/* Crackd: graphite and champagne. Glass panels with a lit top edge, brushed-silver buttons. Gold is money,
   green is a lock that gave way, red is a miss. Manrope for words, JetBrains Mono for numbers and keys. */

:root {
  --bg: #0b0d11; --bg-2: #11141a; --bg-3: #181c23;
  --panel: linear-gradient(180deg, rgba(36, 41, 50, .76), rgba(18, 21, 27, .86));
  --tile: rgba(255, 255, 255, .03); --tile-hi: rgba(255, 255, 255, .06);
  --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: #6b737d;
  --silver: linear-gradient(180deg, #f7f9fb 0%, #dde2e8 46%, #b9c1cb 100%);
  --ice: #b9c8dc;
  --gold: #e0c48a; --gold-2: #f3e3bc; --gold-soft: rgba(224, 196, 138, .1); --gold-glow: rgba(224, 196, 138, .35);
  --green: #8fdab2; --green-soft: rgba(143, 218, 178, .1); --red: #f19191; --red-soft: rgba(241, 145, 145, .1);
  --violet: #b9a2ff; --amber: #f0b67a;
  --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%, #1a1e26, 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: #0b0d11; }
button { font: inherit; }
.mono { font-family: var(--mono); }
.soft { color: var(--tx-2); }
.gold { color: var(--gold); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.kick, .label { font: 600 12px var(--sans); color: var(--tx-3); }
.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-thumb { background: rgba(205, 214, 228, .18); border-radius: 6px; }
.soli { width: .82em; height: .82em; margin-right: .3em; vertical-align: -.04em; opacity: .9; }

.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.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; overflow: hidden; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 40%, rgba(11, 13, 17, .5) 76%, rgba(11, 13, 17, .92) 100%); }
.grain { position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .04; 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%); } }
.no3d { position: fixed; inset: 0; display: grid; place-items: center; color: var(--tx-3); font-size: 13px; }

/* a player at the safe */
.tag { position: absolute; left: 0; top: 0; display: grid; gap: 5px; padding: 5px 9px 6px 5px; border-radius: 12px; white-space: nowrap; min-width: 150px; will-change: transform;
  background: rgba(17, 20, 26, .7); 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, border-color .4s, box-shadow .4s; }
.tag .av { width: 24px; height: 24px; border-radius: 7px; flex: none; background: var(--bg-3); 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 { display: flex; align-items: center; gap: 8px; }
.tg-h > div { min-width: 0; flex: 1; }
.tg-h > i { font-style: normal; font: 600 10px var(--mono); color: var(--tx-3); }
.tag.me { border-color: rgba(224, 196, 138, .45); }
.tag.me .tg-h > i { color: var(--gold); }
.tag.hit { border-color: var(--green); box-shadow: 0 0 30px -6px var(--green); }
.tg-a { padding: 0 2px 0 3px; }

/* what an AI is doing */
.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: dotb 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 dotb { 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)); transition: width .6s var(--ease); }
.k-think { --k: var(--ice); } .k-code { --k: var(--violet); } .k-try { --k: var(--green); } .k-wait { --k: var(--amber); } .k-read { --k: #d6dbe2; } .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; }
@keyframes breathe { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 14%, transparent); } }
@keyframes nudge { 50% { transform: scale(.82); } }

/* ---- 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(16, 19, 24, .64); 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: 750 19px var(--sans); letter-spacing: -.03em; color: var(--tx); }
.word span { background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.word em { font-style: normal; color: var(--gold); -webkit-text-fill-color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav-links a { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 10px; font: 550 13.5px var(--sans); color: var(--tx-2); transition: background .2s, color .2s; }
.nav-links a svg { width: 14px; height: 14px; opacity: .8; }
.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; }
.nav-tok, .nav-ais { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; 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 { padding-left: 6px; }
.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: 550 12.5px var(--mono); }
.nav-tok em { font-style: normal; font: 600 11.5px var(--mono); }
.nav-ais { gap: 8px; color: var(--tx-2); font-weight: 600; }
.nav-ais b { font: 700 13px var(--mono); color: var(--tx); }
.up { color: var(--green); } .down { color: var(--red); }

/* ---- buttons and fields --------------------------------------------------------------------------------- */
.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); 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; }
.btn-primary, .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-gold:hover { background: var(--silver); filter: brightness(1.05); border-color: #fff; }
.btn-gold, .btn-gold:hover { background: linear-gradient(180deg, #f6ead0, #e0c48a 55%, #c6a96c); border-color: rgba(255, 244, 220, .6); }
.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; }
.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); }
.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); transition: background .25s, border-color .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--tx-3); transition: transform .3s var(--ease), background .25s; }
.switch[aria-checked="true"] { color: var(--tx); }
.switch[aria-checked="true"] i { background: var(--gold-soft); border-color: rgba(224, 196, 138, .5); }
.switch[aria-checked="true"] i::after { transform: translateX(15px); background: var(--gold); }

/* ---- panels on the play view ---------------------------------------------------------------------------- */
.panel { z-index: 10; border-radius: 20px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 30px 60px -30px #000; backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15); }
.panel.vaults, .panel.agent { position: fixed; top: 90px; max-height: calc(100vh - 106px); overflow: auto; padding: 16px; }
.panel.vaults { left: max(16px, calc(50% - 620px)); width: 316px; }
.panel.agent { right: max(16px, calc(50% - 620px)); width: 340px; display: flex; flex-direction: column; gap: 14px; }
.stage-spacer { display: none; }

.pot { padding: 4px 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.pot-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.live { display: inline-flex; align-items: center; gap: 7px; font: 600 11.5px var(--sans); color: var(--tx-2); }
.pot > b { display: flex; align-items: baseline; font: 700 34px var(--mono); letter-spacing: -.04em; color: var(--gold-2); text-shadow: 0 0 24px var(--gold-glow); }
.pot > b small { font: 600 13px var(--sans); letter-spacing: 0; color: var(--tx-3); margin-left: 8px; }
.pot .usd { font: 600 14px var(--mono); color: var(--tx-2); min-height: 20px; }
.held { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0 0; 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-2); }
.held b em { font-style: normal; color: var(--tx-3); margin-left: 6px; }
.held:hover b { color: var(--tx); }
.pot-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--tx-3); }
.pot-foot .mono { color: var(--tx-2); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; min-width: 0; padding: 11px 11px 10px; border-radius: 14px; background: var(--tile); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.tile:hover { border-color: var(--line-3); background: var(--tile-hi); }
.tile.wide { grid-column: span 2; }
.tile.next { border-color: rgba(224, 196, 138, .4); background: linear-gradient(180deg, rgba(224, 196, 138, .08), rgba(224, 196, 138, .02)); }
.tile.next::before { content: ""; position: absolute; inset: -1px; border-radius: 14px; box-shadow: 0 0 22px -6px var(--gold-glow); pointer-events: none; animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .3; } }
.tile.open { border-color: rgba(143, 218, 178, .3); background: var(--green-soft); }
.t-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.t-n { font: 600 11px var(--mono); color: var(--tx-3); }
.t-state { font: 650 10.5px var(--sans); color: var(--tx-3); text-transform: uppercase; letter-spacing: .06em; }
.tile.next .t-state { color: var(--gold); } .tile.open .t-state { color: var(--green); }
.t-name { display: block; margin: 3px 0 4px; font: 650 13px var(--sans); }
.t-amt { font: 650 14px var(--mono); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-amt small { font: 600 10px var(--sans); color: var(--tx-3); margin-left: 4px; }
.t-usd { font: 500 11px var(--mono); color: var(--tx-3); }
.t-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel-h { display: flex; align-items: center; justify-content: space-between; }
.panel-h h3 { font: 700 15px var(--sans); }
.state { font: 600 11.5px var(--sans); color: var(--tx-2); padding: 4px 9px; border-radius: 8px; background: var(--tile); border: 1px solid var(--line); }
.agent-body { display: grid; gap: 12px; }
.gate { padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(224, 196, 138, .25); font-size: 12.5px; color: var(--gold-2); }
.prov { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.prov-t { display: flex; align-items: center; justify-content: center; min-width: 0; height: 32px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--tile); color: var(--tx-2); cursor: pointer; font: 600 11.5px var(--sans); transition: border-color .2s, background .2s; }
.prov-t .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-get { font: 600 11.5px var(--sans); color: var(--gold); } .key-get:hover { color: var(--gold-2); }
.prov-t:hover { border-color: var(--line-3); }
.prov-t.on { color: var(--tx); border-color: rgba(224, 196, 138, .45); background: var(--gold-soft); }
.pmark { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--bg-3); font: 700 11px var(--mono); color: var(--tx); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--tx-3); font: 500 11px var(--mono); cursor: pointer; }
.chips button:hover { color: var(--tx-2); border-color: var(--line-3); }
.chips button.on { color: var(--gold-2); border-color: rgba(224, 196, 138, .4); }

.agent-run { display: grid; gap: 12px; }
.run-top { display: flex; align-items: center; gap: 10px; }
.run-who { flex: 1; min-width: 0; }
.run-who b { display: block; font: 650 13.5px var(--mono); overflow: hidden; text-overflow: ellipsis; }
.run-who small { color: var(--tx-3); font-size: 11.5px; }
.run-act { padding: 10px 12px; border-radius: 12px; background: var(--tile); border: 1px solid var(--line); }
.run-act .act { font-size: 12.5px; } .run-act .act-ic { width: 20px; height: 20px; } .run-act .act-ic svg { width: 12px; height: 12px; }
.run-meta { font: 500 11.5px var(--mono); color: var(--tx-3); }

.console-card { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.stats { display: flex; gap: 14px; font-size: 11.5px; color: var(--tx-3); }
.stats b { font: 650 12px var(--mono); color: var(--tx); margin-left: 4px; }
.log { height: 210px; overflow: auto; padding: 10px; border-radius: 12px; background: rgba(6, 8, 11, .55); border: 1px solid var(--line); font: 500 11.5px/1.55 var(--mono); color: var(--tx-2); }
.log > div { white-space: pre-wrap; word-break: break-word; }
.log .tool { color: var(--violet); } .log .ok { color: var(--green); } .log .bad { color: var(--red); } .log .res { color: var(--tx-3); }
.log .think { color: var(--tx); } .log .sep { color: var(--tx-3); text-align: center; margin: 6px 0; font-size: 10.5px; }
.log .win { color: var(--gold-2); font-weight: 700; }

.xray-bar { position: fixed; z-index: 10; left: 50%; bottom: 74px; transform: translateX(-50%); display: flex; gap: 8px; }
.xray-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(16, 19, 24, .7); color: var(--tx-2); font: 650 13px var(--sans); cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--edge); }
.xray-btn svg { width: 16px; height: 16px; }
.xray-btn:hover, .xray-btn[aria-pressed="true"] { color: var(--tx); border-color: var(--ice); }
.panel.ticker { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 720px)); min-width: 300px; height: 46px; padding: 0 16px; border-radius: 14px; display: flex; align-items: center; overflow: hidden; }
.feed { display: flex; gap: 22px; white-space: nowrap; font-size: 12.5px; color: var(--tx-2); overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.feed b { color: var(--tx); font-weight: 650; }

/* ---- sheets and toasts ---------------------------------------------------------------------------------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(6, 8, 11, .6); 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(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; background: linear-gradient(180deg, #1c2028, #13161b); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 40px 80px -30px #000; transform: translateY(10px) scale(.99); transition: transform .35s var(--ease); }
.sheet.sm { width: min(440px, 100%); }
.sheet-bg.on .sheet { transform: none; }
.sheet-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; background: linear-gradient(180deg, #1c2028 70%, rgba(28, 32, 40, 0)); }
.sheet-h h3 { font: 700 18px var(--sans); flex: 1; }
.sheet-h .x { 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 { display: grid; gap: 12px; padding: 0 20px 20px; }
.data { padding: 10px 12px; border-radius: 12px; background: rgba(6, 8, 11, .55); border: 1px solid var(--line); font: 500 12px/1.55 var(--mono); color: var(--tx-2); word-break: break-all; max-height: 320px; overflow: auto; }
.data b { color: var(--tx); }
.pre { white-space: pre-wrap; }
.wallet-list { display: grid; gap: 8px; }
.wallet-list button, .wallet-list a { 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; }
.wallet-list button:hover { border-color: var(--line-3); }
.wallet-list img { width: 28px; height: 28px; border-radius: 8px; }
.stage { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--tile); }
.stage-h { display: flex; gap: 10px; align-items: baseline; }
.stage-h .n { font: 600 11px var(--mono); color: var(--tx-3); }
.stage-h em { margin-left: auto; font: 600 11px var(--sans); font-style: normal; color: var(--green); }
.stage.done { border-color: rgba(143, 218, 178, .25); }
.puzzle { font-size: 13.5px; color: var(--tx-2); line-height: 1.6; }
.stages { display: flex; flex-wrap: wrap; gap: 5px; }
.stages .st { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font: 600 11px var(--mono); color: var(--tx-3); }
.stages .st.open { color: var(--gold); border-color: rgba(224, 196, 138, .4); }
.stages .st.done { color: var(--green); border-color: rgba(143, 218, 178, .35); background: var(--green-soft); }
.sealed { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 22px 16px; border-radius: 16px; border: 1px dashed var(--line-2); }
.sealed svg { width: 28px; height: 28px; color: var(--gold); }
.sealed .row { width: 100%; }
.toast { position: fixed; z-index: 60; left: 50%; top: 90px; transform: translate(-50%, -12px); max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 14px; background: #1d2129; border: 1px solid var(--line-2); box-shadow: 0 20px 40px -16px #000; font: 600 13.5px var(--sans); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.win { border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 50px -10px var(--gold-glow); }

/* ---- docs and console pages ------------------------------------------------------------------------------ */
.doc, .console { max-width: 860px; margin: 0 auto; padding: 120px 20px 80px; }
.doc-hero { margin-bottom: 40px; }
.doc-hero h1 { font: 800 clamp(32px, 6vw, 52px)/1.05 var(--sans); letter-spacing: -.04em; margin: 10px 0 16px; }
.doc-hero h1 em { font-style: normal; color: var(--gold); }
.doc-hero p { font-size: 17px; color: var(--tx-2); max-width: 640px; }
.doc section { padding: 28px 0; border-top: 1px solid var(--line); }
.doc h2 { font: 750 22px var(--sans); margin-bottom: 12px; }
.doc section p { color: var(--tx-2); font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.doc section p b { color: var(--tx); }
.rings { display: grid; gap: 8px; margin-top: 14px; }
.rings > div { display: grid; grid-template-columns: 34px 140px 1fr 50px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--tile); border: 1px solid var(--line); }
.rings .n { font: 600 12px var(--mono); color: var(--tx-3); }
.rings small { color: var(--tx-3); font-size: 12.5px; }
.rings em { font: 700 14px var(--mono); font-style: normal; color: var(--gold); text-align: right; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.cards > div { padding: 16px; border-radius: 14px; background: var(--tile); border: 1px solid var(--line); }
.cards b { display: block; font: 700 24px var(--mono); color: var(--gold-2); }
.cards small { color: var(--tx-3); font-size: 12.5px; }
.code { display: block; padding: 12px 14px; border-radius: 12px; background: rgba(6, 8, 11, .6); border: 1px solid var(--line); font: 500 12px var(--mono); color: var(--tx-2); word-break: break-all; }
.console h1 { font: 800 30px var(--sans); margin-bottom: 20px; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.c-card { padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); display: grid; gap: 10px; align-content: start; }
.c-card.wide { grid-column: span 2; }
.c-card h3 { font: 700 15px var(--sans); }
.c-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--tx-2); }
.c-kv b { font: 600 13px var(--mono); color: var(--tx); text-align: right; word-break: break-all; }
.warn { padding: 10px 12px; border-radius: 12px; background: var(--red-soft); border: 1px solid rgba(241, 145, 145, .3); color: var(--red); font-size: 13px; }

/* ---- phones and tablets: the safe on top, the panels below, the page scrolls ----------------------------- */
@media (max-width: 1100px) {
  body { overflow: auto; }
  #scene { position: fixed; height: 62vh; bottom: auto; }
  .vignette { height: 62vh; }
  #view-play { display: grid; gap: 12px; padding: 0 12px 24px; }
  .stage-spacer { display: block; height: calc(62vh - 10px); }
  .panel.vaults, .panel.agent { position: relative; top: auto; left: auto; right: auto; width: auto; max-height: none; }
  .xray-bar { position: fixed; top: calc(62vh - 56px); bottom: auto; }
  .panel.ticker { position: relative; left: auto; bottom: auto; transform: none; width: auto; min-width: 0; }
  .nav-links { margin-left: 8px; }
  .nav-links .long { display: none; } .nav-links .short { display: inline; }
  .nav-ais .lab { display: none; }
}
@media (max-width: 640px) {
  .nav { top: 10px; height: 52px; padding: 0 6px 0 12px; }
  .word { font-size: 17px; }
  .nav-links a { padding: 0 9px; }
  .nav-links #nav-console span { display: none; }
  .nav-tok, .nav-ais, .nav-links a[data-route="play"] { display: none; }
  .nav-r .btn.sm { height: 34px; padding: 0 11px; font-size: 12.5px; }
  .tag { min-width: 0; }
  .tag small { max-width: 110px; }
  .cards { grid-template-columns: 1fr; }
  .rings > div { grid-template-columns: 30px 1fr 44px; }
  .rings small { grid-column: 2 / 4; }
  .c-grid { grid-template-columns: 1fr; }
  .c-card.wide { grid-column: auto; }
}

/* ---- console: payouts to review ------------------------------------------------------------------------ */
.c-sec { display: grid; gap: 12px; margin-bottom: 34px; }
.c-sec-h { display: flex; align-items: center; gap: 10px; }
.c-sec-h h2 { font: 750 20px var(--sans); }
.badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--gold); color: #121519; font: 700 12px var(--mono); }
.payout { gap: 12px; border-color: rgba(224, 196, 138, .3); }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-head h3 { font-size: 17px; }
.pill { padding: 4px 10px; border-radius: 9px; font: 650 11.5px var(--sans); border: 1px solid var(--line-2); }
.st-owed { color: var(--gold-2); border-color: rgba(224, 196, 138, .45); background: var(--gold-soft); }
.st-held { color: var(--amber); border-color: rgba(240, 182, 122, .45); background: rgba(240, 182, 122, .1); }
.st-paying { color: var(--red); border-color: rgba(241, 145, 145, .45); background: var(--red-soft); }
.st-paid { color: var(--green); border-color: rgba(143, 218, 178, .4); background: var(--green-soft); }
.p-amt-big { font: 700 28px var(--mono); color: var(--gold-2); letter-spacing: -.03em; }
.p-amt-big .soft { font-size: 15px; }
.p-wallet { user-select: all; }
.checks { display: grid; gap: 7px; padding: 12px; border-radius: 12px; background: rgba(6, 8, 11, .5); border: 1px solid var(--line); }
.checks > div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.checks b { display: block; font-weight: 600; color: var(--tx); }
.checks small { display: block; color: var(--tx-3); font-size: 12px; }
.ck { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 700 12px var(--mono); font-style: normal; }
.ck.ok { color: var(--green); background: var(--green-soft); }
.ck.bad { color: var(--red); background: var(--red-soft); }
.ck.info { color: var(--tx-2); background: var(--tile-hi); }
.p-pay { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.p-pay h4 { font: 700 14px var(--sans); }
textarea.input { height: auto; min-height: 64px; padding: 10px 13px; resize: vertical; line-height: 1.5; font-family: var(--sans); }
.ack { display: flex; gap: 9px; align-items: center; font-size: 13px; color: var(--tx-2); }
.c-card .row .btn { flex: none; }

/* ---- the contract address (CA) ---------------------------------------------------------------------------- */
.ca { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; margin: 0 0 14px; padding: 10px 12px; border-radius: 13px; background: var(--gold-soft); border: 1px solid rgba(224, 196, 138, .3); }
.ca-l { padding: 3px 7px; border-radius: 6px; background: var(--gold); color: #121519; font: 800 11px var(--mono); letter-spacing: .04em; }
.ca-v { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: var(--tx); font: 600 13px var(--mono); cursor: pointer; justify-self: start; }
.ca-v svg { width: 14px; height: 14px; color: var(--gold); flex: none; }
.ca-v:hover { color: var(--gold-2); }
.ca-soon { font-size: 12.5px; color: var(--gold-2); }
.ca-links { grid-column: 1 / -1; display: flex; gap: 14px; font: 600 11.5px var(--sans); }
.ca-links a { color: var(--tx-3); } .ca-links a:hover { color: var(--tx); }
button.code { width: 100%; text-align: left; cursor: pointer; } button.code:hover { border-color: var(--gold); color: var(--tx); }
