/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Frozen Lake Color Palette */
  --primary: #2B5A7A;
  --primary-dark: #1E3F56;
  --primary-light: #4A7BA3;
  --secondary: #7BA3C7;
  --accent: #A8D0F0;
  --accent-dark: #85B8E3;
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* Light Mode (default) */
:root {
  --bg-primary: #F8FBFF;
  --bg-secondary: #F0F7FF;
  --bg-tertiary: #E8F4FF;
  --text-primary: #1A2E3F;
  --text-secondary: #2B5A7A;
  --text-muted: #6B8FA8;
  --border: #C8E0F5;
  --border-light: #E0F0FF;
  --shadow: 0 1px 3px 0 rgb(43 90 122 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(43 90 122 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(43 90 122 / 0.1);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0F1A26;
  --bg-secondary: #1A2E3F;
  --bg-tertiary: #2B5A7A;
  --text-primary: #F8FBFF;
  --text-secondary: #C8E0F5;
  --text-muted: #7BA3C7;
  --border: #2B5A7A;
  --border-light: #4A7BA3;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: var(--transition);
  position: relative;
  overflow-x: hidden;
}

/* Interactive Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(43, 90, 122, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168, 208, 240, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(123, 163, 199, 0.05) 0%, transparent 50%);
  z-index: -2;
  animation: backgroundShift 20s ease-in-out infinite;
}

[data-theme="dark"] body::before {
  background: 
    radial-gradient(circle at 20% 80%, rgba(43, 90, 122, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168, 208, 240, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(123, 163, 199, 0.1) 0%, transparent 50%);
}

@keyframes backgroundShift {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-20px) translateY(-10px); }
  50% { transform: translateX(20px) translateY(10px); }
  75% { transform: translateX(-10px) translateY(20px); }
}

/* Floating particles */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.1), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.05), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.05), transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  z-index: -1;
  animation: particleFloat 30s linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-200px); }
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .header {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: none;
  padding: 0 2rem;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
  transition: var(--transition);
  text-decoration: none;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  padding: 6px;
  box-shadow: 0 4px 12px rgba(43, 90, 122, 0.3);
  transition: var(--transition);
  border: 1px solid rgba(43, 90, 122, 0.1);
}

.logo:hover img {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(43, 90, 122, 0.4);
  background: linear-gradient(135deg, #ffffff, #e8f4ff);
}

[data-theme="dark"] .logo img {
  background: linear-gradient(135deg, #ffffff, #f0f7ff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .logo:hover img {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #ffffff, #e8f4ff);
}

.logo span {
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
}

[data-theme="dark"] .logo span {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: flex-end;
  margin-right: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(43, 90, 122, 0.1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.btn-back:hover {
  background: var(--bg-secondary);
}

.btn-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 1rem;
  transition: var(--transition);
}

.btn-close:hover {
  background: var(--bg-secondary);
}

/* Main Content */
.main {
  padding: 2rem 0;
  width: 100%;
}

.main .container {
  max-width: 1400px;
  padding: 0 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  transition: var(--transition);
}

/* Games Grid */
.games {
  margin-bottom: 3rem;
  width: 100%;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.game-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
}

[data-theme="dark"] .game-card {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.game-card:hover::before {
  left: 100%;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .game-card:hover {
  background: rgba(51, 65, 85, 0.3);
}

.game-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--primary);
  background: rgba(43, 90, 122, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(43, 90, 122, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(43, 90, 122, 0.2);
}

.game-card:hover .game-icon {
  background: var(--primary);
  color: white;
  transform: scale(1.1) rotateY(10deg);
  box-shadow: 0 8px 24px rgba(43, 90, 122, 0.4);
}

.game-icon svg {
  width: 32px;
  height: 32px;
}

.game-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.game-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  transition: var(--transition);
}

.btn-play {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-play:hover::before {
  left: 100%;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(43, 90, 122, 0.4);
}

/* Stats Section */
.stats {
  margin-top: 3rem;
  width: 100%;
}

.stats h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: var(--transition);
}

/* Game Container */
.game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 200;
  transition: var(--transition);
}

.game-header {
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .game-header {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.game-title {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.game-stats {
  display: flex;
  gap: 1rem;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  color: var(--text-secondary);
  transition: var(--transition);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-content {
  padding: 2rem;
  height: calc(100vh - 80px);
  overflow-y: auto;
  width: 100%;
  max-width: none;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(8px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

[data-theme="dark"] .modal-content {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.modal-content h2 {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  transition: var(--transition);
}

/* Difficulty Options */
.difficulty-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.difficulty-btn {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(43, 90, 122, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(43, 90, 122, 0.1);
}

[data-theme="dark"] .difficulty-btn {
  background: rgba(43, 90, 122, 0.15);
  border: 2px solid rgba(123, 163, 199, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.difficulty-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(43, 90, 122, 0.1), transparent);
  transition: left 0.5s ease;
}

.difficulty-btn:hover::before {
  left: 100%;
}

.difficulty-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(43, 90, 122, 0.3);
}

[data-theme="dark"] .difficulty-btn:hover {
  background: rgba(43, 90, 122, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.difficulty-name {
  display: block;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.25rem;
  transition: var(--transition);
}

.difficulty-desc {
  display: block;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: var(--transition);
  font-weight: 500;
}

/* Game Specific Styles */

/* Origami Game */
.origami-workspace {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.origami-paper {
  width: 400px;
  height: 400px;
  background: #f8f9fa;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s;
}

.origami-paper:hover {
  box-shadow: var(--shadow-md);
}

.fold-line {
  position: absolute;
  border: 2px dashed var(--text-muted);
  transition: all 0.3s;
  opacity: 0.7;
}

.fold-line.active {
  border-color: var(--primary);
  opacity: 1;
}

.fold-line.completed {
  border-color: var(--success);
  border-style: solid;
}

.origami-sidebar {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.target-shape {
  width: 200px;
  height: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.target-shape img {
  max-width: 180px;
  max-height: 180px;
  border-radius: var(--radius);
}

.instructions {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1rem;
}

.instruction-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.instruction-step:last-child {
  border-bottom: none;
}

.step-number {
  width: 24px;
  height: 24px;
  background: var(--text-muted);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.step-number.current {
  background: var(--primary);
}

.step-number.completed {
  background: var(--success);
}

.step-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Speed Typing Game */
.typing-workspace {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.word-display {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-word {
  font-size: 2.5rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.typing-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-family: 'Courier New', monospace;
}

.typing-input:focus {
  outline: none;
  border-color: var(--primary);
}

.typing-input.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.typing-input.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Memory Game */
.memory-workspace {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.memory-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.memory-grid.grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 250px;
}

.memory-grid.grid-3x3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 300px;
}

.memory-grid.grid-4x4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 350px;
}

.memory-cell {
  aspect-ratio: 1;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.memory-cell:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.memory-cell.revealed {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.memory-cell.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.memory-cell.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.shape {
  width: 40px;
  height: 40px;
}

.shape-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--success);
}

.shape-square {
  background: var(--primary);
}

.shape-circle {
  border-radius: 50%;
  background: var(--warning);
}

.shape-triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: var(--error);
}

.input-cell {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.input-cell:focus {
  outline: none;
}

.shape-reference {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.reference-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.reference-shape {
  width: 30px;
  height: 30px;
}

.reference-number {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  width: 0%;
}

/* Game Controls */
.game-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

/* Results Panel */
.results-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.result-stat {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1rem;
}

.result-stat h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .origami-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .origami-paper {
    width: 300px;
    height: 300px;
  }
  
  .current-word {
    font-size: 1.75rem;
  }
  
  .game-content {
    padding: 1rem;
  }
  
  .modal-content {
    margin: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.pulse {
  animation: pulse 1s infinite;
}

.shake {
  animation: shake 0.3s ease-in-out;
}

/* Game Specific Styles - Enhanced */

/* Origami Game - New Canvas-based Design */
.origami-workspace {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.origami-main {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .origami-main {
  background: rgba(51, 65, 85, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.2);
}

.paper-container {
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

#origamiCanvas {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  cursor: default;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

#origamiCanvas:hover {
  box-shadow: var(--shadow-lg);
}

.fold-guides {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.progress-container {
  margin-bottom: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 6px;
  transition: width 0.5s ease;
  width: 0%;
}

.step-indicator {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.current-instruction {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.instruction-text {
  font-size: 1.125rem;
  color: var(--text-primary);
  font-weight: 500;
}

.origami-sidebar {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  height: fit-content;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .origami-sidebar {
  background: rgba(51, 65, 85, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.2);
}

.origami-sidebar h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.target-shape {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.pattern-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.pattern-preview {
  width: 100px;
  height: 100px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.instructions {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2rem;
  max-height: 300px;
  overflow-y: auto;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.instruction-item:last-child {
  border-bottom: none;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--text-muted);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: var(--transition);
}

.step-number.current {
  background: var(--primary);
  animation: pulse 2s infinite;
}

.step-number.completed {
  background: var(--success);
}

.step-description {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.fold-legend {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 1rem;
}

.fold-legend h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.legend-line {
  width: 30px;
  height: 2px;
  border-radius: 1px;
}

.legend-line.valley {
  border: 2px dashed var(--primary);
  height: 0;
}

.legend-line.mountain {
  border: 2px dotted var(--error);
  height: 0;
}

/* Speed Typing Game - Enhanced */
.typing-workspace {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.word-display {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .word-display {
  background: rgba(51, 65, 85, 0.2);
  border: 2px solid rgba(71, 85, 105, 0.3);
}

.current-word {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  transition: var(--transition);
  letter-spacing: 0.1em;
}

.current-word.correct {
  color: var(--success);
  animation: wordSuccess 0.5s ease;
}

.current-word.incorrect {
  color: var(--error);
  animation: shake 0.3s ease;
}

@keyframes wordSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.typing-input {
  width: 100%;
  padding: 1.5rem;
  font-size: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  font-family: 'Courier New', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  margin-bottom: 2rem;
}

.typing-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.typing-input.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.typing-input.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.game-stats-grid .stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.game-stats-grid .stat-card h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.game-stats-grid .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

/* Memory Game - Fixed Styling */
.memory-workspace {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.game-phase {
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.phase-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.phase-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.countdown {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin: 2rem 0;
  animation: pulse 1s infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.memory-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .memory-grid {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.memory-grid.grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 280px;
}

.memory-grid.grid-3x3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 350px;
}

.memory-grid.grid-4x4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 420px;
}

.memory-cell {
  aspect-ratio: 1;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 60px;
}

.memory-cell:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.memory-cell.revealed {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  transform: scale(1.02);
}

.memory-cell.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  animation: correctPulse 0.6s ease;
}

.memory-cell.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  animation: shake 0.4s ease;
}

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

.shape {
  width: clamp(30px, 60%, 50px);
  height: clamp(30px, 60%, 50px);
  transition: var(--transition);
}

.shape-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: linear-gradient(135deg, var(--success), #059669);
}

.shape-square {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.shape-circle {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warning), #d97706);
}

.shape-triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: linear-gradient(135deg, var(--error), #dc2626);
}

.input-cell {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.input-cell:focus {
  outline: none;
}

.input-cell::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.shape-reference {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .shape-reference {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.reference-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .reference-item {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.reference-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.reference-shape {
  width: 40px;
  height: 40px;
}

/* Balance Game - New Canvas-based Design */
.balance-workspace {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.game-info {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .game-info {
  background: rgba(51, 65, 85, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.2);
}

.balance-game-area {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .balance-game-area {
  background: rgba(51, 65, 85, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.2);
}

#balanceCanvas {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  cursor: crosshair;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  max-width: 100%;
  height: auto;
}

[data-theme="dark"] #balanceCanvas {
  background: linear-gradient(135deg, #1e293b, #334155);
}

#balanceCanvas:hover {
  box-shadow: var(--shadow-lg);
}

.control-instructions {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.control-instructions p {
  margin: 0.5rem 0;
}

.control-instructions strong {
  color: var(--text-primary);
}

/* Game Controls */
.game-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.game-controls button {
  min-width: 120px;
}

/* Results Panel - Enhanced */
.results-panel {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.5s ease;
}

.results-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.result-stat {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.result-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.result-stat h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

/* Responsive Design - Enhanced */
@media (max-width: 1024px) {
  .origami-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .origami-sidebar {
    order: -1;
  }
  
  #origamiCanvas {
    width: 350px;
    height: 350px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .header-content {
    padding: 0 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .game-content {
    padding: 1rem;
  }
  
  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  #origamiCanvas {
    width: 280px;
    height: 280px;
  }
  
  .current-word {
    font-size: 1.75rem;
  }
  
  .typing-input {
    font-size: 1.25rem;
    padding: 1rem;
  }
  
  .game-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .shape-reference {
    gap: 1rem;
  }
  
  .reference-item {
    padding: 0.75rem;
  }
  
  .memory-grid.grid-2x2 {
    max-width: 220px;
  }
  
  .memory-grid.grid-3x3 {
    max-width: 280px;
  }
  
  .memory-grid.grid-4x4 {
    max-width: 320px;
  }
  
  .results-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .game-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .nav {
    gap: 0.5rem;
  }
  
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
  
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
  
  .game-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .game-controls button {
    width: 100%;
    max-width: 200px;
  }
}

/* Animations - Enhanced */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in {
  animation: slideIn 0.4s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }

.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Theme transition for all elements */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
/* Footer */
.footer {
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(200, 224, 245, 0.3);
  padding: 2rem 0;
  margin-top: 4rem;
  transition: var(--transition);
}

[data-theme="dark"] .footer {
  background: rgba(15, 26, 38, 0.8);
  border-top: 1px solid rgba(43, 90, 122, 0.3);
}

.footer-content {
  text-align: center;
}

.footer-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0.25rem 0;
}

.footer-content strong {
  color: var(--primary);
  font-weight: 600;
}

.github-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.github-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.heart {
  color: #e74c3c;
  font-size: 1rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .mobile-menu-btn {
    display: flex;
    order: 3;
  }
  
  .nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(248, 251, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    justify-content: flex-start;
    margin-right: 0;
  }
  
  [data-theme="dark"] .nav-menu {
    background: rgba(15, 26, 38, 0.95);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    font-size: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
    margin: 0;
    border-radius: 0;
    text-align: left;
    width: 100%;
    display: block;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-link:hover {
    background: var(--bg-secondary);
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav {
    order: 2;
    gap: 0.5rem;
  }
  
  .logo {
    order: 1;
  }
  
  .game-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  
  .game-title {
    font-size: 1rem;
    flex: 1 1 100%;
    margin-bottom: 0.5rem;
  }
  
  .game-stats {
    font-size: 0.75rem;
    gap: 0.75rem;
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

/* Tablet and smaller desktop adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .nav-menu {
    gap: 1.5rem;
    margin-right: 1rem;
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}