/* krakka: slate and silver. Graphite ground, brushed-glass panels with a light top edge, metal buttons,
   tiles for anything you can pick. Champagne is the money; green is a lock that gave way. Manrope for
   words, JetBrains Mono for numbers and keys. Every control is drawn here: no native selects,
   checkboxes, file pickers or scrollbars. */

:root {
  --bg: #0c0e12; --bg-2: #111419; --bg-3: #171b21;
  --panel: linear-gradient(180deg, rgba(36, 41, 49, .74), rgba(19, 22, 27, .82));
  --tile: rgba(255, 255, 255, .028); --tile-hi: rgba(255, 255, 255, .055);
  --line: rgba(205, 214, 228, .08); --line-2: rgba(205, 214, 228, .14); --line-3: rgba(225, 232, 242, .28);
  --tx: #eef1f4; --tx-2: #a3abb5; --tx-3: #6d757f;
  --silver: linear-gradient(180deg, #f7f9fb 0%, #dde2e8 46%, #b9c1cb 100%);
  --ice: #b9c8dc; --ice-glow: rgba(185, 200, 220, .45);
  --gold: #dcc48f; --gold-2: #f1e3bf; --gold-soft: rgba(220, 196, 143, .1); --gold-glow: rgba(220, 196, 143, .35);
  --green: #8fdab2; --green-soft: rgba(143, 218, 178, .1); --red: #f19191; --red-soft: rgba(241, 145, 145, .1);
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .07);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--tx); font: 400 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body.page { overflow: auto; background: radial-gradient(1200px 600px at 50% -10%, #1a1e25, transparent 70%), var(--bg); }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
[hidden] { display: none !important; }
::selection { background: #c9d2de; color: #0c0e12; }
.mono { font-family: var(--mono); }
.soft { color: var(--tx-2); }
.faint { color: var(--tx-3); }
.gold { color: var(--gold); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.kick, .label { font: 600 12px var(--sans); color: var(--tx-3); }
.kick { display: inline-flex; align-items: center; gap: 8px; }
.fine { font-size: 12px; color: var(--tx-3); }

* { scrollbar-width: thin; scrollbar-color: rgba(205, 214, 228, .18) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(205, 214, 228, .18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(205, 214, 228, .32); }

.dot { position: relative; display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--green); animation: ping 2s ease-out infinite; }
.dot.g { background: var(--green); }
.dot.off { background: var(--tx-3); box-shadow: none; } .dot.off::after { display: none; }
@keyframes ping { from { opacity: .8; transform: scale(.5); } to { opacity: 0; transform: scale(1.8); } }

/* ---- the scene ---------------------------------------------------------------------------------------- */
#scene { position: fixed; inset: 0; z-index: 0; cursor: grab; }
#scene canvas { display: block; touch-action: none; }
body.orbiting, body.orbiting * { cursor: grabbing !important; user-select: none; }
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 40%, rgba(12, 14, 18, .5) 76%, rgba(12, 14, 18, .9) 100%); }
.grain { position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .045; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(1%, 3%); } }

/* a player at the safe: handle and model, quietly */
.tag { display: grid; gap: 5px; padding: 5px 9px 6px 5px; border-radius: 12px; white-space: nowrap; min-width: 150px;
  background: rgba(18, 21, 26, .66); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 14px 30px -18px #000; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .5s; }
.tag img, .tag .av { width: 24px; height: 24px; border-radius: 7px; flex: none; background: var(--bg-3); object-fit: cover; display: grid; place-items: center; font: 700 11px var(--sans); color: var(--tx-2); }
.tag b { display: block; font: 650 12px var(--sans); color: var(--tx); }
.tag small { display: block; font: 500 10.5px var(--mono); color: var(--tx-3); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tg-h > i { font-style: normal; margin-left: 2px; font: 600 10px var(--mono); color: var(--tx-3); }
.tag.me { border-color: rgba(220, 196, 143, .4); }
.tag.me .tg-h > i { color: var(--gold); }
.tag.hit { border-color: var(--green); box-shadow: 0 0 30px -6px var(--green); }
.tg-h { display: flex; align-items: center; gap: 8px; }
.tg-h > div { min-width: 0; flex: 1; }
.tg-a { padding: 0 2px 0 3px; }

/* what an AI is doing: an icon in its colour, a label, a live value; the time-lock gets a bar */
.act { --k: var(--tx-2); display: flex; align-items: center; gap: 6px; min-width: 0; font: 600 10.5px var(--sans); color: var(--tx-2); }
.act-ic { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: 5px; color: var(--k); background: color-mix(in srgb, var(--k) 16%, transparent); }
.act-ic svg { width: 10px; height: 10px; }
.act-l { overflow: hidden; text-overflow: ellipsis; }
.act-v { margin-left: auto; padding-left: 6px; font: 600 10px var(--mono); color: var(--k); }
.act-dots { display: inline-flex; gap: 2px; margin-left: 1px; }
.act-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--k); animation: dot 1.2s infinite ease-in-out; }
.act-dots i:nth-child(2) { animation-delay: .15s; } .act-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.act-bar { height: 3px; margin-top: 4px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.act-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); box-shadow: 0 0 8px var(--gold-glow); transition: width .6s var(--ease); }
.k-think { --k: var(--ice); } .k-code { --k: #b9a2ff; } .k-grind { --k: var(--gold-2); } .k-try { --k: var(--green); } .k-wait { --k: #f0b67a; } .k-read { --k: var(--silver); } .k-idle { --k: var(--tx-3); }
.k-think .act-ic { animation: breathe 1.6s infinite ease-in-out; }
.k-code .act-ic svg { animation: nudge 1s infinite ease-in-out; }
.k-grind .act-ic svg { animation: spin 4s linear infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 14%, transparent); } }
@keyframes nudge { 50% { transform: scale(.82); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- nav ---------------------------------------------------------------------------------------------- */
.nav { position: fixed; top: 16px; left: 50%; z-index: 30; width: min(1240px, calc(100% - 28px)); transform: translateX(-50%);
  height: 58px; padding: 0 7px 0 16px; display: flex; align-items: center; gap: 8px; border-radius: 18px;
  background: rgba(17, 20, 25, .62); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 20px 40px -24px #000; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.word { display: inline-flex; align-items: center; gap: 10px; font: 650 19px var(--sans); letter-spacing: -.03em; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.word img { filter: grayscale(1) brightness(1.3); }
.nav-links { display: flex; align-items: center; gap: 2px; margin: 0 0 0 18px; }
.nav-links #nav-console { gap: 7px; }
.nav-links #nav-console svg { width: 14px; height: 14px; opacity: .8; }
.nav-links a { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px; font: 550 13.5px var(--sans); color: var(--tx-2); transition: background .2s, color .2s; }
.nav-links a:hover { color: var(--tx); background: rgba(255, 255, 255, .04); }
.nav-links a.on { color: var(--tx); background: var(--tile-hi); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-links .short { display: none; }
.nav-r { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* $SAFE in the nav: the mark, the ticker, the market cap and its 24h move */
.nav-tok { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 6px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--tile); box-shadow: var(--edge); font: 650 13px var(--sans); color: var(--tx); white-space: nowrap; }
.nav-tok img { width: 24px; height: 24px; border-radius: 7px; }
.nav-tok:hover { border-color: var(--line-3); }
.nav-tok b { color: var(--tx-2); font-weight: 550; font-family: var(--mono); font-size: 12.5px; }
.nav-tok em { font-style: normal; margin-left: 1px; font: 600 11.5px var(--mono); }
.up { color: var(--green); } .down { color: var(--red); }
/* how many AIs are at the safe right now */
.nav-ais { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--tile); box-shadow: var(--edge); font: 600 13px var(--sans); color: var(--tx-2); white-space: nowrap; }
.nav-ais b { font: 700 13px var(--mono); color: var(--tx); }
.held { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; font-size: 12px; color: var(--tx-3); }
.held b { display: inline-flex; align-items: center; white-space: nowrap; font: 600 12.5px var(--mono); color: var(--tx); }
.held b em { font-style: normal; color: var(--tx-3); margin-left: 6px; }
.held:hover b { color: var(--tx); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--tile); font: 600 13px var(--sans); color: var(--tx); white-space: nowrap; }
.chip:hover { border-color: var(--line-3); }
.chip .mono { font-size: 12px; color: var(--tx-2); }

/* ---- buttons ------------------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--tile); color: var(--tx); font: 650 13.5px var(--sans); letter-spacing: -.005em; cursor: pointer; white-space: nowrap; box-shadow: var(--edge); transition: background .2s, border-color .2s, box-shadow .25s, transform .2s var(--ease), filter .2s; }
.btn:hover { border-color: var(--line-3); background: var(--tile-hi); }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; }
/* the metal one: brushed silver with a lit edge */
.btn-primary, .btn-blue, .btn-gold { background: var(--silver); color: #121519; border-color: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .18), 0 10px 26px -12px rgba(210, 220, 232, .45); }
.btn-primary:hover, .btn-blue:hover, .btn-gold:hover { background: var(--silver); filter: brightness(1.05); border-color: #fff; box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .18), 0 14px 34px -12px rgba(210, 220, 232, .6); }
.btn-gold { background: linear-gradient(180deg, #f6ead0, #dcc48f 55%, #c4a86d); border-color: rgba(255, 244, 220, .6); }
.btn-gold:hover { background: linear-gradient(180deg, #f6ead0, #dcc48f 55%, #c4a86d); }
.btn-red, .btn-stop { color: var(--red); border-color: rgba(241, 145, 145, .3); background: var(--red-soft); }
.btn-red:hover, .btn-stop:hover { border-color: var(--red); background: rgba(241, 145, 145, .16); }
.btn:disabled { opacity: .4; cursor: default; transform: none; filter: none; }

/* ---- fields ------------------------------------------------------------------------------------------- */
.field { display: grid; gap: 7px; }
.field > span { font: 600 12px var(--sans); color: var(--tx-2); }
.input { width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(8, 10, 13, .6); color: var(--tx); font: 500 13.5px var(--sans); outline: none; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); transition: border-color .2s, box-shadow .2s; }
.input.mono { font: 500 12.5px var(--mono); }
.input:focus { border-color: var(--ice); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px rgba(185, 200, 220, .14); }
.input::placeholder { color: var(--tx-3); }
textarea.input { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row > .grow { flex: 1; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font: 550 13px var(--sans); color: var(--tx-2); background: none; border: 0; padding: 0; }
.switch i { position: relative; width: 36px; height: 21px; border-radius: 21px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); transition: background .25s, border-color .25s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #8b939d; transition: transform .3s var(--ease), background .25s; }
.switch[aria-checked="true"] i { background: rgba(185, 200, 220, .25); border-color: var(--ice); }
.switch[aria-checked="true"] i::after { transform: translateX(15px); background: var(--silver); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--tile); color: var(--tx-3); font: 500 11px var(--mono); cursor: pointer; transition: color .2s, border-color .2s; }
.chips button:hover, .chips button.on { color: var(--tx); border-color: var(--line-3); }

/* ---- panels ----------------------------------------------------------------------------------------- */
.panel { position: fixed; z-index: 10; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 30px 70px -32px #000; backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.panel-h h3 { font: 700 15px var(--sans); }
.state { margin-left: auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 550 12px var(--sans); color: var(--tx-3); }

/* the vaults, left: the pot, then a tile per lock */
.vaults { left: 20px; top: 92px; width: 340px; max-height: calc(100vh - 112px); overflow: auto; padding: 8px; }
.pot { padding: 14px 14px 12px; border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line); box-shadow: var(--edge); }
.pot-top { display: flex; align-items: center; justify-content: space-between; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 600 11.5px var(--sans); color: var(--tx-3); }
.pot > b { display: block; margin: 6px 0 8px; font: 750 36px/1.05 var(--sans); letter-spacing: -.04em; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pot > b small { font-size: 15px; font-weight: 650; color: var(--gold); margin-left: 6px; letter-spacing: 0; }
.pot-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--tx-3); }
.pot-foot .mono { color: var(--tx-2); }
/* the Solana mark in white beside every SOL amount, and dollars under it */
.soli { width: .62em; height: .62em; margin-right: .3em; color: #fff; flex: none; vertical-align: -.02em; }
.pot > b .soli { width: .5em; height: .5em; margin-right: .22em; vertical-align: .06em; }
.usd { margin: -4px 0 8px; font: 600 13px var(--mono); color: var(--tx-3); }
.t-usd { margin-top: 1px; font: 500 11.5px var(--mono); color: var(--tx-3); }
.tiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tile { position: relative; min-width: 0; padding: 12px 12px 11px; border-radius: 15px; background: var(--tile); border: 1px solid var(--line); box-shadow: var(--edge); cursor: pointer; transition: background .2s, border-color .2s, transform .25s var(--ease); }
.tile:hover { background: var(--tile-hi); border-color: var(--line-2); transform: translateY(-1px); }
.tile.wide { grid-column: 1 / -1; }
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.t-n { font: 600 11px var(--mono); color: var(--tx-3); }
.t-state { padding: 2px 7px; border-radius: 6px; font: 650 10.5px var(--sans); color: var(--tx-3); background: rgba(255, 255, 255, .04); }
.t-name { display: block; margin-top: 8px; font: 650 13.5px var(--sans); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-amt { margin-top: 2px; font: 600 16px var(--mono); color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-amt small { margin-left: 5px; font: 600 10.5px var(--sans); color: var(--tx-3); }
.t-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.wide .t-amt { font-size: 20px; }
.tile.next { border-color: rgba(220, 196, 143, .35); background: linear-gradient(180deg, rgba(220, 196, 143, .07), rgba(220, 196, 143, .02)); }
.tile.next .t-state { color: var(--gold); background: var(--gold-soft); }
.tile.open .t-state { color: var(--green); background: var(--green-soft); }
.tile.open .t-amt { color: var(--green); }

/* your AI, right */
.agent { right: 20px; top: 92px; bottom: 20px; width: 372px; display: flex; flex-direction: column; overflow: auto; }
.agent-body { padding: 14px 18px 16px; display: grid; gap: 13px; flex: none; }
.prov { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.prov-t { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 13px; border: 1px solid var(--line); background: var(--tile); color: var(--tx-3); font: 600 10.5px var(--sans); cursor: pointer; box-shadow: var(--edge); transition: border-color .2s, background .2s, color .2s; min-width: 0; }
.prov-t:hover { color: var(--tx-2); border-color: var(--line-2); }
.prov-t.on { color: var(--tx); border-color: var(--line-3); background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); }
.pname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 800 12px var(--sans); color: #15181d; background: linear-gradient(180deg, #8f98a3, #5f6772); }
.prov-t.on .pmark { background: var(--silver); }
.gate { padding: 11px 13px; border-radius: 12px; background: var(--tile); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--tx-2); }
.gate b { color: var(--tx); }
/* the run view: the AI that's working, what it's doing, stop / resume */
.agent-run { padding: 14px 14px 12px; margin: 12px 12px 10px; display: grid; gap: 11px; border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); border: 1px solid var(--line-2); box-shadow: var(--edge); }
.agent-run[hidden], .agent-body[hidden] { display: none; }
.run-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.run-top .pmark { width: 32px; height: 32px; border-radius: 10px; background: var(--silver); flex: none; }
.run-who { min-width: 0; flex: 1; }
.run-who b { display: block; font: 600 13px var(--mono); color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-who small { display: block; font: 550 11.5px var(--sans); color: var(--tx-3); }
.run-act { padding: 11px 12px; border-radius: 12px; background: rgba(6, 8, 10, .45); border: 1px solid var(--line); }
.run-act .act { gap: 9px; font-size: 13.5px; color: var(--tx); }
.run-act .act-ic { width: 26px; height: 26px; border-radius: 8px; }
.run-act .act-ic svg { width: 15px; height: 15px; }
.run-act .act-v { font-size: 13px; }
.run-act .act-dots i { width: 4px; height: 4px; }
.run-act .act-bar { height: 5px; margin-top: 10px; }
.run-meta { margin-top: -4px; padding: 0 2px; font: 500 11.5px var(--mono); color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .sep { margin: 8px 0 4px; padding-top: 8px; border-top: 1px dashed var(--line-2); color: var(--tx-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.console-card { margin: 0 12px 12px; flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; border-radius: 16px; background: rgba(6, 8, 10, .55); border: 1px solid var(--line); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); overflow: hidden; }
.stats { display: flex; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 550 11.5px var(--sans); color: var(--tx-3); }
.stats b { color: var(--tx); font: 600 11.5px var(--mono); margin-left: 3px; }
.log { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px; font: 500 11.5px/1.6 var(--mono); color: var(--tx-2); }
.log div { padding: 2px 0; white-space: pre-wrap; word-break: break-word; }
.log .t { color: var(--tx); }
.log .tool { color: var(--ice); }
.log .res { color: var(--tx-3); }
.log .win { color: var(--green); font-weight: 600; }
.log .err { color: var(--red); }
.log .tl { position: relative; margin: 4px 0; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04); color: var(--gold-2); overflow: hidden; }
.log .tl span { position: relative; z-index: 1; }
.log .tl i { position: absolute; inset: 0 auto 0 0; background: rgba(220,196,143,.14); }

/* x-ray, under the safe */
.xray-bar { position: fixed; z-index: 10; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 8px; }
.xray-btn { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px 0 14px; border-radius: 22px;
  border: 1px solid var(--line-2); background: rgba(18, 21, 26, .66); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--tx); font: 650 13px var(--sans); cursor: pointer;
  box-shadow: var(--edge), 0 16px 40px -18px #000; transition: border-color .3s, box-shadow .4s, background .3s, transform .3s var(--ease); }
.xray-btn svg { width: 18px; height: 18px; color: var(--ice); transition: transform .6s var(--ease); }
.xray-btn:hover { border-color: var(--line-3); box-shadow: var(--edge), 0 16px 40px -18px #000, 0 0 30px -12px var(--ice-glow); }
.xray-btn:active { transform: scale(.97); }
.xray-btn[aria-pressed="true"] { border-color: rgba(185, 200, 220, .55); background: rgba(40, 52, 68, .55); box-shadow: var(--edge), 0 0 44px -10px var(--ice-glow); }
.xray-btn[aria-pressed="true"] svg { transform: rotate(180deg); }

/* who's at the safe, bottom */
.ticker { left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 16px; font-size: 12.5px; color: var(--tx-3); width: max-content; max-width: calc(100% - 800px); min-width: 300px; overflow: hidden; }
.ticker .feed { display: flex; justify-content: center; gap: 18px; white-space: nowrap; overflow: hidden; min-width: 0; }
.ticker .feed span { overflow: hidden; text-overflow: ellipsis; }
.ticker b { color: var(--tx-2); font-weight: 650; }
.toast { position: fixed; left: 50%; top: 88px; z-index: 60; transform: translate(-50%, -12px); padding: 12px 18px; border-radius: 14px; background: rgba(22, 25, 31, .97); border: 1px solid var(--line-3); box-shadow: var(--edge), 0 24px 50px -16px #000; font: 600 13.5px var(--sans); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); max-width: min(520px, calc(100% - 32px)); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.win { border-color: rgba(143, 218, 178, .6); box-shadow: 0 0 60px -16px var(--green); }

/* ---- sheets: a lock's puzzle, the wallet ------------------------------------------------------------ */
.sheet-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(6, 7, 9, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet { width: min(700px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; background: linear-gradient(180deg, #1b1f26, #14171c); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 40px 90px -30px #000; transform: translateY(10px) scale(.985); transition: transform .35s var(--ease); }
.sheet-bg.on .sheet { transform: none; }
.sheet.sm { width: min(420px, 100%); }
.sheet-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; background: #1b1f26; border-bottom: 1px solid var(--line); }
.sheet-h h3 { font: 750 18px var(--sans); }
.sheet-h .x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--tile); color: var(--tx-2); font-size: 18px; cursor: pointer; }
.sheet-b { padding: 18px 20px 22px; display: grid; gap: 14px; }
.puzzle { white-space: pre-wrap; font: 500 13.5px/1.75 var(--sans); color: var(--tx); }
.data { padding: 12px 14px; border-radius: 12px; background: rgba(6, 8, 10, .6); border: 1px solid var(--line); font: 500 11.5px/1.6 var(--mono); color: var(--tx-2); word-break: break-all; max-height: 260px; overflow: auto; }
.data b { color: var(--tx-3); font-weight: 500; }
.data .pre { white-space: pre-wrap; }
.echo-img { width: 100%; max-width: 480px; image-rendering: pixelated; border-radius: 12px; border: 1px solid var(--line-2); }
.sealed { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: var(--tile); border: 1px dashed var(--line-2); text-align: center; }
.sealed svg { width: 28px; height: 28px; margin: 0 auto; color: var(--tx-3); }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tile); border: 1px solid var(--line-2); box-shadow: var(--edge); }
.player .play { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .55); background: var(--silver); cursor: pointer; box-shadow: inset 0 1px 0 #fff, 0 6px 16px -8px rgba(210, 220, 232, .5); }
.player .play i { position: absolute; left: 15px; top: 12px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #15181d; }
.player.on .play i { left: 13px; top: 12px; width: 14px; height: 16px; border: 0; border-left: 4px solid #15181d; border-right: 4px solid #15181d; }
.player .track { position: relative; flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); cursor: pointer; overflow: hidden; }
.player .track span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ice); border-radius: 6px; }
.player .time { font-size: 12px; color: var(--tx-2); min-width: 36px; }
.wallet-list { display: grid; gap: 8px; }
.wallet-list button { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--tile); color: var(--tx); font: 650 14px var(--sans); cursor: pointer; box-shadow: var(--edge); }
.wallet-list button:hover { border-color: var(--line-3); background: var(--tile-hi); }
.wallet-list img { width: 28px; height: 28px; border-radius: 8px; }

/* ---- pages (docs, console) ---------------------------------------------------------------------------- */
.doc { max-width: 920px; margin: 0 auto; padding: 120px 20px 100px; }
.doc-hero { text-align: center; padding: 30px 0 46px; }
.doc-hero h1 { font: 800 clamp(34px, 6vw, 60px)/1.02 var(--sans); letter-spacing: -.045em; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-hero h1 em { font-style: normal; background: linear-gradient(180deg, #f6ead0, #dcc48f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-hero p { max-width: 580px; margin: 16px auto 0; font-size: 16px; color: var(--tx-2); }
.doc section { margin-top: 14px; padding: 26px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--edge); }
.doc h2 { font: 750 21px var(--sans); margin-bottom: 12px; }
.doc p { color: var(--tx-2); font-size: 15px; line-height: 1.75; }
.doc p + p { margin-top: 10px; }
.doc b { color: var(--tx); }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 16px; }
.rings div { display: grid; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--tile); box-shadow: var(--edge); }
.rings .n { font: 600 11px var(--mono); color: var(--tx-3); }
.rings b { display: block; font-size: 15px; }
.rings small { color: var(--tx-2); font-size: 13px; line-height: 1.5; }
.rings em { font: 750 22px var(--sans); font-style: normal; color: var(--gold-2); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cards div { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--tile); box-shadow: var(--edge); }
.cards b { display: block; font: 750 24px var(--sans); letter-spacing: -.03em; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cards small { color: var(--tx-2); font-size: 12.5px; }
.code { display: block; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(6, 8, 10, .6); border: 1px solid var(--line); font: 500 12px var(--mono); color: var(--tx-2); word-break: break-all; }

.console { max-width: 1080px; margin: 0 auto; padding: 110px 20px 80px; display: grid; gap: 14px; }
.box { border-radius: 22px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: var(--edge); }
.box-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.box-h h3 { font: 750 15px var(--sans); }
.box-h .kick { margin-left: auto; }
.box-b { padding: 16px 20px 20px; display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ready { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ready li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--tile); border: 1px solid var(--line); font-size: 13.5px; }
.ready li small { display: block; color: var(--tx-3); font-size: 12px; }
.ready .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
.ready .y .ic { background: var(--green-soft); color: var(--green); }
.ready .n .ic { background: var(--red-soft); color: var(--red); }
.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--tile); box-shadow: var(--edge); }
.step .n { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font: 700 13px var(--mono); border: 1px solid var(--line-2); color: var(--tx-2); background: rgba(255, 255, 255, .03); }
.step.done .n { color: var(--green); border-color: rgba(143, 218, 178, .4); background: var(--green-soft); }
.step b { display: block; font-size: 14px; }
.step small { display: block; color: var(--tx-2); font-size: 12.5px; overflow-wrap: anywhere; }
.step .more { grid-column: 2 / -1; display: grid; gap: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 12px var(--sans); color: var(--tx-3); padding: 0 0 8px; }
.tbl td { padding: 9px 0; border-top: 1px solid var(--line); color: var(--tx-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.drop { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-3); background: var(--tile); cursor: pointer; }
.drop img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--bg-3); }
.drop:hover { border-color: var(--ice); }

/* ---- tablets and phones: the stage on top, the panels below it ---------------------------------------- */
.stage-spacer { display: none; }
@media (max-width: 1100px) {
  body:not(.page) { overflow-x: hidden; overflow-y: auto; }
  #view-play { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0 16px 28px; align-items: start; }
  .stage-spacer { display: block; grid-column: 1 / -1; height: max(380px, 64vh); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
  .panel { position: relative; inset: auto; width: auto; margin: 0; transform: none; max-height: none; }
  .vaults, .agent { top: auto; left: auto; right: auto; bottom: auto; width: auto; max-height: none; overflow: visible; }
  .console-card { flex: none; height: 320px; }
  .ticker { display: none; }
  .xray-bar { position: absolute; bottom: auto; top: calc(max(380px, 64vh) - 62px); }
  .nav-links a[data-route="play"] { display: none; }
  .cards, .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  #view-play { grid-template-columns: minmax(0, 1fr); }
  .nav { top: 10px; width: calc(100% - 20px); height: 54px; padding: 0 6px 0 12px; gap: 4px; }
  .word { font-size: 17px; gap: 8px; } .word img { width: 22px; height: 22px; }
  .nav-links { margin: 0 0 0 8px; } .nav-links a { height: 34px; padding: 0 10px; font-size: 13px; }
  .nav-links #nav-console span { display: none; }
  .nav-r { margin-left: 4px; } .nav-r .btn.sm { height: 36px; padding: 0 12px; font-size: 12.5px; }
  .nav-ais { padding: 0 10px; gap: 6px; } .nav-ais .lab { display: none; }
  .nav-tok { padding: 0 9px 0 5px; gap: 5px; } .nav-tok img { width: 22px; height: 22px; } .nav-tok em { display: none; }
  .tag { gap: 6px; padding: 4px 9px 4px 4px; border-radius: 10px; }
  .tag img, .tag .av { width: 20px; height: 20px; border-radius: 6px; }
  .tag b { font-size: 11px; } .tag small { max-width: 100px; font-size: 9.5px; } .tg-h > i { display: none; }
  .tag { min-width: 0; gap: 3px; } .tag .act { font-size: 9.5px; } .tag .act-ic { width: 14px; height: 14px; }
  .pot b { font-size: 32px; }
  .prov-t { padding: 9px 2px 7px; } .pname { font-size: 9.5px; }
  .sheet-bg { place-items: end center; padding: 0; }
  .sheet { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .sheet-b, .sheet-h { padding-left: 16px; padding-right: 16px; }
  .row { flex-wrap: wrap; }
  .doc { padding-top: 96px; } .doc section { padding: 20px; } .console { padding: 90px 14px 60px; }
  .step { grid-template-columns: 30px minmax(0, 1fr); } .step > .btn, .step > .switch { grid-column: 2; justify-self: start; }
  .toast { top: 74px; }
}
@media (max-width: 420px) {
  .nav-links .long { display: none; } .nav-links .short { display: inline; }
}
