/* ═══════════════════════════════════════════════════════
   Trump Square-Off — Custom Styles
   Dark patriotic theme: deep navy, red, white, gold
═══════════════════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  background-color: #0a0e1a;
  font-family: 'Arial', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ── Flag texture (CSS stripes) ─────────────────────── */
.flag-texture {
  background: repeating-linear-gradient(
    0deg,
    rgba(179,0,0,0.15) 0px,
    rgba(179,0,0,0.15) 12px,
    transparent 12px,
    transparent 24px
  );
}

/* ── Header gradient (compact bar) ──────────────────── */
#hero {
  background: linear-gradient(135deg, #0d1225 0%, #1a0a0a 50%, #0d1225 100%);
  border-bottom: 1px solid rgba(251,191,36,0.3);
  flex-shrink: 0;
}

/* ── Countdown (compact header) ────────────────────── */

/* ── Status Bar ─────────────────────────────────────── */
#statusBar.pre   { background: rgba(30,58,138,0.6); border: 1px solid #3b82f6; color: #93c5fd; }
#statusBar.live  { background: rgba(127,29,29,0.8); border: 1px solid #ef4444; color: #fca5a5; }
#statusBar.post  { background: rgba(20,83,45,0.6); border: 1px solid #22c55e; color: #86efac; }

#statusBar.pre  #statusDot { background: #3b82f6; }
#statusBar.live #statusDot { background: #ef4444; }
#statusBar.post #statusDot { background: #22c55e; }

/* ── Jackpot Banner ─────────────────────────────────── */
.jackpot-banner {
  background: linear-gradient(90deg, rgba(120,53,15,0.6), rgba(161,98,7,0.4), rgba(120,53,15,0.6));
  border: 1px solid rgba(251,191,36,0.5);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { border-color: rgba(251,191,36,0.3); }
  50%       { border-color: rgba(251,191,36,0.9); box-shadow: 0 0 20px rgba(251,191,36,0.2); }
}

/* ── Tabs ───────────────────────────────────────────── */
.tab-btn {
  background: #0d1225;
  color: #6b7280;
}
.tab-btn.active {
  background: #b91c1c;
  color: #fff;
}
.tab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: #d1d5db;
}

/* ── Bingo Grid ─────────────────────────────────────── */
.bingo-cell {
  background: #0d1225;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-height: 70px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.3;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

@media (min-width: 640px) {
  .bingo-cell {
    min-height: 90px;
    font-size: 0.75rem;
    padding: 8px;
  }
}

@media (min-width: 768px) {
  .bingo-cell { min-height: 110px; font-size: 0.8rem; }
}

.bingo-cell:hover:not(.free):not(.locked-cell) {
  border-color: rgba(251,191,36,0.5);
  background: rgba(251,191,36,0.05);
  transform: scale(1.02);
}

/* Empty cell */
.bingo-cell.empty {
  border-style: dashed;
  border-color: rgba(255,255,255,0.08);
  color: #4b5563;
}
.bingo-cell.empty::before {
  content: '+';
  font-size: 1.5rem;
  color: #374151;
}

/* Named cell */
.bingo-cell.named {
  border-color: rgba(255,255,255,0.15);
  color: #e5e7eb;
}

/* Free center */
.bingo-cell.free {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  border-color: #ef4444;
  cursor: default;
  font-family: 'Impact', sans-serif;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Hit cell */
.bingo-cell.hit {
  background: linear-gradient(135deg, #14532d, #15803d);
  border-color: #22c55e;
  animation: cellPop 0.4s ease;
}
.bingo-cell.hit::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 5px;
  color: #4ade80;
  font-size: 1rem;
  font-weight: bold;
}

/* Personal mark */
.bingo-cell.personal-hit {
  box-shadow: inset 0 0 0 2px #fbbf24;
}

/* Jackpot cell */
.bingo-cell.jackpot {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 12px rgba(251,191,36,0.4);
}
.bingo-cell.jackpot::before {
  content: '⭐';
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.7rem;
}

/* Locked cell */
.bingo-cell.locked-cell {
  cursor: not-allowed;
  opacity: 0.85;
}

@keyframes cellPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Vote badge */
.vote-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.6rem;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 1px 5px;
  margin-top: 3px;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.15s;
}
.vote-badge:hover { background: rgba(255,255,255,0.2); }

/* ── Drink Cards ────────────────────────────────────── */
.drink-card {
  background: #0d1225;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}
.drink-card:hover { border-color: rgba(251,191,36,0.2); }

.drink-amount-badge {
  font-size: 0.65rem;
  font-weight: bold;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-sip   { background: #1e3a5f; color: #93c5fd; }
.badge-drink { background: #3b1f05; color: #fb923c; }
.badge-shot  { background: #3b0a0a; color: #f87171; }

.plus-btn {
  background: #1f2937;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  color: #fff;
}
.plus-btn:hover  { background: #374151; transform: scale(1.05); }
.plus-btn:active { transform: scale(0.95); }

.counter-num {
  font-family: 'Impact', sans-serif;
  font-size: 1.6rem;
  color: #fbbf24;
  line-height: 1;
  min-width: 2rem;
  text-align: center;
}

/* ── Modals ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: #0d1225;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  color: #6b7280;
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.modal-close:hover { color: #fff; }

/* Suggestion items in naming modal */
.suggestion-item {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.suggestion-item.top-pick {
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.05);
}

/* ── Leaderboard ────────────────────────────────────── */
.leader-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #111827;
  border-radius: 8px;
  font-size: 0.8rem;
}
.leader-rank {
  font-family: 'Impact', sans-serif;
  font-size: 1rem;
  color: #fbbf24;
  min-width: 1.5rem;
  text-align: center;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
  50%       { box-shadow: 0 0 0 8px rgba(251,191,36,0.15); }
}

.countdown-sep-sm {
  font-size: 0.7rem;
  color: #4b5563;
  margin: 0 1px;
}

/* ── Mic button active state ─────────────────────────── */
.mic-active {
  background: rgba(34,197,94,0.15) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
  animation: pulse-mic 1.5s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0.2); }
}

/* ── Drink card side colors ──────────────────────────── */
.drink-card.border-blue-900\/60 { border-color: rgba(30,58,138,0.6); }
.drink-card.border-red-900\/60  { border-color: rgba(127,29,29,0.6); }

/* ── Header grid: tickers | title | tickers ─────────── */
.header-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .header-grid {
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
  }
}

/* ── Ticker panels ───────────────────────────────────── */
.ticker-panel {
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.07);
}
.ticker-panel-left  { border-color: rgba(234,179,8,0.2); }
.ticker-panel-right { border-color: rgba(59,130,246,0.2); }

/* Hide on mobile — not enough room */
@media (max-width: 1023px) {
  .ticker-panel { display: none; }
}

.ticker-panel-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 700;
}

.ticker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.72rem;
}
.ticker-row:last-child { border-bottom: none; }

.ticker-name {
  color: #9ca3af;
  flex: 1;
  white-space: nowrap;
  font-size: 0.7rem;
}

.ticker-price {
  color: #e5e7eb;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 52px;
  text-align: right;
}

.ticker-change {
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 52px;
  text-align: right;
  border-radius: 4px;
  padding: 1px 4px;
}
.ticker-change.up   { color: #4ade80; background: rgba(74,222,128,0.1); }
.ticker-change.down { color: #f87171; background: rgba(248,113,113,0.1); }
.ticker-change.flat { color: #9ca3af; }

.ticker-updated {
  font-size: 0.55rem;
  color: #374151;
  margin-top: 6px;
  text-align: right;
}

/* Flash animation when price updates */
@keyframes tickerFlash {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 1; }
}
.ticker-flash { animation: tickerFlash 0.4s ease; }

/* ── Live viewer counter ─────────────────────────────── */
.viewer-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: #9ca3af;
}
.viewer-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ── Full-page tile layout: 3 columns filling viewport ── */
.tile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 6px;
  height: calc(100vh - 48px); /* viewport minus header + footer */
  overflow: hidden;
}

@media (min-width: 900px) {
  .tile-layout {
    grid-template-columns: 200px 1fr 200px;
    align-items: stretch;
  }
}

.tile {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0d1225;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tile-drinks {
  padding: 8px;
}

.tile-center {
  padding: 6px;
  background: transparent;
  border: none;
  overflow-y: auto;
}

/* YouTube container — constrained height */
.yt-container {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 34vh;
  flex-shrink: 0;
}

/* Compact bingo grid cells */
.bingo-compact .bingo-cell {
  min-height: 48px;
  font-size: 0.55rem;
  padding: 3px;
  border-radius: 5px;
}

/* Drink scroll area */
.drink-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Compact countdown in header */
.countdown-num-sm {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 1rem;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251,191,36,0.4);
  min-width: 1.5rem;
  text-align: center;
}

/* Drink columns */
.drink-col-anti { border-color: rgba(30,58,138,0.5); background: rgba(15,23,42,0.8); }
.drink-col-pro  { border-color: rgba(127,29,29,0.5); background: rgba(20,10,10,0.8); }

.drink-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── Compact drink triggers for side tile panels ── */
.drink-card {
  padding: 4px 6px;
  border-radius: 6px;
  gap: 4px;
  font-size: 0.6rem;
}
.drink-card .counter-num {
  font-size: 0.85rem;
  min-width: 1.2rem;
}
.plus-btn {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  border-radius: 5px;
  flex-shrink: 0;
}
.drink-card p.font-semibold {
  font-size: 0.6rem;
  line-height: 1.2;
}
.drink-amount-badge {
  font-size: 0.5rem;
  padding: 1px 4px;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

/* ── Hit flash animation on drink +1 ───────────────── */
@keyframes drinkFlash {
  0%   { background: #0d1225; }
  30%  { background: rgba(185,28,28,0.3); }
  100% { background: #0d1225; }
}
.drink-flash { animation: drinkFlash 0.5s ease; }
