/* Cop Slop Bingo - Asmongold / ZackRawrr Bodycam Edition */

:root {
  --bg: #070a12;
  --surface: #0f1420;
  --border: #1e2738;
  --text: #e8eaed;
  --muted: #8b93a7;
  --cop-blue: #00a8ff;
  --cop-blue-dim: #0077cc;
  --cop-red: #ff2a2a;
  --cop-red-dim: #cc1a1a;
  --gold: #ffd600;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.4;
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 40% at 15% 20%, rgba(0, 168, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 35% at 85% 25%, rgba(255, 42, 42, 0.10), transparent 55%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(0, 100, 180, 0.05), transparent);
}

.app {
  width: 100%;
  max-width: 720px;
  padding: 0.75rem 1rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ===== Top section (header + controls) with photo background ===== */
.top {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background-color: #0a1220;
  background-image: url("banner.jpg");
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  padding: 1.1rem 1rem 1.15rem;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  border: 1px solid var(--border);
}

/* Soft dark overlay so title + buttons stay readable while photo remains visible */
.top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 10, 18, 0.45) 0%,
    rgba(7, 10, 18, 0.35) 40%,
    rgba(7, 10, 18, 0.55) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.top > * {
  position: relative;
  z-index: 1;
}

/* Header */
header {
  text-align: center;
  padding: 0 0 0.65rem;
}

h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--cop-blue), #fff 45%, var(--cop-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(0, 168, 255, 0.25);
  margin-bottom: 0.1rem;
}

.tagline {
  color: #c8cdd8;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

a {
  color: var(--cop-blue);
}

/* Controls — below bingo board (match /chase layout) */
.controls {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, var(--cop-blue), var(--cop-blue-dim));
  color: #000;
  box-shadow: 0 4px 18px rgba(0, 168, 255, 0.35);
}

.btn.primary:hover {
  box-shadow: 0 0 0 2px var(--cop-blue), 0 0 18px rgba(0, 168, 255, 0.5), 0 0 28px rgba(255, 42, 42, 0.25);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  border-color: var(--cop-blue);
  color: var(--cop-blue);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.2);
}

.btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

.btn.large {
  padding: 0.85rem 1.8rem;
  font-size: 1.05rem;
}

/* How to */
.how-to {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}

.how-to.hidden {
  display: none;
}

.how-to h3 {
  margin-bottom: 0.65rem;
  color: var(--cop-blue);
  font-size: 1.05rem;
}

.how-to ol {
  margin: 0 0 0.65rem 1.15rem;
  color: var(--text);
}

.how-to li {
  margin-bottom: 0.3rem;
}

.how-to .tip {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  font-style: italic;
}

/* Bingo Board */
.bingo-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  background: var(--surface);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  user-select: none;
}

.cell {
  aspect-ratio: 1;
  background: #121826;
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5px 3px;
  font-size: clamp(0.55rem, 2vw, 0.75rem);
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
  color: var(--text);
}

.cell:hover:not(.free):not(.marked) {
  border-color: transparent;
  background: #1a2235;
  transform: scale(1.04);
  z-index: 1;
  box-shadow:
    0 0 0 1.5px var(--cop-blue),
    0 0 12px rgba(0, 168, 255, 0.45),
    0 0 20px rgba(255, 42, 42, 0.25);
}

.cell:active:not(.free) {
  transform: scale(0.96);
}

/* FREE center */
.cell.free {
  background: linear-gradient(145deg, #0a1a3a, #0d2248);
  border-color: var(--cop-blue);
  color: var(--gold);
  font-weight: 800;
  font-size: clamp(0.7rem, 2.2vw, 0.9rem);
  letter-spacing: 0.04em;
  cursor: default;
  box-shadow: inset 0 0 20px rgba(0, 168, 255, 0.15), 0 0 10px rgba(0, 168, 255, 0.2);
}

.cell.free::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(0, 168, 255, 0.2), transparent 65%);
  pointer-events: none;
}

.cell.free span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 8px rgba(255, 214, 0, 0.5);
}

/* Marked - red/blue cop light theme */
.cell.marked {
  background: linear-gradient(145deg, #4a0a0a, #6b1010);
  border-color: var(--cop-red);
  color: #fff;
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,0.12),
    0 0 10px rgba(255, 42, 42, 0.45),
    0 0 18px rgba(0, 168, 255, 0.2);
}

.cell.marked::before {
  content: "✕";
  position: absolute;
  font-size: 2.2em;
  font-weight: 900;
  color: rgba(255,255,255,0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.cell.marked span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* BINGO headers */
.bingo-headers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 4px;
  padding: 0 8px;
}

.bingo-headers span {
  text-align: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--cop-blue);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0, 168, 255, 0.4);
}

/* Footer */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  padding-top: 0.35rem;
  opacity: 0.85;
}

/* ===== Overlay + Confetti + Cop Lights ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.25s ease;
}

.overlay.hidden {
  display: none;
}

/* Flashing cop lights on the overlay */
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 42, 42, 0.22), transparent 40%, transparent 60%, rgba(0, 168, 255, 0.22));
  animation: copFlash 0.55s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes copFlash {
  0% {
    background: linear-gradient(90deg, rgba(255, 42, 42, 0.28), transparent 45%, transparent 55%, rgba(0, 168, 255, 0.12));
    opacity: 0.9;
  }
  100% {
    background: linear-gradient(90deg, rgba(255, 42, 42, 0.1), transparent 45%, transparent 55%, rgba(0, 168, 255, 0.3));
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bingo-message {
  text-align: center;
  z-index: 2;
  padding: 1.75rem;
  position: relative;
}

.bingo-text {
  font-size: clamp(3.6rem, 16vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, var(--gold), #fff, var(--cop-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 50px rgba(255, 214, 0, 0.45);
  animation: popIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  line-height: 1;
  margin-bottom: 0.4rem;
}

@keyframes popIn {
  0% { transform: scale(0.25); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.bingo-sub {
  font-size: 1.15rem;
  color: #c0c5d0;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Confetti */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti {
  position: absolute;
  top: -30px;
  opacity: 0.95;
  animation: fall linear forwards;
  font-size: 1.1rem;
  line-height: 1;
  will-change: transform;
}

.confetti.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  font-size: 0;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive — phones only. Taller banner clears a typical iOS PiP window. */
@media (max-width: 480px) {
  .app {
    padding: 0.5rem 0.5rem 1.25rem;
    gap: 0.7rem;
  }
  .top {
    min-height: 250px;
    padding: 0.85rem 0.75rem 0.9rem;
  }
  .cell {
    font-size: 0.52rem;
    padding: 3px 2px;
  }
  .bingo-board {
    gap: 3px;
    padding: 5px;
  }
  h1 {
    font-size: 1.55rem;
  }
  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
  }
}
