:root {
  --bg-top: #020617;
  --bg-bottom: #0f172a;
  --panel: #101727;
  --panel-internal: #19233c;
  --text: #e5e7eb;
  --muted: #94a3b8;

  --accent-external: #38bdf8;
  --accent-external-text: #082f49;
  --secondary-internal: #303f5c;

  --border-soft: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.22);

  --radius: 1.25rem;
  --radius-lg: 1.6rem;

  --shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 1.4rem 3.8rem rgba(0, 0, 0, 0.32);

  --content-width: min(94vw, 110rem);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;

  --font-sm: 0.95rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: clamp(1.8rem, 4vw, 3rem);
  --font-hero: clamp(2.2rem, 6vw, 4rem);

  --nav-height: 4.75rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
  background: var(--bg-top);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--font-base);
  line-height: 1.6;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 35%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-color: var(--bg-top);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 0.14rem solid var(--accent-external);
  outline-offset: 0.16rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(0.9rem);
  background: rgba(2, 6, 23, 0.76);
  border-bottom: 0.08rem solid rgba(148, 163, 184, 0.14);
}

.nav {
  width: var(--content-width);
  min-height: var(--nav-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  flex-wrap: wrap;
}

.brand {
  font-size: var(--font-lg);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  border-radius: 999rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
  transform: translateY(-0.08rem);
}

.page {
  width: var(--content-width);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 var(--space-6);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10rem;
  min-height: 3rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  border: none;
  line-height: 1.2;
  text-align: center;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-0.12rem);
  opacity: 0.98;
}

.button-primary {
  background: var(--accent-external);
  color: var(--accent-external-text);
  box-shadow: 0 0.6rem 1.5rem rgba(56, 189, 248, 0.2);
}

.button-primary:hover,
.button-primary:focus-visible {
  box-shadow: 0 0.9rem 2rem rgba(56, 189, 248, 0.28);
}

.button-secondary {
  background: var(--secondary-internal);
  border: 0.08rem solid rgba(148, 163, 184, 0.22);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(48, 63, 92, 0.92);
  border-color: rgba(148, 163, 184, 0.3);
}

.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.86), rgba(15, 23, 42, 0.92));
  border: 0.08rem solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: var(--space-5);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto auto -20% -10%;
  width: 18rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  color: var(--accent-external);
  font-size: var(--font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-2);
}

h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--font-hero);
  line-height: 1.05;
  text-wrap: balance;
}

.hero-text {
  color: var(--muted);
  max-width: 65ch;
  margin: 0;
  font-size: var(--font-lg);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(18rem, 1.1fr);
  gap: var(--space-5);
  align-items: start;
}

.game-panel,
.info-panel {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.88), rgba(15, 23, 42, 0.92));
  border: 0.08rem solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-panel {
  padding: var(--space-4);
}

.game-frame-shell {
  position: relative;
  width: 100%;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 0.08rem solid rgba(148, 163, 184, 0.12);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #020617;
  touch-action: manipulation;
}

#unity-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  width: min(80%, 24rem);
  z-index: 5;
}

#unity-progress-bar-empty {
  width: 100%;
  height: 1rem;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999rem;
  overflow: hidden;
  border: 0.08rem solid rgba(148, 163, 184, 0.18);
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: var(--accent-external);
  border-radius: 999rem;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  z-index: 6;
  width: min(90%, 36rem);
}

#unity-footer,
#unity-build-title,
#unity-logo,
#unity-logo-title-footer {
  display: none;
}

.info-panel {
  padding: clamp(1.5rem, 3vw, 2rem);
}

.info-panel-top {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--space-4);
}

.info-panel h2 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-size: 1.5rem;
}

.info-panel p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.fullscreen-exit {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) scale(1);
  z-index: 9999;
  display: none;
  min-width: 10rem;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(0.5rem);
}

.fullscreen-exit.show {
  display: inline-flex;
}

.fullscreen-exit:hover,
.fullscreen-exit:focus-visible {
  transform: translateX(-50%) scale(1.05);
  opacity: 0.98;
}

.game-frame-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-frame-shell.is-fullscreen .game-frame {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;
  border-radius: 0;
  border: none;
}

.site-footer {
  width: var(--content-width);
  margin: 0 auto;
  padding: 0 0 var(--space-5);
  color: rgba(148, 163, 184, 0.55);
  border-top: 0.08rem solid rgba(148, 163, 184, 0.12);
}

.footer-links {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-2);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  padding: 0.35rem 0.55rem;
  border-radius: 999rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

@media (max-width: 90rem) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 56rem) {
  .nav {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .brand {
    text-align: center;
  }

  .nav-links {
    justify-content: center;
  }
}

@media (max-width: 48rem) {
  .button {
    width: 100%;
    min-width: 0;
  }

  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .info-panel-top {
    justify-content: stretch;
  }

  .fullscreen-exit {
    top: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-width: 20rem;
  }
}