:root {
  --gold: #ffd76a;
  --gold-hi: #fff4c4;
  --gold-deep: #c48a1c;
  --ink: #fff8ea;
  --muted: #c9bff0;
  --panel: rgba(16, 8, 46, 0.72);
  --panel-strong: rgba(12, 5, 36, 0.9);
  --line: rgba(255, 215, 106, 0.45);
  --pink: #ff3fd0;
  --cyan: #36d6ff;
  --board-h: 180px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  color: var(--ink);
  background: #07031a;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: inherit; }

/* ---------- 上の帯 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 16px 18px;
  background: linear-gradient(to bottom, rgba(7, 3, 26, 0.88), rgba(7, 3, 26, 0));
}
/* ロゴは Higgsfield で生成した絵(assets/logo/)。ヘッダーは1行の横長、遊び方の画面は2段 */
.logo { margin: 0; line-height: 0; flex: none; }
.logo img { display: block; height: 46px; width: auto; filter: drop-shadow(0 0 10px rgba(255, 63, 208, 0.35)); user-select: none; }
.rules-logo { display: block; width: min(320px, 80%); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 0 16px rgba(255, 63, 208, 0.4)); }
/* ---------- 金の縁の宝石のような部品(クレジット・上のボタン・ベット欄のボタン) ----------
   縁は金のグラデーション(border-box)、中は紫のガラス(padding-box)。上半分に光沢、下に影 */
.wallet, .icon-btn, button.lang-button, .btn:not(.primary) {
  --rim: linear-gradient(160deg, #fffbe6 0%, #ffd76a 22%, #9c6414 48%, #ffe9a0 68%, #b77a18 86%, #fff1b8 100%);
  --glass: radial-gradient(130% 110% at 50% 0%, rgba(118, 66, 255, 0.62), rgba(34, 12, 92, 0.94) 55%, rgba(10, 3, 34, 0.98));
  position: relative; border: 2px solid transparent; background: var(--glass) padding-box, var(--rim) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 5px 14px rgba(0, 0, 0, 0.55), 0 0 16px rgba(255, 63, 208, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -8px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px); isolation: isolate;
}
/* 上半分の光沢 */
.wallet::after, .icon-btn::after, button.lang-button::after, .btn:not(.primary)::after {
  content: ""; position: absolute; inset: 1px 1px 52% 1px; border-radius: 999px 999px 40% 40% / 999px 999px 30% 30%; z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.02)); pointer-events: none;
}
.wallet { margin-left: auto; display: flex; align-items: baseline; gap: 8px; padding: 7px 18px; white-space: nowrap; border-radius: 999px; }
.wallet-label { font-size: 12px; font-weight: 700; color: var(--muted); }
#balance {
  font: 900 20px/1 var(--display); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 35%, var(--gold) 62%, #d99a2a 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 215, 106, 0.55)) drop-shadow(0 2px 0 rgba(60, 20, 0, 0.9));
}
#balance.bump { animation: bump 0.6s ease-out; }
@keyframes bump { 30% { transform: scale(1.25); filter: drop-shadow(0 0 14px #fff); } }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer; flex: none;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.icon-btn:hover, button.lang-button:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 215, 106, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
.icon-btn:active, button.lang-button:active { transform: translateY(1px) scale(0.96); }
/* 音を消しているときは縁を銀にする(アイコンはスピーカーに × ) */
.icon-btn[aria-pressed="true"] { --rim: linear-gradient(160deg, #f4f4ff, #a9a6c8 30%, #55526e 55%, #c9c6e4 80%, #77748f); filter: saturate(0.6); }

/* アイコン(SVG の形をマスク --i にして、金のグラデーションで塗る) */
.ico { position: relative; display: inline-block; flex: none; width: 20px; height: 20px; filter: drop-shadow(0 0 4px rgba(255, 200, 90, 0.6)) drop-shadow(0 1px 0 rgba(60, 20, 0, 0.9)); }
.ico::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #fffdf0 0%, #ffe9a0 30%, #ffc94a 58%, #d48a1e 100%);
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.ico-help { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.3 8.6a3.8 3.8 0 1 1 5.6 3.3c-1.1.6-1.9 1.4-1.9 2.6v.7' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'/><circle cx='12' cy='19.3' r='1.9'/></svg>"); }
.ico-sound { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 9.2h3.6L11.8 5v14l-5.2-4.2H3z'/><path d='M15.2 9a4.2 4.2 0 0 1 0 6M18 6.3a8.2 8.2 0 0 1 0 11.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/></svg>"); }
.ico-mute { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 9.2h3.6L11.8 5v14l-5.2-4.2H3z'/><path d='M15.5 9.5l5 5M20.5 9.5l-5 5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>"); }
.ico-close { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.5 6.5l11 11M17.5 6.5l-11 11' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>"); }
.ico-clear { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9.2' fill='none' stroke='black' stroke-width='2'/><path d='M8.6 8.6l6.8 6.8M15.4 8.6l-6.8 6.8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>"); }
.ico-rebet { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5.2 13.2a7 7 0 1 0 2.3-6.4' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/><path d='M3.6 3.8l.6 5.9 5.8-1.4z'/></svg>"); }
.ico-double { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 12.5l6-6 6 6M6 19l6-6 6 6' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.icon-btn .ico { width: 21px; height: 21px; }
/* アラビア語(右から左)でも、ゲームの盤面(マスの並び・配当・チップ・リール・ボーナスの場)は左から右のまま。
   右から左にするのは文章(案内・遊び方・注意書き)だけ */
:root[dir="rtl"] :is(.topbar, .reel, .spots, .controls, .history, .bet-bar, .bonus-head, .bonus-field, .win-mult) { direction: ltr; }
/* 言語ボタンと一覧(language-menu.js。SOUL DUEL と同じ部品を、この卓の金と紫に合わせた) */
button.lang-button {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 11px; flex: none; cursor: pointer;
  border-radius: 999px; color: var(--ink); font: 700 12px/1 inherit; white-space: nowrap; transition: transform 0.15s, box-shadow 0.2s;
}
/* 地球儀は language-menu.js の SVG の代わりに、金のアイコン(形は同じ)を出す */
.lang-button .lang-globe { display: none; }
.lang-button::before {
  content: ""; flex: none; width: 19px; height: 19px;
  background: linear-gradient(180deg, #fffdf0 0%, #ffe9a0 30%, #ffc94a 58%, #d48a1e 100%);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3c2.8 2.6 4 5.6 4 9s-1.2 6.4-4 9c-2.8-2.6-4-5.6-4-9s1.2-6.4 4-9z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3c2.8 2.6 4 5.6 4 9s-1.2 6.4-4 9c-2.8-2.6-4-5.6-4-9s1.2-6.4 4-9z'/></svg>") center / contain no-repeat;
}
.lang-button b {
  font: 900 13px/1 var(--display); letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 40%, var(--gold) 70%, #d99a2a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lang-button span { max-width: 8em; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.lang-button[aria-expanded="true"] { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 215, 106, 0.35), 0 0 22px rgba(255, 215, 106, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
.lang-button:focus-visible, .lang-menu button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lang-menu {
  position: fixed; inset: auto; margin: 0; z-index: 200; padding: 6px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel-strong); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 63, 208, 0.25); backdrop-filter: blur(10px);
}
.lang-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer;
}
.lang-menu b { min-width: 2em; color: var(--muted); font-weight: 800; }
.lang-menu button:hover, .lang-menu button:focus-visible { background: rgba(255, 215, 106, 0.12); }
.lang-menu [aria-selected="true"] { background: rgba(255, 215, 106, 0.18); color: var(--gold); }
.lang-menu [aria-selected="true"] b { color: inherit; }
.lang-menu [aria-selected="true"]::after { content: "✓"; margin-left: auto; }

/* ---------- LUCKY REEL ---------- */
/* 筐体は Higgsfield で生成した絵(assets/reel/cabinet.webp)。窓は透明で、その下にリールを置く。
   窓・電球・プレートの位置は public/reel-art.js(絵を解析した値)。大きさはすべて筐体の幅 --cab-w に比例。
   横長では左上(司会の頭上)、縦長ではホイールの真上の中央 */
.reel { position: fixed; z-index: 4; left: 22px; top: calc(var(--safe-t) + 62px); pointer-events: none; --cab-w: 300px; }
.reel-cabinet {
  position: relative; width: var(--cab-w); aspect-ratio: 2671 / 1146;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(255, 63, 208, 0.35));
}
.reel-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; user-select: none; }
/* 窓の中: 暗いガラスと2本のリール(絵の窓の縁がかぶさる) */
.reel-frame {
  position: absolute; z-index: 1; left: 6.51%; top: 29.23%; width: 86.9%; height: 49.91%;
  display: flex; align-items: center; justify-content: center; gap: calc(var(--cab-w) * 0.018);
  border-radius: 8% / 18%;
  background: radial-gradient(ellipse at 50% 50%, #241066, #070222 72%);
}
.reel-col {
  position: relative; z-index: 1; height: calc(var(--cab-w) * 0.15); overflow: hidden; border-radius: calc(var(--cab-w) * 0.022);
  background: linear-gradient(180deg, #0b0430, #2a1468 50%, #0b0430);
}
/* 曲面ガラス: 上下が暗く、真ん中にうっすら光 */
.reel-col::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 30%, rgba(255, 255, 255, 0.07) 46%, rgba(255, 255, 255, 0) 60%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35));
}
.reel-spot { width: calc(var(--cab-w) * 0.37); }
.reel-mult { width: calc(var(--cab-w) * 0.33); }
/* リールの帯: Higgsfield で生成した紫のベルベットに金の線(assets/reel/strip.webp)。
   1枚が2コマ分の高さで、金の線がちょうどコマの境目に来る。帯ごと動くので回転が見える */
.reel-strip {
  position: absolute; left: 0; right: 0; top: 0; will-change: transform;
  background: url("assets/reel/strip.webp") center top / 100% calc(var(--cab-w) * 0.3) repeat-y;
}
.reel.spinning .reel-strip { filter: blur(1.1px); }
.reel-cell { height: calc(var(--cab-w) * 0.15); display: grid; place-items: center; }
/* 絵柄: 枠は付けず、ベルベットの帯の上に文字だけを大きく光らせる。場所はマスの色、倍率は金 */
.reel-cell .tag {
  font: 900 calc(var(--cab-w) * 0.06)/1 var(--display); letter-spacing: 0.04em; white-space: nowrap;
  background: linear-gradient(180deg, #fff 20%, color-mix(in srgb, var(--c) 45%, #fff) 50%, var(--c) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 7px var(--c)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.9));
}
.reel-cell .tag.num { font-size: calc(var(--cab-w) * 0.095); letter-spacing: 0; }
.reel-mult .reel-cell b {
  font: 900 calc(var(--cab-w) * 0.095)/1 var(--display); letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 15%, var(--gold-hi) 40%, var(--gold) 65%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 215, 106, 0.75)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.9));
}
.reel-mult .reel-cell small { font-size: 0.6em; margin-right: 1px; }
/* リールが止まった瞬間、その窓がぱっと光る */
.reel-col.stopped { animation: colstop 0.55s ease-out; }
@keyframes colstop { 0% { box-shadow: inset 0 0 22px rgba(255, 215, 106, 0.9); filter: brightness(1.5); } }
/* 当たり線: 文字の上を横切らないよう、リールの窓の奥(窓のあいだと両端だけに見える) */
.reel-line {
  position: absolute; z-index: 0; left: 9%; right: 9%; top: 50%; height: 2px; margin-top: -1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 63, 208, 0.38) 10%, rgba(255, 63, 208, 0.38) 90%, transparent);
  box-shadow: 0 0 6px rgba(255, 63, 208, 0.4);
}
/* プレートの文字(金に彫り込んだように) */
.reel-plate {
  position: absolute; z-index: 3; left: 38.5%; top: 5%; width: 23.5%; height: 15%;
  display: grid; place-items: center; white-space: nowrap;
  font: 900 calc(var(--cab-w) * 0.034)/1 var(--display); letter-spacing: 0.05em;
  color: #5a1468; text-shadow: 0 1px 0 rgba(255, 244, 210, 0.75), 0 -1px 0 rgba(90, 50, 0, 0.45);
}
.reel-plate span { display: inline-block; transform: scaleX(0.88); }
/* 絵の電球の上に重ねる光(game.js が並べる)。明るい光と暗い点を交互にして、光が一周して見えるようにする */
.reel-bulbs { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.bulb {
  position: absolute; width: calc(var(--cab-w) * 0.036); height: calc(var(--cab-w) * 0.036); transform: translate(-50%, -50%); border-radius: 50%;
  animation: bulb 1.35s steps(1) infinite; animation-delay: calc(var(--k) * -0.075s);
}
@keyframes bulb {
  0%, 32% { background: radial-gradient(circle, #fff 0 28%, rgba(255, 246, 210, 0.95) 40%, rgba(255, 215, 106, 0) 72%); box-shadow: 0 0 10px 2px rgba(255, 215, 106, 0.75); }
  33%, 100% { background: radial-gradient(circle, rgba(40, 0, 30, 0.62) 0 46%, rgba(40, 0, 30, 0) 60%); box-shadow: none; }
}
.reel.spinning .bulb { animation-duration: 0.45s; animation-delay: calc(var(--k) * -0.025s); }
/* そろった: 電球が一斉に点滅し、筐体が金に光り、当たり線が金に光る */
.reel.hit .bulb { animation: bulbflash 0.3s steps(1) infinite; }
@keyframes bulbflash {
  0%, 49% { background: radial-gradient(circle, #fff 0 30%, rgba(255, 246, 210, 0.95) 42%, rgba(255, 215, 106, 0) 74%); box-shadow: 0 0 12px 3px rgba(255, 215, 106, 0.9); }
  50%, 100% { background: radial-gradient(circle, #fff 0 22%, rgba(255, 122, 217, 0.95) 38%, rgba(255, 63, 208, 0) 72%); box-shadow: 0 0 12px 3px rgba(255, 63, 208, 0.8); }
}
.reel.hit .reel-cabinet { animation: cabinethit 0.35s ease-in-out 8 alternate; }
@keyframes cabinethit { to { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 30px rgba(255, 215, 106, 0.95)) brightness(1.12); } }
/* 光は帯より手前(曲面ガラスの層)に描く。帯の下に描くと帯に隠れる */
.reel.hit .reel-col::after { box-shadow: inset 0 0 14px rgba(255, 215, 106, 0.85); animation: colhit 0.35s ease-in-out 8 alternate; }
@keyframes colhit { to { box-shadow: inset 0 0 26px rgba(255, 236, 170, 1), inset 0 0 6px #fff; } }
.reel.hit .reel-line { height: 3px; background: linear-gradient(90deg, transparent, var(--gold-hi) 8%, #fff 50%, var(--gold-hi) 92%, transparent); box-shadow: 0 0 14px var(--gold), 0 0 4px #fff; }
/* 外れ: 右のリールが半コマずれて止まり、窓が少し暗くなる */
.reel.miss .reel-frame { filter: saturate(0.6) brightness(0.75); }
.reel.miss .bulb { animation-play-state: paused; }

/* ---------- 案内・結果 ---------- */
/* ベットの残り時間: 円形のタイマー(案内の上)。--left = 残りの割合(0〜1、game.js が 0.1 秒ごとに入れる) */
.bet-timer {
  position: fixed; z-index: 4; left: 50%; bottom: calc(var(--board-h) + 58px); transform: translateX(-50%);
  width: 92px; height: 92px; display: grid; place-content: center; text-align: center; pointer-events: none;
  border-radius: 50%; background: radial-gradient(circle, rgba(26, 11, 72, 0.95) 55%, rgba(10, 4, 34, 0.9) 70%);
  box-shadow: 0 0 0 2px rgba(255, 215, 106, 0.55), 0 0 26px rgba(255, 215, 106, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.7);
  --left: 1; --c: var(--gold);
}
.bet-timer[hidden] { display: none; }
.bet-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.bet-timer .track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 7; }
.bet-timer .ring {
  fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--left) * 100);
  filter: drop-shadow(0 0 4px var(--c)); transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
}
.bet-timer b {
  position: relative; font: 900 38px/1 var(--display); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 15%, var(--gold-hi) 45%, var(--c) 85%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.8));
}
.bet-timer small { position: relative; margin-top: 2px; font: 900 10px/1 var(--display); letter-spacing: 0.3em; padding-left: 0.3em; color: var(--muted); }
.bet-timer.hurry { --c: #ff3f6d; box-shadow: 0 0 0 2px rgba(255, 63, 109, 0.8), 0 0 34px rgba(255, 63, 109, 0.7), inset 0 0 18px rgba(0, 0, 0, 0.7); }
.bet-timer.hurry small { color: #ff8aa6; }
.bet-timer.beat { animation: timerbeat 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes timerbeat { 0% { transform: translateX(-50%) scale(1.22); } 100% { transform: translateX(-50%) scale(1); } }
.bet-timer.closed { --c: #9a8fc0; }
.bet-timer.closed small { font-size: 13px; letter-spacing: 0.12em; padding-left: 0.12em; color: #fff; }
/* ベット欄の上の細いバー(残り時間に合わせて縮む) */
.bet-bar { position: absolute; left: 6%; right: 6%; top: 3px; height: 7px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; --left: 1; }
.bet-bar[hidden] { display: none; }
.bet-bar i { display: block; height: 100%; width: calc(var(--left) * 100%); border-radius: 3px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi)); box-shadow: 0 0 10px var(--gold); transition: width 0.1s linear; }
.bet-bar.hurry i { background: linear-gradient(90deg, #b0103f, #ff6b8e); box-shadow: 0 0 12px #ff3f6d; }

.banner {
  position: fixed; z-index: 4; left: 50%; bottom: calc(var(--board-h) + 10px); transform: translateX(-50%);
  padding: 9px 26px; border-radius: 999px; white-space: nowrap;
  background: var(--panel-strong); border: 1px solid var(--line); backdrop-filter: blur(6px);
  font-weight: 800; font-size: 16px; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(154, 91, 255, 0.35);
}
.banner.hot {
  color: #1a0b48; border-color: transparent;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi), var(--gold), var(--gold-hi), var(--gold-deep));
  background-size: 200% 100%; animation: shine 1.6s linear infinite;
  box-shadow: 0 0 30px rgba(255, 215, 106, 0.7);
}
@keyframes shine { to { background-position: -200% 0; } }
.win-pop {
  position: fixed; z-index: 6; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font: 900 clamp(46px, 10vw, 110px)/1 var(--display); white-space: nowrap; pointer-events: none;
  background: linear-gradient(180deg, #fff, var(--gold-hi) 30%, var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 215, 106, 0.9)) drop-shadow(0 6px 0 rgba(90, 40, 0, 0.8));
  animation: pop 2s ease-out both;
}
.win-pop small { display: block; margin-top: 6px; font-size: 0.32em; letter-spacing: 0.2em; text-align: center; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; } 14% { transform: translate(-50%, -50%) scale(1.2) rotate(2deg); opacity: 1; } 26% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -64%) scale(1); } }

.history {
  position: fixed; z-index: 4; right: 16px; top: calc(var(--safe-t) + 94px); margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 5px;
}
.history li { min-width: 50px; padding: 4px 8px; border-radius: 8px; text-align: center; font: 900 11px/1.25 var(--display); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.history li.boosted { outline: 2px solid var(--gold); }

/* ---------- ベット欄 ---------- */
.board {
  position: fixed; z-index: 5; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(1120px, 100%); padding: 22px 18px calc(10px + var(--safe-b));
  /* 半透明: 後ろのホイールとステージが透けて見える(濃さは --board-veil と --spot-veil で変えられる) */
  --board-veil: 0.34; --spot-veil: 0.46;
  background: linear-gradient(180deg, rgba(7, 3, 26, 0), rgba(10, 4, 34, var(--board-veil)) 16%, rgba(7, 3, 26, calc(var(--board-veil) + 0.2)));
}
.board::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 8px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent);
  box-shadow: 0 0 12px rgba(255, 215, 106, 0.7);
}
.spots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
/* マス: 奥から「暗い台とマスの色の光(::before)」→「Higgsfield で生成した金の枠(::after)」→「数字・アイコン」 */
.spot {
  position: relative; aspect-ratio: 1004 / 651; height: auto; border-radius: 12%/18%; cursor: pointer; border: 0; padding: 9% 4% 6%; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  transition: transform 0.15s, filter 0.25s;
}
.spot::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 12%; bottom: 7%; border-radius: 9%/14%; z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 40%),
    radial-gradient(130% 100% at 50% 120%, color-mix(in srgb, var(--c) 95%, transparent), color-mix(in srgb, var(--c) 35%, transparent) 45%, transparent 75%),
    radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--c2) 30%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(42, 20, 98, var(--spot-veil)) 0%, rgba(20, 8, 56, var(--spot-veil)) 55%, rgba(10, 4, 36, calc(var(--spot-veil) + 0.12)) 100%);
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, 0.3);
}
.spot::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("assets/board/frame.webp") center / 100% 100% no-repeat;
}
.spot > :not(.stack):not(.boost) { position: relative; z-index: 2; }
.spot:not(:disabled):hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px color-mix(in srgb, var(--c) 70%, transparent)) brightness(1.08);
}
.spot:not(:disabled):active { transform: translateY(1px); }
.spot:disabled { cursor: default; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)) saturate(0.75) brightness(0.8); }
.spot-label {
  font: 900 clamp(24px, 3.1vw, 40px)/0.95 var(--display); letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 18%, color-mix(in srgb, var(--c) 55%, #fff) 45%, var(--c) 72%, color-mix(in srgb, var(--c) 55%, #000));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 70%, transparent)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.7));
}
.spot-odds {
  font: 800 10.5px/1 var(--display); letter-spacing: 0.14em; color: var(--gold); white-space: nowrap;
  padding: 3px 10px 3px 11px; border-radius: 999px; border: 1px solid rgba(255, 215, 106, 0.45); background: rgba(0, 0, 0, 0.45);
}
/* ボーナスのアイコン(Higgsfield で生成)。名前は下に小さく */
.spot-icon { display: block; width: clamp(30px, 3.4vw, 44px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 75%, transparent)); }
.spot-name { font: 900 clamp(8.5px, 0.95vw, 12px)/1 var(--display); letter-spacing: 0.04em; white-space: nowrap; text-shadow: 0 0 10px var(--c), 0 2px 0 rgba(0, 0, 0, 0.8); }
.spot-bonus .spot-odds { display: none; }
.spot-bonus:not(:disabled):hover .spot-icon { animation: iconbob 0.6s ease-in-out infinite alternate; }
@keyframes iconbob { to { transform: translateY(-3px) scale(1.08) rotate(-4deg); } }

/* 置いたチップの山と合計額(マスの下の縁にかかる) */
.stack { position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 4px; pointer-events: none; z-index: 2; }
.stack:empty { display: none; }
.stack .pile { position: relative; width: 28px; height: 28px; }
.stack .pile .chip { position: absolute; left: 0; bottom: calc(var(--i) * 3px); --cs: 28px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); animation: chipdrop 0.25s ease-out; }
@keyframes chipdrop { from { transform: translateY(-14px) scale(1.2); opacity: 0; } }
.stack .amt {
  margin-bottom: 3px; padding: 3px 7px; border-radius: 8px; font: 900 11.5px/1 var(--display); color: #1a0b48;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.spot .boost {
  position: absolute; top: -11px; right: -6px; padding: 4px 8px; border-radius: 9px; z-index: 3;
  font: 900 13px/1 var(--display); color: #1a0b48; background: linear-gradient(180deg, #fff, var(--gold-hi) 40%, var(--gold));
  box-shadow: 0 0 16px var(--gold), 0 2px 4px rgba(0, 0, 0, 0.5); animation: boostpop 0.5s ease-out;
}
.spot .boost:empty { display: none; }
@keyframes boostpop { from { transform: scale(2.4) rotate(-14deg); opacity: 0; } }
.spot.win {
  z-index: 1;
  filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 16px var(--gold)) drop-shadow(0 0 26px color-mix(in srgb, var(--c) 85%, transparent)) brightness(1.15);
  animation: pulse 0.45s ease-in-out 8 alternate;
}
.spot.boosted { filter: drop-shadow(0 0 5px var(--gold-hi)) drop-shadow(0 0 16px rgba(255, 215, 106, 0.85)) brightness(1.1); }
@keyframes pulse { to { transform: scale(1.06); } }

/* チップ(絵は chips.js が描いて --chip-<額面> に入れる。wsog-baccarat と同じデザイン) */
.chip {
  position: relative; width: var(--cs, 46px); height: var(--cs, 46px); border-radius: 50%; flex: none; border: 0; padding: 0;
  background: var(--chip-img) center / contain no-repeat; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(0, 0, 0, 0.35);
}
.chip[data-v="100"] { --chip-img: var(--chip-100); }
.chip[data-v="500"] { --chip-img: var(--chip-500); }
.chip[data-v="1000"] { --chip-img: var(--chip-1000); }
.chip[data-v="5000"] { --chip-img: var(--chip-5000); }
.chip[data-v="10000"] { --chip-img: var(--chip-10000); }
.chip[data-v="100000"] { --chip-img: var(--chip-100000); }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
/* チップトレイ: 金の受け皿 */
.chips {
  display: flex; gap: 12px; padding: 8px 16px 9px; border-radius: 40px;
  background:
    radial-gradient(ellipse 70% 120% at 50% 100%, rgba(255, 215, 106, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.1));
  box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.4), inset 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 18px rgba(154, 91, 255, 0.18);
}
.chips .chip { --cs: 50px; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; }
.chips .chip:not(:disabled):hover { transform: translateY(-3px); }
.chips .chip[aria-checked="true"] {
  transform: translateY(-7px);
  box-shadow: 0 0 0 2px #fff1c7, 0 0 0 4px rgba(184, 140, 60, 0.9), 0 0 24px rgba(240, 220, 168, 0.75), 0 7px 10px rgba(0, 0, 0, 0.5);
  animation: chipglow 1.6s ease-in-out infinite alternate;
}
@keyframes chipglow { from { filter: brightness(1); } to { filter: brightness(1.14); } }
.chips .chip:disabled { cursor: default; opacity: 0.55; }
.actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 999px; padding: 11px 20px; font-weight: 800; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer;
  letter-spacing: 0.06em; color: var(--gold-hi); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s, filter 0.2s;
}
.btn:not(.primary) > span:not(.ico) {
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 40%, var(--gold) 75%, #e0a63a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(40, 10, 0, 0.9));
}
.btn .ico { width: 18px; height: 18px; }
/* 押せるときは光の筋がときどき横切る */
.btn:not(.primary):not(:disabled)::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -50%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: btnsweep 4.5s ease-in-out infinite;
}
.actions .btn:nth-child(2)::before { animation-delay: 0.35s; }
.actions .btn:nth-child(3)::before { animation-delay: 0.7s; }
@keyframes btnsweep { 0%, 70% { left: -50%; } 100% { left: 130%; } }
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 215, 106, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
.btn:not(.primary):not(:disabled):active { transform: translateY(1px) scale(0.98); }
.btn:disabled { cursor: default; filter: saturate(0.55) brightness(0.72); }
.btn.primary {
  position: relative; overflow: hidden; min-width: 150px; padding: 14px 26px; color: #1a0b48; border: 0;
  font: 900 22px/1 var(--display); letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fffbe6, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 0 0 2px rgba(255, 244, 196, 0.6), 0 5px 0 #6e4a0a, 0 0 30px rgba(255, 215, 106, 0.7);
}
.btn.primary:not(:disabled) { animation: spinready 1.4s ease-in-out infinite alternate; }
@keyframes spinready { to { box-shadow: 0 0 0 2px rgba(255, 244, 196, 0.9), 0 5px 0 #6e4a0a, 0 0 46px rgba(255, 215, 106, 0.95); } }
.btn.primary:not(:disabled)::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: sweep 2.2s ease-in-out infinite;
}
@keyframes sweep { 60%, 100% { left: 130%; } }
.btn.primary:not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 #6e4a0a; }
.note { margin: 0; text-align: center; font-size: 11px; color: var(--ink); text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, 0.9); }
/* ベット欄のいちばん下: DEMO / REAL のスイッチ・いまのモードの説明・ログイン */
.mode-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.mode-bar .note { flex: 1; min-width: 0; }
.mode-switch {
  flex: none; display: inline-flex; padding: 3px; border-radius: 999px; border: 2px solid transparent;
  background: linear-gradient(180deg, rgba(10, 3, 34, 0.95), rgba(34, 12, 92, 0.9)) padding-box,
    linear-gradient(160deg, #fffbe6 0%, #ffd76a 22%, #9c6414 48%, #ffe9a0 68%, #b77a18 86%, #fff1b8 100%) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
.mode-switch button {
  min-width: 58px; padding: 7px 12px; border: 0; border-radius: 999px; cursor: pointer; background: transparent;
  font: 900 12px/1 var(--display); letter-spacing: 0.08em; color: rgba(201, 191, 240, 0.7); transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.mode-switch button:hover { color: #fff; }
/* 選んでいる方: DEMO は水色、REAL は金(本物の $WSOG を賭けていることが一目で分かるように) */
.mode-switch button.on[data-mode="demo"] { color: #04263a; background: linear-gradient(180deg, #d8f6ff, #36d6ff 55%, #1794c4); box-shadow: 0 0 14px rgba(54, 214, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.mode-switch button.on[data-mode="real"] { color: #3a2400; background: linear-gradient(180deg, #fffbe6, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 0 14px rgba(255, 215, 106, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.mode-switch.locked { animation: modelocked 0.4s; }
@keyframes modelocked { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
.account { flex: none; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.account-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; color: var(--gold-hi); }
.account-name:empty { display: none; }
/* ログインのボタン(金の .btn.primary を小さくしたもの) */
.btn.primary.login-btn { min-width: 0; padding: 10px 16px; font: 900 13px/1 inherit; letter-spacing: 0.02em; text-decoration: none; box-shadow: 0 0 0 2px rgba(255, 244, 196, 0.6), 0 3px 0 #6e4a0a, 0 0 22px rgba(255, 215, 106, 0.6); }
a.login-btn[hidden], .link-btn[hidden], #refill-btn[hidden] { display: none; }
.link-btn { padding: 4px 2px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: #fff; }
/* 上の残高の名札: DEMO は水色、REAL($WSOG)は金 */
.wallet-label { padding: 3px 8px; border-radius: 999px; font: 900 10px/1 var(--display); letter-spacing: 0.08em; align-self: center; }
.wallet[data-mode="demo"] .wallet-label { color: #04263a; background: linear-gradient(180deg, #d8f6ff, #36d6ff); }
.wallet[data-mode="real"] .wallet-label { color: #3a2400; background: linear-gradient(180deg, #fffbe6, var(--gold)); }
/* ライブ卓: SPIN の場所は残り時間の表示(押すものはない) */
/* 右上(縦長では左下): 参加している人数と、公平性のページへのリンク */
.live-info { position: fixed; z-index: 4; right: 16px; top: calc(var(--safe-t) + 64px); display: flex; align-items: center; gap: 6px; }
.players { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--muted); background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.fair-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; text-decoration: none; color: var(--gold-hi); background: var(--panel); border: 1px solid var(--line); }
.fair-link:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 215, 106, 0.4); }
.fair-link .ico { width: 13px; height: 13px; }
.ico-shield { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l8 3.2v5.6c0 5.300-3.400 9.300-8 11.200-4.600-1.900-8-5.900-8-11.200V5.200zm-1.300 13.600l5.800-6.200-1.500-1.400-4.400 4.700-2-2-1.400 1.500z' fill-rule='evenodd'/></svg>"); }
.ico-back { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 12H5M11 5l-7 7 7 7' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.rules-fair { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-hi); font-weight: 800; text-decoration: none; border-bottom: 1px solid rgba(255, 215, 106, 0.5); }
.rules-fair .ico { width: 15px; height: 15px; }
.players::before { content: "● "; color: #ff3f6d; animation: livedot 1s steps(1) infinite; }
@keyframes livedot { 50% { color: transparent; } }

/* ---------- ボーナス: 全画面のステージ ---------- */
/* 背景はステージごとの絵(Higgsfield で生成、assets/bonus/stage-*.jpg)。光の筋が回り、周りが暗く落ちる */
.bonus { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow: hidden; background: #05021a; animation: fadein 0.35s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.bonus[hidden], .refill[hidden], .win-pop[hidden], .rules[hidden], .bonus-intro[hidden], .bonus-win[hidden] { display: none; }
.stage-bg { position: absolute; inset: -4%; background: var(--stage) center / cover no-repeat; animation: stagezoom 18s ease-in-out infinite alternate; }
.bonus[data-stage="twin"] { --stage: url("assets/bonus/stage-twin.jpg"); --accent: #ff4d8d; --accent2: #3d7bff; }
.bonus[data-stage="drop"] { --stage: url("assets/bonus/stage-drop.jpg"); --accent: #ff8a1f; --accent2: #ffd76a; }
.bonus[data-stage="hunt"] { --stage: url("assets/bonus/stage-hunt.jpg"); --accent: #18e0a4; --accent2: #9a5bff; }
.bonus[data-stage="nova"] { --stage: url("assets/bonus/stage-nova.jpg"); --accent: #ffd23f; --accent2: #ff3fd0; }
@keyframes stagezoom { from { transform: scale(1); } to { transform: scale(1.06) translateY(-1%); } }
.stage-rays {
  position: absolute; left: 50%; top: 42%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.07) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 55%); mask: radial-gradient(circle, #000 0 18%, transparent 55%);
  mix-blend-mode: screen; animation: rays 40s linear infinite;
}
@keyframes rays { to { transform: rotate(360deg); } }
.stage-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(5, 2, 20, 0) 35%, rgba(5, 2, 20, 0.55) 75%, rgba(5, 2, 20, 0.85) 100%); }
.stage-inner {
  position: relative; z-index: 2; width: min(980px, 100%); max-height: 100%; padding: calc(var(--safe-t) + 14px) 14px calc(var(--safe-b) + 14px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.bonus-head { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.bonus-head h2 {
  margin: 0; font: 900 clamp(30px, 6.4vw, 64px)/1 var(--display); letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 35%, var(--gold) 60%, var(--gold-deep) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 80%, transparent)) drop-shadow(0 4px 0 rgba(60, 20, 0, 0.9));
}
.bonus-boost {
  padding: 7px 14px; border-radius: 12px; font: 900 clamp(15px, 2.2vw, 22px)/1 var(--display); color: #1a0b48;
  background: linear-gradient(180deg, #fff, var(--gold-hi) 40%, var(--gold)); box-shadow: 0 0 22px var(--gold), 0 3px 0 #6e4a0a;
  animation: boostpulse 0.6s ease-in-out infinite alternate;
}
@keyframes boostpulse { to { transform: scale(1.08); box-shadow: 0 0 36px var(--gold), 0 3px 0 #6e4a0a; } }
.bonus-boost[hidden] { display: none; }
.bonus-hint {
  margin: 0; min-height: 1.3em; padding: 7px 20px; border-radius: 999px; font-weight: 800; font-size: clamp(13px, 1.7vw, 17px); color: #fff;
  background: rgba(8, 3, 28, 0.7); border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); backdrop-filter: blur(4px);
}
.bonus-hint:empty { visibility: hidden; }
.bonus-field { display: grid; justify-items: center; gap: 12px; width: 100%; }
/* 登場演出のあいだは奥の中身を隠し、終わったらふわっと出す */
.stage-inner { transition: opacity 0.4s, transform 0.4s; }
.bonus.intro .stage-inner { opacity: 0; transform: scale(0.94); }
/* 当たりの演出のあいだは、奥のステージの中身(タイトル・盤)を消す */
.bonus.celebrating .stage-inner { opacity: 0; transform: scale(0.96); }

/* 開始の登場演出 */
.bonus-intro { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; text-align: center; pointer-events: none; background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 60%); animation: introflash 1.8s ease-out both; }
.bonus-intro small { display: block; font: 900 clamp(16px, 2.6vw, 28px)/1 var(--display); letter-spacing: 0.5em; padding-left: 0.5em; color: #fff; text-shadow: 0 0 16px var(--accent), 0 0 4px #fff; animation: introsub 1.8s ease-out both; }
.bonus-intro b {
  display: block; margin-top: 10px; font: 900 clamp(46px, 11vw, 128px)/1 var(--display); letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 35%, var(--gold) 60%, var(--gold-deep) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px var(--accent)) drop-shadow(0 6px 0 rgba(60, 20, 0, 0.9));
  animation: introtitle 1.8s cubic-bezier(0.2, 1.3, 0.3, 1) both;
}
@keyframes introflash { 0% { opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes introtitle { 0% { transform: scale(3) rotate(-6deg); opacity: 0; } 25% { transform: scale(0.92) rotate(1deg); opacity: 1; } 35% { transform: scale(1); } 80% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes introsub { 0%, 15% { opacity: 0; transform: translateY(20px); } 35% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* 倍率が決まったときの演出(段階 data-tier: none / win / big / mega / epic)。
   奥から: 閃光 → 光の筋 → 衝撃波の輪 → 金貨の雨 → 喜ぶ司会 → タイトル・倍率・獲得額 → 紙吹雪 */
.bonus-win {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle, rgba(5, 2, 20, 0.55), rgba(5, 2, 20, 0.92)); animation: fadein 0.2s ease-out;
  --tier: var(--gold); --tier2: #ff8a1f;
}
.bonus-win[data-tier="mega"] { --tier: #ff3fd0; --tier2: #9a5bff; }
.bonus-win[data-tier="epic"] { --tier: #36d6ff; --tier2: #ff3fd0; }
.bonus-win[data-tier="none"] { --tier: #9a8fc0; --tier2: #4a3a80; }
.win-flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff 0, rgba(255, 244, 210, 0.85) 25%, rgba(255, 215, 106, 0) 70%); opacity: 0; }
.bonus-win.hit .win-flash { animation: winflash 0.8s ease-out; }
.bonus-win.slam .win-flash { animation: winflash 0.6s ease-out; }
@keyframes winflash { 0% { opacity: 1; } 100% { opacity: 0; } }
.win-rays {
  position: absolute; left: 50%; top: 50%; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tier) 55%, transparent) 0deg 5deg, transparent 5deg 12deg, color-mix(in srgb, var(--tier2) 40%, transparent) 12deg 15deg, transparent 15deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 8%, transparent 48%); mask: radial-gradient(circle, #000 0 8%, transparent 48%);
  animation: rays 7s linear infinite; mix-blend-mode: screen; opacity: 0.85;
}
.bonus-win.slam .win-rays { animation: rays 2.5s linear infinite; opacity: 1; }
.bonus-win[data-tier="epic"] .win-rays { background: repeating-conic-gradient(from 0deg, #ff3fd0 0deg 4deg, transparent 4deg 9deg, #36d6ff 9deg 13deg, transparent 13deg 18deg, #ffd76a 18deg 22deg, transparent 22deg 27deg); opacity: 0.55; }
.bonus-win[data-tier="none"] .win-rays { opacity: 0.3; }
.win-shock {
  position: absolute; left: 50%; top: 46%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; opacity: 0;
  border: 6px solid var(--gold-hi); box-shadow: 0 0 30px var(--tier), inset 0 0 20px var(--tier);
}
.win-shock.s2 { border-color: var(--tier); }
.bonus-win.slam .win-shock { animation: shock 1s ease-out forwards; }
.bonus-win.slam .win-shock.s2 { animation-delay: 0.18s; }
@keyframes shock { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(34); opacity: 0; } }
.win-coins { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 喜ぶ司会(グリーンバックを抜いた「喜ぶ」動画。bonus.js が canvas に描く) */
.win-host {
  position: absolute; left: max(0px, calc(50% - 560px)); bottom: 0; height: min(78vh, 600px); width: auto; aspect-ratio: 9 / 16;
  opacity: 0; transform: translateY(30px); transition: opacity 0.4s, transform 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--tier) 60%, transparent));
}
.bonus-win.slam .win-host { opacity: 1; transform: none; }
.bonus-win[data-tier="none"] .win-host { display: none; }
.win-center { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0 12px; }
.win-title { width: min(760px, 88vw); height: auto; opacity: 0; transform: scale(0.2) translateY(-40px); filter: drop-shadow(0 0 30px color-mix(in srgb, var(--tier) 70%, transparent)); }
.win-title[hidden] { display: none; }
.bonus-win.slam .win-title { animation: titledrop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) forwards, titleglow 1.2s 0.7s ease-in-out infinite alternate; }
@keyframes titledrop { 0% { opacity: 0; transform: scale(2.6) rotate(-4deg); } 55% { opacity: 1; transform: scale(0.92) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes titleglow { 0% { opacity: 1; transform: none; } 100% { opacity: 1; transform: scale(1.04); filter: drop-shadow(0 0 46px var(--tier)) brightness(1.15); } }
.win-mult {
  position: relative; font: 900 clamp(70px, 17vw, 190px)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 8%, var(--gold-hi) 30%, var(--gold) 58%, var(--gold-deep) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px var(--tier)) drop-shadow(0 8px 0 rgba(70, 25, 0, 0.95));
  animation: multin 0.35s ease-out both;
}
.win-mult small { font-size: 0.5em; }
@keyframes multin { from { transform: scale(0.5); opacity: 0; } }
.bonus-win.slam .win-mult { animation: punch 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes punch { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.win-amount {
  position: relative; margin-top: 10px; padding: 10px 28px; border-radius: 999px; font: 900 clamp(22px, 4vw, 44px)/1.1 var(--display); color: #fff;
  font-variant-numeric: tabular-nums; background: rgba(8, 3, 28, 0.82); border: 2px solid var(--gold);
  box-shadow: 0 0 26px color-mix(in srgb, var(--tier) 70%, transparent), inset 0 0 18px color-mix(in srgb, var(--tier) 35%, transparent);
  text-shadow: 0 0 14px var(--tier), 0 3px 0 rgba(0, 0, 0, 0.8);
}
.bonus-win[data-tier="none"] .win-amount { font-size: clamp(16px, 2.6vw, 24px); color: var(--muted); border-color: rgba(255, 255, 255, 0.25); }
.bonus-win.slam .win-amount { animation: amountslam 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes amountslam { 0% { transform: scale(1.35); box-shadow: 0 0 60px var(--tier); } 100% { transform: scale(1); } }
/* 揺れ(最初の一撃と、止まった瞬間) */
.bonus.shake .stage-bg, .bonus.shake .bonus-win .win-center { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 15% { transform: translate(-8px, 4px); } 30% { transform: translate(7px, -5px); } 45% { transform: translate(-6px, -3px); } 60% { transform: translate(5px, 4px); } 75% { transform: translate(-3px, 2px); } 100% { transform: none; } }
.confetti { position: absolute; inset: 0; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .win-host { left: -6%; height: 44vh; }
  .win-center { margin-top: -18vh; }
}

/* 選択肢のボタン(SUPER NOVA の針) */
.choice-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.choice {
  min-width: 108px; padding: 13px 18px; border-radius: 16px; cursor: pointer; color: #fff; font: 900 18px/1 var(--display); letter-spacing: 0.08em;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.65), transparent 40%), var(--c);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45), 0 0 22px var(--c), inset 0 -6px 10px rgba(0, 0, 0, 0.25);
  animation: choicebob 1s ease-in-out infinite alternate;
}
.choice:nth-child(2) { animation-delay: -0.33s; }
.choice:nth-child(3) { animation-delay: -0.66s; }
@keyframes choicebob { to { transform: translateY(-4px); } }
.choice[aria-pressed="true"] { outline: 4px solid #fff; animation: none; transform: scale(1.12); box-shadow: 0 0 40px var(--c), 0 6px 0 rgba(0, 0, 0, 0.45); }
.choice:disabled { cursor: default; }
.choice:disabled:not([aria-pressed="true"]) { opacity: 0.45; animation: none; }

/* ---- TWIN STAR: 台座の上で金のコインが宙を舞う ---- */
.twin-row { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 56px); width: 100%; }
.twin-side {
  min-width: clamp(110px, 16vw, 170px); padding: 14px 16px 12px; border-radius: 18px; color: #fff; text-align: center;
  font: 900 clamp(30px, 4.6vw, 52px)/1 var(--display);
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.35), transparent 60%), linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 50%, #000));
  border: 2px solid rgba(255, 255, 255, 0.75); box-shadow: 0 0 30px var(--c), 0 0 60px color-mix(in srgb, var(--c) 50%, transparent), inset 0 -8px 14px rgba(0, 0, 0, 0.3);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 16px rgba(255, 255, 255, 0.5);
  transition: transform 0.3s, filter 0.3s;
}
.twin-side small { display: block; font-size: 0.3em; letter-spacing: 0.35em; padding-left: 0.35em; margin-bottom: 6px; opacity: 0.95; }
.twin-side.win { transform: scale(1.18); animation: sidewin 0.4s ease-in-out 6 alternate; }
.twin-side.lose { filter: grayscale(0.6) brightness(0.55); transform: scale(0.9); }
@keyframes sidewin { to { box-shadow: 0 0 50px #fff, 0 0 90px var(--c), inset 0 -8px 14px rgba(0, 0, 0, 0.3); } }
.coin-wrap { position: relative; width: min(34vh, 270px, 42vw); aspect-ratio: 1; perspective: 1000px; }
.coin-pedestal { position: absolute; left: 50%; bottom: -14%; width: 120%; height: 22%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 215, 106, 0.75), rgba(255, 140, 40, 0.25) 45%, transparent 70%); filter: blur(2px); }
.coin-toss { position: absolute; inset: 0; transform-style: preserve-3d; }
.coin-toss.tossing { animation: toss 3.2s cubic-bezier(0.3, 0, 0.3, 1) both; }
@keyframes toss { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-38%) scale(1.15); } 85% { transform: translateY(2%) scale(1); } 92% { transform: translateY(-4%); } 100% { transform: translateY(0); } }
.coin { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 3.2s cubic-bezier(0.15, 0.6, 0.2, 1); }
.coin-face {
  position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--img) center / contain no-repeat; filter: drop-shadow(0 0 26px var(--c));
}
.coin-face.front { --img: url("assets/bonus/coin-pink.webp"); --c: #ff4d8d; }
.coin-face.back { --img: url("assets/bonus/coin-blue.webp"); --c: #3d7bff; transform: rotateY(180deg); }
.coin-face .val {
  position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%); padding: 0.18em 0.6em; border-radius: 999px; white-space: nowrap;
  font: 900 clamp(20px, 4.2vh, 34px)/1 var(--display); color: #1a0b48;
  background: linear-gradient(180deg, #fff, var(--gold-hi) 45%, var(--gold)); box-shadow: 0 0 14px rgba(255, 215, 106, 0.9), 0 3px 0 #6e4a0a;
}
.coin-face .val:empty { display: none; }

/* ---- GALAXY HUNT: ネオンの射的場 ---- */
.hunt-wrap { position: relative; width: min(780px, 96vw, calc((100vh - 200px) * 1.25)); cursor: crosshair; touch-action: none; }
.hunt-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; padding: 10px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 30, 40, 0.55), rgba(6, 2, 26, 0.75));
  border: 2px solid rgba(24, 224, 164, 0.85); backdrop-filter: blur(3px);
  box-shadow: 0 0 34px rgba(24, 224, 164, 0.55), inset 0 0 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 215, 106, 0.35);
}
.hunt-cell {
  aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center; font: 900 clamp(9px, 1.6vw, 15px)/1 var(--display);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(160deg, #3a1a8c, #120838);
  transition: transform 0.35s, background 0.3s;
}
.hunt-cell.sym { font-size: clamp(13px, 2.4vw, 22px); color: var(--s); text-shadow: 0 0 10px var(--s), 0 0 2px #fff; }
.hunt-cell.val { background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.3), transparent 45%), linear-gradient(160deg, #16c597, #075c48); animation: flipin 0.4s ease-out both; animation-delay: calc(var(--d, 0) * 6ms); }
.hunt-cell.val.big { background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.5), transparent 45%), linear-gradient(160deg, #ffe28a, #c48a1c); color: #1a0b48; }
@keyframes flipin { from { transform: rotateY(90deg); } }
.hunt-cell.mine { position: relative; z-index: 2; outline: 3px solid #fff; transform: scale(1.5); box-shadow: 0 0 30px var(--gold), 0 0 60px rgba(255, 215, 106, 0.7); background: linear-gradient(160deg, #fff4c4, #ffd76a); color: #1a0b48; animation: none; }
.hunt-cell.dim { opacity: 0.4; }
.hunt-cell.locked { outline: 3px solid #5dffb0; box-shadow: 0 0 16px #5dffb0; z-index: 1; }
.hunt-grid.shuffle .hunt-cell { animation: shuffle 0.45s ease-in-out infinite alternate; }
.hunt-grid.shuffle .hunt-cell:nth-child(odd) { animation-direction: alternate-reverse; }
@keyframes shuffle { from { transform: translate(-5px, 4px) rotate(-10deg) scale(0.92); } to { transform: translate(5px, -4px) rotate(10deg) scale(1.05); } }
.crosshair {
  position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; pointer-events: none;
  border: 3px solid #5dffb0; box-shadow: 0 0 22px #5dffb0, inset 0 0 14px rgba(93, 255, 176, 0.55);
  background:
    radial-gradient(circle, #fff 0 3px, transparent 4px),
    linear-gradient(#5dffb0, #5dffb0) center / 2px 100% no-repeat,
    linear-gradient(#5dffb0, #5dffb0) center / 100% 2px no-repeat;
  transition: left 0.08s, top 0.08s; animation: aim 1.2s linear infinite;
}
@keyframes aim { to { transform: rotate(360deg); } }
.crosshair.fire { animation: fire 0.45s ease-out; }
@keyframes fire { 40% { transform: scale(0.55); box-shadow: 0 0 60px #fff, 0 0 120px #5dffb0; } }
.hit-burst { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 4px #fff, 0 0 40px 20px #ffd76a; animation: burst 0.6s ease-out forwards; }
@keyframes burst { to { transform: scale(14); opacity: 0; } }

/* ---- STAR DROP / SUPER NOVA(canvas) ---- */
.drop-canvas { height: min(66vh, 640px); width: auto; max-width: 94vw; display: block; border-radius: 20px; box-shadow: 0 0 40px rgba(255, 138, 31, 0.45); }
.nova-wrap { position: relative; display: grid; place-items: center; }
.nova-wrap::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 215, 106, 0.45), rgba(255, 63, 208, 0.2) 45%, transparent 70%); animation: novaglow 1.6s ease-in-out infinite alternate; }
@keyframes novaglow { to { transform: scale(1.08); opacity: 0.8; } }
.nova-canvas { position: relative; width: min(540px, 92vw, 60vh); height: auto; display: block; }

@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  /* 縦長: コインを上に大きく、その下にピンクと青の札を並べる */
  .twin-row { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; gap: 18px 12px; }
  .twin-row .coin-wrap { grid-column: 1 / -1; order: -1; width: min(62vw, 34vh); margin-bottom: 8px; }
  .twin-side { min-width: 0; width: 100%; max-width: 170px; font-size: 34px; }
  .crosshair { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
  .choice { min-width: 92px; padding: 12px 12px; font-size: 16px; }
}

/* ---------- 遊び方 ---------- */
.rules { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 14px; background: rgba(5, 2, 20, 0.8); backdrop-filter: blur(4px); }
.rules-card {
  position: relative; width: min(620px, 100%); max-height: calc(100vh - 28px); overflow: auto; padding: 20px 22px; border-radius: 20px;
  background: linear-gradient(160deg, #2a1266, #0d0530); border: 1px solid var(--line); line-height: 1.65; font-size: 14px; user-select: text;
}
.rules-card h2 { margin: 0 0 8px; color: var(--gold); font: 900 24px/1.2 var(--display); }
.rules-card h3 { margin: 16px 0 4px; color: var(--gold); font: 900 16px/1.2 var(--display); }
.rules-card p { margin: 6px 0; }
.rules-card table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.rules-card th, .rules-card td { padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); text-align: left; }
.rules-card td:nth-child(2), .rules-card th:nth-child(2) { text-align: right; }
/* ボーナスの説明: ベット欄と同じ絵のマス(押せない小さい版)を左に置く */
.rules-bonus { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.rules-bonus p { margin: 0; flex: 1; min-width: 0; }
.rules-bonus p b { display: block; margin-bottom: 2px; color: var(--gold-hi); font: 900 13px/1.2 var(--display); letter-spacing: 0.04em; }
.rules-tile { flex: none; width: 112px; cursor: default; pointer-events: none; gap: 2px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.rules-tile .spot-icon { width: 30px; }
.rules-tile .spot-name { font-size: 8.5px; }
.rules-card .muted { color: var(--muted); font-size: 12px; }
.rules-close { position: absolute; top: 12px; right: 12px; }

.refill { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 22px 26px; border-radius: 18px; background: var(--panel-strong); border: 1px solid var(--line); text-align: center; }

/* ---------- 縦長・狭い画面 ---------- */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .topbar { gap: 7px; padding-left: 12px; padding-right: 12px; }
  .logo img { height: 40px; }
  .wallet { padding: 6px 11px; }
  .wallet { gap: 6px; }
  .wallet-label { padding: 3px 6px; font-size: 9px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn .ico { width: 18px; height: 18px; }
  button.lang-button { height: 36px; padding: 0 10px 0 8px; gap: 4px; }
  .lang-button::before { width: 17px; height: 17px; }
  .lang-button span { display: none; }
  .reel { left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 50px); --cab-w: min(250px, 68vw); }
  .history { display: none; }
  .bet-timer { width: 74px; height: 74px; bottom: calc(var(--board-h) + 50px); }
  .bet-timer b { font-size: 30px; }
  .bet-timer small { font-size: 9px; }
  .live-info { top: auto; right: auto; left: 10px; bottom: calc(var(--board-h) + 48px); }
  .banner { font-size: 13px; padding: 7px 16px; }
  .board { padding: 18px 10px calc(8px + var(--safe-b)); }
  .spots { grid-template-columns: repeat(4, 1fr); gap: 14px 7px; }
  .spot { padding: 10% 3% 6%; gap: 2px; }
  .spot-label { font-size: 25px; }
  .spot-odds { font-size: 8.5px; padding: 2px 6px; letter-spacing: 0.06em; }
  .spot-icon { width: 30px; }
  .spot-name { font-size: 8px; letter-spacing: 0.01em; }
  .stack { bottom: -12px; }
  .stack .pile, .stack .pile .chip { width: 22px; height: 22px; --cs: 22px; }
  .stack .amt { font-size: 10px; padding: 2px 5px; }
  .controls { margin-top: 18px; gap: 10px; }
  .note { font-size: 10px; }
  /* 縦長: 1 段目にスイッチとログイン、2 段目に説明 */
  .mode-bar { flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; margin-top: 8px; }
  .mode-bar .note { order: 3; flex: 0 0 100%; }
  .mode-switch button { min-width: 54px; padding: 7px 10px; }
  .btn.primary.login-btn { padding: 9px 12px; font-size: 12px; }
  .chips { width: 100%; justify-content: center; gap: 7px; padding: 6px 10px 7px; }
  .chips .chip { --cs: 40px; }
  .actions { width: 100%; gap: 6px; }
  .actions .btn { flex: 1; padding: 12px 4px; font-size: 12px; gap: 3px; letter-spacing: 0.02em; }
  .btn .ico { width: 15px; height: 15px; }
  .actions #rebet { flex: 1.35; }
}

/* 幅の狭いスマホ: 上の帯(ロゴ・残高・言語・遊び方・音)を 1 行に収める。ロゴは残りの幅に合わせて縮む。
   残高の名札(DEMO / $WSOG)は出さず、数字の色で見分ける(モードは下のスイッチにも出ている) */
@media (max-width: 480px) {
  .topbar { gap: 5px; padding-left: 8px; padding-right: 8px; }
  .logo { flex: 0 1 150px; min-width: 64px; }
  .logo img { width: 100%; height: auto; }
  .wallet { flex: none; padding: 6px 10px; }
  .wallet-label { display: none; }
  #balance { font-size: 15px; }
  .wallet[data-mode="demo"] #balance { background: linear-gradient(180deg, #fff 10%, #d8f6ff 40%, #36d6ff 80%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 6px rgba(54, 214, 255, 0.55)) drop-shadow(0 2px 0 rgba(0, 30, 60, 0.9)); }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn .ico { width: 16px; height: 16px; }
  button.lang-button { height: 32px; padding: 0 8px 0 6px; gap: 3px; }
  .lang-button::before { width: 15px; height: 15px; }
  .lang-button b { font-size: 12px; }
}

/* ---------- 公平性のページ(fair.html) ---------- */
/* ゲームの画面は 1 画面に固定して流さないが、このページは縦に読む */
html:has(body.fairpage), body.fairpage { height: auto; min-height: 100%; overflow: visible; }
body.fairpage {
  user-select: text; line-height: 1.65; font-size: 14px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(154, 91, 255, 0.35), transparent 70%), radial-gradient(900px 500px at 100% 30%, rgba(255, 63, 208, 0.16), transparent 70%), #07031a;
  background-attachment: fixed;
}
.fair-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 16px 10px; background: linear-gradient(to bottom, rgba(7, 3, 26, 0.95), rgba(7, 3, 26, 0.7)); backdrop-filter: blur(8px); }
.fair-sp { flex: 1; }
.fair-back { text-decoration: none; padding: 9px 16px 9px 12px; }
.fair-wrap { max-width: 880px; margin: 0 auto; padding: 8px 16px calc(40px + var(--safe-b)); display: grid; gap: 18px; }
.fair-mast { text-align: center; padding: 6px 0 2px; }
.fair-logo { display: block; width: min(260px, 60%); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 0 16px rgba(255, 63, 208, 0.4)); }
.fair-eyebrow { margin: 0; color: var(--muted); font-weight: 800; letter-spacing: 0.2em; font-size: 12px; }
.fair-mast h1 {
  margin: 2px 0 6px; font: 900 clamp(34px, 8vw, 58px)/1 var(--display); letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 35%, var(--gold) 62%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 215, 106, 0.45)) drop-shadow(0 4px 0 rgba(60, 20, 0, 0.9));
}
.fair-lead { margin: 0 auto; max-width: 34em; color: var(--ink); font-size: 15px; }
.fair-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fair-pillar, .fair-panel {
  border: 2px solid transparent; border-radius: 18px;
  background: linear-gradient(180deg, rgba(34, 12, 92, 0.86), rgba(12, 5, 36, 0.94)) padding-box,
    linear-gradient(160deg, rgba(255, 244, 196, 0.9), rgba(255, 215, 106, 0.55) 25%, rgba(156, 100, 20, 0.5) 55%, rgba(255, 215, 106, 0.6)) border-box;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.fair-pillar { padding: 16px 16px 14px; }
.fair-pillar svg { width: 40px; height: 40px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(255, 215, 106, 0.5)); }
.fair-pillar h3 { margin: 8px 0 4px; color: var(--gold-hi); font-size: 15px; }
.fair-pillar p { margin: 0; color: var(--muted); font-size: 13px; }
.fair-panel { padding: 18px 18px 16px; }
.fair-panel h2 { margin: 0 0 10px; color: var(--gold); font: 900 20px/1.2 var(--display); }
.fair-panel h3 { margin: 0; color: var(--gold-hi); font-size: 15px; }
.fair-dim { color: var(--muted); font-size: 12px; }
.fair-past-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.fair-round { position: relative; margin: 8px 0; padding: 12px 14px; border-radius: 12px; background: rgba(5, 2, 20, 0.55); border: 1px solid rgba(255, 255, 255, 0.1); }
.fair-round.cur { border-color: rgba(54, 214, 255, 0.5); box-shadow: 0 0 18px rgba(54, 214, 255, 0.15); }
.fr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fr-head b { font: 900 14px/1.2 var(--display); color: #fff; }
.fr-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.fr-meta b { color: var(--gold-hi); }
.fair-chip { display: inline-block; padding: 3px 9px; border-radius: 6px; font: 900 11px/1.2 var(--display); letter-spacing: 0.03em; white-space: nowrap; }
.fair-reel.hit { color: var(--gold-hi); font-weight: 800; }
.fair-boost { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font: 900 10px/1.4 var(--display); color: #1a0b48; background: linear-gradient(180deg, #fff, var(--gold)); }
.fair-tag { padding: 2px 8px; border-radius: 999px; font: 900 10px/1.4 var(--display); letter-spacing: 0.06em; color: #fff; background: rgba(255, 63, 109, 0.75); }
.fair-tag.live { display: inline-block; margin-bottom: 6px; color: #04263a; background: linear-gradient(180deg, #d8f6ff, #36d6ff); }
.fair-round dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 12px; }
.fair-round dt { color: var(--muted); font-weight: 800; }
.fair-round dd { margin: 0; min-width: 0; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11.5px; overflow-wrap: anywhere; color: #e9e2ff; }
.fr-act { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; margin-top: 10px; }
.fr-act .btn, .fair-past-head .btn, .fair-manual .btn { padding: 8px 16px; font-size: 13px; }
.fair-res { font-size: 12.5px; font-weight: 700; }
.fair-res .ok, .ok { color: #5ee6a8; }
.fair-res .ng, .ng { color: #ff6b8e; }
.fair-manual { display: flex; gap: 8px; }
.fair-manual input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 2, 20, 0.7); color: #fff;
  font: 13px ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.fair-manual input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.fair-rtp { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.fair-rtp th, .fair-rtp td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); text-align: start; }
.fair-rtp th { color: var(--muted); font-size: 12px; }
.fair-rtp td:last-child, .fair-rtp th:last-child { text-align: end; font-weight: 800; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.fair-how p { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.fair-how a { color: var(--gold-hi); }
@media (max-width: 700px) {
  .fair-pillars { grid-template-columns: 1fr; }
  .fair-panel { padding: 16px 14px 14px; }
  .fair-top { padding-left: 10px; padding-right: 10px; }
}

/* ---------- 上の帯の「← WSOG」とメニュー(ポップアップ) ----------
   見た目はこのゲームの金の縁の宝石のまま。できることは WSOG のほかのゲームのバー(wsog-baccarat の topbar.js)と同じ:
   入金・$WSOG の購入・ベット履歴・DEMO / REAL・言語・音・ログイン。帯には「← WSOG」・ロゴ・残高・メニューだけを出す */
.home-btn { width: auto; height: 40px; padding: 0 14px 0 9px; gap: 4px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; color: var(--ink); font: 900 12px/1 var(--display); letter-spacing: 0.06em; }
.home-btn span { background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 40%, var(--gold) 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
button.wallet { font: inherit; color: var(--ink); cursor: pointer; align-items: center; transition: transform 0.15s, box-shadow 0.2s; }
button.wallet:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 215, 106, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
button.wallet:active { transform: translateY(1px) scale(0.97); }
.wallet-caret { width: 0; height: 0; margin-left: 2px; border: 5px solid transparent; border-top: 6px solid var(--gold); border-bottom: 0; align-self: center; filter: drop-shadow(0 0 3px rgba(255, 200, 90, 0.7)); }
.wallet[aria-expanded="true"] .wallet-caret { transform: rotate(180deg); }
.ico-back { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14.8 5.2L8 12l6.8 6.8' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-menu { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4.5 6.5h15M4.5 12h15M4.5 17.5h15' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'/></svg>"); }
.ico-user { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='8' r='4.2'/><path d='M3.8 21c.6-4.6 4-7.2 8.2-7.2s7.6 2.6 8.2 7.2z'/></svg>"); }
.ico-deposit { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3.5v10M7.5 9.5L12 14l4.5-4.5' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/><path d='M4 15.5v4h16v-4' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-buy { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9.2' fill='none' stroke='black' stroke-width='2.2'/><path d='M12 7v10M7 12h10' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/></svg>"); }
.ico-history { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4.6 12a7.4 7.4 0 1 0 2.2-5.3' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/><path d='M3.4 3.6l.5 4.9 4.8-1z'/><path d='M12 7.6v4.8l3.2 2' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-globe { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3c2.8 2.6 4 5.6 4 9s-1.2 6.4-4 9c-2.8-2.6-4-5.6-4-9s1.2-6.4 4-9z'/></svg>"); }
.ico-logout { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 4.5H5.5v15H10' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/><path d='M10.5 12h9M16 8l4 4-4 4' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }

.menu { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.menu[hidden] { display: none; }
.menu-card {
  pointer-events: auto; position: absolute; right: 12px; top: calc(var(--safe-t) + 62px);
  width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - var(--safe-t) - 74px); overflow-y: auto; overscroll-behavior: contain;
  padding: 14px; border-radius: 20px; border: 2px solid transparent;
  background: radial-gradient(130% 90% at 50% 0%, rgba(118, 66, 255, 0.55), rgba(26, 9, 74, 0.97) 50%, rgba(9, 3, 30, 0.99)) padding-box,
    linear-gradient(160deg, #fffbe6 0%, #ffd76a 22%, #9c6414 48%, #ffe9a0 68%, #b77a18 86%, #fff1b8 100%) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 18px 48px rgba(0, 0, 0, 0.7), 0 0 34px rgba(255, 63, 208, 0.3);
  animation: menuin 0.18s ease-out;
}
@keyframes menuin { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.menu-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; font-size: 14px; }
.menu-who #menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head .icon-btn { width: 32px; height: 32px; }
.menu-head .icon-btn .ico { width: 14px; height: 14px; }
.menu-bal { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.menu-bal b { font: 900 26px/1 var(--display); font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff 10%, var(--gold-hi) 35%, var(--gold) 62%, #d99a2a 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px rgba(255, 215, 106, 0.55)); }
.menu-bal[data-mode="demo"] b { background-image: linear-gradient(180deg, #fff 10%, #d8f6ff 40%, #36d6ff 80%); filter: drop-shadow(0 0 6px rgba(54, 214, 255, 0.55)); }
.menu-bal .wallet-label { padding: 3px 8px; border-radius: 999px; font: 900 10px/1 var(--display); letter-spacing: 0.08em; }
.menu-bal[data-mode="demo"] .wallet-label { color: #04263a; background: linear-gradient(180deg, #d8f6ff, #36d6ff); }
.menu-bal[data-mode="real"] .wallet-label { color: #3a2400; background: linear-gradient(180deg, #fffbe6, var(--gold)); }
.menu-mode { display: flex; justify-content: center; margin: 10px auto 0; width: max-content; }
.menu-note { margin: 8px 2px 0; font-size: 11px; line-height: 1.5; color: var(--muted); text-align: center; }
.menu-note:empty { display: none; }
.menu-acts { display: flex; gap: 8px; margin-top: 10px; }
.menu-acts[hidden] { display: none; }
.menu-acts .btn { flex: 1; justify-content: center; text-decoration: none; font-size: 12px; padding: 10px 6px; }
.menu-login { display: block; margin-top: 10px; text-align: center; text-decoration: none; }
.menu-login[hidden] { display: none; }
.menu-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 215, 106, 0.25); }
.menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; text-align: start; text-decoration: none; cursor: pointer;
}
.menu-item[hidden] { display: none; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 215, 106, 0.1); outline: none; }
.menu-item > span:not([data-lang-slot]) { flex: 1; }
.menu-ext { margin-left: auto; font-style: normal; font-size: 12px; color: var(--gold); opacity: 0.8; }
.menu-state { margin-left: auto; padding: 3px 9px; border-radius: 999px; font: 900 10px/1 var(--display); letter-spacing: 0.08em; color: #3a2400; background: linear-gradient(180deg, #fffbe6, var(--gold)); }
#mute[aria-pressed="true"] .menu-state { color: var(--ink); background: rgba(255, 255, 255, 0.14); }
.menu-lang { cursor: default; }
.menu-lang:hover { background: transparent; }
.menu-lang button.lang-button { height: 34px; padding: 0 10px 0 8px; }
.menu-lang .lang-button span { display: inline; }

@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .home-btn { height: 36px; padding: 0 11px 0 7px; font-size: 11px; }
  .menu-card { top: calc(var(--safe-t) + 54px); right: 8px; }
}
@media (max-width: 480px) {
  .home-btn { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .home-btn span { display: none; }
  .wallet-caret { display: none; }
  .menu-card { left: 8px; right: 8px; width: auto; }
}
/* ゲスト: 残高の代わりに「ログイン」。名札(DEMO / $WSOG)は出さない */
.wallet.guest .wallet-label { display: none; }
.wallet.guest #balance { font-size: 14px; letter-spacing: 0.04em; }
.menu-bal[hidden] { display: none; }
