/* UKGames — daylight arcade (light) and night arcade (dark).
   Every color comes from the tokens below; the dark blocks only redefine tokens. */
:root {
  /* Brand constants (same in both themes) */
  --ink: #14213d;
  --blast: #ff7a1a;
  --jeep: #e23d2e;
  --sun: #ffc53d;
  --white: #ffffff;
  --console: #1b2233;
  --console-line: #2e3850;
  --console-edge: #6d7ba0;
  --console-text: #eef2ff;
  --console-soft: #b9c3dc;
  --on-accent: #14213d;        /* text on orange / yellow */

  /* Theme tokens: light */
  --bg: #eef6fc;
  --surface: #ffffff;
  --surface-2: #eef6fc;
  --band: #bfe3fa;             /* games section */
  --text: #14213d;
  --text-soft: #3d4a66;
  --line: #14213d;             /* sticker outlines */
  --shadow-c: #14213d;         /* hard offset shadows */
  --stroke: #14213d;           /* outline around big display words */
  --dash: #c9d6e8;
  --header-bg: rgba(238, 246, 252, 0.92);
  --play-bg: #14213d;
  --play-fg: #ffffff;
  --smash-bg: #14213d;
  --smash-soft: #dbe5f5;
  --smash-muted: #c7d3ea;
  --contact-bg: #ffc53d;
  --contact-text: #14213d;
  --footer-bg: #14213d;
  --footer-text: #c7d3ea;
  --plus: #1f8a3a;
  --minus: #e23d2e;

  --font-display: "Bungee", "Arial Black", Impact, sans-serif;
  --font-body: "Rethink Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --border: 3px solid var(--line);
  --shadow: 6px 6px 0 var(--shadow-c);
  --shadow-lift: 9px 9px 0 var(--shadow-c);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;

  color-scheme: light;
}

/* Theme tokens: dark (system setting, unless the visitor picked light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1322;
    --surface: #172036;
    --surface-2: #1f2b46;
    --band: #111c31;
    --text: #eef3ff;
    --text-soft: #a9b7d4;
    --line: #56699a;
    --shadow-c: #04070e;
    --stroke: #04070e;
    --dash: #2f3d5c;
    --header-bg: rgba(13, 19, 34, 0.9);
    --play-bg: #eef3ff;
    --play-fg: #14213d;
    --smash-bg: #080d18;
    --contact-bg: #221c0b;
    --contact-text: #ffe7a3;
    --footer-bg: #070b15;
    --footer-text: #a9b7d4;
    --plus: #4fd27f;
    --minus: #ff6b5e;
    color-scheme: dark;
  }
}
/* Theme tokens: dark (picked with the header button) */
:root[data-theme="dark"] {
  --bg: #0d1322;
  --surface: #172036;
  --surface-2: #1f2b46;
  --band: #111c31;
  --text: #eef3ff;
  --text-soft: #a9b7d4;
  --line: #56699a;
  --shadow-c: #04070e;
  --stroke: #04070e;
  --dash: #2f3d5c;
  --header-bg: rgba(13, 19, 34, 0.9);
  --play-bg: #eef3ff;
  --play-fg: #14213d;
  --smash-bg: #080d18;
  --contact-bg: #221c0b;
  --contact-text: #ffe7a3;
  --footer-bg: #070b15;
  --footer-text: #a9b7d4;
  --plus: #4fd27f;
  --minus: #ff6b5e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blast); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Wordmark (matches the UKGAMES logo: "UK" + reversed "GAMES") ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-display); font-size: 22px; line-height: 1;
  text-decoration: none; color: var(--text); letter-spacing: 0.01em;
}
.wordmark b { font-weight: 400; background: var(--text); color: var(--bg); padding: 5px 6px 3px; border-radius: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.nav { display: flex; align-items: center; gap: clamp(10px, 2.2vw, 26px); }
.nav a { text-decoration: none; font-weight: 700; font-size: 15px; }
.nav a:hover { color: var(--blast); }
.lang {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.06em;
  border: 2px solid var(--line); border-radius: 999px; padding: 4px 10px; text-decoration: none;
}
.lang:hover { background: var(--text); color: var(--bg); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--text); color: var(--bg); }
.theme-toggle svg { width: 18px; height: 18px; }
/* The button shows the theme it switches to: a moon in light mode, a sun in dark mode. */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
@media (max-width: 720px) {
  .nav .nav-section { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 16px; text-decoration: none;
  padding: 12px 20px; border: var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); box-shadow: 4px 4px 0 var(--shadow-c);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-c); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-c); }
.btn-blast { background: var(--blast); color: var(--on-accent); }
.btn-play { background: var(--play-bg); color: var(--play-fg); box-shadow: 4px 4px 0 var(--blast); }
.btn-play:hover { box-shadow: 6px 6px 0 var(--blast); }
.btn-play svg { width: 20px; height: 20px; flex: none; }
.btn-play small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .08em; opacity: .8; text-transform: uppercase; line-height: 1.1; }
.btn-play span { line-height: 1.15; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 7vw, 84px) clamp(48px, 8vw, 96px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--on-accent);
  background: var(--sun); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(38px, 6.4vw, 76px); line-height: .98; letter-spacing: -0.01em;
  margin-block: 18px 20px;
}
.hero h1 .hl { color: var(--blast); -webkit-text-stroke: 2px var(--stroke); paint-order: stroke fill; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-soft); max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; font-family: var(--font-mono); font-size: 14px; color: var(--text-soft); }
.hero-facts strong { color: var(--text); font-weight: 500; }

.poster { position: relative; margin: 0; }
.poster img {
  width: 100%; aspect-ratio: 1456 / 816; object-fit: cover;
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  transform: rotate(1.6deg); background: var(--band);
}
.poster figcaption {
  position: absolute; left: -10px; bottom: -18px; transform: rotate(-3deg);
  background: var(--jeep); color: var(--white); border: var(--border); border-radius: 10px;
  padding: 8px 14px; font-weight: 800; box-shadow: 4px 4px 0 var(--shadow-c); max-width: 90%;
}
.poster figcaption span { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .poster { max-width: 560px; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4.4vw, 50px); line-height: 1; }
.section-head p { color: var(--text-soft); max-width: 30em; }
.label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Game cards ---------- */
.games { background: var(--band); border-block: var(--border); }
.game-list { display: grid; gap: clamp(28px, 4vw, 44px); }
.game {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 4vw, 48px); align-items: center;
  background: var(--surface); border: var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow); padding: clamp(20px, 3.4vw, 40px);
}
.game-title { display: flex; align-items: center; gap: 16px; }
.game-title img { width: 76px; height: 76px; border-radius: 18px; border: var(--border); flex: none; }
.game-title h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 34px); line-height: 1.05; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-family: var(--font-mono); font-size: 12px; font-weight: 500; border: 2px solid currentColor; border-radius: 999px; padding: 1px 9px; }
.game-body { display: grid; gap: 18px; }
.game-body > p { color: var(--text-soft); max-width: 36em; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.stats li { border: 2px solid var(--line); border-radius: 10px; padding: 6px 12px; line-height: 1.2; background: var(--surface-2); }
.stats b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--text-soft); }

.shots { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 14px; scroll-snap-type: x mandatory; }
.shots img {
  width: clamp(120px, 14vw, 150px); aspect-ratio: 9 / 20; object-fit: cover; flex: none;
  border: var(--border); border-radius: 16px; scroll-snap-align: start; background: var(--band);
}
.shots img:nth-child(odd) { transform: translateY(10px); }

/* Color Blocks keeps the retro handheld look of the game itself, in both themes */
.game.console { background: var(--console); color: var(--console-text); border-color: var(--line); }
.game.console .game-body > p { color: var(--console-soft); }
.game.console .stats li { background: var(--console-line); border-color: var(--console-edge); }
.game.console .stats span { color: var(--console-soft); }
.game.console .tag { color: var(--sun); }
.game.console .game-title img { border-color: var(--console-edge); }
.game.console .shots img { border-color: var(--console-edge); }
.game.console .btn-play { background: var(--sun); color: var(--on-accent); box-shadow: 4px 4px 0 #000; border-color: #000; }
.game.console .btn-play:hover { box-shadow: 6px 6px 0 #000; }

@media (max-width: 860px) {
  .game { grid-template-columns: 1fr; }
}

/* ---------- SmashJeeps feature band ---------- */
.smash { position: relative; color: var(--white); background: var(--smash-bg); overflow: hidden; }
.smash::before {
  content: ""; position: absolute; inset: 0;
  background: url("/img/smashjeeps-art.jpg") center / cover no-repeat;
  opacity: .28; filter: saturate(1.2);
}
.smash .wrap { position: relative; display: grid; grid-template-columns: 1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.smash .label { color: var(--sun); }
.smash h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 6.4vw, 78px); line-height: .95; margin-block: 10px 16px; color: var(--white); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--jeep); }
.smash .intro { font-size: clamp(17px, 1.6vw, 19px); color: var(--smash-soft); max-width: 32em; }
.features { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.features li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.features .ic {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--blast); color: var(--on-accent); border: 2px solid var(--white);
  font-family: var(--font-display); font-size: 16px;
}
.features b { display: block; color: var(--white); }
.features span { color: var(--smash-muted); font-size: 15px; }
.economy {
  background: var(--surface); color: var(--text); border: var(--border); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--jeep); padding: clamp(18px, 3vw, 28px); position: relative;
}
.economy img { width: min(78%, 300px); margin: -80px auto 6px; filter: drop-shadow(6px 8px 0 rgba(4, 7, 14, .35)); }
.economy h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; margin-bottom: 12px; }
.coin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.coin-table td { padding: 8px 0; border-bottom: 2px dashed var(--dash); }
.coin-table tr:last-child td { border-bottom: 0; }
.coin-table td:last-child { text-align: right; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--plus); } .minus { color: var(--minus); }
.economy .note { margin-top: 14px; font-size: 13px; color: var(--text-soft); }
@media (max-width: 860px) {
  .smash .wrap { grid-template-columns: 1fr; }
  .economy { margin-top: 70px; }
}

/* ---------- About ---------- */
.about .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.about h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4.4vw, 50px); line-height: 1; margin-bottom: 20px; }
.about .prose { display: grid; gap: 14px; color: var(--text-soft); max-width: 36em; }
.about .prose strong { color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.fact { background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: 4px 4px 0 var(--shadow-c); }
.fact dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.fact dd { margin: 4px 0 0; font-family: var(--font-display); font-size: clamp(18px, 2.1vw, 26px); line-height: 1.1; overflow-wrap: anywhere; }
.fact dd small { display: block; font-family: var(--font-body); font-size: 14px; color: var(--text-soft); margin-top: 4px; }
@media (max-width: 860px) { .about .wrap { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { background: var(--contact-bg); color: var(--contact-text); border-block: var(--border); }
.contact .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.contact h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4.4vw, 50px); line-height: 1; margin-bottom: 14px; }
.contact p { max-width: 30em; }
.mail {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text);
  background: var(--surface); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.mail a { font-family: var(--font-mono); font-weight: 500; font-size: clamp(17px, 2.2vw, 22px); text-decoration: none; word-break: break-all; flex: 1 1 220px; }
.mail a:hover { color: var(--blast); }
.mail button { font: inherit; font-weight: 800; font-size: 14px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.socials a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--surface); color: var(--text); }
.socials a:hover { background: var(--text); color: var(--bg); }
.socials svg { width: 18px; height: 18px; }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding-block: 40px; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; }
.site-footer .wordmark { color: var(--white); }
.site-footer .wordmark b { background: var(--white); color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--sun); }

/* ---------- Legal pages ---------- */
.legal-page { padding-block: clamp(36px, 6vw, 72px); }
.legal {
  max-width: 820px; margin-inline: auto; background: var(--surface); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(20px, 5vw, 56px);
}
.legal h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; margin-bottom: 8px; }
.legal .alt { font-size: 14px; margin-bottom: 24px; }
.legal > p:first-of-type { font-family: var(--font-mono); font-size: 14px; color: var(--text-soft); }
.legal h2 { font-size: 22px; margin: 34px 0 10px; padding-top: 18px; border-top: 2px dashed var(--dash); }
.legal h3 { font-size: 17px; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--text-soft); }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 1.2em; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal strong { color: var(--text); }
.legal a { color: var(--text); text-decoration-color: var(--blast); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.table-scroll { overflow-x: auto; margin: 12px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 420px; }
.legal th, .legal td { text-align: left; padding: 9px 12px; border: 2px solid var(--line); vertical-align: top; }
.legal th { background: var(--band); color: var(--text); }

/* ---------- Small pages (404, redirects) ---------- */
.center-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 60px; }
.center-page h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(56px, 12vw, 120px); line-height: 1; }
.center-page p { margin: 12px 0 24px; color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .btn, .btn:hover { transition: none; transform: none; }
  .poster img, .poster figcaption, .shots img:nth-child(odd) { transform: none; }
}
