/* ═══════════════════════════════════════════════════════════════════
   MIA GAMES — Global Stylesheet
   Project  : MiniGameArena  |  Brand: MIA Games
   Author   : MIA Tech Services (miatechservices.com)
   Version  : 1.0.0  |  Phase 1 — Site Layout & Theme System
   Stack    : Pure CSS3 — No frameworks, no preprocessors
   ═══════════════════════════════════════════════════════════════════

   TABLE OF CONTENTS
   ─────────────────
   01. Design Tokens (CSS Custom Properties)
       01a. Color Palette — Dark Theme (default)
       01b. Color Palette — Light Theme
       01c. Typography Scale
       01d. Spacing & Sizing
       01e. Shadows, Radii, Transitions
   02. CSS Reset & Base
   03. Typography
   04. Layout Utilities
   05. Skip Link (Accessibility)
   06. Ad Containers (AdSense-compliant)
   07. Site Header & Navigation
   08. Mobile Navigation Drawer
   09. Theme Toggle Button
   10. Hero Section
   11. Page Layout (Content + Sidebar Grid)
   12. Game Cards
   13. Games Section
   14. About Section
   15. Sidebar Components
   16. Site Footer
   17. Utility Classes & Badges
   18. Responsive Breakpoints
   19. Reduced Motion
   ═══════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════
   01. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════ */

/* ── 01a. DARK THEME (default) ────────────────────────────────────── */
:root,
[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary:       #0d0d1a;   /* deepest — page body */
  --bg-secondary:     #13131f;   /* cards, sidebars */
  --bg-tertiary:      #1a1a2e;   /* elevated elements */
  --bg-surface:       #1f1f35;   /* hover states, inset blocks */
  --bg-header:        rgba(13, 13, 26, 0.92);

  /* Foreground / Text */
  --text-primary:     #eaeaf5;
  --text-secondary:   #9898b8;
  --text-muted:       #5c5c7a;
  --text-inverse:     #0d0d1a;

  /* Brand Accents */
  --accent-purple:    #7c6dfa;   /* primary CTA, links, highlights */
  --accent-purple-hover: #9585fb;
  --accent-purple-dim:   rgba(124, 109, 250, 0.12);
  --accent-teal:      #3ecfcf;   /* secondary accent */
  --accent-teal-dim:  rgba(62, 207, 207, 0.1);
  --accent-amber:     #f5a623;   /* warning, hangman, fun */
  --accent-amber-dim: rgba(245, 166, 35, 0.1);
  --accent-red:       #f05252;   /* danger, minesweeper */
  --accent-red-dim:   rgba(240, 82, 82, 0.1);
  --accent-green:     #34d399;   /* success */

  /* Gradient */
  --gradient-brand:   linear-gradient(135deg, #7c6dfa 0%, #3ecfcf 100%);
  --gradient-card:    linear-gradient(160deg, #1a1a2e 0%, #13131f 100%);
  --gradient-hero:    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 109, 250, 0.18) 0%, transparent 70%);

  /* Borders */
  --border-subtle:    rgba(255, 255, 255, 0.06);
  --border-default:   rgba(255, 255, 255, 0.10);
  --border-strong:    rgba(255, 255, 255, 0.18);
  --border-accent:    rgba(124, 109, 250, 0.35);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 24px rgba(124, 109, 250, 0.22);

  /* Ad Placeholders */
  --ad-bg:        #1a1a2e;
  --ad-border:    rgba(255,255,255,0.07);
  --ad-text:      #3d3d5c;

  color-scheme: dark;
}

/* ── 01b. LIGHT THEME ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:       #f5f5fc;
  --bg-secondary:     #ffffff;
  --bg-tertiary:      #eeeef8;
  --bg-surface:       #e8e8f5;
  --bg-header:        rgba(245, 245, 252, 0.92);

  --text-primary:     #12122a;
  --text-secondary:   #4a4a6a;
  --text-muted:       #9898b0;
  --text-inverse:     #ffffff;

  --accent-purple:    #6557f5;
  --accent-purple-hover: #7c6dfa;
  --accent-purple-dim:   rgba(101, 87, 245, 0.10);
  --accent-teal:      #0fa8a8;
  --accent-teal-dim:  rgba(15, 168, 168, 0.10);
  --accent-amber:     #d4890e;
  --accent-amber-dim: rgba(212, 137, 14, 0.10);
  --accent-red:       #dc2626;
  --accent-red-dim:   rgba(220, 38, 38, 0.08);
  --accent-green:     #059669;

  --gradient-brand:   linear-gradient(135deg, #6557f5 0%, #0fa8a8 100%);
  --gradient-card:    linear-gradient(160deg, #ffffff 0%, #f5f5fc 100%);
  --gradient-hero:    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(101, 87, 245, 0.10) 0%, transparent 70%);

  --border-subtle:    rgba(0, 0, 0, 0.05);
  --border-default:   rgba(0, 0, 0, 0.09);
  --border-strong:    rgba(0, 0, 0, 0.16);
  --border-accent:    rgba(101, 87, 245, 0.30);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.07);
  --shadow-glow: 0 0 24px rgba(101, 87, 245, 0.15);

  --ad-bg:        #ededf8;
  --ad-border:    rgba(0,0,0,0.07);
  --ad-text:      #b0b0cc;

  color-scheme: light;
}

/* ── 01c. TYPOGRAPHY ──────────────────────────────────────────────── */
:root {
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --fs-xs:   0.70rem;   /*  11px */
  --fs-sm:   0.813rem;  /*  13px */
  --fs-base: 1rem;      /*  16px */
  --fs-md:   1.063rem;  /*  17px */
  --fs-lg:   1.25rem;   /*  20px */
  --fs-xl:   1.5rem;    /*  24px */
  --fs-2xl:  1.875rem;  /*  30px */
  --fs-3xl:  2.25rem;   /*  36px */
  --fs-4xl:  2.875rem;  /*  46px */
  --fs-5xl:  3.75rem;   /*  60px */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;

  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-normal: 1.6;
  --lh-loose:  1.8;

  --ls-tight: -0.04em;
  --ls-snug:  -0.02em;
  --ls-wide:   0.06em;
  --ls-wider:  0.10em;
}

/* ── 01d. SPACING & SIZING ────────────────────────────────────────── */
:root {
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2rem);

  --header-h: 68px;

  /* Sidebar — standard ad widths */
  --sidebar-w:  300px;

  /* Ad slot standard dimensions */
  --ad-leaderboard-w: 728px;
  --ad-leaderboard-h: 90px;
  --ad-rect-w: 300px;
  --ad-rect-h: 250px;
  --ad-tall-h: 600px;
  --ad-mobile-banner-w: 320px;
  --ad-mobile-banner-h: 50px;
}

/* ── 01e. RADII & TRANSITIONS ─────────────────────────────────────── */
:root {
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-full: 9999px;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --transition-fast:   150ms var(--ease-out);
  --transition-base:   250ms var(--ease-out);
  --transition-slow:   400ms var(--ease-out);
  --transition-spring: 350ms var(--ease-spring);
}


/* ═══════════════════════════════════════════════════════════════════
   02. CSS RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--accent-purple-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

button:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-surface);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-teal);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-8) 0;
}


/* ═══════════════════════════════════════════════════════════════════
   03. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
}

h1 { font-size: clamp(var(--fs-3xl), 5vw, var(--fs-5xl)); }
h2 { font-size: clamp(var(--fs-xl), 3vw, var(--fs-3xl)); }
h3 { font-size: clamp(var(--fs-lg), 2vw, var(--fs-xl)); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p {
  line-height: var(--lh-loose);
  color: var(--text-secondary);
  max-width: 72ch;
}

p + p {
  margin-top: var(--space-4);
}

strong {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ═══════════════════════════════════════════════════════════════════
   04. LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: clamp(var(--fs-xl), 3vw, var(--fs-2xl));
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section-sub {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 60ch;
}


/* ═══════════════════════════════════════════════════════════════════
   05. SKIP LINK (Accessibility)
   ═══════════════════════════════════════════════════════════════════ */

.skip-link {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-3) var(--space-6);
  background: var(--accent-purple);
  color: #fff;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-md);
  transform: translateY(-150%);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}


/* ═══════════════════════════════════════════════════════════════════
   06. AD CONTAINERS
   AdSense Policy Compliant:
   - Clearly separated from interactive content
   - Labelled "Advertisement"
   - Standard IAB dimensions
   - No overlap with game elements or buttons
   ═══════════════════════════════════════════════════════════════════ */

/* Ad label shown above every unit */
.ad-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-2);
  display: block;
  user-select: none;
}

/* Leaderboard strip (top and bottom of page) */
.ad-strip {
  width: 100%;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-4) var(--container-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-strip--bottom {
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-12);
}

/* Generic ad wrapper */
.ad-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

/* Leaderboard 728×90 (desktop) / collapses to 320×50 mobile */
.ad-leaderboard {
  width: 100%;
  max-width: var(--ad-leaderboard-w);
  height: var(--ad-leaderboard-h);
}

/* Rectangle 300×250 */
.ad-rectangle {
  width: var(--ad-rect-w);
  height: var(--ad-rect-h);
}

/* Sidebar units */
.ad-sidebar-rect {
  width: var(--ad-rect-w);
  height: var(--ad-rect-h);
}

.ad-sidebar-tall {
  width: var(--ad-rect-w);
  height: var(--ad-tall-h);
}

/* Placeholder tiles (visible before AdSense is live) */
.ad-placeholder {
  position: absolute;
  inset: 0;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ad-placeholder span {
  font-size: var(--fs-xs);
  color: var(--ad-text);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.ad-placeholder--tall {
  /* Tall sidebar ad gets a vertical label */
}

/* Inline ad wrap (between content sections) */
.ad-inline-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-12) 0;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Sidebar ad wrappers */
.ad-sidebar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-6);
}


/* ═══════════════════════════════════════════════════════════════════
   07. SITE HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.88;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
  line-height: 1;
}

.logo--small .logo-text {
  font-size: var(--fs-lg);
}

.logo-accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Desktop Navigation */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.main-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-surface);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  color: var(--accent-purple);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   07a. SITE HEADER & NAVIGATION — TWO ROW
   ═══════════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg-header);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-slow), border-color var(--transition-slow);
  padding: 4px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 100%;
  flex-wrap: wrap;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.88;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
  line-height: 1;
}

.logo--small .logo-text {
  font-size: var(--fs-lg);
}

.logo-accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Desktop Navigation - Two Rows */
.main-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 2px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.main-nav a {
  display: block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-surface);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  color: var(--accent-purple);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Responsive - Hide two-row nav on mobile */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .header-inner {
    height: var(--header-h);
  }
}

/* Adjust header height for desktop with two rows */
@media (min-width: 769px) {
  .site-header {
    height: auto;
    padding: 6px 0;
  }
  
  .header-inner {
    height: auto;
    min-height: var(--header-h);
  }
}


/* ═══════════════════════════════════════════════════════════════════
   08. MOBILE NAVIGATION DRAWER
   ═══════════════════════════════════════════════════════════════════ */

/* Hamburger Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: background var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--bg-tertiary);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Panel */
.mobile-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  z-index: 850;
  width: min(300px, 82vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-default);
  padding: var(--space-6) var(--space-4);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}

.mobile-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
  text-decoration: none;
}

.mobile-nav a[aria-current="page"] {
  color: var(--accent-purple);
  background: var(--accent-purple-dim);
}

/* Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 840;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.nav-overlay.is-visible {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════
   09. THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════ */

.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-spring);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(18deg) scale(1.08);
}

.theme-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

/* Dark theme: show sun icon (to switch to light) */
[data-theme="dark"] .theme-icon--sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-icon--moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }

/* Light theme: show moon icon (to switch to dark) */
[data-theme="light"] .theme-icon--sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="light"] .theme-icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }


/* ═══════════════════════════════════════════════════════════════════
   10. HERO SECTION
   ═══════════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  padding: clamp(var(--space-16), 8vw, var(--space-24)) 0 clamp(var(--space-10), 5vw, var(--space-16));
  overflow: hidden;
}

/* Ambient background glow */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}

/* Subtle dot-grid texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-default) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--accent-purple-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent-purple);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-purple);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl));
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}

.hero-sub {
  font-size: clamp(var(--fs-base), 2vw, var(--fs-lg));
  color: var(--text-secondary);
  line-height: var(--lh-loose);
  max-width: 56ch;
  margin-bottom: var(--space-8);
}

/* CTA Buttons */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-snug);
  border-radius: var(--radius-md);
  transition: transform var(--transition-spring), box-shadow var(--transition-base), background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

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

.btn--primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 109, 250, 0.30);
}

.btn--primary:hover {
  box-shadow: 0 8px 28px rgba(124, 109, 250, 0.42);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn--ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Hero Stats Row */
.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat strong {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  font-weight: var(--fw-medium);
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-default);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   11. PAGE LAYOUT: CONTENT + SIDEBAR GRID
   This layout is shared by the homepage AND all game pages.
   Game pages inherit this structure from their own HTML.
   ═══════════════════════════════════════════════════════════════════ */

.page-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--space-10);
  align-items: start;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.content-column {
  min-width: 0; /* prevent grid blowout */
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   12. GAME CARDS
   ═══════════════════════════════════════════════════════════════════ */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--space-6);
}

.game-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.game-card:hover,
.game-card.is-hovered {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-accent);
}

/* Full-card clickable overlay — sits below all content */
.game-card-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

/* Card icon area */
.game-card-icon {
  padding: var(--space-8) var(--space-8) var(--space-4);
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* Subtle top-left glow on hover */
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.game-card:hover::before,
.game-card.is-hovered::before {
  opacity: 1;
}

.game-card-body {
  padding: 0 var(--space-8) var(--space-8);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.game-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

.game-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.game-card-title a:hover {
  color: var(--accent-purple);
  text-decoration: none;
}

.game-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-loose);
  max-width: none;
  flex: 1;
}

.game-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.game-tag {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.game-tag + .game-tag::before {
  content: '·';
  margin-right: var(--space-2);
  color: var(--border-strong);
}

.play-btn {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--accent-purple);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  position: relative;
  z-index: 2;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--accent-purple-dim);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.play-btn:hover {
  background: var(--accent-purple);
  color: #fff;
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════════
   13. GAMES SECTION
   ═══════════════════════════════════════════════════════════════════ */

.games-section {
  margin-bottom: var(--space-4);
}


/* ═══════════════════════════════════════════════════════════════════
   14. ABOUT / SEO TEXT SECTION
   ═══════════════════════════════════════════════════════════════════ */

.about-section {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border-subtle);
}

.about-section h2 {
  font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-2xl));
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.about-section h3 {
  font-size: var(--fs-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.about-section p {
  margin-bottom: var(--space-4);
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  color: var(--text-secondary);
}

.about-section p + p {
  margin-top: 0;
}

.about-section a {
  color: var(--accent-purple);
  text-underline-offset: 3px;
}


/* ═══════════════════════════════════════════════════════════════════
   15. SIDEBAR COMPONENTS
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-base);
}

.sidebar-card:hover {
  border-color: var(--border-default);
}

.sidebar-card--fun {
  background: var(--bg-tertiary);
}

.sidebar-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: var(--ls-snug);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* How-to list in sidebar */
.howto-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.howto-list li a {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.howto-list li a:hover {
  background: var(--bg-surface);
  text-decoration: none;
}

.howto-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.howto-list strong {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.howto-list p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: var(--lh-snug);
  max-width: none;
  margin: 0;
}

/* Fun facts list */
.fun-facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.fun-facts li {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
  padding-left: var(--space-5);
  position: relative;
}

.fun-facts li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-teal);
  font-weight: var(--fw-bold);
}

.fun-facts strong {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}


/* ═══════════════════════════════════════════════════════════════════
   16. BADGE SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.6;
}

.badge--purple {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid rgba(124, 109, 250, 0.2);
}

.badge--teal {
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  border: 1px solid rgba(62, 207, 207, 0.2);
}

.badge--amber {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.badge--red {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(240, 82, 82, 0.2);
}

.badge--ai {
  background: linear-gradient(135deg, var(--accent-purple-dim), var(--accent-teal-dim));
  color: var(--accent-teal);
  border: 1px solid rgba(62, 207, 207, 0.15);
}

.badge--score {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 166, 35, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════
   17. SITE FOOTER
   ═══════════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-12);
  margin-top: var(--space-4);
}

.footer-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-tagline {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: none;
  margin: 0;
  line-height: var(--lh-normal);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.footer-nav-col h4 {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-4);
}

.footer-nav-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-nav-col a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav-col a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer-bottom {
  padding: var(--space-5) var(--container-pad);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  max-width: none;
  margin: 0;
  line-height: var(--lh-normal);
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--accent-purple);
}


/* ═══════════════════════════════════════════════════════════════════
   18. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tablet — ≤ 1024px ──────────────────────────────────────────── */
@media (max-width: 1024px) {

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--space-5);
  }

  .ad-sidebar-tall {
    display: none; /* Hide 300×600 on tablet — too tall for horizontal sidebar */
  }

}

/* ── Mobile Landscape / Small Tablet — ≤ 768px ─────────────────── */
@media (max-width: 768px) {

  :root {
    --header-h: 60px;
  }

  /* Show hamburger, hide desktop nav */
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  /* Hero */
  .hero {
    padding: var(--space-12) 0 var(--space-8);
    text-align: center;
  }

  .hero-inner {
    max-width: 100%;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-sub {
    margin-inline: auto;
  }

  /* Leaderboard — switch to mobile banner */
  .ad-leaderboard {
    max-width: var(--ad-mobile-banner-w);
    height: var(--ad-mobile-banner-h);
  }

  /* Game cards: single column */
  .games-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  /* Sidebar: single column cards */
  .sidebar {
    grid-template-columns: 1fr;
  }

  .ad-sidebar-rect,
  .ad-sidebar-tall {
    display: none; /* Sidebar ads hidden on mobile — use inline ad instead */
  }

}

/* ── Mobile Portrait — ≤ 480px ──────────────────────────────────── */
@media (max-width: 480px) {

  .logo-icon {
    display: none; /* Keep wordmark only on tiny screens */
  }

  .hero-title {
    font-size: var(--fs-2xl);
  }

  .btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
  }

  .hero-cta {
    flex-direction: column;
  }

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

  .hero-stats {
    gap: var(--space-4);
  }

  .stat strong {
    font-size: var(--fs-xl);
  }

}

/* ── Very small — ≤ 360px ───────────────────────────────────────── */
@media (max-width: 360px) {
  :root {
    --container-pad: 0.875rem;
  }

  .hero-badge {
    font-size: 0.65rem;
  }

  .game-card-body {
    padding: 0 var(--space-5) var(--space-5);
  }

  .game-card-icon {
    padding: var(--space-6) var(--space-5) var(--space-3);
  }
}


/* ═══════════════════════════════════════════════════════════════════
   19. REDUCED MOTION
   Respects user OS setting — no animations for users who prefer none
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-badge::before {
    animation: none;
  }

  .game-card:hover,
  .game-card.is-hovered {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  .theme-toggle:hover {
    transform: none;
  }

}


/* ═══════════════════════════════════════════════════════════════════
   GAME PAGE SHARED LAYOUT
   These rules are used by all individual game pages (games//index.html)
   They define the sidebar + game area two-column layout that each
   game file will inherit by linking to this same style.css.
   ═══════════════════════════════════════════════════════════════════ */

/* Game area wrapper — sits in .content-column on game pages */
.game-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  min-height: 400px;
}

/* Game controls bar (restart, difficulty, fullscreen) */
.game-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  width: 100%;
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.game-controls-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.control-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.control-btn--primary {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border-color: var(--border-accent);
}

.control-btn--primary:hover {
  background: var(--accent-purple);
  color: #fff;
}

/* Difficulty selector */
.difficulty-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.difficulty-select:hover,
.difficulty-select:focus {
  border-color: var(--border-accent);
  color: var(--text-primary);
  outline: none;
}

/* Score / stat row above game canvas */
.game-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  width: 100%;
}

.game-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.game-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  font-weight: var(--fw-medium);
}

.game-stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1;
}

/* Game status message (win/lose/draw) */
.game-status {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  text-align: center;
  min-height: 1.5em;
}

.game-status--win    { color: var(--accent-green); }
.game-status--lose   { color: var(--accent-red); }
.game-status--draw   { color: var(--accent-amber); }

/* Shared game instructions panel (inside sidebar on game pages) */
.game-instructions {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.game-instructions h2 {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.game-instructions p,
.game-instructions li {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-loose);
}

.game-instructions ul,
.game-instructions ol {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.game-instructions ul li {
  list-style: disc;
}

.game-instructions ol li {
  list-style: decimal;
}

.game-instructions h3 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

/* Session stats card (shown in sidebar on game pages) */
.session-stats {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.session-stats-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.session-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.session-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.session-stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1;
}

.session-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

/* ═══════════════════════════════════════════════════════════════════
   20. MOBILE CLICK FIX — CRITICAL
   Fixes the issue where buttons/controls don't respond on mobile
   ═══════════════════════════════════════════════════════════════════ */

/* Ensure all interactive elements have proper pointer-events */
button,
a,
.control-btn,
.primary-btn,
.secondary-btn,
.nav-toggle,
.theme-toggle,
.play-btn,
.game-card-link,
.game-card a,
.difficulty-select,
.rt-pad,
.simon-btn,
.cf-cell,
.ttt-cell,
.ws-cell,
.ad-container,
.adsbygoogle,
.adsbygoogle * {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Fix for mobile nav overlay - ensure it doesn't block clicks */
.nav-overlay {
  pointer-events: none !important;
}

.nav-overlay.is-visible {
  pointer-events: auto !important;
}

/* Ensure mobile nav links are clickable */
.mobile-nav a {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Fix for game cards - ensure links work on mobile */
.game-card-link {
  pointer-events: auto !important;
}

.game-card a {
  pointer-events: auto !important;
  position: relative;
  z-index: 5;
}

/* Ensure all buttons work on touch devices */
button,
[role="button"],
input[type="submit"],
input[type="button"],
.btn,
.control-btn {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Fix for any potential overlay issues */
.game-area,
.game-controls,
.game-stats-row,
.game-status,
.ad-strip,
.ad-inline-wrap,
.ad-sidebar-wrap,
.sidebar,
.sidebar-card,
.site-header,
.site-footer,
main,
section,
article,
div,
span,
p,
h1, h2, h3, h4, h5, h6 {
  pointer-events: auto !important;
}

/* Ensure canvas doesn't block clicks on mobile */
canvas {
  pointer-events: auto !important;
  touch-action: none !important;
}

/* Fix for select dropdowns on mobile */
.difficulty-select,
select {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Ensure all interactive elements work on touch */
@media (hover: none) {
  button,
  a,
  .control-btn,
  .primary-btn,
  .secondary-btn,
  .nav-toggle,
  .theme-toggle,
  .play-btn,
  .game-card-link,
  .game-card a,
  .difficulty-select,
  .rt-pad,
  .simon-btn,
  .cf-cell,
  .ttt-cell,
  .ws-cell {
    cursor: default !important;
    touch-action: manipulation !important;
  }
}

/* Fix for iOS Safari click delay */
a, button, input, select, textarea {
  cursor: pointer !important;
  touch-action: manipulation !important;
}

/* Ensure ad containers don't block clicks */
.ad-container,
.ad-placeholder,
.adsbygoogle {
  pointer-events: none !important;
}

.ad-container .adsbygoogle {
  pointer-events: auto !important;
}

/* Fix for any element with pointer-events: none that shouldn't have it */
* {
  pointer-events: auto !important;
}

/* Exception: elements that should have pointer-events: none */
.ad-placeholder,
.ad-placeholder *,
[aria-hidden="true"]:not(.mobile-nav):not(.nav-overlay):not(.game-card-link) {
  pointer-events: none !important;
}

/* But ensure interactive elements inside aria-hidden are clickable */
[aria-hidden="true"] .control-btn,
[aria-hidden="true"] button,
[aria-hidden="true"] a {
  pointer-events: auto !important;
}
