@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Press+Start+2P&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.35);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

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

  --border-color: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(6, 182, 212, 0.4);

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

  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.brand-highlight {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.audio-toggle.muted {
  opacity: 0.5;
  border-color: var(--accent-rose);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 3rem 1rem 4rem;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

/* Chess Board & Piece Styling */
.chess-cell, .checkers-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chess-cell.cell-light, .checkers-cell.cell-light {
  background-color: #cbd5e1;
}

.chess-cell.cell-dark, .checkers-cell.cell-dark {
  background-color: #334155;
}

/* Square Last Move Lighting */
.last-move-from {
  background-color: rgba(234, 179, 8, 0.45) !important;
  box-shadow: inset 0 0 12px #eab308;
}

.last-move-to {
  background-color: rgba(6, 182, 212, 0.55) !important;
  box-shadow: inset 0 0 16px #06b6d4;
}

.chess-cell.selected, .checkers-cell.selected {
  background-color: rgba(168, 85, 247, 0.5) !important;
  box-shadow: inset 0 0 14px #a855f7;
}

.chess-cell.valid-target::after, .checkers-cell.valid-target::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.chess-piece {
  font-size: 2.5rem;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s ease;
}

.chess-piece:active {
  cursor: grabbing;
}

/* White Pieces: Pure Glowing White/Gold */
.chess-piece.white-piece, .white-symbol {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 15px #fef08a;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* Black Pieces: Cyber Dark Slate / Neon Pink Outline */
.chess-piece.black-piece, .black-symbol {
  color: #0f172a !important;
  text-shadow: 0 0 6px #ec4899, 0 0 12px #f43f5e;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.9));
}

/* Checkers Piece Styling */
.checkers-piece {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s ease;
}

.checkers-piece.piece-red {
  background: radial-gradient(circle at 35% 35%, #ef4444, #991b1b);
  border: 3px solid #fca5a5;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.5);
}

.checkers-piece.piece-black {
  background: radial-gradient(circle at 35% 35%, #334155, #0f172a);
  border: 3px solid #38bdf8;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4);
}

/* Flip Popup in Hill Climb */
.flip-popup {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(245, 158, 11, 0.95);
  color: #0f172a;
  font-weight: 900;
  font-size: 1.75rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
  pointer-events: none;
  z-index: 9999;
  animation: popupAnim 1.2s forwards;
}

@keyframes popupAnim {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
}

footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-top: auto;
}