/* ===== Tokenmaxxed — Molten Inferno theme ============================== */
:root {
  --char-900: #0e0805;
  --char-800: #160c07;
  --char-700: #211109;
  --char-600: #2e170c;
  --ember-red: #ff3b1d;
  --ember-orange: #ff7a18;
  --ember-amber: #ffae12;
  --ember-yellow: #ffd11a;
  --cream: #ffe9cf;
  --ash: #b9a08c;
  --good: #6ee787;

  --grad-fire: linear-gradient(135deg, #ffd11a 0%, #ff7a18 42%, #ff3b1d 100%);
  --grad-fire-soft: linear-gradient(135deg, #ff7a18, #cc2208);

  --radius: 18px;
  --shadow-glow: 0 0 0 1px rgba(255, 122, 24, 0.25), 0 18px 50px rgba(255, 60, 29, 0.18);
  --maxw: 1180px;
  --font-display: 'Archivo Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--cream);
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(255, 122, 24, 0.22), transparent 60%),
    radial-gradient(900px 600px at 10% 10%, rgba(255, 60, 29, 0.18), transparent 55%),
    var(--char-900);
  min-height: 100vh;
  overflow-x: hidden;
}

#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Header ========================================================== */
header.hero { text-align: center; padding: 56px 20px 26px; position: relative; z-index: 1; }
.kicker {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ember-amber);
  border: 1px solid rgba(255, 174, 18, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}
h1.title {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 110px);
  line-height: 0.92;
  margin: 0;
  background: var(--grad-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 40px rgba(255, 60, 29, 0.35);
  letter-spacing: -0.02em;
}
.subtitle { font-size: clamp(16px, 2.4vw, 22px); color: var(--cream); opacity: 0.92; margin: 18px auto 0; max-width: 720px; }
.subtitle b { color: var(--ember-yellow); }

/* ===== Section headings ============================================== */
.section-h { font-family: var(--font-display); font-size: 26px; margin: 40px 0 18px; color: var(--cream); }
.section-h .num { color: var(--ember-orange); }

/* ===== Use-case picker =============================================== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--cream); background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 122, 24, 0.3); border-radius: 999px; padding: 8px 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.chip:hover { border-color: rgba(255, 174, 18, 0.7); }
.chip.active { background: var(--grad-fire); color: #1a0d06; border-color: transparent; }
.search {
  font: inherit; color: var(--cream); min-width: 220px; flex: 1 1 220px; max-width: 320px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 122, 24, 0.3);
  border-radius: 999px; padding: 9px 16px;
}
.search::placeholder { color: var(--ash); }
.search:focus { outline: none; border-color: var(--ember-orange); }
.empty { color: var(--ash); font-size: 15px; padding: 28px 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.uc-card .hot {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: #1a0d06;
  background: var(--grad-fire); padding: 3px 9px; border-radius: 999px;
}
.uc-card { position: relative; }
.uc-card {
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(255, 122, 24, 0.25);
  background: linear-gradient(180deg, rgba(46, 23, 12, 0.85), rgba(22, 12, 7, 0.85));
  border-radius: var(--radius);
  padding: 22px;
  color: var(--cream);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  font: inherit;
}
.uc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: rgba(255, 174, 18, 0.6); }
.uc-card.active { border-color: var(--ember-orange); box-shadow: var(--shadow-glow); background: linear-gradient(180deg, rgba(255, 122, 24, 0.18), rgba(22, 12, 7, 0.9)); }
.uc-card .emoji { font-size: 34px; }
.uc-card h3 { font-family: var(--font-display); font-size: 20px; margin: 12px 0 6px; }
.uc-card p { margin: 0; font-size: 14px; color: var(--ash); }

/* ===== Console (params + results) =================================== */
.console { display: grid; grid-template-columns: 380px 1fr; gap: 22px; margin-top: 12px; align-items: start; }
.panel {
  background: linear-gradient(180deg, rgba(33, 17, 9, 0.92), rgba(14, 8, 5, 0.92));
  border: 1px solid rgba(255, 122, 24, 0.22);
  border-radius: var(--radius);
  padding: 22px;
}
.panel h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.panel .blurb { font-size: 14px; color: var(--ash); margin: 0 0 18px; line-height: 1.5; }

/* Controls */
.ctrl { margin-bottom: 18px; }
.ctrl label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ctrl label .val { color: var(--ember-yellow); font-variant-numeric: tabular-nums; }
input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--ember-red), var(--ember-amber)); outline: none;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ember-orange); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ember-orange); cursor: pointer; }
select {
  width: 100%; padding: 10px 12px; border-radius: 12px; font: inherit; color: var(--cream);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,122,24,0.3);
}

/* ===== Results ====================================================== */
.headline { text-align: center; padding: 14px 0 6px; }
.headline .lead { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); }
.headline .big {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 84px);
  line-height: 1;
  margin: 6px 0;
  background: var(--grad-fire);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.headline .range { font-size: 15px; color: var(--ash); }
.headline .range b { color: var(--cream); }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.model-card { border-radius: 16px; padding: 18px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); position: relative; overflow: hidden; }
.model-card::before { content:''; position:absolute; inset:0 0 auto 0; height:4px; background: var(--accent, var(--ember-orange)); }
.model-card h4 { margin: 6px 0 2px; font-family: var(--font-display); font-size: 18px; }
.model-card .price { font-size: 12px; color: var(--ash); margin-bottom: 12px; }
.model-card .cost { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.model-card .per { font-size: 12px; color: var(--ash); }
.model-card .toks { font-size: 12px; color: var(--ash); margin-top: 8px; }
.model-card.cheap { box-shadow: inset 0 0 0 1px rgba(110,231,135,0.4); }
.model-card .tag { position:absolute; top:12px; right:12px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; padding:3px 8px; border-radius:999px; }
.tag.cheapest { background: rgba(110,231,135,0.18); color: var(--good); }
.tag.priciest { background: rgba(255,60,29,0.18); color: var(--ember-red); }

/* Panic + equivalents */
.split { display:grid; grid-template-columns: 280px 1fr; gap: 18px; margin-top: 6px; }
.panic { text-align:center; background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:16px; padding:16px; }
.panic canvas { width: 220px; max-width: 100%; height: 220px; }
.panic .lvl { font-family: var(--font-display); font-size: 20px; margin-top: -6px; }
.panic .sub { font-size: 13px; color: var(--ash); }

.equiv-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap:12px; }
.equiv { background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:14px; padding:14px; }
.equiv .e { font-size:24px; }
.equiv .v { font-family: var(--font-display); font-size:22px; margin:4px 0 2px; }
.equiv .l { font-size:12px; color: var(--ash); }

.quip { margin-top:16px; padding:14px 16px; border-radius:14px; background: rgba(255,174,18,0.1); border:1px dashed rgba(255,174,18,0.4); font-size:15px; }

/* Fine print */
details.fine { margin-top:16px; border:1px solid rgba(255,255,255,0.1); border-radius:14px; background: rgba(0,0,0,0.25); }
details.fine summary { cursor:pointer; padding:14px 16px; font-weight:700; list-style:none; }
details.fine summary::-webkit-details-marker { display:none; }
details.fine summary::before { content:'\25B8  '; color: var(--ember-orange); }
details.fine[open] summary::before { content:'\25BE  '; }
.fine .body { padding: 0 16px 16px; font-size: 14px; color: var(--ash); line-height:1.6; }
.fine code { color: var(--ember-yellow); background: rgba(255,255,255,0.06); padding:2px 6px; border-radius:6px; }
.fine ul { margin: 8px 0; padding-left: 20px; }

/* Buttons */
.actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:18px; }
.btn { font: inherit; font-weight:700; cursor:pointer; border:none; border-radius:12px; padding:12px 18px; color:#1a0d06; background: var(--grad-fire); box-shadow: var(--shadow-glow); }
.btn.ghost { background: transparent; color: var(--cream); border:1px solid rgba(255,122,24,0.4); box-shadow:none; }
.btn:active { transform: translateY(1px); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--char-700); border:1px solid var(--ember-orange); color:var(--cream); padding:12px 18px; border-radius:12px; opacity:0; transition: opacity .25s; z-index: 50; }
.toast.show { opacity: 1; }

/* Leaderboard */
.lb { background: linear-gradient(180deg, rgba(33,17,9,0.9), rgba(14,8,5,0.9)); border:1px solid rgba(255,122,24,0.22); border-radius: var(--radius); padding: 8px 8px; }
.lb-row { display:grid; grid-template-columns: 44px 1fr auto; align-items:center; gap:12px; padding:12px 14px; border-radius:12px; }
.lb-row + .lb-row { border-top: 1px solid rgba(255,255,255,0.06); }
.lb-row.mine { background: rgba(255,174,18,0.12); border:1px solid rgba(255,174,18,0.4); }
.lb-rank { font-family: var(--font-display); font-size:20px; color: var(--ember-amber); text-align:center; }
.lb-name { font-weight:700; }
.lb-blurb { font-size:12px; color: var(--ash); }
.lb-tok { font-family: var(--font-display); font-size:18px; color: var(--cream); }

footer { text-align:center; padding: 40px 20px 60px; color: var(--ash); font-size: 13px; position: relative; z-index:1; }
footer a { color: var(--ember-amber); }

.hidden { display: none !important; }

/* ===== Responsive =================================================== */
@media (max-width: 860px) {
  .console { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
