/**
 * スロ塾の暇ゲー（/game/）「絶対ゴールさせないゲーム」の見た目（page-game.php・js/hima-game.js）
 * 2026-09-29 作り変え。見た目はたかどらくんのデザインシート（紺の見出し帯・白いカード・王冠の金）に合わせる。
 * ゲーム画面なので暗い1色で固定（サイトの昼夜の切り替えは使わない）。
 */
:root { color-scheme: dark; --navy: #1c2a44; --navy-2: #0f1624; --gold: #f4c430; --ink: #1c2233; --paper: #ffffff; --red: #d62d2e; --mute: #5b6477; }
html, body { height: 100%; }
body.hima-body { margin: 0; background: var(--navy-2); color: #fff; font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif;
  overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.app { position: relative; height: 100%; display: flex; flex-direction: column; }
.hud { flex: none; display: flex; align-items: center; gap: 5px; padding: 8px 8px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(15, 22, 36, .96); border-bottom: 3px solid var(--gold); }
.hud button { font: inherit; }
.chip { background: #26324b; color: #fff; font-weight: 800; font-size: 13px; padding: 7px 9px; border-radius: 9px; border: 0; white-space: nowrap;
  font-variant-numeric: tabular-nums; text-decoration: none; line-height: 1.2; }
.chip b { color: var(--gold); }
.chip--btn { cursor: pointer; }
.chip--lap { background: var(--gold); color: var(--ink); }
.sp { flex: 1; }
.stage { position: relative; flex: 1; min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }   /* 引っ張ってもページが動かない */

/* 札（カード） */
.ov { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 22, .55); overflow-y: auto; }
.ov--pause { background: rgba(8, 12, 22, .35); }
.card { width: min(340px, 100%); background: var(--paper); color: var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 0 rgba(0, 0, 0, .35);
  border: 3px solid var(--navy-2); position: relative; }
.card__head { background: var(--navy); color: #fff; font-weight: 800; font-size: 15px; padding: 12px 16px; letter-spacing: .04em; }
.card__body { padding: 16px 18px 18px; display: grid; gap: 10px; text-align: center; }
.card h1 { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.25; text-wrap: balance; }
.card p { margin: 0; font-size: 14px; line-height: 1.6; }
.card .how { background: #eef6e4; color: #3f6b12; border-radius: 12px; padding: 8px 10px; font-weight: 800; }
.card .shi { font-size: 56px; font-weight: 900; color: var(--red); line-height: 1; }
.card .msg { font-weight: 800; font-size: 16px; }
.card .hint { background: #fff6d6; border-radius: 12px; padding: 8px 10px; text-align: left; }
.card .hint b { display: block; font-size: 12px; color: #8a5e00; }
.card .small { color: var(--mute); font-size: 12px; }
.taka { position: absolute; right: 8px; top: -6px; width: 64px; height: auto; }

/* ボタン */
.btn { font: inherit; font-weight: 900; font-size: 20px; color: var(--ink); background: var(--gold); border: 3px solid var(--ink); border-radius: 14px;
  padding: 12px 18px; box-shadow: 0 4px 0 var(--ink); cursor: pointer; position: relative; transition: transform .12s ease; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn--sub { background: #e8ebf1; font-size: 16px; }
.btn--small { font-size: 15px; padding: 8px 12px; }
.btn:focus-visible, .chip--btn:focus-visible, .link:focus-visible { outline: 3px solid #7cc4ff; outline-offset: 2px; }
.link { font: inherit; font-weight: 800; font-size: 14px; color: var(--mute); background: none; border: 0; text-decoration: underline; cursor: pointer; justify-self: center; padding: 4px; }
.link--strong { color: #8a5e00; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; font-size: 16px; padding: 10px 8px; }
.yesno { display: flex; gap: 10px; justify-content: center; }
.yesno .btn { font-size: 18px; flex: 1; }

/* 結果 */
.result { display: flex; justify-content: center; gap: 18px; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; }
.result em { font-style: normal; font-size: 26px; color: #b42318; }
.found { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; text-align: left; font-size: 11px; max-height: 170px; overflow-y: auto; }
.found span { color: #9aa3b5; }
.found span.on { color: var(--ink); font-weight: 800; }
.card .rankline { font-weight: 800; color: var(--navy); }

/* ランキング */
.card--rank { max-height: 100%; display: flex; flex-direction: column; }
.card--rank .card__body { overflow-y: auto; }
.card .me { font-weight: 800; }
.me__main { display: block; font-size: 20px; font-weight: 900; }
.me__sub { display: block; font-size: 12px; color: var(--mute); }
.nameform { display: grid; gap: 6px; text-align: left; font-size: 12px; color: var(--mute); }
.nameform__row { display: flex; gap: 6px; }
.nameform input { flex: 1; min-width: 0; font: inherit; font-size: 16px; font-weight: 800; color: var(--ink); background: #fff; color-scheme: light; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; }
.ranklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.ranklist li { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; gap: 2px 8px; padding: 6px 8px; border-radius: 10px; background: #f2f4f8; font-variant-numeric: tabular-nums; }
.ranklist li.is-me { background: #fff1bf; }
.ranklist__no { font-weight: 900; color: var(--navy); }
.ranklist__name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranklist__pt { font-weight: 900; color: #b42318; }
.ranklist__sub { grid-column: 2 / 4; font-size: 11px; color: var(--mute); }
.ranklist__empty { display: block !important; text-align: center; color: var(--mute); background: none !important; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
