:root {
  color-scheme: dark;
  --ink: #f8f8ff;
  --muted: #b4b7d2;
  --bg: #090b20;
  --panel: #141735;
  --line: #30365e;
  --lime: #d9ff57;
  --lime-ink: #121500;
  --cyan: #3ce8ff;
  --focus: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 85% 0%, #24295b 0, transparent 30rem), var(--bg); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible, iframe:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 60px; display: flex; align-items: center; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: rgb(9 11 32 / .9); border-bottom: 1px solid rgb(255 255 255 / .08); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 950; letter-spacing: -.04em; }
.brand img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 5px 10px rgb(0 0 0 / .24)); }

.home-view { width: min(1180px, 100%); margin: 0 auto; padding: 16px 16px 0; }
.eyebrow { margin: 0 0 7px; color: var(--lime); font: 850 .73rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
.featured { position: relative; display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(310px, .78fr); min-height: 560px; overflow: hidden; border: 1px solid #3b4272; border-radius: 28px; background: #151938; box-shadow: 0 30px 90px rgb(0 0 0 / .3); isolation: isolate; }
.feature-art { position: relative; min-height: 470px; overflow: hidden; background: #101536; }
.feature-art::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, transparent 68%, #151938), linear-gradient(0deg, rgb(9 11 32 / .22), transparent 50%); }
.feature-art > img { width: 100%; height: 100%; object-fit: cover; object-position: center; animation: hero-breathe 8s ease-in-out infinite alternate; }
.art-glow { position: absolute; z-index: 3; border-radius: 50%; filter: blur(1px); pointer-events: none; animation: drift 6s ease-in-out infinite alternate; }
.glow-one { width: 9px; height: 9px; left: 12%; top: 17%; background: var(--lime); box-shadow: 0 0 28px 10px rgb(217 255 87 / .45); }
.glow-two { width: 7px; height: 7px; right: 18%; bottom: 18%; background: var(--cyan); box-shadow: 0 0 26px 8px rgb(60 232 255 / .38); animation-delay: -2s; }
.feature-copy { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(30px, 5vw, 62px); }
.feature-copy h1 { margin-bottom: 15px; font-size: clamp(3.6rem, 6vw, 5.8rem); line-height: .86; letter-spacing: -.075em; }
.feature-copy > p:not(.eyebrow) { max-width: 360px; margin-bottom: 24px; color: #d1d3e5; font-size: 1.06rem; line-height: 1.55; }
.feature-copy > small { margin-top: 12px; color: var(--muted); font-size: .78rem; }
.button, .icon-button, .player-back, .text-button { min-height: 44px; border: 0; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 15px; border-radius: 12px; font-weight: 850; }
.button-play { min-width: 180px; min-height: 54px; justify-content: space-between; color: var(--lime-ink); background: var(--lime); box-shadow: 0 12px 30px rgb(217 255 87 / .15); transition: transform .18s ease, box-shadow .18s ease; }
.button-play:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgb(217 255 87 / .22); }
.button-play:active { transform: translateY(1px) scale(.99); }
.button-play b { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink); background: var(--bg); border-radius: 50%; font-size: .75rem; }
.button-primary { color: var(--lime-ink); background: var(--lime); }
.button-secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }

.catalogue { padding: 52px 0 70px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.045em; }
.section-heading > span { padding-bottom: 6px; color: var(--muted); font-size: .85rem; }
.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.game-card { overflow: hidden; display: block; padding: 0; color: var(--ink); text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.game-card:hover { transform: translateY(-3px); border-color: #6972ad; }
.game-card:active { transform: translateY(0) scale(.99); }
.card-art { min-height: 165px; display: grid; place-items: center; overflow: hidden; background: #242955; }
.card-art b { font-size: 2.7rem; letter-spacing: -.08em; opacity: .88; transform: rotate(-7deg); }
.card-stacker .card-art { background: linear-gradient(145deg, #ff855d, #9f2f6e); }
.card-launch .card-art { background: linear-gradient(145deg, #41e6ff, #3051c7); }
.card-block .card-art { background: linear-gradient(145deg, #facd45, #e85f42); }
.card-bounce .card-art { background: linear-gradient(145deg, #a3f36b, #279f92); }
.card-copy { display: block; padding: 15px; }
.card-copy strong, .card-copy small, .card-copy i { display: block; }
.card-copy strong { line-height: 1.2; }
.card-copy small { min-height: 34px; margin-top: 5px; color: var(--muted); line-height: 1.35; }
.card-copy i { margin-top: 12px; color: var(--lime); font: 800 .69rem/1.2 ui-monospace, monospace; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }

.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 0 -16px; padding: 24px max(16px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); }
.footer-brand { justify-self: start; }
.footer-brand img { width: 30px; height: 30px; }
.site-footer p { margin: 0; text-align: center; }
.site-footer > span { justify-self: end; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }

.player-view { min-height: 100vh; background: #050612; }
.player-header { position: relative; z-index: 8; min-height: 62px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: max(7px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 7px max(10px, env(safe-area-inset-left)); background: #11132f; border-bottom: 1px solid #292e55; }
.player-back { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--ink); background: transparent; }
.player-back span:first-child { font-size: 1.35rem; }
.player-title { display: flex; align-items: center; gap: 8px; }
.player-title img { width: 36px; height: 36px; border-radius: 9px; }
.player-title strong { font-size: .86rem; }
.icon-button { justify-self: end; width: 44px; display: grid; place-items: center; color: var(--ink); background: #23274d; border: 1px solid #3e4572; border-radius: 12px; font-size: 1.35rem; }
.player-stage { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 10px max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: radial-gradient(circle at 50% 30%, #1c2150, #050612 60%); }
.game-frame-wrap { height: calc(100vh - 82px); max-height: 900px; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden; background: #111; border-radius: 16px; box-shadow: 0 24px 80px #000; animation: player-in .2s ease-out; }
.game-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #111; }
.player-state { width: min(420px, calc(100% - 24px)); padding: 34px 26px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; text-align: center; animation: player-in .2s ease-out; }
.player-state h2 { margin-bottom: 8px; font-size: 2rem; letter-spacing: -.045em; }
.player-state > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.loader-mark { position: relative; width: 76px; height: 76px; margin: 0 auto 22px; }
.loader-mark img { width: 100%; height: 100%; object-fit: contain; }
.loader-mark span { position: absolute; inset: -8px; border: 2px solid transparent; border-top-color: var(--lime); border-radius: 50%; animation: spin 1s linear infinite; }
.text-button { padding: 8px; color: var(--muted); background: transparent; text-decoration: underline; }
.state-symbol { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 18px; color: var(--lime); background: #292f5b; border-radius: 18px; font-size: 2rem; font-weight: 900; }
.state-actions { display: grid; gap: 9px; margin-top: 22px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 28px); padding: 12px 16px; transform: translateX(-50%); color: var(--ink); background: #262b50; border: 1px solid #4c5586; border-radius: 12px; box-shadow: 0 16px 44px rgb(0 0 0 / .4); font-weight: 700; animation: toast-in .18s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hero-breathe { to { transform: scale(1.035); } }
@keyframes drift { to { transform: translate3d(10px, -8px, 0); opacity: .7; } }
@keyframes player-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 767px) {
  .home-view { padding-top: 12px; }
  .featured { grid-template-columns: 1fr; min-height: 0; border-radius: 22px; }
  .feature-art { min-height: 232px; }
  .feature-art::after { background: linear-gradient(0deg, #151938 0%, transparent 55%); }
  .feature-art > img { object-position: 32% center; }
  .feature-copy { padding: 18px 20px 20px; }
  .feature-copy h1 { margin-bottom: 10px; font-size: 3.15rem; }
  .feature-copy > p:not(.eyebrow) { margin-bottom: 15px; font-size: .96rem; line-height: 1.45; }
  .button-play { width: 100%; min-height: 50px; }
  .feature-copy > small { align-self: center; margin-top: 9px; }
  .catalogue { padding-top: 40px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-art { min-height: 112px; }
  .card-copy { padding: 12px; }
  .card-copy strong { font-size: .9rem; }
  .card-copy small { font-size: .75rem; }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p { display: none; }
  .player-header { grid-template-columns: auto 1fr auto; }
  .player-back span:last-child { display: none; }
  .player-title { justify-self: center; }
  .game-frame-wrap { height: calc(100dvh - 78px); }
}

@media (max-width: 380px) {
  .feature-art { min-height: 208px; }
  .feature-copy { padding: 15px 18px 17px; }
  .feature-copy .eyebrow { font-size: .65rem; }
  .feature-copy h1 { font-size: 2.75rem; }
  .feature-copy > p:not(.eyebrow) { margin-bottom: 11px; font-size: .88rem; }
  .feature-copy > small { font-size: .7rem; }
  .section-heading > span { display: none; }
  .card-art { min-height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
