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

:root {
  /* Warm, EldenBingo-inspired palette (dark sepia, not pure black/blue). */
  --bg: rgba(8, 8, 8, 0.55);
  --cell-bg: rgba(18, 20, 20, 0.92);  /* #121414 warm near-black */
  --grid: rgba(118, 110, 97, 0.42);    /* #766E61 warm brown-gray grid */
  --text: #e8e6e3;                      /* warm off-white */
  --team-0: #e5484d;                    /* streamer (overridden from config) */
  --team-1: #3b82f6;                    /* chat (overridden from config) */
}

* { 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: 3px;
  width: min(92vw, 720px);
  aspect-ratio: 1 / 1;
  padding: 3px;
  background: var(--grid);  /* warm grid lines show through the gaps */
  border-radius: 10px;
}

.bingo-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background-color: var(--cell-bg);
  border-radius: 4px;
  text-align: center;
  overflow: hidden;
  transition: background-color 0.15s ease, box-shadow 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 — solid fill like EldenBingo: the whole square is flooded with the
   team colour, not just outlined. A soft dark gradient gives the top-left a
   little depth, echoing EldenBingo's shaded-square look. */
.bingo-cell.team-streamer {
  background-color: var(--team-0);
  background-image: linear-gradient(150deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.08) 60%);
}
.bingo-cell.team-chat {
  background-color: var(--team-1);
  background-image: linear-gradient(150deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.08) 60%);
}
.bingo-cell.team-streamer.team-chat {
  background-color: transparent;
  background-image: linear-gradient(135deg, var(--team-0) 0%, var(--team-0) 47%, var(--team-1) 53%, var(--team-1) 100%);
}

.bingo-cell.team-streamer .bingo-cell-num,
.bingo-cell.team-chat .bingo-cell-num { color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

.bingo-cell.team-streamer .bingo-cell-text,
.bingo-cell.team-chat .bingo-cell-text {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Winning line — gold ring + glow, keeps the team fill underneath. */
.bingo-cell.bingo-win {
  box-shadow: 0 0 0 2px #ffd34d, 0 0 22px rgba(255, 211, 77, 0.6);
  animation: winFlash 0.6s ease-in-out infinite alternate;
  z-index: 1;
}

/* 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 0 2px #ffd34d, 0 0 10px rgba(255, 211, 77, 0.45); }
  to   { box-shadow: 0 0 0 2px #ffd34d, 0 0 26px rgba(255, 211, 77, 0.85); }
}
