/* =========================================================
   game punk — design tokens
   ========================================================= */
:root {
  /* Brand colours (Retro Pixel Punk palette) */
  --gp-bg:        #2D1B4E;
  --gp-surface:   #3A2560;
  --gp-border:    #4E3778;
  --gp-purple:    #FF00A0;
  --gp-pink:      #00F0FF;
  --gp-yellow:    #FF6B35;
  --gp-text:      #FFF8E7;
  --gp-muted:     #B9A9D9;
  --gp-muted-2:   #7A6A9E;

  /* Type */
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body:    "Inter", -apple-system, sans-serif;
  --font-mono:    "Space Mono", "Courier New", monospace;

  /* Layout */
  --wrap-width: 1080px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gp-bg);
  color: var(--gp-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* =========================================================
   Logo (used in header + footer)
   ========================================================= */
.logo-link {
  display: inline-block;
  line-height: 0;
  transition: opacity 0.15s ease;
}

.logo-link:hover { opacity: 0.85; }

.site-logo {
  height: 46px;
  width: auto;
  display: block;
}

.site-logo-small { height: 30px; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--gp-border);
  padding: 20px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}

.main-nav a {
  color: var(--gp-text);
  opacity: 0.85;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  opacity: 1;
  color: var(--gp-yellow);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 72px 0 48px;
  text-align: left;
  overflow: hidden;

  background-image: url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--gp-bg); /* fallback shown until the image loads */
}

/* Overlay to keep text readable over the background image */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(45, 27, 78, 0.9) 0%,
      rgba(45, 27, 78, 0.78) 40%,
      rgba(45, 27, 78, 0.3) 100%
    ),
    linear-gradient(
      180deg,
      rgba(45, 27, 78, 0.88) 0%,
      rgba(45, 27, 78, 0.94) 100%
    );
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gp-yellow);
  margin: 0 0 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  margin: 0 0 20px;
  letter-spacing: -1px;
}

.hero-accent {
  color: var(--gp-pink);
}

/* Full stops styled as a small angled panel, echoing the "u" panel in the logo */
.stop-mark {
  display: inline-block;
  width: 0.28em;
  height: 0.62em;
  margin-left: 0.06em;
  margin-bottom: -0.03em;
  background: var(--gp-purple);
  clip-path: polygon(0% 0%, 100% 16%, 84% 100%, 0% 88%);
  vertical-align: baseline;
}

.hero-accent .stop-mark {
  background: var(--gp-text);
}

.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;
}

.hero-sub {
  font-size: 17px;
  color: var(--gp-muted);
  margin: 0 0 32px;
  max-width: 480px;
}

.search-bar {
  display: flex;
  gap: 10px;
  max-width: 520px;
}

.search-input {
  flex: 1;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--gp-text);
  font-family: var(--font-body);
  font-size: 15px;
}

.search-input::placeholder { color: var(--gp-muted-2); }

.search-input:focus {
  outline: none;
  border-color: var(--gp-purple);
  box-shadow: 0 0 0 3px rgba(139, 0, 255, 0.25);
}

.search-btn {
  background: var(--gp-purple);
  color: var(--gp-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-btn:hover { background: #D1008C; }

.search-btn:focus-visible,
.filter-pill:focus-visible,
.logo-link:focus-visible {
  outline: 2px solid var(--gp-yellow);
  outline-offset: 2px;
}

/* =========================================================
   Filters
   ========================================================= */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 24px;
}

.filter-pill {
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  color: var(--gp-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--gp-purple);
  color: var(--gp-text);
}

.filter-pill.is-active {
  background: var(--gp-purple);
  border-color: var(--gp-purple);
  color: var(--gp-text);
}

/* =========================================================
   Game grid + cards
   ========================================================= */
.game-section {
  margin-bottom: 40px;
}

.game-section:last-of-type {
  margin-bottom: 72px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.game-card {
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: var(--gp-purple);
  transform: translateY(-2px);
}

/* .game-card sets display:flex, which otherwise beats the browser's
   default [hidden] { display: none } rule and keeps "hidden" cards visible. */
.game-card[hidden] {
  display: none;
}

.game-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gp-bg);
}

.game-thumb.game-thumb-cover {
  object-fit: cover;
}

.game-info { flex: 1; min-width: 0; }

.game-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.game-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  color: var(--gp-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discount-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--gp-pink);
  color: #123338;
  white-space: nowrap;
}

.discount-badge.is-none {
  background: var(--gp-border);
  color: var(--gp-muted);
}

.preorder-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--gp-purple);
  color: var(--gp-text);
  white-space: nowrap;
}

.game-meta {
  font-size: 12px;
  color: var(--gp-muted);
  margin: 4px 0 0;
}

.game-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--font-mono);
}

.price-was {
  font-size: 12px;
  color: var(--gp-muted-2);
  text-decoration: line-through;
}

.price-now {
  font-size: 18px;
  font-weight: 700;
  color: var(--gp-yellow);
}

.store-name {
  font-size: 11px;
  color: var(--gp-muted);
  font-family: var(--font-body);
}

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
  text-align: center;
  color: var(--gp-muted);
  font-size: 14px;
  padding: 48px 0 72px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--gp-border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.footer-note {
  font-size: 12px;
  color: var(--gp-muted-2);
  margin: 0;
}

.footer-note a {
  color: var(--gp-muted);
  text-decoration: underline;
}

.footer-note a:hover { color: var(--gp-text); }

/* =========================================================
   Motion preference
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =========================================================
   Game detail page
   ========================================================= */
.game-page {
  padding-top: 32px;
  padding-bottom: 72px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--gp-muted);
  margin-bottom: 24px;
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--gp-text); }

.game-hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--gp-border);
}

.game-hero-thumb {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--gp-bg);
}

.game-hero-thumb.game-hero-cover {
  width: 120px;
  height: 160px;
  object-fit: contain;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
}

.game-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gp-yellow);
  color: var(--gp-bg);
}

.game-hero-meta {
  font-size: 14px;
  color: var(--gp-muted);
  margin: 0;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.genre-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  color: var(--gp-muted);
}

.game-hero-summary {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gp-muted);
  margin: 12px 0 0;
  max-width: 640px;
}

.section-heading {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--gp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}

.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.price-row.is-best {
  border-color: var(--gp-purple);
  background: linear-gradient(90deg, rgba(255, 0, 160, 0.08), var(--gp-surface) 60%);
}

.price-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gp-muted);
  text-align: center;
}

.price-row.is-best .price-rank {
  color: var(--gp-bg);
  background: var(--gp-purple);
  border-radius: 20px;
  padding: 4px 0;
  font-size: 11px;
  text-transform: uppercase;
}

.price-store {
  font-size: 15px;
  font-weight: 600;
  color: var(--gp-text);
}

.price-discount {
  font-size: 12px;
  font-weight: 600;
  color: var(--gp-yellow);
  white-space: nowrap;
}

.price-discount.is-none { color: var(--gp-muted-2); }

.price-amount-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.price-amount-was {
  font-size: 12px;
  color: var(--gp-muted-2);
  text-decoration: line-through;
}

.price-amount-now {
  font-size: 18px;
  font-weight: 700;
  color: var(--gp-yellow);
}

.price-cta {
  background: var(--gp-purple);
  color: var(--gp-text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.price-cta:hover { background: #D1008C; }

@media (max-width: 640px) {
  .price-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "rank store"
      "rank discount"
      "rank amount"
      "rank cta";
    row-gap: 6px;
  }
  .price-rank { grid-area: rank; }
  .price-store { grid-area: store; }
  .price-discount { grid-area: discount; }
  .price-amount-group { grid-area: amount; }
  .price-cta { grid-area: cta; justify-self: start; }
}

/* =========================================================
   Game not found state
   ========================================================= */
.empty-game-state {
  max-width: 480px;
  padding: 48px 0 32px;
}

.empty-game-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.empty-game-sub {
  font-size: 15px;
  color: var(--gp-muted);
  margin: 0 0 28px;
}

.empty-game-back {
  display: inline-block;
  font-size: 13px;
  color: var(--gp-muted);
  text-decoration: underline;
  transition: color 0.15s ease;
}

.empty-game-back:hover { color: var(--gp-text); }

/* =========================================================
   Small screens
   ========================================================= */
@media (max-width: 560px) {
  .header-inner { flex-direction: column; gap: 14px; align-items: flex-start; }
  .search-bar { flex-direction: column; }
  .game-grid { grid-template-columns: 1fr; }
}
