/* ============================================
   BINGO OVERLAY — STYLES
   ============================================ */

:root {
  --bg: rgba(0, 0, 0, 0.55);
  --cell-bg: rgba(20, 20, 24, 0.85);
  --cell-border: rgba(255, 255, 255, 0.12);
  --text: #f4f4f5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-height: 100vh;
  justify-content: center;
}

.scorebar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 18px;
  background: var(--bg);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bingo-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bingo-score-pill .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 8px var(--team-color);
}

.bingo-score-pill b { font-size: 1.15em; }

.bingo-status-mid {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 15px;
}

.bingo-status-mid.win {
  color: #ffd34d;
  text-shadow: 0 0 12px rgba(255, 211, 77, 0.7);
  animation: pulse 0.9s ease-in-out infinite;
}

.board {
  display: flex;
  justify-content: center;
}

.bingo-grid {
  display: grid;
  gap: 6px;
  width: min(92vw, 720px);
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: var(--bg);
  border-radius: 12px;
}

.bingo-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: var(--cell-bg);
  border: 2px solid var(--cell-border);
  border-radius: 8px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.bingo-cell-num {
  position: absolute;
  top: 3px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.bingo-cell-text {
  font-size: clamp(9px, 1.6vw, 13px);
  font-weight: 600;
  line-height: 1.15;
  word-break: break-word;
}

/* Team marks */
.bingo-cell.team-streamer { border-color: #e5484d; }
.bingo-cell.team-chat { border-color: #3b82f6; }
.bingo-cell.team-streamer.team-chat {
  border-image: linear-gradient(135deg, #e5484d 50%, #3b82f6 50%) 1;
}

.bingo-cell.team-streamer { box-shadow: inset 0 0 18px rgba(229, 72, 77, 0.25); }
.bingo-cell.team-chat { box-shadow: inset 0 0 18px rgba(59, 130, 246, 0.25); }
.bingo-cell.team-streamer.team-chat { box-shadow: inset 0 0 18px rgba(160, 90, 220, 0.35); }

.bingo-cell.team-streamer .bingo-cell-num,
.bingo-cell.team-chat .bingo-cell-num { color: rgba(255, 255, 255, 0.75); }

/* Winning line */
.bingo-cell.bingo-win {
  border-color: #ffd34d;
  background: rgba(255, 211, 77, 0.18);
  box-shadow: 0 0 22px rgba(255, 211, 77, 0.55);
  animation: winFlash 0.6s ease-in-out infinite alternate;
}

/* Focus star (streamer's private path marker) */
.bingo-cell-focus {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 14px;
  line-height: 1;
  color: #ffd34d;
  text-shadow: 0 0 8px rgba(255, 211, 77, 0.8);
}

/* Scroll counter (progress badge) */
.bingo-cell-counter {
  position: absolute;
  bottom: 4px;
  right: 6px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

/* Empty board placeholder */
.bingo-empty {
  padding: 24px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.connection-status {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.4s ease;
}

.connection-status.connecting { background: rgba(255, 165, 0, 0.25); color: #ffb84d; }
.connection-status.connected { background: rgba(46, 204, 113, 0.25); color: #6ee7a0; }
.connection-status.disconnected { background: rgba(229, 72, 77, 0.25); color: #ff8a8d; }
.connection-status.error { background: rgba(229, 72, 77, 0.35); color: #ffb0b3; }
.connection-status.testing { background: rgba(59, 130, 246, 0.25); color: #8ab4ff; }
.connection-status.auto-hide { opacity: 0; pointer-events: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes winFlash {
  from { box-shadow: 0 0 14px rgba(255, 211, 77, 0.4); }
  to { box-shadow: 0 0 28px rgba(255, 211, 77, 0.8); }
}
