/* ============================================
   MemoryFlip — Memory Card Game
   Dark Arcade Aesthetic
   Fonts: Syne (display) + DM Mono (body)
   ============================================ */

/* ----- CSS Custom Properties ----- */
:root {
  --color-bg: #0a0a0f;
  --color-surface: #1a1a2e;
  --color-card-bg: #14141f;
  --color-cyan: #00e5ff;
  --color-pink: #ff3cac;
  --color-yellow: #ffe600;
  --color-green: #00ff88;
  --color-red: #ff3333;
  --color-text: #e0e0e0;
  --color-text-muted: #888899;
  --color-border: rgba(255, 255, 255, 0.06);
  --glow-cyan: 0 0 10px rgba(0, 229, 255, 0.4), 0 0 40px rgba(0, 229, 255, 0.15);
  --glow-pink: 0 0 10px rgba(255, 60, 172, 0.4), 0 0 40px rgba(255, 60, 172, 0.15);
  --glow-yellow: 0 0 10px rgba(255, 230, 0, 0.4), 0 0 40px rgba(255, 230, 0, 0.15);
  --glow-green: 0 0 10px rgba(0, 255, 136, 0.5), 0 0 30px rgba(0, 255, 136, 0.2);
  --glow-red: 0 0 10px rgba(255, 51, 51, 0.5), 0 0 30px rgba(255, 51, 51, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Mono', monospace;
  --transition-fast: 0.2s ease;
  --transition-mid: 0.4s ease;
  --transition-slow: 0.6s ease;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}

a {
  color: var(--color-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-pink);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Keyframe Animations ----- */
@keyframes neonPulse {
  0%, 100% {
    text-shadow:
      0 0 5px rgba(0, 229, 255, 0.4),
      0 0 20px rgba(0, 229, 255, 0.2),
      0 0 40px rgba(0, 229, 255, 0.1);
  }
  50% {
    text-shadow:
      0 0 10px rgba(0, 229, 255, 0.6),
      0 0 30px rgba(0, 229, 255, 0.35),
      0 0 60px rgba(0, 229, 255, 0.15);
  }
}

@keyframes neonPulsePink {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 60, 172, 0.3), 0 0 20px rgba(255, 60, 172, 0.1);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 60, 172, 0.5), 0 0 40px rgba(255, 60, 172, 0.2);
  }
}

@keyframes cardReveal {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.12);
  }
  60% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1.04);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(0, 229, 255, 0.3);
  }
  50% {
    border-color: rgba(0, 229, 255, 0.7);
  }
}

@keyframes matchPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 255, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
  }
}

@keyframes spinIn {
  from {
    transform: rotate(-10deg) scale(0.8);
    opacity: 0;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

/* ============================================
   HEADER — Sticky Glass Morphism
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px;
  transition: background var(--transition-fast);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  font-size: 1.6rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-cyan);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition-fast);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 100px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  animation: neonPulse 3s ease-in-out infinite;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-pink), var(--color-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-cyan);
  display: block;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.hero-stat .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-cyan);
  color: var(--color-bg);
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover {
  background: #33ebff;
  color: var(--color-bg);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-pink);
  border-color: var(--color-pink);
  box-shadow: 0 0 10px rgba(255, 60, 172, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 60, 172, 0.1);
  color: var(--color-pink);
  box-shadow: var(--glow-pink);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--color-yellow);
  color: var(--color-bg);
  border-color: var(--color-yellow);
  box-shadow: 0 0 10px rgba(255, 230, 0, 0.15);
}

.btn-accent:hover {
  background: #fff133;
  color: var(--color-bg);
  box-shadow: var(--glow-yellow);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.05rem;
}

.btn-icon {
  font-size: 1.1em;
}

/* ============================================
   SECTION COMMON
   ============================================ */
.section {
  padding: 80px 20px;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.section-header h2 .accent-cyan {
  color: var(--color-cyan);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.section-header h2 .accent-pink {
  color: var(--color-pink);
  text-shadow: 0 0 20px rgba(255, 60, 172, 0.3);
}

.section-header h2 .accent-yellow {
  color: var(--color-yellow);
  text-shadow: 0 0 20px rgba(255, 230, 0, 0.3);
}

.section-header p {
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ============================================
   MODES GRID
   ============================================ */
.modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.mode-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition-mid);
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-pink));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.mode-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--glow-cyan);
}

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

.mode-card .mode-icon {
  font-size: 2.8rem;
  margin-bottom: 18px;
  display: block;
  animation: float 4s ease-in-out infinite;
}

.mode-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #fff;
}

.mode-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.mode-card .mode-tag {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 229, 255, 0.1);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

/* ============================================
   THEMES GRID
   ============================================ */
.themes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.theme-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition-mid);
  position: relative;
}

.theme-card:hover {
  border-color: rgba(255, 60, 172, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--glow-pink);
}

.theme-card .theme-preview {
  font-size: 2.4rem;
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.theme-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.theme-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ============================================
   BENEFITS SECTION
   ============================================ */
.benefits-section {
  padding: 80px 20px;
}

.benefit-row {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 60px;
  align-items: center;
}

.benefit-row:nth-child(even) {
  flex-direction: column;
}

.benefit-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.benefit-content {
  flex: 1;
}

.benefit-content h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.benefit-content p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.benefit-list {
  margin-top: 14px;
}

.benefit-list li {
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.benefit-list li::before {
  content: '\2713';
  color: var(--color-green);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ============================================
   FAQ SECTION — Accordion
   ============================================ */
.faq-section {
  padding: 80px 20px;
}

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: rgba(0, 229, 255, 0.2);
}

.faq-item.active {
  border-color: rgba(0, 229, 255, 0.4);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--color-cyan);
}

.faq-question .faq-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--color-cyan);
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 24px;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px;
}

.faq-answer p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   GUIDE CONTENT — Article Typography
   ============================================ */
.guide-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 20px;
}

.guide-content h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.guide-content h2 {
  font-size: 1.6rem;
  margin-top: 48px;
  margin-bottom: 14px;
  color: var(--color-cyan);
}

.guide-content h3 {
  font-size: 1.2rem;
  margin-top: 32px;
  margin-bottom: 10px;
}

.guide-content p {
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 18px;
  color: var(--color-text);
}

.guide-content ul,
.guide-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.guide-content ul {
  list-style: disc;
}

.guide-content ol {
  list-style: decimal;
}

.guide-content li {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 8px;
  color: var(--color-text);
}

.guide-content blockquote {
  border-left: 3px solid var(--color-cyan);
  padding: 14px 20px;
  margin: 24px 0;
  background: rgba(0, 229, 255, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.guide-content code {
  background: rgba(0, 229, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-cyan);
}

.guide-content pre {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.guide-content pre code {
  background: none;
  padding: 0;
}

/* ============================================
   GAME CONTAINER
   ============================================ */
.game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Game Header — Info bar */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.game-stat {
  text-align: center;
}

.game-stat .stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.game-stat .stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.game-stat.streak .stat-value {
  color: var(--color-yellow);
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.3);
}

.game-stat.timer .stat-value {
  color: var(--color-pink);
  text-shadow: 0 0 10px rgba(255, 60, 172, 0.3);
}

.game-mode-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  padding: 6px 14px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 20px;
}

/* ============================================
   GAME BOARD — Grid
   ============================================ */
.game-board {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  padding: 10px 0;
}

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

.game-board.grid-6x6 {
  grid-template-columns: repeat(6, 1fr);
  max-width: 620px;
}

.game-board.grid-8x8 {
  grid-template-columns: repeat(8, 1fr);
  max-width: 760px;
  gap: 8px;
}

/* ============================================
   CARD — Flip Animation
   ============================================ */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.flip-card .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: box-shadow var(--transition-fast);
}

/* ── Card front (emoji side, shown when flipped) ── */
.card-front {
  transform: rotateY(180deg);
  background: var(--color-surface);
  border: 2px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* ── Card back (unflipped / face-down) — pink/magenta with diamond ── */
.card-back {
  background: linear-gradient(135deg, #c2185b, #e91e8a);
  border: 2px solid rgba(255, 60, 172, 0.6);
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.flip-card:hover .card-back {
  border-color: rgba(255, 60, 172, 0.9);
  box-shadow: 0 0 18px rgba(255, 60, 172, 0.35);
  transform: scale(1.03);
}

/* ── Flipped (checking) — cyan border glow on the emoji face ── */
.flip-card.flipped .card-front {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.3), 0 0 30px rgba(0, 229, 255, 0.1);
}

/* ── Matched card — green glow, stays permanently visible ── */
.flip-card.matched .card-inner {
  transform: rotateY(180deg);
  animation: cardReveal 0.5s ease forwards;
}

.flip-card.matched .card-front {
  background: #0d2b1e;
  border: 2px solid #00ff88;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.35), 0 0 40px rgba(0, 255, 136, 0.12);
}

.flip-card.matched {
  animation: matchPulse 0.8s ease;
}

/* ── Wrong match — red shake ── */
.flip-card.wrong .card-inner {
  animation: shake 0.5s ease;
}

.flip-card.wrong .card-front {
  border-color: var(--color-red);
  box-shadow: var(--glow-red);
}

/* Disabled / locked */
.flip-card.disabled {
  pointer-events: none;
}

/* Small cards on larger grids */
.grid-8x8 .card-face {
  font-size: 1.3rem;
}

.grid-6x6 .card-face {
  font-size: 1.6rem;
}

/* ============================================
   GAME OVER OVERLAY
   ============================================ */
.game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-over-overlay.active {
  opacity: 1;
  visibility: visible;
}

.game-over-modal {
  background: var(--color-card-bg);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  animation: fadeInUp 0.5s ease;
}

.game-over-modal h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  animation: neonPulse 2s ease-in-out infinite;
}

.game-over-modal .game-over-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

.game-over-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.game-over-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
}

.game-over-stat .stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-cyan);
  display: block;
}

.game-over-stat .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.game-over-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.game-over-ad {
  margin-top: 20px;
}

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  min-height: 60px;
}

.ad-leaderboard {
  max-width: 728px;
  width: 100%;
}

.ad-rectangle {
  max-width: 336px;
  width: 100%;
}

.ad-sidebar {
  max-width: 300px;
  width: 100%;
}

.ad-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: rgba(10, 10, 15, 0.95);
  border-top: 1px solid var(--color-border);
  padding: 50px 20px 30px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
}

.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding: 4px 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-col a:hover {
  color: var(--color-cyan);
  padding-left: 6px;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.footer-bottom-links a:hover {
  color: var(--color-cyan);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-cyan { color: var(--color-cyan); }
.text-pink { color: var(--color-pink); }
.text-yellow { color: var(--color-yellow); }
.text-green { color: var(--color-green); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.glass {
  background: rgba(20, 20, 31, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
}

.glow-border {
  animation: borderGlow 3s ease-in-out infinite;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.3);
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background: rgba(0, 229, 255, 0.25);
  color: #fff;
}

/* ============================================
   RESPONSIVE — Tablet (768px+)
   ============================================ */
@media (min-width: 768px) {
  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .themes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefit-row {
    flex-direction: row;
    gap: 60px;
  }

  .benefit-row:nth-child(even) {
    flex-direction: row-reverse;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .game-board.grid-4x4 {
    gap: 14px;
  }

  .game-board.grid-6x6 {
    gap: 10px;
  }

  .game-over-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .hero {
    padding: 120px 20px 100px;
  }
}

/* ============================================
   RESPONSIVE — Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .modes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .themes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .section {
    padding: 100px 20px;
  }

  .hero {
    padding: 140px 20px 120px;
  }
}

/* ============================================
   RESPONSIVE — Mobile adjustments (below 768)
   ============================================ */
@media (max-width: 767px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    animation: slideDown 0.3s ease;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-stats {
    gap: 24px;
  }

  .game-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .game-info {
    justify-content: center;
  }

  .game-board.grid-8x8 {
    gap: 4px;
  }

  .game-board.grid-6x6 {
    gap: 6px;
  }

  .card-face {
    border-radius: var(--radius-sm);
  }

  .grid-8x8 .card-face {
    font-size: 0.9rem;
  }

  .grid-6x6 .card-face {
    font-size: 1.2rem;
  }

  .game-over-modal {
    padding: 32px 24px;
  }

  .ad-sidebar {
    display: none;
  }
}

/* Hide sidebar ads on non-desktop */
@media (max-width: 1023px) {
  .ad-sidebar {
    display: none;
  }
}

/* ============================================
   LOADING / SPLASH STATE
   ============================================ */
.game-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 20px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.game-loading p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============================================
   SCORE / COMBO POP
   ============================================ */
.score-pop {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-yellow);
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
  pointer-events: none;
  animation: scoreFloat 1s ease forwards;
  z-index: 100;
}

@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.3);
  }
}

.combo-text {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-pink);
  text-shadow: 0 0 20px rgba(255, 60, 172, 0.5);
  pointer-events: none;
  animation: comboReveal 1.2s ease forwards;
  z-index: 100;
}

@keyframes comboReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-5deg);
  }
  30% {
    opacity: 1;
    transform: scale(1.2) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: scale(1) translateY(-40px);
  }
}

/* ============================================
   DIFFICULTY SELECT SCREEN
   ============================================ */
.difficulty-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 60px 20px;
  text-align: center;
}

.difficulty-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.difficulty-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  cursor: pointer;
  transition: all var(--transition-mid);
  min-width: 160px;
  text-align: center;
}

.difficulty-card:hover {
  border-color: var(--color-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-4px);
}

.difficulty-card.selected {
  border-color: var(--color-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.difficulty-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.difficulty-card p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-pink));
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* ============================================
   TOAST / NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--color-text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 340px;
}

.toast.success {
  border-color: rgba(0, 255, 136, 0.3);
}

.toast.error {
  border-color: rgba(255, 51, 51, 0.3);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ============================================
   LEADERBOARD TABLE
   ============================================ */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.leaderboard-table th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.leaderboard-table tr:hover td {
  background: rgba(0, 229, 255, 0.03);
}

.leaderboard-table .rank-1 {
  color: var(--color-yellow);
  font-weight: 700;
}

.leaderboard-table .rank-2 {
  color: #c0c0c0;
  font-weight: 700;
}

.leaderboard-table .rank-3 {
  color: #cd7f32;
  font-weight: 700;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
.settings-panel {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  margin: 0 auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row label {
  font-size: 0.88rem;
  color: var(--color-text);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle.active {
  background: var(--color-cyan);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* ============================================
   PAUSE OVERLAY
   ============================================ */
.pause-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pause-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

.pause-content h2 {
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: neonPulse 2s ease-in-out infinite;
  margin-bottom: 24px;
}

/* ============================================
   PARTICLES / DECORATION
   ============================================ */
.decoration-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}

.orb-cyan {
  background: rgba(0, 229, 255, 0.08);
}

.orb-pink {
  background: rgba(255, 60, 172, 0.06);
}

/* ============================================
   CTA BANNER
   ============================================ */
.cta-banner {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(255, 60, 172, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  margin: 40px 0;
}

.cta-banner h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.cta-banner p {
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 0.92rem;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-cyan);
}

.breadcrumbs .separator {
  color: rgba(255, 255, 255, 0.15);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .game-container {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }
}

/* ============================================
   HOMEPAGE — Section Title & Grids
   ============================================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-pink), var(--color-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ── Homepage Cards (generic .card class for homepage) ── */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition-mid);
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--glow-cyan);
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #fff;
}

.card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.card-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 14px;
  animation: float 4s ease-in-out infinite;
}

/* Theme preview cards */
.theme-emojis {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 12px;
  letter-spacing: 4px;
}

/* ── Hero CTAs & Stats ── */
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-stats .stat-item {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.hero-stats .stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-cyan);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* ── CTA Box ── */
.cta-box {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(255, 60, 172, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}

.cta-box h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.cta-box p {
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto 20px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.streak-display {
  font-size: 1.1rem;
  color: var(--color-yellow);
  margin-bottom: 16px;
}

/* ── Accordion (FAQ) ── */
.accordion {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-header {
  display: block;
  padding: 18px 24px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  transition: color var(--transition-fast);
  list-style: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header:hover {
  color: var(--color-cyan);
}

.accordion-body {
  padding: 0 24px 18px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   GAME PAGE — Selectors & Header Layout
   ============================================ */
.game-header-left,
.game-header-center,
.game-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-header-center {
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.back-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.back-btn:hover {
  color: var(--color-cyan);
}

.mode-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  padding: 5px 14px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.grid-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.grid-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.grid-btn:hover {
  border-color: rgba(0, 229, 255, 0.4);
  color: #fff;
}

.grid-btn.active {
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.theme-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.theme-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.theme-btn:hover {
  border-color: rgba(255, 60, 172, 0.4);
  color: #fff;
}

.theme-btn.active {
  border-color: var(--color-pink);
  color: var(--color-pink);
  background: rgba(255, 60, 172, 0.08);
}

/* ── Footer extra ── */
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}

.footer-logo span {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Ad Sidebar float ── */
.ad-sidebar {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 50;
  max-width: 300px;
}

/* ── Nav toggle active state ── */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Static page dark theme helpers ── */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.page-content h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}

.page-content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--color-cyan);
}

.page-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.page-content p {
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.page-content a {
  color: var(--color-cyan);
}

.page-content ul {
  padding-left: 1.5rem;
  list-style: disc;
}

.page-content ul li {
  color: var(--color-text);
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.page-content .date-line {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.page-content section {
  margin-bottom: 2rem;
}

.info-box {
  padding: 1.5rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-item {
  padding: 1.25rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.feature-item strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-cyan);
}

.page-cta {
  text-align: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(255, 60, 172, 0.06));
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.page-cta h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.page-cta p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

/* ── Mobile game header ── */
@media (max-width: 767px) {
  .game-header-left,
  .game-header-center,
  .game-header-right {
    justify-content: center;
    width: 100%;
  }

  .grid-selector {
    gap: 6px;
  }

  .theme-selector {
    gap: 6px;
  }

  .theme-btn {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .grid-8x8 .card-face {
    font-size: 0.9rem;
  }

  .grid-6x6 .card-face {
    font-size: 1.2rem;
  }
}

/* ============================================
   TEXT READABILITY FIXES
   ============================================ */

/* 1. Global form input styles */
input,
textarea,
select {
  background: #1a1a24;
  color: #e8e8f0;
  border: 1px solid #2a2a3d;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-cyan);
}

input::placeholder,
textarea::placeholder {
  color: #7a7a99;
}

/* 2. Ensure h3 text is visible on dark backgrounds */
.page-content h3 {
  color: #e8e8f0;
}

.guide-content h3 {
  color: #e8e8f0;
}

/* 3. Feature items / info boxes — ensure body text is readable */
.feature-item {
  color: var(--color-text);
}

.info-box {
  color: var(--color-text);
}

.info-box h2 {
  color: var(--color-cyan);
}

/* 4. Card text readability — catch-all for card variants */
.benefit-card,
.mode-card,
.guide-card,
.theme-card {
  color: var(--color-text);
}

.benefit-card h3,
.mode-card h3,
.guide-card h3,
.theme-card h3 {
  color: #fff;
}

.benefit-card p,
.mode-card p,
.guide-card p,
.theme-card p {
  color: var(--color-text-muted);
}

/* 5. FAQ / accordion text readability */
.faq-item {
  color: var(--color-text);
}

.faq-item h3,
.faq-item strong {
  color: #fff;
}

.faq-item p {
  color: var(--color-text-muted);
}

.accordion-body p {
  color: var(--color-text-muted);
}

/* 6. Links inside content pages */
.page-content a {
  color: var(--color-cyan);
}

.page-content a:hover {
  color: var(--color-pink);
}

.guide-content a {
  color: var(--color-cyan);
}

.guide-content a:hover {
  color: var(--color-pink);
}

/* 7. Footer text readability */
.site-footer,
.site-footer p,
.site-footer li {
  color: #9a9ab0;
}

.footer-col a {
  color: #9a9ab0;
}

.footer-col a:hover {
  color: var(--color-cyan);
}

.footer-bottom p,
.footer-bottom-links a {
  color: #7a7a99;
}

.footer-bottom-links a:hover {
  color: var(--color-cyan);
}

/* 8. Breadcrumbs text */
.breadcrumbs {
  color: var(--color-text-muted);
}

.breadcrumbs span {
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-cyan);
}

/* ============================================
   MATCHED CARD — Bulletproof Overrides
   ============================================ */
.flip-card.matched {
  pointer-events: none !important;
}

.flip-card.matched .card-inner {
  transform: rotateY(180deg) !important;
}

.flip-card.matched .card-front {
  opacity: 1 !important;
  visibility: visible !important;
  background: #0d2b1e !important;
  border: 2px solid #00ff88 !important;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.35) !important;
}

.flip-card.matched .card-back {
  opacity: 0 !important;
  visibility: hidden !important;
}
