@import url("https://fonts.googleapis.com/css2?family=Special+Elite&family=Black+Ops+One&family=Anton&display=swap");
/* Ghoul Ball: the look of the page around the table (score display, cards, buttons).
   Owned by the DESIGN thread. See Arcade/IDEAS/pinball-design-brief.md */
:root {
  --bg: #0a0909;
  --ink: #f2ece0;
  --bone: #ece4d2;
  --red: #e3102a;
  --red-hot: #ff3347;
  --muted: #9b938a;
  --panel: rgba(14, 11, 11, 0.88);
  --line: rgba(236, 228, 210, 0.16);
  --green: #7cff2a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Chakra Petch", system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#gl { display: block; position: fixed; inset: 0; width: 100%; height: 100%; }

/* ---------- score display ---------- */
#hud { position: fixed; z-index: 5; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: stretch; pointer-events: none; }
#hud > * { pointer-events: auto; }
.side { display: flex; flex-direction: column; gap: 8px; }
.btn { font: 700 11px/1 "Chakra Petch", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--red); color: #fff; }
.dmd { flex: 1; min-width: 0; border-radius: 10px; padding: 10px 12px; font-family: "Press Start 2P", monospace; color: #ff4a36; text-shadow: 0 0 6px rgba(255, 60, 40, 0.65); border: 1px solid rgba(227, 16, 42, 0.45);
  background: radial-gradient(circle, rgba(255, 70, 40, 0.07) 1px, transparent 1.6px) 0 0 / 4px 4px, #140808; }
.dmd .score { font-size: clamp(14px, 4.6vw, 22px); white-space: nowrap; overflow: hidden; }
.dmd .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 8px; margin-top: 8px; color: #ff8d6e; }
.dmd .msg { font-size: 8px; line-height: 1.5; margin-top: 8px; min-height: 12px; color: var(--bone); text-shadow: 0 0 6px rgba(236, 228, 210, 0.35); }
@media (orientation: landscape) {
  #hud { right: auto; width: min(300px, 34vw); flex-direction: column; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .dmd .score { font-size: 20px; }
}

/* ---------- big callouts ---------- */
#pop { position: fixed; z-index: 6; left: 50%; top: 44%; transform: translate(-50%, -50%); font-family: Creepster, cursive; font-size: clamp(38px, 8vw, 84px); letter-spacing: 0.04em; color: var(--bone); text-shadow: 4px 4px 0 var(--red), 0 0 26px rgba(227, 16, 42, 0.6); pointer-events: none; opacity: 0; white-space: nowrap; }
#pop.show { animation: pop 1.5s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-5deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(-2deg); }
  72% { opacity: 1; transform: translate(-50%, -52%) scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
  #pop.show { animation: fade 1.5s linear forwards; }
  @keyframes fade { 0%, 70% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -50%); } }
}

/* ---------- title / pause cards ---------- */
.overlay { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(10, 9, 9, 0.2), rgba(10, 9, 9, 0.7)); }
/* phones: the title card sits low so the skull and the skyline's light show stay in view */
@media (orientation: portrait) { #title.overlay { place-items: end center; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(10, 9, 9, 0) 30%, rgba(10, 9, 9, 0.8)); } }
.overlay[hidden] { display: none; }
.card { width: min(420px, 100%); text-align: center; background: rgba(12, 9, 9, 0.92); border: 1px solid rgba(227, 16, 42, 0.45); border-radius: 16px; padding: 22px 20px 18px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 34px rgba(227, 16, 42, 0.28), 0 20px 60px rgba(0, 0, 0, 0.6); }
.kicker { font: 400 9px/1 "Press Start 2P", monospace; color: var(--green); letter-spacing: 0.12em; text-shadow: 0 0 8px rgba(124, 255, 42, 0.45); }
.card h1 { margin: 10px 0 2px; font: 400 clamp(52px, 15vw, 76px)/0.95 Creepster, cursive; letter-spacing: 0.03em; color: var(--bone); text-shadow: 4px 4px 0 var(--red); }
.tag { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.keys { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; font-size: 14px; text-align: left; }
.keys li { display: flex; align-items: center; gap: 10px; }
kbd { font: 700 11px/1 "Chakra Petch", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; background: #1d1414; color: var(--bone); border: 1px solid rgba(236, 228, 210, 0.3); border-bottom-width: 3px; border-radius: 6px; padding: 6px 8px; min-width: 104px; text-align: center; }
.start { width: 100%; font: 400 12px/1 "Press Start 2P", monospace; letter-spacing: 0.04em; color: #fff; background: var(--red); border: 0; border-radius: 10px; padding: 16px 12px; cursor: pointer; box-shadow: 0 4px 0 #7d0716; }
.start:active { transform: translateY(2px); box-shadow: 0 2px 0 #7d0716; }
.hi { margin: 14px 0 0; font: 400 9px/1.6 "Press Start 2P", monospace; color: #ff8d6e; }
.small { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: block; } .mouse-only { display: none; } }

/* ---------- tune panel ---------- */
#tune { position: fixed; z-index: 9; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: min(320px, calc(100% - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
#tune[hidden] { display: none; }
#tune .ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#tune label { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; margin: 10px 0; color: var(--bone); }
#tune output { font: 400 9px/1.6 "Press Start 2P", monospace; color: #ff8d6e; }
#tune input { grid-column: 1 / -1; width: 100%; accent-color: var(--red); }
#tune .hint { font-size: 12px; color: var(--muted); margin: 0 0 4px; }

/* ---------- phone controls ---------- */
#launchBtn { position: fixed; z-index: 5; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); padding: 16px 16px; display: none; background: rgba(227, 16, 42, 0.85); color: #fff; border-color: transparent; }
@media (pointer: coarse) { #launchBtn { display: inline-flex; } }
#nogl { position: fixed; inset: 0; display: none; place-items: center; padding: 24px; text-align: center; }

/* ---------- v3: punk-flyer / B-movie treatment (overrides the rules above) ---------- */
:root { --pink: #ff2e88; --purple: #5b1e7a; --acid: #4fcf1c; --paper: #e9e1cc; }
.overlay { background: radial-gradient(ellipse at center, rgba(40, 6, 40, 0.25), rgba(6, 3, 8, 0.78)); }
@media (orientation: portrait) { #title.overlay { background: linear-gradient(to bottom, rgba(6, 3, 8, 0) 30%, rgba(6, 3, 8, 0.85)); } }
.card { position: relative; border: 0; border-radius: 0; transform: rotate(-0.7deg);
  background: radial-gradient(circle, rgba(255, 46, 136, 0.13) 1.1px, transparent 1.7px) 0 0 / 6px 6px, linear-gradient(#120a10, #0a0709);
  clip-path: polygon(0% 0.4%, 4% 1.1%, 8% 1.1%, 12% 1.4%, 16% 0.3%, 20% 0.4%, 24% 0.2%, 28% 0.4%, 32% 1.2%, 36% 0.2%, 40% 0.9%, 44% 0.3%, 48% 0.5%, 52% 0.7%, 56% 1.3%, 60% 1.0%, 64% 0.0%, 68% 0.4%, 72% 0.2%, 76% 1.4%, 80% 1.3%, 84% 1.3%, 88% 1.3%, 92% 1.2%, 96% 1.5%, 100% 1.3%, 99.6% 4%, 98.8% 8%, 99.3% 12%, 98.9% 16%, 99.2% 20%, 99.4% 24%, 99.5% 28%, 99.4% 32%, 99.6% 36%, 99.8% 40%, 98.9% 44%, 98.9% 48%, 98.6% 52%, 99.0% 56%, 99.2% 60%, 99.0% 64%, 99.8% 68%, 99.1% 72%, 99.4% 76%, 99.8% 80%, 99.7% 84%, 99.3% 88%, 99.6% 92%, 99.4% 96%, 100% 98.9%, 96% 99.3%, 92% 99.8%, 88% 99.1%, 84% 99.6%, 80% 99.6%, 76% 99.6%, 72% 99.3%, 68% 99.9%, 64% 98.8%, 60% 98.3%, 56% 99.3%, 52% 98.7%, 48% 98.3%, 44% 99.9%, 40% 99.7%, 36% 98.5%, 32% 98.5%, 28% 98.8%, 24% 99.7%, 20% 99.3%, 16% 98.4%, 12% 98.4%, 8% 98.6%, 4% 99.6%, 0% 98.5%, 0.5% 96%, 1.0% 92%, 0.2% 88%, 1.4% 84%, 0.8% 80%, 1.0% 76%, 0.3% 72%, 0.9% 68%, 0.8% 64%, 0.8% 60%, 0.5% 56%, 1.0% 52%, 0.5% 48%, 0.4% 44%, 0.2% 40%, 1.0% 36%, 0.2% 32%, 0.3% 28%, 0.1% 24%, 0.9% 20%, 0.8% 16%, 0.8% 12%, 0.1% 8%, 0.6% 4%); box-shadow: none; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7)); }
.kicker { display: inline-block; font: 400 12px/1 "Special Elite", "Courier New", monospace; letter-spacing: 0.18em; color: #0b0909; background: var(--paper); padding: 5px 9px 4px; transform: rotate(-2deg); text-shadow: none; box-shadow: 3px 3px 0 var(--pink); }
.card h1 { position: relative; margin: 14px 0 22px; color: var(--pink); -webkit-text-stroke: 2px #0b0909; letter-spacing: 0.04em; transform: rotate(-2deg) skewX(-4deg);
  text-shadow: 2px 2px 0 #3a0b4c, 4px 4px 0 var(--purple), 6px 6px 0 var(--purple), 8px 8px 0 #2a0a3a, 0 0 30px rgba(255, 46, 136, 0.35); }
.card h1::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -14px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath fill='%23ff2e88' d='M0 0H200V3L187.4 3 L186.6 12.7 A2.5 2.5 0 0 1 182.8 12.7 L181.9 3 L175.3 3 L174.4 3.4 A2.7 2.7 0 0 1 170.3 3.4 L169.4 3 L167.4 3 L166.4 13.0 A3.0 3.0 0 0 1 161.6 13.0 L160.6 3 L152.2 3 L151.5 6.6 A2.2 2.2 0 0 1 148.0 6.6 L147.3 3 L133.8 3 L133.4 4.8 A1.4 1.4 0 0 1 131.2 4.8 L130.8 3 L128.2 3 L127.2 7.6 A2.7 2.7 0 0 1 123.0 7.6 L122.1 3 L110.4 3 L109.5 3.0 A2.5 2.5 0 0 1 105.7 3.0 L104.9 3 L92.3 3 L91.8 9.3 A1.7 1.7 0 0 1 89.1 9.3 L88.5 3 L78.5 3 L77.8 10.9 A1.9 1.9 0 0 1 74.9 10.9 L74.3 3 L60.6 3 L60.0 12.9 A1.7 1.7 0 0 1 57.4 12.9 L56.8 3 L54.1 3 L53.1 5.6 A3.0 3.0 0 0 1 48.5 5.6 L47.5 3 L38.1 3 L37.5 4.4 A1.6 1.6 0 0 1 35.0 4.4 L34.5 3 L28.3 3 L27.8 6.9 A1.4 1.4 0 0 1 25.7 6.9 L25.3 3 L18.6 3 L17.7 5.9 A2.8 2.8 0 0 1 13.3 5.9 L12.3 3 L11.0 3 L10.1 7.5 A2.6 2.6 0 0 1 6.0 7.5 L5.2 3 L0 3Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.tag { font-family: "Special Elite", "Courier New", monospace; color: #cfc4b0; }
kbd { background: var(--paper); color: #0b0909; border-color: #0b0909; font-family: "Black Ops One", "Chakra Petch", sans-serif; letter-spacing: 0.06em; }
.keys li { font-family: "Special Elite", "Courier New", monospace; }
.start { font-family: "Black Ops One", "Press Start 2P", monospace; font-size: 17px; letter-spacing: 0.08em; color: #0b0909; background: var(--pink); border: 3px solid #0b0909; border-radius: 3px; box-shadow: 5px 5px 0 var(--purple); transform: rotate(0.6deg); }
.start:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--purple); }
.hi { color: var(--pink); }
.small { font-family: "Special Elite", "Courier New", monospace; }
/* score display: cracked glass, taped to the cabinet */
.dmd { position: relative; border-color: rgba(255, 46, 136, 0.45); border-radius: 6px; }
.dmd::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 120' preserveAspectRatio='none'%3E%3Cpath fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1' d='M140 0 L133 12 L155 22 L155 46 L130 64 L137 75 L130 95 M138 0 L151 12 L135 24 L136 48 L141 69 L134 91 L110 105 M195 0 L209 16 L184 30 L167 45 L185 58 L208 81 L182 96'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.dmd::before { content: ""; position: absolute; top: -7px; left: 14px; width: 54px; height: 16px; background: rgba(225, 215, 170, 0.55); transform: rotate(-6deg); pointer-events: none; }
.btn { border-radius: 4px; }
.btn:hover { border-color: var(--pink); }
/* big callouts: B-movie title cards */
#pop { color: var(--pink); -webkit-text-stroke: 2px #0b0909; text-shadow: 3px 3px 0 var(--purple), 6px 6px 0 var(--purple), 9px 9px 0 #2a0a3a, 0 0 30px rgba(255, 46, 136, 0.45); }
/* (selectors below start with `body` so they beat index.html's inline defaults, which load after this file) */
/* two players: Solo / 2 Players as stamped tickets, names typed on a membership card */
body .modes { gap: 10px; }
body .mode-btn { font: 400 15px/1 "Black Ops One", "Chakra Petch", sans-serif; letter-spacing: 0.1em; color: #cfc4b0; background: #0b0909; border: 2px dashed rgba(236, 228, 210, 0.35); border-radius: 3px; padding: 12px 10px; transform: rotate(-0.6deg); }
body .mode-btn:nth-child(2) { transform: rotate(0.8deg); }
body .mode-btn.on { color: #0b0909; background: var(--paper); border: 2px solid #0b0909; box-shadow: 4px 4px 0 var(--pink); }
body .names input { font: 400 16px/1 "Special Elite", "Courier New", monospace; letter-spacing: 0.08em; color: #0b0909; background: var(--paper); border: 0; border-bottom: 2px solid #0b0909; border-radius: 0; box-shadow: 3px 3px 0 var(--purple); }
body .names input::placeholder { color: rgba(11, 9, 9, 0.45); }
body .names input:focus { outline: 2px solid var(--pink); outline-offset: 2px; border-color: #0b0909; }
/* "your turn" and final scores read like B-movie title cards */
body #turn h1, body #results h1 { font-size: clamp(40px, 12vw, 64px); }
body #turn .kicker, body #results .kicker { background: var(--pink); }
body #scoreLines { font-family: "Special Elite", "Courier New", monospace; font-size: 17px; line-height: 1.6; color: var(--bone); white-space: pre-line; }
body #results .modes .start { flex: 1; }
/* pause guide: hot-pink pins and ransom-tape labels */
body .guide-lines line { stroke: var(--pink); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.9; }
body .guide-dot { background: var(--pink); color: #0b0909; box-shadow: 0 0 0 2px #0b0909, 0 0 10px rgba(255, 46, 136, 0.8); }
body .tag-label { background: var(--paper); color: #0b0909; border: 0; border-radius: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6); font: 400 11px/1.3 "Special Elite", "Courier New", monospace; transform: rotate(-1deg); }
body .tag-label b { color: #0b0909; background: var(--pink); display: inline-block; padding: 2px 4px 1px; margin-bottom: 4px; font: 400 11px/1.2 "Black Ops One", sans-serif; letter-spacing: 0.06em; }
body #legend { font-family: "Special Elite", "Courier New", monospace; color: #e2d9c4; }
body #legend b { color: var(--pink); font: 400 11px/1.4 "Black Ops One", sans-serif; letter-spacing: 0.05em; }
body #rules h2 { color: var(--pink); font: 400 15px/1.3 "Black Ops One", sans-serif; letter-spacing: 0.06em; }
body #rules p, body #rules li { font-family: "Special Elite", "Courier New", monospace; }
body #watchBadge { background: var(--pink); color: #0b0909; border-radius: 3px; box-shadow: 4px 4px 0 var(--purple); }
