/* ==========================================================================
   BINGO ONLINE 5X5 - CYBER NEON GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-color: #080c18;
  --panel-bg: rgba(16, 24, 44, 0.85);
  --panel-card: rgba(22, 33, 62, 0.65);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.35);

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.45);
  --accent-red: #ef4444;
  --accent-blue: #38bdf8;
  --accent-green: #10b981;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-logo: 'Bungee', cursive, sans-serif;
  --font-hand: 'Patrick Hand', cursive, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 24px rgba(99, 102, 241, 0.15);
  --shadow-glow: 0 0 18px rgba(56, 189, 248, 0.3);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px, 28px 28px;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.8rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left));
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

/* Ambient glow orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
  top: -80px;
  left: -80px;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.glow-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25), transparent 70%);
  bottom: -90px;
  right: -90px;
  animation: floatOrb 15s ease-in-out infinite alternate-reverse;
}

.glow-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.22), transparent 70%);
  top: 45%;
  left: 65%;
  animation: floatOrb 10s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(30px) scale(1.1); }
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Floating emojis container */
.floating-emojis-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  font-size: 2.2rem;
  bottom: 20px;
  animation: flyEmojiUp 2.8s ease-out forwards;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes flyEmojiUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translateY(-40px) scale(1.2) rotate(10deg);
  }
  80% {
    opacity: 0.9;
    transform: translateY(-380px) scale(1.1) rotate(-15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-480px) scale(0.7) rotate(20deg);
  }
}

/* Container */
.game-container {
  width: 100%;
  max-width: 580px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10;
  margin: auto 0;
}

/* ================= PORTAL NAV ================= */
.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.28rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }

.portal-tab {
  flex: 1;
  min-width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.portal-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.portal-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.active-dot {
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
}

/* ================= HEADER ================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0.2rem;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.badge {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.6px;
}

.badge-sub {
  font-size: 0.62rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.main-title {
  font-family: var(--font-logo);
  font-size: 1.35rem;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 70%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #38bdf8;
}

/* ================= VIEWS SWITCHING ================= */
.game-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.game-view.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= VIEW 1: LOBBY ================= */
.lobby-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hero-desc {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.hero-desc h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.2rem;
}

.hero-desc p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nickname-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nickname-box label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
}

.input-inline {
  display: flex;
  gap: 0.4rem;
}

.input-inline input,
.form-group input,
.form-group select {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  transition: var(--transition);
}

.input-inline input:focus,
.form-group input:focus,
.form-group select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.btn-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-mini:hover { background: rgba(255, 255, 255, 0.16); }

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.action-box {
  background: var(--panel-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
}

.create-box {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(99, 102, 241, 0.05));
}

.join-box {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.04));
}

.box-tag {
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}
.create-box .box-tag { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.join-box .box-tag { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.box-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.box-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.box-title-row h3 { font-size: 0.95rem; font-weight: 800; color: #fff; }
.box-title-row p { font-size: 0.72rem; color: var(--text-muted); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.custom-select {
  cursor: pointer;
}
.custom-select option {
  background: #111827;
  color: #fff;
}

.btn-action-primary {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: var(--transition);
}
.btn-action-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-action-secondary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-action-secondary:hover {
  filter: brightness(1.1);
}

.quick-rooms-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.quick-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip-room {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.chip-room:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
}

/* ================= VIEW 2: ROOM LOUNGE ================= */
.lounge-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lounge-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.btn-back-tool {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-back-tool:hover { background: rgba(239, 68, 68, 0.25); }

.lounge-room-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.lounge-room-pill .lbl { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.lounge-room-pill .room-val {
  font-size: 0.95rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.8px;
}

.btn-share-tool {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-share-tool:hover { background: rgba(56, 189, 248, 0.28); }

.lounge-body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.lounge-players-panel {
  background: var(--panel-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-row h3 {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.room-state-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.players-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.player-card-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  text-align: center;
}

.player-card-item.is-me {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(0, 0, 0, 0.3));
}

.player-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.player-card-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-host-crown {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.75rem;
}

.player-ready-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}
.player-ready-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.player-ready-badge.waiting {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.lounge-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.btn-ready-toggle {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}
.btn-ready-toggle.is-ready {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-host-start {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: var(--transition);
}
.btn-host-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

/* Lounge Board Setup Preview */
.lounge-board-setup {
  background: var(--panel-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setup-title h4 { font-size: 0.82rem; font-weight: 800; color: #38bdf8; }
.setup-title p { font-size: 0.68rem; color: var(--text-muted); }

.setup-quick-tools {
  display: flex;
  gap: 0.35rem;
}

.btn-setup-act {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-setup-act:hover { background: rgba(255, 255, 255, 0.16); }

.mini-board-preview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #cbd5e1;
}

.setup-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ================= VIEW 3: BATTLE ARENA ================= */
.battle-turn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.turn-pulse-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 1.4s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

.turn-info {
  display: flex;
  flex-direction: column;
}

.turn-sub-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.turn-current-player {
  font-size: 0.88rem;
  font-weight: 900;
  color: #38bdf8;
}

.turn-current-player.is-me-turn {
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.turn-timer-box {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
}

.timer-sec {
  font-size: 0.82rem;
  font-weight: 900;
  color: #f87171;
}

.called-count-box {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.called-val { color: #fff; font-weight: 800; }

/* Radar Đối Thủ */
.opponents-radar-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.opponents-radar-bar::-webkit-scrollbar { display: none; }

.radar-title {
  font-size: 0.65rem;
  font-weight: 900;
  color: #a855f7;
  white-space: nowrap;
}

.opponents-chips-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.opponent-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.18rem 0.45rem;
  white-space: nowrap;
}

.opponent-chip.is-active-turn {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.opp-chip-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: #e2e8f0;
  max-width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opp-chip-lines {
  font-size: 0.64rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 0.08rem 0.32rem;
  border-radius: var(--radius-full);
}

/* Bingo Progress Ribbon */
.bingo-progress-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(24, 24, 37, 0.9), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
}

.bingo-ribbon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ribbon-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #c084fc;
  letter-spacing: 0.5px;
}

.bingo-badge-count {
  font-size: 0.74rem;
  font-weight: 900;
  color: #f59e0b;
}

.bingo-letters-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.bingo-letter-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.char-letter {
  font-family: var(--font-logo);
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1;
}

.char-sub {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.char-check {
  display: none;
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.65rem;
  color: #10b981;
}

.bingo-letter-box.unlocked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(236, 72, 153, 0.3));
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
  transform: translateY(-2px);
}

.bingo-letter-box.unlocked .char-letter {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 20px #ef4444;
  animation: letterPulse 1s ease-out;
}

.bingo-letter-box.unlocked .char-sub {
  color: #fca5a5;
}

.bingo-letter-box.unlocked .char-check {
  display: block;
}

@keyframes letterPulse {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ================= BATTLE BOARD ================= */
.battle-board-section {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.board-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  background: rgba(10, 15, 30, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.grid-5x5-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
  width: 100%;
  height: 100%;
}

.battle-cell {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 900;
  color: #f8fafc;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.battle-cell:hover:not(.marked) {
  border-color: #38bdf8;
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.battle-cell:active {
  transform: scale(0.95);
}

.battle-cell.marked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.45));
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: inset 0 0 12px rgba(239, 68, 68, 0.3);
}

.battle-cell.marked::after {
  content: '✕';
  position: absolute;
  font-size: 1.8rem;
  font-weight: 900;
  color: #ef4444;
  opacity: 0.85;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
  pointer-events: none;
  animation: strikeMark 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.battle-cell.just-called {
  animation: justCalledFlash 1.2s ease-out;
}

@keyframes justCalledFlash {
  0% { transform: scale(1.2); box-shadow: 0 0 25px #f59e0b; border-color: #f59e0b; background: rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1); }
}

@keyframes strikeMark {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  70% { transform: scale(1.25) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
}

/* SVG Line Overlay */
.lines-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.strike-svg-line {
  stroke: #ef4444;
  stroke-width: 6px;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px #ef4444) drop-shadow(0 0 14px rgba(239, 68, 68, 0.8));
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawSvgLine 0.45s ease-out forwards;
}

@keyframes drawSvgLine {
  to { stroke-dashoffset: 0; }
}

/* ================= BOTTOM PANEL: HISTORY & CHAT ================= */
.battle-bottom-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.history-strip::-webkit-scrollbar { display: none; }

.history-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.history-scroll {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.history-pill {
  font-size: 0.72rem;
  font-weight: 900;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
  animation: popPill 0.3s ease-out;
}

@keyframes popPill {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.empty-history-tip {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-style: italic;
}

.interactive-social-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quick-emojis {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}

.btn-emoji {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s;
}
.btn-emoji:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.1);
}

.quick-chat-row {
  display: flex;
  gap: 0.35rem;
}

.quick-chat-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  outline: none;
}
.quick-chat-row input:focus { border-color: #38bdf8; }

.btn-send-chat {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-send-chat:hover { filter: brightness(1.1); }

/* ================= NUMBER CALL POPUP ================= */
.call-announcement-popup {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  animation: callPopupAnim 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.call-announcement-popup.hidden {
  display: none !important;
}

.call-popup-card {
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.6rem;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.6), 0 10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  backdrop-filter: blur(15px);
}

.caller-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f59e0b;
}

.call-number-circle {
  font-family: var(--font-logo);
  font-size: 2.8rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 18px #f59e0b, 0 0 30px rgba(245, 158, 11, 0.8);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35), transparent 70%);
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #f59e0b;
}

.call-tip-text {
  font-size: 0.68rem;
  color: #94a3b8;
}

@keyframes callPopupAnim {
  0% { opacity: 0; transform: translateX(-50%) scale(0.4) translateY(30px); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.05) translateY(0); }
  22% { transform: translateX(-50%) scale(1) translateY(0); }
  80% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(-40px); }
}

/* ================= MODALS ================= */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 1rem;
  animation: modalFadeIn 0.25s ease-out;
}

.custom-modal.hidden {
  display: none !important;
}

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

.modal-card {
  background: var(--panel-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close-btn:hover { color: #fff; }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.fill-instruction {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.next-num-tag {
  font-size: 1rem;
  color: #38bdf8;
  padding: 0.1rem 0.4rem;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 4px;
}

.modal-grid {
  aspect-ratio: 1;
  max-width: 320px;
  margin: 0 auto;
}

.modal-grid .battle-cell {
  font-size: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-sub-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-sub-action:hover { background: rgba(255, 255, 255, 0.15); }

.btn-main-action {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-main-action:hover { filter: brightness(1.1); }

/* Victory Card */
.victory-card {
  text-align: center;
  align-items: center;
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(24, 24, 37, 0.95), rgba(15, 23, 42, 0.98));
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.3), var(--shadow-lg);
}

.trophy-icon {
  font-size: 3.2rem;
  animation: trophyBounce 1.5s infinite alternate ease-in-out;
}

@keyframes trophyBounce {
  0% { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-8px) rotate(5deg); }
}

.victory-title {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.victory-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.victory-stats-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.victory-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.victory-player-row:last-child { border-bottom: none; }

.victory-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}
.victory-actions button { flex: 1; }

/* Responsive adjustments */
@media (max-width: 480px) {
  body { padding: 0.4rem; }
  .game-container { padding: 0.6rem; border-radius: var(--radius-md); }
  .main-title { font-size: 1.15rem; }
  .battle-cell { font-size: 1.15rem; }
  .char-letter { font-size: 1rem; }
  .action-grid { grid-template-columns: 1fr; }
}
