@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lilita-one-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/fredoka-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/fredoka-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/fredoka-latin-700.woff2") format("woff2");
}

:root {
  --bg: #07071c;
  --ink: #eef3ff;
  --muted: #c9d4f2;
  --cyan: #3df0ff;
  --green: #39ff8f;
  --orange: #ff8a3d;
  --yellow: #ffe14a;
  --pink: #ff4fd8;
  --navy: #121433;
  --line: rgba(61, 240, 255, 0.28);
  --font-display: "Lilita One", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: Fredoka, "Trebuchet MS", "Segoe UI", sans-serif;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --header: 5.25rem;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

h1, h2, h3, .logo-text {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 0.95;
}

p { margin: 0; }

a { color: var(--cyan); }

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

::selection { background: var(--yellow); color: #1a1230; }

[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--yellow);
  color: #1a1230;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("/assets/decor/stars.svg");
  background-size: 280px 280px;
  animation: drift 90s linear infinite;
}

.sky::after {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: url("/assets/decor/stars.svg");
  background-size: 170px 170px;
  opacity: 0.55;
  animation: drift 55s linear infinite reverse;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(109, 40, 217, 0.48), transparent 60%),
    radial-gradient(680px 420px at 100% 0%, rgba(61, 240, 255, 0.14), transparent 55%),
    radial-gradient(620px 480px at 80% 110%, rgba(255, 138, 61, 0.16), transparent 50%);
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 7, 28, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  text-decoration: none;
}

.logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan);
}

.logo-text { font-size: 1.35rem; }
.logo-text span { display: block; color: var(--yellow); font-size: 0.95rem; }

.site-nav { display: flex; align-items: center; gap: 0.2rem; }

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(61, 240, 255, 0.12);
  color: var(--cyan);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: transparent;
  color: white;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.hero { padding: 2.4rem 0 1rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.pixel-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 8px 0 0 var(--yellow), 0 8px 0 var(--orange);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.1rem, 7vw, 5.7rem);
  text-shadow: 4px 4px 0 #1a1038;
}

.hero h1 span { display: block; }
.line-b { color: var(--yellow); text-shadow: 4px 4px 0 #5a2a00; }

.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  margin: 0.9rem 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.tagline span:nth-child(1) { color: var(--cyan); }
.tagline span:nth-child(2) { color: var(--green); }
.tagline span:nth-child(3) { color: var(--orange); }
.tagline span:nth-child(4) { color: var(--yellow); }

.tagline span + span::before {
  content: "•";
  margin: 0 0.45rem;
  color: white;
}

.welcome {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions { margin-top: 1.3rem; }

.hero-note {
  margin-top: 0.9rem;
  color: var(--yellow);
  font-weight: 700;
}

.hero-note a { color: inherit; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
}

.stats li {
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: rgba(8, 10, 30, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: white;
}

.hero-stage {
  position: relative;
  aspect-ratio: 800 / 484;
  border-radius: 32px;
  overflow: hidden;
  border: 3px solid rgba(61, 240, 255, 0.4);
  box-shadow: 0 0 0 6px rgba(20, 10, 50, 0.35), var(--shadow);
  background: #101428;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}

.section { padding: 2.8rem 0; }

.section-head h2,
.about-panel h2,
.missing h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.section-head p,
.lede { color: var(--muted); max-width: 40rem; }

.messages {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 2px solid #ffb020;
  background: rgba(80, 40, 0, 0.38);
  color: #ffe7b8;
}

.messages ul { margin: 0.45rem 0 0; padding-left: 1.2rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: end;
  margin: 1.2rem 0 0.6rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 650; }
.field span, .chip-label { font-size: 0.92rem; color: var(--muted); }
.field-search { flex: 1 1 220px; }
.field input, .field select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(6, 8, 24, 0.72);
  color: white;
  padding: 0 0.8rem;
  font: inherit;
}

.chip-row { display: flex; flex-direction: column; gap: 0.35rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  min-height: 40px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--ink);
  padding: 0.3rem 0.85rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #06202a;
}

.results-count { min-height: 1.5rem; margin: 0.4rem 0 0.9rem; color: var(--muted); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.15rem;
}

.game-card {
  --card-glow: var(--cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(22, 24, 58, 0.95), rgba(10, 12, 32, 0.95));
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-glow);
  box-shadow: var(--shadow), 0 0 0 4px var(--card-glow);
}

.game-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #121433;
}

.game-card__media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}

.game-card__media.is-missing::before {
  content: "No art";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--yellow);
  letter-spacing: 0.04em;
}

.status-badge,
.ribbon {
  position: absolute;
  top: 12px;
  z-index: 1;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  border: 2px solid #141226;
}

.status-badge { right: 12px; }
.ribbon { left: 12px; background: var(--orange); color: #2a1000; }
.status-playable { background: var(--green); color: #062214; }
.status-coming-soon { background: #2a2208; color: var(--yellow); border-color: var(--yellow); }

.status-badge--inline {
  position: static;
  display: inline-flex;
  margin-top: 0.8rem;
}

.game-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  padding: 0.95rem 1rem 1rem;
}

.game-card__category {
  margin: 0;
  color: var(--card-glow);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-card h3 { margin: 0; font-size: 1.45rem; }
.game-card__desc { color: var(--muted); }
.game-card__meta { color: var(--yellow); font-weight: 700; font-size: 0.92rem; }
.game-card__action { margin-top: auto; padding-top: 0.55rem; }
.game-card__action .btn { width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 3px solid #141226;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary,
.btn-play {
  background: var(--yellow);
  color: #1a1230;
  box-shadow: 0 5px 0 #c98a12;
}

.btn-play { background: var(--green); color: #062214; box-shadow: 0 5px 0 #149454; }

.btn-primary:hover,
.btn-play:hover { transform: translateY(-2px); }

.btn-primary:active,
.btn-play:active { transform: translateY(2px); box-shadow: 0 2px 0 #149454; }

.btn-primary:active { box-shadow: 0 2px 0 #c98a12; }

.btn-soon,
.btn:disabled {
  background: transparent;
  color: var(--yellow);
  border-color: var(--yellow);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
}

.btn:disabled:hover { transform: none; }

.empty-state { text-align: center; padding: 1.5rem 0 0.5rem; }
.empty-state img {
  width: 96px;
  height: 96px;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--cyan);
}
.empty-state p { color: var(--muted); margin-bottom: 0.8rem; }

.catalog-loading { color: var(--muted); margin: 1rem 0; }

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.5rem;
  align-items: center;
}

.about-art {
  border-radius: 32px;
  overflow: hidden;
  border: 3px solid rgba(255, 225, 74, 0.35);
  background:
    radial-gradient(circle at 50% 20%, rgba(61, 240, 255, 0.18), transparent 46%),
    linear-gradient(180deg, #24145a, #101428);
}

.about-art img { display: block; width: 100%; }

.about-panel {
  padding: 1.4rem;
  border-radius: 28px;
  border: 3px solid rgba(255, 225, 74, 0.35);
  background-color: rgba(14, 16, 40, 0.8);
  background-image: radial-gradient(rgba(255, 225, 74, 0.16) 1.1px, transparent 1.4px);
  background-size: 10px 10px;
}

.about-panel p { margin: 0.7rem 0; color: var(--muted); }

.facts { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.7rem; }

.facts li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(8, 10, 30, 0.62);
  color: white;
  font-weight: 650;
}

.fact-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #1a1230;
  border: 2px solid var(--cyan);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 20, 0.9);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.3rem 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: white;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

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

.player-main { padding: 1.6rem 0 3rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.8rem;
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover { color: var(--yellow); }

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.player-heading h1 { margin: 0.2rem 0 0.45rem; font-size: clamp(2rem, 4vw, 3.2rem); }
.player-heading .welcome, #player-description { color: var(--muted); margin-top: 0.35rem; }

.cabinet {
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 24px;
  border: 3px solid rgba(61, 240, 255, 0.45);
  background: #07091a;
  box-shadow: 0 0 0 6px rgba(18, 8, 48, 0.45), 0 0 32px rgba(61, 240, 255, 0.12);
}

.cabinet__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05060f;
}

.cabinet__screen iframe,
.game-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05060f;
}

.game-poster { object-fit: cover; opacity: 0.4; z-index: 0; }
.cabinet__screen iframe { z-index: 1; display: block; max-width: none; }

.cabinet__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
}

.game-message {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 2rem));
  margin: 0;
  padding: 1.1rem 1rem;
  text-align: center;
  border-radius: 18px;
  border: 3px solid var(--yellow);
  background: rgba(10, 12, 32, 0.94);
}

.game-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(5, 6, 15, 0.86);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

.cabinet__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem;
  background: #0c1024;
  border-top: 2px solid rgba(61, 240, 255, 0.2);
}

.cabinet:fullscreen,
.cabinet:-webkit-full-screen {
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.cabinet:fullscreen .cabinet__screen,
.cabinet:-webkit-full-screen .cabinet__screen {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}

.hint {
  margin: 0.8rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 225, 74, 0.1);
  border: 2px solid rgba(255, 225, 74, 0.45);
  color: #ffe7a3;
}

.orientation-hint { display: none; }

.action-status { min-height: 1.4rem; margin: 0.55rem 0 0; color: var(--muted); }
.action-status:empty { display: none; }

.info-panel {
  position: sticky;
  top: calc(var(--header) + 0.8rem);
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 24px;
  border: 3px solid rgba(255, 225, 74, 0.28);
  background: rgba(10, 12, 32, 0.78);
}

.info-panel h2 { margin: 0.9rem 0 0.3rem; font-size: 1.35rem; }
.info-panel h2:first-child { margin-top: 0; }
.info-panel p { color: var(--muted); }

.recommended { margin-top: 2rem; }
.recommended h2 { margin: 0 0 0.9rem; font-size: clamp(1.8rem, 3vw, 2.4rem); }

.missing {
  text-align: center;
  padding: 3rem 0 4rem;
}

.missing img { width: min(220px, 60vw); margin-bottom: 0.5rem; }
.missing p { color: var(--muted); margin: 0.6rem auto 1.2rem; max-width: 32rem; }

@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 280px 560px; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .player-layout { grid-template-columns: 1fr; }

  .hero-stage { order: -1; }
  .info-panel { position: static; }
  .about-art { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 700px) {
  .toolbar { align-items: stretch; }
  .chip-row,
  .field { flex: 1 1 100%; }
  .stats { gap: 0.45rem; }
  .stats li { padding: 0.55rem 0.45rem; }
  .stats strong { font-size: 1.25rem; }
  .stats span { font-size: 0.82rem; }
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
    background: rgba(10, 10, 32, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.8rem 0.9rem; }
  .logo-text { font-size: 1.15rem; }
}

@media (max-width: 800px) and (orientation: portrait) {
  .is-playing .orientation-hint { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
