/* Mako Arcade — one stylesheet for every page.
   Colours and sizes are variables at the top, so the look of the whole site can be changed from here. */

:root {
  --bg: #07101c;
  --bg-raised: #0d1b2e;
  --panel: #11233a;
  --panel-hover: #152c47;
  --line: rgba(160, 200, 240, 0.16);
  --text: #e8f1fb;
  --muted: #9db2c9;
  --accent: #2de2c4;
  --accent-strong: #19c4a8;
  --accent-ink: #04231e;
  --sky: #5aa9ff;
  --warm: #ffb454;
  --radius: 16px;
  --radius-small: 10px;
  --page-width: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 520px at 80% -10%, rgba(45, 226, 196, 0.12), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(90, 169, 255, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #7ff5e0; }

:focus-visible {
  outline: 3px solid var(--warm);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--warm);
  color: #1a1100;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.02rem;
}
.brand:hover { color: var(--text); }
.brand img { width: 38px; height: 38px; }
.brand span b { color: var(--accent); font-weight: 800; }

.site-nav { display: flex; gap: 6px; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- Main ---------- */

main { flex: 1 0 auto; }

.hero {
  padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 48px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
}
.section-title h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.section-title p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Catalog ---------- */

.catalog {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}

.game-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(45, 226, 196, 0.5);
}

.game-card .cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-raised);
}
.game-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.game-card:hover .cover img { transform: scale(1.04); }

.game-card .body { padding: 20px 22px 24px; }
.game-card h3 { margin: 0 0 10px; font-size: 1.4rem; letter-spacing: -0.01em; }
.game-card h3 a { color: var(--text); text-decoration: none; }
.game-card h3 a:hover { color: var(--accent); }
.game-card h3 a::after { content: " \2197"; color: var(--accent); font-weight: 400; }
/* The title's link is stretched over the whole card, so the entire box is the click target */
.game-card { position: relative; cursor: pointer; }
.game-card h3 a::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.game-card:has(h3 a:focus-visible) { outline: 3px solid var(--warm); outline-offset: 3px; }
.game-card h3 a:focus-visible { outline: none; }

.play-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 1.08rem;
  box-shadow: 0 6px 22px rgba(45, 226, 196, 0.35);
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
}
.play-cue svg { width: 14px; height: 14px; fill: currentColor; }
.game-card:hover .play-cue,
.game-card:focus-within .play-cue { background: #7ff5e0; transform: translateX(3px); }
.game-card p { margin: 0; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Game page ---------- */

.game-page { padding: clamp(24px, 4vw, 44px) 0 clamp(40px, 6vw, 72px); }

.game-title { margin: 0 0 18px; }
.game-title h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.crumbs { margin: 0 0 8px; font-size: 0.9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 440px;
  max-height: 82vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.game-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.game-stage:fullscreen,
.game-stage:-webkit-full-screen {
  max-height: none;
  border-radius: 0;
  border: 0;
}

.start-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(7, 16, 28, 0.35), rgba(7, 16, 28, 0.78)),
    var(--cover, none) center / cover no-repeat;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.start-overlay[hidden] { display: none; }
.start-overlay .play-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 10px rgba(45, 226, 196, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.start-overlay:hover .play-icon,
.start-overlay:focus-visible .play-icon {
  transform: scale(1.06);
  box-shadow: 0 0 0 14px rgba(45, 226, 196, 0.28);
}
.start-overlay .play-icon svg { width: 34px; height: 34px; margin-left: 4px; fill: currentColor; }
.start-overlay strong { font-size: 1.35rem; }
.start-overlay span { color: var(--muted); font-size: 0.98rem; }

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 600 0.92rem/1 inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.build-info {
  margin-left: 8px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 0.78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}
.build-info:empty { display: none; }

.content-block {
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(20px, 3vw, 32px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.content-block h2 { margin: 0 0 12px; font-size: 1.35rem; letter-spacing: -0.01em; }
.content-block p { margin: 0; max-width: 75ch; color: #c9d8ea; font-size: 1.04rem; }

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 22px 36px;
}
.controls-grid h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.controls-list { margin: 0; padding: 0; list-style: none; }
.controls-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.controls-list li:last-child { border-bottom: 0; }
.controls-list .keys { flex: 0 0 auto; min-width: 7.6rem; display: flex; flex-wrap: wrap; gap: 6px; }
.controls-list .action { color: #c9d8ea; }
kbd {
  display: inline-block;
  min-width: 2rem;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid rgba(160, 200, 240, 0.35);
  border-bottom-width: 3px;
  background: var(--bg-raised);
  color: var(--text);
  font: 700 0.86rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
.note { margin-top: 18px !important; font-size: 0.95rem !important; color: var(--muted) !important; }

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.8);
  padding: 26px 0 30px;
  color: var(--muted);
  font-size: 0.93rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}
.site-footer p { margin: 0; }
.site-footer .copyright { color: var(--text); }
@media (max-width: 640px) {
  .site-header .wrap { min-height: 60px; }
  .brand { font-size: 0.9rem; letter-spacing: 0.1em; }
  .game-stage { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
