/* ==========================================================================
   Qavra Games - Jogos de Puzzle Online Gratis
   Sistema de Design e Estilos Globais
   ========================================================================== */

/* CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  /* Colors - Dark Theme with Vibrant Accents */
  --color-bg-primary: #0f1419;
  --color-bg-secondary: #1a1f2e;
  --color-bg-tertiary: #242b3d;
  --color-bg-card: #1e2433;
  --color-bg-hover: #2a3245;

  --color-accent-primary: #8b5cf6;
  --color-accent-secondary: #7c3aed;
  --color-accent-tertiary: #06b6d4;
  --color-accent-success: #10b981;
  --color-accent-warning: #f59e0b;
  --color-accent-error: #ef4444;

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --color-text-muted: #475569;

  --color-border: #334155;
  --color-border-light: #1e293b;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --gradient-card: linear-gradient(145deg, #1e2433 0%, #242b3d 100%);
  --gradient-hero: linear-gradient(180deg, #0f1419 0%, #1a1f2e 100%);

  /* Typography - System Fonts */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Font Sizes */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-base: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing Scale */
  --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;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --shadow-glow: 0 0 20px rgb(139 92 246 / 0.3);
  --shadow-glow-success: 0 0 20px rgb(16 185 129 / 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Container */
  --container-max: 1200px;
  --container-narrow: 800px;
}

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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

a:hover {
  color: var(--color-accent-secondary);
}

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* Skip Link (Accessibility)
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent-primary);
  color: var(--color-text-primary);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Container
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Header & Navigation
   ========================================================================== */
.header {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(10px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  gap: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
}

.header__logo:hover {
  color: var(--color-accent-primary);
}

.header__logo svg {
  width: 36px;
  height: 36px;
  fill: var(--color-accent-primary);
}

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

.nav__link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
}

.nav__link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.nav__link--active {
  color: var(--color-accent-primary);
  background: rgba(139, 92, 246, 0.1);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text-primary);
}

.nav__toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .nav__toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-secondary);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-8) var(--space-4);
    gap: var(--space-2);
    transition: right var(--transition-base);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
  }

  .nav--open {
    right: 0;
  }

  .nav__link {
    padding: var(--space-4);
    font-size: var(--font-size-lg);
  }

  .nav__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: var(--space-2);
  }

  .nav__close svg {
    width: 24px;
    height: 24px;
  }

  .nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
  }

  .nav__overlay--visible {
    display: block;
  }
}

/* Hero Section
   ========================================================================== */
.hero {
  background: var(--gradient-hero);
  padding: var(--space-16) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(139, 92, 246, 0.2);
  color: var(--color-accent-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.hero__title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-6);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-12) 0;
  }

  .hero__title {
    font-size: var(--font-size-3xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-lg);
  }
}

/* Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--gradient-primary);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn--secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

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

.btn--success {
  background: var(--color-accent-success);
  color: var(--color-text-primary);
}

.btn--success:hover {
  background: #0d9668;
}

.btn--danger {
  background: var(--color-accent-error);
  color: var(--color-text-primary);
}

.btn--danger:hover {
  background: #dc2626;
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
}

.btn--icon {
  padding: var(--space-3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* Cards
   ========================================================================== */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.card__image {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
  background: var(--color-bg-tertiary);
}

.card__content {
  padding: var(--space-6);
}

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card__description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

/* Game Cards Grid
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
  padding: var(--space-12) 0;
}

.game-card {
  position: relative;
}

.game-card__badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-accent-success);
  color: var(--color-text-primary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  z-index: 1;
}

.game-card__stats {
  display: flex;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.game-card__stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.game-card__stat svg {
  width: 16px;
  height: 16px;
}

/* Section Styles
   ========================================================================== */
.section {
  padding: var(--space-16) 0;
}

.section--alt {
  background: var(--color-bg-secondary);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section__title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-4);
}

.section__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Trust Badges
   ========================================================================== */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-8) 0;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

.trust-badge svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent-success);
}

.trust-badge__text {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.trust-badge__subtext {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* How It Works
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-8);
}

.step {
  text-align: center;
  padding: var(--space-6);
}

.step__number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.step__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

.step__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Footer
   ========================================================================== */
.footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-12) 0 var(--space-6);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.footer__brand {
  max-width: 300px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.footer__logo svg {
  width: 32px;
  height: 32px;
  fill: var(--color-accent-primary);
}

.footer__description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.footer__column-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

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

.footer__link {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.footer__link:hover {
  color: var(--color-accent-primary);
}

.footer__bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.footer__copyright {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.footer__compliance {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  margin-top: var(--space-6);
}

.footer__compliance-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.footer__compliance-text strong {
  color: var(--color-accent-success);
}

/* Forms
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-accent-error);
  margin-top: var(--space-1);
}

/* Tables
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.table th {
  background: var(--color-bg-tertiary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  background: var(--color-bg-secondary);
}

.table tbody tr:hover td {
  background: var(--color-bg-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table__rank {
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-primary);
}

.table__rank--gold {
  color: #fbbf24;
}

.table__rank--silver {
  color: #9ca3af;
}

.table__rank--bronze {
  color: #d97706;
}

/* Tabs
   ========================================================================== */
.tabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab {
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.tab--active {
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content--active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Rating Widget
   ========================================================================== */
.rating-widget {
  padding: var(--space-6);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

.rating-widget__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.rating-stars {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.rating-star {
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.rating-star:hover,
.rating-star--active {
  color: var(--color-accent-warning);
  transform: scale(1.1);
}

.rating-number-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.rating-number-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rating-number-btn:hover {
  border-color: var(--color-accent-primary);
  color: var(--color-accent-primary);
}

.rating-number-btn--active {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

.rating-display {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.rating-display__average {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-warning);
}

.rating-display__info {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* Modal
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-overlay--visible {
  display: flex;
}

.modal {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
}

.modal__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.modal__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.modal__close svg {
  width: 24px;
  height: 24px;
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

/* Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
}

.toast {
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: toastIn 0.3s ease;
}

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

.toast--success { border-color: var(--color-accent-success); }
.toast--success svg { color: var(--color-accent-success); }
.toast--error { border-color: var(--color-accent-error); }
.toast--error svg { color: var(--color-accent-error); }
.toast--warning { border-color: var(--color-accent-warning); }
.toast--warning svg { color: var(--color-accent-warning); }

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
  font-size: var(--font-size-sm);
}

.toast__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: var(--space-1);
}

/* Game Board Styles
   ========================================================================== */
.game-container {
  max-width: 800px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
}

.game-info {
  display: flex;
  gap: var(--space-6);
}

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

.game-stat__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-stat__value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.game-controls {
  display: flex;
  gap: var(--space-2);
}

.game-board {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.game-status {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-semibold);
}

.game-status--highlight {
  background: rgba(139, 92, 246, 0.2);
  color: var(--color-accent-primary);
}

.game-status--success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-accent-success);
}

.game-status--warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-accent-warning);
}

/* 2048 Game
   ========================================================================== */
.g2048-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  background: var(--color-bg-tertiary);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  max-width: 400px;
  margin: 0 auto;
}

.g2048-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  font-size: 1.5rem;
  transition: all var(--transition-fast);
}

.g2048-cell--empty { background: var(--color-bg-secondary); }
.g2048-cell--2 { background: #eee4da; color: #776e65; }
.g2048-cell--4 { background: #ede0c8; color: #776e65; }
.g2048-cell--8 { background: #f2b179; color: #f9f6f2; }
.g2048-cell--16 { background: #f59563; color: #f9f6f2; }
.g2048-cell--32 { background: #f67c5f; color: #f9f6f2; }
.g2048-cell--64 { background: #f65e3b; color: #f9f6f2; }
.g2048-cell--128 { background: #edcf72; color: #f9f6f2; font-size: 1.25rem; }
.g2048-cell--256 { background: #edcc61; color: #f9f6f2; font-size: 1.25rem; }
.g2048-cell--512 { background: #edc850; color: #f9f6f2; font-size: 1.25rem; }
.g2048-cell--1024 { background: #edc53f; color: #f9f6f2; font-size: 1rem; }
.g2048-cell--2048 { background: #edc22e; color: #f9f6f2; font-size: 1rem; }
.g2048-cell--super { background: #3c3a32; color: #f9f6f2; font-size: 0.875rem; }

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

.g2048-cell--new {
  animation: g2048Pop 0.2s ease;
}

/* Snake Game
   ========================================================================== */
.snake-canvas-wrapper {
  max-width: 400px;
  margin: 0 auto;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  border: 2px solid var(--color-border);
}

.snake-canvas {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
}

.snake-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  max-width: 180px;
  margin: var(--space-4) auto 0;
}

.snake-controls button {
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.snake-controls button:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent-primary);
}

.snake-controls button:active {
  transform: scale(0.95);
}

/* Simon Says Game
   ========================================================================== */
.simon-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  max-width: 320px;
  margin: 0 auto;
}

.simon-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-xl);
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.simon-btn:hover {
  opacity: 0.8;
}

.simon-btn--active {
  opacity: 1 !important;
  transform: scale(1.05);
  box-shadow: 0 0 30px currentColor;
}

.simon-btn--green { background: #22c55e; border-color: #16a34a; color: #22c55e; }
.simon-btn--red { background: #ef4444; border-color: #dc2626; color: #ef4444; }
.simon-btn--yellow { background: #eab308; border-color: #ca8a04; color: #eab308; }
.simon-btn--blue { background: #3b82f6; border-color: #2563eb; color: #3b82f6; }

.simon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.simon-score {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
}

/* Submit Score Form
   ========================================================================== */
.score-form {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--color-border-light);
}

.score-form__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.score-form__title svg {
  color: var(--color-accent-success);
}

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

@media (max-width: 480px) {
  .score-form__row {
    grid-template-columns: 1fr;
  }
}

/* Leaderboard Preview
   ========================================================================== */
.leaderboard-preview {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--color-border-light);
}

.leaderboard-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.leaderboard-preview__title {
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.leaderboard-preview__title svg {
  color: var(--color-accent-warning);
}

/* Page Header
   ========================================================================== */
.page-header {
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
  background: var(--gradient-hero);
}

.page-header__title {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
}

.page-header__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}

.breadcrumb a {
  color: var(--color-text-tertiary);
}

.breadcrumb a:hover {
  color: var(--color-accent-primary);
}

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

/* Policy Pages
   ========================================================================== */
.policy-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-12) var(--space-4);
}

.policy-content h2 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-light);
}

.policy-content h3 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.policy-content p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
}

.policy-content ul,
.policy-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.policy-content li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
  list-style: disc;
}

.policy-content ol li {
  list-style: decimal;
}

.policy-meta {
  background: var(--color-bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* Contact Form
   ========================================================================== */
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  padding: var(--space-12) 0;
}

@media (max-width: 768px) {
  .contact-section {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.contact-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
}

.contact-item__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item__icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.contact-item__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-1);
}

.contact-item__value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* Utilities
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

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

@media (max-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* Print Styles
   ========================================================================== */
@media print {
  .header,
  .footer,
  .nav,
  .btn,
  .game-controls {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    break-inside: avoid;
  }
}
