:root {
  --max-site: 1200px;
  --max-game: 1200px;
  --radius-xl: 24px;
  --radius-md: 14px;

  /* Among Us logo-inspired palette */
  --au-blue: #132ed1;
  --au-red: #c51111;
  --au-yellow: #f5f557;
  --au-green: #127f2d;
  --au-cyan: #3cf2ff;
  --au-pink: #ff4fd8;

  --bg-1: #060b1f;
  --bg-2: #0c1640;
  --bg-3: #220814;
  --ambient-1: #1a2f79;
  --ambient-2: #5b0b2b;
  --ambient-3: #7a6805;
  --text-main: #e9f4ff;
  --text-soft: #b9cbe8;
  --card: rgba(8, 17, 38, 0.74);
  --stroke: rgba(80, 178, 255, 0.34);
  --glow-soft: 0 0 22px rgba(60, 242, 255, 0.24);
  --glow-hard: 0 0 34px rgba(255, 79, 216, 0.28);
  --grid-line: rgba(60, 242, 255, 0.12);
  --topbar-bg: linear-gradient(120deg, rgba(10, 24, 54, 0.62), rgba(30, 10, 28, 0.56));
  --controls-bg: rgba(4, 12, 30, 0.42);
}

body.light-theme {
  --bg-1: #f2f7ff;
  --bg-2: #e7f0ff;
  --bg-3: #fdf2f7;
  --ambient-1: #8db5ff;
  --ambient-2: #ffa2cc;
  --ambient-3: #ffe78a;
  --text-main: #0b1738;
  --text-soft: #304b76;
  --card: rgba(255, 255, 255, 0.88);
  --stroke: rgba(35, 88, 154, 0.34);
  --glow-soft: 0 0 18px rgba(19, 46, 209, 0.12);
  --glow-hard: 0 0 24px rgba(197, 17, 17, 0.1);
  --grid-line: rgba(0, 0, 0, 0.07);
  --topbar-bg: linear-gradient(120deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 255, 0.88));
  --controls-bg: rgba(235, 244, 255, 0.74);
  background: linear-gradient(160deg, #ffffff 0%, #e8e8e8 60%, #d2d2d2 100%);
  background-attachment: fixed;
}

* {
  box-sizing: border-box;
  font-family: "Merriweather Sans", sans-serif;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text-main);
  font-family: "Merriweather Sans", sans-serif;
  background:
    radial-gradient(ellipse 95% 65% at 50% -4%, #1e46c8 0%, #0a1a5e 28%, transparent 62%),
    #020614;
  background-attachment: fixed;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-position: 0 0;
}

.site-shell {
  position: relative;
  z-index: 3;
  width: min(100%, var(--max-site));
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 28px) clamp(14px, 2.2vw, 28px) 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text-main);
  text-decoration: none;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1rem, 2vw, 1.14rem);
  letter-spacing: 0.03em;
}

.brand img {
  width: clamp(42px, 8vw, 56px);
  height: auto;
  filter: drop-shadow(0 0 8px rgba(60, 242, 255, 0.85)) drop-shadow(0 0 18px rgba(255, 79, 216, 0.45));
}

.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.lang-wrap {
  margin-left: 6px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  padding: 0;
  border-radius: 0;
}

.switch-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(8, 27, 60, 0.65);
  border: 1.5px solid rgba(60, 242, 255, 0.65);
  box-shadow: inset 0 0 8px rgba(60, 242, 255, 0.25);
  flex-shrink: 0;
}

.switch-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c51111;
  box-shadow: 0 0 10px rgba(197, 17, 17, 0.75);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.switch-input:checked ~ .switch-thumb {
  transform: translateX(24px);
  background: #f5f557;
  box-shadow: 0 0 10px rgba(245, 245, 87, 0.85);
}

.switch-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-soft);
}

.switch-icon svg {
  width: 17px;
  height: 17px;
}

.lang-wrap select {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text-main);
  background: var(--card);
  font: 600 0.9rem "Merriweather Sans", sans-serif;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.lang-wrap select:hover,
.lang-wrap select:focus-visible {
  border-color: rgba(60, 242, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(60, 242, 255, 0.18);
}

#google_translate_element {
  display: none;
}

.hero {
  text-align: center;
  margin: 32px auto 28px;
  max-width: 900px;
  display: grid;
  gap: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Rubik", sans-serif !important;
  text-wrap: balance;
  font-weight: 600;
}

h1 {
  margin-top: 20px;
  font-size: 55px;
  font-weight: 800 !important;
  background: linear-gradient(90deg, #ffffff 0%, #c8f9ff 32%, #f5f557 64%, #ff4fd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(60, 242, 255, 0.28);
}

.lead {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 2.4vw, 1.1rem);
  line-height: 1.78;
}

.game-wrap {
  width: min(100%, var(--max-game));
  margin: 0 auto 42px;
  padding: 3px;
  border-radius: var(--radius-md);
  isolation: isolate;
  background: linear-gradient(90deg, var(--au-blue), var(--au-red), var(--au-yellow), var(--au-green), var(--au-blue));
  background-size: 240% 100%;
  animation: borderFlow 14s linear infinite;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(19, 46, 209, 0.24),
    0 0 24px rgba(197, 17, 17, 0.18),
    var(--glow-hard);
}

@keyframes borderFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 240% 0%; }
}

.game-inner {
  position: relative;
  border-radius: calc(var(--radius-md) - 2px);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.42);
  aspect-ratio: 16 / 8.8;
  min-height: 280px;
}

#gameSlot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.game-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at 20% 18%, rgba(19, 46, 209, 0.45), transparent 42%),
    radial-gradient(circle at 80% 75%, rgba(197, 17, 17, 0.34), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(245, 245, 87, 0.08), transparent 55%),
    linear-gradient(160deg, rgba(6, 9, 25, 0.92), rgba(18, 8, 20, 0.95));
}

.start-overlay.is-hidden {
  display: none !important;
}

.start-card {
  display: grid;
  gap: 11px;
  justify-items: center;
  max-width: 500px;
}

.start-logo {
  width: clamp(72px, 14vw, 120px);
  height: auto;
  filter: drop-shadow(0 0 10px rgba(60, 242, 255, 0.65));
}

.start-title {
  font-family: "Rubik", sans-serif;
  letter-spacing: 0.06em;
  font-size: clamp(1.06rem, 2.8vw, 1.56rem);
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(60, 242, 255, 0.45);
  margin-top: 18px;
}

.start-subtitle {
  margin: 0;
  color: #d5e9ff;
  font-size: clamp(0.9rem, 1.7vw, 1rem);
  line-height: 1.6;
}

.start-btn {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 24px;
  font: 700 0.95rem "Merriweather Sans", sans-serif;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #030b1e;
  background: linear-gradient(90deg, var(--au-yellow), var(--au-cyan));
  box-shadow: 0 8px 24px rgba(60, 242, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(60, 242, 255, 0.42);
}

.start-btn svg {
  width: 18px;
  height: 18px;
  stroke: #030b1e;
}

.skip-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 4px;
}
.skip-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--au-cyan);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(60, 242, 255, 0.35);
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.skip-nav a:hover,
.skip-nav a:focus-visible {
  background: rgba(60, 242, 255, 0.12);
  outline: none;
}

.sections {
  display: grid;
  gap: 16px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(60, 242, 255, 0.34);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 25px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--au-cyan), var(--au-yellow), var(--au-pink)) top / 100% 2px no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(60, 242, 255, 0.62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), var(--glow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-head svg {
  width: 20px;
  height: 20px;
  stroke: var(--au-cyan);
  filter: drop-shadow(0 0 8px rgba(60, 242, 255, 0.55));
}

.panel p,
.panel li {
  color: var(--text-soft);
  font-size: clamp(0.93rem, 2vw, 1.02rem);
  line-height: 1.72;
}

.panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.panel strong {
  color: var(--text-main);
}

.panel h3 {
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  font-weight: 700;
  color: var(--au-cyan);
  margin-top: 26px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(60, 242, 255, 0.18);
}

.panel h3:first-of-type {
  margin-top: 18px;
}

body.light-theme .switch-track {
  background: rgba(231, 241, 255, 0.95);
  border-color: rgba(19, 46, 209, 0.5);
  box-shadow: inset 0 0 8px rgba(19, 46, 209, 0.12);
}

body.light-theme .switch-icon {
  color: #29497a;
}

body.light-theme .lang-wrap select {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(19, 46, 209, 0.32);
}

body.light-theme h1 {
  background: linear-gradient(90deg, #0f2a62 0%, #1e4eb6 45%, #9d2f69 78%, #c88f0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(30, 78, 182, 0.14);
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: transform, opacity;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.light-theme .panel {
  border-color: rgba(19, 46, 209, 0.2);
  box-shadow: 0 8px 20px rgba(19, 46, 209, 0.08);
}

body.light-theme .panel h2,
body.light-theme .panel h3 {
  color: #0b1738;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  text-shadow: none;
}

body.light-theme .panel:hover {
  border-color: rgba(19, 46, 209, 0.36);
  box-shadow: 0 10px 24px rgba(19, 46, 209, 0.12);
}

footer {
  margin-top: 22px;
  border-top: 1px solid rgba(140, 187, 255, 0.25);
  padding-top: 14px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

footer a {
  color: #8ed5ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 213, 255, 0.7);
}

body.light-theme footer {
  border-top-color: rgba(0, 0, 0, 0.12);
  color: #304b76;
}

body.light-theme footer a {
  color: #1a3fa8;
  border-bottom-color: rgba(26, 63, 168, 0.5);
}

body.light-theme footer a:hover,
body.light-theme footer a:focus-visible {
  color: #0d2a80;
  border-bottom-color: #0d2a80;
}

footer a:hover,
footer a:focus-visible {
  color: #d0eeff;
  border-bottom-color: #d0eeff;
}

@media (max-width: 760px) {
  .site-shell {
    padding: 14px 18px 34px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin-bottom: 8px;
  }

  .brand img {
    width: 44px;
  }

  .controls {
    width: auto;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .lang-wrap select {
    font-size: 0.84rem;
    padding: 5px 8px;
  }

  .hero {
    text-align: left;
    justify-items: start;
    margin: 50px 0 22px;
    max-width: 100%;
  }

  h1 {
    font-size: 28px;
    margin-top: 2px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 20px;
  }

  .lead {
    font-size: 0.9rem;
    line-height: 1.58;
    text-align: left;
  }

  .game-wrap {
    border-radius: 16px;
    margin-bottom: 24px;
  }

  .game-inner {
    border-radius: 14px;
    aspect-ratio: unset;
    height: 420px;
    min-height: unset;
  }

  .start-card {
    gap: 8px;
  }

  .start-logo {
    width: 60px;
  }

  .start-title {
    font-size: 1.1rem;
    margin-top: 8px;
  }

  .start-subtitle {
    font-size: 0.82rem;
  }

  .start-btn {
    padding: 10px 20px;
    font-size: 0.88rem;
  }
}

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

  .blob,
  .game-wrap {
    animation: none;
  }

  .panel {
    transition: none;
  }

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