/* Host shell for the Keystore Studio isometric scenes and games.
   Tokens live on .iso-root so the rest of this site keeps its own ink, type and buttons.
   Scene geometry is css/ks/iso.css. Game drawing is js/ks/games.js. */

.iso-root{
  --font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue","Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
  --font-display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Helvetica Neue","Segoe UI Variable Display","Segoe UI",system-ui,sans-serif;
  --font-mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  --bg:#fbfbfd;--bg-2:#f5f5f7;--bg-3:#ececf0;--surface:#fff;--surface-2:#f7f7f9;
  --glass:rgba(255,255,255,.72);--glass-strong:rgba(255,255,255,.86);
  --line:rgba(0,0,0,.08);--line-strong:rgba(0,0,0,.14);
  --ink:#1d1d1f;--ink-2:#424245;--muted:#6e6e73;--faint:#86868b;
  --brand:#1d1d1f;--on-brand:#fff;
  --ok:#1f9d55;--ok-soft:rgba(31,157,85,.12);
  --warn:#c77700;--warn-soft:rgba(199,119,0,.12);
  --bad:#d92d20;--bad-soft:rgba(217,45,32,.12);
  --info:#0a66d9;--info-soft:rgba(10,102,217,.1);--link:#0a66d9;
  --iso-top:#fff;--iso-left:#e9e9ee;--iso-right:#d6d6dd;--iso-edge:rgba(0,0,0,.1);
  --iso-ink-top:#2a2a2d;--iso-ink-left:#161618;--iso-ink-right:#0b0b0c;--iso-floor:rgba(0,0,0,.06);
  --iso-ink-edge:rgba(255,255,255,.09);--iso-paper-edge:rgba(0,0,0,.34);
  --iso-shadow:rgba(0,0,0,.13);--iso-shadow-2:rgba(0,0,0,.05);
  --iso-engrave:rgba(0,0,0,.34);--iso-engrave-ink:rgba(255,255,255,.4);
  --iso-glass-0:rgba(255,255,255,.55);--iso-glass-1:rgba(255,255,255,.12);--iso-glass-2:rgba(0,0,0,.04);
  --iso-glass-edge:rgba(0,0,0,.2);--iso-glass-hi:rgba(255,255,255,.95);
  --iso-groove:rgba(0,0,0,.09);--iso-screen:#f4f4f6;
  --shadow-sm:0 1px 2px rgba(0,0,0,.04),0 1px 1px rgba(0,0,0,.03);
  --shadow-md:0 10px 30px -12px rgba(0,0,0,.18),0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:0 40px 80px -30px rgba(0,0,0,.28),0 12px 24px -12px rgba(0,0,0,.1);
  --radius-lg:28px;
  --ease-out:cubic-bezier(.22,1,.36,1);--ease-in-out:cubic-bezier(.65,0,.35,1);--ease-spring:cubic-bezier(.34,1.36,.64,1);
  --dur-1:160ms;--dur-2:320ms;--dur-3:640ms;--dur-4:1100ms;
  color-scheme:light;
  background:var(--bg-2);color:var(--ink);
  font-family:var(--font-sans);font-size:17px;line-height:1.47;letter-spacing:-.012em;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  padding:clamp(56px,8vw,104px) clamp(16px,5vw,40px) clamp(64px,9vw,120px);
}
.iso-root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#000;--bg-2:#0b0b0c;--bg-3:#161618;--surface:#0f0f10;--surface-2:#161618;
  --glass:rgba(18,18,20,.66);--glass-strong:rgba(22,22,24,.86);
  --line:rgba(255,255,255,.09);--line-strong:rgba(255,255,255,.16);
  --ink:#f5f5f7;--ink-2:#d2d2d7;--muted:#a1a1a6;--faint:#86868b;
  --brand:#f5f5f7;--on-brand:#000;
  --ok:#34d399;--ok-soft:rgba(52,211,153,.14);
  --warn:#fbbf24;--warn-soft:rgba(251,191,36,.14);
  --bad:#f87171;--bad-soft:rgba(248,113,113,.14);
  --info:#60a5fa;--info-soft:rgba(96,165,250,.14);--link:#6cb4ff;
  --iso-top:#2a2a2e;--iso-left:#1a1a1d;--iso-right:#111113;--iso-edge:rgba(255,255,255,.1);
  --iso-ink-top:#f5f5f7;--iso-ink-left:#cfcfd4;--iso-ink-right:#a9a9b0;--iso-floor:rgba(255,255,255,.05);
  --iso-ink-edge:rgba(0,0,0,.14);--iso-paper-edge:rgba(255,255,255,.36);
  --iso-shadow:rgba(255,255,255,.07);--iso-shadow-2:rgba(255,255,255,.025);
  --iso-engrave:rgba(255,255,255,.36);--iso-engrave-ink:rgba(0,0,0,.46);
  --iso-glass-0:rgba(255,255,255,.1);--iso-glass-1:rgba(255,255,255,.03);--iso-glass-2:rgba(255,255,255,.015);
  --iso-glass-edge:rgba(255,255,255,.26);--iso-glass-hi:rgba(255,255,255,.5);
  --iso-groove:rgba(255,255,255,.08);--iso-screen:#0c0c0d;
  --shadow-sm:0 1px 2px rgba(0,0,0,.6);
  --shadow-md:0 10px 30px -12px rgba(0,0,0,.8),0 0 0 1px rgba(255,255,255,.04);
  --shadow-lg:0 40px 80px -30px rgba(0,0,0,.9),0 0 0 1px rgba(255,255,255,.05);
}
.iso-root :focus-visible{outline:2px solid var(--link);outline-offset:3px}
.iso-sprite{position:absolute;width:0;height:0;overflow:hidden}
.iso-wrap{width:100%;max-width:1200px;margin-inline:auto}
.iso-root h2,.iso-root h3,.iso-root h4{
  font-family:var(--font-display);font-weight:600;letter-spacing:-.016em;text-transform:none;color:var(--ink);margin:0;
}
.iso-head{max-width:820px;margin:0 auto clamp(40px,6vw,72px);text-align:center;display:grid;gap:16px;justify-items:center}
.iso-root .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:13px;line-height:1;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--muted)}
.iso-root .eyebrow::before{content:"";width:6px;height:6px;border-radius:2px;background:currentColor;transform:rotate(45deg)}
.iso-root .display-m{font-size:clamp(32px,4.4vw,56px);line-height:1.07;letter-spacing:-.03em;font-weight:700}
.iso-root .display-s{font-size:clamp(24px,2.6vw,32px);line-height:1.15;letter-spacing:-.022em;font-weight:700}
.iso-root .lede{font-size:clamp(18px,1.7vw,22px);line-height:1.45;letter-spacing:-.016em;color:var(--muted);font-weight:500;max-width:62ch}
.iso-root .lede a,.iso-root .text-link{color:var(--link);font-weight:500}
.iso-root .text-link:hover{text-decoration:underline;text-underline-offset:3px}
.iso-root .small{font-size:14px;line-height:1.43;color:var(--muted)}
.iso-root .dot{display:inline-block;flex:none;width:7px;height:7px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}
.iso-root .dot.warn{background:var(--warn);box-shadow:0 0 0 3px var(--warn-soft)}
.iso-root .dot.bad{background:var(--bad);box-shadow:0 0 0 3px var(--bad-soft)}
.iso-root .title{font-size:21px;line-height:1.3;letter-spacing:-.016em;font-weight:600;text-transform:none;color:var(--ink)}
.asset-status{min-height:1.5em;margin:0}
.asset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:0;padding:0;list-style:none}
.iso-root .asset{display:flex;flex-direction:column;min-width:0;border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-md);opacity:1;transform:none}
.asset-wide{grid-column:1 / -1}
.asset-stage{flex:1;display:grid;align-items:center;padding:24px 16px 8px}
.asset-wide .asset-stage .iso-scene{max-width:880px;margin-inline:auto}
.asset-meta{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;padding:20px 24px 24px;border-top:1px solid var(--line)}
.asset-text{flex:1 1 240px;display:grid;gap:4px}
.asset-text p{margin:0;font-size:14px;line-height:1.45;color:var(--ink-2)}
.asset-text .asset-hint{color:var(--muted)}
.iso-root .chip-link{
  display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 14px;border:0;border-radius:999px;
  background:var(--surface);box-shadow:inset 0 0 0 1px var(--line-strong);color:var(--ink);
  font-family:var(--font-sans);font-size:14px;font-weight:600;letter-spacing:0;text-transform:none;text-decoration:none;
  cursor:pointer;transition:background-color var(--dur-1),transform var(--dur-1) var(--ease-out);
}
.iso-root .chip-link svg{width:15px;height:15px}
.iso-root .chip-link:hover{background:var(--bg-3)}
.iso-root .chip-link:active{transform:scale(.97)}
button.asset-get{border:0;cursor:pointer;font-family:inherit}
button.asset-get[hidden]{display:none}
.iso-games-head{margin-top:clamp(72px,9vw,120px)}
.game-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:20px;margin:0;padding:0;list-style:none}
.game-grid .asset{flex:0 0 calc((100% - 40px) / 3)}
.game-grid .asset-text{flex-basis:180px}
.game-preview{display:block;width:100%;aspect-ratio:4/3;background:transparent}

/* Playable game, same screen as the studio build, without the missing-page frame. */
.iso-root .game{
  width:100%;max-width:960px;margin:0 auto clamp(28px,4vw,40px);border-radius:20px;background:var(--surface);
  border:1px solid var(--line);box-shadow:var(--shadow-lg);overflow:hidden;text-align:left;
}
.iso-root .game[hidden]{display:none}
.iso-root .game-head,.iso-root .game-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:12px 16px;font-size:13px;color:var(--muted)}
.iso-root .game-head{border-bottom:1px solid var(--line)}
.iso-root .game-foot{display:grid;justify-content:stretch;gap:4px;border-top:1px solid var(--line);text-align:left}
.iso-root .game-foot p{margin:0}
.iso-root .game-foot [data-text]{font-size:15px;font-weight:600;color:var(--ink-2)}
.iso-root .game-result{font-size:15px;font-weight:600;color:var(--ink)}
.iso-root .game-head h3{flex:1 1 auto;text-align:left;margin:0;font-size:15px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink)}
.iso-root .game-actions{display:flex;gap:8px}
.iso-root .game-score{display:flex;gap:14px;font-variant-numeric:tabular-nums}
.iso-root .game-score b{color:var(--ink);font-weight:700}
.iso-root .game button{
  height:32px;padding:0 14px;border:0;border-radius:999px;background:transparent;box-shadow:inset 0 0 0 1px var(--line-strong);
  color:var(--ink);font:600 13px var(--font-sans);letter-spacing:0;text-transform:none;cursor:pointer;
}
.iso-root .game button:hover{background:var(--bg-2)}
.iso-root .game button.primary{min-width:104px;background:var(--brand);color:var(--on-brand);box-shadow:none}
.iso-root .game button.primary:hover{opacity:.88}
.iso-root .game-stage{position:relative;outline:none;container-type:inline-size}
.iso-root .game-stage canvas{display:block;width:100%;height:min(75cqw,clamp(340px,calc(100vh - 380px),540px));cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.iso-root .game-stage:focus-visible{box-shadow:inset 0 0 0 2px var(--info)}
.iso-root .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
#studio,#games,#play,#scenes{scroll-margin-top:130px}

@media (max-width:980px){
  .game-grid .asset{flex-basis:calc((100% - 20px) / 2)}
}
@media (max-width:820px){
  .asset-grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:640px){
  .game-grid .asset{flex-basis:100%}
}
@media (prefers-reduced-motion:reduce){
  .iso-root .chip-link{transition:none}
}
