/* Play page (lib/landing.js). The game's look: Theme.luau palette, Bangers + Fredoka, ink outlines, downward drop shadows. */
@font-face { font-family: 'Bangers'; src: url('bangers.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('fredoka.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }

:root {
  --ink: #17142a; --bg: #1d1938; --panel: #2c284e; --panel-l: #403a6e;
  --yellow: #ffd628; --green: #46d278; --green-hi: #7ef0a6; --green-lo: #23a85a; --pink: #ff78c8; --cyan: #46d7eb; --red: #ff525c; --orange: #ff9632; --purple: #aa64ff;
  --text: #fff; --soft: #d9d4ff;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 600 17px/1.4 'Fredoka', 'Trebuchet MS', sans-serif; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }
h1, h2, h3 { margin: 0; font-family: 'Bangers', 'Fredoka', sans-serif; font-weight: 400; letter-spacing: 0.03em; line-height: 0.95; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.page { overflow-x: clip; padding: 0 max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(120% 60% at 50% 0%, #4a3f8f 0%, rgba(74, 63, 143, 0) 70%), radial-gradient(90% 50% at 50% 100%, #2a2252 0%, rgba(42, 34, 82, 0) 70%); }

/* --- hero ------------------------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; max-width: 560px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 0 6px; text-align: center; }
.rays { position: absolute; z-index: -1; top: -170px; left: 50%; width: 760px; height: 760px; margin-left: -380px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 40, 0.16) 0deg 9deg, rgba(255, 214, 40, 0) 9deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 72%); mask: radial-gradient(closest-side, #000 18%, transparent 72%);
  animation: spin 60s linear infinite; }
.icon { display: block; width: 144px; height: 144px; margin: 0 auto; border: 5px solid var(--ink); border-radius: 34px;
  box-shadow: 0 8px 0 var(--ink), 0 22px 30px rgba(8, 4, 24, 0.5); transform: rotate(-4deg); animation: pop 0.7s var(--spring) both, wobble 5s ease-in-out 0.9s infinite; }
h1 { margin: 18px 0 10px; color: var(--yellow); font-size: clamp(64px, 19vw, 112px); -webkit-text-stroke: 0.1em var(--ink); paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--ink); transform: rotate(-2deg); animation: drop 0.6s var(--spring) 0.08s both; }
.pitch { max-width: 31ch; margin: 0 auto 24px; color: var(--soft); font-size: 19px; line-height: 1.35; text-wrap: balance; }
.pitch em { font-style: normal; color: var(--yellow); white-space: nowrap; }
.blob { position: absolute; z-index: -1; width: 54px; height: 54px; filter: drop-shadow(0 5px 0 var(--ink)); animation: bob 3.4s ease-in-out infinite; }
.b1 { top: 26px; left: 2%; color: var(--pink); transform: rotate(-12deg); }
.b2 { top: 108px; right: 1%; width: 62px; height: 62px; color: var(--cyan); animation-delay: -1.2s; }
.b3 { top: 318px; left: -8px; width: 40px; height: 40px; color: var(--green); animation-delay: -2.1s; }
.b4 { top: 10px; right: 16%; width: 34px; height: 34px; color: var(--orange); animation-delay: -0.6s; }

/* --- the button ------------------------------------------------------------------------- */
.play { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 440px; min-height: 96px; margin: 0 auto;
  padding: 10px 22px 6px; border: 5px solid var(--ink); border-radius: 26px; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, var(--green-hi) 0%, var(--green) 48%, var(--green-lo) 100%);
  box-shadow: 0 9px 0 var(--ink), 0 22px 28px rgba(8, 4, 24, 0.55), inset 0 -6px 0 rgba(0, 60, 30, 0.28);
  font: 400 clamp(40px, 12vw, 52px)/1 'Bangers', 'Fredoka', sans-serif; letter-spacing: 0.05em;
  -webkit-text-stroke: 0.12em var(--ink); paint-order: stroke fill; text-shadow: 0 0.07em 0 var(--ink);
  transition: transform 0.16s var(--spring), box-shadow 0.16s var(--out); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.play::before { content: ''; position: absolute; top: 7px; left: 18px; right: 18px; height: 26%; border-radius: 18px 18px 40px 40px; background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08)); pointer-events: none; }
.play::after { content: ''; position: absolute; top: 12px; right: 26px; width: 14px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); transform: rotate(-20deg); pointer-events: none; }
.play span { position: relative; padding-top: 0.04em; }
.pi { position: relative; flex: none; width: 0.85em; height: 0.85em; overflow: visible; }
.pi path { fill: #fff; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; paint-order: stroke fill; }
.p1 { animation: pop 0.6s var(--spring) 0.18s both, nudge 3.2s ease-in-out 1.6s infinite; }
.play:hover { transform: translateY(-3px); box-shadow: 0 12px 0 var(--ink), 0 26px 30px rgba(8, 4, 24, 0.55), inset 0 -6px 0 rgba(0, 60, 30, 0.28); }
.play:active { transform: translateY(8px) scale(0.985); box-shadow: 0 1px 0 var(--ink), 0 6px 10px rgba(8, 4, 24, 0.5), inset 0 -3px 0 rgba(0, 60, 30, 0.28); transition-duration: 0.05s; }
.opens { margin: 18px 0 0; color: var(--soft); font-size: 14px; opacity: 0.85; }

/* --- help ------------------------------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; }
.help { max-width: 520px; margin: 34px auto 0; padding: 20px 18px 18px; border: 4px solid var(--ink); border-radius: 24px; background: var(--panel); box-shadow: 0 7px 0 var(--ink), 0 18px 26px rgba(8, 4, 24, 0.35); }
.help h2 { margin: 0 0 14px; color: var(--cyan); font-size: 30px; -webkit-text-stroke: 0.08em var(--ink); paint-order: stroke fill; text-shadow: 0 0.07em 0 var(--ink); }
.help ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.help li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px; align-items: start; font-size: 16.5px; line-height: 1.35; }
.help li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 50%;
  background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--ink); font: 400 21px/1 'Bangers', sans-serif; padding-top: 2px; }
.help li > span:first-of-type { padding-top: 5px; }
.help b { color: var(--yellow); font-weight: 700; }
.mini { display: inline-block; padding: 3px 8px 1px; border: 2px solid var(--ink); border-radius: 9px; background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--ink);
  font: 400 15px/1.1 'Bangers', sans-serif; letter-spacing: 0.05em; -webkit-text-stroke: 0.1em var(--ink); paint-order: stroke fill; white-space: nowrap; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.store { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 16px 8px 12px; border: 3px solid var(--ink); border-radius: 15px; background: #fff; color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; transition: transform 0.14s var(--spring), box-shadow 0.14s var(--out); }
.store svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.store:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.store:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }

/* --- minigames -------------------------------------------------------------------------- */
.games-sec { margin-top: 56px; text-align: center; }
.games-sec h2, .end h2 { color: #fff; font-size: 44px; -webkit-text-stroke: 0.09em var(--ink); paint-order: stroke fill; text-shadow: 0 0.07em 0 var(--ink); }
.games-sec h2 span { color: var(--yellow); }
.sub { margin: 8px 0 0; color: var(--soft); font-size: 16px; }
.games { display: flex; gap: 16px; margin: 0 -16px; padding: 18px 16px 26px; list-style: none; text-align: left; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  scrollbar-width: thin; scrollbar-color: var(--panel-l) transparent; overscroll-behavior-x: contain; }
.game { flex: none; width: 232px; scroll-snap-align: start; overflow: hidden; border: 4px solid var(--ink); border-radius: 22px; background: var(--panel-l); box-shadow: 0 6px 0 var(--ink); }
.game:nth-child(odd) { transform: rotate(-1.2deg); }
.game:nth-child(even) { transform: rotate(1.2deg); }
.game img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border-bottom: 4px solid var(--ink); background: var(--panel); }
.game h3 { margin: 12px 14px 4px; font-size: 25px; -webkit-text-stroke: 0.08em var(--ink); paint-order: stroke fill; }
.game p { margin: 0 14px 14px; color: var(--soft); font-size: 14.5px; line-height: 1.3; }
.game:nth-child(5n+1) h3 { color: var(--yellow); }
.game:nth-child(5n+2) h3 { color: var(--cyan); }
.game:nth-child(5n+3) h3 { color: var(--pink); }
.game:nth-child(5n+4) h3 { color: var(--green); }
.game:nth-child(5n) h3 { color: var(--orange); }
@media (min-width: 900px) {
  .games { flex-wrap: wrap; justify-content: center; gap: 22px; margin: 0; padding: 26px 0 10px; overflow: visible; }
  .game { width: 250px; }
  .game:hover { transform: translateY(-4px) rotate(0deg); box-shadow: 0 10px 0 var(--ink); transition: transform 0.2s var(--spring), box-shadow 0.2s var(--out); }
}

/* --- end + footer ----------------------------------------------------------------------- */
.end { max-width: 440px; margin: 48px auto 0; text-align: center; }
.end h2 { margin-bottom: 20px; font-size: 40px; color: var(--yellow); }
footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 56px auto 0; color: var(--soft); font-size: 13px; opacity: 0.75; text-align: center; }
footer a { text-underline-offset: 3px; }

/* --- motion ----------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { scale: 0.82; } }
@keyframes drop { from { translate: 0 -14px; scale: 1.06; } }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes bob { 50% { translate: 0 -9px; } }
@keyframes nudge { 0%, 86%, 100% { scale: 1; rotate: 0deg; } 90% { scale: 1.045; rotate: -1deg; } 94% { scale: 0.99; rotate: 0.6deg; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
