/* ============================================================
   arcaderecall.com — Arcade / neon / pixel theme
   Dark CRT backdrop, neon outlines, Press Start 2P for arcade
   chrome only; body copy stays in readable system fonts.
   ============================================================ */
:root {
  --bg: #0b0620;
  --bg2: #120a2e;
  --panel: #170e38;
  --panel2: #1e1247;
  --line: #2c1b63;
  --cyan: #00f0ff;
  --magenta: #ff2fb3;
  --yellow: #ffe14d;
  --green: #39ff88;
  --red: #ff4d6d;
  --orange: #ffb347;
  --text: #e8e6ff;
  --dim: #a89fd4;
  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --shadow-cyan: 0 0 6px rgba(0,240,255,.75), 0 0 18px rgba(0,240,255,.35);
  --shadow-magenta: 0 0 6px rgba(255,47,179,.75), 0 0 18px rgba(255,47,179,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(120,40,255,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0,240,255,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
  min-height: 100vh;
}
/* subtle CRT scanlines overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
}
.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- arcade top bar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(11,6,32,.85);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(4px);
}
.topbar .brand { font-family: var(--pixel); font-size: 12px; color: var(--cyan); text-decoration: none; text-shadow: var(--shadow-cyan); letter-spacing: 1px; }
.topbar .brand b { color: var(--magenta); text-shadow: var(--shadow-magenta); }
.topbar .spacer { flex: 1; }
.iconbtn {
  font-family: var(--pixel); font-size: 10px; cursor: pointer;
  color: var(--yellow); background: var(--panel); border: 2px solid var(--line);
  padding: 8px 10px; text-transform: uppercase; letter-spacing: 1px;
}
.iconbtn:hover { border-color: var(--yellow); box-shadow: 0 0 10px rgba(255,225,77,.4); }
.iconbtn.off { color: var(--dim); }

/* ---------- headings / pixels ---------- */
.px { font-family: var(--pixel); letter-spacing: 1px; }
h1.px, h2.px, h3.px { color: var(--cyan); text-shadow: var(--shadow-cyan); }
h1 { font-size: clamp(20px, 4.4vw, 34px); }
h2 { font-size: 18px; }
h3 { font-size: 14px; }
.title-glow { color: var(--magenta); text-shadow: var(--shadow-magenta); }
.sub { color: var(--dim); margin-top: 4px; }
a { color: var(--cyan); }
a:hover { color: var(--yellow); }

/* ---------- arcade cabinet buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; user-select: none;
  font-family: var(--pixel); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; text-decoration: none; text-align: center;
  color: var(--text); background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 3px solid var(--line); padding: 14px 18px; margin: 6px;
  box-shadow: 0 4px 0 var(--line), inset 0 0 12px rgba(0,240,255,.06);
  transition: transform .05s, box-shadow .05s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 4px 0 var(--line), var(--shadow-cyan); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.big { font-size: 13px; padding: 18px 26px; }
.btn.primary { color: #081018; background: linear-gradient(180deg, #7dffd4, var(--green)); border-color: #0c6; text-shadow: none; box-shadow: 0 4px 0 #0a6; }
.btn.primary:hover { box-shadow: 0 4px 0 #0a6, 0 0 14px rgba(57,255,136,.8); }
.btn.magenta { color: #16061a; background: linear-gradient(180deg, #ff8fd6, var(--magenta)); border-color: #a10e6b; box-shadow: 0 4px 0 #a10e6b; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.small { font-size: 9px; padding: 9px 12px; margin: 4px; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.panel {
  background: linear-gradient(180deg, rgba(30,18,71,.9), rgba(23,14,56,.92));
  border: 3px solid var(--line);
  box-shadow: inset 0 0 24px rgba(0,0,0,.35);
  padding: 18px;
}
.panel.hot { border-color: var(--magenta); box-shadow: inset 0 0 24px rgba(0,0,0,.35), 0 0 14px rgba(255,47,179,.25); }
.panel h2 { margin-top: 0; }

.machine {
  background: linear-gradient(180deg, #1b1140, #120a2e 60%);
  border: 3px solid var(--cyan);
  border-radius: 18px 18px 6px 6px;
  box-shadow: 0 0 24px rgba(0,240,255,.18), inset 0 0 40px rgba(0,0,0,.4);
  padding: 20px;
  position: relative;
}
.machine::after { /* marquee light strip */
  content: ''; position: absolute; left: 20px; right: 20px; top: -3px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--magenta) 0 24px, var(--yellow) 24px 48px, var(--cyan) 48px 72px);
  border-radius: 2px;
}

/* ---------- game HUD ---------- */
.hud { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 10px 0 14px; }
.hud .stat { font-family: var(--pixel); font-size: 10px; color: var(--dim); line-height: 1.8; }
.hud .stat b { display: block; color: var(--yellow); font-size: 16px; text-shadow: 0 0 8px rgba(255,225,77,.5); }
.hud .stat.lives b { color: var(--red); }
.hud .stat.combo b { color: var(--magenta); text-shadow: var(--shadow-magenta); }
.hud .stat.time b { color: var(--cyan); }

.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.controls label { font-size: 13px; color: var(--dim); }
select, input[type=text], input[type=number] {
  background: #0d0726; color: var(--text); border: 2px solid var(--line);
  font-family: var(--body); font-size: 14px; padding: 8px 10px; outline: none;
}
select:focus, input:focus { border-color: var(--cyan); }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chip {
  font-size: 13px; cursor: pointer; border: 2px solid var(--line); background: var(--panel);
  color: var(--dim); padding: 5px 12px; border-radius: 999px;
}
.chip.on { color: #081018; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.chip:disabled { opacity: .4; }

/* ---------- cards ---------- */
.cardgrid { display: grid; gap: 10px; perspective: 900px; margin: 14px auto; }
.cardsize-4x3 { grid-template-columns: repeat(4, 1fr); max-width: 620px; }
.cardsize-4x4 { grid-template-columns: repeat(4, 1fr); max-width: 660px; }
.cardsize-6x5 { grid-template-columns: repeat(6, 1fr); max-width: 760px; }
.card {
  aspect-ratio: 1 / 1.08; cursor: pointer; position: relative; transform-style: preserve-3d;
  transition: transform .18s ease; user-select: none;
}
.card.flip { transform: rotateY(180deg); }
.card.done { opacity: .55; cursor: default; filter: saturate(.6); }
.card .face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px;
  font-size: 13px; font-weight: 600; word-break: break-word;
}
.card .front {
  background: repeating-linear-gradient(45deg, #1e1247, #1e1247 8px, #241654 8px, #241654 16px);
  border: 3px solid var(--cyan); color: var(--cyan);
  font-family: var(--pixel); font-size: 12px; box-shadow: 0 0 10px rgba(0,240,255,.25) inset;
}
.card .back {
  transform: rotateY(180deg); border: 3px solid var(--magenta); background: #0d0726;
  box-shadow: inset 0 0 18px rgba(255,47,179,.15); overflow: hidden;
}
.card .back .wordface { color: var(--yellow); font-family: var(--pixel); font-size: 11px; }
.card .back .figface { font-size: 34px; }
.card .back .defface { font-size: 12.5px; color: var(--text); font-weight: 500; }
.card.miss .back { border-color: var(--red); animation: shake .3s; }
.card.hit .back { border-color: var(--green); }
.card.matchflash { animation: pop .35s; }
@keyframes shake { 25% { transform: rotateY(180deg) translateX(-5px); } 75% { transform: rotateY(180deg) translateX(5px); } }
@keyframes pop { 0%{transform:rotateY(180deg) scale(1);} 50%{transform:rotateY(180deg) scale(1.12);} 100%{transform:rotateY(180deg) scale(1);} }

/* ---------- words / answers ---------- */
.wordbox {
  text-align: center; padding: 22px; border: 3px dashed var(--line); margin: 10px 0;
  font-family: var(--pixel); font-size: 22px; color: var(--yellow); text-shadow: 0 0 12px rgba(255,225,77,.4);
  background: rgba(13,7,38,.6); min-height: 90px;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.answerbtn {
  display: block; width: 100%; text-align: center; cursor: pointer;
  background: var(--panel); border: 3px solid var(--line); color: var(--text);
  font-size: 15px; font-weight: 600; padding: 14px 10px; margin: 6px 0;
}
.answerbtn:hover:not(:disabled) { border-color: var(--cyan); }
.answerbtn:disabled { opacity: .45; cursor: default; }
.answerbtn.right { border-color: var(--green); background: rgba(57,255,136,.14); color: var(--green); }
.answerbtn.wrong { border-color: var(--red); background: rgba(255,77,109,.14); color: var(--red); }

/* word whack grid */
.whackgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; margin: 12px auto; }
.whackgrid .whack {
  aspect-ratio: 1.6; font-family: var(--body); font-weight: 700; font-size: clamp(13px, 2.6vw, 19px);
  cursor: pointer; color: var(--text); background: radial-gradient(circle at 50% 30%, #2a1a5e, #150c33);
  border: 3px solid var(--line); border-radius: 10px; display:flex; align-items:center; justify-content:center; text-align:center; padding:6px;
}
.whackgrid .whack:hover { border-color: var(--magenta); box-shadow: 0 0 12px rgba(255,47,179,.5); }
.whackgrid .whack.pop { animation: pop2 .28s; border-color: var(--green); }
.whackgrid .whack.boo { animation: shake2 .28s; border-color: var(--red); }
@keyframes pop2 { 50% { transform: scale(1.18); } }
@keyframes shake2 { 20%{transform:translateX(-6px);} 60%{transform:translateX(6px);} }

/* type / input rows */
.typein { font-family: var(--pixel); font-size: 15px; letter-spacing: 3px; text-transform: lowercase; text-align: center; width: 100%; max-width: 420px; color: var(--green); }
.typetarget { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.typetarget span { font-family: var(--pixel); font-size: 16px; color: var(--dim); }
.typetarget span.done { color: var(--green); text-shadow: 0 0 8px rgba(57,255,136,.8); }
.typetarget span.cur { color: var(--yellow); }

/* flash word big */
.bigflash { font-family: var(--pixel); font-size: clamp(26px, 7vw, 54px); color: var(--yellow); text-shadow: 0 0 18px rgba(255,225,77,.6); text-align:center; padding: 30px 10px; min-height: 150px; display:flex; align-items:center; justify-content:center; }
.count3 { font-family: var(--pixel); font-size: 60px; color: var(--cyan); text-shadow: var(--shadow-cyan); text-align:center; animation: pop 1s; }

/* study phase speed recall */
.studyword { display: inline-block; font-family: var(--pixel); font-size: 15px; color: var(--green); background: rgba(13,7,38,.8); border: 2px solid var(--line); padding: 12px 14px; margin: 6px; }

/* ---------- overlays / results ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(6,3,18,.88); backdrop-filter: blur(3px); padding: 16px;
}
.overlay.hidden { display: none; }
.resultcard {
  max-width: 560px; width: 100%; text-align: center; padding: 26px 20px;
  border: 3px solid var(--yellow); background: var(--panel);
  box-shadow: 0 0 30px rgba(255,225,77,.25), inset 0 0 30px rgba(0,0,0,.4);
  animation: pop .3s;
}
.resultcard .final { font-family: var(--pixel); font-size: 34px; color: var(--yellow); text-shadow: 0 0 16px rgba(255,225,77,.7); margin: 10px 0; }
.resultcard .row { font-size: 14px; color: var(--dim); margin: 4px 0; }
.resultcard .hi { color: var(--green); font-weight: 700; }
.resultcard .decknote { font-size: 12.5px; color: var(--cyan); margin-top: 10px; }

/* ---------- print sheet ---------- */
.printsheet { display: none; }
@media print {
  body { background: #fff; color: #111; }
  body::before, .topbar, .no-print, .hud, .controls, .rules, .machine, footer, .panel { display: none !important; }
  .printsheet { display: block; }
  .wrap { max-width: none; padding: 0; }
  .printsheet .sheet { background: #fff; color: #111; padding: 20px; }
  .printsheet h2 { color: #111; font-family: var(--body); text-shadow: none; }
  .wsgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .wsgrid ol { font-size: 13px; }
  .wsgrid .defs { counter-reset: d; list-style: none; padding: 0; }
  .wsgrid .defs li { margin: 8px 0; font-size: 13px; }
  .answerkey { border-top: 1px solid #999; margin-top: 18px; font-size: 12px; }
}

/* ---------- footer / misc ---------- */
footer { margin-top: 44px; border-top: 2px solid var(--line); padding: 18px 0 10px; color: var(--dim); font-size: 13px; text-align: center; }
footer a { color: var(--dim); margin: 0 8px; text-decoration: none; }
footer a:hover { color: var(--yellow); }
.small { font-size: 12px; color: var(--dim); }
.muted { color: var(--dim); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }
.errline { color: var(--red); font-weight: 700; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--panel2); border: 2px solid var(--cyan); color: var(--text);
  padding: 10px 18px; font-size: 13px; box-shadow: var(--shadow-cyan); display: none;
}
.toast.show { display: block; animation: pop .2s; }
.kbd { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 4px; padding: 1px 7px; font-family: var(--pixel); font-size: 10px; color: var(--yellow); }

/* cabinet card (home) */
.cab {
  position: relative; display: block; text-decoration: none; color: var(--text);
  border: 3px solid var(--line); background: linear-gradient(180deg, #1c1145, #110a2b);
  padding: 16px; border-radius: 12px 12px 4px 4px; transition: transform .08s, box-shadow .08s;
  min-height: 240px;
}
.cab:hover { transform: translateY(-3px); box-shadow: 0 0 18px rgba(0,240,255,.35); border-color: var(--cyan); color: var(--text); }
.cab .cabtitle { font-family: var(--pixel); font-size: 12px; color: var(--yellow); text-shadow: 0 0 8px rgba(255,225,77,.4); margin: 10px 0 6px; }
.cab .cabdesc { color: var(--dim); font-size: 13px; }
.cab .tag { display: inline-block; font-size: 11px; border: 1px solid var(--magenta); color: var(--magenta); border-radius: 999px; padding: 1px 8px; margin: 2px 2px 0 0; }
.cab .emblem { font-size: 40px; line-height: 1.2; filter: drop-shadow(0 0 8px rgba(255,47,179,.6)); }
.cab.main { border-color: var(--magenta); box-shadow: 0 0 16px rgba(255,47,179,.3); }

.faq q { font-style: italic; color: var(--dim); }
.rules { font-size: 15px; }
.rules p { margin: 8px 0; }
