:root {
  /* SHPOOM v2: black base, fire palette (orange / amber / red), bold glow */
  --bg: #07080b;
  --bg-rgb: 7, 8, 11;
  --bg2: #0c0e13;
  --panel: #11141b;
  --card: #161a23;
  --card2: #1c212c;
  --line: #252b38;
  --line2: #323a4a;
  --fg: #f7f7f8;
  --fg2: #d8dce5;
  --muted: #98a1b2;
  --acc: #ff5a1f;
  --acc-rgb: 255, 90, 31;
  --on-acc: #160700;
  --heat: #ffb800;
  --heat-rgb: 255, 184, 0;
  --fire: var(--acc);
  --fire2: #ff8a00;
  --spark: #ffb800;
  --ember: #e11d48;
  --good: #22c55e;
  --bad: #ef4444;
  --sky: #38bdf8;
  --grad: linear-gradient(120deg, #ffb800 0%, #ff8a00 30%, #ff5a1f 62%, #e11d48 100%);
  --radius: 16px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --glow: 0 0 0 1px rgba(var(--acc-rgb), .5), 0 18px 60px -18px rgba(var(--acc-rgb), .7);
  --ff: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-d: 'Barlow Condensed', 'Cairo', sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--ff); font-size: 16px; line-height: 1.7; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--spark); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.latin { font-family: var(--ff-d); letter-spacing: .02em; }

/* ---------- logo */
.logo { display: inline-flex; align-items: center; direction: ltr; font-family: var(--ff-d); font-weight: 800; font-style: italic; font-size: 30px; line-height: 1; letter-spacing: .5px; color: var(--fg); gap: 0; }
.logo .lg-t { background: linear-gradient(180deg, #fff 30%, #ffd5c2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .lg-bomb { width: 1.08em; height: 1.08em; margin: 0 -.02em 0 .02em; transform: translateY(.03em); overflow: visible; }
.lg-bomb .spark { transform-origin: 54px 9px; animation: spark 0.9s infinite ease-in-out; }
.lg-bomb .spark2 { transform-origin: 54px 9px; animation: spark 0.6s infinite ease-in-out reverse; }
@keyframes spark { 0%, 100% { transform: scale(.75) rotate(0deg); opacity: .85; } 50% { transform: scale(1.25) rotate(25deg); opacity: 1; } }

/* ---------- buttons */
.btn { --b: var(--card2); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 2px solid var(--line2); background: var(--b); font-weight: 800; font-size: 16px; transition: transform .2s, box-shadow .25s, background .25s, border-color .25s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); border-color: #5a6478; }
.btn:active { transform: translateY(1px); }
.btn-fire { border: 0; color: var(--on-acc); background: var(--grad); box-shadow: 0 10px 40px -10px rgba(var(--acc-rgb), .85), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-fire:hover { box-shadow: 0 16px 56px -8px rgba(var(--acc-rgb), 1), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-fire::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%); background-size: 250% 100%; background-position: 150% 0; transition: background-position .8s; pointer-events: none; }
.btn-fire:hover::after { background-position: -50% 0; }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 18px; border-radius: 14px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- segmented controls */
.seg { display: inline-flex; flex-wrap: nowrap; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 10px; transition: background .2s, color .2s; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--fire); color: var(--on-acc); }
.seg button.on.good { background: var(--good); color: #052e16; }
.seg button.on.bad { background: var(--bad); color: #fff; }
.seg-wrap { flex-wrap: wrap; }

/* ---------- player */
.player { display: block; }
.pl-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: radial-gradient(70% 60% at 55% 45%, rgba(var(--acc-rgb), .16), transparent 70%), linear-gradient(180deg, #10131a, #0a0c10); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.pl-stage::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.pl-stage.is-bad { border-color: rgba(239, 68, 68, .55); box-shadow: 0 0 0 1px rgba(239, 68, 68, .25), 0 20px 60px -24px rgba(239, 68, 68, .6); }
.pl-stage.is-bad.flash { animation: badflash 1.6s ease-in-out; }
@keyframes badflash { 0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, .25); } 30% { box-shadow: 0 0 0 3px rgba(239, 68, 68, .7), 0 0 60px rgba(239, 68, 68, .45); } }
.pl-svg { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 11 / 10; }
.pl-hud { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; }
.pl-phase, .pl-reps { background: rgba(10, 12, 16, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; padding: 7px 13px; }
.pl-phase b { display: block; font-size: 16px; line-height: 1.35; }
.pl-phase small { color: var(--muted); font-size: 12px; font-weight: 600; }
.pl-phase.flag { border-color: rgba(239, 68, 68, .7); }
.pl-phase.flag b { color: var(--bad); }
.pl-reps { text-align: center; padding: 5px 12px; }
.pl-reps b { display: block; font-family: var(--ff-d); font-size: 30px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-reps small { color: var(--muted); font-size: 11px; }
.pl-verdict { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.pl-verdict.ok { background: rgba(34, 197, 94, .14); color: var(--good); border: 1px solid rgba(34, 197, 94, .4); }
.pl-verdict.no { background: rgba(239, 68, 68, .16); color: #ff8a8a; border: 1px solid rgba(239, 68, 68, .5); }
.pl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .06); }
.pl-bar i { display: block; height: 100%; width: 0; background: var(--grad); }
.pl-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; }
.pl-play { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--fg); }
@media (max-width: 520px) {
  .pl-phase b { font-size: 14px; }
  .pl-reps b { font-size: 22px; }
  .pl-hud { flex-direction: row; top: 8px; left: 8px; }
  .pl-verdict { font-size: 12px; bottom: 10px; }
  .seg button { padding: 8px 10px; font-size: 13px; }
}

/* ---------- calculators */
.calc-card { display: grid; gap: 18px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calc-grid .wide { grid-column: span 2; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fld { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.fld input, .fld select { width: 100%; min-height: 46px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; color: var(--fg); font-size: 16px; font-weight: 700; }
.fld input:focus, .fld select:focus { border-color: var(--fire); outline: none; box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .2); }
.fld .seg { width: 100%; }
.fld .seg button { flex: 1; justify-content: center; }
.calc-out { display: grid; gap: 14px; }
.calc-out.two { grid-template-columns: 1fr 1fr; }
.big-stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.big-stat small { width: 100%; color: var(--muted); font-weight: 700; }
.big-stat b { font-family: var(--ff-d); font-size: clamp(40px, 7vw, 60px); line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr; }
.big-stat span { color: var(--muted); font-weight: 700; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.tag.good { background: rgba(34, 197, 94, .15); color: var(--good); }
.tag.warn { background: rgba(255, 184, 0, .14); color: #ffc93c; }
.tag.bad { background: rgba(239, 68, 68, .15); color: #ff8a8a; }
.macro-row { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.macro { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 2px; }
.macro small { color: var(--muted); font-weight: 700; }
.macro b { font-family: var(--ff-d); font-size: 30px; line-height: 1.1; }
.macro span { color: var(--muted); font-size: 12px; }
.macro .meter { display: block; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: 6px; }
.macro .meter em { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .6s; }
.macro.p em { background: var(--fire); } .macro.c em { background: var(--spark); } .macro.f em { background: var(--sky); }
.macro-row.locked .macro { filter: blur(5px); opacity: .6; }
.lock-cta { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; color: var(--fg); background: rgba(var(--bg-rgb), .35); border-radius: 14px; }
.lock-cta:hover span { text-decoration: underline; }
.calc-note { margin: 0; color: var(--fg2); font-weight: 600; }
.calc-hint { margin: 0; color: var(--muted); font-size: 13px; }
.calc-hint.center { text-align: center; margin-top: 16px; }
.scale { position: relative; height: 12px; border-radius: 9px; background: linear-gradient(90deg, #38bdf8 0 14%, #22c55e 14% 40%, #ffb800 40% 60%, #ef4444 60%); display: flex; justify-content: space-around; font-size: 11px; color: var(--muted); }
.scale span { transform: translateY(14px); }
.scale .needle { position: absolute; top: -5px; width: 4px; height: 22px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px #fff; transform: translateX(50%); transition: inset-inline-start .5s; }
.calc-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.calc-tabs button { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 800; padding: 9px 16px; border-radius: 12px; }
.calc-tabs button.on { background: var(--grad); color: var(--on-acc); border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
