/* ==========================================================================
   GameVault – main stylesheet
   Order: base → layout → buttons → badges → section → header → drawer
          → sidebar → hero → game card → footer
   ========================================================================== */

/* Fonts: Plus Jakarta Sans variable font (400–800), self-hosted, SIL OFL 1.1
   (assets/vendor/fonts/OFL.txt). Not preloaded: font preloads are blocked when the
   page is opened from disk (file://), and font-display: swap keeps text visible anyway.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Base
   ========================================================================== */

/* Overflow safety net; layouts must still not overflow. `hidden` on body
   would make it a scroll container and break position: sticky, so body uses clip. */
html {
  overflow-x: hidden;
}

body {
  overflow-x: clip;
}

body {
  background-color: var(--gv-color-bg);
  color: var(--gv-color-text);
  font-family: var(--gv-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  line-height: var(--gv-line-height-tight);
  font-weight: var(--gv-font-weight-heavy);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
}

/* SVG icons from the sprite in assets/js/icons.js; sized like the text around them. */
.bi {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
}

:focus-visible {
  outline: none;
  box-shadow: var(--gv-focus-ring);
}

#main-content:focus {
  outline: none; /* skip-link target; not interactive */
}

.gv-skip-link {
  position: absolute;
  top: var(--gv-space-2);
  left: var(--gv-space-2);
  z-index: var(--gv-z-skip);
  padding: var(--gv-space-2) var(--gv-space-3);
  background: var(--gv-accent);
  color: var(--gv-accent-ink);
  font-weight: var(--gv-font-weight-bold);
  border-radius: var(--gv-radius-sm);
}

/* Forced colours (Windows High Contrast) drop box-shadows, which carry all our
   focus rings. Use system-colour outlines instead. */
@media (forced-colors: active) {
  :focus-visible,
  .gv-card:focus-within {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .gv-card__link:focus-visible {
    outline: none; /* the card outline above is the indicator */
  }

  .gv-btn,
  .gv-hero .carousel .gv-hero__dots [data-bs-target],
  .gv-hero__control {
    border-color: ButtonText;
  }

  /* Forced colours make transparent borders visible; keep the underline for the active tab only. */
  .gv-nav__link:not(.active, [aria-current="page"]) {
    border-bottom-color: Canvas;
  }

  .gv-nav__link.active,
  .gv-nav__link[aria-current="page"],
  .gv-rail__link.active,
  .gv-drawer__link.active,
  .gv-drawer__link[aria-current="page"],
  .gv-hero .carousel .gv-hero__dots .active {
    border-color: Highlight;
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Layout
   ========================================================================== */

/* Content sits to the right of the fixed rail on desktop (see docs/UI-UX.md). */
.gv-layout {
  padding: var(--gv-space-3) var(--gv-space-3) var(--gv-space-5);
}

@media (min-width: 768px) {
  .gv-layout {
    margin-left: var(--gv-rail-width);
  }
}

/* Buttons
   Usage: <a class="gv-btn gv-btn--primary">  sizes: gv-btn--sm, gv-btn--block
   ========================================================================== */

.gv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gv-space-2);
  min-height: 36px;
  padding: 0 var(--gv-space-3);
  border: 1px solid transparent;
  border-radius: var(--gv-radius-sm);
  background: transparent;
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-heavy);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--gv-transition), border-color var(--gv-transition),
    color var(--gv-transition), box-shadow var(--gv-transition);
}

.gv-btn--primary {
  background: var(--gv-accent);
  color: var(--gv-accent-ink);
}

.gv-btn--primary:hover {
  background: var(--gv-accent-hover);
  color: var(--gv-accent-ink);
  box-shadow: var(--gv-shadow-glow);
}

.gv-btn--outline {
  border-color: var(--gv-color-border-strong);
  background: var(--gv-color-panel);
}

.gv-btn--outline:hover {
  border-color: var(--gv-accent);
  color: var(--gv-color-text);
  box-shadow: var(--gv-shadow-glow);
}

.gv-btn--icon {
  width: 36px;
  padding: 0;
}

.gv-btn--sm {
  min-height: 30px;
  padding: 0 var(--gv-space-2);
  font-size: var(--gv-font-size-xs);
}

.gv-btn--block {
  width: 100%;
}

/* A form that wraps a single button without affecting layout (header Logout). */
.gv-inline-form {
  display: contents;
}

/* Status messages after an action (subscribed, logged out …) */
.gv-flash {
  display: flex;
  align-items: center;
  gap: var(--gv-space-2);
  margin: 0 0 var(--gv-space-3);
  padding: 0.75rem var(--gv-space-3);
  border: 1px solid var(--gv-color-border);
  border-left: 4px solid var(--gv-color-text-muted);
  border-radius: var(--gv-radius);
  background: var(--gv-color-panel);
  color: var(--gv-color-text);
  font-weight: var(--gv-font-weight-semibold);
}

.gv-flash--success {
  border-left-color: var(--gv-color-android);
}

.gv-flash--success .bi {
  color: var(--gv-color-android);
}

.gv-flash--error {
  border-left-color: var(--gv-color-danger);
}

.gv-flash--error .bi {
  color: var(--gv-color-danger);
}

/* Badges & chips (overlaid on images or inline)
   ========================================================================== */

.gv-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gv-space-1);
  padding: 2px 6px;
  border-radius: var(--gv-radius-sm);
  background: var(--gv-color-overlay);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-heavy);
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gv-badge--android { color: var(--gv-color-android); }
.gv-badge--java { color: var(--gv-color-java); }
.gv-badge--html5 { color: var(--gv-color-html5); }

.gv-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: var(--gv-radius-sm);
  background: var(--gv-color-overlay);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-bold);
  line-height: 1.4;
}

.gv-rating .bi {
  color: var(--gv-color-rating);
}

/* Section
   ========================================================================== */

.gv-section {
  margin-top: 1.625rem;
}

.gv-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gv-space-3);
  margin-bottom: 0.75rem;
}

.gv-section__title {
  display: flex;
  align-items: center;
  gap: var(--gv-space-2);
  margin: 0;
  font-size: var(--gv-font-size-lg);
  font-weight: var(--gv-font-weight-heavy);
  letter-spacing: 0.02em;
}

.gv-section__title .bi {
  color: var(--gv-accent);
}

.gv-section__link {
  display: inline-flex;
  align-items: center;
  gap: var(--gv-space-1);
  color: var(--gv-accent-text);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-bold);
  white-space: nowrap;
  border-radius: var(--gv-radius-sm);
}

.gv-section__link:hover {
  color: var(--gv-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Anchor jumps and keyboard focus scrolling both stop below the sticky
   header/chip bar, so focused elements are never hidden (WCAG 2.4.11). */
html {
  scroll-padding-top: calc(var(--gv-sticky-offset) + var(--gv-space-3));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Header
   ========================================================================== */

.gv-header {
  position: sticky;
  top: 0;
  z-index: var(--gv-z-header);
  height: var(--gv-header-height);
  background: rgb(11 13 16 / 0.96);
  border-bottom: 1px solid var(--gv-color-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gv-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0 var(--gv-space-3);
}

.gv-logo {
  display: flex;
  flex-shrink: 1;
  min-width: 0;
  align-items: center;
  gap: var(--gv-space-2);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-lg);
  font-weight: var(--gv-font-weight-heavy);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-radius: var(--gv-radius-sm);
}

.gv-logo:hover {
  color: var(--gv-color-text);
}

.gv-logo__text {
  overflow: hidden;
  color: var(--gv-accent); /* brand red wordmark (logos are exempt from contrast rules) */
  text-overflow: ellipsis;
}

.gv-logo__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px var(--gv-accent-glow));
}

/* Tab-style links, full header height (desktop only) */
.gv-nav {
  display: none;
  align-self: stretch;
  gap: var(--gv-space-1);
}

.gv-nav__link {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  border-bottom: 2px solid transparent;
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-semibold);
  white-space: nowrap;
  transition: color var(--gv-transition), border-color var(--gv-transition),
    background-color var(--gv-transition);
}

.gv-nav__link:hover {
  color: var(--gv-color-text);
  border-bottom-color: var(--gv-accent);
}

.gv-nav__link.active,
.gv-nav__link[aria-current="page"] {
  color: var(--gv-color-text);
  border-bottom-color: var(--gv-accent);
  background: var(--gv-accent-tint);
}

.gv-nav__link:focus-visible {
  box-shadow: inset 0 0 0 2px var(--gv-accent);
}

.gv-header__actions {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gv-space-2);
  min-width: 0;
  margin-left: auto;
}

.gv-header__cta {
  display: none;
}

/* Header breakpoints use em so that users with a larger browser font size get
   the compact (hamburger) header sooner. 62em = 992px and 75em = 1200px at the
   default 16px. */
@media (min-width: 62em) {
  .gv-nav {
    display: flex;
  }

  .gv-header__cta {
    display: inline-flex;
  }

  .gv-menu-btn {
    display: none;
  }
}

/* Narrow desktop: tighten so logo + tabs + CTAs fit in one row. */
@media (min-width: 62em) and (max-width: 74.99em) {
  .gv-nav__link {
    padding: 0 0.5rem; /* five tabs incl. Leader Board */
  }

  .gv-nav {
    gap: 0;
  }

  .gv-header__cta {
    padding: 0 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .gv-header__inner {
    gap: var(--gv-space-2);
    padding: 0 0.625rem;
  }

  .gv-logo {
    font-size: 1rem;
    gap: 6px;
  }

  .gv-logo__icon {
    width: 28px;
    height: 28px;
  }

  .gv-menu-btn {
    width: 34px;
    min-height: 34px;
  }
}

/* Very small screens: icon-only logo; the text stays for screen readers. */
@media (max-width: 359.98px) {
  .gv-logo__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Drawer (Bootstrap offcanvas, right side)
   ========================================================================== */

.gv-drawer {
  --bs-offcanvas-width: min(290px, 85vw);
  --bs-offcanvas-bg: var(--gv-color-panel);
  --bs-offcanvas-border-color: var(--gv-color-border);
  --bs-offcanvas-padding-x: var(--gv-space-3);
  --bs-offcanvas-padding-y: var(--gv-space-3);
}

.gv-drawer__head {
  border-bottom: 1px solid var(--gv-color-border);
}

.gv-drawer__title {
  margin: 0;
  font-size: var(--gv-font-size-base);
  font-weight: var(--gv-font-weight-bold);
}

.gv-drawer__body {
  display: flex;
  flex-direction: column;
  gap: var(--gv-space-4);
}

.gv-drawer__nav,
.gv-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: var(--gv-space-2);
}

.gv-drawer__link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-sm);
  background: var(--gv-color-card);
  color: var(--gv-color-text);
  font-size: 0.875rem;
  font-weight: var(--gv-font-weight-semibold);
  transition: border-color var(--gv-transition), background-color var(--gv-transition);
}

.gv-drawer__link:hover {
  border-color: var(--gv-accent);
  color: var(--gv-color-text);
}

.gv-drawer__link.active,
.gv-drawer__link[aria-current="page"] {
  border-color: var(--gv-accent);
  background: var(--gv-accent);
  color: var(--gv-accent-ink);
}

/* Sidebar: vertical icon rail (≥768px) / horizontal chip bar (<768px)
   ========================================================================== */

.gv-rail {
  position: sticky;
  top: var(--gv-header-height);
  z-index: var(--gv-z-rail);
  height: var(--gv-chipbar-height);
  background: var(--gv-color-panel);
  border-bottom: 1px solid var(--gv-color-border);
}

.gv-rail__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 0.625rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.gv-rail__nav::-webkit-scrollbar {
  display: none;
}

.gv-rail__link {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-sm);
  background: var(--gv-color-card);
  color: var(--gv-color-text);
  transition: border-color var(--gv-transition), background-color var(--gv-transition),
    box-shadow var(--gv-transition);
}

.gv-rail__link .bi {
  font-size: 1rem;
  line-height: 1;
}

.gv-rail__label {
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-bold);
  line-height: 1;
}

.gv-rail__link:hover {
  border-color: var(--gv-color-border-strong);
  background: var(--gv-color-card-hover);
  color: var(--gv-color-text);
}

.gv-rail__link.active {
  border-color: var(--gv-accent);
  box-shadow: var(--gv-shadow-glow);
}

.gv-rail__link.active .gv-rail__label,
.gv-rail__link.active .bi {
  color: var(--gv-accent-text);
}

@media (min-width: 768px) {
  .gv-rail {
    position: fixed;
    top: var(--gv-header-height);
    bottom: 0;
    left: 0;
    width: var(--gv-rail-width);
    height: auto;
    border-right: 1px solid var(--gv-color-border);
    border-bottom: 0;
  }

  .gv-rail__nav {
    flex-direction: column;
    gap: var(--gv-space-2);
    height: 100%;
    padding: 0.75rem 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .gv-rail__link {
    flex-direction: column;
    gap: var(--gv-space-1);
    width: 60px;
    min-width: 0;
    height: 56px;
    padding: 0;
    border-color: transparent;
    border-radius: var(--gv-radius);
    background: transparent;
  }

  .gv-rail__link .bi {
    font-size: 1.125rem;
  }

  .gv-rail__link.active {
    background: var(--gv-color-card);
  }
}

/* Short screens (landscape phones): only the header stays sticky; the chip bar
   scrolls away so content keeps most of the height. */
@media (max-width: 767.98px) and (max-height: 500px) {
  :root {
    --gv-sticky-offset: var(--gv-header-height);
  }

  .gv-rail {
    position: relative;
    top: auto;
  }
}

/* Hero slider (Bootstrap carousel)
   ========================================================================== */

.gv-hero {
  --gv-hero-ratio: 21 / 7;
  --gv-hero-min-height: 190px;
  --gv-hero-max-height: 480px; /* keeps games above the fold on wide screens */
  --gv-hero-controls-height: 38px;
}

.gv-hero__stage {
  aspect-ratio: var(--gv-hero-ratio);
  min-height: var(--gv-hero-min-height);
  max-height: var(--gv-hero-max-height);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-lg);
  background: var(--gv-color-panel);
}

.gv-hero__slide {
  height: 100%;
}

.gv-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom; /* hero art keeps its subject bottom-right; crop from the sky */
}

.gv-hero__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--gv-space-2);
  padding: 2rem;
  background:
    linear-gradient(90deg, rgb(11 13 16 / 0.85) 0%, rgb(11 13 16 / 0.5) 45%, transparent 75%),
    linear-gradient(0deg, rgb(11 13 16 / 0.6) 0%, transparent 50%);
}

.gv-hero__title {
  max-width: 60%;
  margin: 0;
  font-size: var(--gv-font-size-2xl);
}

.gv-hero__desc {
  max-width: 45ch;
  margin: 0;
  color: var(--gv-color-text-muted);
}


.gv-hero__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--gv-hero-controls-height);
  padding-top: 10px;
}

/* Override Bootstrap's absolutely positioned bar indicators with numbered dots.
   Dot selectors are prefixed with `.gv-hero .carousel` to match the specificity of
   Bootstrap's `[data-bs-theme=dark] .carousel .carousel-indicators [data-bs-target]`. */
.gv-hero__dots {
  position: static;
  gap: 6px;
  margin: 0;
}

.gv-hero .carousel .gv-hero__dots [data-bs-target],
.gv-hero__control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gv-color-border);
  border-radius: 50%;
  background: var(--gv-color-panel);
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-bold);
  text-indent: 0;
  opacity: 1;
  transition: background-color var(--gv-transition), border-color var(--gv-transition),
    color var(--gv-transition), box-shadow var(--gv-transition);
}

.gv-hero .carousel .gv-hero__dots [data-bs-target]:hover,
.gv-hero__control:hover {
  border-color: var(--gv-accent);
  color: var(--gv-color-text);
}

.gv-hero .carousel .gv-hero__dots .active {
  border-color: var(--gv-accent);
  background: var(--gv-accent);
  color: var(--gv-accent-ink);
  box-shadow: var(--gv-shadow-glow);
}

.gv-hero__toggle {
  margin-left: var(--gv-space-2);
}

@media (max-width: 991.98px) {
  .gv-hero__title {
    max-width: 75%;
    font-size: var(--gv-font-size-xl);
  }

  .gv-hero__caption {
    padding: 1.25rem;
  }
}

/* Phones in portrait: taller 16:9 banner. From 576px (incl. landscape phones) keep 21:7
   so the caption stays above the fold. */
@media (max-width: 575.98px) {
  .gv-hero {
    --gv-hero-ratio: 16 / 9;
    --gv-hero-min-height: 160px;
  }
}

@media (max-width: 767.98px) {
  .gv-hero__stage {
    border-radius: var(--gv-radius);
  }

  .gv-hero__caption {
    gap: 6px;
    padding: 0.75rem;
  }

  .gv-hero__title {
    max-width: 100%;
    font-size: var(--gv-font-size-lg);
  }

  .gv-hero__desc {
    display: none;
  }
}

/* Game grid: 2 → 3 (576) → 4 (992) → 6 (1200) columns
   ========================================================================== */

.gv-section__grid {
  --gv-cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--gv-cols), minmax(0, 1fr));
  gap: var(--gv-grid-gap);
}

@media (min-width: 576px) {
  .gv-section__grid { --gv-cols: 3; }
}

@media (min-width: 992px) {
  .gv-section__grid { --gv-cols: 4; }
}

@media (min-width: 1200px) {
  .gv-section__grid { --gv-cols: 6; }
}

.gv-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--gv-space-4);
  border: 1px dashed var(--gv-color-border-strong);
  border-radius: var(--gv-radius);
  color: var(--gv-color-text-muted);
  text-align: center;
}

/* Game card
   ========================================================================== */

.gv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
  transition: transform var(--gv-transition), border-color var(--gv-transition),
    box-shadow var(--gv-transition);
}

.gv-card:hover,
.gv-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--gv-accent);
  box-shadow: var(--gv-shadow);
}

.gv-card__thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gv-color-thumb);
}

.gv-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gv-card:hover .gv-card__img {
  transform: scale(1.04);
}

.gv-card__thumb .gv-badge {
  position: absolute;
  top: 6px;
  left: 6px;
}

.gv-card__thumb .gv-rating {
  position: absolute;
  right: 6px;
  bottom: 6px;
}

.gv-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding: var(--gv-space-2);
}

.gv-card__title {
  margin: 0;
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-bold);
  line-height: 1.35;
}

.gv-card__link {
  display: block;
  overflow: hidden;
  color: var(--gv-color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stretch the title link over the whole card. */
.gv-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.gv-card__link:hover {
  color: var(--gv-color-text);
}

/* The card itself shows focus (border + lift); add a ring around the whole card. */
.gv-card__link:focus-visible {
  box-shadow: none;
}

.gv-card__link:focus-visible::after {
  border-radius: var(--gv-radius);
  box-shadow: inset 0 0 0 2px var(--gv-accent);
}

.gv-card__meta {
  margin: 0 0 6px;
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-semibold);
}

.gv-card__action {
  position: relative;
  z-index: 2; /* above the stretched title link */
  margin-top: auto;
}

@media (max-width: 767.98px) {
  .gv-card__body {
    padding: 7px 6px;
  }
}

/* Large screens: cards are ~200–300px wide, so scale the text up a step. */
@media (min-width: 1400px) {
  .gv-card__body {
    padding: 0.625rem;
  }

  .gv-card__title {
    font-size: 0.9375rem;
  }

  .gv-card__meta {
    font-size: 0.75rem;
  }

  .gv-card__action {
    min-height: 34px;
    font-size: var(--gv-font-size-sm);
  }
}

/* Breadcrumb
   ========================================================================== */

.gv-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gv-space-1) var(--gv-space-2);
  margin: 0 0 var(--gv-space-3);
  padding: 0;
  list-style: none;
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
}

.gv-breadcrumb__list li + li::before {
  content: "›";
  margin-right: var(--gv-space-2);
  color: var(--gv-color-text-subtle);
}

.gv-breadcrumb__list a {
  color: var(--gv-color-text-muted);
  border-radius: var(--gv-radius-sm);
}

.gv-breadcrumb__list a:hover {
  color: var(--gv-color-text);
}

.gv-breadcrumb__list [aria-current="page"] {
  color: var(--gv-color-text);
}

/* Game details
   ========================================================================== */

.gv-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gv-space-4);
  padding: var(--gv-space-4);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-lg);
  background:
    radial-gradient(circle at 0% 0%, var(--gv-accent-tint), transparent 50%),
    var(--gv-color-panel);
}

.gv-details__cover {
  max-width: 320px;
  overflow: hidden;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-thumb);
}

.gv-details__img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gv-details__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gv-space-3);
}

.gv-details__title {
  margin: 0;
  font-size: var(--gv-font-size-xl);
}

.gv-details__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gv-details__facts .gv-badge {
  padding: 4px 8px;
  border: 1px solid var(--gv-color-border);
}

.gv-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--gv-space-1);
  padding: 4px 10px;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-pill);
  background: var(--gv-color-card);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-bold);
}

.gv-chip .bi {
  color: var(--gv-color-rating);
}

.gv-chip--free {
  border-color: var(--gv-color-android);
  color: var(--gv-color-android);
}

.gv-chip--subscription {
  border-color: var(--gv-accent);
}

.gv-details__summary {
  margin: 0;
  color: var(--gv-color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.gv-details__action {
  min-height: 48px;
  padding: 0 var(--gv-space-5);
  font-size: 1rem;
}

.gv-details__note {
  display: flex;
  align-items: center;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0.75rem var(--gv-space-3);
  border: 1px dashed var(--gv-color-border-strong);
  border-radius: var(--gv-radius);
  color: var(--gv-color-text-muted);
}

.gv-details__access {
  margin: 0;
  color: var(--gv-color-text-subtle);
  font-size: var(--gv-font-size-sm);
}

.gv-details__access a,
.gv-details__about a {
  color: var(--gv-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gv-details__about p {
  max-width: 70ch;
  color: var(--gv-color-text-muted);
  line-height: 1.7;
}

@media (min-width: 576px) {
  .gv-details {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    align-items: start;
  }

  .gv-details__title {
    font-size: var(--gv-font-size-2xl);
  }
}

@media (min-width: 992px) {
  .gv-details {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    padding: var(--gv-space-5);
  }
}

/* HTML5 play page (play-game.php)
   ========================================================================== */

.gv-play__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gv-space-2) var(--gv-space-3);
  margin-bottom: var(--gv-space-3);
}

.gv-play__title {
  margin: 0;
  font-size: var(--gv-font-size-xl);
  font-weight: var(--gv-font-weight-heavy);
  line-height: var(--gv-line-height-tight);
}

.gv-play__tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gv-space-2);
}

/* Fills most of the viewport below the sticky header; games scale themselves to the frame. */
.gv-play__stage {
  position: relative;
  height: clamp(420px, calc(100svh - var(--gv-sticky-offset) - 11rem), 900px);
  overflow: hidden;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-lg);
  background: #000;
}

.gv-play__stage:fullscreen {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.gv-play__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.gv-play__noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--gv-space-3);
  color: var(--gv-color-text-muted);
  text-align: center;
}

.gv-play__status {
  display: flex;
  align-items: center;
  gap: var(--gv-space-2);
  margin: var(--gv-space-3) 0 0;
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
}

.gv-play__status .bi {
  flex: none;
  color: var(--gv-color-rating);
}

.gv-play__board {
  margin-left: auto;
  color: var(--gv-color-text);
  font-weight: var(--gv-font-weight-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .gv-play__title {
    font-size: var(--gv-font-size-2xl);
  }
}

/* "View all" listing pages (all-*.php)
   ========================================================================== */

.gv-listing__title {
  font-size: var(--gv-font-size-xl);
}

.gv-listing__count {
  margin: 0;
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
}

/* Pagination (listing pages, admin lists): current page in brand red
   ========================================================================== */

.gv-pagination {
  margin-top: var(--gv-space-4);
}

.gv-pagination__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gv-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gv-space-1);
  min-width: 40px;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--gv-color-border-strong);
  border-radius: var(--gv-radius-sm);
  background: var(--gv-color-panel);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-bold);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--gv-transition), box-shadow var(--gv-transition), background-color var(--gv-transition);
}

a.gv-pagination__link:hover {
  border-color: var(--gv-accent);
  color: var(--gv-color-text);
  box-shadow: var(--gv-shadow-glow);
}

.gv-pagination__link[aria-current="page"] {
  border-color: var(--gv-accent);
  background: var(--gv-accent);
  color: var(--gv-accent-ink);
}

.gv-pagination__link[aria-disabled="true"] {
  color: var(--gv-color-text-subtle);
  cursor: default;
  opacity: 0.6;
}

.gv-pagination__gap {
  color: var(--gv-color-text-subtle);
}

/* Small phones: arrows only for Previous/Next (the words stay for screen readers). */
@media (max-width: 400px) {
  .gv-pagination__link > span:not(.visually-hidden) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Leader board (leaderboard.php)
   ========================================================================== */

.gv-board {
  max-width: 880px;
}

.gv-board__head {
  margin-bottom: var(--gv-space-3);
}

.gv-board__title {
  display: flex;
  align-items: center;
  gap: var(--gv-space-2);
  margin: 0 0 var(--gv-space-2);
  font-size: var(--gv-font-size-xl);
  font-weight: var(--gv-font-weight-heavy);
  line-height: var(--gv-line-height-tight);
}

.gv-board__title .bi {
  color: var(--gv-accent);
}

.gv-board__intro {
  margin: 0;
  color: var(--gv-color-text-muted);
}

.gv-board__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gv-space-2) var(--gv-space-3);
  margin-bottom: var(--gv-space-3);
}

.gv-board__periods {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gv-space-2);
}

.gv-board__period {
  min-height: 36px;
  padding: 0 var(--gv-space-3);
  border-radius: var(--gv-radius-pill);
}

.gv-board__period[aria-current="page"] {
  border-color: var(--gv-accent);
  background: var(--gv-accent-tint);
  color: var(--gv-color-text);
}

.gv-board__game {
  display: flex;
  gap: var(--gv-space-2);
  flex: 1 1 260px;
  max-width: 360px;
}

.gv-field__input.gv-board__select {
  min-height: 40px;
  letter-spacing: normal;
}

.gv-board__show {
  min-height: 40px;
}

.gv-board__me {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gv-space-2) var(--gv-space-3);
  margin-bottom: var(--gv-space-3);
  padding: 0.75rem var(--gv-space-3);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-panel);
}

.gv-board__me p {
  margin: 0;
  color: var(--gv-color-text-muted);
}

.gv-board__me strong {
  color: var(--gv-color-text);
}

.gv-board__me .bi {
  margin-right: var(--gv-space-1);
  color: var(--gv-color-rating);
  vertical-align: -0.125em;
}

.gv-board__wrap {
  overflow-x: auto;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
}

.gv-board__table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.gv-board__table th,
.gv-board__table td {
  padding: 0.75rem var(--gv-space-3);
  text-align: left;
  vertical-align: middle;
}

.gv-board__table th {
  border-bottom: 1px solid var(--gv-color-border-strong);
  color: var(--gv-color-text-subtle);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gv-board__table tbody tr + tr td {
  border-top: 1px solid var(--gv-color-border);
}

.gv-board__table .gv-board__rank {
  width: 5.5rem;
}

.gv-board__table .gv-board__points {
  text-align: right;
}

td.gv-board__points {
  font-weight: var(--gv-font-weight-heavy);
}

.gv-board__mobile {
  letter-spacing: 0.04em;
}

.gv-board__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--gv-space-1);
  border-radius: var(--gv-radius-pill);
  background: var(--gv-color-panel);
  color: var(--gv-color-text);
  font-weight: var(--gv-font-weight-heavy);
}

.gv-board__badge--top {
  background: var(--gv-color-rating);
  color: var(--gv-color-primary);
}

.gv-board__row--me td {
  background: var(--gv-accent-tint);
}

.gv-board__you {
  margin-left: var(--gv-space-2);
  letter-spacing: normal;
}

@media (min-width: 576px) {
  .gv-board__title {
    font-size: var(--gv-font-size-2xl);
  }
}

/* Secondary pages: centred panel (subscribe.html, input-number.html)
   ========================================================================== */

.gv-page-center {
  display: flex;
  justify-content: center;
  padding-block: var(--gv-space-5);
}

.gv-panel {
  width: 100%;
  max-width: 560px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius-lg);
  background:
    radial-gradient(circle at 50% 0%, var(--gv-accent-tint), transparent 60%),
    var(--gv-color-panel);
  text-align: center;
}

.gv-panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gv-color-card);
  color: var(--gv-accent);
  font-size: 2rem;
  box-shadow: var(--gv-shadow-glow);
}

.gv-panel__title {
  margin: var(--gv-space-3) 0 var(--gv-space-4);
  font-size: var(--gv-font-size-xl);
}

.gv-panel__back {
  display: inline-flex;
  align-items: center;
  gap: var(--gv-space-1);
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-semibold);
  border-radius: var(--gv-radius-sm);
}

.gv-panel__back:hover {
  color: var(--gv-color-text);
}

@media (min-width: 576px) {
  .gv-panel {
    padding: 2.5rem;
  }
}

/* Subscribe page */
.gv-subscribe__facts {
  display: grid;
  gap: var(--gv-space-2);
  margin: 0 0 var(--gv-space-4);
  padding: 0;
  list-style: none;
}

.gv-subscribe__fact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gv-space-2);
  padding: 0.75rem var(--gv-space-3);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
  color: var(--gv-color-text);
  font-weight: var(--gv-font-weight-semibold);
}

.gv-subscribe__fact .bi {
  color: var(--gv-accent);
}

.gv-subscribe__fact--price {
  align-items: baseline;
  color: var(--gv-color-text-muted);
}

.gv-subscribe__price {
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-2xl);
  font-weight: var(--gv-font-weight-heavy);
  line-height: 1;
}

.gv-subscribe__terms {
  margin: 0 0 var(--gv-space-3);
  color: var(--gv-color-text-muted);
}

.gv-subscribe__cta {
  margin: 0 0 var(--gv-space-4);
  font-size: 1rem;
  font-weight: var(--gv-font-weight-semibold);
  line-height: 2.75rem; /* room for the inline button */
}

.gv-subscribe__cta .gv-btn {
  min-height: 44px;
  margin: 0 var(--gv-space-1);
  padding: 0 var(--gv-space-4);
  font-size: 1rem;
  vertical-align: middle;
}

/* Wider, left-aligned panel for long content (FAQ) */
.gv-panel--wide {
  max-width: 820px;
}

/* FAQ page: every question and answer always visible */
.gv-faq {
  display: grid;
  gap: var(--gv-space-2);
  margin-bottom: var(--gv-space-4);
  text-align: left;
}

.gv-faq__item {
  padding: var(--gv-space-3);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
}

.gv-faq__question {
  display: flex;
  align-items: flex-start;
  gap: var(--gv-space-2);
  margin: 0 0 var(--gv-space-2);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-base);
  font-weight: var(--gv-font-weight-bold);
  line-height: 1.4;
}

.gv-faq__text {
  flex: 1;
}

.gv-faq__marker {
  flex-shrink: 0;
  color: var(--gv-accent);
  font-weight: var(--gv-font-weight-heavy);
}

.gv-faq__answer {
  padding-left: 1.6em;
  color: var(--gv-color-text-muted);
  line-height: 1.6;
}

.gv-faq__answer p {
  margin: 0;
}

.gv-faq__answer .gv-faq__marker {
  margin-left: -1.6em;
  margin-right: 0.35em;
}

.gv-faq__answer a,
.gv-support a {
  color: var(--gv-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.gv-faq__bullets {
  margin: 0;
  padding-left: 1.1rem;
}

.gv-support {
  padding: var(--gv-space-3);
  border: 1px solid var(--gv-color-border);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
  text-align: left;
}

.gv-support__title {
  margin: 0 0 var(--gv-space-2);
  font-size: var(--gv-font-size-base);
}

.gv-support__list {
  display: grid;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--gv-color-text-muted);
}

.gv-support__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gv-space-1) var(--gv-space-2);
}

.gv-support__list .bi {
  color: var(--gv-accent);
}

/* Notify page (subscription confirmation) */
.gv-notify__message {
  margin: var(--gv-space-4) 0;
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-lg);
  font-weight: var(--gv-font-weight-semibold);
  line-height: 1.5;
}

.gv-notify__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gv-space-3);
}

.gv-notify__actions .gv-btn {
  min-height: 48px;
  font-size: 1rem;
}

/* Forms (input-number.html) */
.gv-form {
  margin-bottom: var(--gv-space-4);
  text-align: left;
}

.gv-field {
  margin-bottom: var(--gv-space-3);
}

.gv-field__label {
  display: block;
  margin-bottom: var(--gv-space-2);
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-bold);
}

.gv-field__input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--gv-space-3);
  border: 1px solid var(--gv-color-border-strong);
  border-radius: var(--gv-radius);
  background: var(--gv-color-card);
  color: var(--gv-color-text);
  font: inherit;
  font-size: 1rem; /* ≥16px stops iOS from zooming in on focus */
  letter-spacing: 0.04em;
  transition: border-color var(--gv-transition), box-shadow var(--gv-transition);
}

.gv-field__input:focus-visible {
  border-color: var(--gv-accent);
}

.gv-field__input[aria-invalid="true"] {
  border-color: var(--gv-color-danger);
}

.gv-field__error {
  min-height: 1.25rem; /* reserve space so the error doesn't push the button down */
  margin: var(--gv-space-2) 0 0;
  color: var(--gv-color-danger);
  font-size: var(--gv-font-size-sm);
  font-weight: var(--gv-font-weight-semibold);
}

.gv-form__submit {
  min-height: 48px;
  font-size: 1rem;
}

/* Footer
   ========================================================================== */

.gv-footer {
  margin-top: var(--gv-space-5);
  padding-top: 2rem;
  border-top: 1px solid var(--gv-color-border);
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-sm);
}

/* 1 column → 2 (576px) → 4 (992px) */
.gv-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gv-space-4);
}

@media (min-width: 576px) {
  .gv-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
  .gv-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.gv-footer__heading {
  margin: 0 0 0.75rem;
  color: var(--gv-color-text);
  font-size: var(--gv-font-size-xs);
  font-weight: var(--gv-font-weight-heavy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gv-footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gv-footer__link {
  color: var(--gv-color-text-muted);
  border-radius: var(--gv-radius-sm);
  transition: color var(--gv-transition);
}

.gv-footer__link:hover {
  color: var(--gv-accent-text);
}

.gv-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gv-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gv-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gv-color-border);
  border-radius: 50%;
  background: var(--gv-color-panel);
  color: var(--gv-color-text-muted);
  font-size: 1rem;
  transition: color var(--gv-transition), border-color var(--gv-transition),
    box-shadow var(--gv-transition);
}

.gv-footer__social-link:hover {
  border-color: var(--gv-accent);
  color: var(--gv-accent);
  box-shadow: var(--gv-shadow-glow);
}

.gv-footer__copyright {
  margin: 2rem 0 0;
  padding-top: var(--gv-space-3);
  border-top: 1px solid var(--gv-color-border);
  color: var(--gv-color-text-muted);
  font-size: var(--gv-font-size-xs);
  text-align: center;
}
