:root {
  --horizon: 64%;
  --pink: #ff71ce;
  --cyan: #01cdfe;
  --mint: #05ffa1;
  --purple: #b967ff;
  --yellow: #fffb96;
  --ink: #0d0221;
  --panel: rgba(22, 6, 46, 0.88);
  --text: #f5eaff;
  --text-dim: #c3a8e6;
  --bevel-hi: #ffb8ea;
  --bevel-lo: #3d0d6b;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Fira Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

/* ---------- Background scene: sky, striped sun, scrolling grid ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #0d0221 0%,
    #261447 28%,
    #5a1f72 46%,
    #c23d8c 58%,
    #ff7e9d var(--horizon)
  );
}

.scene::before {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--horizon);
  width: 110vmin;
  aspect-ratio: 1;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(255, 113, 206, 0.5) 0%, rgba(255, 113, 206, 0) 60%);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

.sun {
  position: absolute;
  left: 50%;
  top: var(--horizon);
  width: min(58vmin, 540px);
  aspect-ratio: 1;
  transform: translate(-50%, -72%);
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--yellow) 0%, #ffb36b 38%, var(--pink) 72%, var(--purple) 100%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0 50%, transparent 50% 52%,
    #000 52% 59%, transparent 59% 62%,
    #000 62% 68%, transparent 68% 72%,
    #000 72% 77%, transparent 77% 82%,
    #000 82% 86%, transparent 86% 92%,
    #000 92%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0 50%, transparent 50% 52%,
    #000 52% 59%, transparent 59% 62%,
    #000 62% 68%, transparent 68% 72%,
    #000 72% 77%, transparent 77% 82%,
    #000 82% 86%, transparent 86% 92%,
    #000 92%
  );
}

.floor {
  position: absolute;
  top: var(--horizon);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  perspective: 300px;
  perspective-origin: 50% 0;
  background: linear-gradient(to bottom, #2a0845 0%, var(--ink) 100%);
  border-top: 2px solid var(--pink);
  box-shadow: 0 0 24px 4px rgba(255, 113, 206, 0.7);
}

.floor::before {
  content: "";
  position: absolute;
  left: -200%;
  right: -200%;
  bottom: 0;
  height: 4000px;
  transform-origin: 50% 100%;
  transform: rotateX(80deg) translateY(0);
  background-image:
    linear-gradient(to top, var(--pink) 2px, transparent 2px),
    linear-gradient(to right, var(--cyan) 2px, transparent 2px);
  background-size: 64px 64px;
  background-position: center bottom;
  opacity: 0.8;
  animation: grid-scroll 1.2s linear infinite;
  will-change: transform;
}

.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 126, 157, 0.9) 0%,
    rgba(120, 30, 110, 0.6) 12%,
    rgba(42, 8, 69, 0) 40%
  );
}

@keyframes grid-scroll {
  to {
    transform: rotateX(80deg) translateY(64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .floor::before {
    animation: none;
  }
}

/* ---------- Typography ---------- */

.chrome {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #bdf3ff 38%,
    #3a1c71 50%,
    var(--pink) 58%,
    #ffe1f6 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(3px 3px 0 var(--ink)) drop-shadow(0 0 14px rgba(1, 205, 254, 0.55));
}

.neon {
  display: block;
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--pink);
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--purple);
}

/* ---------- Layout ---------- */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.hero {
  padding: clamp(40px, 14vh, 140px) 20px clamp(36px, 10vh, 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero .chrome {
  font-size: clamp(2.6rem, 10vw, 7rem);
}

.hero .neon {
  font-size: 0.38em;
  margin-bottom: 0.1em;
}

.site-header {
  padding: 14px 20px;
}

.site-header .chrome {
  font-size: 1.35rem;
}

.site-header a:hover .chrome {
  filter: drop-shadow(3px 3px 0 var(--ink)) drop-shadow(0 0 14px rgba(255, 113, 206, 0.9));
}

.center-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  text-align: center;
}

.center-page .chrome {
  font-size: clamp(5rem, 22vw, 12rem);
}

.center-page p {
  margin: 0;
  font-size: 1.1rem;
  text-shadow: 0 1px 3px var(--ink);
}

/* ---------- Windows ---------- */

.window {
  background: var(--panel);
  border: 2px solid;
  border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  box-shadow: 6px 6px 0 rgba(13, 2, 33, 0.7), 0 0 28px rgba(185, 103, 255, 0.35);
  display: flex;
  flex-direction: column;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 6px 3px 10px;
  background: linear-gradient(90deg, var(--pink), var(--purple) 55%, var(--cyan));
}

.titlebar h1,
.titlebar h2 {
  flex: 1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 1px 1px 0 var(--bevel-lo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar a {
  color: inherit;
}

.titlebar::after {
  content: "";
  flex: none;
  width: 52px;
  height: 16px;
  background:
    linear-gradient(#e9d8ff, #e9d8ff) 0 0 / 16px 16px no-repeat,
    linear-gradient(#e9d8ff, #e9d8ff) 18px 0 / 16px 16px no-repeat,
    linear-gradient(#e9d8ff, #e9d8ff) 36px 0 / 16px 16px no-repeat;
  opacity: 0.85;
}

.window-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ---------- Game cards ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 440px));
  justify-content: center;
  gap: 28px;
}

.game-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(13, 2, 33, 0.7), 0 0 36px rgba(1, 205, 254, 0.55);
}

.game-thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #04070c;
  border-bottom: 2px solid var(--bevel-lo);
}

.game-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.94rem;
  flex: 1;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  background: rgba(5, 255, 161, 0.08);
  border: 1px solid rgba(5, 255, 161, 0.45);
  color: var(--mint);
}

.badge.alt {
  background: rgba(1, 205, 254, 0.08);
  border-color: rgba(1, 205, 254, 0.45);
  color: var(--cyan);
}

.card-actions {
  display: flex;
  gap: 10px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text);
  background: #2b1055;
  border: 2px solid;
  border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  transition: color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(1, 205, 254, 0.6);
}

.btn:active {
  border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo);
}

.btn:focus-visible {
  outline: 2px dashed var(--yellow);
  outline-offset: 2px;
}

.btn-primary {
  color: var(--ink);
  background: linear-gradient(to bottom, #ffb8ea, var(--pink));
}

.btn-primary:hover {
  color: var(--ink);
  box-shadow: 0 0 16px rgba(255, 113, 206, 0.85);
}

.titlebar .btn {
  padding: 2px 10px;
  font-size: 0.75rem;
}

/* ---------- Game page ---------- */

.game-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  background: #000;
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.info-grid p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.controls-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.controls-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed rgba(185, 103, 255, 0.35);
  padding-bottom: 4px;
}

.controls-list li:last-child {
  border-bottom: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0 6px;
  background: #1a0636;
  border: 1px solid;
  border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  color: var(--yellow);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .titlebar:has(.btn)::after {
    display: none;
  }
}
