/* REKT ARCADE - game shell + per-game styles. Mobile first: big targets, sticky controls. */
.game-intro .intro-grid { display: grid; gap: 22px; } @media (min-width: 860px) { .game-intro .intro-grid { grid-template-columns: 1fr 1fr; align-items: center; } }
.intro-art { position: relative; border: 4px solid #05041a; box-shadow: 0 0 0 2px var(--accent), 0 0 50px color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; } .intro-art .cover, .intro-art .cover svg { width: 100%; height: 100%; }
.intro-copy h1 { color: var(--accent); text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.how { padding-left: 1.2em; } .how li { margin: 6px 0; } .keys { font-family: var(--f-mono); font-size: .8rem; color: var(--dim); } .keys b { color: var(--accent); }
.best-line { font-family: var(--f-mono); font-size: .85rem; margin-top: 8px; } .best-line strong { color: var(--gold); }

.game-live { padding: 0 !important; max-width: 920px; display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h) - var(--safe-t)); min-height: calc(100svh - var(--top-h) - var(--safe-t)); }
.hud { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 20; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 8px max(14px, var(--safe-l)) 8px max(14px, var(--safe-r)); background: var(--bg); border-bottom: 2px solid var(--accent); }
.hud-title b { font-family: var(--f-display); font-size: .9rem; color: var(--accent); letter-spacing: .06em; } .hud-title em { font-style: normal; font-family: var(--f-mono); font-size: .65rem; background: var(--gold); color: #000; padding: 1px 6px; margin-left: 8px; }
.hud-score { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; } .hud-score small { font-family: var(--f-mono); font-size: .62rem; color: var(--dim); letter-spacing: .12em; } .hud-score .counter { font-size: 1.6rem; color: var(--text); text-shadow: 0 0 14px rgba(255,255,255,.2); }
.hud-sub { grid-column: 1; font-family: var(--f-mono); font-size: .72rem; color: var(--dim); } .hud-sub:empty { display: none; } .hud-side:empty { display: none; }
.hud-btns { grid-column: 2; grid-row: 2; display: flex; gap: 6px; justify-content: flex-end; } .hud-title { grid-row: 1; }
.stage { position: relative; flex: 1; padding: 12px max(14px, var(--safe-l)) calc(20px + var(--safe-b)) max(14px, var(--safe-r)); }
.stage.flash-good { animation: fgood .4s; } .stage.flash-bad { animation: fbad .45s; } @keyframes fgood { 30% { box-shadow: inset 0 0 70px rgba(183,255,42,.28); } } @keyframes fbad { 30% { box-shadow: inset 0 0 70px rgba(255,51,85,.34); } }
.stage.paused .play-area { filter: blur(6px); pointer-events: none; }
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(5,4,26,.78); } .overlay.hidden { display: none; } .pause-card { text-align: center; padding: 24px; background: var(--panel); border: 2px solid var(--accent); border-radius: 14px; width: min(88%, 380px); } .pause-card .cta-row { justify-content: center; }
.play-area { display: grid; gap: 12px; align-content: start; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; } .turn { font-family: var(--f-display); font-size: .85rem; color: var(--accent); letter-spacing: .08em; }
.combo { font-family: var(--f-mono); font-size: .8rem; color: var(--dim); } .combo.hot { color: var(--gold); text-shadow: 0 0 10px rgba(255,201,51,.6); animation: pulse 1s infinite; }

/* shared board pieces */
.chart-wrap { position: relative; background: #05041a; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; } .chart-wrap.short .chart { height: 90px; }
.chart-wrap .chart-svg, .chart-wrap .chart { width: 100%; display: block; } .chart { width: 100%; height: auto; }
.price { position: absolute; top: 8px; left: 12px; font-family: var(--f-display); font-size: 1.6rem; } .price small { font-family: var(--f-mono); font-size: .75rem; margin-left: 8px; } .price.up { color: var(--good); } .price.down { color: var(--bad); }
.alert { min-height: 1.4em; margin: 0; font-size: .88rem; color: var(--dim); } .alert.on { color: #ffd76a; background: rgba(255,201,51,.08); border-left: 4px solid var(--gold); padding: 8px 10px; }
.clues, .acct { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .acct { grid-template-columns: repeat(4, 1fr); }
.clue { background: var(--panel); border: 1px solid var(--line); padding: 8px 8px; border-radius: 8px; text-align: center; min-width: 0; } .clue small { display: block; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); } .clue b { font-family: var(--f-display); font-size: .95rem; }
.clue.good { border-color: rgba(183,255,42,.6); } .clue.good b { color: var(--good); } .clue.bad { border-color: rgba(255,51,85,.7); } .clue.bad b { color: #ff7d92; } .clue.warn { border-color: rgba(255,201,51,.6); } .clue.warn b { color: var(--gold); }
.mini-log { list-style: none; padding: 0; margin: 0; font-family: var(--f-mono); font-size: .72rem; color: var(--dim); display: grid; gap: 2px; }
.lesson { background: rgba(155,107,255,.1); border-left: 4px solid var(--purple); padding: 10px 12px; }

.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 10; padding: 6px 0; } .actions.three, .actions.four { grid-template-columns: 1fr; }
@media (min-width: 640px) { .actions.three { grid-template-columns: repeat(3, 1fr); } .actions.four { grid-template-columns: repeat(2, 1fr); } }
.act { min-height: 62px; display: grid; place-content: center; gap: 2px; padding: 8px 10px; text-align: center; background: var(--panel2); color: var(--text); border: 2px solid var(--line2); border-radius: 10px; cursor: pointer; font-family: var(--f-body); touch-action: manipulation; transition: transform .08s, border-color .15s, background .15s; } .act b { font-family: var(--f-display); font-size: .88rem; letter-spacing: .04em; } .act small { color: var(--dim); font-size: .68rem; font-family: var(--f-mono); }
.act:hover:not([disabled]) { border-color: var(--accent); } .act:active:not([disabled]) { transform: scale(.97); } .act[disabled] { opacity: .45; cursor: not-allowed; }
.act.good { border-color: rgba(183,255,42,.7); background: rgba(183,255,42,.08); } .act.warn { border-color: rgba(255,201,51,.7); background: rgba(255,201,51,.08); } .act.bad { border-color: rgba(255,51,85,.8); background: rgba(255,51,85,.1); }
.act.picked { border-color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); } .act.truth { border-color: var(--good); box-shadow: inset 0 0 0 2px var(--good); opacity: 1; }
.feedback { padding: 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; } .feedback.hidden { display: none; } .fb-head { margin: 0 0 6px; font-family: var(--f-display); text-transform: uppercase; font-size: .85rem; } .fb-head.good { color: var(--good); } .fb-head.bad { color: #ff7d92; } .fb-head.warn { color: var(--gold); } .fb-head b { margin-right: 8px; }

/* bot */
.tx-wrap { overflow-x: auto; border: 1px solid var(--line2); border-radius: 10px; background: #05041a; } .tx { font-family: var(--f-mono); font-size: .78rem; } .tx td { padding: 6px 10px; white-space: nowrap; } .tx tbody tr { animation: rowIn .35s both; animation-delay: calc(var(--i) * 45ms); } @keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } }
.tx .buy { color: var(--good); } .tx .sell { color: #ff7d92; }
.readout small { font-family: var(--f-mono); font-size: .65rem; letter-spacing: .08em; color: var(--cyan); }

/* candle */
.candle .ask { margin: 0; text-align: center; font-family: var(--f-display); text-transform: uppercase; font-size: .9rem; } .why { min-height: 2.6em; font-size: .85rem; color: var(--dim); margin: 0; }
.pop { position: absolute; right: 18px; top: 150px; font-family: var(--f-display); font-size: 2rem; opacity: 0; pointer-events: none; } .pop.show { animation: popUp .8s ease-out; } .pop.good { color: var(--good); } .pop.bad { color: var(--bad); } @keyframes popUp { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px); } }
.nlabel { font: 700 8px var(--f-mono); fill: #9a97c8; } .elabel { font: 700 9px var(--f-mono); fill: #b7ff2a; }

/* launch + shared choice buttons */
.choices { display: flex; flex-wrap: wrap; gap: 10px; } .choices.col { flex-direction: column; }
.choice { min-height: 52px; padding: 10px 14px; text-align: left; background: var(--panel2); color: var(--text); border: 2px solid var(--line2); border-radius: 10px; cursor: pointer; font: 600 .95rem var(--f-body); touch-action: manipulation; } .choice b { font-family: var(--f-display); font-size: .88rem; display: block; } .choice small { display: block; color: var(--dim); font-weight: 400; margin-top: 2px; }
.choice:hover:not([disabled]) { border-color: var(--accent); } .choice.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); } .choice[disabled] { opacity: .7; }
.event-card { padding: 16px; background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line2); border-left: 5px solid var(--accent); border-radius: 12px; display: grid; gap: 10px; } .event-card h2 { margin: 0; font-size: 1.15rem; text-transform: none; font-family: var(--f-body); font-weight: 800; line-height: 1.3; } .event-card small { font-family: var(--f-mono); letter-spacing: .1em; color: var(--accent); }
.typed { animation: fade .5s both; } .delayed { color: var(--gold); margin: 0; font-size: .88rem; }

/* detective */
.cases { display: grid; gap: 12px; margin-top: 12px; } @media (min-width: 720px) { .cases { grid-template-columns: repeat(3, 1fr); } }
.case-card { display: grid; gap: 6px; text-align: left; padding: 16px; background: var(--panel); color: var(--text); border: 2px solid var(--line2); border-radius: 12px; cursor: pointer; font-family: var(--f-body); } .case-card:hover { border-color: var(--accent); } .case-card b { font-family: var(--f-display); text-transform: uppercase; } .case-card span { color: var(--dim); font-size: .85rem; } .case-card small { font-family: var(--f-mono); color: var(--accent); }
.case-head p { color: var(--dim); margin: 4px 0 0; }
.graph-wrap { background: #05041a; border: 1px solid var(--line2); border-radius: 12px; touch-action: manipulation; } .graph-svg, .graph { width: 100%; height: auto; display: block; }
.gnode { cursor: pointer; outline: none; } .gnode:focus-visible circle:nth-child(2) { stroke: var(--cyan); } .gnode.sel circle:nth-child(2) { filter: drop-shadow(0 0 6px var(--lime)); }
.detail { display: grid; gap: 10px; } .wallet-card { padding: 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; display: grid; gap: 4px; } .wallet-card .mono { color: var(--cyan); font-size: .8rem; } .wallet-card p { margin: 0; color: #d4d1ff; font-size: .88rem; }
.edges { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .82rem; } .edges li { padding: 6px 8px; background: var(--panel); border-left: 3px solid var(--lime); } .edges b { font-family: var(--f-mono); color: var(--lime); margin-right: 4px; } .edges small { color: var(--dim); }
.timeline { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; } .timeline summary { cursor: pointer; font-family: var(--f-display); text-transform: uppercase; font-size: .85rem; min-height: 32px; } .timeline ol { margin: 8px 0 0; padding-left: 1.2em; font-size: .85rem; color: #d4d1ff; }
.question { padding: 16px; background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--accent); border-radius: 12px; display: grid; gap: 8px; } .question h2 { margin: 0; font-size: 1.05rem; text-transform: none; font-family: var(--f-body); font-weight: 800; } .question small { font-family: var(--f-mono); color: var(--accent); } .hint { color: var(--gold); font-size: .88rem; margin: 0; }

/* risk */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .seg-btn { min-height: 50px; background: var(--panel2); color: var(--text); border: 2px solid var(--line2); border-radius: 8px; cursor: pointer; font: 700 .9rem var(--f-display); touch-action: manipulation; } .seg-btn.sel { background: var(--accent); color: #0a0820; border-color: var(--accent); } .seg-btn.danger:not(.sel) { border-color: rgba(255,51,85,.6); color: #ff7d92; }
.risk-meter { position: relative; height: 16px; background: linear-gradient(90deg, rgba(183,255,42,.25), rgba(255,201,51,.25) 60%, rgba(255,51,85,.35)); border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; } .risk-meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width .25s; } .risk-meter.over i { background: var(--red); } .risk-meter .lim { position: absolute; left: 60%; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .7; }
.breakdown { display: grid; gap: 8px; margin-bottom: 14px; }

/* result screen */
.result { text-align: center; max-width: 820px; } .result .result-head small { font-family: var(--f-mono); letter-spacing: .2em; color: var(--accent); } .result h1 { font-size: clamp(2.2rem, 10vw, 4.4rem); margin: 6px 0; } .result.win h1 { color: var(--lime); text-shadow: 0 0 36px rgba(183,255,42,.45); } .result.lose h1 { color: var(--red); text-shadow: 0 0 36px rgba(255,51,85,.45); } .result .lead { margin: 0 auto 14px; }
.final-score small { display: block; font-family: var(--f-mono); letter-spacing: .2em; color: var(--dim); } .final-score .counter { font-size: clamp(2.8rem, 14vw, 5.5rem); color: var(--gold); text-shadow: 0 0 30px rgba(255,201,51,.4); }
.result .cta-row { justify-content: center; } .result .recap, .result .stats { text-align: left; } .result .stats { margin: 20px 0; } .result .unlocks { text-align: left; }
@media (max-width: 420px) { .acct { grid-template-columns: repeat(2, 1fr); } .clue b { font-size: .88rem; } }

/* ---- mobile in-game layout: immersive, compact HUD, controls always reachable ---- */
.actions { background: linear-gradient(to top, var(--bg) 62%, rgba(7,6,26,0)); margin: 0 calc(-1 * max(14px, var(--safe-l))) 0 calc(-1 * max(14px, var(--safe-r))); padding: 14px max(14px, var(--safe-r)) 6px max(14px, var(--safe-l)); }
@media (max-width: 1099px) {
  .in-game .topbar { display: none; }
  .in-game .view { padding-top: 0; }
  .game-live { min-height: 100vh; min-height: 100svh; }
  .hud { top: 0; padding-top: calc(8px + var(--safe-t)); grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 0 10px; }
  .hud-title { grid-column: 1; grid-row: 1; line-height: 1.2; }
  .hud-score { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .hud-score .counter { font-size: 1.9rem; line-height: 1.05; }
  .hud-sub { grid-column: 1; grid-row: 3; }
  .hud-side { grid-column: 1 / -1; grid-row: 4; }
  .hud-btns { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}
.how-title { font-size: 1rem; margin: 1.2em 0 .4em; color: var(--dim); font-family: var(--f-mono); letter-spacing: .14em; }
.start-row .btn.big { flex: 1 1 200px; }
@media (hover: none) and (pointer: coarse) { .keys { display: none; } }
@media (max-width: 859px) { .intro-art { aspect-ratio: 16 / 7; } .game-intro { padding-top: 14px; } }

/* ---- results: score reveal, grade stamp, staggered badges ---- */
.score-row { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin: 6px 0; }
.best-delta { display: block; font-style: normal; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; color: var(--dim); margin-top: 4px; }
.result.record .best-delta { color: var(--gold); }
.grade { display: grid; place-items: center; width: 92px; height: 92px; border: 4px solid var(--gc, var(--cyan)); color: var(--gc, var(--cyan)); background: rgba(5,4,26,.7); transform: rotate(-8deg) scale(0); animation: stamp .55s .9s cubic-bezier(.2,1.6,.4,1) forwards; clip-path: polygon(14% 0, 86% 0, 100% 14%, 100% 86%, 86% 100%, 14% 100%, 0 86%, 0 14%); box-shadow: inset 0 0 22px color-mix(in srgb, var(--gc, var(--cyan)) 25%, transparent); }
.grade small { font-family: var(--f-mono); font-size: .55rem; letter-spacing: .2em; margin-top: 6px; opacity: .8; } .grade b { font-family: var(--f-display); font-size: 2.8rem; line-height: .9; text-shadow: 0 0 18px currentColor; }
.grade.g-s { --gc: var(--gold); } .grade.g-a { --gc: var(--lime); } .grade.g-b { --gc: var(--cyan); } .grade.g-c { --gc: var(--purple); } .grade.g-d { --gc: #ff7d92; }
@keyframes stamp { 0% { transform: rotate(-24deg) scale(2.4); opacity: 0; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
.result .r-title { animation: titleIn .6s cubic-bezier(.2,1.4,.4,1) both; }
.result.win .r-title { animation: titleIn .6s cubic-bezier(.2,1.4,.4,1) both, glowPulse 2.4s 0.7s ease-in-out infinite; }
.result.lose .r-title { animation: titleIn .5s ease-out both, glitch .5s .5s steps(2) 2; }
@keyframes titleIn { from { opacity: 0; transform: translateY(-14px) scale(1.35); filter: blur(6px); } }
@keyframes glowPulse { 50% { text-shadow: 0 0 56px rgba(183,255,42,.75); } }
@keyframes glitch { 0% { transform: translate(0); } 25% { transform: translate(-4px, 1px); } 50% { transform: translate(4px, -1px); } 100% { transform: translate(0); } }
.result .badge { animation: badgeIn .4s calc(.5s + var(--d, 0) * .12s) cubic-bezier(.2,1.5,.4,1) both; } @keyframes badgeIn { from { opacity: 0; transform: translateY(10px) scale(.8); } }
.result .unlocks .ach { animation: badgeIn .5s 1.1s both; }
.result .final-score .counter { display: inline-block; }

/* ---- achievement banner ---- */
.ach-toast { position: fixed; z-index: 130; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); transform: translateX(-50%); width: min(92vw, 400px); display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: linear-gradient(135deg, #2a2260, #15133a); border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 3px #05041a, 0 0 36px rgba(255,201,51,.45), 0 16px 30px rgba(0,0,0,.5); animation: achIn .5s cubic-bezier(.2,1.4,.4,1) both; pointer-events: none; }
.ach-toast.out { animation: achOut .3s ease-in both; }
.ach-toast .at-ico { flex: none; width: 52px; height: 52px; display: grid; place-items: center; background: #0a0820; color: var(--gold); border: 2px solid var(--gold); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); animation: icoSpin .8s .2s ease-out both; }
.ach-toast.rare { border-color: var(--purple); } .ach-toast.rare .at-ico { color: var(--purple); border-color: var(--purple); }
.ach-toast.common { border-color: var(--cyan); } .ach-toast.common .at-ico { color: var(--cyan); border-color: var(--cyan); }
.at-txt { display: grid; min-width: 0; } .at-txt small { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .2em; color: var(--gold); } .at-txt b { font-family: var(--f-display); font-size: 1.05rem; text-transform: uppercase; } .at-txt span { color: var(--dim); font-size: .8rem; }
@keyframes achIn { from { transform: translate(-50%, -140%); opacity: 0; } } @keyframes achOut { to { transform: translate(-50%, -140%); opacity: 0; } } @keyframes icoSpin { from { transform: rotate(-180deg) scale(.3); } }
@media (prefers-reduced-motion: reduce) { .grade { transform: rotate(-8deg) scale(1); animation: none; } .ach-toast .at-ico { animation: none; } }
