:root {
  --bg: #07080a; --panel: #0e1115; --panel2: #12161b; --line: #1f242b; --line2: #2c323b;
  --ink: #e9ecf0; --soft: #b6bcc6; --mute: #8a929e; --dim: #6c7480;
  --neon: #14f195; --neon-ink: #03140b; --hot: #9945ff; --hot-txt: #c89bff; --bad: #ff4d4d; --warn: #ffb020; --blue: #4da3ff;
  --display: 'Archivo', system-ui, sans-serif; --sans: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { min-height: 100vh; background:
  radial-gradient(40% 45% at 30% 30%, rgba(20, 241, 149, 0.07), transparent 70%),
  radial-gradient(50% 40% at 80% 100%, rgba(153, 69, 255, 0.10), transparent 70%), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* header */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: var(--display); font-stretch: 72%; font-weight: 900; font-size: 22px; text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--neon); }
.tag { font-family: var(--mono); font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.14em; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--neon); border: 1px solid rgba(20, 241, 149, 0.45); padding: 5px 10px; border-radius: 4px; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.top nav { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.top nav a { color: var(--soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.ghost { background: none; border: 1px solid var(--line2); border-radius: 6px; padding: 6px 12px; color: var(--soft); }
.ghost:hover { border-color: var(--mute); color: var(--ink); }

/* layout */
.sim { display: grid; grid-template-columns: minmax(380px, 470px) minmax(0, 1fr); gap: 32px; padding: 28px 24px 40px; max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .sim { grid-template-columns: 1fr; padding: 16px; } }
.device-col { display: flex; flex-direction: column; align-items: center; gap: 18px; }

/* device */
.device { --s: 1.12; position: relative; width: calc(368px * var(--s)); height: calc(612px * var(--s)); border-radius: calc(44px * var(--s));
  background: linear-gradient(160deg, #23272d, #121418 55%, #191c21); box-shadow: inset 0 0 0 2px #2e333a, inset 0 2px 0 3px rgba(255, 255, 255, 0.04), 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px #000; }
@media (max-width: 440px) { .device { --s: 0.9; } }
.device.buzz { animation: buzz 0.09s linear 3; }
@keyframes buzz { 50% { transform: translateX(1.5px) rotate(0.3deg); } }
.glass { position: absolute; left: calc(24px * var(--s)); right: calc(24px * var(--s)); top: calc(54px * var(--s)); height: calc(480px * var(--s));
  background: #000; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 calc(4px * var(--s)) #04050a; }
canvas#screen { width: 100%; height: 100%; display: block; image-rendering: auto; touch-action: none; cursor: pointer; }
.glass .off { position: absolute; inset: 0; background: #020304; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.glass .off.on { opacity: 1; pointer-events: auto; }
.boot { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--mute); pointer-events: none; }
.boot.done { display: none; }
.light { position: absolute; top: -3px; left: 28%; width: 26px; height: 6px; border-radius: 3px; background: #2a2f36; transition: background 0.15s, box-shadow 0.15s; }
.light.green { background: var(--neon); box-shadow: 0 0 14px 3px var(--neon); }
.light.blue { background: var(--blue); box-shadow: 0 0 14px 3px var(--blue); }
.light.red { background: var(--bad); box-shadow: 0 0 14px 3px var(--bad); }
.light.yellow { background: var(--warn); box-shadow: 0 0 14px 3px var(--warn); }
.light.purple { background: var(--hot); box-shadow: 0 0 14px 3px var(--hot); }
.light.blink { animation: blink 0.5s steps(2, jump-none) infinite; }
.light.slow { animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.15; box-shadow: none; } }
.side { position: absolute; border: 0; padding: 0; background: linear-gradient(90deg, #30353d, #1c2026); }
.side:hover { filter: brightness(1.35); }
.side:active { filter: brightness(1.7); }
.pwr { left: -5px; top: 30%; width: 6px; height: 54px; border-radius: 3px 0 0 3px; }
.trade { right: -6px; top: 40%; width: 7px; height: 64px; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, #1c2026, #14f195 220%); }
.wheel { right: -9px; top: 17%; width: 12px; height: 62px; border-radius: 6px; background: repeating-linear-gradient(0deg, #3a4048 0 3px, #22262c 3px 6px); }
.wheel span { display: none; }

.controls { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.wheelpad { display: grid; grid-template-rows: 1fr 1fr 1fr; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.wheelpad button { background: var(--panel); border: 0; border-bottom: 1px solid var(--line); padding: 6px 18px; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.wheelpad button:last-child { border-bottom: 0; }
.wheelpad button:hover { background: var(--panel2); color: var(--ink); }
.wheelpad .press { font-size: 11px; letter-spacing: 0.1em; }
.tradekey { display: flex; align-items: center; gap: 10px; background: #0f1a15; border: 1px solid var(--neon); color: var(--neon); border-radius: 10px; padding: 0 20px;
  font-family: var(--display); font-stretch: 80%; font-weight: 800; letter-spacing: 0.08em; font-size: 15px; }
.tradekey i { width: 8px; height: 22px; border-radius: 2px; background: var(--neon); box-shadow: 0 0 10px var(--neon); }
.tradekey:hover, .tradekey.down { background: #133224; }
.ptt { min-height: 48px; border: 2px solid var(--neon); color: var(--neon); background: transparent; border-radius: 999px; padding: 0 22px; font-family: var(--display); font-stretch: 80%; font-weight: 800; letter-spacing: 0.08em; font-size: 14px; }
.ptt.on { background: rgba(20, 241, 149, 0.18); box-shadow: 0 0 22px rgba(20, 241, 149, 0.4); }
.keys { font-size: 12.5px; color: var(--mute); text-align: center; line-height: 1.8; max-width: 440px; margin: 0; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; margin: 0 2px; color: var(--soft); }

/* side panel */
.side-col { min-width: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--mute); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--neon); }
.tabs span { font-family: var(--mono); font-size: 11px; color: var(--neon); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.card.warn { border-color: rgba(255, 176, 32, 0.35); }
.card h3 { margin: 0 0 10px; font-family: var(--display); font-stretch: 75%; font-weight: 900; text-transform: uppercase; font-size: 19px; letter-spacing: 0.01em; }
.card h3 small { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--mute); letter-spacing: 0.08em; margin-left: 8px; }
.muted { color: var(--mute); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.small { font-size: 12.5px; }
.primary, .bad { border-radius: 8px; padding: 10px 16px; font-family: var(--display); font-stretch: 80%; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px; }
.primary { background: var(--neon); color: var(--neon-ink); border: 1px solid var(--neon); }
.primary:disabled { background: transparent; color: var(--dim); border-color: var(--line2); cursor: default; }
.bad { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.bad:hover { background: rgba(255, 77, 77, 0.08); }
pre { background: #090b0e; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; color: var(--soft); white-space: pre-wrap; word-break: break-all; margin: 12px 0 0; }
.wallet { display: grid; grid-template-columns: 110px 1fr auto; gap: 4px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wallet:last-child { border-bottom: 0; }
.wallet b { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.wallet code { font-family: var(--mono); font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet .eq { font-family: var(--mono); font-size: 13px; text-align: right; }
.wallet .st { grid-column: 2 / 4; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.wallet .st.ok { color: var(--neon); }
.approve { border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--panel2); }
.approve .eyebrow { font-family: var(--mono); font-size: 11px; color: var(--mute); letter-spacing: 0.12em; text-transform: uppercase; }
.approve dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 13.5px; }
.approve dt { color: var(--mute); }
.approve dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.approve dd.ok { color: var(--neon); }
.approve dd.no { color: var(--bad); }
input[type=text] { width: 100%; background: #090b0e; border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; color: var(--ink); font: 14px var(--sans); }
input[type=text]:focus { outline: none; border-color: var(--neon); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button { background: none; border: 1px solid var(--line2); border-radius: 6px; padding: 5px 9px; font-family: var(--mono); font-size: 11.5px; color: var(--soft); }
.chips button:hover { border-color: var(--neon); color: var(--neon); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--soft); margin: 4px 0 8px; }
.prose p, .prose li { color: var(--soft); font-size: 14.5px; line-height: 1.6; }
.prose b { color: var(--ink); }

/* network log */
.net-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#net { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 220px); overflow: auto; }
.req { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-family: var(--mono); font-size: 12px; }
.req summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 52px 60px 1fr auto; gap: 8px; padding: 8px 10px; align-items: center; }
.req summary::-webkit-details-marker { display: none; }
.req .host { font-weight: 700; }
.req .host.hl { color: #97fce4; } .req .host.pac { color: #6ad0ff; } .req .host.lit { color: #c9b6ff; } .req .host.relay { color: var(--warn); }
.req .m { color: var(--mute); }
.req .p { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req .s { color: var(--neon); }
.req .s.err { color: var(--bad); }
.req .notes { padding: 0 10px 6px; }
.req .notes div { color: var(--soft); padding: 2px 0; }
.req .notes div.ok { color: var(--neon); }
.req .notes div.no { color: var(--bad); }
.req pre { margin: 0 10px 10px; max-height: 260px; overflow: auto; }
.req .who { font-size: 10px; color: var(--dim); margin-left: 6px; }

/* ---- v2: modes, button bar, demo effects ---- */
.switch { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.switch button { background: none; border: 0; padding: 7px 14px; font-weight: 600; font-size: 13.5px; color: var(--mute); }
.switch button.on { background: var(--neon); color: var(--neon-ink); }
.switch.net button.on[data-net="testnet"] { background: var(--warn); color: #241600; }
.switch.net button.on[data-net="mainnet"] { background: var(--bad); color: #fff; }
.guide { font-weight: 700; font-size: 14px; color: var(--neon); text-decoration: none; border: 1px solid rgba(20, 241, 149, 0.5); border-radius: 8px; padding: 7px 12px; background: rgba(20, 241, 149, 0.08); }
.guide:hover { background: rgba(20, 241, 149, 0.16); }
.banner { text-align: center; font-family: var(--mono); font-size: 12.5px; padding: 8px 16px; letter-spacing: 0.04em; }
.banner.testnet { background: rgba(255, 176, 32, 0.12); color: var(--warn); border-bottom: 1px solid rgba(255, 176, 32, 0.3); }
.banner.mainnet { background: rgba(255, 77, 77, 0.16); color: #ff8080; border-bottom: 1px solid rgba(255, 77, 77, 0.45); font-weight: 700; }
.ghost-link { display: inline-block; margin-top: 4px; color: var(--neon); font-weight: 600; font-size: 14px; text-decoration: none; }

.bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: min(100%, 470px); }
.bar button { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 58px; user-select: none; touch-action: none; }
.bar button b { font-size: 17px; line-height: 1; color: var(--ink); }
.bar button small { font-size: 10.5px; color: var(--mute); line-height: 1.15; text-align: center; }
.bar button:hover { border-color: var(--mute); }
.bar button.enter { border-color: var(--neon); background: #0f1a15; }
.bar button.enter b, .bar button.enter small { color: var(--neon); }
.bar button.ptt { border-color: var(--neon); border-width: 1px; border-radius: 10px; padding: 8px 4px; }
.bar button.ptt b { color: var(--neon); }
.bar button.ptt.on, .bar button.down { background: rgba(20, 241, 149, 0.2); }
@media (max-width: 520px) { .bar { grid-template-columns: repeat(4, 1fr); } }

.caption { width: min(100%, 470px); min-height: 52px; display: grid; place-items: center; text-align: center; font-size: 17px; font-weight: 600; line-height: 1.35;
  padding: 10px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.lock { position: absolute; inset: 0; border-radius: inherit; cursor: not-allowed; }

.callouts { position: absolute; inset: 0; pointer-events: none; }
.callout { position: absolute; transform: translateY(-50%); background: var(--neon); color: var(--neon-ink); font-family: var(--mono); font-weight: 700; font-size: 12px;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 0 18px rgba(20, 241, 149, 0.5); animation: pop 0.18s ease-out; }
.callout.left { right: calc(100% + 14px); }
.callout.right { left: calc(100% + 14px); }
.callout.ptt { left: 50%; top: auto; bottom: -46px; transform: translateX(-50%); max-width: 420px; white-space: normal; text-align: center; }
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(0.9); } }
.side.hl { filter: none; background: var(--neon) !important; box-shadow: 0 0 22px 4px rgba(20, 241, 149, 0.75); }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tapfx { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid var(--neon); background: rgba(20, 241, 149, 0.25);
  animation: tap 0.7s ease-out forwards; }
@keyframes tap { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.taplabel { position: absolute; transform: translate(-50%, -150%); font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--neon-ink); background: var(--neon); padding: 2px 6px; border-radius: 4px; animation: fade 1.1s ease-out forwards; }
.swipefx { position: absolute; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(20, 241, 149, 0), var(--neon)); transform-origin: 0 50%; animation: fade 0.9s ease-out forwards; }
.swipefx::after { content: ''; position: absolute; right: -8px; top: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 14px var(--neon); }
@keyframes fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

.player { display: flex; gap: 8px; margin-bottom: 10px; }
.player select { flex: 1; background: #090b0e; color: var(--ink); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 10px; font: 600 14.5px var(--sans); }
.card.hero { border-color: rgba(20, 241, 149, 0.35); }
.steps { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; max-height: 340px; overflow: auto; }
.steps li { color: var(--dim); font-size: 13.5px; line-height: 1.4; transition: color 0.2s; }
.steps li.done { color: var(--mute); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::marker { color: var(--neon); }
.checklist { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.checklist li { color: var(--soft); font-size: 14px; line-height: 1.5; }
.checklist li.done { color: var(--mute); text-decoration: line-through; text-decoration-color: rgba(20, 241, 149, 0.5); }
.checklist a { color: var(--neon); }
.wallet button { grid-column: 3; justify-self: end; font-size: 12.5px; padding: 5px 10px; }
.wallet.locked { opacity: 0.5; }
input[type=text] + .muted { margin-top: 8px; }
dialog { background: var(--panel2); color: var(--ink); border: 1px solid var(--bad); border-radius: 14px; max-width: 460px; padding: 22px 24px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h3 { margin: 0 0 10px; font-family: var(--display); font-stretch: 75%; font-weight: 900; font-size: 24px; text-transform: uppercase; color: #ff8080; }
dialog p, dialog li { color: var(--soft); line-height: 1.55; font-size: 14.5px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.bad:disabled { opacity: 0.4; cursor: default; }
#relay-status .ok { color: var(--neon); } #relay-status .no { color: var(--bad); }
.switch[hidden], .bar[hidden] { display: none; }
@media (min-width: 901px) and (max-height: 960px) { .device { --s: 0.98; } }
@media (min-width: 901px) and (max-height: 840px) { .device { --s: 0.86; } }
.caption[hidden] { display: none; }
#mic-note { color: var(--soft); margin: 2px 0 8px; } #mic-note.ok { color: var(--neon); } #mic-note.no { color: var(--bad); }
