/* ═══════════════════════════════════════════════════════════
   SKINSCAM.ME — satirical CS2 case-opening mockup
   genre: atmospheric-dark casino satire · tokens locked below
   ═══════════════════════════════════════════════════════════ */

:root {
  /* paper band — near-black green */
  --bg-0: #050806;
  --bg-1: #0a120d;
  --bg-panel: #0e1811;
  --bg-card: #101c14;
  --bg-inset: #0b140e;

  /* lines */
  --border: #1d3527;
  --border-bright: #2c5138;

  /* accents */
  --accent: #34e07f;
  --accent-dim: #1e8f4d;
  --accent-ink: #04130a;
  --gold: #f5c518;
  --gold-bright: #ffdb4d;
  --gold-ink: #1d1502;
  --danger: #ff5f5f;

  /* text */
  --text: #eef5f0;
  --muted: #8fa398;

  /* rarity (CS2-flavoured) */
  --rarity-blue: #4b69ff;
  --rarity-purple: #8847ff;
  --rarity-pink: #d32ce6;
  --rarity-red: #eb4b4b;
  --rarity-gold: #ffd700;

  /* type */
  --font-display: "Unbounded", "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* spacing scale (4pt) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --radius: 12px;
  --radius-sm: 8px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { background: var(--bg-0); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(52, 224, 127, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--font-display); font-style: normal; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
button { font-family: inherit; }
img, svg { display: block; }
::selection { background: rgba(52, 224, 127, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 6px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out),
              background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-green {
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
}
.btn-green:hover { box-shadow: 0 6px 24px rgba(52, 224, 127, 0.35); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--gold-ink);
}
.btn-gold:hover { box-shadow: 0 6px 24px rgba(245, 197, 24, 0.35); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-bright);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }

.btn-red {
  background: linear-gradient(180deg, #ff7b7b, var(--danger));
  color: #1f0303;
}
.btn-red:hover { box-shadow: 0 6px 24px rgba(255, 95, 95, 0.4); }

/* ── header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  background: rgba(8, 14, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-skull {
  width: 26px;
  height: 26px;
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(52, 224, 127, 0.5));
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.wordmark em { font-style: normal; color: var(--accent); }

.header-right { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

.balance-pill {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: 8px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.balance-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.balance-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}

/* ── marquee ───────────────────────────────────────────── */
.marquee {
  overflow: clip;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(245, 197, 24, 0.08), rgba(52, 224, 127, 0.06));
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 26s linear infinite;
}
.marquee-chunk {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  padding: 12px var(--s-4);
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.marquee-chunk i { font-style: normal; color: var(--accent); opacity: 0.7; }
.marquee-small {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── disclaimer ────────────────────────────────────────── */
.disclaimer {
  max-width: 1240px;
  margin: var(--s-4) auto 0;
  padding: var(--s-3) var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
}
.disclaimer strong { color: var(--text); }

/* ── layout ────────────────────────────────────────────── */
.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-5) var(--s-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-5);
  align-items: start;
}
.sidebar {
  display: grid;
  gap: var(--s-4);
  position: sticky;
  top: 76px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.panel-head { margin-bottom: var(--s-4); }
.panel-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  border: 1px solid rgba(245, 197, 24, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
}
.panel-sub { margin-top: var(--s-1); color: var(--muted); font-size: 0.85rem; }

/* ── case cards ────────────────────────────────────────── */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: var(--s-4);
}
.case-card {
  --case-color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-3);
  background:
    radial-gradient(90px 46px at 50% 0%, color-mix(in srgb, var(--case-color) 9%, transparent), transparent),
    linear-gradient(180deg, var(--bg-card), var(--bg-inset));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out);
}
.case-card:hover {
  transform: translateY(-4px);
  border-color: var(--case-color);
  box-shadow: 0 10px 34px color-mix(in srgb, var(--case-color) 22%, transparent);
}
.case-img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}
.case-fallback { display: none; width: 128px; height: 88px; }
.case-name {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.case-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
}
.btn-case {
  width: 100%;
  margin-top: var(--s-1);
  padding: 9px 10px;
  background: linear-gradient(180deg, var(--case-color), color-mix(in srgb, var(--case-color) 60%, #000));
  color: #04130a;
}
.btn-case:hover { box-shadow: 0 6px 22px color-mix(in srgb, var(--case-color) 40%, transparent); }

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .case-card { background: linear-gradient(180deg, var(--bg-card), var(--bg-inset)); }
  .case-card:hover { box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35); }
  .btn-case { background: var(--case-color); }
  .btn-case:hover { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); }
}

/* ── feed ──────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-entry {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 10px;
  border-left: 3px solid var(--rc, var(--border-bright));
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  font-size: 0.84rem;
  overflow: hidden;
}
.feed-entry:last-child { border-bottom: none; }
.feed-user { font-family: var(--font-mono); color: var(--muted); flex: none; }
.feed-item {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--rc, var(--text));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-entry.enter { animation: feed-in 300ms var(--ease-out); }
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rarity-blue   { --rc: var(--rarity-blue); }
.rarity-purple { --rc: var(--rarity-purple); }
.rarity-pink   { --rc: var(--rarity-pink); }
.rarity-red    { --rc: var(--rarity-red); }
.rarity-gold   { --rc: var(--rarity-gold); }

/* ── stats ─────────────────────────────────────────────── */
.stats-panel { display: grid; gap: var(--s-2); }
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}
.stat-label { color: var(--muted); font-size: 0.86rem; }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-value.bump { animation: stat-bump 400ms var(--ease-out); }
@keyframes stat-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); color: var(--gold); }
  100% { transform: scale(1); }
}
.stats-note { margin-top: var(--s-1); font-size: 0.72rem; color: var(--muted); opacity: 0.75; }

/* ── case opening overlay ──────────────────────────────── */
.gate-card-case { text-align: center; }
.case-open-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.case-reel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: var(--s-4) 0;
}
.case-reel-img {
  width: min(200px, 70%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6));
}
.case-reel-img.spinning {
  animation: case-spin 100ms linear infinite;
}
@keyframes case-spin {
  0%   { transform: translateY(-6px) rotate(-2deg); }
  50%  { transform: translateY(4px) rotate(2deg); }
  100% { transform: translateY(-6px) rotate(-2deg); }
}
.case-reel-img.result {
  animation: case-reveal 500ms var(--ease-out) forwards;
}
@keyframes case-reveal {
  0%   { transform: scale(0.6) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.case-reel-img.result-lost {
  animation: case-shatter 600ms var(--ease-out) forwards;
}
@keyframes case-shatter {
  0%   { transform: scale(1); opacity: 1; filter: grayscale(0) drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6)); }
  40%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.85) translateY(20px); opacity: 0.3; filter: grayscale(1) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)); }
}
.case-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--s-3);
}
.case-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 800ms steps(2) infinite;
}
.case-dots span:nth-child(2) { animation-delay: 150ms; }
.case-dots span:nth-child(3) { animation-delay: 300ms; }
@keyframes dot-pulse { 50% { opacity: 0.15; } }
.case-result-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--danger);
  text-shadow: 0 0 24px rgba(255, 95, 95, 0.4);
}
.case-result-sub {
  margin: var(--s-3) auto var(--s-5);
  max-width: 38ch;
  color: var(--muted);
  font-size: 0.92rem;
}
.case-result-anim {
  animation: result-flash 400ms var(--ease-out);
}
@keyframes result-flash {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-0);
  padding: var(--s-5);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent); }
.footer-links { margin-top: var(--s-2); }

/* ── overlays / modals ─────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: rgba(2, 5, 3, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay[hidden] { display: none; }

.gate-card {
  width: min(520px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: var(--s-6) var(--s-5);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.gate-card-sm { width: min(440px, 100%); }
.gate-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s-5);
}
.gate-skull { width: 34px; height: 34px; fill: var(--accent); filter: drop-shadow(0 0 8px rgba(52, 224, 127, 0.5)); }
.gate-logo .wordmark { font-size: 1.3rem; }
.gate-card h1 { font-size: 1.25rem; font-weight: 700; }
.gate-card h2 { font-size: 1.2rem; font-weight: 700; }
.error-title { color: var(--danger); }
.gate-sub { margin: var(--s-3) auto var(--s-5); max-width: 40ch; color: var(--muted); font-size: 0.92rem; }
.gate-actions { display: flex; justify-content: center; gap: var(--s-3); flex-wrap: wrap; }

/* ── misc ──────────────────────────────────────────────── */
.noscript-note {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  padding: var(--s-3);
  text-align: center;
  background: var(--danger);
  color: #1a0000;
  font-weight: 700;
}

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; top: auto; }
}

@media (max-width: 640px) {
  .site-header { padding: var(--s-3); }
  .wordmark { font-size: 0.9rem; }
  .balance-label { display: none; }
  .layout { padding: var(--s-4) var(--s-3) var(--s-7); }
  .panel { padding: var(--s-4); }
  .disclaimer { flex-direction: column; align-items: flex-start; margin-inline: var(--s-3); }
  .gate-card { padding: var(--s-5) var(--s-4); }
  .marquee-chunk { font-size: 0.68rem; }
}

/* ── 404 page ──────────────────────────────────────────── */
.nf-main {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: var(--s-7) var(--s-4);
}
.nf-panel {
  width: min(720px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: var(--s-7) var(--s-6);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.nf-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(72px, 16vw, 150px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow:
    3px 0 0 rgba(235, 75, 75, 0.5),
    -3px 0 0 rgba(75, 105, 255, 0.5),
    0 0 42px rgba(52, 224, 127, 0.35);
  animation: nf-flicker 3.2s steps(1) infinite;
}
@keyframes nf-flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93%, 95% { opacity: 0.72; }
  97% { opacity: 0.9; }
}
.nf-title {
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  margin-top: var(--s-4);
}
.nf-sub {
  color: var(--muted);
  margin: var(--s-3) auto 0;
  max-width: 48ch;
}
.nf-odds {
  list-style: none;
  margin: var(--s-5) auto 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-width: 440px;
  text-align: left;
}
.nf-odds li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  padding: 8px 12px;
  border-left: 3px solid var(--rc, var(--border-bright));
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.nf-odds b { color: var(--rc, var(--text)); font-weight: 700; flex: none; }
.nf-missing b { color: var(--danger); animation: nf-blink 1.1s steps(1) infinite; }
@keyframes nf-blink { 50% { opacity: 0.25; } }

.nf-log {
  margin: var(--s-5) auto 0;
  max-width: 480px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--muted);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-4);
  overflow-x: auto;
}
.nf-log em { font-style: normal; color: var(--accent); }
.nf-log .err { color: var(--danger); font-weight: 700; }

.nf-actions {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-6);
}

@media (max-width: 640px) {
  .nf-main { padding: var(--s-6) var(--s-3); }
  .nf-panel { padding: var(--s-6) var(--s-4); }
  .nf-code { font-size: clamp(60px, 22vw, 110px); }
}

/* ── impressum page ────────────────────────────────────── */
.imp-main {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--s-7) var(--s-5) var(--s-8);
}
.imp-panel { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.imp-panel .panel-head h1 {
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.imp-block { margin-top: var(--s-5); }
.imp-block h2 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s-2);
  margin-bottom: var(--s-2);
}
.imp-address {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-4);
}
.imp-provider { font-size: 1.02rem; margin-bottom: var(--s-2); }
.imp-provider strong { color: var(--accent); }
.imp-address-block {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
}
.imp-contact { margin-top: var(--s-2); color: var(--muted); font-size: 0.92rem; }
.imp-contact a { word-break: break-all; }
.imp-mono { font-family: var(--font-mono); color: var(--gold); }
.imp-note {
  margin-top: var(--s-6);
  padding: var(--s-3) var(--s-4);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.85rem;
}
.imp-note strong { color: var(--text); }

@media (max-width: 640px) {
  .imp-main { padding: var(--s-6) var(--s-3) var(--s-7); }
  .imp-panel { padding: var(--s-5) var(--s-4); }
}

/* ── downgrader page ─────────────────────────────────── */
.dg-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-5) var(--s-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: var(--s-5);
  align-items: start;
}
.dg-panel { text-align: center; }
.dg-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 1.4rem;
}
.dg-sub {
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52ch;
  margin-inline: auto;
}

/* ── downgrader inventory ────────────────────────────── */
.dg-inventory { margin-top: var(--s-6); }
.dg-inv-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 700;
}
.dg-inv-hint {
  margin-top: var(--s-1);
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.85;
}
.dg-inv-grid {
  margin-top: var(--s-3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}
.dg-inv-card {
  --case-color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-2);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-inset));
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  color: var(--text);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out);
}
.dg-inv-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}
.dg-inv-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 26px rgba(52, 224, 127, 0.18);
}
.dg-inv-card.lost {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}
.dg-inv-img {
  width: 100%;
  max-width: 120px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}
.dg-inv-name {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}
.dg-inv-wear {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dg-chance-section {
  margin-top: var(--s-6);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
}
.dg-chance-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.dg-chance-display {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.dg-chance-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  white-space: nowrap;
  min-width: 4ch;
  text-align: right;
}
.dg-slider {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--danger));
  outline: none;
  cursor: pointer;
}
.dg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(52, 224, 127, 0.5);
  cursor: pointer;
}
.dg-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(52, 224, 127, 0.5);
  cursor: pointer;
}
.dg-chance-hint {
  margin-top: var(--s-3);
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.8;
}

.dg-potential {
  margin-top: var(--s-4);
  display: grid;
  gap: var(--s-2);
  text-align: left;
}
.dg-pot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}
.dg-pot-label { color: var(--muted); font-size: 0.86rem; }
.dg-pot-value { font-family: var(--font-mono); font-weight: 700; }
.dg-pot-win { color: var(--accent); }
.dg-pot-lose { color: var(--danger); }

.dg-spin-btn {
  width: 100%;
  margin-top: var(--s-3);
}
.dg-spin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dg-reel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
}
.dg-reel-item {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(52, 224, 127, 0.4);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.dg-reel-img {
  width: min(290px, 88%);
  height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.6));
  transition: opacity 150ms var(--ease-out), filter 150ms var(--ease-out);
}
.dg-reel.spinning .dg-reel-item,
.dg-reel.spinning .dg-reel-img {
  animation: reel-shake 120ms linear infinite;
  opacity: 0.3;
}
@keyframes reel-shake {
  0% { transform: translateY(-4px); }
  50% { transform: translateY(3px); }
  100% { transform: translateY(-4px); }
}
.dg-reel.lost .dg-reel-item {
  color: var(--danger);
  text-shadow: 0 0 24px rgba(255, 95, 95, 0.4);
  animation: reel-fall 400ms var(--ease-out);
}
.dg-reel.lost .dg-reel-img {
  animation: reel-fall 400ms var(--ease-out);
  filter: drop-shadow(0 10px 22px rgba(255, 95, 95, 0.5)) grayscale(1);
}
@keyframes reel-fall {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(40px); opacity: 0; }
}
.dg-reel.won .dg-reel-item {
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245, 197, 24, 0.5);
}

/* ── downgrader showcase (side animation panel) ──────── */
.dg-showcase {
  position: sticky;
  top: 76px;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  padding: var(--s-6) var(--s-5);
  background:
    radial-gradient(460px 280px at 50% 10%, rgba(52, 224, 127, 0.1), transparent 60%),
    var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.dg-showcase.spinning {
  border-color: var(--accent);
  animation: show-flash 260ms linear infinite;
}
.dg-showcase.lost {
  border-color: var(--danger);
  box-shadow: 0 0 60px rgba(255, 95, 95, 0.22), inset 0 0 80px rgba(255, 95, 95, 0.06);
}
@keyframes show-flash {
  0%, 100% { box-shadow: inset 0 0 30px rgba(52, 224, 127, 0.06); }
  50% { box-shadow: inset 0 0 80px rgba(52, 224, 127, 0.16), 0 0 50px rgba(52, 224, 127, 0.3); }
}

.dg-leds {
  display: flex;
  gap: 9px;
}
.dg-leds span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(52, 224, 127, 0.6);
  animation: led-blink 1.1s steps(2) infinite;
}
.dg-leds span:nth-child(3n) { animation-delay: 0.15s; }
.dg-leds span:nth-child(3n+1) { animation-delay: 0.3s; }
@keyframes led-blink { 50% { opacity: 0.12; } }

.dg-showcase-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  animation: status-flicker 2.4s steps(1) infinite;
}
@keyframes status-flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.5; }
  96% { opacity: 1; }
}

@media (max-width: 1024px) {
  .dg-main { grid-template-columns: minmax(0, 1fr); }
  .dg-showcase { position: static; top: auto; min-height: 340px; }
}

.dg-history {
  margin-top: var(--s-6);
  text-align: left;
}
.dg-history-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 700;
}
.dg-history-list { margin-top: var(--s-3); display: grid; gap: 6px; }
.dg-history-empty {
  padding: var(--s-4);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.dg-hist-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 8px 12px;
  border-left: 3px solid var(--rc, var(--border-bright));
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  animation: feed-in 300ms var(--ease-out);
}
.dg-hist-entry .dg-hist-chance { color: var(--text); }
.dg-hist-entry .dg-hist-result { font-weight: 700; flex: none; }

/* ── downgrader overlays (escation / truth) ──────────── */
.esc-title { color: var(--danger); }
.gate-card-truth { border-color: var(--accent); }
.truth-title { color: var(--accent); font-size: 1.45rem; }
.truth-body {
  margin: var(--s-3) auto 0;
  max-width: 46ch;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}
.truth-cta {
  margin: var(--s-4) auto var(--s-5);
  max-width: 40ch;
  color: var(--gold);
  font-weight: 700;
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .dg-main { padding: var(--s-4) var(--s-3) var(--s-7); }
  .dg-chance-display { gap: var(--s-3); }
  .dg-inv-grid { grid-template-columns: 1fr; }
  .dg-showcase { min-height: 280px; padding: var(--s-5) var(--s-3); }
}
