/* Candle Climber: a trading terminal at night, candy candles, one gold accent. */
:root {
  --bg: #0b0f17;
  --bg-2: #111724;
  --bg-3: #182033;
  --line: rgba(232, 236, 243, 0.1);
  --text: #e8ecf3;
  --mute: #8a93a6;
  --up: #22e39b;
  --dn: #ff4f6e;
  --gold: #ffcf3d;
  --pix: "Silkscreen", ui-monospace, monospace;
  --ui: "Chakra Petch", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--mute); }
.up { color: var(--up); } .dn { color: var(--dn); }
kbd { font: 11px var(--pix); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--text); }

/* top */
.top { display: flex; align-items: center; gap: 20px; padding: 14px max(16px, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--line); background: rgba(11, 15, 23, 0.9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 18px/1 var(--pix); letter-spacing: 0.02em; }
.brand.small { font-size: 14px; }
.mark { width: 26px; height: 26px; background: url("favicon.svg") center / contain no-repeat; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 7px 10px; border-radius: 6px; color: #c6cddb; }
.nav a:hover { background: var(--bg-3); color: var(--text); }
.nav .tok b { color: var(--gold); font: 700 13px var(--pix); }

/* stage */
.stage-wrap { width: min(1180px, 100% - 24px); margin: 18px auto 0; }
.stage-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--bg-2); font-size: 15px; }
.lvl-label b { font: 700 14px var(--pix); color: var(--gold); margin-right: 4px; }
.lvl-stats { color: var(--mute); font-size: 14px; }
.stage { position: relative; height: min(68vh, 600px); min-height: 300px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; background: var(--bg); touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.help { text-align: center; color: var(--mute); font-size: 14px; margin: 10px 0 0; }
.overlay { position: absolute; inset: 0; display: none; place-items: center; padding: 16px; background: radial-gradient(closest-side, rgba(11, 15, 23, 0.6), rgba(11, 15, 23, 0.86)); }
.overlay.on { display: grid; }
.ov-card { width: min(460px, 100%); background: rgba(17, 23, 36, 0.96); border: 1px solid var(--line); border-radius: 16px; padding: 24px; text-align: center; box-shadow: 0 30px 80px -30px #000; }
.ov-card h2 { font: 700 30px/1.05 var(--pix); margin: 6px 0 10px; }
.ov-card p { color: #c6cddb; margin: 0 0 14px; }
.ov-coin { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ov-coin img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); }
.kicker { font: 700 12px/1 var(--pix); letter-spacing: 0.08em; text-transform: uppercase; color: var(--up); margin: 0 0 10px; }
.kicker.gold { color: var(--gold); } .kicker.red { color: var(--dn); }
.fine { font-size: 13px; color: var(--mute); margin: 12px 0 0; }
.linkish { background: none; border: 0; color: var(--gold); text-decoration: underline; margin-top: 10px; font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3); font-weight: 600; text-decoration: none; }
.btn:hover { border-color: rgba(232, 236, 243, 0.3); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--gold); color: #1b1505; border-color: transparent; box-shadow: 0 4px 0 #a07c12; }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #a07c12; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 15px; font: 700 18px var(--pix); }
.res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px; }
.res div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; }
.res dt { font: 10px var(--pix); color: var(--mute); text-transform: uppercase; }
.res dd { margin: 4px 0 0; font: 700 22px var(--pix); }
.res dd i { display: block; font: 600 11px var(--ui); font-style: normal; color: var(--gold); }
.bar { display: flex; gap: 4px; justify-content: center; margin-bottom: 14px; }
.bar span { width: 22px; height: 22px; border-radius: 4px; background: #1d2433; }
.bar .g { background: var(--up); } .bar .r { background: var(--dn); }
.post { display: flex; gap: 8px; margin-bottom: 12px; }
.post input, .any-form input, .field input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); font: 500 15px var(--ui); }
.post input:focus, .any-form input:focus, .field input:focus { outline: 2px solid rgba(255, 207, 61, 0.5); }
.ov-actions { display: flex; gap: 8px; justify-content: center; }

/* sections */
.sec { padding: 56px 0; }
h2 { font: 700 34px/1.1 var(--pix); margin: 0 0 10px; }
h3 { font: 700 18px/1.2 var(--ui); margin: 8px 0 4px; }
.sub { color: #c6cddb; max-width: 44em; margin: 0 0 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.board { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.board li { display: grid; grid-template-columns: 40px 1fr auto 70px; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.board li:last-child { border-bottom: 0; }
.board li:nth-child(odd) { background: rgba(232, 236, 243, 0.02); }
.board li.muted { display: block; }
.board li.me { background: rgba(255, 207, 61, 0.08); }
.board .rk { font: 700 16px var(--pix); color: var(--gold); }
.board .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pc { color: var(--mute); font: 12px var(--pix); }
.board .sc { text-align: right; font: 700 16px var(--pix); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.me-stats dt { font-size: 12px; color: var(--mute); }
.me-stats dd { margin: 4px 0 0; font: 700 18px var(--pix); }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--mute); }

.band { background: var(--bg-2); border-block: 1px solid var(--line); padding: 52px 0; }
.any-form { display: flex; gap: 10px; max-width: 640px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font: 700 12px var(--pix); }
.chip img { width: 22px; height: 22px; border-radius: 50%; }
.chip:hover { border-color: var(--gold); }

.legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 8px; }
.legend > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.legend p { margin: 0; font-size: 14px; color: #c6cddb; }
.lg { display: block; height: 46px; border-radius: 6px; background-repeat: no-repeat; }
.lg-up { background: linear-gradient(var(--up) 0 4px, #169a6b 4px, #0c5b40) 0 18px / 30% 100%, linear-gradient(var(--dn) 0 4px, #c43a55 4px, #6d1f30) 34% 26px / 30% 100%, linear-gradient(var(--up) 0 4px, #169a6b 4px, #0c5b40) 68% 10px / 30% 100%; background-repeat: no-repeat; }
.lg-wall { background: linear-gradient(var(--up) 0 4px, #169a6b 4px, #0c5b40) 0 32px / 45% 100%, linear-gradient(var(--up) 0 4px, #169a6b 4px, #0c5b40) 100% 0 / 45% 100%; background-repeat: no-repeat; }
.lg-spike { background: conic-gradient(from 150deg at 50% 10%, transparent 0 0, #f4f6fb 0 60deg, transparent 0) 50% 0 / 40px 30px no-repeat, linear-gradient(var(--dn) 0 4px, #6d1f30 4px) 0 30px / 100% 100% no-repeat; }
.lg-coin { background: radial-gradient(circle at 50% 50%, var(--gold) 0 11px, transparent 12px) 50% 0 / 30px 30px no-repeat, linear-gradient(var(--up) 0 4px, #0c5b40 4px) 0 34px / 100% 100% no-repeat; }

.token { background: linear-gradient(180deg, var(--bg-2), #1a1608); border-top: 1px solid var(--line); padding: 60px 0 70px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0 10px; }
.steps > div { border: 1px solid rgba(255, 207, 61, 0.25); border-radius: 12px; padding: 18px; background: rgba(11, 15, 23, 0.5); }
.steps p { margin: 0; color: #c6cddb; font-size: 15px; }
.n { font: 700 12px var(--pix); color: var(--gold); }
.foot { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--mute); font-size: 13px; }
.foot-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 40; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-weight: 600; transition: 0.2s; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px; }
  .nav { width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; padding: 6px 8px; font-size: 14px; }
  .stage { height: 62vh; min-height: 340px; }
  .stage-wrap { width: calc(100% - 16px); }
  h2 { font-size: 26px; }
  .ov-card { padding: 18px; }
  .ov-card h2 { font-size: 24px; }
  .legend { grid-template-columns: 1fr; }
  .any-form { flex-direction: column; }
  .post { flex-direction: column; }
  .me-stats { grid-template-columns: repeat(3, 1fr); }
}
