/* ==========================================================================
   GOMZ — Premium Aesthetic Pass
   Glassmorphism, micro-animations, refined color hierarchy, responsive
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────
   EXTENDED TOKENS & VARIABLES
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --cb-glass-blur: blur(12px) saturate(1.20);
  --cb-glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --cb-glow-sm: 0 0 12px rgba(58, 255, 143, 0.20);
  --cb-glow-md: 0 0 24px rgba(58, 255, 143, 0.28);
  --cb-glow-lg: 0 0 40px rgba(58, 255, 143, 0.35);
  --cb-glow-accent: 0 0 32px rgba(255, 193, 7, 0.25);
}

/* ─────────────────────────────────────────────────────────────────────────
   TOPBAR PREMIUM
   ───────────────────────────────────────────────────────────────────────── */
.topbar {
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.65), rgba(26, 32, 41, 0.45));
  backdrop-filter: blur(12px) saturate(1.20);
  border-bottom: 1px solid var(--cb-border-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: var(--cb-radius-md) var(--cb-radius-md) 0 0;
  animation: topbarSlideIn var(--cb-duration-normal) var(--cb-easing-ease-out);
}

@keyframes topbarSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand h1 {
  background: linear-gradient(120deg, var(--cb-text-primary) 0%, var(--cb-primary-light) 60%, var(--cb-text-primary) 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShimmer 4s var(--cb-easing-in-out) infinite;
}

@keyframes titleShimmer {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO & MENU SCREEN
   ───────────────────────────────────────────────────────────────────────── */
.hero .logo {
  text-shadow:
    0 0 24px rgba(58, 255, 143, 0.3),
    0 0 48px rgba(58, 255, 143, 0.15),
    0 0 2px rgba(58, 255, 143, 0.5);
  animation: logoGlowPremium 3.2s var(--cb-easing-in-out) infinite;
}

@keyframes logoGlowPremium {
  0%, 100% {
    opacity: 1;
    filter:
      drop-shadow(0 0 12px rgba(58, 255, 143, 0.25))
      drop-shadow(0 0 24px rgba(58, 255, 143, 0.12))
      drop-shadow(0 0 40px rgba(58, 255, 143, 0.08));
    transform: scale(1);
  }
  50% {
    opacity: 0.98;
    filter:
      drop-shadow(0 0 18px rgba(58, 255, 143, 0.35))
      drop-shadow(0 0 36px rgba(58, 255, 143, 0.18))
      drop-shadow(0 0 54px rgba(58, 255, 143, 0.12));
    transform: scale(1.02);
  }
}

.mini-board {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
  animation: miniBoardPop var(--cb-duration-slow) var(--cb-easing-bounce) both;
}

@keyframes miniBoardPop {
  0% {
    transform: scale(0.6) rotateZ(-8deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.12) rotateZ(2deg);
  }
  100% {
    transform: scale(1) rotateZ(0deg);
    opacity: 1;
  }
}

.mini-board i {
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 0 8px rgba(58, 255, 143, 0.15);
  backdrop-filter: brightness(1.1);
  transition:
    transform var(--cb-duration-normal) var(--cb-easing-in-out),
    box-shadow var(--cb-duration-normal) var(--cb-easing-in-out),
    filter var(--cb-duration-normal) var(--cb-easing-in-out);
}

.mini-board i:hover {
  transform: scale(1.2) rotateZ(4deg);
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.6),
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(58, 255, 143, 0.25);
  filter: brightness(1.2);
}

/* ─────────────────────────────────────────────────────────────────────────
   MENU CARDS — GLASSMORPHISM PREMIUM
   ───────────────────────────────────────────────────────────────────────── */
.menu-card {
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.78), rgba(26, 32, 41, 0.60));
  backdrop-filter: var(--cb-glass-blur);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 1px rgba(58, 255, 143, 0.10);
  border: 1px solid var(--cb-border-light);
  transition:
    all var(--cb-duration-normal) var(--cb-easing-in-out),
    box-shadow var(--cb-duration-fast) var(--cb-easing-in-out);
  animation: cardGlideIn var(--cb-duration-normal) var(--cb-easing-ease-out) both;
  position: relative;
  overflow: hidden;
}

@keyframes cardGlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: none;
    backdrop-filter: var(--cb-glass-blur);
  }
}

.menu-card:nth-child(2) {
  animation-delay: var(--cb-duration-fast);
}

.menu-card:nth-child(3) {
  animation-delay: calc(var(--cb-duration-fast) * 2);
}

.menu-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(58, 255, 143, 0.08), transparent);
  opacity: 0;
  transition: opacity var(--cb-duration-normal) var(--cb-easing-in-out);
  pointer-events: none;
}

.menu-card:hover {
  border-color: var(--cb-border-strong);
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.90), rgba(26, 32, 41, 0.85));
  transform: translateY(-6px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 24px rgba(58, 255, 143, 0.25);
}

.menu-card:hover::before {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────────────
   DIFFICULTY CHIPS
   ───────────────────────────────────────────────────────────────────────── */
.diff-chip {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(6px);
  border: 2px solid var(--cb-border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}

.diff-chip:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: var(--cb-border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.diff-chip.on {
  background: linear-gradient(135deg, rgba(58, 255, 143, 0.28), rgba(58, 255, 143, 0.14));
  border-color: var(--cb-primary);
  box-shadow:
    0 0 0 4px rgba(58, 255, 143, 0.28),
    0 8px 24px rgba(58, 255, 143, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  color: var(--cb-primary-light);
}

.diff-chip:active {
  transform: scale(0.95);
}

/* ─────────────────────────────────────────────────────────────────────────
   PRIMARY BUTTONS
   ───────────────────────────────────────────────────────────────────────── */
.big-btn {
  background: linear-gradient(180deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
  box-shadow:
    0 12px 40px rgba(58, 255, 143, 0.35),
    0 0 2px rgba(58, 255, 143, 0.60),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--cb-duration-fast) var(--cb-easing-in-out),
    box-shadow var(--cb-duration-fast) var(--cb-easing-in-out),
    background var(--cb-duration-fast) var(--cb-easing-in-out);
  animation: buttonEnter var(--cb-duration-normal) var(--cb-easing-bounce);
}

@keyframes buttonEnter {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.big-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 60px rgba(58, 255, 143, 0.45),
    0 0 2px rgba(58, 255, 143, 0.90),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  background: linear-gradient(180deg, var(--cb-primary-light) 0%, var(--cb-primary) 100%);
}

.big-btn:active {
  transform: translateY(-1px);
  box-shadow:
    0 8px 16px rgba(58, 255, 143, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.big-btn.alt {
  background: linear-gradient(180deg, #5a8ef7 0%, #3d5fcf 100%);
  box-shadow:
    0 8px 24px rgba(90, 142, 247, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.big-btn.alt:hover {
  transform: translateY(-4px);
  box-shadow:
    0 16px 40px rgba(90, 142, 247, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────
   ICON BUTTONS
   ───────────────────────────────────────────────────────────────────────── */
.icon-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(6px);
  border: 1px solid var(--cb-border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}

.icon-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: var(--cb-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn.pri {
  background: linear-gradient(180deg, var(--cb-primary), var(--cb-primary-dark));
  border: 0;
  box-shadow:
    0 8px 20px rgba(58, 255, 143, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.icon-btn.pri:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(58, 255, 143, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ─────────────────────────────────────────────────────────────────────────
   GAME SCREEN
   ───────────────────────────────────────────────────────────────────────── */
#screen-game.show {
  animation: screenFadeInUp var(--cb-duration-normal) var(--cb-easing-ease-out);
}

@keyframes screenFadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   PLAYER PANELS
   ───────────────────────────────────────────────────────────────────────── */
.pl {
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.60), rgba(26, 32, 41, 0.40));
  backdrop-filter: blur(8px) saturate(1.10);
  border: 1px solid var(--cb-border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all var(--cb-duration-normal) var(--cb-easing-in-out);
  animation: playerPanelSlide var(--cb-duration-normal) var(--cb-easing-ease-out);
}

@keyframes playerPanelSlide {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pl:nth-child(2) {
  animation: playerPanelSlide var(--cb-duration-normal) var(--cb-easing-ease-out);
  animation-direction: reverse;
}

.pl.white {
  animation-direction: reverse;
}

.pl .disc {
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 0 8px rgba(58, 255, 143, 0.12);
  transition:
    transform var(--cb-duration-normal) var(--cb-easing-in-out),
    filter var(--cb-duration-normal) var(--cb-easing-in-out),
    box-shadow var(--cb-duration-normal) var(--cb-easing-in-out);
}

.pl.active {
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.80), rgba(26, 32, 41, 0.65));
  border-color: var(--cb-primary);
  box-shadow:
    0 0 0 3px rgba(58, 255, 143, 0.40),
    0 12px 40px rgba(58, 255, 143, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: scale(1.02);
}

.pl.active .disc {
  transform: scale(1.15);
  filter: drop-shadow(0 0 12px rgba(58, 255, 143, 0.4));
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(58, 255, 143, 0.35),
    0 0 12px rgba(58, 255, 143, 0.25);
}

/* ─────────────────────────────────────────────────────────────────────────
   BOARD & CELLS
   ───────────────────────────────────────────────────────────────────────── */
#board {
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.60),
    0 0 1px rgba(58, 255, 143, 0.08),
    inset 0 2px 8px rgba(255, 255, 255, 0.15),
    inset 0 0 0 4px rgba(138, 95, 42, 0.8);
  animation: boardSlideDown var(--cb-duration-slow) var(--cb-easing-bounce) both;
  transition:
    opacity var(--cb-duration-normal),
    box-shadow var(--cb-duration-normal) var(--cb-easing-in-out),
    transform var(--cb-duration-normal) var(--cb-easing-in-out);
}

@keyframes boardSlideDown {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-12px);
  }
  70% {
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cell {
  transition:
    background-color var(--cb-duration-fast) var(--cb-easing-in-out),
    box-shadow var(--cb-duration-fast) var(--cb-easing-in-out);
}

.cell:hover {
  background-color: rgba(58, 255, 143, 0.10);
  box-shadow: inset 0 0 8px rgba(58, 255, 143, 0.18);
}

.cell .stone {
  transition:
    transform var(--cb-duration-normal) var(--cb-easing-bounce),
    opacity var(--cb-duration-fast) ease,
    box-shadow var(--cb-duration-normal) var(--cb-easing-in-out),
    filter var(--cb-duration-normal) var(--cb-easing-in-out);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.cell.black .stone {
  box-shadow:
    inset 0 -5px 10px rgba(0, 0, 0, 0.95),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    0 0 8px rgba(0, 0, 0, 0.3);
}

.cell.white .stone {
  box-shadow:
    inset 0 -5px 10px rgba(100, 110, 130, 0.8),
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    0 0 8px rgba(255, 255, 255, 0.15);
}

.cell.drop .stone {
  animation: stoneDropPremium var(--cb-duration-slow) var(--cb-easing-bounce) both;
}

@keyframes stoneDropPremium {
  0% {
    transform: scale(0) translateY(-24px);
    opacity: 0;
  }
  30% {
    transform: scale(1.28) translateY(0);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  }
}

/* Last move indicator */
.cell.last::after {
  animation: lastMovePulse 1.6s var(--cb-easing-ease-out) infinite;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 1),
    0 0 24px 8px rgba(120, 200, 255, 0.85),
    0 0 40px 12px rgba(120, 200, 255, 0.35);
}

@keyframes lastMovePulse {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 1),
      0 0 24px 8px rgba(120, 200, 255, 0.85),
      0 0 40px 12px rgba(120, 200, 255, 0.35);
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 1),
      0 0 32px 10px rgba(120, 200, 255, 1),
      0 0 48px 14px rgba(120, 200, 255, 0.5);
    transform: scale(1.08);
  }
}

/* Win indicators */
.cell.win .stone {
  animation: winStoneShine var(--cb-duration-slow) ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 193, 7, 0.6));
}

.cell.win::after {
  animation: winRingPulse var(--cb-duration-slow) ease-in-out infinite;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 1),
    0 0 32px 10px rgba(255, 193, 7, 1),
    0 0 48px 14px rgba(255, 193, 7, 0.6);
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.7));
}

@keyframes winStoneShine {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.92);
  }
}

@keyframes winRingPulse {
  0%, 100% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 1),
      0 0 32px 10px rgba(255, 193, 7, 1),
      0 0 48px 14px rgba(255, 193, 7, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(255, 255, 255, 1),
      0 0 40px 14px rgba(255, 193, 7, 1),
      0 0 56px 18px rgba(255, 193, 7, 0.7);
    transform: scale(1.1);
  }
}

/* Hint cells */
.cell.hint::after {
  animation: hintPulse var(--cb-duration-slow) ease-in-out infinite;
  border: 2px solid rgba(58, 255, 143, 0.7);
  box-shadow:
    0 0 0 2px rgba(58, 255, 143, 0.5),
    0 0 16px 3px rgba(58, 255, 143, 0.25);
}

@keyframes hintPulse {
  0%, 100% {
    opacity: 0.6;
    box-shadow:
      0 0 0 2px rgba(58, 255, 143, 0.5),
      0 0 16px 3px rgba(58, 255, 143, 0.25);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 0 3px rgba(58, 255, 143, 0.6),
      0 0 20px 5px rgba(58, 255, 143, 0.4);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   GAME ACTIONS
   ───────────────────────────────────────────────────────────────────────── */
.game-actions button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(6px);
  border: 1px solid var(--cb-border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}

.game-actions button:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: var(--cb-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.game-actions button.pri {
  background: linear-gradient(180deg, var(--cb-primary), var(--cb-primary-dark));
  border: 0;
  box-shadow:
    0 8px 20px rgba(58, 255, 143, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.game-actions button.pri:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(58, 255, 143, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ─────────────────────────────────────────────────────────────────────────
   OVERLAYS & DIALOGS — PREMIUM GLASS
   ───────────────────────────────────────────────────────────────────────── */
.ov {
  background: rgba(6, 9, 14, 0.75);
  backdrop-filter: blur(4px);
  animation: overlayFadeIn var(--cb-duration-normal) var(--cb-easing-ease-out);
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

.dialog {
  background: linear-gradient(135deg, rgba(21, 29, 42, 0.88), rgba(26, 32, 41, 0.80));
  backdrop-filter: var(--cb-glass-blur);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 1px rgba(58, 255, 143, 0.10);
  border: 1px solid var(--cb-border-light);
  animation: dialogPopUp var(--cb-duration-normal) var(--cb-easing-bounce) both;
}

@keyframes dialogPopUp {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    backdrop-filter: var(--cb-glass-blur);
  }
}

.dialog h2 {
  background: linear-gradient(120deg, var(--cb-text-primary), var(--cb-primary-light) 50%, var(--cb-text-primary));
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dialog input {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--cb-border-light);
  backdrop-filter: blur(4px);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}

.dialog input:focus {
  border-color: var(--cb-primary);
  background: rgba(0, 0, 0, 0.5);
  box-shadow:
    0 0 0 4px rgba(58, 255, 143, 0.2),
    inset 0 1px 2px rgba(58, 255, 143, 0.1);
}

.dialog .btn {
  background: linear-gradient(180deg, var(--cb-primary), var(--cb-primary-dark));
  box-shadow:
    0 8px 20px rgba(58, 255, 143, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}

.dialog .btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(58, 255, 143, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dialog .btn.alt {
  background: linear-gradient(180deg, #5a8ef7, #3d5fcf);
  box-shadow: 0 8px 20px rgba(90, 142, 247, 0.35);
}

.dialog .btn.alt:hover {
  box-shadow: 0 12px 32px rgba(90, 142, 247, 0.45);
}

.dialog .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dialog .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ─────────────────────────────────────────────────────────────────────────
   EMOJI & VICTORY
   ───────────────────────────────────────────────────────────────────────── */
.over-emoji {
  animation: emojiDance var(--cb-duration-slow) var(--cb-easing-bounce) both;
  text-shadow: 0 0 16px rgba(255, 193, 7, 0.4);
}

@keyframes emojiDance {
  0% {
    transform: scale(0) rotateZ(-30deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.2) rotateZ(8deg);
  }
  100% {
    transform: scale(1) rotateZ(0deg);
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────────────────── */
#toast {
  background: linear-gradient(135deg, rgba(20, 26, 35, 0.95), rgba(26, 32, 41, 0.9));
  backdrop-filter: blur(8px);
  border: 1px solid var(--cb-border-light);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#toast.show {
  animation: toastSlideUp var(--cb-duration-normal) var(--cb-easing-ease-out);
}

@keyframes toastSlideUp {
  from {
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   ONLINE BANNER
   ───────────────────────────────────────────────────────────────────────── */
#online-banner.show {
  animation: bannerSlide var(--cb-duration-normal) var(--cb-easing-bounce);
  background: linear-gradient(135deg, rgba(75, 140, 240, 0.20), rgba(75, 140, 240, 0.12));
  backdrop-filter: blur(10px) saturate(1.15);
  box-shadow:
    0 12px 40px rgba(75, 140, 240, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(75, 140, 240, 0.65);
}

@keyframes bannerSlide {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.05);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#online-banner .code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(58, 255, 143, 0.3);
  animation: codePulse 2s ease-in-out infinite;
}

@keyframes codePulse {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 12px rgba(58, 255, 143, 0.3);
  }
  50% {
    opacity: 0.85;
    text-shadow: 0 0 20px rgba(58, 255, 143, 0.5);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   LIGHT MODE ENHANCEMENTS
   ───────────────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  .topbar {
    background: linear-gradient(135deg, rgba(240, 244, 249, 0.8), rgba(232, 236, 242, 0.7));
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  .menu-card {
    background: linear-gradient(135deg, rgba(232, 236, 242, 0.8), rgba(240, 244, 249, 0.7));
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .menu-card:hover {
    background: linear-gradient(135deg, rgba(224, 228, 236, 0.9), rgba(232, 236, 242, 0.85));
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .pl {
    background: linear-gradient(135deg, rgba(232, 236, 242, 0.6), rgba(240, 244, 249, 0.5));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .pl.active {
    background: linear-gradient(135deg, rgba(224, 228, 236, 0.8), rgba(232, 236, 242, 0.7));
    box-shadow:
      0 0 0 2px rgba(58, 255, 143, 0.4),
      0 8px 20px rgba(58, 255, 143, 0.15);
  }

  .dialog {
    background: linear-gradient(135deg, rgba(240, 244, 249, 0.9), rgba(232, 236, 242, 0.85));
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .cell.last::after {
    box-shadow:
      0 0 0 3px rgba(0, 0, 0, 0.1),
      0 0 16px 4px rgba(75, 140, 240, 0.4);
  }

  .cell.win::after {
    box-shadow:
      0 0 0 3px rgba(0, 0, 0, 0.1),
      0 0 20px 6px rgba(255, 150, 50, 0.5);
  }

  .cell.hint::after {
    border-color: rgba(58, 255, 143, 0.5);
    box-shadow:
      0 0 0 1px rgba(58, 255, 143, 0.3),
      0 0 12px 2px rgba(58, 255, 143, 0.15);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cell.drop .stone {
    animation: none !important;
  }
  .cell.win .stone,
  .cell.win::after,
  .cell.last::after,
  .cell.hint::after {
    animation: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE: MOBILE-FIRST
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .topbar {
    background: linear-gradient(135deg, rgba(20, 26, 35, 0.6), rgba(26, 32, 41, 0.4));
    border-radius: 0;
  }

  .menu-card {
    backdrop-filter: blur(8px);
  }

  .dialog {
    width: min(92vw, 400px);
    backdrop-filter: blur(10px);
  }

  .board-wrap {
    max-width: 100%;
  }

  #board {
    box-shadow:
      0 16px 40px rgba(0, 0, 0, 0.3),
      inset 0 0 0 3px rgba(138, 95, 42, 0.7);
  }

  .players {
    gap: var(--cb-gap-sm);
  }

  .pl {
    padding: var(--cb-space-5);
  }

  .pl .nm {
    font-size: 0.9rem;
  }

  .game-actions {
    flex-wrap: wrap;
    gap: var(--cb-gap-sm);
  }

  .game-actions button {
    flex: 1;
    min-width: auto;
  }
}

@media (max-width: 360px) {
  .brand h1 {
    font-size: 1rem;
  }

  .dialog {
    width: 90vw;
    padding: var(--cb-space-6);
  }

  .dialog h2 {
    font-size: 1.2rem;
  }

  .pl .nm {
    font-size: 0.85rem;
  }

  .game-actions button {
    font-size: 0.75rem;
    padding: var(--cb-space-4) var(--cb-space-5);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   RTL SUPPORT
   ───────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .brand,
[dir="rtl"] .topbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .players {
  direction: rtl;
}

[dir="rtl"] .pl {
  flex-direction: row-reverse;
}

[dir="rtl"] .game-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .dialog .field {
  flex-direction: row-reverse;
}
