@font-face { font-family: Rubik; src: url(fonts/Rubik-VariableFont_wght.ttf) format("truetype"); font-weight: 300 900; }
:root { color-scheme: dark;
  --ink: #f4efe6; --mute: #b9b2c9; --bg: #07060d; --glass: rgba(22, 18, 38, .78);
  --line: rgba(255, 255, 255, .14); --hot: #ff8a2a; --hot2: #ffc23d; --sky: #6fd0ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: Rubik, system-ui, sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; }
.lbl { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; background: var(--glass); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
.lbl.hot { background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #1a0f00; border: 0; font-size: 15px; padding: 6px 14px; box-shadow: 0 6px 24px rgba(255, 138, 42, .45); }
.lbl.small { font-size: 11px; padding: 2px 7px; font-weight: 500; opacity: .9; direction: ltr; }
.lbl.plaque { font-size: 12px; color: var(--hot2); }

.hud-top { position: fixed; top: max(12px, env(safe-area-inset-top)); inset-inline: 12px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.pill { background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; backdrop-filter: blur(8px); }
.pill b { color: var(--hot2); font-variant-numeric: tabular-nums; }
.brand { background: linear-gradient(135deg, #2a1d4d, #121027); font-weight: 800; }

.hud-bottom { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); inset-inline: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.big { font: inherit; font-size: 18px; font-weight: 800; border: 0; border-radius: 16px; padding: 14px 26px; cursor: pointer; color: #1a0f00;
  background: linear-gradient(135deg, var(--hot), var(--hot2)); box-shadow: 0 8px 30px rgba(255, 138, 42, .4); }
.big:active { transform: translateY(2px); }
.search { display: flex; gap: 8px; width: min(520px, 100%); background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 6px; backdrop-filter: blur(8px); }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; background: transparent; border: 0; color: var(--ink); padding: 6px 8px; outline: none; }
.search button { font: inherit; font-weight: 700; font-size: 14px; border: 0; border-radius: 10px; padding: 8px 12px; background: #2b2550; color: var(--ink); cursor: pointer; white-space: nowrap; }

.card { z-index: 10; position: fixed; top: 64px; inset-inline-start: 12px; width: min(330px, calc(100% - 24px)); background: var(--glass); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 16px 14px; backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.card .num { font-size: 13px; color: var(--mute); }
.card .handle { font-size: 20px; font-weight: 800; direction: ltr; text-align: right; }
.card .tier { display: inline-block; margin-top: 6px; font-weight: 800; color: #1a0f00; background: linear-gradient(135deg, var(--hot), var(--hot2)); border-radius: 8px; padding: 3px 9px; }
.card .joke { margin: 8px 0 6px; line-height: 1.45; font-size: 15px; }
.card .prop { font-size: 14px; color: var(--sky); }
.ladder { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ladder span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--mute); }
.ladder span.on { color: var(--ink); border-color: var(--hot); }
.x { position: absolute; top: 8px; inset-inline-end: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 15px; cursor: pointer; }

.modal { position: fixed; inset: 0; z-index: 20; background: rgba(4, 3, 10, .6); display: grid; place-items: end center; padding: 12px; }
.sheet { position: relative; width: min(460px, 100%); background: #15122a; border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 18px; margin-bottom: env(safe-area-inset-bottom); }
.sheet h2 { margin: 0 0 12px; font-size: 22px; }
.sheet ol { padding-inline-start: 22px; margin: 0 0 16px; display: grid; gap: 10px; font-size: 16px; }
.sheet code { font-family: Rubik, monospace; font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--hot2); direction: ltr; display: inline-block; }
.sheet .big { width: 100%; }
.small { font-size: 13px; color: var(--mute); margin: 12px 0 0; line-height: 1.4; }

.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #1a0f00;
  font-weight: 800; padding: 10px 18px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 24px); text-align: center; }
[hidden] { display: none !important; }

@media (orientation: landscape) and (max-height: 520px) {
  .hud-bottom { flex-direction: row; justify-content: center; }
  .big { padding: 10px 18px; font-size: 16px; }
  .card { top: 56px; }
}

/* ---- round 4: live product ---- */
.pill.share { font: inherit; font-size: 16px; padding: 6px 12px; line-height: 1; font-weight: 700; color: var(--ink); cursor: pointer; pointer-events: auto; margin-inline-start: auto; }
.lbl.build { font-size: 12px; background: rgba(255, 194, 61, .16); border-color: rgba(255, 194, 61, .5); }
.lbl.build.next { color: var(--hot2); border-style: dashed; }
.mini { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: #2b2550; color: var(--ink); border-radius: 8px; padding: 3px 9px; cursor: pointer; vertical-align: middle; }
a.big { display: block; text-align: center; text-decoration: none; }
.small a { color: var(--sky); }
.modal .step-wait { display: none; text-align: center; }
.modal[data-step="wait"] .step-code { display: none; }
.modal[data-step="wait"] .step-wait { display: block; }
.step-wait p { line-height: 1.5; }
.orbit { width: 64px; height: 64px; margin: 8px auto 6px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .25); position: relative; animation: spin 2.4s linear infinite; }
.orbit i { position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--hot2); box-shadow: 0 0 14px var(--hot); }
@keyframes spin { to { transform: rotate(360deg); } }
.card .mine { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.card .mine p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.big.small-big { width: 100%; font-size: 16px; padding: 11px 16px; }
#loader { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 40%, #1b1733, #07060d 70%); display: grid; place-content: center; justify-items: center; gap: 10px; transition: opacity .8s; }
#loader.done { opacity: 0; pointer-events: none; }
#loader .moon { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f3efe6, #a7a19a 60%, #5c5852); box-shadow: 0 0 60px rgba(255, 240, 210, .25); animation: bob 2s ease-in-out infinite; }
#loader b { font-size: 26px; font-weight: 800; }
#loader span { color: var(--mute); font-size: 15px; min-height: 1.4em; text-align: center; padding: 0 16px; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.brand { display: flex; align-items: center; gap: 7px; padding-inline-start: 6px; }
.brand .logo { width: 24px; height: 24px; border-radius: 50%; }
#loader img.moon { background: none; box-shadow: 0 0 60px rgba(255, 215, 106, .25); }
