/* ============================================
   Modern Tic-Tac-Toe - Enhanced UI/UX
   ============================================ */

:root {
  /* Dark Theme (Default) */
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-gradient-start: #121212;
  --bg-gradient-end: #2d2d2d;
  
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  
  --accent-primary: #ff6b6b;
  --accent-secondary: #4ecdc4;
  --accent-tertiary: #ffd166;
  --accent-success: #06d6a0;
  
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #888888;
  
  --x-color: #ff6b6b;
  --o-color: #4ecdc4;
  --draw-color: #ffd166;
  
  /* Shape colors for background animation */
  --shape-opacity: 0.15;
  
  /* Spacing & Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --max-width: 900px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Light Theme */
body.light-theme {
  --bg-primary: #f8f9fa;
  --bg-secondary: #e9ecef;
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #f8f9fa;
  
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(255, 107, 107, 0.2);
  
  --accent-primary: #ff6b6b;
  --accent-secondary: #4ecdc4;
  --accent-tertiary: #ffd166;
  --accent-success: #06d6a0;
  
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  
  --x-color: #ff6b6b;
  --o-color: #4ecdc4;
  --draw-color: #ffd166;
  
  --shape-opacity: 0.08;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 107, 107, 0.25);
  --glass-shadow: 0 8px 32px 0 rgba(255, 107, 107, 0.1);
}

/* ============================================
   Base Styles
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* ============================================
   Animated Background
   ============================================ */

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--shape-opacity);
  animation: float 20s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--accent-tertiary), var(--accent-secondary));
  bottom: -150px;
  right: -150px;
  animation-delay: 7s;
}

.shape-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 50px) scale(0.9);
  }
}

/* ============================================
   Top Navigation
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.theme-toggle i {
  position: absolute;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.sun-icon {
  color: #fbbf24;
  transform: rotate(0deg) scale(0);
  opacity: 0;
}

.moon-icon {
  color: #60a5fa;
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* Light theme icon states */
body.light-theme .sun-icon {
  transform: rotate(180deg) scale(1);
  opacity: 1;
}

body.light-theme .moon-icon {
  transform: rotate(180deg) scale(0);
  opacity: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  transition: left 0.3s ease;
}

.nav-link:hover::before {
  left: 0;
}

.nav-link i {
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.nav-link span {
  position: relative;
  z-index: 1;
}

.nav-link:hover i {
  transform: scale(1.1) rotate(-5deg);
}

/* GitHub Nav Link */
.nav-link.github {
  background: rgba(36, 41, 47, 0.5);
  border: 2px solid rgba(88, 166, 255, 0.3);
  color: #58a6ff;
}

.nav-link.github::before {
  background: linear-gradient(135deg, #24292f, #0d1117);
}

.nav-link.github:hover {
  border-color: #58a6ff;
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.3);
  transform: translateY(-2px);
  color: #ffffff;
}

/* LinkedIn Nav Link */
.nav-link.linkedin {
  background: rgba(10, 102, 194, 0.1);
  border: 2px solid rgba(10, 102, 194, 0.3);
  color: #0a66c2;
}

.nav-link.linkedin::before {
  background: linear-gradient(135deg, #0a66c2, #004182);
}

.nav-link.linkedin:hover {
  border-color: #0a66c2;
  box-shadow: 0 4px 16px rgba(10, 102, 194, 0.3);
  transform: translateY(-2px);
  color: #ffffff;
}

/* ============================================
   Main Container
   ============================================ */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 20px 40px; /* Added top padding for fixed nav */
  position: relative;
  z-index: 1;
}

/* ============================================
   Header
   ============================================ */

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header-content {
  animation: fadeInDown 0.8s ease-out;
}

.title-wrapper {
  margin-bottom: 16px;
}

.main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  letter-spacing: -0.02em;
}

.icon-wrapper {
  font-size: 2.5rem;
  filter: drop-shadow(0 4px 8px rgba(255, 107, 107, 0.4));
  animation: bounce 2s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.icon-wrapper:hover {
  transform: scale(1.2) rotate(10deg);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.title-underline {
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-tertiary));
  margin: 12px auto;
  border-radius: 2px;
  animation: expandWidth 1s ease-out;
}

@keyframes expandWidth {
  from { width: 0; }
  to { width: 120px; }
}

.sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 12px 0;
  font-weight: 500;
}

.creator-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.badge-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Game Section
   ============================================ */

.game {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Controls
   ============================================ */

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.mode {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-option {
  position: relative;
  cursor: pointer;
}

.mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.mode-option input[type="radio"]:checked + .mode-label {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
  transform: translateY(-2px);
}

.mode-option:hover .mode-label {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Difficulty Selector */
.difficulty-selector {
  width: 100%;
  padding: 16px;
  background: rgba(255, 107, 107, 0.05);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--radius-md);
  margin-top: 12px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.difficulty-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.difficulty-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.difficulty-option {
  position: relative;
  cursor: pointer;
  flex: 1;
  min-width: 100px;
}

.difficulty-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.difficulty-label-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.difficulty-option input[type="radio"]:checked + .difficulty-label-text {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.difficulty-option:nth-child(1) input[type="radio"]:checked + .difficulty-label-text {
  background: linear-gradient(135deg, #06d6a0, #14d9a2);
}

.difficulty-option:nth-child(2) input[type="radio"]:checked + .difficulty-label-text {
  background: linear-gradient(135deg, #ffd166, #e6bd5c);
}

.difficulty-option:nth-child(3) input[type="radio"]:checked + .difficulty-label-text {
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.difficulty-option:hover .difficulty-label-text {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(255, 107, 107, 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
}

.btn-secondary:active {
  transform: translateY(-1px);
}

.btn i {
  position: relative;
  z-index: 1;
}

.btn span {
  position: relative;
  z-index: 1;
}

/* ============================================
   Status
   ============================================ */

.status-wrapper {
  margin-bottom: 28px;
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.3rem;
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
  }
}

.status-icon {
  font-size: 1.5rem;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   Board
   ============================================ */

.board-wrapper {
  margin-bottom: 32px;
  perspective: 1000px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 450px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
  position: relative;
}

.board:hover {
  transform: scale(1.02);
}

.cell {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cell:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(255, 209, 102, 0.4);
}

.cell:hover::before {
  opacity: 0.1;
}

.cell:active {
  transform: translateY(-2px) scale(1.02);
}

.cell:focus {
  outline: 3px solid rgba(255, 107, 107, 0.5);
  outline-offset: 2px;
}

.cell.winning {
  background: linear-gradient(135deg, var(--accent-success), #05b48a);
  color: #ffffff;
  border-color: var(--accent-success);
  animation: winAnimation 0.6s ease-out;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

@keyframes winAnimation {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.cell.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Light Theme Cell Adjustments */
body.light-theme .cell {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(78, 205, 196, 0.03));
  border: 2px solid rgba(255, 107, 107, 0.2);
  color: var(--text-primary);
}

body.light-theme .cell:hover {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.08));
  border-color: var(--accent-primary);
}

/* ============================================
   Scores
   ============================================ */

.scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: width 0.3s ease;
}

.score-x::before {
  background: var(--x-color);
}

.score-o::before {
  background: var(--o-color);
}

.score-draw::before {
  background: var(--draw-color);
}

.score-card:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.score-card:hover::before {
  width: 100%;
  opacity: 0.1;
}

.score-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.score-x .score-icon {
  background: rgba(255, 107, 107, 0.15);
  color: var(--x-color);
}

.score-o .score-icon {
  background: rgba(78, 205, 196, 0.15);
  color: var(--o-color);
}

.score-draw .score-icon {
  background: rgba(255, 209, 102, 0.15);
  color: var(--draw-color);
}

.score-content {
  flex: 1;
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ============================================
   Project Links
   ============================================ */

.project-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.project-link:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
}

.project-link i {
  font-size: 1rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  margin-top: 60px;
  padding: 30px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.footer-content {
  text-align: center;
}

.footer-copyright {
  padding-top: 0;
  border-top: none;
}

.footer-copyright p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .top-nav {
    padding: 12px 20px;
  }
  
  .nav-brand {
    font-size: 1.2rem;
  }
  
  .nav-right {
    gap: 12px;
  }
  
  .nav-social {
    gap: 8px;
  }
  
  .theme-toggle {
    width: 42px;
    height: 42px;
  }
  
  .theme-toggle i {
    font-size: 1rem;
  }
  
  .nav-link span {
    display: none;
  }
  
  .nav-link {
    padding: 8px 12px;
  }
  
  .wrap {
    padding: 80px 16px 24px;
  }
  
  .game {
    padding: 24px 16px;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mode {
    width: 100%;
  }
  
  .mode-option {
    flex: 1;
  }
  
  .mode-label {
    justify-content: center;
    width: 100%;
  }
  
  .difficulty-selector {
    margin-top: 12px;
  }
  
  .difficulty-options {
    flex-direction: column;
  }
  
  .difficulty-option {
    width: 100%;
  }
  
  .actions {
    width: 100%;
  }
  
  .btn {
    flex: 1;
    justify-content: center;
  }
  
  .board {
    padding: 12px;
    gap: 8px;
  }
  
  .cell {
    font-size: 2rem;
  }
  
  .scores {
    grid-template-columns: 1fr;
  }
  
  .social-links {
    flex-direction: column;
    gap: 12px;
  }
  
  .social-link {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.75rem;
    gap: 10px;
  }
  
  .icon-wrapper {
    font-size: 2rem;
  }
  
  .status {
    font-size: 1.1rem;
    padding: 12px;
  }
  
  .cell {
    font-size: 1.5rem;
  }
  
  .score-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
  }
  
  .score-value {
    font-size: 1.5rem;
  }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.cell:focus-visible,
.mode-label:focus-visible,
.social-link:focus-visible,
.project-link:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}
