/* Sealed Frames playtest. Tokens from crypto/tools/sable-studio/tokens.json. Layout: three Zone columns, enemy on top, you below, hand docked at the bottom. */
:root {
  --void: #05070A; --ink: #0A1118; --panel: #0E1822; --line: #1d3242;
  --text: #E8F2F8; --dim: #8FA3B0; --dimtext: #728A9B;
  --cyan: #18BFFF; --soft: #72DCFF; --moon: #FF7A59; --ok: #8FD0B8; --gold: #E0BE72;
  --serif: "Source Serif 4", Georgia, serif; --sans: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--void); color: var(--text); font: 15px/1.45 var(--sans); }
body { min-height: 100dvh; overflow-x: hidden; }
[hidden] { display: none !important; }
.mono { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.btn { border: 1px solid var(--cyan); background: rgba(24,191,255,.14); color: var(--text); font: 600 15px var(--sans); padding: 11px 18px; border-radius: 10px; cursor: pointer; }
.btn:hover { background: rgba(24,191,255,.26); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { border-color: #2b4152; background: transparent; }
:focus-visible { outline: 2px solid var(--soft); outline-offset: 2px; }

.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(5,7,10,.9); backdrop-filter: blur(8px); border-bottom: 1px solid #12202c; }
.bar b { font: 600 18px var(--serif); }

/* start */
.start { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 14px; }
.start h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.05; }
.start h1 em { font-style: normal; color: var(--cyan); }
.start h2 { font-size: 22px; margin-top: 10px; }
.rules { display: grid; gap: 8px; padding-left: 20px; color: var(--dim); }
.rules b { color: var(--text); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.choice { text-align: left; border: 1px solid var(--line); background: var(--ink); color: var(--text); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; }
.choice b { display: block; font: 600 17px var(--serif); }
.choice span { color: var(--dim); font-size: 13px; }
.choice[aria-pressed="true"] { border-color: var(--fc, var(--cyan)); box-shadow: 0 0 0 1px var(--fc, var(--cyan)), 0 0 24px -10px var(--fc, var(--cyan)); }
.fine { color: var(--dimtext); font-size: 12.5px; }

/* game */
.game { max-width: 640px; margin: 0 auto; padding: 10px 12px calc(290px + env(safe-area-inset-bottom, 0px)); }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.zone { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; border-radius: 12px; padding: 6px; background: linear-gradient(180deg, rgba(255,122,89,.04), transparent 30%, transparent 70%, rgba(24,191,255,.05)); border: 1px solid #12202c; min-width: 0; }
.zone.target { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; cursor: pointer; }
.zone.blocked { opacity: .55; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.slot { aspect-ratio: 63 / 88; border-radius: 7px; border: 1px dashed #18283a; }
.plate { align-self: center; text-align: center; padding: 6px 4px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.plate .zn { font: 600 12.5px/1.15 var(--serif); }
.plate .zr { color: var(--dim); font-size: 10.5px; line-height: 1.25; margin-top: 2px; }
.score { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font: 700 15px var(--mono); }
.score .e { color: var(--moon); } .score .m { color: var(--cyan); }
.score .rc { font: 500 10px var(--mono); color: var(--dimtext); }
.lead-m { box-shadow: 0 0 0 1px rgba(24,191,255,.6) inset; }
.lead-e { box-shadow: 0 0 0 1px rgba(255,122,89,.6) inset; }

/* mini card */
.mc { min-width: 0; width: 100%; position: relative; aspect-ratio: 63 / 88; border-radius: 7px; overflow: hidden; background: var(--ink); border: 1.5px solid var(--fc, #26323c); cursor: pointer; container-type: inline-size; }
.mc .art { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.mc .art.ph { background: radial-gradient(80% 60% at 50% 35%, color-mix(in srgb, var(--fc) 30%, #0e1822), #070b10 80%); }
.mc .art.ph::after { content: attr(data-g); position: absolute; inset: 0; display: grid; place-items: center; font: 600 38cqw var(--serif); color: color-mix(in srgb, var(--fc) 55%, transparent); }
.mc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(5,7,10,.9) 80%); }
.mc .c { position: absolute; z-index: 1; top: 3%; left: 4%; width: 30cqw; aspect-ratio: 1; display: grid; place-items: center; font: 700 17cqw var(--mono); color: var(--void); background: var(--soft);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.mc.cost-up .c { background: var(--moon); }
.mc .p { position: absolute; z-index: 1; right: 4%; bottom: 3%; min-width: 32cqw; aspect-ratio: 1; display: grid; place-items: center; font: 700 18cqw var(--mono); border-radius: 50%; background: rgba(5,7,10,.8); border: 1.5px solid var(--fc); }
.mc .p.up { color: var(--ok); } .mc .p.down { color: var(--moon); }
.mc .nm { position: absolute; z-index: 1; left: 5%; right: 38%; bottom: 5%; font: 600 11.5cqw/1.05 var(--serif); text-shadow: 0 1px 4px #000; }
.mc .tag { position: absolute; z-index: 1; top: 4%; right: 4%; font: 700 max(9px, 11cqw) var(--mono); padding: 1px 3px; border-radius: 3px; background: var(--moon); color: var(--void); }
.mc.back { background: radial-gradient(70% 50% at 50% 45%, #0f2a3d, #070b10 75%); border-color: #1d3242; }
.mc.back::after { background: none; }
.mc.back::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid rgba(114,220,255,.35); box-shadow: 0 0 0 6px rgba(114,220,255,.05); }
.mc.planned { outline: 1.5px dashed var(--soft); outline-offset: 1px; }
.mc.pop { animation: pop .45s cubic-bezier(.2,.7,.2,1); }
@keyframes pop { from { transform: scale(.6) rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.f-seal { --fc: var(--cyan); } .f-cap { --fc: var(--ok); } .f-receipt { --fc: var(--gold); } .f-rogue { --fc: var(--moon); }
.t-sable { box-shadow: 0 0 14px -2px var(--soft); } .t-prime { box-shadow: 0 0 10px -3px var(--fc); }

/* detail strip */
.detail { margin: 10px 0 0; min-height: 76px; padding: 10px 12px; border-radius: 12px; background: var(--ink); border: 1px solid var(--line); }
.detail .hint { color: var(--dim); font-size: 14px; }
.detail h3 { font: 600 18px var(--serif); }
.detail .meta { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fc, var(--dim)); }
.detail p { font-size: 14px; margin-top: 3px; }
.detail p b { color: var(--soft); font-weight: 600; }
.detail .means { color: var(--dim); border-left: 2px solid var(--fc, var(--cyan)); padding-left: 8px; margin-top: 6px; font-size: 13.5px; }

/* hand */
.handbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(5,7,10,.94); backdrop-filter: blur(10px); border-top: 1px solid #12202c; display: grid; gap: 8px; }
.handbar > * { max-width: 640px; width: 100%; margin: 0 auto; }
.budget { display: flex; align-items: center; gap: 6px; font: 600 13px var(--mono); color: var(--dim); }
.budget i { width: 14px; height: 14px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #1d3242; }
.budget i.on { background: var(--soft); }
.budget i.used { background: #2a5266; }
.hand { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.hand .mc { flex: 0 0 88px; }
.hand .mc .nm { font-size: 13cqw; }
.hand .mc.sel { outline: 2px solid var(--cyan); transform: translateY(-6px); }
.hand .mc.cant { opacity: .45; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 30; max-width: min(92vw, 520px); padding: 9px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
.toast.bad { border-color: var(--moon); }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5,7,10,.86); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.panel { width: min(460px, 100%); background: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 12px; }
.panel h2 { font-size: 30px; }
.r-zones { display: grid; gap: 6px; }
.r-zones div { white-space: nowrap; gap: 10px; display: flex; justify-content: space-between; font: 500 14px var(--mono); padding: 6px 10px; border-radius: 8px; background: var(--panel); }
/* a long Zone name ("Confidential Execution and Attestation") wraps instead of pushing the result past a 390 px phone */
.r-zones div span:first-child { white-space: normal; min-width: 0; }
.r-zones div span:last-child { flex: none; }
.overlay > .panel, .panel > * { min-width: 0; }
.share { font: 13px/1.5 var(--mono); white-space: pre-wrap; background: var(--void); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--dim); }
.row { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 520px) {
  .plate .zr { font-size: 9.5px; }
  .hand .mc { flex-basis: 76px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* small cards on the board (phones): cost and Power only, bigger; tap for the text */
@container (max-width: 72px) {
  .nm { display: none; }
  .c { width: 50cqw; font-size: 30cqw; }
  .p { min-width: 52cqw; font-size: 32cqw; }
  .tag { font-size: 16cqw; }
}
/* match menu: the guide link as a button with a line of context */
.sguide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 4px; }
.sguide .btn { text-decoration: none; padding: 9px 16px !important; font-size: 14px !important; }
.sguide span { color: var(--dim); font-size: 13px; flex: 1 1 220px; min-width: 0; }
