:root {
  --bg: #11141d;
  --bg-2: #171b27;
  --ink: #0a1020;
  --text: #f4f6fb;
  --text-dim: #a8b2c7;
  --red: #ff3b3b;
  --red-deep: #c81e1e;
  --yellow: #ffcf3f;
  --yellow-deep: #e9a400;
  --title: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --body: 'Fredoka', system-ui, sans-serif;
  --brush: 'Caveat Brush', 'Fredoka', cursive;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.78), rgba(10, 16, 32, 0.55));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-pad { width: 42px; height: 28px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.brand-text {
  font-family: var(--title);
  font-size: 28px;
  letter-spacing: 0.3px;
  font-style: italic;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.brand-text span { font-size: 0.72em; }

.nav-links { flex: 1; display: flex; justify-content: center; gap: 6px; }
.nav-links a {
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  color: #e6ebf5;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-links a.active { background: rgba(255, 255, 255, 0.16); color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-yellow {
  padding: 10px 22px;
  color: #1c1300;
  background: linear-gradient(180deg, #ffe17a, var(--yellow) 50%, var(--yellow-deep));
  box-shadow: 0 4px 0 #a86f00, 0 10px 20px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.nav-cta { margin-left: auto; flex-shrink: 0; }

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

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative;
  height: clamp(560px, 84vh, 860px);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg, .hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 40%;
  z-index: -2;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 40%;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero-video.is-on { opacity: 1; }
.hero-bg img, .hero-video {
  /* A slow drift so the scene breathes even between loops. */
  animation: drift 32s ease-in-out infinite alternate;
}
.hero::after {
  /* Fade the scene into the page so the cards sit on solid ground. */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 16, 32, 0.35) 0%, rgba(10, 16, 32, 0) 18%),
    linear-gradient(180deg, rgba(17, 20, 29, 0) 52%, rgba(17, 20, 29, 0.75) 78%, var(--bg) 100%);
}

.hero-title {
  position: absolute;
  top: clamp(116px, 16vh, 150px);
  left: 52%;
  transform: translateX(-50%) rotate(-4deg);
  text-align: center;
  white-space: nowrap;
}
.hero-title h1 {
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(64px, 9.5vw, 150px);
  line-height: 0.95;
  color: #fff;
  letter-spacing: 1px;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink), 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.hero-title h1 span { color: var(--red); }
.crown {
  position: absolute;
  width: clamp(56px, 7vw, 100px);
  left: 26%;
  top: clamp(-62px, -6vw, -40px);
  transform: rotate(8deg);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}
.spark { position: absolute; top: 4%; width: 46px; height: 46px; }
.spark i {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 20px;
  margin: -10px 0 0 -2.5px;
  border-radius: 3px;
  background: var(--yellow);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.spark-l { left: -60px; }
.spark-r { right: -60px; }
.spark-l i:nth-child(1) { transform: rotate(-50deg) translateY(-18px); }
.spark-l i:nth-child(2) { transform: rotate(-15deg) translateY(-20px); }
.spark-l i:nth-child(3) { transform: rotate(-85deg) translateY(-14px); }
.spark-r i:nth-child(1) { transform: rotate(50deg) translateY(-18px); }
.spark-r i:nth-child(2) { transform: rotate(15deg) translateY(-20px); }
.spark-r i:nth-child(3) { transform: rotate(85deg) translateY(-14px); }

.tagline {
  position: relative;
  display: inline-block;
  margin-top: clamp(4px, 1vw, 12px);
  padding: 6px clamp(18px, 3vw, 36px) 10px;
  transform: rotate(-2deg);
}
.tagline::before {
  /* Brush-stroke ribbon */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ffe27e, #ffd240);
  border-radius: 40% 60% 46% 54% / 60% 42% 58% 40%;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.tagline::after {
  content: '';
  position: absolute;
  left: 30%; right: 22%;
  bottom: -12px;
  height: 7px;
  border-radius: 6px;
  background: var(--red);
  transform: rotate(-2deg);
}
.tagline span {
  font-family: var(--brush);
  font-size: clamp(22px, 2.8vw, 40px);
  color: #1b1408;
  line-height: 1.1;
}

/* Wooden sign */
.sign {
  position: absolute;
  right: clamp(12px, 3vw, 48px);
  top: 26%;
  width: clamp(160px, 13vw, 220px);
  transform: rotate(4deg);
  transform-origin: bottom center;
  animation: sway 6s ease-in-out infinite;
}
.sign-pad {
  width: 34%;
  margin: 0 auto -12px 44%;
  position: relative;
  z-index: 2;
  transform: rotate(-12deg);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3));
}
.sign-board {
  position: relative;
  z-index: 1;
  padding: 16px 12px 14px;
  text-align: center;
  font-family: var(--title);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.02;
  color: #f6e2bb;
  text-shadow: 0 2px 0 #3d2410, 0 -1px 0 rgba(255, 255, 255, 0.2);
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 34%, rgba(40, 22, 8, 0.45) 34% 35.5%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 3px, rgba(0, 0, 0, 0.05) 3px 7px),
    linear-gradient(180deg, #9a6a3d, #7a4f29 60%, #64401f);
  border-radius: 10px;
  border: 3px solid #4a2d14;
  box-shadow: 0 8px 0 #3a230f, 0 16px 30px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.18);
}
.sign-post {
  width: 18px;
  height: 120px;
  margin: -4px auto 0;
  background: linear-gradient(90deg, #5a3a1c, #7f5530 50%, #4f3218);
  border-radius: 0 0 4px 4px;
}

/* ---------------------------------------------------------------- games */
.games {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: clamp(-340px, -36vh, -170px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  scroll-margin-top: 120px;
}
.card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.82), 0 22px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-game img { width: 100%; height: auto; }
.card-game:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 0 0 4px #fff, 0 0 40px rgba(255, 207, 63, 0.45), 0 30px 60px rgba(0, 0, 0, 0.55);
}
.card-soon {
  display: grid;
  place-items: center;
  min-height: 220px;
  background: #3b2a6e;
}
.soon-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.soon-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.soon-text svg { width: 46px; height: 32px; margin-bottom: 10px; }
.soon-small { font-size: clamp(18px, 1.7vw, 24px); font-weight: 600; line-height: 1.25; }
.soon-big { font-family: var(--title); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; }

/* ------------------------------------------------------------- features */
.features {
  max-width: 1180px;
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #e4e8f1;
}
.feature + .feature { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.feature svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------- panels */
.panel {
  max-width: 900px;
  margin: clamp(48px, 8vh, 88px) auto 0;
  padding: 0 var(--gutter);
  scroll-margin-top: 100px;
}
.panel h2 {
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  margin-bottom: 14px;
}
.panel h2::after {
  content: '';
  display: block;
  width: 64px;
  height: 6px;
  margin-top: 6px;
  border-radius: 4px;
  background: var(--red);
}
.panel p { font-size: 18px; color: var(--text-dim); max-width: 70ch; }

.updates { list-style: none; display: grid; gap: 14px; }
.updates li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.updates time { font-weight: 700; color: var(--yellow); }
.updates strong { display: block; font-size: 18px; color: #fff; }
.updates div { color: var(--text-dim); }

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1180px;
  margin: clamp(56px, 10vh, 100px) auto 0;
  padding: 24px var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 14px;
}

/* ----------------------------------------------------------- animation */
@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes sway {
  0%, 100% { transform: rotate(4deg); }
  50% { transform: rotate(1.5deg); }
}
@keyframes drift {
  from { transform: scale(1.06) translate3d(0.6%, 0.4%, 0); }
  to { transform: scale(1) translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .sign { display: none; }
  .hero-title { left: 58%; }
}
@media (max-width: 860px) {
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .brand-text { font-size: 24px; }
  .hero { height: clamp(560px, 86vh, 760px); }
  .hero-bg img, .hero-video { object-position: 16% 40%; }
  .hero-title { left: 50%; top: 96px; }
  .hero-title h1 { font-size: clamp(46px, 14.5vw, 96px); }
  .spark { display: none; }
  .games { grid-template-columns: minmax(0, 1fr); margin-top: -180px; }
  .card-soon { min-height: 190px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .feature { gap: 10px; font-size: 15px; }
  .feature svg { width: 36px; height: 36px; }
  .feature { justify-content: flex-start; }
  .feature + .feature { border-left: 0; }
  .updates li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 420px) {
  .nav-cta { padding: 9px 16px; }
  .brand-pad { width: 34px; }
  .brand-text { font-size: 21px; }
  .hero-title h1 { -webkit-text-stroke-width: 2px; }
}
