:root {
  color-scheme: dark;
  --bg: #101219;
  --panel: #181d28;
  --panel-2: #202838;
  --ink: #f2eee5;
  --muted: #aeb7c9;
  --line: #374055;
  --gold: #f3bf5b;
  --blue: #8fb7ff;
  --red: #ff7d73;
  --green: #8de1b1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 0%, #24314e 0, transparent 38rem), var(--bg);
  color: var(--ink);
}
button { font: inherit; }
.shell { width: min(1060px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 54px; }
.hero { margin-bottom: 22px; }
.eyebrow, .label, .micro { color: var(--muted); letter-spacing: .05em; text-transform: uppercase; font-size: .75rem; }
.hero h1 { margin: 0; font-size: clamp(3rem, 12vw, 7.5rem); line-height: .85; }
.dek { max-width: 680px; color: #d7deea; font-size: 1.15rem; line-height: 1.5; }
.panel {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 16px 50px rgb(0 0 0 / 22%);
}
.equation-panel { display: grid; grid-template-columns: 1.5fr .9fr; gap: 20px; align-items: center; margin-bottom: 18px; }
.formula { font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(1.4rem, 4vw, 3rem); color: var(--gold); overflow-wrap: anywhere; }
.rates { display: grid; gap: 12px; }
.rates div, .stat { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.rates strong { font-size: 1.7rem; }
.grid { display: grid; grid-template-columns: .8fr 1fr; gap: 18px; margin-bottom: 18px; }
.controls, .shop, .automator { display: grid; gap: 14px; }
.automator { grid-column: 1 / -1; }
.automator label { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: #dbe6ff; }
.automator input { width: 1.2rem; height: 1.2rem; accent-color: var(--gold); }
button { border: 0; border-radius: 14px; padding: 14px 16px; cursor: pointer; color: #101219; background: var(--gold); font-weight: 800; transition: transform .08s ease, opacity .15s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .45; }
.primary { font-size: 1.25rem; min-height: 70px; }
.shop button { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: #dbe6ff; }
.danger { background: var(--red); color: #220805; width: 100%; margin-top: 12px; }
.meter { height: 14px; border-radius: 999px; background: #0c0f15; border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .2s ease; }
.hinge { margin-bottom: 18px; }
.hinge h2 { margin: 0 0 8px; font-size: clamp(2rem, 7vw, 4.5rem); color: var(--blue); }
.cost-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 8px; }
.cost-list div { border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 14px; }
dt { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
dd { margin: 6px 0 0; line-height: 1.35; }
.log ul { margin: 0; padding-left: 1.1rem; color: #dbe6ff; }
.log li + li { margin-top: 7px; }
@media (max-width: 760px) {
  .equation-panel, .grid, .cost-list { grid-template-columns: 1fr; }
}
