: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;
  --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; }

#rain { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
body:not([data-state="menu"]) #rain { display: none; }    /* it rains on the street, not in the shop */
#ring { position: fixed; inset: 0; z-index: 0; display: block; }
#fx { position: fixed; inset: 0; z-index: 20; 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); }
kbd { font: 400 12px var(--display); background: #fff7e3; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 1px 6px; box-shadow: 0 2px 0 var(--ink); }

/* ---- neon signs */
.neon {
  margin: 0; font-family: var(--display); font-weight: 400; text-align: center; line-height: 0.95; color: #fff8e6;
  font-size: clamp(26px, 4vw, 40px); letter-spacing: 2px;
  text-shadow: 0 0 6px #fff, 0 0 14px var(--gold), 0 0 30px var(--red), 0 0 60px rgba(255, 77, 109, 0.6);
  animation: flicker 6s infinite;
}
.neon.big { font-size: clamp(50px, 9vw, 112px); }
.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: 10px 0 0; font-weight: 800; color: var(--mint); letter-spacing: 2px; text-transform: uppercase; font-size: 14px; text-align: center; text-shadow: 0 0 12px rgba(46, 230, 168, 0.6); }

/* ---- the menu, over the ring with a merchant warming up */
.screen { position: fixed; inset: 0; z-index: 10; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 16px 24px;
  background: linear-gradient(rgba(7, 8, 26, 0.55), rgba(7, 8, 26, 0.88) 60%); }
.hero { padding-top: 4vh; display: grid; justify-items: center; }
.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.small { font-size: 15px; padding: 9px 16px; }
.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.45; }
.mint { color: var(--mint); } .red { color: var(--red); } .gold { color: var(--gold); } .purple { color: var(--purple); }
.controls { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.controls 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 fight */
.game { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.game > * { pointer-events: auto; }
.hud { position: absolute; top: 12px; left: 12px; right: 12px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; pointer-events: none; }
.me { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stat { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 6px 11px; display: grid; min-width: 88px; }
.stat small { font-weight: 800; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.stat b { font: 400 21px var(--display); color: #fff; transition: transform 0.15s; }
.stat b.bump { transform: scale(1.22); color: var(--gold); }
.signed { justify-self: end; }
.hearts { display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.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)); }
.heart.off { background: rgba(255, 255, 255, 0.16); filter: none; }
.heart.lost { animation: heartLost 0.6s; }
@keyframes heartLost { 30% { transform: scale(1.6); background: #fff; } }
.opp { display: grid; justify-items: center; gap: 6px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 7px 16px 9px; }
.opp b { font: 400 16px var(--display); color: #fff; letter-spacing: 1px; white-space: nowrap; }
.pips { display: flex; gap: 5px; }
.pips i { width: 18px; height: 12px; border-radius: 4px; background: var(--red); border: 2px solid var(--ink); box-shadow: 0 0 8px rgba(255, 77, 109, 0.6); transition: background 0.2s; }
.pips i.off { background: rgba(255, 255, 255, 0.12); box-shadow: none; }

/* the objection, in a speech bubble over the merchant */
.bubble {
  position: absolute; left: 50%; top: max(84px, 11vh); transform: translateX(-50%); width: min(760px, 92vw);
  background: #fff7e3; color: var(--ink); border: 4px solid var(--ink); border-radius: 22px; padding: 12px 22px 16px; text-align: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -22px; width: 30px; height: 26px; background: #fff7e3; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: translateX(-50%) rotate(45deg) skew(10deg, 10deg); }
.bubble.in { animation: bubbleIn 0.32s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes bubbleIn { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }
.bubble small { display: block; font: 400 12px var(--display); color: #6b5f8a; letter-spacing: 1.5px; }
.bubble span { display: block; font-weight: 900; font-size: clamp(22px, 3vw, 36px); line-height: 1.15; margin-top: 2px; }
.track { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.track i { font-style: normal; font-weight: 800; font-size: 13.5px; padding: 4px 10px; border-radius: 999px; border: 2px dashed #8a7fa8; color: #6b5f8a; }
.track i.done { border: 2px solid var(--ink); background: var(--mint); color: var(--ink); }

/* the three replies */
.bottom { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(1120px, 96vw); }
.replies { display: grid; gap: 8px; }
.fuse { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); border: 2px solid var(--ink); overflow: hidden; }
.fuse i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
.fuse.hurry i { background: var(--red); animation: hurry 0.3s infinite alternate; }
@keyframes hurry { to { opacity: 0.45; } }
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reply {
  display: flex; gap: 10px; align-items: center; text-align: left; min-height: 74px; padding: 10px 14px; border-radius: 16px; cursor: pointer;
  font: 800 clamp(15px, 1.5vw, 19px) var(--body); color: #fff; background: var(--panel); border: 3px solid var(--line); line-height: 1.25;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4); transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.reply:hover { border-color: var(--mint); }
.reply kbd { flex: none; font-size: 15px; padding: 3px 9px; }
.reply.right { background: rgba(46, 230, 168, 0.3); border-color: var(--mint); }
.reply.wrong { background: rgba(255, 77, 109, 0.3); border-color: var(--red); }
.reply.in { animation: replyIn 0.3s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.reply.in:nth-child(2) { animation-delay: 0.05s; } .reply.in:nth-child(3) { animation-delay: 0.1s; }
@keyframes replyIn { from { transform: translateY(24px); opacity: 0; } }
.said { background: var(--panel); border: 2px solid var(--mint); border-radius: 16px; padding: 10px 16px; text-align: center; }
.said small { font: 400 12px var(--display); color: var(--mint); letter-spacing: 1.5px; }
.said p { margin: 3px 0 0; font-weight: 800; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.4; }

/* a miss: what you should have said */
.learn {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(780px, 94vw); display: grid; gap: 6px; justify-items: center; text-align: center;
  background: var(--panel); border: 3px solid var(--red); border-radius: 18px; padding: 14px 20px 16px; box-shadow: 0 0 40px rgba(255, 77, 109, 0.3);
}
.learn.in { animation: replyIn 0.3s ease-out; }
.learn p { margin: 0; }
.learn-k { font: 400 14px var(--display); color: var(--red); letter-spacing: 1.5px; }
.learn-r { font-weight: 900; font-size: clamp(19px, 2.2vw, 26px); color: var(--mint); }
.learn-l { font-weight: 700; font-size: clamp(14.5px, 1.4vw, 17px); line-height: 1.45; }
.learn-t { font-weight: 800; font-size: 14px; color: var(--gold); }
.learn-s { font-weight: 700; font-size: 12px; color: var(--muted); }
.learn .btn { margin-top: 6px; }

.intro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: 8px; justify-items: center; text-align: center;
  background: var(--panel); border: 3px solid var(--gold); border-radius: 20px; padding: 18px 28px 20px; box-shadow: 0 0 50px rgba(255, 216, 74, 0.3); width: min(560px, 92vw); }
.intro.in { animation: bubbleIn2 0.4s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes bubbleIn2 { from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; } }
.intro small { font: 400 14px var(--display); color: var(--cyan); letter-spacing: 2px; }
.intro p { margin: 0; font-weight: 800; }
.intro .go { color: var(--muted); font-size: 13px; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.banner span {
  font: 400 clamp(44px, 9vw, 120px) var(--display); color: #fff; text-align: center; line-height: 1;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink), 0 0 40px var(--glow, rgba(46, 230, 168, 0.85));
}
.banner.go span { animation: bannerIn 1.6s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes bannerIn { 0% { transform: scale(0.3) rotate(-8deg); opacity: 0; } 15% { transform: scale(1.1) rotate(-3deg); opacity: 1; } 80% { transform: scale(1) rotate(-3deg); opacity: 1; } 100% { transform: scale(1.15) rotate(-3deg); opacity: 0; } }

/* ---- pause and game over */
.overlay { position: fixed; inset: 0; z-index: 30; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: rgba(7, 8, 26, 0.8); backdrop-filter: blur(4px); }
.over { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 540px); gap: 18px; width: 100%; max-width: 1020px; }
.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-label { font-weight: 900; color: #fff; display: block; }
.got .r { margin: 5px 0 2px; font-weight: 800; color: var(--mint); font-size: 14.5px; }
.got p { margin: 4px 0; line-height: 1.4; font-size: 14px; }
.got small { color: var(--muted); font-size: 12px; }
.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: the replies stack, and the keys give way to taps */
@media (max-width: 700px) {
  .hud { grid-template-columns: 1fr auto; }
  .opp { grid-column: 1 / -1; grid-row: 2; justify-self: center; padding: 5px 12px 7px; }
  .stat { min-width: 70px; padding: 4px 9px; }
  .stat b { font-size: 17px; }
  .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"); }
  .bubble { top: 136px; padding: 9px 14px 12px; }
  .opts { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .reply { min-height: 52px; padding: 8px 12px; }
  .keys-line { display: none; }
}
body.touch .reply kbd, body.touch .hint-key { display: none; }
