/* ============================================================
   LemonAIde — "Maple Street Mission Control, 197X"
   Retrofuturistic console. Warm (human) vs. cold (machine).
   ============================================================ */

:root {
  /* palette — warm lemonade vs. cold machine */
  --bg:        #150e06;
  --bg-2:      #0c0703;
  --panel:     #1d1207;
  --panel-2:   #251705;
  --edge:      #41300f;
  --line:      #3a2912;
  --lemon:     #ffd23f;
  --lemon-lo:  #ffe96b;
  --amber:     #ff9e1b;
  --cream:     #f6e8c6;
  --cream-dim: #b29a6b;
  --cyan:      #2fe4ff;
  --cyan-deep: #0bb6d6;
  --danger:    #ff2e63;
  --mint:      #6bf0a5;

  /* type */
  --f-logo:    'Monoton', cursive;
  --f-display: 'Bungee', 'Arial Black', sans-serif;
  --f-mono:    'DM Mono', ui-monospace, 'Courier New', monospace;

  --glow-lemon: 0 0 6px rgba(255,210,63,.55), 0 0 18px rgba(255,158,27,.35);
  --glow-cyan:  0 0 6px rgba(47,228,255,.55), 0 0 18px rgba(11,182,214,.35);
  --glow-danger:0 0 8px rgba(255,46,99,.6), 0 0 22px rgba(255,46,99,.4);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--f-mono);
  color: var(--cream);
  background:
    radial-gradient(1100px 700px at 50% -8%, #2a1c08 0%, var(--bg) 55%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- full-screen CRT atmosphere ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.scanlines {
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px);
  mix-blend-mode: multiply;
  animation: scandrift 8s linear infinite;
}
.grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: overlay;
  animation: grainshift .6s steps(3) infinite;
}
.vignette {
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%);
}

/* ---------- the console bezel ---------- */
.console {
  position: relative;
  max-width: 1140px;
  margin: 14px auto 28px;
  padding: 18px 24px 22px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--edge);
  box-shadow:
    inset 0 2px 0 rgba(255,210,63,.10),
    inset 0 0 60px rgba(0,0,0,.6),
    0 24px 60px rgba(0,0,0,.65),
    0 0 0 6px #0e0904,
    0 0 0 8px #251705;
}

.screw {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a4416, #1a1206 70%);
  box-shadow: inset 0 0 3px rgba(0,0,0,.8), 0 1px 1px rgba(255,210,63,.15);
}
.screw::before {
  content: ""; position: absolute; inset: 4px; border-top: 2px solid #0a0703;
  transform: rotate(35deg);
}
.screw.tl { top: 10px; left: 10px; } .screw.tr { top: 10px; right: 10px; }
.screw.bl { bottom: 10px; left: 10px; } .screw.br { bottom: 10px; right: 10px; }

/* ---------- header / logo ---------- */
.topbar { text-align: center; margin-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.logo {
  font-family: var(--f-logo);
  font-size: clamp(32px, 5.5vw, 56px);
  line-height: 1;
  margin: 0;
  color: var(--lemon);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255,210,63,.7), 0 0 28px rgba(255,158,27,.5), 0 0 50px rgba(255,158,27,.3);
  animation: flickerlogo 6s infinite;
}
.logo .ai { color: var(--cyan); text-shadow: 0 0 10px rgba(47,228,255,.9), 0 0 30px rgba(11,182,214,.6); }
.powerlight {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 8px var(--mint), 0 0 16px var(--mint);
  animation: blink 2.4s steps(1) infinite;
}
.tagline {
  margin: 8px 0 0; color: var(--amber); font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase;
}

/* ---------- HUD readouts ---------- */
.hud { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.chip {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #0e0a04, #160d05);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), inset 0 2px 10px rgba(0,0,0,.6);
}
.chip::after { /* faint display scanline */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 3px, rgba(0,0,0,.18) 3px 4px);
}
.chip-k { display: block; font-size: 9px; letter-spacing: 2px; color: var(--cream-dim); }
.chip-v { display: block; font-family: var(--f-display); font-size: 22px; color: var(--cream); margin-top: 2px; }
.chip-v.money { color: var(--lemon); text-shadow: var(--glow-lemon); }
.chip.danger .chip-v { color: var(--danger); text-shadow: var(--glow-danger); }
#heat-chip .chip-v { color: var(--amber); }
#heat-chip.hot .chip-v { color: var(--danger); text-shadow: var(--glow-danger); }

/* ---------- the tug-of-war gauge (centerpiece) ---------- */
.meter { margin: 2px 0 12px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.meter-label { font-size: 11px; letter-spacing: 2px; font-weight: 500; }
.meter-label.human { color: var(--lemon); text-shadow: var(--glow-lemon); }
.meter-label.machine { color: var(--danger); text-shadow: var(--glow-danger); }
.meter-title { font-family: var(--f-display); font-size: 11px; color: var(--cream-dim); letter-spacing: 1px; }
.meter-track {
  position: relative; height: 26px; border-radius: 999px; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,210,63,.10), rgba(47,228,255,.05) 60%, rgba(255,46,99,.12));
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
}
.meter-ticks {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(to right, rgba(0,0,0,0) 0 calc(10% - 1px), rgba(246,232,198,.25) calc(10% - 1px) 10%);
}
.meter-fill {
  position: relative; height: 100%; width: 35%;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.12) 0 6px, rgba(0,0,0,0) 6px 12px), linear-gradient(90deg, var(--lemon) 0%, var(--amber) 45%, var(--danger) 100%);
  box-shadow: 0 0 16px rgba(255,46,99,.5), inset 0 1px 0 rgba(255,255,255,.25);
  transition: width .7s cubic-bezier(.2,.8,.2,1);
}
.meter-knob {
  position: absolute; right: -2px; top: 50%; width: 8px; height: 150%;
  transform: translateY(-50%); border-radius: 4px;
  background: var(--cream);
  box-shadow: 0 0 10px var(--cream), 0 0 22px rgba(255,210,63,.8);
}
.meter-fill.pulse { animation: meterpulse .65s ease; }
.meter-goal { text-align: center; font-size: 11px; line-height: 1.5; color: var(--cream-dim); margin-top: 9px; }
.meter-goal b { font-weight: 500; }
.meter-goal .win-t { color: var(--mint); }
.meter-goal .lose-t { color: var(--danger); }

/* ---------- the street ---------- */
.street-wrap {
  position: relative; margin-bottom: 10px; padding: 10px 12px 8px;
  background: linear-gradient(180deg, #120c05, #1a1006);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.5);
}
.street-tag { position: absolute; top: 8px; left: 12px; font-size: 9px; letter-spacing: 2px; color: var(--cream-dim); }
.street {
  display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.street::-webkit-scrollbar { height: 6px; }
.street::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.stand {
  position: relative; flex: 0 0 auto; width: 92px; text-align: center;
  padding: 12px 6px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25);
  animation: bob 4s ease-in-out infinite;
}
.stand::before { /* awning */
  content: ""; position: absolute; top: -7px; left: -1px; right: -1px; height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, #0d0904 8px 16px);
}
.stand.you {
  border-color: var(--lemon); color: var(--lemon);
  box-shadow: 0 0 14px rgba(255,210,63,.35), inset 0 0 18px rgba(255,210,63,.08);
}
.stand.you::before { background: repeating-linear-gradient(90deg, var(--lemon) 0 8px, #7a5a10 8px 16px); }
.stand.rival {
  border-color: var(--cyan-deep); color: var(--cyan);
  box-shadow: 0 0 12px rgba(47,228,255,.25), inset 0 0 16px rgba(47,228,255,.06);
}
.stand.rival::before { background: repeating-linear-gradient(90deg, var(--cyan-deep) 0 8px, #07333c 8px 16px); }
.stand.disabled { opacity: .3; filter: grayscale(.7); animation: none; }
.stand.disabled::after {
  content: "OFFLINE"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 9px; color: var(--danger); letter-spacing: 1px;
  transform: rotate(-10deg); text-shadow: var(--glow-danger);
}
.stand .face { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.stand.you .face { animation: floaty 3s ease-in-out infinite; }
.stand .name { font-size: 8.5px; letter-spacing: .5px; margin-top: 6px; word-break: break-word; min-height: 2.4em; }

/* per-rival integrity */
.stand .hp { height: 5px; margin-top: 6px; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.55); border: 1px solid var(--line); }
.stand .hp-fill { height: 100%; width: 100%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); transition: width .45s ease; }
.stand .hp-fill.mid { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.stand .hp-fill.lo  { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.stand .hp-num { font-size: 8px; color: var(--cream-dim); margin-top: 3px; letter-spacing: .5px; }
/* targeting */
.stand.rival.targetable { cursor: pointer; }
.stand.rival.targetable:hover { border-color: var(--danger); box-shadow: 0 0 14px rgba(255,46,99,.5); transform: translateY(-2px); }
.stand.rival.aoe { border-color: var(--danger); box-shadow: 0 0 12px rgba(255,46,99,.35); }
.stand.rival.targeted { border-color: var(--danger); box-shadow: 0 0 18px rgba(255,46,99,.7); }
.stand.rival.targeted::after { content: "🎯"; position: absolute; top: -12px; right: -6px; font-size: 18px; animation: none; }

/* nth-child bob desync */
.stand:nth-child(2n) { animation-delay: -1.3s; }
.stand:nth-child(3n) { animation-delay: -2.1s; }

/* ---------- briefing / ticker ---------- */
.briefing {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #160d05, #0f0a04);
  border: 1px solid var(--line); border-left: 4px solid var(--amber);
  padding: 9px 14px; border-radius: 8px; margin-bottom: 12px;
}
.briefing-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display); font-size: 10px; color: var(--amber); letter-spacing: 1px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: var(--glow-danger); animation: blink 1.2s steps(1) infinite; }
.headline { flex: 1; min-width: 200px; color: var(--cream); letter-spacing: .5px; font-size: 14px; }
.weather { font-size: 11px; color: var(--cyan); }
.weather b { color: var(--cyan); text-shadow: var(--glow-cyan); }

/* ---------- control panel ---------- */
.panel {
  background: linear-gradient(180deg, #1a1006, #140c05);
  border: 1px solid var(--edge); border-radius: 14px; padding: 13px;
  display: grid; gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255,210,63,.06);
}
.dials { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.control label, .control-k { display: block; font-size: 10px; letter-spacing: 2px; color: var(--cream-dim); margin-bottom: 8px; text-transform: uppercase; }
.control output { float: right; font-family: var(--f-display); color: var(--lemon); text-shadow: var(--glow-lemon); }
.hint { display: block; margin-top: 7px; font-size: 10px; line-height: 1.45; color: var(--cream-dim); }
.hint b { color: var(--lemon); font-weight: 500; }
.hint.center { text-align: center; }

/* ---------- how-to-play onboarding ---------- */
.howto-open { margin-top: 10px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 2px; color: var(--cream-dim); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.howto-open:hover { color: var(--lemon); border-color: var(--lemon); }
.results-lead { margin: 0 0 12px; font-size: 13px; color: var(--cream-dim); }
.howto-card { position: relative; max-width: 480px; max-height: 88vh; overflow: auto; text-align: left; }
.howto-card h2 { text-align: center; }
.x-close { position: absolute; top: 8px; right: 10px; z-index: 2; background: none; border: none; color: var(--cream-dim); font-size: 16px; line-height: 1; cursor: pointer; padding: 6px; border-radius: 6px; }
.x-close:hover, .x-close:focus-visible { color: var(--lemon); background: rgba(255,255,255,.06); outline: none; }
.howto-more { margin-top: 16px; padding-top: 12px; border-top: 1px dotted var(--line); }
.howto-more p { font-size: 12.5px; line-height: 1.5; color: var(--cream-dim); margin: 0 0 9px; }
.howto-more p:last-child { margin-bottom: 0; }
.howto-more b { color: var(--lemon); font-weight: 500; }
.howto-card b { color: var(--lemon); font-weight: 500; }
.howto-intro { font-size: 14px; line-height: 1.55; color: var(--cream); margin: 0 0 14px; }
.howto-goals { display: flex; gap: 10px; margin-bottom: 14px; }
.goal { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-family: var(--f-display); font-size: 12px; }
.goal span { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--cream-dim); margin-top: 4px; }
.goal.win { border-color: var(--mint); color: var(--mint); }
.goal.lose { border-color: var(--danger); color: var(--danger); }
.howto-steps { margin: 0 0 14px; padding-left: 0; list-style: none; counter-reset: h; }
.howto-steps li { counter-increment: h; position: relative; padding: 6px 0 6px 34px; font-size: 13.5px; line-height: 1.4; border-bottom: 1px dotted var(--line); }
.howto-steps li::before { content: counter(h); position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 11px; color: #2a1602; background: linear-gradient(180deg, var(--lemon-lo), var(--amber)); }
.howto-tip { font-size: 12.5px; line-height: 1.5; color: var(--cyan); margin: 0 0 16px; }

/* difficulty picker + badge + smart hint */
.diff-prompt { font-family: var(--f-display); font-size: 12px; letter-spacing: 1px; color: var(--cream-dim); margin: 6px 0 10px; text-align: center; }
.diff-pick { display: flex; gap: 10px; }
.diff-btn { flex: 1; min-width: 0; font-family: var(--f-display); font-size: 14px; letter-spacing: 1px; cursor: pointer; text-align: center; padding: 12px 6px; border-radius: 10px; color: var(--cream); background: linear-gradient(180deg, #1b1207, #130c05); border: 1px solid var(--line); transition: transform .1s ease, box-shadow .1s ease; }
.diff-btn span { display: block; margin-top: 5px; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0; text-transform: none; color: var(--cream-dim); }
.diff-btn:hover { transform: translateY(-2px); }
.diff-btn.easy { border-color: var(--mint); color: var(--mint); }
.diff-btn.easy:hover { box-shadow: 0 0 14px rgba(107,240,165,.4); }
.diff-btn.medium { border-color: var(--lemon); color: var(--lemon); }
.diff-btn.medium:hover { box-shadow: 0 0 14px rgba(255,210,63,.4); }
.diff-btn.hard { border-color: var(--danger); color: var(--danger); }
.diff-btn.hard:hover { box-shadow: 0 0 14px rgba(255,46,99,.4); }
.howto-close-link { display: block; margin: 14px auto 0; background: none; border: none; color: var(--cream-dim); font-family: var(--f-mono); font-size: 11px; cursor: pointer; text-decoration: underline; }
.howto-close-link:hover { color: var(--lemon); }
.diff-badge { font-family: var(--f-display); font-size: 9px; letter-spacing: 1px; color: var(--cream-dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; margin-left: 8px; vertical-align: middle; cursor: pointer; transition: color .15s, border-color .15s; }
.diff-badge:hover, .diff-badge:focus-visible { color: var(--lemon); border-color: var(--lemon); outline: none; }
.hint-line { margin: 0 0 14px; padding: 9px 13px; font-size: 12.5px; line-height: 1.45; color: var(--lemon-lo); background: rgba(255,210,63,.06); border: 1px solid var(--line); border-left: 3px solid var(--lemon); border-radius: 8px; }

/* range inputs as console sliders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 6px; background: linear-gradient(90deg, #3a2912, #0d0904); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 6px; background: linear-gradient(90deg, #3a2912, #0d0904); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--lemon-lo), var(--amber));
  border: 2px solid #3a2912; box-shadow: 0 0 10px rgba(255,210,63,.6), 0 2px 4px rgba(0,0,0,.6);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--lemon-lo), var(--amber));
  border: 2px solid #3a2912; box-shadow: 0 0 10px rgba(255,210,63,.6);
}

/* action cards */
.action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.acard {
  position: relative; text-align: left; font: inherit; cursor: pointer;
  background: linear-gradient(180deg, #1b1207, #130c05);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px;
  color: var(--cream); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.acard:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--lemon); box-shadow: 0 6px 16px rgba(0,0,0,.5), 0 0 14px rgba(255,210,63,.2); }
.acard.sabotage { border-left: 3px solid var(--cyan-deep); }
.acard.sabotage:hover:not(:disabled) { border-color: var(--cyan); box-shadow: 0 6px 16px rgba(0,0,0,.5), 0 0 14px rgba(47,228,255,.25); }
.acard.selected {
  border-color: var(--lemon); background: linear-gradient(180deg, #2a1c08, #1a1106);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.7), 0 0 16px rgba(255,210,63,.45);
  transform: translateY(1px);
}
.acard.selected::after {
  content: "● ARMED"; position: absolute; top: 8px; right: 10px;
  font-family: var(--f-display); font-size: 8px; color: var(--lemon); letter-spacing: 1px; text-shadow: var(--glow-lemon);
}
.acard.sabotage.selected { border-color: var(--cyan); box-shadow: inset 0 2px 10px rgba(0,0,0,.7), 0 0 16px rgba(47,228,255,.5); }
.acard.sabotage.selected::after { color: var(--cyan); text-shadow: var(--glow-cyan); }
.acard:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(.4); }
.acard .a-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-family: var(--f-display); font-size: 11px; }
.acard .a-cost { color: var(--lemon); }
.acard.sabotage .a-cost { color: var(--cyan); }
.acard .a-blurb { display: block; font-size: 10px; line-height: 1.35; color: var(--cream-dim); margin-top: 5px; }

/* rotating wild card */
.acard.wild { border-color: var(--amber); box-shadow: 0 0 14px rgba(255,158,27,.28); overflow: visible; }
.acard.wild::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px; padding: 1px; pointer-events: none; opacity: .8;
  background: linear-gradient(120deg, var(--amber), var(--lemon-lo), var(--cyan), var(--amber));
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: shimmer 4s linear infinite;
}
.acard.wild .wild-badge {
  position: absolute; top: -8px; left: 12px; z-index: 2; font-family: var(--f-display); font-size: 8px; letter-spacing: 1px;
  color: #2a1602; background: linear-gradient(180deg, var(--lemon-lo), var(--amber)); padding: 2px 7px; border-radius: 6px;
  box-shadow: 0 0 8px rgba(255,210,63,.5);
}
@keyframes shimmer { to { background-position: 300% 0; } }

/* the big launch button */
.open-stand {
  font-family: var(--f-display); font-size: 17px; letter-spacing: 3px; cursor: pointer;
  color: #2a1602; border: none; border-radius: 12px; padding: 16px;
  background: linear-gradient(180deg, var(--lemon-lo), var(--amber));
  box-shadow: 0 5px 0 #9c5e06, 0 10px 22px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.open-stand:hover { filter: brightness(1.06); }
.open-stand:active { transform: translateY(4px); box-shadow: 0 1px 0 #9c5e06, 0 4px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4); }

/* ---------- results + overlay ---------- */
.results, .overlay {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px;
  background: rgba(8,5,2,.74); backdrop-filter: blur(4px);
  animation: fadein .25s ease;
}
.results-card, .overlay-card {
  width: 100%; max-width: 420px; padding: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--lemon); border-radius: 16px;
  box-shadow: 0 0 0 6px #0e0904, 0 30px 60px rgba(0,0,0,.7), 0 0 50px rgba(255,210,63,.2);
  animation: pop .3s cubic-bezier(.2,1.1,.3,1);
}
.results-card h2 { margin: 0 0 14px; font-family: var(--f-display); font-size: 18px; color: var(--lemon); letter-spacing: 1px; text-shadow: var(--glow-lemon); }
.results-lines { list-style: none; padding: 0; margin: 0 0 14px; }
.results-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 14px; }
.results-lines li span { color: var(--cream-dim); }
.results-lines li b { color: var(--cream); }
.results-flavor { color: var(--cyan); font-size: 13px; font-style: italic; min-height: 1.2em; margin: 0 0 16px; text-shadow: var(--glow-cyan); }
.results-anomaly { margin: 0 0 14px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; color: var(--cyan); border: 1px dashed var(--cyan-deep); border-radius: 8px; background: rgba(47,228,255,.07); }

.overlay-card { text-align: center; max-width: 460px; }
.overlay-card h2 { font-family: var(--f-display); font-size: clamp(22px, 6vw, 34px); margin: 0 0 12px; letter-spacing: 1px; }
.overlay-card p { color: var(--cream); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.overlay-card.win { border-color: var(--mint); box-shadow: 0 0 0 6px #0e0904, 0 30px 60px rgba(0,0,0,.7), 0 0 60px rgba(107,240,165,.35); }
.overlay-card.win h2 { color: var(--mint); text-shadow: 0 0 10px rgba(107,240,165,.7); }
.overlay-card.lose { border-color: var(--danger); box-shadow: 0 0 0 6px #0e0904, 0 30px 60px rgba(0,0,0,.7), 0 0 60px rgba(255,46,99,.35); }
.overlay-card.lose h2 { color: var(--danger); text-shadow: var(--glow-danger); }

.hidden { display: none !important; }

/* ---------- load reveal stagger ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .55s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--d) * 90ms + 120ms); }

/* ---------- keyframes ---------- */
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes scandrift { to { background-position: 0 3px; } }
@keyframes grainshift { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:.15} }
@keyframes flickerlogo { 0%,97%,100%{opacity:1} 97.5%{opacity:.72} 98.5%{opacity:.92} }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes floaty { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-3px) rotate(2deg)} }
@keyframes meterpulse { 0%{filter:brightness(2)} 100%{filter:brightness(1)} }
@keyframes fadein { from{opacity:0} to{opacity:1} }
@keyframes pop { from{opacity:0; transform:scale(.9)} to{opacity:1; transform:scale(1)} }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .console { margin: 12px auto 40px; padding: 18px 14px 22px; border-radius: 20px; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .dials { grid-template-columns: 1fr; }
  .action-cards { grid-template-columns: 1fr 1fr; }
  .meter-title { display: none; }
}

/* ---------- accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
