/* =========================================
   Bulls & Cows - Modern Glassmorphism Theme
   ========================================= */

:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #090d16 100%);
  --glass-bg: rgba(30, 41, 59, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-inner-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 16px 36px 0 rgba(0, 0, 0, 0.45);
  
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-accent: #38bdf8;
  
  --bull-color: #10b981;
  --bull-glow: rgba(16, 185, 129, 0.4);
  --bull-bg: rgba(16, 185, 129, 0.15);
  
  --cow-color: #f59e0b;
  --cow-glow: rgba(245, 158, 11, 0.4);
  --cow-bg: rgba(245, 158, 11, 0.15);

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

  --danger-color: #ef4444;
  --success-color: #10b981;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
}

/* Background animated glow orbs */
.bg-glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

.bg-glow-orb-1 {
  width: 380px;
  height: 380px;
  background: #4338ca;
  top: -80px;
  left: -80px;
}

.bg-glow-orb-2 {
  width: 420px;
  height: 420px;
  background: #0ea5e9;
  top: 40%;
  right: -100px;
}

.bg-glow-orb-3 {
  width: 320px;
  height: 320px;
  background: #8b5cf6;
  bottom: -60px;
  left: 20%;
}

/* Confetti Canvas */
.confetti-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Container */
.app-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  min-height: 100vh;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
}

/* Glass Card */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.brand-mascots {
  display: flex;
  align-items: center;
  position: relative;
}

.brand-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.brand-icon.cow {
  margin-left: -14px;
}

.brand-title h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a7f3d0 0%, #38bdf8 50%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-title span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-inner-border);
  color: var(--text-main);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* Screens Management */
.screen {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.screen.active {
  display: block;
}

/* Main Menu */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.menu-card {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.menu-card-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

.menu-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.menu-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
  flex-grow: 1;
}

.menu-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* Game Settings Bar */
.game-options-panel {
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--glass-inner-border);
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Action Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

/* Game Area Layout */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 860px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

/* Status & Turn Bar */
.turn-status-card {
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid var(--color-accent);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.player-info h4 {
  font-size: 1.05rem;
  color: var(--text-main);
}

.player-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.game-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-inner-border);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fde047;
}

/* Input Section */
.input-section {
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.input-slots-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 24px;
}

.digit-slot {
  width: 56px;
  height: 68px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.digit-slot.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  transform: scale(1.05);
}

.digit-slot.filled {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--color-primary);
}

/* Virtual Number Pad (for mobile & mouse click) */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 0 auto 18px;
}

.numpad-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-inner-border);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 12px 0;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.numpad-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.numpad-btn:active {
  transform: translateY(1px);
}

.numpad-btn.btn-action {
  font-size: 1rem;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.numpad-btn.btn-action:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* History Log Card */
.history-card {
  padding: 20px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-inner-border);
}

.history-list {
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.history-item.ai-turn {
  background: rgba(30, 27, 75, 0.5);
  border-color: rgba(99, 102, 241, 0.3);
}

.history-turn-num {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 700;
  width: 24px;
}

.history-guess {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #ffffff;
}

.history-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.score-badge.bull {
  background: var(--bull-bg);
  color: var(--bull-color);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.score-badge.cow {
  background: var(--cow-bg);
  color: var(--cow-color);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.score-badge.none {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

/* Sidebar (Scratchpad + Stats) */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Scratchpad Styles */
.scratchpad-card {
  padding: 18px;
}

.scratch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.scratch-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.scratch-reset-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.scratch-reset-btn:hover {
  color: var(--color-accent);
}

.scratch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.scratch-digit {
  height: 48px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.scratch-digit:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.scratch-digit .scratch-badge {
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

/* Scratchpad States */
.scratch-digit.excluded {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  text-decoration: line-through;
}

.scratch-digit.maybe {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.scratch-digit.included {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-main);
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* LAN Lobby Card */
.lan-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-code-wrapper {
  margin: 12px 0;
}

.lan-url-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-inner-border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 1rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Quick Emoji Reactions */
.reaction-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.reaction-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-full);
  font-size: 1.3rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.reaction-btn:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.2);
}

/* Floating Reaction Toast */
.floating-reaction {
  position: fixed;
  font-size: 3rem;
  pointer-events: none;
  animation: floatUpFade 2s ease forwards;
  z-index: 10000;
}

/* Custom Text Inputs */
.custom-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1rem;
  color: #ffffff;
  outline: none;
  margin-bottom: 14px;
}

.custom-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Rules / Instructions in Modal */
.rules-content {
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

.rules-content h4 {
  color: var(--text-main);
  margin: 14px 0 6px;
}

.rules-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.rules-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

/* =========================================
   Bull Position Template Styles (Compact)
   ========================================= */
.bull-template-card {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(6, 78, 59, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
}

.bull-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bull-template-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.bull-slots-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.bull-slot {
  flex: 1;
  max-width: 48px;
  height: 44px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px dashed rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.bull-slot:hover {
  border-color: rgba(16, 185, 129, 0.8);
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.bull-slot.selecting {
  border-color: #38bdf8;
  border-style: solid;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.bull-slot.has-val {
  border-style: solid;
  border-color: var(--bull-color);
  background: rgba(16, 185, 129, 0.2);
}

.bull-pos-label {
  font-size: 0.58rem;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1;
}

.bull-val-display {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.bull-slot.has-val .bull-val-display {
  color: #34d399;
}

.bull-slot-clear {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.65rem;
  color: #f87171;
  cursor: pointer;
  line-height: 1;
}

.bull-slot-clear:hover {
  transform: scale(1.3);
}

.bull-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.15s ease;
}

.bull-picker-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-inner-border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s ease;
}

.bull-picker-btn:hover {
  background: var(--bull-color);
  color: #ffffff;
}

.bull-picker-btn.selected {
  background: var(--bull-color);
  color: #ffffff;
  box-shadow: 0 0 8px var(--bull-glow);
}

.bull-picker-btn.used {
  opacity: 0.35;
  text-decoration: line-through;
}

/* =========================================
   Scratchpad Styles (Compact)
   ========================================= */
.scratchpad-card {
  padding: 10px 12px;
  margin-bottom: 10px;
}

.scratch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.scratch-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.scratch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.scratch-digit {
  height: 34px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.scratch-digit:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.scratch-digit .scratch-badge {
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

/* =========================================
   Split Screen 2-Player Arena Styles
   ========================================= */
.split-screen-header {
  padding: 12px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.split-screen-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .split-screen-container {
    grid-template-columns: 1fr;
  }
}

.split-column {
  padding: 16px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.split-column.active-turn {
  border-color: var(--color-accent);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.3);
}

/* Disabled Overlay for Inactive Player */
.column-disabled-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.split-column.disabled .column-disabled-overlay {
  opacity: 1;
  pointer-events: auto;
}

.overlay-msg {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--glass-border);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: pulse 2s infinite;
}

/* Split Player Header */
.split-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-inner-border);
  flex-wrap: wrap;
  gap: 8px;
}

.split-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.split-turn-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-weight: 600;
}

.split-column.active-turn .split-turn-badge {
  background: var(--color-primary);
  color: #ffffff;
  animation: turnPulse 1.5s infinite;
}

/* Secret Box with Eye Toggle */
.secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-inner-border);
}

.secret-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.secret-value {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #38bdf8;
}

.secret-value.masked {
  color: var(--text-muted);
  letter-spacing: 4px;
}

.btn-secret-eye {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 3px 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secret-eye:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* Split Input Panel */
.split-input-panel {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
}

/* Expand history containers to show more turns */
.split-history-panel {
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.split-history-panel .history-list {
  max-height: 420px;
}

.history-card {
  padding: 18px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

/* =========================================
   Player Leaderboard / Stats Table Styles
   ========================================= */
.stats-table-wrapper {
  max-height: 320px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-inner-border);
  margin-bottom: 12px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.stats-table th {
  background: rgba(15, 23, 42, 0.85);
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--glass-border);
}

.stats-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.stats-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.stats-player-cell {
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-badge-win {
  color: #34d399;
  font-weight: 700;
}

.stats-badge-loss {
  color: #f87171;
  font-weight: 700;
}

.stats-badge-best {
  color: #fbbf24;
  font-weight: 800;
}

.stats-empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* =========================================
   LAN Multiplayer Dual History & Reactions
   ========================================= */
.lan-dual-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 680px) {
  .lan-dual-history-grid {
    grid-template-columns: 1fr;
  }
}

.lan-history-card {
  padding: 14px;
  max-height: 460px;
  display: flex;
  flex-direction: column;
}

.lan-history-card .history-list {
  max-height: 380px;
}

/* Expandable 30-Emoji Reaction System */
.btn-toggle-emojis {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-inner-border);
  color: var(--color-accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-emojis:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

.reaction-grid-full {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-height: 240px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.2s ease;
}

.reaction-grid-full.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.reaction-grid-full .reaction-btn {
  padding: 4px 6px;
  font-size: 1.15rem;
}

/* =========================================
   Player Ranks & Titles System
   ========================================= */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.badge-pill {
  padding: 3px 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

/* =========================================
   Lobby Room Browser
   ========================================= */
.rooms-browser-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px 4px;
}

.room-card-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-inner-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.room-card-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.room-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-code-title {
  font-size: 1rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
}

.room-host-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-main);
}

.room-time-meta {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.room-join-btn {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.room-join-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.rooms-empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* =========================================
   PWA Installation Guide Modal
   ========================================= */
.pwa-guide-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

.pwa-tab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-inner-border);
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--color-accent);
  color: #ffffff;
}

.pwa-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.pwa-steps li {
  line-height: 1.45;
}

.pwa-step-badge {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.82rem;
}




