/* NARABE の見た目。並べる画面と結果の画面は review2/mock3 の案A、入口・待合室・遊び方は review2/mock2 から写した。
   遊ぶ画面は「いちばん上の帯・お題・禁止の1行・列・下の台」の5つを縦に積み、画面の高さちょうどに収める。
   列の行の高さは、画面の高さから他の部品の高さを引いた残りを人数で割って決める（app.js の layout）。
   場面が変わっても部品の高さは変えない。お知らせは下の台の決まった枠の中に重ねて出す。
   動きは transform と opacity だけで作る（幅・高さ・余白は transition で動かさない）。 */
:root {
  --sky: #DDF0FA;
  --navy: #17233F;
  --navy-d: #0A1226;
  --soft: #EAF3F9;
  --white-d: #B9D2E3;
  --road: #FFF9EA;
  --road-edge: #E8D6AA;
  --grass: #A6D783;
  --grass-far: #C4E5A8;
  --grass-d: #7DB85A;
  --yellow: #FFD54A;
  --yellow-d: #D6A51C;
  --green: #2F9E55;
  --red: #E4483A;
  --sub: #4A5874;
  --gone: #D3DCE7;
  --back-in: inset 0 0 0 3px #17233F, inset 0 0 0 4.5px #5D74A4;
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M0 0 10 10M10 0 0 10' stroke='%23455C8C' stroke-width='1.3'/%3E%3C/svg%3E") center / 9px 9px;
  --n: 4; --rh: 56px; --ch: 44px; --cw: 44px; --roadw: 62px; --rightw: 96px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sky);
  color: var(--navy);
  font-family: "LINE Seed JP", "Hiragino Sans", sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  line-break: strict;
}
b, strong { font-weight: 800; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; }

/* 文を意味のまとまりで区切った1つ分。まとまりの中では改行せず、まとまりとまとまりのあいだでだけ改行する（app.js の ph） */
.ck { display: inline-block; white-space: nowrap; }
.nw { white-space: nowrap; }

.num {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-variation-settings: "wdth" 75, "opsz" 96;
  display: inline-block;
  line-height: 1;
}

/* 写真を撮るときと、試すときは、CSS の動きを止める */
body.still *, body.still *::before, body.still *::after { transition: none !important; animation: none !important; }

/* 空の雲（TOP と同じ形）。飾りなので押せず、字の後ろに置く */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cl { position: absolute; width: var(--w); height: calc(var(--w) * .26); border-radius: 999px; background: #fff; opacity: .9; animation: cloud 30s ease-in-out infinite alternate; }
.cl::before, .cl::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cl::before { left: 16%; bottom: 35%; width: 36%; aspect-ratio: 1; }
.cl::after { left: 44%; bottom: 22%; width: 30%; aspect-ratio: 1; }
.cl.c1 { --w: 120px; top: 30%; right: -40px; opacity: .8; }
.cl.c2 { --w: 84px; top: 58%; left: -40px; animation-delay: -12s; opacity: .7; }
@keyframes cloud { from { transform: translateX(0); } to { transform: translateX(-18px); } }

/* つながりの帯（切れたときだけ、画面のいちばん上に重ねる） */
#net { position: fixed; left: 0; right: 0; top: 0; z-index: 60; padding: 6px 16px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; }
#net[hidden] { display: none; }
/* 短いお知らせ（入口と待合室で使う） */
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; max-width: 398px; margin: 0 auto; padding: 10px 14px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 3px 0 var(--navy-d); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s cubic-bezier(0.2,0,0,1); pointer-events: none; }
#toast.on { opacity: 1; transform: translateY(0); }

/* 画面全体 */
#app { position: relative; z-index: 2; max-width: 430px; margin: 0 auto; }
/* 遊ぶ画面は高さを画面の高さに固定し、5つの部品を縦に積む */
#app.game { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
/* 入口と待合室は、ふつうのページ（待合室は下へスクロールして遊び方を読む） */
#app.page { padding: 10px 16px 24px; }

/* ---------- いちばん上の帯 ---------- */
.bar { flex: none; display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 12px 0 16px; }
.sc { display: flex; align-items: baseline; }
.sc .lb { font-size: 13px; font-weight: 700; color: var(--sub); margin-right: 5px; }
.sc .u { font-size: 13px; font-weight: 700; color: var(--sub); }
.nb { position: relative; display: inline-grid; height: 32px; align-items: end; padding: 0 2px; border-radius: 8px; }
.nb .num { grid-area: 1 / 1; font-size: 29px; color: var(--green); font-variant-numeric: tabular-nums; text-align: center; padding-bottom: 3px; }
.nb.zero .num { color: #8C99AF; }
.sc.best .nb .num { color: var(--navy); }
.nb .recbg { grid-area: 1 / 1; position: absolute; inset: 0; border-radius: 8px; background: var(--yellow); opacity: 0; }
.nb.newrec .recbg { opacity: 1; }
.bar .right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.code-s { font-size: 11px; font-weight: 700; color: var(--sub); white-space: nowrap; }
.code-s .num { font-size: 16px; color: var(--navy); margin-left: 3px; }
/* 「遊び方」は押せる範囲を 44px の高さにし、白い丸みのあるボタンの形はその中に描く */
.howto-btn { position: relative; isolation: isolate; height: 44px; min-width: 64px; padding: 0 14px; border: 0; background: none; font-size: 13px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.howto-btn::before { content: ""; position: absolute; left: 2px; right: 2px; top: 6px; bottom: 7px; border-radius: 99px; background: #fff; box-shadow: 0 3px 0 var(--white-d); z-index: -1; }
/* 幅380px 未満では、連続成功と最高記録のラベルを回数の上に置き、帯の幅に「遊び方」まで収める */
@media (max-width: 379px) {
  .bar { gap: 10px; }
  .sc { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; }
  .sc .lb { grid-column: 1 / -1; font-size: 11px; line-height: 1.1; margin: 0 0 -2px; }
  .nb { height: 30px; }
  .nb .num { font-size: 26px; }
}
/* 幅380〜399px で回数が2けたになるときは、帯の中のすき間を詰める */
@media (min-width: 380px) and (max-width: 399px) {
  .bar.two { gap: 8px; }
  .bar.two .sc .lb { margin-right: 3px; }
  .bar.two .right { gap: 2px; }
}

.tag { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 0 9px; border-radius: 99px; background: var(--navy); color: #fff; white-space: nowrap; }
.tag.light { background: #fff; color: var(--navy); }

/* ---------- お題（白い札にのせる。1〜2行）と禁止の1行 ----------
   お題は遊ぶ画面でいちばん大きい字（既定 21px。app.js の TTF）。列の行の高さが矢印のボタンの高さより低くなる画面だけ、app.js の layout が小さくする */
.topic { flex: none; display: flex; align-items: flex-start; gap: 8px; margin: 2px 16px 0; padding: 6px 10px 7px 7px; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--white-d); }
.topic .tag { flex: none; font-size: 12px; line-height: 20px; padding: 0 8px; margin-top: calc((var(--ttf, 21px) * 1.3 - 20px) / 2); }
.topic .tt { font-size: var(--ttf, 21px); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; min-width: 0; }
.ban { flex: none; display: flex; align-items: center; gap: 6px; height: 22px; margin: 4px 0 0; padding: 0 16px; font-size: 12.5px; font-weight: 700; color: var(--sub); }
.ban svg { flex: none; width: 15px; height: 15px; }

/* ---------- 列 ---------- */
.board { flex: 1 1 0; min-height: 0; position: relative; display: flex; flex-direction: column; justify-content: center; padding: 2px 16px; }
.list { --eh: 36px; position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr var(--roadw) var(--rightw); column-gap: 8px; grid-template-rows: var(--eh) calc(var(--rh) * var(--n)) var(--eh); }
/* 列の上と下のはし。紺の札（小さい数字／1に近い）と、お題のそのはしにあたる句を1行に並べる */
.ends { grid-column: 1 / -1; position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.ends.top { grid-row: 1; }
.ends.bot { grid-row: 3; }
.ends .eb { flex: none; display: flex; flex-direction: column; justify-content: center; height: calc(var(--eh) - 2px); padding: 0 8px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.ends .eb b { font-size: 12.5px; }
.ends .ep { font-size: 17px; font-weight: 800; color: var(--navy); line-height: 1.3; }
#app.short .ends .eb { font-size: 11px; }
#app.short .ends .eb b { font-size: 11.5px; }
#app.short .ends .ep { font-size: 15.5px; }
/* 上の札から下の札へ、列の左を下向きに伸びる矢印（下へ行くほど数字が大きい） */
.gauge { grid-column: 1; grid-row: 2; position: relative; z-index: 1; justify-self: start; width: 10px; margin: 1px 0 4px 8px; transform-origin: top; pointer-events: none; }
.gauge::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 6px; width: 2px; border-radius: 2px; background: #7F92B0; }
.gauge::after { content: ""; position: absolute; left: 0; bottom: 0; border-style: solid; border-width: 8px 5px 0; border-color: #7F92B0 transparent transparent; }
.rows { grid-column: 1 / -1; grid-row: 2; list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-rows: repeat(var(--n), var(--rh)); }
/* 砂色の小道。カードはこの上に乗る */
.road { grid-column: 2; grid-row: 2; margin: -3px 0; position: relative; z-index: 0; border-radius: 16px; background: var(--road); border: 3px solid var(--road-edge); overflow: hidden; transform-origin: top; transition: border-color .3s; }
.road .fill { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: var(--grass); transform-origin: top; transform: scaleY(0); }
.road .redseg { position: absolute; left: 0; right: 0; top: 0; height: 0; background: #EF7F73; transform-origin: top; }
.list.locked .road { border-color: var(--navy); }
.row { position: relative; display: grid; grid-template-columns: 1fr var(--roadw) var(--rightw); column-gap: 8px; align-items: center; height: var(--rh); cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* 選んだ行の白い帯は、小道の下に敷く（z-index -1 で列の重なりのいちばん下に置く） */
.row::before { content: ""; position: absolute; left: -10px; right: -10px; top: 3px; bottom: 3px; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--white-d); z-index: -1; opacity: 0; transition: opacity .2s; }
.row.sel::before { opacity: 1; }
.row.moved:not(.sel)::before { opacity: 1; background: #F2F8FC; box-shadow: none; }
/* たとえを比べるよう促す2人の行。名前の後ろに白い帯を敷く */
.row::after { content: ""; position: absolute; left: -10px; top: 4px; bottom: 4px; width: calc(100% - var(--roadw) - var(--rightw) - 6px); border-radius: 12px; background: #fff; box-shadow: 0 0 0 2px var(--navy); z-index: -1; opacity: 0; transition: opacity .25s; }
.row.hint::after { opacity: 1; }
.who { position: relative; z-index: 1; min-width: 0; padding-left: 22px; }
.nmline { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.nm { position: relative; font-size: var(--nmf, 18px); font-weight: 800; line-height: 1.25; white-space: nowrap; transform-origin: left center; }
.nm .pill { position: absolute; left: -8px; right: -8px; top: -2px; bottom: -2px; border-radius: 99px; background: #fff; box-shadow: 0 3px 0 var(--white-d); z-index: -1; opacity: 0; }
.sub { font-size: 11.5px; line-height: 1.3; color: var(--sub); font-weight: 700; white-space: nowrap; }
.sub.mv { color: var(--navy); font-size: 11px; }
.okm { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--green); white-space: nowrap; flex: none; }
.okm svg { width: 16px; height: 16px; flex: none; }
.who.tight .okm .okt { display: none; }
.who.stack .nmline .sub { display: none; }
.cardslot { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; perspective: 520px; }
.rt { position: relative; z-index: 1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; height: 100%; }
.mv-btn { width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--sky); color: var(--navy); box-shadow: 0 3px 0 var(--white-d); display: grid; place-items: center; padding: 0; flex: none; transition: transform .12s cubic-bezier(0.2,0,0,1), opacity .2s; }
.mv-btn:active { transform: translateY(2px); }
.mv-btn:disabled { opacity: .3; cursor: default; }
.mv-btn svg { width: 16px; height: 11px; }
/* 接続が切れた人の行：名前とカードだけを薄くする（矢印はふつうの色で出す） */
.row.off .who, .row.off .cardslot { opacity: .45; }

/* カード。表（.cf）と裏（.cb）を重ねて置き、めくるときは2枚を順に回す */
.card { position: relative; width: var(--cw); height: var(--ch); }
.card > .cb, .card > .cf { position: absolute; inset: 0; border-radius: 9px; display: grid; place-items: center; backface-visibility: hidden; }
.card > .cb { background: var(--navy) var(--lattice); box-shadow: var(--back-in), 0 4px 0 var(--navy-d); }
.card > .cf { background: #fff; box-shadow: 0 4px 0 var(--white-d); visibility: hidden; }
.card.up > .cf { visibility: visible; }
.card.up > .cb { visibility: hidden; }
.card.me > .cf { background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-d); }
.card .num { font-size: calc(var(--ch) * .58); color: var(--navy); }
/* めくる場面では、裏と表の両方を出しておき、回す動きで見せ分ける */
.card.flip > .cf, .card.flip > .cb { visibility: visible; }
.card.gone > .cb { background: var(--gone); box-shadow: 0 4px 0 #AEBBCB; }
.card.gone > .cb svg { width: 62%; height: auto; }
.row.sel .card { transform: scale(1.04); }
.row.sel .card > .cb { box-shadow: var(--back-in), 0 4px 0 var(--navy-d), 0 0 0 2px #fff, 0 0 0 4.5px var(--navy); }
.row.sel .card.me > .cf { box-shadow: 0 4px 0 var(--yellow-d), 0 0 0 2px #fff, 0 0 0 4.5px var(--navy); }
.row.sel .card.gone > .cb { box-shadow: 0 4px 0 #AEBBCB, 0 0 0 2px #fff, 0 0 0 4.5px var(--navy); }
/* 持ち上げたときの白いふちと、順番が逆だったときの赤いふち（重ねて置き、透明度で出す） */
.card > .lift, .card > .ngr { position: absolute; inset: 0; border-radius: 9px; pointer-events: none; opacity: 0; }
.card > .lift { box-shadow: 0 0 0 4px #fff, 0 12px 22px rgba(10,18,38,.25); }
.card > .ngr { box-shadow: 0 5px 0 #B8322A, 0 0 0 3px var(--red); }
.card.ng > .ngr { opacity: 1; }

/* 3、2、1 の白い丸。列の右の空き（矢印の列）のうち、選んだ行より上か下の広いほうに出す */
.cd { position: absolute; z-index: 3; border-radius: 50%; background: #fff; box-shadow: 0 5px 0 var(--white-d); display: grid; place-items: center; }
.cd .num { font-variation-settings: "wdth" 100, "opsz" 96; color: var(--navy); }

/* ---------- 下の台 ---------- */
.dock { flex: none; position: relative; z-index: 6; }
.hill { display: block; width: 100%; height: 14px; margin-bottom: -1px; }
.hill path { fill: var(--grass); }
.hill path.far { fill: var(--grass-far); }
.dock .in { position: relative; background: var(--grass); padding: 3px 16px calc(8px + env(safe-area-inset-bottom)); }
.slot { position: relative; height: 44px; }
.status { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; transition: opacity .2s; }
.status .s1 { font-size: 13px; font-weight: 800; line-height: 1.4; }
.status .s2 { font-size: 12px; line-height: 1.4; }
/* 最初の回の手順（台の文の代わりに出す）。ふつうの台の文より少し大きくする */
.status.guide .s1 { font-size: 13.5px; }
.status.guide .s2 { font-size: 12.5px; font-weight: 700; }
.notice { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 12px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.4; box-shadow: 0 3px 0 var(--navy-d); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s cubic-bezier(0.2,0,0,1); pointer-events: none; }
.notice.on { opacity: 1; transform: translateY(0); }
.slot.noting .status { opacity: 0; }
.btn { position: relative; display: block; width: 100%; height: 48px; margin: 5px 0 0; padding: 0 12px; border: 0; border-radius: 999px; font-size: 17px; font-weight: 800; background: #fff; color: var(--navy); box-shadow: 0 4px 0 var(--white-d); white-space: nowrap; transition: transform .12s cubic-bezier(0.2,0,0,1), opacity .2s; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 4px 0 var(--navy-d); }
.btn:active { transform: translateY(3px); }
.btn:disabled { opacity: .5; cursor: default; }
/* 1人だけOKしていないときに、その人のボタンのまわりを光らせる（光の輪の透明度だけを動かす） */
.btn::after { content: ""; position: absolute; inset: -5px; border-radius: 999px; box-shadow: 0 0 0 3px #fff; opacity: 0; pointer-events: none; }
.btn.glow::after { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
/* 途中で入った人：ボタンの代わりに文を出す（台の高さは変えない） */
.spec { position: absolute; left: 16px; right: 16px; top: 3px; height: 97px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 800; line-height: 1.5; }
/* めくっているあいだ、台に出す枚数の行 */
.counter { position: absolute; left: 16px; right: 16px; top: 3px; height: 97px; pointer-events: none; }
.counter > * { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; }
.counter .c0 { font-size: 15px; font-weight: 800; text-align: center; }
.counter .ck1 .num { font-size: 50px; color: var(--green); font-variation-settings: "wdth" 100, "opsz" 96; min-width: 30px; text-align: right; padding-right: 2px; }
.counter .ck1.grey .num { color: #6F7D93; }
.counter .ck1 .t { font-size: 15px; font-weight: 800; padding-top: 12px; text-align: left; }

/* 数字が近い2枚を比べるとき、画面のほかの部分を紺で暗くする。照らす帯だけを mask-image で透明にする */
.spot { position: fixed; left: 0; right: 0; top: 0; height: 100vh; z-index: 5; background: rgba(10,18,38,.93); opacity: 0; pointer-events: none; }

/* ---------- 結果の画面 ---------- */
.mode-result .road { border-color: var(--grass-d); }
.mode-result.ok .road { background: var(--grass); border-color: var(--green); }
.xmark { position: absolute; z-index: 4; width: 22px; height: 22px; }
.mode-result .nmline .sub { margin-left: 2px; }
/* 結果の画面は、右の数直線で数字の大きさを見せるので、列の左の矢印を出さず、名前の欄を広くとる */
.mode-result .gauge { display: none; }
.mode-result .who { padding-left: 2px; }
.ov { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.chip { position: absolute; z-index: 4; width: 34px; height: 22px; border-radius: 6px; background: #fff; display: grid; place-items: center; box-shadow: 0 2px 0 var(--white-d); }
.chip .num { font-size: 15px; }
.chip.me { background: var(--yellow); box-shadow: 0 2px 0 var(--yellow-d); }
.chip.bad { box-shadow: 0 2px 0 var(--white-d), 0 0 0 2px var(--red); }
.chip.me.bad { box-shadow: 0 2px 0 var(--yellow-d), 0 0 0 2px var(--red); }
.nl-t { position: absolute; z-index: 4; font-size: 11px; font-weight: 700; color: var(--sub); white-space: nowrap; }
.nl-e { position: absolute; z-index: 4; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 11px; color: var(--sub); line-height: 1; white-space: nowrap; }
.jk { width: 22px; height: 22px; margin-right: auto; margin-left: 4px; }
.ngl { font-size: 13px; font-weight: 800; color: var(--red); white-space: nowrap; margin-right: auto; margin-left: 6px; }

/* 成功の大きな数字。列の右に「成功！」、数字、「回連続で成功」を縦に並べる */
.st { position: absolute; z-index: 4; display: flex; flex-direction: column; align-items: center; }
.st-h { font-size: 24px; font-weight: 800; color: var(--green); line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; }
.bn { position: relative; display: inline-grid; border-radius: 999px; margin-top: 10px; }
.bn .bg { position: absolute; inset: 0; border-radius: 999px; }
.bn.glow .bg { background: rgba(47,158,85,.1); box-shadow: 0 0 0 6px rgba(47,158,85,.08); }
.bn.rec .bg { background: var(--yellow); box-shadow: 0 0 0 6px rgba(255,213,74,.4), 0 0 0 13px rgba(255,213,74,.16); }
.bn .num { position: relative; font-size: var(--bnf, 80px); color: var(--green); font-variation-settings: "wdth" 100, "opsz" 96; text-align: center; padding: 4px calc(var(--bnf) * .2) 0; }
.bn.rec .num { color: var(--navy); padding: 4px calc(var(--bnf) * .22) 0; }
.stamp { position: absolute; top: -24px; right: -14px; padding: 2px 7px; border-radius: 8px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 800; box-shadow: 0 3px 0 var(--white-d); transform: rotate(-8deg); white-space: nowrap; line-height: 1.5; }
.st-u { font-size: 14px; font-weight: 800; color: var(--green); line-height: 1.3; margin-top: 10px; white-space: nowrap; }
.st.isrec .bn { margin-top: 28px; }
.st.isrec .st-u { color: var(--navy); margin-top: 16px; }
#confetti { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#confetti i { position: absolute; left: 0; top: 0; }

/* 結果の台（成功は芝、失敗は砂の色の丘） */
.sheet { flex: none; position: relative; z-index: 6; --sh: var(--grass); --sh-far: var(--grass-far); }
.sheet.ng { --sh: var(--road); --sh-far: #F4E7C6; }
.sheet .hill path { fill: var(--sh); }
.sheet .hill path.far { fill: var(--sh-far); }
.sheet .in { background: var(--sh); padding: 4px 18px calc(10px + env(safe-area-inset-bottom)); }
.rs-h { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 0; }
.rs-main { font-size: 17px; font-weight: 800; line-height: 1.4; margin: 0; }
.rs-why { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.rs-why b { font-family: "Bricolage Grotesque", sans-serif; font-variation-settings: "wdth" 75; font-size: 17px; }
.rs-next { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; }
.sheet .btn { margin-top: 8px; }
.rs-note { margin: 5px 0 0; font-size: 11.5px; color: var(--sub); text-align: center; line-height: 1.4; }
.sheet.ok .rs-note { color: var(--navy); }

/* ---------- 入口 ---------- */
.logo { margin: 6px 0 0; display: flex; align-items: baseline; gap: 4px; }
.logo .num { font-size: 46px; letter-spacing: .01em; }
.logo .kari { font-size: 15px; font-weight: 800; color: var(--sub); }
.hero { position: relative; margin: 8px 0 4px; height: 76px; }
.hero .hroad { position: absolute; left: 0; right: 0; top: 8px; height: 64px; border-radius: 999px; background: var(--road); border: 3px solid var(--road-edge); overflow: hidden; }
.hero .hroad i { position: absolute; inset: 0; background: var(--grass); transform-origin: left; transform: scaleX(0); }
.hero .hc { position: absolute; top: 15px; left: 0; --ch: 50px; --cw: 42px; }
.hero .hc .num { font-size: 28px; }
.hero .hok { position: absolute; right: 6px; top: -8px; display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--green); background: #fff; padding: 2px 10px 2px 6px; border-radius: 99px; box-shadow: 0 2px 0 var(--white-d); opacity: 0; }
.hero .hok svg { width: 16px; height: 16px; }
.lead { margin: 8px 0 6px; font-size: 14px; line-height: 1.55; }
.field { display: block; margin: 8px 0 6px; font-weight: 800; font-size: 13px; }
.field input { display: block; width: 100%; height: 46px; margin-top: 4px; padding: 0 14px; font-size: 17px; border: 2px solid var(--white-d); border-radius: 14px; background: #fff; color: var(--navy); font-weight: 400; }
.field input:focus { outline: none; border-color: var(--navy); }
.page .btn { margin-top: 8px; }
.or { margin: 16px 0 0; color: var(--sub); font-size: 13px; text-align: center; display: flex; align-items: center; gap: 10px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--white-d); border-radius: 2px; }
.note { font-size: 11.5px; color: var(--sub); margin: 12px 0 0; line-height: 1.5; }
@media (min-height: 700px) {
  .logo { margin-top: 18px; }
  .logo .num { font-size: 56px; }
  .hero { height: 96px; margin: 14px 0 8px; }
  .hero .hroad { height: 80px; }
  .hero .hc { top: 22px; --ch: 56px; --cw: 48px; }
  .hero .hc .num { font-size: 32px; }
  .lead { font-size: 15px; margin: 12px 0 10px; }
  .field { margin: 12px 0 8px; font-size: 14px; }
  .field input { height: 50px; }
  .or { margin-top: 22px; }
  .note { margin-top: 18px; font-size: 12px; }
}

/* ---------- 待合室 ---------- */
.sign { margin: 6px auto 0; width: 76%; padding: 8px 12px 10px; background: #fff; border-radius: 16px; text-align: center; box-shadow: 0 4px 0 var(--white-d); transform: rotate(-1.5deg); }
.sign .lb { font-size: 13px; color: var(--sub); font-weight: 800; }
.sign .num { font-size: 44px; letter-spacing: .12em; display: block; margin-top: 2px; }
.sign-note { margin: 8px 0 0; font-size: 13px; color: var(--sub); text-align: center; }
.page h2 { font-size: 14px; margin: 16px 0 6px; color: var(--sub); }
.members { display: flex; flex-wrap: wrap; gap: 6px; }
.members span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px 5px 8px; border-radius: 99px; background: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 2px 0 var(--white-d); white-space: nowrap; }
.members span.off { opacity: .55; }
.members svg { width: 14px; height: 18px; flex: none; }
.members small { font-weight: 400; color: var(--sub); font-size: 11px; }
.lobby-go { margin-top: 12px; }
.count { text-align: center; font-size: 13px; font-weight: 700; margin: 6px 0 0; }
.now { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: #fff; }
.now p { margin: 4px 0 0; font-size: 14px; font-weight: 800; line-height: 1.5; }
.now.alert { background: var(--navy); color: #fff; }
.now.alert .tag { background: #fff; color: var(--navy); }
.btn.small { height: 44px; font-size: 15px; }

/* ---------- 遊び方 ---------- */
.headline { font-size: 17px; font-weight: 800; line-height: 1.5; margin: 10px 0 0; }
.ex { margin-top: 10px; padding: 12px 14px 14px; background: #fff; border-radius: 18px; }
.ex-topic { font-size: 12px; color: var(--sub); line-height: 1.5; }
.ex-topic b { display: block; font-size: 16px; color: var(--navy); }
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.steps > li { position: relative; padding: 12px 0 0 30px; counter-increment: s; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.steps p { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.55; }
.steps p small { display: block; font-size: 12.5px; font-weight: 400; color: var(--sub); margin-top: 2px; }
.steps p.why { font-size: 12.5px; font-weight: 400; color: var(--sub); margin-top: 6px; }
.fig { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; align-items: flex-end; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--sub); white-space: nowrap; }
.mini .card { --cw: 34px; --ch: 42px; }
.mini .card .num { font-size: 21px; }
.say { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--sub); white-space: nowrap; }
.say .card { --cw: 24px; --ch: 30px; }
.say .card > .cb, .say .card > .cf { border-radius: 6px; }
.say .card .num { font-size: 15px; }
.say q { quotes: "「" "」"; font-size: 14px; font-weight: 800; color: var(--navy); }
.mroad { position: relative; margin-top: 8px; padding: 6px 0; }
.mroad::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 48px; border-radius: 999px; background: var(--road); border: 2px solid var(--road-edge); }
.mroad.done::before { background: var(--grass); border-color: var(--grass-d); }
.mroad > div { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0 3px 7px; white-space: nowrap; }
.mroad .card { --cw: 34px; --ch: 38px; }
.mroad .card > .cb, .mroad .card > .cf { border-radius: 7px; }
.mroad .card .num { font-size: 20px; }
.mroad q { quotes: "「" "」"; color: var(--sub); }
.mroad .ar { margin-left: auto; display: flex; gap: 4px; flex: none; }
.mroad .ar i { width: 24px; height: 24px; border-radius: 7px; background: var(--soft); display: grid; place-items: center; }
.mroad .ar svg { width: 10px; height: 7px; }
.mroad .pick .card > * { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.figok { font-size: 13px; color: var(--green); font-weight: 800; margin: 6px 0 0 2px; display: flex; gap: 4px; align-items: center; }
.figok svg { width: 16px; height: 16px; }
.rule { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 9px 12px; background: #fff; border-radius: 12px; font-size: 13px; font-weight: 800; line-height: 1.5; }
.rule svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.rule p { margin: 0; }
.rule p + p { margin-top: 6px; font-weight: 400; }
.goal { font-size: 14px; margin: 10px 0 0; }
.extra-h { font-size: 14px; margin: 16px 0 4px; color: var(--navy); }
.extra { margin: 0; padding-left: 1.4em; font-size: 14px; }
.extra li { margin: 4px 0; }
@media (max-width: 343px) {
  .ex { padding-left: 10px; padding-right: 10px; }
  .mroad > div { gap: 6px; }
}
/* 遊んでいる途中に開く遊び方。画面全体に重ね、中だけをスクロールする */
#howto { position: fixed; inset: 0; z-index: 40; background: var(--sky); overflow-y: auto; overscroll-behavior: contain; }
#howto[hidden] { display: none; }
#howto .wrap { max-width: 430px; margin: 0 auto; padding: 0 0 24px; }
#howto .body { padding: 0 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sheet-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
body.dealing .row::before { opacity: 0 !important; }
.who .sub.blk { display: none; }
.who.stack .sub.blk { display: block; }
.spec[hidden] { display: none; }
/* 高さ600px より低い画面では、入口を少し詰めて、スクロールせずに「部屋に入る」まで見せる */
@media (max-height: 600px) {
  .logo { margin-top: 0; }
  .logo .num { font-size: 40px; }
  .hero { height: 62px; margin: 4px 0 2px; }
  .hero .hroad { top: 4px; height: 56px; }
  .hero .hc { top: 9px; --ch: 44px; --cw: 38px; }
  .hero .hc .num { font-size: 25px; }
  .lead { margin: 4px 0 2px; font-size: 13.5px; line-height: 1.5; }
  .field { margin: 6px 0 4px; }
  .field input { height: 44px; }
  .page .btn { margin-top: 6px; }
  .or { margin-top: 10px; }
  .note { margin-top: 8px; font-size: 11px; }
}
html.fixed, html.fixed body { overflow: hidden; height: 100%; }

/* 列の行の高さが矢印のボタンの高さ（44px）より低くなる画面（375×548 の6人など）だけ、帯・両はし・下の台を少し詰める（app.js の layout が付ける）。
   「遊び方」のボタンは 44px のまま、帯の下に 4px はみ出す */
#app.short .bar { height: 40px; align-items: flex-start; }
#app.short .bar .sc { align-self: center; }
#app.short .topic { margin-top: 4px; padding-top: 5px; padding-bottom: 6px; }
#app.short .ban { height: 20px; margin-top: 3px; }
#app.short .list { --eh: 30px; }
#app.short .hill { height: 10px; }
#app.short .dock .in { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
#app.short .slot { height: 40px; }
#app.short .dock .btn { height: 46px; margin-top: 4px; }
#app.short .spec, #app.short .counter { height: 90px; }
/* 詰めた画面では、お題の札の左右の余白と「お題」の札を小さくし、いちばん長いお題（19文字）でも 15px で1行に収める */
#app.short .topic { gap: 7px; padding-left: 6px; padding-right: 8px; }
#app.short .topic .tag { font-size: 11px; padding: 0 7px; }
/* 結果の画面は台が高く、列の行の高さが足りなくなるので、両はしを1行にする
   （紺の札は「小さい数字」「大きい数字」だけ。1 と 100 は失敗のときの数直線で見せる） */
#app .mode-result .list { --eh: 24px; }
#app .mode-result .ends .eb { flex-direction: row; height: 20px; padding: 0 7px; border-radius: 7px; }
#app .mode-result .ends .eb > span { display: none; }
#app .mode-result .ends .eb b { font-size: 11.5px; }
#app .mode-result .ends .ep { font-size: 14.5px; }
/* 詰めた画面の結果の台（失敗の理由が3行になる 375×548 の6人など） */
#app.short .sheet .in { padding-top: 2px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
#app.short .sheet .btn { margin-top: 5px; }
#app.short .rs-note { margin-top: 3px; }

/* ---------- PLAYROOM の部品（本番で足したもの） ---------- */
/* 入口の右上の「PLAYROOM へ戻る」。ロゴの行の右の空きに置くので、入口の高さは変わらない */
.back { position: absolute; top: 12px; right: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: #fff; color: var(--navy); font-family: "Bricolage Grotesque", "LINE Seed JP", sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .02em; text-decoration: none; box-shadow: 0 2px 0 var(--white-d); }
.back svg { flex: none; }
@media (min-height: 700px) { .back { top: 22px; } }
/* 待合室の「LINEで呼ぶ」「リンクをコピー」。合言葉の札のすぐ下に横に並べる */
.invite { display: flex; gap: 8px; margin: 10px 0 0; }
.invite .btn { margin: 0; flex: 1 1 0; min-width: 0; font-size: 15px; }
.btn.line { background: #06C755; color: #fff; box-shadow: 0 4px 0 #04963F; }
/* 広告の枠（/game-ads.js が中身を入れる）。出さない人には高さ0のまま */
.adslot:empty { display: none; }
.adslot { margin-top: 12px; }
/* 結果の台の感想の入口（/feedback.js が1行を描く）。1行ぶんの高さだけ取り、開いたときは上へ伸ばして列の上に重ねる */
.fbwrap { position: relative; height: 44px; margin-top: 0; }
.fbwrap .fb { position: absolute; left: -18px; right: -18px; bottom: 0; padding: 0 18px; background: var(--sh); color: var(--navy); text-align: center; max-height: calc(100dvh - 120px); overflow-y: auto; }
#app.short .rs-note + .fbwrap { margin-top: -2px; }
/* LINE・X のアプリ内ブラウザでは、入口と待合室の下に逃げを作る（下のボタンがツールバーに隠れないように）。遊ぶ画面には付けない */
:root[data-inapp="1"] #app.page::after { content: ""; display: block; height: calc(34vh + env(safe-area-inset-bottom)); }
