/* ---- 8-BIT CASINO THEME v2.0 ---- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --bg: #0d0221;
  --panel: #1a0b3d;
  --panel2: #241259;
  --border: #6320ee;
  --neon: #00ffd5;
  --gold: #ffd700;
  --red: #ff2e63;
  --green: #3dfc73;
  --text: #e8e6ff;
  --dim: #9b93c9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  line-height: 1.8;
  min-height: 100vh;
  image-rendering: pixelated;
}

body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 3px);
}

a { color: var(--neon); text-decoration: none; }
h1, h2, h3 { line-height: 1.5; margin-bottom: 16px; }
h1 { font-size: 20px; color: var(--gold); text-shadow: 3px 3px 0 var(--red); }
h2 { font-size: 14px; color: var(--neon); }

.wrap { max-width: 960px; margin: 0 auto; padding: 20px; }

.panel {
  background: var(--panel);
  border: 4px solid var(--border);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--border), 0 0 24px rgba(99,32,238,0.5);
  padding: 20px;
  margin-bottom: 28px;
}

nav.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--panel2); border-bottom: 4px solid var(--border);
  padding: 8px 16px; margin-bottom: 24px;
}
nav.topbar .brand { color: var(--gold); font-size: 12px; display: inline-flex; align-items: center; }
nav.topbar .links a { margin-left: 12px; font-size: 10px; }
.balance-chip {
  background: var(--bg); border: 3px solid var(--gold); color: var(--gold);
  padding: 4px 10px; font-size: 11px; cursor: pointer;
}
.balance-chip:hover { filter: brightness(1.3); }
.reset-timer { font-size: 9px; color: var(--neon); border: 2px solid var(--neon); padding: 4px 8px; }

/* the champ's 8-bit face — compact */
.pixel-face {
  width: 36px; height: 36px; image-rendering: auto;
  border: 2px solid var(--gold); background: var(--panel);
  margin-right: 8px;
}
.vault .face {
  display: block; margin: 0 auto 8px; width: 110px; height: 110px;
  image-rendering: auto; border: 3px solid var(--gold); background: var(--panel2);
}

/* trash talk bubble */
.talk-bubble {
  font-size: 8px; color: var(--neon); background: var(--bg);
  border: 2px solid var(--neon); padding: 4px 8px; margin-left: 10px;
  position: relative; max-width: 280px; line-height: 1.6;
}
.talk-bubble::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  border: 4px solid transparent; border-right-color: var(--neon);
}
@media (max-width: 900px) { .talk-bubble { display: none; } }

/* airplane banner flyover */
.flyover {
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  background: rgba(13,2,33,0.35);
}
.fly-rig {
  position: absolute; top: 38%; left: -80%; white-space: nowrap;
  display: flex; align-items: center;   animation: flyby 5s linear forwards;
}
.fly-plane { font-size: 40px; position: relative; }
.fly-plane-img {
  height: 96px; image-rendering: auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55));
}
.fly-rope { width: 30px; height: 3px; background: var(--dim); }
.fly-banner {
  background: var(--gold); color: #1a0b3d; font-size: 12px; padding: 10px 16px;
  border: 3px solid #1a0b3d; box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}
@keyframes flyby {
  0%   { left: -80%; transform: translateX(0); }
  30%  { left: 50%;  transform: translateX(-50%); }
  70%  { left: 50%;  transform: translateX(-50%); }   /* full 2-second pause mid-screen */
  100% { left: 115%; transform: translateX(0); }
}

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,2,33,0.85); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal { background: var(--panel); border: 4px solid var(--gold); padding: 20px; max-width: 520px; width: 92%; }
.modal .modal-body { max-height: 55vh; overflow-y: auto; margin-bottom: 14px; }
.modal table { font-size: 9px; }

/* collapsible rules */
details.rules summary { cursor: pointer; color: var(--neon); font-size: 13px; list-style: none; }
details.rules summary::before { content: '▶ '; font-size: 10px; }
details.rules[open] summary::before { content: '▼ '; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules p { font-size: 10px; line-height: 2.2; margin-top: 12px; }

.plays-chip {
  display: inline-block; font-size: 9px; color: var(--gold);
  border: 2px solid var(--gold); padding: 4px 10px; margin-bottom: 14px;
}

.btn {
  display: inline-block; cursor: pointer; font-family: inherit; font-size: 12px;
  background: var(--border); color: #fff; border: none; padding: 12px 20px;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,0.4), inset 4px 4px 0 rgba(255,255,255,0.2);
}
.btn:hover { filter: brightness(1.2); }
.btn:active { box-shadow: inset 4px 4px 0 rgba(0,0,0,0.4); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.gold { background: #a67c00; }
.btn.red { background: var(--red); }
.btn.green { background: #0e9e4a; }
.btn.small { font-size: 10px; padding: 8px 12px; }

input, select {
  font-family: inherit; font-size: 12px; color: var(--text);
  background: var(--bg); border: 3px solid var(--border); padding: 10px; width: 100%;
}
label { display: block; font-size: 10px; color: var(--dim); margin: 12px 0 4px; }

table { width: 100%; border-collapse: collapse; font-size: 10px; }
th, td { border-bottom: 2px solid var(--panel2); padding: 8px 6px; text-align: left; }
th { color: var(--neon); }

.flash { padding: 12px; margin: 12px 0; border: 3px solid; font-size: 11px; }
.flash.win { border-color: var(--green); color: var(--green); }
.flash.lose { border-color: var(--red); color: var(--red); }
.flash.info { border-color: var(--neon); color: var(--neon); }

/* lobby cabinets */
.cabinets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.cabinet {
  background: var(--panel2); border: 4px solid var(--border); padding: 18px;
  text-align: center; transition: transform .1s;
}
.cabinet:hover { transform: translateY(-4px); border-color: var(--neon); }
.cabinet .icon { font-size: 40px; display: block; margin-bottom: 10px; }
.cabinet .tag { font-size: 9px; color: var(--dim); display: block; margin-top: 8px; }
.cabinet.earn { border-color: #0e9e4a; }
.cabinet.earn:hover { border-color: var(--green); }

/* cards — backs and royals wear the champ's face */
.card {
  display: inline-block; width: 58px; height: 82px; margin: 4px;
  background: #fff; color: #111; border: 3px solid #111; border-radius: 4px;
  font-size: 16px; text-align: center; line-height: 82px; vertical-align: middle;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.6);
}
.card.red { color: #d40000; }
.card.back {
  background:
    url('../img/saarth_face.png?v=22') center / 68% no-repeat,
    repeating-linear-gradient(45deg, var(--border) 0 6px, var(--panel) 6px 12px);
  image-rendering: pixelated;
  color: transparent;
}
.card.face-card { line-height: normal; padding-top: 8px; }
.card.face-card .card-mug {
  display: block; width: 36px; height: 36px; margin: 2px auto 4px;
  image-rendering: auto;
}
.card.face-card b { font-size: 13px; }
.card.flip-target { outline: 4px solid var(--gold); outline-offset: 2px; }

.bj-cards { text-align: center; min-height: 90px; }
.bj-log { font-size: 9px; color: var(--dim); line-height: 2; min-height: 40px; margin-top: 10px; text-align: center; }

/* ride the bus slots */
.bus-slots { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.bus-slot { text-align: center; }
.bus-slot .slot-label { display: block; font-size: 8px; color: var(--dim); margin-top: 6px; max-width: 80px; line-height: 1.7; }
.bus-slot.active .slot-label { color: var(--gold); }

/* roulette wheel */
.rl-wrap { text-align: center; position: relative; }
#rl-wheel { display: block; margin: 0 auto; }
.rl-pointer { font-size: 20px; color: var(--gold); margin-bottom: -6px; }
.rl-history { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.rl-chip {
  width: 32px; height: 32px; line-height: 32px; text-align: center; font-size: 10px;
  border: 2px solid #000; color: #fff;
}
.rl-chip.red { background: #c1121f; }
.rl-chip.black { background: #111; }
.rl-chip.green { background: #0e9e4a; }
.rl-board { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; justify-content: center; }

/* field goal v3 (behind the ball) */
#fg-canvas { background: #06280a; border: 4px solid #1c5c1c; display: block; margin: 0 auto; max-width: 100%; }
.meter { height: 22px; background: var(--bg); border: 3px solid var(--border); position: relative; margin: 10px 0; }
.meter .fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); width: 0%; }
.meter .marker { position: absolute; top: -6px; bottom: -6px; width: 4px; background: #fff; }
.meter .zone { position: absolute; top: 0; bottom: 0; background: rgba(61,252,115,0.35); }
.fg-hud { display: flex; justify-content: space-between; font-size: 10px; color: var(--gold); margin: 8px 0; flex-wrap: wrap; gap: 8px; }

/* frogger */
#frog-canvas { border: 4px solid #1c5c1c; max-width: 100%; touch-action: manipulation; }
#dpad .btn { min-width: 52px; margin: 2px; }
@media (min-width: 700px) { #dpad { display: none; } }

/* wordle */
.wordle-grid { display: inline-block; margin-top: 8px; }
.wrow { display: flex; gap: 6px; margin-bottom: 6px; justify-content: center; }
.wcell {
  width: 52px; height: 52px; line-height: 52px; font-size: 20px; text-align: center;
  border: 3px solid var(--border); background: var(--bg); color: var(--text);
}
.wcell.g { background: #0e9e4a !important; border-color: #0e9e4a !important; color: #fff !important; }
.wcell.y { background: #a67c00 !important; border-color: #a67c00 !important; color: #fff !important; }
.wcell.x { background: #2a2a3a !important; border-color: #2a2a3a !important; color: var(--dim) !important; }

/* leaderboard */
.lb-tabs { margin-bottom: 16px; }
.activity-grid td, .activity-grid th { text-align: center; font-size: 9px; }
.lb-house-row td { color: var(--gold); border-top: 3px solid var(--gold); }

.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.center { text-align: center; }
.mt { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 120px; }

/* login screen */
.vault { max-width: 480px; margin: 3vh auto; }
.clues { margin-top: 16px; }
.clues li { font-size: 10px; color: var(--gold); margin: 10px 0 10px 20px; }

@media (max-width: 600px) {
  body { font-size: 10px; }
  h1 { font-size: 15px; }
  .card { width: 44px; height: 64px; line-height: 64px; font-size: 13px; }
  .card.face-card { line-height: normal; }
}

/* wordle payouts + alphabet tracker (v2.1) */
.wpay { font-size: 9px; color: var(--dim); margin-left: 10px; line-height: 52px; min-width: 52px; text-align: left; }
#wkeyboard { margin-top: 14px; }
.wkb-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.wkey { width: 26px; height: 32px; line-height: 32px; font-size: 10px; text-align: center;
        border: 2px solid var(--border); background: var(--bg); color: var(--text); }
.wkey.g { background: #0e9e4a; border-color: #0e9e4a; color: #fff; }
.wkey.y { background: #a67c00; border-color: #a67c00; color: #fff; }
.wkey.x { background: #2a2a3a; border-color: #2a2a3a; color: var(--dim); }

/* attendance status — every page, bottom, orange, calm (v2.7) */
.attendance-bar {
  text-align: center; font-size: 12px; color: #ff9f1c;
  padding: 14px 10px 20px; line-height: 1.9;
}

/* lobby 3-step walkthrough */
.howto-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.howto-step { display: none; }
.howto-step.active { display: block; }
.howto-step ul { margin: 8px 0 0 20px; }
.howto-step li { font-size: 10px; line-height: 2.1; margin-bottom: 6px; }

/* ---- v2.8: marquee casino lights around the GAMBLE cabinets (hover) ---- */
.cabinet { position: relative; }
.cabinet:not(.earn)::before,
.cabinet:not(.earn)::after {
  content: ''; position: absolute; inset: -12px; pointer-events: none; opacity: 0;
}
.cabinet:not(.earn)::before {
  background:
    repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 24px) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 24px) 0 100% / 100% 6px no-repeat,
    repeating-linear-gradient(0deg,  var(--gold) 0 6px, transparent 6px 24px) 0 0 / 6px 100% no-repeat,
    repeating-linear-gradient(0deg,  var(--gold) 0 6px, transparent 6px 24px) 100% 0 / 6px 100% no-repeat;
}
.cabinet:not(.earn)::after {
  background:
    repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 24px) 12px 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 24px) 12px 100% / 100% 6px no-repeat,
    repeating-linear-gradient(0deg,  var(--red) 0 6px, transparent 6px 24px) 0 12px / 6px 100% no-repeat,
    repeating-linear-gradient(0deg,  var(--red) 0 6px, transparent 6px 24px) 100% 12px / 6px 100% no-repeat;
}
.cabinet:not(.earn):hover::before { animation: bulbs-a 0.5s steps(1) infinite; }
.cabinet:not(.earn):hover::after  { animation: bulbs-b 0.5s steps(1) infinite; }
@keyframes bulbs-a { 0%, 100% { opacity: 1; }    50% { opacity: 0.15; } }
@keyframes bulbs-b { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

/* nested bullets inside the lobby walkthrough (ADIT PENALTY tiers) */
.howto-step ul ul { margin: 8px 0 4px 18px; }
.howto-step ul ul li { margin-bottom: 4px; }

/* ---- v2.9: the plane is ticklish ---- */
.fly-plane.ticklish { pointer-events: auto; cursor: pointer; }

/* ---- v2.9: Guthrie Gallery of Memes ---- */
.memes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
  margin-top: 16px;
}
.meme-card { background: var(--panel2); border: 4px solid var(--border); padding: 12px; }
.meme-card img { width: 100%; display: block; border: 3px solid var(--border); background: #000; image-rendering: auto; cursor: zoom-in; }
.meme-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; flex-wrap: wrap;
}
.meme-count { font-size: 9px; color: var(--dim); }

/* ---- v5.1 mobile pass: every game playable on a phone ---- */
canvas { max-width: 100%; height: auto; }
.panel { overflow-x: auto; }

@media (max-width: 700px) {
  body { font-size: 10px; }
  .wrap { padding: 10px; }
  h1 { font-size: 15px; }
  h2 { font-size: 11px; }
  nav.topbar { flex-wrap: wrap; row-gap: 6px; padding: 8px 10px; }
  nav.topbar .links { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; }
  nav.topbar .links a { margin-left: 0; }
  .cabinets { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cabinet { padding: 12px 8px; font-size: 10px; }
  .cabinet .icon { font-size: 30px; }
  .btn { padding: 10px 12px; }
  input, select { font-size: 16px; }   /* stops iOS zoom-on-focus */
  .plays-chip { display: inline-block; margin-bottom: 6px; }
  .bj-cards .card { transform: scale(0.85); margin: -4px -6px; }
  .howto-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .memes-grid { grid-template-columns: 1fr; }
  #dpad .btn, #rc-touch .btn { padding: 14px 18px; }   /* fat thumbs welcome */
}
