/* Edit these to change the site colours and fonts */
:root {
  --bg: #fdfcf8;
  --surface: #f4f2ec;
  --ink: #1c1d22;
  --gold: #ffb800;
  --gold-light: #ffc933;
  --muted: #5f6068;
  --line: rgba(28, 29, 34, 0.1);

  --font: "Satoshi", system-ui, sans-serif;
  --font-heading: "Libre Baskerville", "Baskerville", Georgia, serif;
  --font-wordmark: "Clash Display", "Satoshi", sans-serif;
  --max-width: 1100px;
  --header-height: 76px;

  /* Edit these to change animation speed */
  --speed: 0.3s;
  --speed-slow: 0.8s;
  --partners-speed: 40s;
  --shine-every: 4s;
  --swap-speed: 900ms;

  /* Easing curves */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1); /* gentle and even, from easings.net */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
}

strong,
b {
  font-weight: 700;
}

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

h1,
h2,
h3 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
}

h3 {
  font-size: 2rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--ink);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* The "Golden Game" wordmark */
.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Image frame with corner marks. Put an <img> inside to replace the placeholder. */
.frame {
  --corner: 22px;
  --corner-color: var(--ink);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(var(--corner-color) 0 0) top left / var(--corner) 1px,
    linear-gradient(var(--corner-color) 0 0) top left / 1px var(--corner),
    linear-gradient(var(--corner-color) 0 0) top right / var(--corner) 1px,
    linear-gradient(var(--corner-color) 0 0) top right / 1px var(--corner),
    linear-gradient(var(--corner-color) 0 0) bottom left / var(--corner) 1px,
    linear-gradient(var(--corner-color) 0 0) bottom left / 1px var(--corner),
    linear-gradient(var(--corner-color) 0 0) bottom right / var(--corner) 1px,
    linear-gradient(var(--corner-color) 0 0) bottom right / 1px var(--corner);
  background-repeat: no-repeat;
}

.frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--speed-slow) ease;
}

/* Underline that draws in on hover */
.underline-link {
  position: relative;
}

.underline-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--speed) ease;
}

.underline-link:hover::after {
  transform: scaleX(1);
}

/* Buttons */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--speed) ease, transform 0.1s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: transform var(--speed) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn .arrow {
  transition: transform var(--speed) ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}

.btn-gold::before {
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left;
}

.btn-gold:hover::before {
  transform: scaleX(1);
}

.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline::before {
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
}

.btn-outline:hover {
  color: var(--bg);
}

.btn-outline:hover::before {
  transform: scaleY(1);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: background-color var(--speed) ease, border-color var(--speed) ease;
}

.site-header.scrolled {
  background: rgba(253, 252, 248, 0.95);
  border-bottom-color: var(--line);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
}

/* Edit the height to change the logo size */
.logo img {
  height: 52px;
  width: auto;
  transition: transform var(--speed) ease;
}

.logo:hover img {
  transform: rotate(-12deg) scale(1.05);
}

.site-nav {
  display: flex;
  gap: 2.25rem;
}

.site-nav a {
  font-weight: 700;
}

.nav-toggle {
  display: none;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + 1rem) 1.5rem 1.5rem;
  text-align: center;
}

/* Edit this to change the glow behind the hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 184, 0, 0.18), transparent 60%);
}

.hero-image {
  --corner-color: var(--bg);
  position: absolute;
  inset: calc(var(--header-height) + 1rem) 1.5rem 1.5rem;
  z-index: -2;
  background: var(--ink);
}

/* Background video, cropped to fill the frame */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark tint over the video so the text stays readable: darker in the middle, lighter at the edges.
   Edit the last number in each colour (0 to 1) to make it darker or lighter. */
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(28, 29, 34, 0.75), rgba(28, 29, 34, 0.45));
}

.hero-content {
  max-width: 1000px;
  padding: 3rem 1.5rem 4.5rem;
}

.hero-content > * {
  animation: fade-up var(--speed-slow) ease both;
}

.hero-content > :nth-child(2) {
  animation-delay: 0.15s;
}

.hero-content > :nth-child(3) {
  animation-delay: 0.3s;
}

.hero-content > :nth-child(4) {
  animation-delay: 0.45s;
}

/* Hero title: gold "Golden Game" that fades into "GG" on scroll (class added in js/main.js).
   Both words sit in the same spot and are the same width, so the shine lines up across them. */
.hero-title {
  display: grid;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  white-space: nowrap;
  animation: fade-up var(--speed-slow) ease both;
}

.hero-title span {
  grid-area: 1 / 1;
  text-align: center;
  color: transparent;
  background: linear-gradient(110deg, var(--gold) 45%, #fff6d8 50%, var(--gold) 55%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer var(--shine-every) ease 0.9s infinite;
  transition:
    opacity var(--swap-speed) var(--ease-in-out-sine),
    filter var(--swap-speed) var(--ease-in-out-sine),
    transform var(--swap-speed) var(--ease-in-out-sine);
}

/* The word that isn't showing: faded, softly blurred, slightly smaller */
.hero-title .title-short,
.hero-title.collapsed .title-full {
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.97);
}

.hero-title.collapsed .title-short {
  opacity: 1;
  filter: none;
  transform: none;
}

.hero-tagline {
  max-width: 720px;
  margin: 0 auto 1.75rem;
  color: rgba(253, 252, 248, 0.85);
  font-size: 1rem;
  text-wrap: balance;
}

/* Mini-game (js/minigame.js): a dark arcade screen with a gold neon glow */
.mini-game-window {
  --corner-color: var(--gold);
  width: min(100%, 42vh, 400px); /* Edit this to change the window size */
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.75rem;
  background: #0b0c12;
  border-color: rgba(255, 184, 0, 0.35);
  box-shadow: 0 0 24px rgba(255, 184, 0, 0.15);
  transition: box-shadow 300ms var(--ease-out);
}

.mini-game-window[data-state="playing"] {
  box-shadow: 0 0 36px rgba(255, 184, 0, 0.3);
}

.game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

/* While playing: no cursor (the crosshair replaces it) and taps don't scroll the page */
.mini-game-window[data-state="playing"] .game-canvas {
  cursor: none;
  touch-action: none;
}

/* Old-screen scanlines and darker corners, drawn over the game */
.game-scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6));
}

/* Arcade text: Satoshi Bold, capitals, wide spacing, gold glow */
.game-hud,
.game-screen {
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.game-hud {
  position: absolute;
  top: 0.7rem;
  left: 0.8rem;
  right: 0.8rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}

.mini-game-window[data-state="playing"] .game-hud {
  opacity: 1;
}

.game-score,
.game-combo {
  display: inline-block;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.game-score {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 184, 0, 0.7);
}

.game-combo {
  color: #fff6d8;
  text-shadow: 0 0 8px rgba(255, 246, 216, 0.7);
}

.game-lives {
  display: flex;
  gap: 0.25rem;
}

.game-life {
  width: 20px;
  height: 20px;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.game-life.lost {
  opacity: 0.2;
  transform: scale(0.7);
  filter: grayscale(1);
}

/* Start and game over screen: fades and settles in, fades away when you play */
.game-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.5rem;
  background: rgba(11, 12, 18, 0.65);
  transition:
    opacity 250ms var(--ease-out),
    transform 250ms var(--ease-out),
    visibility 0s;
}

.mini-game-window[data-state="playing"] .game-screen {
  opacity: 0;
  transform: scale(0.97);
  visibility: hidden;
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out),
    visibility 0s 200ms;
}

.game-screen p {
  margin: 0;
}

.game-screen-title {
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(255, 184, 0, 0.7);
}

.game-screen-text {
  color: rgba(253, 252, 248, 0.75);
  font-size: 0.7rem;
}

.game-screen .btn {
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Hi-score blinks like an arcade attract screen */
.game-best {
  color: #fff6d8;
  font-size: 0.7rem;
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* Light outline button on dark backgrounds (hero video, cookie banner) */
.hero .btn-outline,
.cookie-banner .btn-outline {
  border-color: var(--bg);
  color: var(--bg);
}

.hero .btn-outline::before,
.cookie-banner .btn-outline::before {
  background: var(--bg);
}

.hero .btn-outline:hover,
.cookie-banner .btn-outline:hover {
  color: var(--ink);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The shine crosses in the first 40% of each loop, then pauses */
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  40%,
  100% {
    background-position: 0 0;
  }
}

/* Scroll reveal. Add class="reveal" to anything you want to fade in. */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--speed-slow) ease, transform var(--speed-slow) ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 8rem 0;
  scroll-margin-top: var(--header-height);
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Partners: scrolling logo strip */
.partners {
  padding-top: 3.5rem;
}

/* Full-width strip, edge to edge */
.partners-strip {
  overflow: hidden;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

/* Smaller gap between the strip and the About section */
.partners + .section {
  padding-top: 5rem;
}

.partners-track {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: scroll-logos var(--partners-speed) linear infinite;
}

.partners-strip:hover .partners-track {
  animation-play-state: paused;
}

.partners-track li {
  padding: 0 3rem;
}

/* Edit the height to change the logo size */
.partners-track img {
  height: 40px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.85; /* Edit this to make the logos lighter or darker (0 to 1) */
  transition: opacity var(--speed) ease;
}

.partners-track img:hover {
  opacity: 1;
}

@keyframes scroll-logos {
  to {
    transform: translateX(-50%);
  }
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text p:not(.section-label) {
  color: var(--muted);
  font-size: 1.1rem;
}

.about-image {
  aspect-ratio: 16 / 9; /* Edit this to match the about image's shape */
  transition-delay: 0.15s;
}

/* Games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: opacity var(--speed-slow) ease, transform var(--speed) ease, border-color var(--speed) ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--ink);
}

.game-card:hover .frame > img {
  transform: scale(1.05);
}

.game-image {
  --corner-color: var(--bg);
  aspect-ratio: 16 / 9;
  border: none;
  background: #ebe8e0;
}

.game-body {
  padding: 2rem;
}

.game-body p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* "Coming soon" tag on a game card */
.game-body .game-status {
  display: inline-block;
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Featured game: wide card with the image beside the text */
.game-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
}

.game-card.featured .game-image {
  aspect-ratio: auto;
  min-height: 360px;
}

.game-card.featured .game-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem;
}

/* Contact */
.contact-section {
  padding: 4.5rem 0;
}

.contact {
  text-align: center;
}

.contact h2 {
  font-size: 2rem;
}

.contact-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  font-weight: 700;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.footer-inner p {
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--muted);
}

/* Other pages (contact, privacy, terms) */
.page {
  min-height: calc(100vh - 60px);
  padding: calc(var(--header-height) + 4rem) 0 5rem;
}

.page-inner {
  max-width: 680px;
}

.page h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 2rem;
}

.page p {
  color: var(--muted);
}

/* Legal pages (privacy, terms) */
.legal h2 {
  margin: 3rem 0 1rem;
  font-size: 1.5rem;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.legal li {
  margin-bottom: 0.4rem;
}

.legal strong {
  color: var(--ink);
}

.legal a {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.legal-updated {
  font-size: 0.9rem;
}

.legal-copyright {
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* Wide tables scroll sideways on small screens */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.legal th,
.legal td {
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal th {
  font-weight: 700;
}

.legal td {
  color: var(--muted);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid rgba(28, 29, 34, 0.2);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--speed) ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
  outline: none;
}

.form-status {
  font-weight: 700;
}

/* Cookie banner (made by js/cookies.js) */
.cookie-banner {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 20;
  max-width: 420px;
  padding: 1.5rem;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 12px 32px rgba(28, 29, 34, 0.25);
  animation: fade-up var(--speed-slow) ease both;
}

.cookie-banner p {
  margin: 0 0 1.25rem;
  color: rgba(253, 252, 248, 0.85);
  font-size: 0.9rem;
}

.cookie-banner a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Both buttons are the same size so neither choice is pushed */
.cookie-buttons .btn {
  flex: 1;
  justify-content: center;
  padding: 0.7rem 1rem;
}

/* Tablet and mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .partners-strip {
    padding: 2rem 0;
  }

  .partners + .section {
    padding-top: 3.5rem;
  }

  .logo {
    gap: 0.5rem;
    font-size: 1rem;
  }

  .logo img {
    height: 40px;
  }

  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }

  .partners-track li {
    padding: 0 1.75rem;
  }

  .partners-track img {
    height: 30px;
  }

  .site-nav a {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line);
  }

  .site-nav a::after {
    display: none;
  }

  .hero {
    min-height: 85vh;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .section {
    padding: 5rem 0;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .games-grid,
  .game-card.featured {
    grid-template-columns: 1fr;
  }

  .game-card.featured .game-image {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .game-card.featured .game-body {
    padding: 2rem;
  }
}
