/* Lucky Dice — Midnight Arcade */
@font-face { font-family: "Geist"; src: url(fonts/geist-normal.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/instrumentserif-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/instrumentserif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --bg: #100c12;
  --wine: #632235;
  --crim: #bc3953;
  --rose: #ff8d9d;
  --blush: #ffcabf;
  --purple: #532344;
  --violet: #d2a6ae;
  --gold: #ffcea7;
  --text: #fff0eb;
  --muted: #cdb2bb;
  --glass: rgba(255, 255, 255, .06);
  --glass-b: rgba(255, 255, 255, .13);
  --ok: #5ee0a0;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "Geist", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(ellipse at 62% 0%, #322035 0%, transparent 62%),
    radial-gradient(ellipse at 50% 112%, #3d1827 0%, transparent 53%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
input, textarea, select { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%); }

#app { position: fixed; inset: 0; z-index: 2; max-width: 640px; margin: 0 auto; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: calc(var(--sat) + 10px) calc(var(--sar) + 16px) calc(var(--sab) + 12px) calc(var(--sal) + 16px);
  gap: 12px;
}
.screen.active { display: flex; animation: screenIn .24s var(--ease) both; }
.screen.leaving { display: flex; animation: screenOut .16s ease both; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes screenOut { to { opacity: 0; transform: translateY(-4px); } }

.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.screen-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 6vw, 2.3rem); letter-spacing: .02em; margin: 0; text-align: center; flex: 1; }
.spacer { width: 44px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foot { text-align: center; font-size: .72rem; color: var(--muted); margin: 0; letter-spacing: .04em; }

/* ---------- surfaces ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.pad { padding: 16px; }
.glow {
  border: 1.5px solid transparent;
  background:
    linear-gradient(160deg, #30131b, #1a0e13) padding-box,
    linear-gradient(135deg, #88544c, #3f2428) border-box;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}
@keyframes spinGlow { to { --a: 360deg; } }
.sec { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin: 0 0 10px; letter-spacing: .03em; color: var(--blush); }
.hint { margin: -4px 0 10px; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.err { color: #ff8aa6; font-size: .86rem; margin: 0; min-height: 0; text-align: center; }
.err:empty { display: none; }

/* ---------- buttons ---------- */
.btn {
  min-height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 650; letter-spacing: .03em; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden;
  transition: transform .15s var(--ease), filter .2s, box-shadow .25s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .42; filter: grayscale(.4); }
.btn-primary {
  background: linear-gradient(110deg, #ffc1b7, #fda1a5 66%, #f88da3);
  color: #29101b; border: 1px solid #ffd1cb;
  box-shadow: 0 8px 26px rgba(110, 16, 31, .45), inset 0 1px rgba(255, 255, 255, .15);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn-primary > span[aria-hidden] { position: absolute; right: 18px; }
.btn-glass { background: var(--glass); border: 1px solid var(--glass-b); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost { color: var(--muted); }
.btn-danger { background: linear-gradient(135deg, #7a1236, #3d0a22); border: 1px solid rgba(255, 77, 125, .4); }
.btn-gold { background: linear-gradient(135deg, #f1d28f, #b88a3a); color: #2a1305; box-shadow: 0 8px 26px rgba(232, 194, 122, .35); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .88rem; border-radius: 12px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-b); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.icon-btn.sm { width: 38px; height: 38px; border-radius: 12px; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm svg { width: 19px; height: 19px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
input[type=text], input[type=number], input:not([type]), textarea, select {
  width: 100%; font: inherit; color: var(--text); background: rgba(0, 0, 0, .35);
  border: 1px solid var(--glass-b); border-radius: 12px; padding: 12px 14px; font-size: 1rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255, 77, 125, .2); }
textarea { resize: none; min-height: 110px; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: #1a0a16; color: var(--text); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err-field input { border-color: #ff6b8e; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .95rem; line-height: 1.4; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: 0 0 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--glass-b); background: rgba(0, 0, 0, .3); display: grid; place-items: center; margin-top: 1px; transition: .2s; }
.check input:checked + .box { background: linear-gradient(135deg, var(--crim), var(--purple)); border-color: transparent; }
.check input:checked + .box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input:focus-visible + .box { outline: 2px solid var(--gold); outline-offset: 2px; }
.rules { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 8px; font-size: .9rem; color: #e8d6de; line-height: 1.4; }
.rules li::marker { color: var(--rose); }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 14px; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: .78rem; }
input.switch { appearance: none; -webkit-appearance: none; flex: 0 0 52px; width: 52px; height: 30px; border-radius: 20px; background: rgba(255, 255, 255, .12); position: relative; cursor: pointer; transition: background .25s; padding: 0; border: 1px solid var(--glass-b); }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
input.switch:checked { background: linear-gradient(135deg, var(--crim), var(--purple)); }
input.switch:checked::after { transform: translateX(22px); }
input.switch:disabled { opacity: .45; }
input[type=range] { width: 100%; accent-color: var(--rose); height: 32px; background: none; padding: 0; border: 0; box-shadow: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 999px; font-size: .82rem; background: var(--glass); border: 1px solid var(--glass-b); transition: .2s; display: inline-flex; gap: 6px; align-items: center; }
.chip.off { opacity: .5; text-decoration: line-through; border-style: dashed; }
.chip.on { background: linear-gradient(135deg, rgba(214, 18, 63, .5), rgba(109, 40, 217, .5)); border-color: rgba(255, 77, 125, .5); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: rgba(0, 0, 0, .3); padding: 4px; border-radius: 14px; border: 1px solid var(--glass-b); }
.seg button { padding: 10px 4px; border-radius: 10px; font-size: .88rem; color: var(--muted); transition: .2s; }
.seg button.on { background: linear-gradient(135deg, var(--crim), var(--purple)); color: #fff; box-shadow: 0 4px 14px rgba(214, 18, 63, .4); }

/* setup: modes + levels */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode { text-align: left; padding: 11px 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-b); display: grid; gap: 3px; transition: .2s; position: relative; }
.mode b { font-size: .92rem; display: flex; gap: 6px; align-items: center; }
.mode small { color: var(--muted); font-size: .72rem; line-height: 1.3; }
.mode.on { border-color: var(--rose); background: linear-gradient(135deg, #4b2027, #2b141c); }
.mode[data-m="midnight"] { grid-column: 1 / -1; padding: 13px 46px 13px 13px; }
.mode .tag18 { position: absolute; top: 8px; right: 8px; font-size: .6rem; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .5); color: var(--gold); border: 1px solid rgba(232, 194, 122, .4); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lvl { padding: 10px 2px 8px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-b); display: grid; gap: 4px; justify-items: center; font-size: .66rem; color: var(--muted); transition: .2s; text-align: center; line-height: 1.15; }
.lvl .n { font-family: var(--font-display); font-size: 1.4rem; color: var(--text); line-height: 1; }
.lvl .flames { display: flex; gap: 2px; }
.lvl .flames i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.lvl .flames i.f { background: var(--rose); box-shadow: 0 0 6px var(--rose); }
.lvl.on { border-color: var(--rose); background: linear-gradient(160deg, rgba(214, 18, 63, .35), rgba(109, 40, 217, .35)); color: #fff; }
.lvl:disabled { opacity: .4; }

/* ---------- lobby ---------- */
#app[data-screen="home"] { max-width: 1264px; border: 0; background: none; }
#screen-home {
  gap: clamp(14px, 3vh, 26px);
  overflow-y: auto;
  padding: calc(var(--sat) + 16px) max(16px, var(--sar)) calc(var(--sab) + 16px) max(16px, var(--sal));
}
.lobby-nav, .lobby-hero, .lobby-games { flex: 0 0 auto; }
.lobby-nav { min-height: 45px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lobby-brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-weight: 660; }
.brand-mark { color: var(--gold); width: 32px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #b75d716b; border-radius: 10px; background: #71294055; }
.lobby-nav-actions { display: flex; align-items: center; gap: 9px; }
.lobby-nav .icon-btn { width: 40px; height: 40px; border-radius: 12px; }
.nav-text { min-height: 44px; font-size: .88rem; padding: 0 10px; color: var(--muted); white-space: nowrap; }
.nav-text:hover { color: #fff; }
.lobby-hero {
  position: relative; display: grid; overflow: hidden; isolation: isolate;
  border: 1px solid #98546a7d; border-radius: 27px;
  background:
    radial-gradient(ellipse at 78% 72%, #a22b4e69, transparent 57%),
    linear-gradient(125deg, #201120 8%, #261320 47%, #3c1428 100%);
  box-shadow: 0 28px 75px #08040a7a, inset 0 1px #ffb2bc24;
}
.lobby-copy { display: grid; align-content: center; align-items: start; justify-items: start; gap: 13px; padding: 27px 21px 18px; z-index: 1; }
.lobby-kicker { display: flex; align-items: center; gap: 8px; margin: 0; color: #f6c4c6; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lobby-kicker span { width: 6px; height: 6px; border-radius: 50%; background: #ff9aac; box-shadow: 0 0 13px #f8698f; }
.lobby-title { font: 400 clamp(3.3rem, 13vw, 5.45rem)/.87 var(--font-display); letter-spacing: -.035em; margin: 0; }
.lobby-title em { color: var(--blush); font-weight: 400; }
.lobby-description { margin: 0; color: #e8cbd0; max-width: 32ch; line-height: 1.5; font-size: .91rem; }
.desktop-break { display: none; }
.lobby-cta { display: grid; width: min(100%, 290px); gap: 8px; margin-top: 7px; }
.lobby-cta .btn { justify-content: space-between; padding-inline: 16px; }
.lobby-cta .btn-glass > span { display: none; }
.lobby-art { position: relative; min-height: 162px; height: clamp(162px, 27dvh, 270px); overflow: hidden; display: grid; place-items: center; }
.table-atmosphere, .table-outline { position: absolute; pointer-events: none; }
.table-atmosphere { inset: 0; background: radial-gradient(ellipse at 50% 53%, #ed51765b, #79244851 35%, transparent 67%); }
.table-outline {
  inset: 18% 10%;
  border: 1px solid #ffc7b038; border-radius: 50%;
  transform: rotate(-21deg);
  box-shadow: 0 0 0 12px #ffadb411, 0 0 0 32px #ffadb40b, 0 0 60px #ec57772b;
}
.hero-dice { position: relative; }
.table-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.webgl-ready .hero-dice, .webgl-ready > .dice-scene, .webgl-ready > .dice-shadow { visibility: hidden; }
.lobby-games { display: grid; gap: 8px; }
.lobby-game {
  display: grid; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 12px;
  padding: 12px; min-width: 0; min-height: 68px; text-align: left; border-radius: 15px;
  border: 1px solid #fdbbc62a; background: linear-gradient(125deg, #261722, #1e141f);
  transition: transform .22s var(--ease), border-color .22s, background .22s;
}
.lobby-game:hover { transform: translateY(-3px); border-color: #f999ae8f; background: #33202c; }
.lobby-game:active { transform: scale(.98); }
.lobby-game b, .lobby-game small { display: block; }
.lobby-game b { font-size: .97rem; font-weight: 660; }
.lobby-game small { font-size: .76rem; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.lobby-game-icon { display: grid; width: 100%; aspect-ratio: 1; place-items: center; font-size: 1.16rem; color: var(--blush); background: #a33b5533; border: 1px solid #ff91ad38; border-radius: 10px; }
.lobby-arrow { color: #f3b6c2; justify-self: end; }
#screen-home .foot { margin-top: auto; }

@media (min-width: 760px) {
  #screen-home { padding-inline: max(28px, var(--sal)); }
  .lobby-hero { grid-template-columns: .92fr 1fr; min-height: clamp(365px, 57dvh, 575px); }
  .lobby-copy { gap: clamp(14px, 2.5vh, 24px); padding: 32px 0 36px clamp(28px, 5vw, 78px); }
  .lobby-title { font-size: clamp(5.3rem, 9vw, 8.8rem); }
  .lobby-title em { display: block; }
  .lobby-description { font-size: 1rem; max-width: 34ch; }
  .desktop-break { display: initial; }
  .lobby-art { height: auto; min-height: 100%; }
  .lobby-games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
  .lobby-game { padding: 15px; min-height: 86px; }
  .lobby-game-icon { border-radius: 11px; }
}
@media (max-width: 440px) {
  .lobby-nav { gap: 7px; }
  .lobby-nav-actions { gap: 3px; }
  .lobby-nav .icon-btn { width: 34px; height: 38px; }
  .nav-text { font-size: .74rem; padding: 0 5px; }
}
@media (max-width: 350px) {
  .lobby-brand { font-size: .83rem; gap: 6px; }
  .brand-mark { width: 26px; }
  .lobby-nav .js-fs { display: none; }
}

/* ---------- 3D dice ---------- */
.dice-scene { --s: 104px; width: var(--s); height: var(--s); perspective: 620px; margin: 0 auto; }
.dice-tilt { width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(-28deg); }
.dice { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transform: rotateX(0) rotateY(0); }
.dice .face {
  position: absolute; inset: 0; border-radius: 16px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15px; backface-visibility: hidden;
  background: radial-gradient(circle at 28% 22%, #ad3c44 0%, #641923 55%, #2a1017 100%);
  border: 1.5px solid rgba(232, 194, 122, .55);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .05);
}
.dice .face::before { content: ""; position: absolute; inset: 0; border-radius: 15px; background: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 40%); pointer-events: none; }
.pip { border-radius: 50%; align-self: center; justify-self: center; width: 78%; aspect-ratio: 1; background: radial-gradient(circle at 35% 30%, #fff8e6, #e8c27a 60%, #9c722a); box-shadow: 0 0 10px rgba(232, 194, 122, .6), inset 0 -2px 3px rgba(0, 0, 0, .35); }
.dice .f1 { transform: translateZ(calc(var(--s) / 2)); }
.dice .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.dice .f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.dice .f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.dice .f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.dice .f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.hero-dice .dice { animation: heroSpin 14s linear infinite; }
@keyframes heroSpin { to { transform: rotateX(360deg) rotateY(360deg); } }

.dice-area { position: relative; display: grid; place-items: center; height: 176px; flex: 0 0 auto; padding-top: 22px; }
.dice-area .dice-scene { --s: 112px; }
.dice-hop { width: 100%; height: 100%; transform-style: preserve-3d; }
.dice-area.rolling .dice-hop { animation: hop var(--roll-ms) cubic-bezier(.3, .6, .4, 1); }
@keyframes hop {
  0% { transform: translateY(0) scale(1); } 18% { transform: translateY(-52px) scale(1.12); } 36% { transform: translateY(0) scale(.96); }
  52% { transform: translateY(-26px) scale(1.05); } 68% { transform: translateY(0); } 80% { transform: translateY(-8px); } 100% { transform: translateY(0); }
}
.dice-shadow { position: absolute; bottom: 8px; left: 50%; width: 92px; height: 18px; margin-left: -46px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 77, 125, .5), transparent); filter: blur(3px); }
.dice-area.rolling .dice-shadow { animation: shadow var(--roll-ms) cubic-bezier(.3, .6, .4, 1); }
@keyframes shadow { 18% { transform: scale(.5); opacity: .4; } 36% { transform: scale(1); } 52% { transform: scale(.7); opacity: .6; } 68%, 100% { transform: scale(1); opacity: 1; } }
.dice-idle .dice-tilt { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: rotateX(-22deg) rotateY(-28deg) translateY(-6px); } }

/* ---------- HUD ---------- */
.hud { display: flex; flex-direction: column; gap: 8px; }
.hud-row { display: flex; align-items: center; gap: 8px; }
.round-pill { flex: 1; text-align: center; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-pill small { display: block; font-family: var(--font-ui); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
.lvl-chip { height: 38px; padding: 0 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-b); font-size: .78rem; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lvl-chip b { color: var(--rose); font-family: var(--font-display); font-size: 1.1rem; }
.scorebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); width: 100%; text-align: left; }
.sb-p { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sb-p.r { flex-direction: row-reverse; text-align: right; }
.sb-p .nm { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.sb-p .pt { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--gold); min-width: 1.2ch; text-align: center; }
.sb-p.turn .nm { color: var(--rose); font-weight: 700; }
.sb-vs { color: var(--muted); font-size: .65rem; letter-spacing: .2em; }
.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.5); color: #fff; } }

/* ---------- stage ---------- */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; position: relative; }
.stage::-webkit-scrollbar { display: none; }
.stage > * { flex: 1 0 auto; }
.enter { animation: stageIn .23s var(--ease) both; }
@keyframes stageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.roll-stage, .choose, .challenge { display: flex; flex-direction: column; gap: 12px; }
.challenge { justify-content: center; }
.roll-stage { padding-top: 6px; }
.roll-stage { justify-content: flex-start; }
.round-tag { text-align: center; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); padding-left: .26em; }
.roll-panel { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.who { text-align: center; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.15; }
.who b { color: var(--rose); font-style: italic; }
.who small { display: block; font-family: var(--font-ui); font-size: .75rem; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.num-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.num { aspect-ratio: 1; min-height: 48px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-b); font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; display: grid; place-items: center; position: relative; transition: transform .15s var(--ease), background .2s, box-shadow .2s; }
.num:active:not(:disabled) { transform: scale(.92); }
.num.sel { background: linear-gradient(135deg, var(--crim), var(--purple)); box-shadow: 0 0 22px rgba(214, 18, 63, .6); border-color: transparent; transform: translateY(-3px); }
.num.taken { opacity: .45; background: rgba(0, 0, 0, .35); border-style: dashed; }
.num.taken small { position: absolute; bottom: 2px; font-family: var(--font-ui); font-size: .5rem; letter-spacing: .04em; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; justify-content: center; gap: 18px; font-size: .75rem; color: var(--muted); }
.steps span { display: inline-flex; gap: 6px; align-items: center; }
.steps i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.steps .ok i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.steps .ok { color: var(--text); }
.locked-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lp { padding: 10px; border-radius: 16px; text-align: center; background: var(--glass); border: 1px solid var(--glass-b); }
.lp small { display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp b { font-family: var(--font-display); font-size: 1.9rem; color: var(--gold); letter-spacing: .1em; }
.lp.win { border-color: var(--gold); box-shadow: 0 0 24px rgba(232, 194, 122, .4); background: linear-gradient(160deg, rgba(232, 194, 122, .2), rgba(255, 255, 255, .04)); }
.result-banner { text-align: center; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; }
.result-banner em { color: var(--rose); font-style: italic; }
.result-banner small { display: block; margin-top: 4px; font-family: var(--font-ui); font-size: .82rem; color: var(--muted); }
.result-banner.miss em { color: var(--violet); }
.power-ping { text-align: center; padding: 8px; border-radius: 14px; font-size: .85rem; background: linear-gradient(90deg, rgba(232, 194, 122, .12), rgba(167, 139, 250, .12)); border: 1px solid rgba(232, 194, 122, .35); color: var(--gold); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 20px rgba(232, 194, 122, .35); } }

/* choose */
.banner { text-align: center; }
.banner h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; margin: 2px 0 0; line-height: 1.1; }
.banner h2 em { color: var(--rose); }
.banner p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { min-height: 92px; padding: 12px; border-radius: 18px; text-align: left; background: var(--glass); border: 1px solid var(--glass-b); display: flex; flex-direction: column; justify-content: space-between; gap: 4px; transition: transform .15s var(--ease), box-shadow .25s, border-color .2s; }
.choice:active:not(:disabled) { transform: scale(.97); }
.choice:hover:not(:disabled) { border-color: var(--rose); box-shadow: 0 0 22px rgba(214, 18, 63, .3); }
.choice:disabled { opacity: .4; }
.choice .ic { font-size: 1.5rem; }
.choice b { font-size: .95rem; }
.choice small { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.choice.wide { grid-column: 1 / -1; min-height: 74px; }
.choice.big { min-height: 130px; align-items: center; justify-content: center; text-align: center; }
.choice.big .ic { font-size: 2.4rem; }
.midnight-choose { justify-content: center; }
.quick-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-choice {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 12px;
  background: linear-gradient(140deg, #3b1922, #231117); border: 1px solid #6c373d; border-radius: 12px;
  text-align: left; font-size: .85rem; font-weight: 650; transition: background .16s, border-color .16s;
}
.quick-choice:hover, .quick-choice:active { background: #50232d; border-color: var(--rose); }
.quick-choice span { color: var(--gold); font-size: 1rem; flex: 0 0 18px; text-align: center; }
.choice-links { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-links > button { flex: 1 1 auto; }
.deck-row { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.deck-row > span { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.mini-seg { display: inline-flex; background: rgba(0, 0, 0, .3); border: 1px solid var(--glass-b); border-radius: 12px; padding: 3px; }
.mini-seg button { padding: 6px 11px; font-size: .78rem; border-radius: 9px; color: var(--muted); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-seg button.on { background: linear-gradient(135deg, var(--crim), var(--purple)); color: #fff; }
.power-card { padding: 12px 14px; border-radius: 18px; display: grid; gap: 8px; }
.power-card .pc-h { display: flex; align-items: center; gap: 10px; }
.power-card .pc-ic { font-size: 2rem; filter: drop-shadow(0 0 10px rgba(232, 194, 122, .7)); }
.power-card b { font-family: var(--font-display); font-size: 1.25rem; color: var(--gold); display: block; line-height: 1.1; }
.power-card small { color: #e5d1d9; font-size: .8rem; line-height: 1.3; }
.power-card .pc-a { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.back-row { display: flex; align-items: center; gap: 10px; }
.back-row h3 { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; flex: 1; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow-y: auto; padding: 2px 2px 6px; scrollbar-width: none; flex: 1; min-height: 0; align-content: start; }
.cat-grid::-webkit-scrollbar { display: none; }
.cat { padding: 11px 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); text-align: left; display: grid; gap: 2px; transition: .2s; position: relative; }
.cat:active:not(:disabled) { transform: scale(.97); }
.cat:hover:not(:disabled) { border-color: var(--rose); }
.cat:disabled { opacity: .35; }
.cat .ci { font-size: 1.35rem; }
.cat b { font-size: .86rem; line-height: 1.2; }
.cat small { color: var(--muted); font-size: .68rem; }
.cat.adult { border-color: rgba(232, 194, 122, .35); }
.cat.adult::after { content: "18+"; position: absolute; top: 8px; right: 8px; font-size: .58rem; color: var(--gold); border: 1px solid rgba(232, 194, 122, .4); border-radius: 6px; padding: 1px 5px; }
.cat.mine { border-color: rgba(167, 139, 250, .5); }
.empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 18px; line-height: 1.5; }

/* wheel */
.wheel-wrap { --w: min(74vw, 270px, 34dvh); position: relative; width: var(--w); aspect-ratio: 1; margin: 6px auto; flex: 0 0 auto; }
.wheel { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--gold); box-shadow: 0 0 34px rgba(214, 18, 63, .5), inset 0 0 28px rgba(0, 0, 0, .6); transition: transform 2.35s cubic-bezier(.12, .6, .08, 1); overflow: hidden; }
.wheel .lab { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.wheel .lab span { position: absolute; left: -14px; top: calc(var(--w) * -0.36); width: 28px; text-align: center; font-size: 1.35rem; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f1d28f, #8a6420); border: 2px solid #2a1305; display: grid; place-items: center; font-size: 1.2rem; z-index: 2; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); }
.wheel-ptr { position: absolute; left: 50%; top: -10px; margin-left: -11px; width: 22px; height: 30px; z-index: 3; background: linear-gradient(180deg, #fff3cf, var(--gold)); clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.wheel-name { text-align: center; font-family: var(--font-display); font-size: 1.35rem; min-height: 1.6em; color: var(--gold); }

/* mystery */
.mystery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; perspective: 800px; margin-top: 6px; }
.mcard { aspect-ratio: 3 / 4.4; position: relative; transform-style: preserve-3d; transition: transform .48s var(--ease); border-radius: 16px; }
.mcard .mf, .mcard .mb { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mcard .mf { background: radial-gradient(circle at 30% 20%, #6d1a52, #2a0a3d 70%); border: 1.5px solid rgba(232, 194, 122, .6); font-size: 2.2rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .5), 0 0 24px rgba(109, 40, 217, .35); animation: mfloat 3s ease-in-out infinite; }
.mcard:nth-child(2) .mf { animation-delay: -1s; } .mcard:nth-child(3) .mf { animation-delay: -2s; }
@keyframes mfloat { 50% { transform: translateY(-5px); } }
.mcard .mb { transform: rotateY(180deg); background: linear-gradient(160deg, #3d0a22, #14051c); border: 1.5px solid var(--gold); font-size: 2rem; }
.mcard.flip { transform: rotateY(180deg); }
.mcard.fade { opacity: .25; transition: opacity .5s; }

/* challenge */
.ch-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pill { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-b); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill.for { background: linear-gradient(135deg, rgba(214, 18, 63, .5), rgba(109, 40, 217, .5)); border-color: rgba(255, 77, 125, .5); }
.pill.gold { color: var(--gold); border-color: rgba(232, 194, 122, .5); }
.card-face { border-radius: 24px; padding: 22px 18px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 200px; flex: 0 1 auto; margin: auto 0; position: relative; overflow: hidden; }
.card-face.midnight-card { padding-inline: clamp(17px, 6vw, 30px); background: radial-gradient(ellipse at top, #492028, #1c0c12 80%); border-color: #8c5550; }
.midnight-card .cf-ic { color: var(--gold); }
.card-face .cf-ic { font-size: 1.8rem; filter: drop-shadow(0 0 10px rgba(255, 77, 125, .6)); }
.card-face h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; color: var(--gold); margin: 0; }
.card-face p { font-family: var(--font-display); font-size: clamp(1.18rem, 4.9vw, 1.5rem); line-height: 1.3; margin: 0; font-weight: 500; text-wrap: balance; }
.card-face.quiz p { font-size: clamp(1.15rem, 4.6vw, 1.4rem); }
.card-face.jackpot { animation: spinGlow 3s linear infinite; background: linear-gradient(160deg, rgba(60, 38, 8, .95), rgba(20, 8, 18, .95)) padding-box, conic-gradient(from var(--a), #fff3cf, #e8c27a, #b88a3a, #fff3cf) border-box; box-shadow: 0 0 40px rgba(232, 194, 122, .4); }
.card-face.flipin { animation: cardFlip .42s var(--ease) both; }
.card-face.jackpot.flipin { animation: cardFlip .42s var(--ease) both, spinGlow 3s linear infinite; }
@keyframes cardFlip { from { transform: perspective(720px) rotateX(-12deg) translateY(15px) scale(.945); opacity: 0; } }
.timer-box { display: flex; align-items: center; justify-content: center; gap: 16px; }
.timer { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.timer .trk { stroke: rgba(255, 255, 255, .1); }
.timer .bar { stroke: url(#tg); stroke: var(--rose); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--rose)); transition: stroke .3s; }
.timer.low .bar { stroke: #ffd24d; filter: drop-shadow(0 0 8px #ffd24d); }
.timer.low .t-read { animation: pulse2 1s ease-in-out infinite; }
.timer.done .bar { stroke: var(--ok); }
@keyframes pulse2 { 50% { transform: translate(-50%, -50%) scale(1.18); } }
.t-read { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.ch-actions.two { grid-template-columns: 1fr 1fr; }
.btn-ok { background: linear-gradient(135deg, #1fa971, #0f6b5a); box-shadow: 0 8px 24px rgba(31, 169, 113, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }

/* ---------- dock ---------- */
.dock { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 6px; border-radius: 18px; background: #1e1015; border: 1px solid var(--glass-b); }
.dock-btn { height: 52px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #e8d6de; transition: .2s; }
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:active:not(:disabled) { background: rgba(255, 255, 255, .1); transform: scale(.96); }
.dock-btn:disabled { opacity: .35; }
.dock-btn.stop { color: #ff9f99; background: #3d1c24; }

/* ---------- modal / sheet ---------- */
#modal-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(4, 1, 8, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: auto; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .25s ease both; }
.backdrop.center { align-items: center; padding: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; display: flex; flex-direction: column; padding: 18px 16px calc(var(--sab) + 16px); border-radius: 26px 26px 0 0; background: linear-gradient(170deg, rgba(40, 10, 34, .96), rgba(14, 5, 20, .98)); border: 1px solid var(--glass-b); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); animation: sheetUp .38s var(--ease) both; }
.center .sheet { border-radius: 26px; border: 1px solid var(--glass-b); max-height: 86dvh; padding-bottom: 18px; animation: pop .35s var(--ease) both; text-align: center; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-h h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; }
.sheet-b { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; padding-bottom: 4px; }
.sheet-b::-webkit-scrollbar { display: none; }
.sheet-f { display: grid; gap: 10px; margin-top: 14px; }
.center .sheet-f { grid-auto-flow: row; }
.big-ic { font-size: 3rem; margin-bottom: 4px; filter: drop-shadow(0 0 16px rgba(255, 77, 125, .6)); }
.center .sheet h2 { font-size: 1.8rem; }
.center .sheet p { color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.menu-list { display: grid; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); text-align: left; font-weight: 600; }
.menu-item span.i { font-size: 1.3rem; width: 28px; text-align: center; }
.menu-item small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; margin-top: 1px; }
.menu-item.danger { color: #ff8aa6; }

.score-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc { padding: 14px 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-b); text-align: center; }
.sc.lead { border-color: var(--gold); box-shadow: 0 0 24px rgba(232, 194, 122, .3); }
.sc h3 { margin: 0; font-family: var(--font-display); font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc .big { font-family: var(--font-display); font-size: 3.2rem; color: var(--gold); line-height: 1.05; }
.sc ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.sc li { display: flex; justify-content: space-between; }
.sc li b { color: var(--text); }
.hist { display: grid; gap: 8px; }
.h-item { padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-b); display: grid; gap: 4px; font-size: .86rem; }
.h-item .hh { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.h-item .st { font-weight: 700; }
.h-item .st.done { color: var(--ok); } .h-item .st.skipped { color: var(--violet); }
.h-item p { margin: 0; line-height: 1.4; color: #eddde4; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--gold); line-height: 1.1; }
.stat small { color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.set-group { display: grid; gap: 4px; padding: 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-b); }
.set-group h3 { margin: 0 0 6px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.set-group .switch-row { margin-top: 8px; }
.deck-card { padding: 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); display: grid; gap: 6px; }
.deck-card.inactive { opacity: .5; }
.deck-card h4 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.deck-card p { margin: 0; font-size: .85rem; color: #dcc8d1; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deck-card .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.deck-card .tags .pill { font-size: .6rem; padding: 3px 8px; }
.deck-card .ops { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.form { display: grid; gap: 12px; text-align: left; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row output { min-width: 3ch; text-align: right; font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); }
.help p, .help li { font-size: .9rem; line-height: 1.5; color: #e8d6de; }
.help h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--blush); margin: 8px 0 2px; }
.help ul { padding-left: 18px; margin: 4px 0; }
.privacy { font-size: .78rem; color: var(--muted); line-height: 1.4; }

/* toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--sab) + 96px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: rgba(20, 6, 22, .92); border: 1px solid var(--glass-b); padding: 10px 16px; border-radius: 14px; font-size: .88rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toastIn .35s var(--ease) both, toastOut .4s ease 2.4s both; max-width: 420px; text-align: center; backdrop-filter: blur(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- responsive ---------- */
@media (max-height: 700px) {
  .dice-area { height: 134px; } .dice-area .dice-scene { --s: 90px; }
  .hero-dice .dice-scene { --s: 84px; }
  .num { min-height: 42px; } .who { font-size: 1.25rem; }
  .card-face { min-height: 130px; padding: 14px; }
  .timer { width: 70px; height: 70px; } .dock-btn { height: 46px; }
  .choice { min-height: 78px; }
}
@media (max-height: 600px) {
  .dice-area { height: 110px; } .dice-area .dice-scene { --s: 74px; }
  .hud-row .round-pill small { display: none; }
}
@media (max-height: 540px) {
  .hero-dice .dice-scene { --s: 58px; }
}
@media (min-width: 521px) {
  #app { border-left: 1px solid rgba(255, 255, 255, .06); border-right: 1px solid rgba(255, 255, 255, .06); background: rgba(0, 0, 0, .15); }
  .sheet { border-radius: 26px; margin-bottom: 20px; border-bottom: 1px solid var(--glass-b); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .glow, .card-face.jackpot { animation: none; }
}
body.no-fx .hero-dice .dice, body.no-fx .glow { animation: none; }

.sheet.tall { min-height: 62dvh; }
.center .sheet .sheet-b { align-items: center; }

/* compact choose screen on short phones (keeps gameplay scroll-free) */
@media (max-height: 700px) {
  .banner h2 { font-size: 1.35rem; }
  .banner p { margin-top: 2px; font-size: .8rem; }
  .choose { gap: 8px; }
  .choice { min-height: 62px; padding: 9px 11px; }
  .choice small { display: none; }
  .choice .ic { font-size: 1.25rem; }
  .choice.big { min-height: 104px; }
  .choice.big small { display: block; }
  .power-card { padding: 9px 12px; gap: 6px; }
  .power-card .pc-ic { font-size: 1.6rem; }
  .power-card b { font-size: 1.1rem; }
  .power-card small { font-size: .74rem; }
  .deck-row > span { display: none; }
}

.ch-actions .btn { white-space: nowrap; }

/* step-by-step heat sequences */
.step-lab { font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 4px; }
.step-dots i { width: 26px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .16); transition: background .3s, box-shadow .3s; }
.step-dots i.on { background: var(--rose); box-shadow: 0 0 10px var(--rose); }

/* Arcade setup and turn selection */
.arcade-options { display: grid; gap: 8px; }
.arcade-options .mode { padding: 12px 14px; }
#activity-field { margin-top: 14px; }
.arcade-turn { justify-content: center; }
.arcade-turn h2 { font: 500 clamp(1.6rem, 7vw, 2.1rem)/1.1 var(--font-display); margin: 0; text-align: center; }
.arcade-turn .hint { text-align: center; margin: 0; }
.arcade-turn .chips { justify-content: center; }
.arcade-turn .chip[aria-pressed="true"] { border-color: var(--rose); background: var(--wine); }
#screen-game.arcade .back-row [data-act="back-main"] { display: none; }
#setup-oral { grid-column: 1 / -1; }
#setup-oral .switch-row { margin-top: 0; }
#screen-game.arcade .round-pill small { display: block; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; }
.arcade .choose:has(.mystery), .arcade .choose:has(.wheel-wrap) { justify-content: center; }
.mcard .mf { color: var(--gold); background: radial-gradient(ellipse at top left, #672a31, #29151b 75%); border-color: #995e52; box-shadow: inset 0 0 0 5px #29151b, inset 0 0 0 6px #724641; }

/* Turn feedback and action surfaces */
#screen-game .hud-row, #screen-setup .top-row, #screen-gate .top-row { min-height: 48px; }
#screen-game .hud { padding: 0 0 8px; border-bottom: 1px solid #ffc8d21f; }
#screen-game .round-pill { font-family: var(--font-ui); font-weight: 625; font-size: .94rem; }
#screen-game .round-pill small { color: #e0b7c3; }
#screen-game .lvl-chip { background: #a34b6533; border-color: #f6a3b450; }
#screen-game .lvl-chip b { color: var(--blush); }
#screen-game .dice-area { isolation: isolate; }
#screen-game .dice-area::before { content: ""; position: absolute; inset: 4% 12%; z-index: -1; background: radial-gradient(ellipse, #9b314f58, transparent 70%); }
#screen-game .dock { background: #241723; border-color: #f0b2c32d; box-shadow: 0 9px 28px #09050b69; }
#screen-game .dock-btn { flex-direction: row; gap: 7px; height: 47px; font-size: .71rem; letter-spacing: .07em; white-space: nowrap; }
#screen-game .dock-btn svg { width: 17px; height: 17px; }
#screen-game .dock-btn.stop { background: #79304755; }
.arcade-turn h2 { font-size: clamp(1.9rem, 9vw, 3.2rem); }
.arcade-turn > .btn { margin-inline: auto; width: min(100%, 420px); }
.arcade-turn > .hint { line-height: 1.55; font-size: .93rem; }
.arcade-turn > .quick-choices { width: min(100%, 500px); margin-inline: auto; }
.arcade-turn .stat b { font-size: clamp(1.4rem, 7vw, 2.3rem); }
.arcade-turn .stat { min-width: 0; overflow-wrap: anywhere; }
.turn-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.turn-progress span { height: 3px; border-radius: 3px; background: #f6b2c129; }
.turn-progress .passed { background: #c55773; }
.turn-progress .current { background: var(--blush); box-shadow: 0 0 10px #ff809b85; }
.card-face:not(.jackpot) {
  border: 1px solid #fbb2b570; border-radius: 25px;
  background:
    radial-gradient(ellipse at 100% 0, #8c294e75, transparent 65%),
    radial-gradient(ellipse at 0 95%, #6b314a60, transparent 68%),
    #261623;
  box-shadow: 0 23px 60px #08050ac0, inset 0 0 0 5px #fed4d30b;
}
.card-face:not(.jackpot) p { font-size: clamp(1.44rem, 5.2vw, 2rem); }
.card-face h3 { color: #ffe0d0; }
.arcade .mcard .mf { color: #ffd7bf; background: repeating-conic-gradient(from 0deg at 50% 50%, #f3a5b211 0 5deg, transparent 5deg 13deg), radial-gradient(ellipse at 50% 48%, #813650, #351727 65%); box-shadow: inset 0 0 0 5px #321725, inset 0 0 0 6px #b16e7a, 0 9px 22px #0a050b73; }
.mcard:nth-child(1) { --delay: 0s; }
.mcard:nth-child(2) { --delay: .05s; }
.mcard:nth-child(3) { --delay: .10s; }
.mystery { animation: deal .35s var(--ease) both; }
.mcard { animation: deal .38s var(--ease) var(--delay) both; }
@keyframes deal { from { translate: 0 14px; opacity: 0; } }
.sheet { background: linear-gradient(145deg, #30202e, #18111a 68%); }
.sheet-h h2 { font-weight: 400; font-size: 1.95rem; }
.match-choices .quick-choice { min-height: 78px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.match-choices .quick-choice span { color: var(--blush); }
.match-result { text-align: center; color: var(--blush); font-size: 1rem; margin: 0; }
.match-result strong { color: var(--text); }
.no-fx .screen, .no-fx .enter, .no-fx .mcard, .no-fx .mcard .mf, .no-fx .mystery, .no-fx .card-face, .no-fx .dice-idle .dice-tilt { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
.draw-art { position: relative; width: min(205px, 68vw); height: clamp(105px, 21dvh, 155px); margin: 6px auto 12px; perspective: 500px; }
.draw-art span {
  position: absolute; left: 50%; top: 50%; width: 36%; height: 90%;
  display: grid; place-items: center; border: 1px solid #ffbda687; border-radius: 9px; color: #ffc7b6; font-size: 1.8rem;
  background: repeating-conic-gradient(#f9d1c80c 0 5deg, transparent 5deg 16deg), radial-gradient(ellipse at 25% 20%, #87314b, #382032 74%);
  box-shadow: inset 0 0 0 4px #482132, inset 0 0 0 5px #a9556d, 0 8px 21px #10081160;
  transform: translate(-50%, -50%) rotate(var(--fan, 0deg));
  animation: fanIn .48s var(--ease) both;
}
.draw-art span:nth-child(1) { --fan: -23deg; margin-left: -21%; }
.draw-art span:nth-child(2) { --fan: 22deg; margin-left: 21%; }
.draw-art span:nth-child(3) { animation-delay: .045s; }
@keyframes fanIn { from { transform: translate(-50%, -36%) rotate(0) scale(.88); opacity: 0; } }
.no-fx .draw-art span { animation: none; }
@media (prefers-reduced-motion: reduce) { .draw-art span, .lobby-game { animation: none; transition: none; } }
@media (max-height: 605px) { #screen-game .dock-btn { height: 42px; } }
.lobby-arrow { width: 14px; height: 14px; position: relative; display: block; transform: rotate(-45deg); }
.lobby-arrow::before, .lobby-arrow::after { content: ""; position: absolute; }
.lobby-arrow::before { width: 8px; height: 8px; right: 1px; top: 3px; border-top: 1.4px solid currentColor; border-right: 1.4px solid currentColor; transform: rotate(45deg); }
.lobby-arrow::after { width: 12px; height: 1.4px; background: currentColor; left: 0; top: 7px; }
.lobby-cta .lobby-arrow { color: inherit; }
.challenge { padding-block: 12px; }
.challenge .card-face { margin: 0; }
