/* ==========================================================================
   FreeOnlineGames.win — Dark Glassmorphism & Web Design Guidelines Stylesheet
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-obsidian: #07090e;
  --bg-surface: rgba(15, 23, 42, 0.72);
  --bg-surface-elevated: rgba(30, 41, 59, 0.78);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-neon: rgba(34, 211, 238, 0.45);
  --accent-cyan: #22d3ee;
  --accent-violet: #a855f7;
  --accent-emerald: #10b981;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: #f8fafc;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-obsidian);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(6, 182, 212, 0.11) 0%, transparent 38%),
    radial-gradient(circle at 88% 22%, rgba(168, 85, 247, 0.10) 0%, transparent 42%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Web Design Guidelines: Typography & Numerals */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.heading-balance {
  text-wrap: balance;
}

.body-pretty {
  text-wrap: pretty;
}

/* Web Design Guidelines: High-Contrast Keyboard Focus Ring */
:focus-visible {
  outline: 2px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

/* Web Design Guidelines: Minimum 44x44px Hit Targets for Interactive Controls */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

/* Glassmorphism Surfaces */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
}

.glass-card {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.85) 0%, rgba(11, 15, 25, 0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease,
              box-shadow 0.22s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-neon);
  box-shadow: 0 16px 36px -10px rgba(6, 182, 212, 0.22),
              0 0 20px -4px rgba(168, 85, 247, 0.16);
}

/* CLS-Safe Google AdSense Placeholders */
.ad-slot-container {
  position: relative;
  background: repeating-linear-gradient(
    -45deg,
    rgba(15, 23, 42, 0.65),
    rgba(15, 23, 42, 0.65) 12px,
    rgba(30, 41, 59, 0.45) 12px,
    rgba(30, 41, 59, 0.45) 24px
  );
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot-leaderboard {
  min-height: 90px;
  width: 100%;
  max-width: 728px;
}

.ad-slot-rectangle {
  min-height: 250px;
  width: 100%;
}

.ad-slot-skyscraper {
  min-height: 300px;
  width: 100%;
}

.ad-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Game Canvas Viewport & Touch Ergonomics */
.game-stage-wrapper {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1rem;
  overflow: hidden;
  background: #050811;
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.8),
              0 0 25px -5px rgba(6, 182, 212, 0.18);
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Fullscreen support for Game Stage */
.game-arena-card:fullscreen {
  background: #050811;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  overflow-y: auto;
}

.game-arena-card:fullscreen .game-stage-wrapper {
  max-width: min(82vh, 92vw);
}

/* Web Design Guidelines: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .glass-card,
  .animate-pulse,
  .transition-all,
  .transition-transform {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
