:root {
  --bg: #fffdf8;
  --sky: #e6f5ff;
  --sky-soft: #f2f9ff;
  --cream: #fff7e6;
  --ink: #17305b;
  --ink-soft: #51627f;
  --line: #e7edf5;
  --moon: #ffd24a;
  --moon-glow: rgba(255, 210, 74, 0.45);
  --sea: #1593e6;
  --sea-deep: #0b6fb8;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(23, 48, 91, 0.08);
  --shadow-lift: 0 18px 40px rgba(23, 48, 91, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.7 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sea-deep); }
a:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 253, 248, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(231, 237, 245, 0.7);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 20px/1 "Fredoka", "Nunito", sans-serif; letter-spacing: 0.05em;
  color: var(--ink); text-decoration: none;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
}
.nav a:hover { background: var(--sky); }
@media (max-width: 400px) { .nav a { padding: 8px 10px; } .logo { font-size: 18px; } }

/* Home hero: a sunset over a tropical sea */
:root {
  --dusk-1: #b9a7ee;   /* lavender, top of the sky */
  --dusk-2: #f4a7c6;   /* pink */
  --dusk-3: #ffb48f;   /* coral */
  --dusk-4: #ffd6a0;   /* peach at the horizon */
  --sea-far: #2f8fb5;
  --sea-mid: #22b2bd;
  --sea-near: #52d6c8;
  --sunset-sky: linear-gradient(180deg, var(--dusk-1) 0%, var(--dusk-2) 40%, var(--dusk-3) 62%, var(--dusk-4) 78%);
}
.hero {
  position: relative; overflow: hidden; text-align: center;
  /* the last 3px are page colour so no sky line shows under the front wave */
  background: var(--sunset-sky) top / 100% calc(100% - 3px) no-repeat, var(--bg);
  padding-top: 104px;
}
.hero h1 {
  position: relative; z-index: 2;
  font: 600 clamp(36px, 12.5vw, 112px)/1 "Fredoka", "Nunito", sans-serif;
  letter-spacing: 0.03em; margin: 0 0 18px;
}
.hero p { position: relative; z-index: 2; margin: 0; color: #3d3866; font-size: clamp(17px, 2.4vw, 20px); font-weight: 600; }

.scene { position: relative; height: 400px; margin-top: 24px; --horizon: 140px; --sun: 200px; }
.horizon-glow {
  position: absolute; left: 50%; top: var(--horizon); width: 1100px; height: 300px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 222, 170, 0.6) 0%, rgba(255, 196, 150, 0.3) 35%, rgba(255, 180, 150, 0) 70%);
}
.sun {
  position: absolute; left: 50%; top: var(--horizon);
  width: var(--sun); height: var(--sun); transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #fff3cf 0%, #ffd37f 40%, #ffa75a 80%, #ff8c4f 100%);
  box-shadow: 0 0 36px 8px rgba(255, 170, 96, 0.6), 0 0 120px 44px rgba(255, 140, 110, 0.3);
}
.sea {
  position: absolute; left: 0; right: 0; top: var(--horizon); bottom: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--sea-far) 0%, var(--sea-mid) 45%, var(--sea-near) 100%);
}
.sea::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 42% 75% at 50% 0%, rgba(255, 210, 160, 0.6), rgba(255, 210, 160, 0) 70%);
}
.sea::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, rgba(255, 240, 210, 0), rgba(255, 244, 220, 0.95) 50%, rgba(255, 240, 210, 0));
}
.glint { position: absolute; left: 50%; top: 0; width: 400px; height: 260px; transform: translateX(-50%); }
.glint rect { fill: #ffe2a0; animation: glint 3.4s ease-in-out infinite; }
@keyframes glint { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (max-width: 600px) {
  .hero { padding-top: 64px; }
  .scene { height: 300px; margin-top: 16px; --horizon: 100px; --sun: 132px; }
  .horizon-glow { width: 700px; height: 220px; }
  .glint { width: 280px; height: 182px; }
}
@media (prefers-reduced-motion: reduce) { .glint rect { animation: none; } }

/* Waves: three layers drifting at different speeds */
.waves { position: absolute; left: 0; right: 0; bottom: -1px; height: 150px; overflow: hidden; pointer-events: none; }
.wave { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; display: block; }
.wave-back { fill: #6fe0d2; opacity: 0.7; animation: wave-drift 28s linear infinite; }
.wave-mid { animation: wave-drift 17s linear infinite reverse; }
.wave-mid .body { fill: #a6f0e4; opacity: 0.85; }
.wave-mid .foam { fill: none; stroke: #ffffff; stroke-width: 4; opacity: 0.7; }
.wave-front { animation: wave-drift 40s linear infinite; }
.wave-front .body { fill: var(--bg); }
.wave-front .foam { fill: none; stroke: #ffffff; stroke-width: 3; opacity: 0.9; }
@keyframes wave-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .wave { animation: none; } }
@media (max-width: 600px) { .waves { height: 100px; } }
.waves-sm { height: 80px; }
@media (max-width: 600px) { .waves-sm { height: 56px; } }

/* Sections */
.section { padding: 64px 0 80px; }
.section-title {
  font: 600 clamp(28px, 4vw, 36px)/1.2 "Fredoka", "Nunito", sans-serif;
  text-align: center; margin: 0 0 40px; letter-spacing: 0.01em;
}

/* Game grid */
.games {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
@media (max-width: 1000px) { .games { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .games { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.game-card {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 32px 16px 26px;
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.game-card img {
  width: 132px; height: 132px; border-radius: 24%;
  box-shadow: 0 8px 20px rgba(23, 48, 91, 0.16);
}
.game-card .name {
  font: 600 20px/1.25 "Fredoka", "Nunito", sans-serif; letter-spacing: 0.02em; text-align: center;
}
@media (max-width: 600px) {
  .game-card { padding: 22px 10px 18px; gap: 12px; border-radius: 22px; }
  .game-card img { width: 104px; height: 104px; }
  .game-card .name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .game-card { transition: none; } .game-card:hover { transform: none; } }

/* Contact */
.contact {
  text-align: center; background: var(--sky-soft); border: 1px solid var(--line);
  border-radius: 32px; padding: 48px 20px;
}
.contact .section-title { margin-bottom: 14px; }
.contact a {
  font: 600 clamp(18px, 3vw, 24px)/1.4 "Fredoka", "Nunito", sans-serif;
  color: var(--sea-deep); text-decoration: none; word-break: break-all;
}
.contact a:hover { text-decoration: underline; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 32px 0 40px; text-align: center; color: var(--ink-soft); font-size: 15px; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 10px; }
.site-foot a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-foot a:hover { text-decoration: underline; }
.site-foot p { margin: 0; }

/* Game page */
.game-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #cbbcf3 0%, #f7b9d2 45%, #ffc6a2 80%, #ffd9ad 100%) top / 100% calc(100% - 3px) no-repeat, var(--bg);
  padding: 32px 0 110px;
}
.game-hero .back { color: #3d3866; }
.game-hero .back:hover { color: var(--ink); }
.game-hero .wrap { position: relative; z-index: 1; }
@media (max-width: 600px) { .game-hero { padding-bottom: 80px; } }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px;
  color: var(--ink-soft); font-weight: 700; text-decoration: none; font-size: 15px;
}
.back:hover { color: var(--ink); }
.game-title { display: flex; align-items: center; gap: 28px; }
.game-title img {
  width: 132px; height: 132px; border-radius: 24%; flex: none;
  box-shadow: 0 10px 26px rgba(23, 48, 91, 0.18);
}
.game-title h1 {
  font: 600 clamp(34px, 5.4vw, 56px)/1.08 "Fredoka", "Nunito", sans-serif;
  margin: 0; letter-spacing: 0.01em;
}
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.store {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 15px; line-height: 1.2;
}
.store:hover { background: #0e2246; }
.store svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 600px) {
  .game-title { flex-direction: column; align-items: flex-start; gap: 18px; }
  .game-title img { width: 104px; height: 104px; }
}

.game-body { padding: 56px 0 32px; }
.videos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px; margin: 0 0 56px;
}
.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: #0e2246; box-shadow: var(--shadow);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prose { max-width: 720px; margin: 0 auto; }
.prose .lead { font: 600 clamp(20px, 2.8vw, 24px)/1.5 "Fredoka", "Nunito", sans-serif; margin: 0 0 18px; }
.prose h2 {
  font: 600 21px/1.35 "Fredoka", "Nunito", sans-serif; letter-spacing: 0.02em;
  margin: 40px 0 10px; color: var(--ink);
}
.prose h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--moon); margin-right: 10px; vertical-align: 0.12em;
}
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2em; }
.prose li { margin: 0 0 6px; }
.prose li::marker { color: var(--sea); }

.shots { display: grid; gap: 20px; margin: 56px 0 0; }
.shots.landscape { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.shots.square { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.shots.portrait { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 400px) { .shots.portrait { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.shots figure { margin: 0; }
.shots img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); background: var(--sky-soft); }
.shots.square img { aspect-ratio: 1 / 1; object-fit: cover; }
.shots.fit img { aspect-ratio: 16 / 9; object-fit: cover; }
.videos:has(> .video:only-child) { max-width: 880px; margin-left: auto; margin-right: auto; }
.shots figcaption { margin-top: 12px; text-align: center; font-weight: 700; line-height: 1.45; }

.more { padding: 56px 0 72px; }
.more .section-title { font-size: 24px; margin-bottom: 28px; }
.more-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 18px; }
.more-list a {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 12px; line-height: 1.3; text-align: center;
}
.more-list img { width: 68px; height: 68px; border-radius: 24%; box-shadow: 0 6px 16px rgba(23, 48, 91, 0.14); transition: transform 0.2s ease; }
.more-list a:hover img { transform: translateY(-3px); }

/* Legal pages */
.legal { padding: 56px 0 72px; }
.legal h1 { font: 600 clamp(32px, 5vw, 44px)/1.15 "Fredoka", "Nunito", sans-serif; margin: 0 0 28px; }
.legal h2 { font: 700 19px/1.4 "Nunito", sans-serif; margin: 32px 0 8px; }
.legal h2::before { display: none; }
.legal p, .legal li { color: #2b3d5e; }

/* 404 */
.not-found { text-align: center; padding: 96px 0 120px; }
.not-found h1 { font: 600 40px/1.2 "Fredoka", "Nunito", sans-serif; margin: 0 0 12px; }
.not-found p { color: var(--ink-soft); margin: 0 0 24px; }
.button {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 700;
}
