:root {
  --bg-900: #070b14;
  --bg-800: #0b1120;
  --bg-700: #121a2d;

  --surface-1: rgba(18, 27, 46, 0.30);
  --surface-2: rgba(25, 37, 62, 0.38);

  --text-primary: #edf3ff;
  --text-secondary: #a8b4cf;

  --accent: #5be0bf;
  --accent-strong: #3cc9a8;
  --accent-alt: #7ab6ff;

  --border-soft: rgba(163, 183, 218, 0.24);
  --border-strong: rgba(91, 224, 191, 0.58);

  --shadow-elevated: 0 20px 45px rgba(2, 7, 16, 0.56);
  --focus-ring: #9addff;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --container: 1120px;
  --section-width: 35rem;

  --ship-hero: #8ea6ff;
  --ship-hero-detail: #5be0bf;
  --ship-enemy: #ff9b71;
  --ship-enemy-detail: #ffd08a;
  --blast: #ffc086;

  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(120% 120% at 84% -12%, rgba(122, 182, 255, 0.2), transparent 56%),
    radial-gradient(110% 110% at 8% 0%, rgba(91, 224, 191, 0.12), transparent 54%),
    linear-gradient(155deg, var(--bg-900) 0%, var(--bg-800) 54%, #070c17 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black, transparent 84%);
  animation: gridDrift 22s linear infinite;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.72;
  transform: translateZ(0);
  will-change: transform;
}

.page {
  position: relative;
  z-index: 1;
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  width: min(var(--section-width), 100%);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand__icon {
  width: 2.35rem;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-soft);
  background: linear-gradient(150deg, rgba(122, 182, 255, 0.26), rgba(91, 224, 191, 0.18));
  animation: floatBadge 4.8s ease-in-out infinite;
}

.brand__name {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.35rem;
}

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.tab:hover {
  color: var(--text-primary);
  border-color: var(--border-soft);
  background-color: rgba(122, 182, 255, 0.08);
}

.tab--active {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(91, 224, 191, 0.12);
}

/* Tab Content */
.tab-content {
  display: none;
  margin-top: clamp(2.2rem, 5.5vw, 4rem);
  width: min(var(--section-width), 100%);
  margin-inline: auto;
}

.tab-content--active {
  display: block;
}

main {
  display: block;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, var(--surface-2), var(--surface-1));
  backdrop-filter: blur(2px) saturate(120%);
  box-shadow: var(--shadow-elevated);
  padding: clamp(1.8rem, 5vw, 4rem);
  display: grid;
  justify-items: start;
  width: min(var(--section-width), 100%);
  margin-inline: auto;
}

.hero > * {
  position: relative;
  z-index: 1;
  max-width: min(20rem, 100%);
}

.hero::before {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -58%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(91, 224, 191, 0.26), transparent 70%);
  animation: heroPulse 7s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(122, 182, 255, 0.2), transparent 68%);
  transform: translateX(-72%);
  animation: heroSweep 7.6s ease-in-out infinite;
}

.hero__eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background: linear-gradient(102deg, #eff6ff 0%, #8ad8ff 35%, #7af3cf 52%, #eff6ff 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: titleFlow 11s ease-in-out infinite;
  }
}

.hero__lead {
  max-width: 42ch;
  margin: 0.9rem 0 1.2rem;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(122, 182, 255, 0.38);
  background: rgba(122, 182, 255, 0.1);
  color: #dde7ff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.32rem 0.62rem;
  animation: chipFloat 6.2s ease-in-out infinite;
}

.chip:nth-child(2) {
  animation-delay: 1.05s;
}

.chip:nth-child(3) {
  animation-delay: 2.1s;
}

/* Buttons */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.85rem;
  padding: 0.72rem 1.18rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease,
    color 200ms ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: linear-gradient(112deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  transform: translateX(-130%);
  opacity: 0;
}

.btn--primary {
  color: #07121f;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  box-shadow: 0 12px 24px rgba(91, 224, 191, 0.22);
  animation: ctaPulse 3.6s ease-in-out infinite;
}

.btn--ghost {
  color: var(--text-primary);
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
}

/* Section head */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.section-head h2 {
  position: relative;
  margin: 0;
  padding-bottom: 0.35rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  animation: lineSweep 5.6s ease-in-out infinite;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
}

/* Cards */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.game-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 250px;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, rgba(18, 27, 46, 0.30), rgba(14, 20, 35, 0.34));
  backdrop-filter: blur(2px) saturate(118%);
  box-shadow: var(--shadow-elevated);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
  animation: cardBreath 8.5s ease-in-out infinite;
}

.game-card:nth-child(2) {
  animation-delay: 1.45s;
}

.game-card::before {
  content: "";
  position: absolute;
  top: -52%;
  left: -22%;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 182, 255, 0.25), transparent 68%);
  opacity: 0.26;
  pointer-events: none;
  animation: cardGlow 9.8s ease-in-out infinite;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 220ms ease;
}

.game-card--dimmed {
  background: linear-gradient(160deg, rgba(18, 27, 46, 0.24), rgba(14, 20, 35, 0.28));
}

.game-card--dimmed::before {
  opacity: 0.2;
}

.game-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.game-card h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.game-card__text {
  margin: 0;
  color: var(--text-secondary);
}

.badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #dce6ff;
  border: 1px solid rgba(122, 182, 255, 0.4);
  background: rgba(122, 182, 255, 0.12);
  border-radius: 999px;
  padding: 0.32rem 0.58rem;
  white-space: nowrap;
}

.status {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-radius: 999px;
  padding: 0.3rem 0.56rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status--live {
  color: #b5f6e6;
  background: rgba(60, 201, 168, 0.17);
  border-color: rgba(60, 201, 168, 0.46);
  animation: statusPulse 2.8s ease-in-out infinite;
}

.status--update {
  color: #ffe3c2;
  background: rgba(255, 155, 113, 0.16);
  border-color: rgba(255, 155, 113, 0.45);
  animation: statusPulse 3.3s ease-in-out infinite;
}

.game-card__actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inline-note {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
}

.inline-note::before {
  content: "";
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(91, 224, 191, 0.6);
  animation: liveDot 1.9s ease-in-out infinite;
}

/* Footer */
.site-footer {
  margin-top: clamp(2rem, 5vw, 3.4rem);
  padding: 1rem 0 0.45rem;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid rgba(163, 183, 218, 0.16);
  width: min(var(--section-width), 100%);
  margin-inline: auto;
}

.site-footer p {
  margin: 0;
  font-size: 0.95rem;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 560ms var(--ease-spring), transform 560ms var(--ease-spring);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero.reveal.is-visible {
  animation: heroRollIn 760ms var(--ease-spring) both;
}

.game-card.reveal.is-visible {
  animation: cardRollIn 620ms var(--ease-spring) both;
}

.game-card.reveal.is-visible:nth-child(2) {
  animation-delay: 70ms;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Hover */
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px) scale(1.01);
  }

  .btn:hover::after {
    opacity: 1;
    animation: btnShine 820ms var(--ease-spring) forwards;
  }

  .btn--primary:hover {
    box-shadow: 0 18px 34px rgba(91, 224, 191, 0.34);
  }

  .btn--ghost:hover {
    border-color: var(--border-strong);
    background: rgba(91, 224, 191, 0.08);
  }

  .game-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: 0 24px 46px rgba(2, 7, 16, 0.62);
  }

  .game-card:hover::after {
    border-color: rgba(91, 224, 191, 0.42);
  }
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

/* Animations */
@keyframes gridDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(44px, 22px, 0); }
}

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

@keyframes heroPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes heroSweep {
  0%, 56% { transform: translateX(-76%); opacity: 0; }
  68% { opacity: 0.58; }
  100% { transform: translateX(90%); opacity: 0; }
}

@keyframes titleFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

@keyframes lineSweep {
  0%, 100% { width: 44%; opacity: 0.72; }
  50% { width: 84%; opacity: 1; }
}

@keyframes cardGlow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.22; }
  50% { transform: translate3d(16%, 10%, 0) scale(1.15); opacity: 0.34; }
}

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

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 224, 191, 0); }
  50% { box-shadow: 0 0 0 0.22rem rgba(91, 224, 191, 0.08); }
}

@keyframes liveDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 224, 191, 0.55); }
  60% { box-shadow: 0 0 0 0.26rem rgba(91, 224, 191, 0); }
}

@keyframes btnShine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 12px 24px rgba(91, 224, 191, 0.2); }
  50% { box-shadow: 0 16px 30px rgba(91, 224, 191, 0.34); }
}

@keyframes heroRollIn {
  0% {
    opacity: 0;
    transform: translateX(-28px) translateY(12px) scale(0.985);
    filter: saturate(88%);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes cardRollIn {
  0% {
    opacity: 0;
    transform: translateX(-22px) translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Mobile */
@media (max-width: 700px) {
  .page {
    width: min(var(--container), calc(100% - 0.8rem));
  }

  .bg-canvas {
    opacity: 0.8;
  }

  .hero {
    border-radius: 20px;
    padding: 1.2rem;
    backdrop-filter: blur(1px) saturate(108%);
  }

  .hero > * {
    max-width: 100%;
  }

  .site-header,
  .hero,
  .tab-content,
  .site-footer {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.72rem, 8.8vw, 2.4rem);
    line-height: 1.06;
  }

  .hero__lead {
    margin-top: 0.7rem;
    margin-bottom: 1rem;
  }

  .hero__chips {
    gap: 0.45rem;
    margin-bottom: 0;
  }

  .btn {
    min-height: 2.7rem;
  }

  .hero .btn {
    width: min(13.5rem, 100%);
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 220px;
    padding: 1rem;
    backdrop-filter: blur(1px) saturate(108%);
    box-shadow: 0 14px 26px rgba(2, 7, 16, 0.5);
  }

  .game-card__head {
    align-items: flex-start;
  }

  .site-footer {
    margin-top: 1.6rem;
  }

  .tab {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .game-card:hover,
  .btn:hover,
  .btn:active {
    transform: none;
  }

  .bg-canvas {
    opacity: 0.24;
  }
}
