/* ==========================================================================
   Pokiieplay — Design System
   Light & dark gaming themes · glassmorphism · fluid type · zero-CLS cards
   ========================================================================== */

/* ---------- Design tokens (light theme — default) ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg-0: #eef1f8;
  --bg-1: #ffffff;
  --bg-2: #e6eaf3;
  --glass: rgba(15, 27, 50, 0.04);
  --glass-strong: rgba(15, 27, 50, 0.08);
  --border: rgba(15, 27, 50, 0.1);
  --border-strong: rgba(15, 27, 50, 0.18);

  /* Text */
  --text-1: #111a2b;
  --text-2: #45536b;
  --text-3: #71809b;

  /* Brand */
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --amber: #f59e0b;
  --accent: #0e7490; /* accessible accent for text & icons on light surfaces */
  --gradient-brand: linear-gradient(100deg, #0891b2, var(--violet) 55%, #db2777);

  /* Effects */
  --shadow-1: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-2: 0 12px 32px rgba(16, 24, 40, 0.14);
  --shadow-glow: 0 8px 40px rgba(139, 92, 246, 0.18);
  --ring: 0 0 0 3px rgba(8, 145, 178, 0.4);

  /* Theme-dependent surfaces */
  --header-bg: rgba(255, 255, 255, 0.85);
  --searchbar-bg: rgba(250, 251, 254, 0.97);
  --mobile-nav-bg: rgba(255, 255, 255, 0.98);
  --shimmer-hi: rgba(15, 27, 50, 0.06);
  --glow-a: rgba(139, 92, 246, 0.07);
  --glow-b: rgba(34, 211, 238, 0.06);

  /* Shape & motion */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --header-h: 68px;
  --content-w: 1440px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Dark theme overrides ---------- */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg-0: #070b14;
  --bg-1: #0c1220;
  --bg-2: #131b2e;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-1: #f1f5fb;
  --text-2: #9aa7bd;
  --text-3: #64748b;

  --amber: #fbbf24;
  --accent: #22d3ee;
  --gradient-brand: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--pink));

  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 8px 40px rgba(139, 92, 246, 0.28);
  --ring: 0 0 0 3px rgba(34, 211, 238, 0.45);

  --header-bg: rgba(9, 13, 24, 0.82);
  --searchbar-bg: rgba(12, 18, 32, 0.96);
  --mobile-nav-bg: rgba(9, 13, 24, 0.98);
  --shimmer-hi: rgba(255, 255, 255, 0.05);
  --glow-a: rgba(139, 92, 246, 0.13);
  --glow-b: rgba(34, 211, 238, 0.09);
}

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

html {
  scroll-behavior: smooth;
  overflow-y: scroll; /* stable scrollbar — prevents layout shift between pages */
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 500px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(900px 450px at -10% 15%, var(--glow-b), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* Accessibility: visible focus without hurting mouse users */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 2000;
  padding: 0.6rem 1.2rem;
  background: var(--violet);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Utilities ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

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

/* ==========================================================================
   Header & navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--content-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.brand img {
  width: auto;
  height: 40px;
  display: block;
}

@media (max-width: 640px) {
  .brand img {
    height: 32px;
  }
}

/* Desktop nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.main-nav > a,
.nav-drop-btn {
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s, background-color 0.2s;
}

.main-nav > a:hover,
.nav-drop-btn:hover {
  color: var(--text-1);
  background: var(--glass-strong);
}

.main-nav > a.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.09);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-drop-btn .caret {
  transition: transform 0.25s var(--ease);
}

.nav-drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  min-width: 190px;
  padding: 0.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  display: grid;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}

.nav-dropdown.open .nav-drop-menu,
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown.open .caret,
.nav-dropdown:hover .caret {
  transform: rotate(180deg);
}

.nav-drop-menu a {
  padding: 0.55rem 0.9rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s, background-color 0.15s;
}

.nav-drop-menu a:hover,
.nav-drop-menu a.active {
  color: var(--text-1);
  background: var(--glass-strong);
}

/* Header action buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: color 0.2s, background-color 0.2s;
}

.icon-btn:hover {
  color: var(--accent);
  background: var(--glass-strong);
}

.menu-btn {
  display: none;
}

/* Theme toggle: shows the icon of the mode you can switch TO */
.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Slide-down search bar */
.search-bar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 990;
  padding: 0.9rem 1.5rem;
  background: var(--searchbar-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  transform: translateY(-130%);
  visibility: hidden;
  transition: transform 0.35s var(--ease), visibility 0.35s;
}

.search-bar.open {
  transform: translateY(0);
  visibility: visible;
}

.search-bar form {
  width: 100%;
  max-width: 720px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  border-radius: var(--r-full);
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-3);
}

.search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.search-bar .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-3);
  pointer-events: none;
}

/* ---------- Live search suggestions ---------- */
.search-suggest {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 0.35rem;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  display: none;
}

.search-suggest.open {
  display: block;
}

/* Same card grid as the site's game rows, sized to fit the dropdown. */
.suggest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  padding: 0.5rem;
}

@media (max-width: 560px) {
  .suggest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* The lift-on-hover from .game-card would clip inside a scrolling panel. */
.suggest-grid .suggest-item:hover,
.suggest-grid .suggest-item:focus-visible {
  transform: none;
}

.suggest-grid .suggest-item.active {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: var(--shadow-glow);
}

.suggest-empty,
.suggest-all {
  display: block;
  padding: 0.7rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

.suggest-all {
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.suggest-all:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.75rem 0 1.4rem;
}

.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.section-title::before {
  content: "";
  width: 5px;
  height: 1.35em;
  border-radius: var(--r-full);
  background: var(--gradient-brand);
  flex-shrink: 0;
}

.section-count {
  font-size: 0.9rem;
  color: var(--text-3);
  white-space: nowrap;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 260px at 15% 0%, rgba(139, 92, 246, 0.22), transparent 65%),
    radial-gradient(500px 240px at 90% 100%, rgba(34, 211, 238, 0.16), transparent 60%),
    var(--bg-1);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  margin-bottom: 2.5rem;
  animation: fade-in 0.5s var(--ease);
}

.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 22ch;
}

.hero p {
  margin-top: 0.75rem;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-2);
  max-width: 55ch;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.chip {
  padding: 0.45rem 1.1rem;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}

.chip:hover {
  color: #fff;
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.18);
  transform: translateY(-2px);
}

.chip.active {
  color: #071018;
  background: var(--cyan);
  border-color: var(--cyan);
}

/* ==========================================================================
   Game grid & cards
   ========================================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  animation: fade-in 0.4s var(--ease) both;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: var(--shadow-glow);
}

/* Fixed aspect ratio + placeholder tone: images never cause layout shift */
.card-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(110deg, var(--bg-2) 40%, var(--shimmer-hi) 50%, var(--bg-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.card-thumb.loaded {
  animation: none;
  background: var(--bg-2);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.game-card:hover .card-thumb img {
  transform: scale(1.07);
}

.card-body {
  padding: 0.8rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 0.15rem 0.6rem;
  border-radius: var(--r-full);
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.rating svg {
  width: 13px;
  height: 13px;
  color: var(--amber);
}

/* Ribbon badges (NEW / HOT) */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.6rem;
  border-radius: var(--r-full);
  color: #fff;
  box-shadow: var(--shadow-1);
}

.card-badge.badge-new {
  background: linear-gradient(90deg, #10b981, #22d3ee);
}

.card-badge.badge-hot {
  background: linear-gradient(90deg, #f43f5e, #fb923c);
}

/* Favourite toggle */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  color: #fff;
  background: rgba(7, 11, 20, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.2s var(--ease), background-color 0.2s;
}

.fav-btn:hover {
  transform: scale(1.12);
  background: rgba(7, 11, 20, 0.85);
}

.fav-btn.active {
  color: var(--pink);
}

/* ==========================================================================
   Buttons & forms
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-1);
  background: var(--glass);
  border: 1px solid var(--border-strong);
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.btn:hover {
  color: var(--accent);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-1px);
}

.btn-primary {
  color: #071018;
  background: linear-gradient(100deg, var(--cyan), #67e8f9);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35);
}

.btn-primary:hover {
  color: #071018;
  background: linear-gradient(100deg, #67e8f9, var(--cyan));
  border-color: transparent;
  transform: translateY(-2px);
}

/* ==========================================================================
   Category pages
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}

/* ==========================================================================
   Game player page
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-3);
  margin-bottom: 1.1rem;
}

.breadcrumb a {
  color: var(--text-2);
  transition: color 0.2s;
}

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

.breadcrumb [aria-current] {
  color: var(--text-1);
  font-weight: 600;
}

.player-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.iframe-container {
  position: relative;
  width: 100%;
  /* Overridden per-game by game.js once the bundled game reports its own
     canvas size; 16/9 stays the default for cross-origin games we can't read. */
  aspect-ratio: var(--player-ratio, 16 / 9);
  /* Games whose UI is absolutely positioned against the viewport need a floor on
     height, not just a ratio: their menus size from a font-size that stops
     shrinking, so a ratio-only box keeps getting shorter as it narrows and clips
     the UI. Opt in per game via minHeight in the catalog. */
  min-height: var(--player-min-height, 0px);
  max-height: 78vh;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

.iframe-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Tall/portrait games would otherwise overflow the viewport at width:100%.
   Cap the width so the ratio is kept and the box stays inside max-height. */
.iframe-container.is-portrait {
  width: auto;
  max-width: 100%;
  height: 78vh;
  margin-inline: auto;
}

.iframe-container.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  max-height: none;
  /* Fullscreen already gives the game the whole screen; a leftover floor would
     only push the box past the viewport. */
  min-height: 0;
  border-radius: 0;
  border: none;
}

/* Click-to-play overlay */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: rgba(7, 11, 20, 0.65);
  transition: opacity 0.35s var(--ease);
}

.game-overlay.hidden-overlay {
  opacity: 0;
  pointer-events: none;
}

.ov-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: blur(3px);
  z-index: -1;
}

.play-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 2.4rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #071018;
  background: linear-gradient(100deg, var(--cyan), #67e8f9);
  border-radius: var(--r-full);
  box-shadow: 0 10px 40px rgba(34, 211, 238, 0.4);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 50px rgba(34, 211, 238, 0.55);
}

.ov-status {
  min-height: 1.4em;
  color: var(--text-2);
  font-size: 0.9rem;
  text-align: center;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Game info panel */
.game-info-panel {
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.g-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.g-header h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.g-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.g-about-title {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
}

.g-desc {
  color: var(--text-2);
  max-width: 75ch;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tag-list .chip {
  font-size: 0.78rem;
  padding: 0.3rem 0.85rem;
}

/* ==========================================================================
   Static content pages (about / contact / privacy ...)
   ========================================================================== */
.page-panel {
  max-width: 820px;
  margin: 1rem auto 0;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: var(--r-lg);
  animation: rise-in 0.45s var(--ease);
}

.page-panel h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-panel h2 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.page-panel p {
  color: var(--text-2);
  margin-bottom: 1rem;
}

.page-panel strong {
  color: var(--text-1);
}

.page-panel a:not(.btn) {
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}

.footer-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2.5rem;
}

.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-3);
  max-width: 32ch;
}

.footer-col h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-1);
  margin-bottom: 0.9rem;
}

.footer-col ul {
  display: grid;
  gap: 0.5rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-2);
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ==========================================================================
   States
   ========================================================================== */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
  font-size: 1.05rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .main-nav > a,
  .nav-drop-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  /* Mobile navigation: slide-down panel */
  .menu-btn {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 980;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin: 0;
    padding: 1rem 1.25rem 1.5rem;
    background: var(--mobile-nav-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-115%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0.35s;
  }

  body.nav-open .main-nav {
    transform: translateY(0);
    visibility: visible;
  }

  .main-nav > a,
  .nav-drop-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    justify-content: space-between;
  }

  /* Dropdown becomes an inline accordion */
  .nav-drop-menu {
    position: static;
    translate: 0 0;
    transform: none;
    min-width: 0;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 1rem;
    display: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-dropdown.open .nav-drop-menu {
    display: grid;
  }

  .nav-dropdown:hover:not(.open) .nav-drop-menu {
    display: none;
  }

  .header-inner {
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.9rem;
  }

  .g-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

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

@media (min-width: 1600px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

/* ==========================================================================
   Arcade page — coin balance, filter chips, coin cards
   ========================================================================== */

/* Chips are <button> on the arcade filter bar; the base .chip rules were
   written for <a>, so pick up the inherited typography and reset the box. */
button.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: normal;
}

/* ---------- Header coin balance ---------- */
.coin-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-1);
  white-space: nowrap;
}

.coin-icon {
  color: var(--amber);
  flex-shrink: 0;
}

.coin-value {
  font-variant-numeric: tabular-nums;
}

/* ---------- Result count ---------- */
.result-count {
  color: var(--text-3);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Coin cards ---------- */
.coin-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.coin-users,
.coin-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.coin-users {
  color: var(--text-3);
}

.coin-cost {
  color: var(--text-1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-full);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-variant-numeric: tabular-nums;
}

/* ---------- Insufficient-balance note ---------- */
.coin-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--text-1);
  font-size: 0.9rem;
  font-weight: 600;
}

.game-card.shake {
  animation: shake 0.35s var(--ease);
}

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

/* ---------- About block ---------- */
.about-block {
  margin-top: 3rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-1);
}

.about-block h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.about-block p {
  color: var(--text-2);
  max-width: 75ch;
  line-height: 1.7;
}

.about-block p + p {
  margin-top: 0.85rem;
}

@media (max-width: 560px) {
  .coin-balance {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
  }
}
