:root {
  --color-primary: #ff2d95;
  --color-secondary: #00e6ff;
  --color-accent: #ff9f1c;
  --color-bg-dark: #100a2a;
  --color-bg-deep: #0f0743;
  --color-surface: rgba(16, 10, 42, 0.85);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #f5f7ff;
  --color-text-muted: #9fa3ff;
  --shadow-neon: 0 0 20px rgba(255, 45, 149, 0.35);
  --radius-large: 18px;
  --radius-medium: 12px;
  --radius-small: 8px;
  --header-height: 72px;
  color-scheme: dark;
  font-size: 16px;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  font-family: 'Orbitron', system-ui, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 32px 0 64px;
}

.gradient-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 45, 149, 0.35), transparent 55%),
    radial-gradient(circle at 80% 15%, rgba(0, 230, 255, 0.28), transparent 55%),
    linear-gradient(135deg, var(--color-bg-deep), var(--color-bg-dark));
}

.site-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  width: min(1200px, 92vw);
  padding: 20px clamp(16px, 4vw, 32px);
  margin: 0 auto;
  background: rgba(7, 3, 28, 0.75);
  backdrop-filter: blur(12px);
  z-index: 10;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.site-header.compact {
  padding-block: 12px;
}

.logo-wordmark {
  font-family: 'VT323', monospace;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.site-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.site-header .site-nav {
  margin-left: 12px;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border-radius: var(--radius-small);
  transition: background 160ms ease, color 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-text);
  background: rgba(0, 230, 255, 0.2);
}

.nav-link.is-active {
  color: var(--color-accent);
}

.btn {
  border: none;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border-radius: var(--radius-small);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #120422;
  box-shadow: var(--shadow-neon);
}

.btn-secondary {
  background: rgba(0, 230, 255, 0.14);
  color: var(--color-secondary);
  border: 1px solid rgba(0, 230, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 45, 149, 0.26);
}

.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  justify-items: center;
  margin-top: 48px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-copy .eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.hero-copy {
  text-align: center;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 16px 0;
}

.hero-copy .lede {
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 42ch;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  justify-content: center;
}

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1.1;
  border-radius: var(--radius-large);
  overflow: hidden;
  background: radial-gradient(circle at 50% 10%, rgba(255, 45, 149, 0.5), transparent 60%),
              linear-gradient(155deg, rgba(0, 230, 255, 0.18), rgba(16, 10, 42, 0.92));
  box-shadow: var(--shadow-neon);
}

.hero-stars {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 96%, rgba(0, 230, 255, 0.35) 97%),
    linear-gradient(90deg, transparent 96%, rgba(255, 45, 149, 0.25) 97%);
  background-size: 32px 32px;
  opacity: 0.6;
}

.hero-orbit {
  position: absolute;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -28%);
  background: radial-gradient(circle at 50% 50%, rgba(255, 117, 171, 0.8), rgba(255, 159, 28, 0.15));
  box-shadow: 0 0 60px rgba(255, 45, 149, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.06);
}

.hero-orbit::after {
  content: '';
  position: absolute;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 56%;
  top: 58%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 50%, rgba(255, 210, 127, 0.75), transparent 70%);
}

.featured-projects {
  margin-top: 72px;
  display: grid;
  gap: 28px;
}

.featured-header {
  text-align: center;
  display: grid;
  gap: 8px;
}

.featured-header p {
  margin: 0;
  color: var(--color-text-muted);
}

.featured-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.featured-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(8, 4, 24, 0.92);
  border: 1px solid rgba(0, 230, 255, 0.2);
  border-radius: var(--radius-medium);
  overflow: hidden;
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.featured-card:hover,
.featured-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 28px 44px rgba(0, 0, 0, 0.45);
}

.featured-card:focus-within {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
}

.featured-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.6);
}

.featured-card-media img,
.featured-card-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card-content {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.featured-card-content h3 {
  margin: 0;
  font-size: 1.2rem;
}

.featured-card-content p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.featured-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.featured-card-tags li {
  background: rgba(0, 230, 255, 0.16);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.featured-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.featured-footer {
  display: flex;
  justify-content: center;
}

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

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  padding: 24px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.cta-ribbon {
  margin-top: 80px;
  padding: 40px;
  border-radius: var(--radius-large);
  background: linear-gradient(90deg, rgba(255, 45, 149, 0.2), rgba(0, 230, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.site-footer {
  width: min(1200px, 92vw);
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  color: var(--color-text-muted);
  gap: 16px;
}

.site-footer.compact {
  margin-top: auto;
}

.footer-link {
  color: var(--color-secondary);
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  text-decoration: underline;
}

.fine-print {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.page-games main {
  width: min(1320px, 94vw);
}

.gallery-header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.gallery-controls input[type='search'] {
  width: min(420px, 100%);
  padding: 12px 16px;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 12, 32, 0.92);
  color: var(--color-text);
  font-family: 'Orbitron', sans-serif;
}

.gallery-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(8, 4, 24, 0.92);
  border: 1px solid rgba(0, 230, 255, 0.2);
  border-radius: var(--radius-medium);
  overflow: hidden;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:focus-visible,
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 48px rgba(0, 0, 0, 0.45);
}

.game-card:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
}

.game-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.6);
}

.game-logo,
.game-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

.game-preview {
  opacity: 0;
  pointer-events: none;
}

.game-card.is-previewing .game-preview {
  opacity: 1;
}

.game-card.is-previewing .game-logo {
  opacity: 0;
}

.game-card.has-live-preview .game-preview {
  opacity: 1;
}

.game-card.has-live-preview .game-logo {
  display: none;
}

.play-overlay {
  position: absolute;
  inset: auto 16px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.game-card:hover .play-overlay,
.game-card:focus-visible .play-overlay {
  opacity: 1;
  pointer-events: auto;
}

.game-content {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.game-title {
  margin: 0;
  font-size: 1.1rem;
}

.game-description {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.game-tags li {
  background: rgba(0, 230, 255, 0.16);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
}

.player-dialog {
  border: none;
  background: transparent;
  padding: 0;
  width: min(1280px, 96vw);
  height: min(820px, 92vh);
  margin: auto;
}

.player-dialog::backdrop {
  background: rgba(5, 2, 20, 0.8);
}

.player-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: rgba(8, 4, 24, 0.92);
  border-radius: var(--radius-large);
  overflow: hidden;
  border: 1px solid rgba(0, 230, 255, 0.22);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.4);
}

.player-header h2 {
  margin: 0;
}

.player-actions {
  display: flex;
  gap: 12px;
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.player-status {
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid rgba(0, 230, 255, 0.16);
}

.auth-modal {
  border: none;
  background: transparent;
  padding: 0;
}

.auth-modal::backdrop {
  background: rgba(7, 11, 28, 0.85);
}

.auth-card {
  position: relative;
  width: min(420px, 92vw);
  background: rgba(12, 18, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-large);
  padding: 32px;
  display: grid;
  gap: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.auth-buttons {
  display: grid;
  gap: 12px;
}

.about-content {
  display: grid;
  gap: 56px;
}

.about-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-section {
  background: rgba(12, 18, 46, 0.88);
  padding: 32px;
  border-radius: var(--radius-large);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 16px;
  border-radius: var(--radius-small);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 12, 32, 0.85);
  color: var(--color-text);
  font-family: 'Orbitron', sans-serif;
}

.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.play-shell {
  width: min(1200px, 96vw);
  margin: 40px auto 64px;
}

.player-wrapper {
  background: rgba(8, 4, 24, 0.92);
  border-radius: var(--radius-large);
  border: 1px solid rgba(0, 230, 255, 0.2);
  overflow: hidden;
  box-shadow: 0 32px 48px rgba(0, 0, 0, 0.45);
}

.page-play main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(12px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.page-play .play-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.page-play .player-wrapper {
  flex: 1 1 auto;
  width: min(1200px, 92vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: clamp(380px, calc(100vh - var(--header-height) - 96px), 940px);
}

.page-play .player-wrapper iframe {
  flex: 1;
  min-height: 0;
}

.page-play .player-status {
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(8, 4, 24, 0.92);
  border: 1px solid rgba(0, 230, 255, 0.24);
  color: var(--color-text);
  padding: 14px 20px;
  border-radius: var(--radius-medium);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 200;
}

@media (max-width: 768px) {
  main {
    width: 92vw;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 12px 20px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .game-media {
    aspect-ratio: 4 / 3;
  }

  .player-dialog {
    width: 96vw;
    height: 92vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
.site-header #auth-button {
  margin-left: auto;
}
