:root {
  --bg: #07081a;
  --panel: rgba(14, 16, 38, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #10121f;
  --text: #e6e8f5;
  --muted: #9aa0c3;
  --mint: #2ee6a8;
  --red: #ff4d6d;
  --pink: #ff4dd2;
  --gold: #ffd84a;
  --cyan: #4dd4ff;
  --orange: #ff9f43;
  --purple: #b48cff;
  --display: "Bungee", Impact, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--text); font-family: var(--body); background: var(--bg); overflow: hidden; }
[hidden] { display: none !important; }

/* ---- the scene: the high street, blurred and drifting, under rain */
.scene {
  position: fixed; inset: -4%; z-index: -3;
  background: var(--keyart, url("../doorstep/assets/keyart.webp")) center / cover no-repeat;
  filter: blur(7px) brightness(0.3) saturate(1.25);
  animation: drift 40s ease-in-out infinite alternate;
}
.scene::after { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(7, 8, 26, 0) 30%, rgba(7, 8, 26, 0.85) 90%); }
@keyframes drift { to { transform: scale(1.08) translate(-1.5%, 1%); } }
#rain { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
#fx { position: fixed; inset: 0; z-index: 8; pointer-events: none; }

.arcade-back { position: absolute; top: 14px; left: 16px; color: var(--muted); font-weight: 800; text-decoration: none; font-size: 14px; z-index: 5; }
.arcade-back:hover { color: var(--mint); }

/* ---- neon signs, in Flatpay mint */
.neon {
  margin: 0; font-family: var(--display); font-weight: 400; text-align: center; line-height: 0.95; color: #f2fff9;
  font-size: clamp(26px, 4vw, 40px); letter-spacing: 2px;
  text-shadow: 0 0 6px #fff, 0 0 14px var(--mint), 0 0 30px var(--mint), 0 0 60px rgba(46, 230, 168, 0.6);
  animation: flicker 6s infinite;
}
.neon.big { font-size: clamp(54px, 10vw, 124px); }
.neon.small { font-size: clamp(24px, 3.4vw, 36px); }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: 0.55; } 94% { opacity: 1; } 96% { opacity: 0.7; } 97% { opacity: 1; } }
.tag { margin: 8px 0 0; font-weight: 800; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; font-size: 14px; text-align: center; text-shadow: 0 0 12px rgba(255, 216, 74, 0.5); }

/* ---- the menu */
.screen { position: fixed; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 16px 24px; }
.hero { position: relative; width: min(980px, 100%); height: clamp(170px, 30vh, 290px); border-radius: 22px; overflow: hidden; flex: none;
  border: 3px solid var(--ink); box-shadow: 0 0 0 3px rgba(46, 230, 168, 0.45), 0 0 40px rgba(46, 230, 168, 0.25); }
.hero canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hero-text { position: absolute; inset: 0; display: grid; place-content: center; background: radial-gradient(ellipse at center, rgba(7, 8, 26, 0.72), rgba(7, 8, 26, 0.15) 75%); pointer-events: none; }
.menu-grid { display: grid; grid-template-columns: minmax(0, 580px) minmax(0, 380px); gap: 18px; width: 100%; max-width: 980px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); min-width: 0; }
.card.center { text-align: center; display: grid; gap: 16px; justify-items: center; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 18px; margin: 0 0 12px; color: #fff; }
label { display: block; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
input { flex: 1 1 220px; min-width: 0; font: 800 18px var(--body); padding: 13px 15px; border-radius: 12px; border: 3px solid var(--ink); background: #fff7e3; color: var(--ink); outline: none; }
input:focus { box-shadow: 0 0 0 3px var(--mint); }
.btn {
  font: 400 18px var(--display); padding: 13px 22px; border-radius: 12px; border: 3px solid var(--ink);
  background: #2a2e57; color: #fff; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 5px 0 var(--ink);
}
.btn.primary { background: var(--mint); color: var(--ink); box-shadow: 0 5px 0 var(--ink), 0 0 26px rgba(46, 230, 168, 0.35); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.err { min-height: 18px; margin: 8px 0 0; color: var(--red); font-weight: 700; font-size: 14px; }
.how { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 9px; font-size: 15px; line-height: 1.4; }
.mint { color: var(--mint); } .red { color: var(--red); } .gold { color: var(--gold); }
.controls { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.controls b, .keys b { color: #fff; }
.link { display: inline-block; margin-top: 12px; color: var(--mint); font-weight: 800; text-decoration: none; }

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-weight: 700; }
.board li.me { background: rgba(46, 230, 168, 0.18); outline: 2px solid var(--mint); }
.board li.empty { display: block; color: var(--muted); font-weight: 600; }
.board .rank { font-family: var(--display); color: var(--gold); }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .len { color: var(--muted); font-size: 13px; }
.board .pts { font-family: var(--display); color: #fff; }

/* ---- the game: panel and board */
.game { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(270px, 350px) minmax(0, 1fr); gap: 18px; padding: 16px; }
.play { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; min-width: 0; min-height: 0; }

/* the question, as close to the board as it can get, in type you can read at a glance */
.ask {
  background: var(--panel); border: 3px solid var(--gold); border-radius: 16px; padding: 9px 18px 11px; text-align: center;
  box-shadow: 0 0 26px rgba(255, 216, 74, 0.18);
}
.ask.in { animation: askIn 0.32s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes askIn { from { transform: scale(0.96); opacity: 0.3; } }
.ask-title { font: 400 13px var(--display); color: var(--cyan); letter-spacing: 1.5px; }
.ask-q { margin: 3px 0 0; font-weight: 900; font-size: clamp(19px, 2.1vw, 30px); line-height: 1.2; color: #fff; min-height: 2.4em; display: grid; place-items: center; }
.panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 7px 10px; display: grid; }
.stat small { font-weight: 800; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.stat b { font: 400 22px var(--display); color: #fff; transition: transform 0.15s; }
.stat b.bump { transform: scale(1.22); color: var(--gold); }
.hearts { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; min-height: 26px; }
.heart { width: 24px; height: 22px; background: var(--red); clip-path: path("M12 21 C-4 10 3 -2 12 5 C21 -2 28 10 12 21Z"); filter: drop-shadow(0 0 4px var(--red)); transition: transform 0.2s; }
.heart.off { background: rgba(255, 255, 255, 0.14); filter: none; }
.heart.lost { animation: heartLost 0.6s; }
@keyframes heartLost { 30% { transform: scale(1.6); background: #fff; } }
.powers { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.power { font: 400 12px var(--display); padding: 5px 9px; border-radius: 8px; border: 2px solid var(--ink); color: var(--ink); }
.power.manager { background: var(--cyan); } .power.fasttrack { background: var(--gold); }

.feedback { background: var(--panel); border: 2px solid var(--line); border-left: 6px solid var(--mint); border-radius: 14px; padding: 11px 14px; display: grid; gap: 5px; }
.feedback.no { border-left-color: var(--red); }
.feedback.old { opacity: 0.62; }
.fbk { margin: 0; font-weight: 800; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.fbq { margin: 0; font-weight: 800; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.feedback.in { animation: cardIn 0.3s ease-out; }
.verdict { margin: 0; font: 400 15px var(--display); color: var(--mint); }
.feedback.no .verdict { color: var(--red); }
.why { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.4; }
.src { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.keys { margin: auto 0 0; color: var(--muted); font-size: 13px; }

.arena { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; touch-action: none; }
#board { display: block; border-radius: 12px; box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px rgba(46, 230, 168, 0.55), 0 0 46px rgba(46, 230, 168, 0.3); }
.start { position: absolute; bottom: 9%; display: grid; gap: 6px; justify-items: center; text-align: center; pointer-events: none; padding: 14px 20px; border-radius: 16px; background: rgba(7, 8, 26, 0.82); border: 2px solid var(--mint); }
.start b { font: 400 clamp(17px, 2vw, 24px) var(--display); color: var(--mint); animation: pulse 1.1s ease-in-out infinite; }
.start small { font-weight: 700; color: var(--text); font-size: 14px; }
@keyframes pulse { 50% { opacity: 0.45; } }
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.banner span {
  font: 400 clamp(26px, 4.4vw, 56px) var(--display); color: #fff; text-align: center; padding: 0 16px; line-height: 1.05;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink), 0 0 34px var(--glow, rgba(46, 230, 168, 0.8));
}
.banner.go span { animation: bannerIn 1.5s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes bannerIn { 0% { transform: scale(0.3) rotate(-6deg); opacity: 0; } 18% { transform: scale(1.08) rotate(-2deg); opacity: 1; } 75% { transform: scale(1) rotate(-2deg); opacity: 1; } 100% { transform: scale(1.1) rotate(-2deg); opacity: 0; } }

/* ---- pause and game over */
.overlay { position: fixed; inset: 0; z-index: 10; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: rgba(7, 8, 26, 0.78); backdrop-filter: blur(4px); }
.over { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 520px); gap: 18px; width: 100%; max-width: 1000px; }
.over-why { margin: 8px 0 0; text-align: center; font-weight: 800; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 6px; }
.figures div { background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 11px 6px; text-align: center; }
.figures span { display: block; font-family: var(--display); font-size: 24px; color: #fff; }
.figures small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 10.5px; }
.rank-line { min-height: 22px; font-weight: 800; color: var(--gold); margin: 6px 0 14px; text-align: center; }
.over .row { margin-bottom: 18px; justify-content: center; }
.got { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.got li { background: rgba(255, 255, 255, 0.05); border-left: 4px solid var(--red); border-radius: 10px; padding: 11px 13px; }
.got li.clean { border-color: var(--mint); }
.got-head { display: flex; gap: 8px; align-items: baseline; }
.got-label { font-weight: 800; color: #fff; }
.got p { margin: 6px 0 4px; line-height: 1.4; font-size: 14px; }
.got small { color: var(--muted); font-size: 12px; }
.chip { font: 400 11px var(--display); padding: 3px 7px; border-radius: 6px; background: var(--red); color: var(--ink); white-space: nowrap; }
.chip.yes { background: var(--mint); } .chip.no { background: var(--pink); }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

@media (max-width: 900px) {
  .menu-grid, .over { grid-template-columns: minmax(0, 1fr); }
}
/* phones and tall windows: the question on top, the board underneath */
@media (max-aspect-ratio: 4/5) {
  .game { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px; }
  .panel { height: 26vh; gap: 7px; }        /* fixed, so the board doesn't jump when an explanation arrives */
  .play { gap: 8px; }
  .arena { align-items: start; }             /* the board sits right under its question */
  .ask { padding: 7px 12px 9px; }
  .ask-q { font-size: 17px; }
  .hud { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .hearts { grid-column: auto; }
  .heart { width: 18px; height: 17px; clip-path: path("M9 16 C-3 8 2 -1.5 9 4 C16 -1.5 21 8 9 16Z"); }
  .stat { padding: 5px 8px; }
  .stat b { font-size: 17px; }
  .feedback { padding: 7px 11px; gap: 3px; }
  .fbq { font-size: 12px; }
  .why { font-size: 13.5px; }
  .keys { display: none; }
  .start { bottom: 3%; padding: 8px 14px; background: rgba(7, 8, 26, 0.72); }
  .start small { display: none; }
}
