:root {
  --bg: #08101c;
  --surface: #122433;
  --surface-alt: #192d45;
  --text: #f6f9ff;
  --muted: #a2b0c8;
  --accent: #ffd163;
  --accent-strong: #ffb347;
  --border: rgba(255, 209, 99, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(255, 209, 99, 0.16), transparent 40%),
    radial-gradient(circle at bottom right, rgba(69, 141, 255, 0.15), transparent 25%),
    var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 16, 28, 0.92);
  border-bottom: 1px solid rgba(255, 209, 99, 0.12);
  padding: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-image {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.brand-title {
  display: grid;
  gap: 0.15rem;
}

.brand-title h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
}

.brand-title p {
  margin: 0;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  transform-style: preserve-3d;
  perspective: 900px;
}

.site-nav a {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  transform: translateY(calc(var(--step, 0) * -4px)) translateZ(calc(var(--step, 0) * 2px));
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255, 209, 99, 0.14);
  border-color: rgba(255, 209, 99, 0.22);
  transform: translateY(calc(var(--step, 0) * -4px)) translateZ(calc(var(--step, 0) * 8px));
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.18);
}

.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 209, 99, 0.22);
  background: rgba(255, 209, 99, 0.06);
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.5rem;
}

.hero-content h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.hero-content p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #102030;
  font-weight: 700;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.page-intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 44rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.answer-box {
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 1.05rem;
}

.audio-panel {
  border-radius: 20px;
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-media {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(3, 14, 34, 0.35);
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
}

.card h3 {
  margin-top: 0;
}

.card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.gallery {
  margin: 2.5rem 0;
}

.gallery h2 {
  margin-bottom: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.game-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 209, 99, 0.14);
  border-radius: 24px;
  padding: 1.5rem;
}

.game-output {
  border: 1px solid rgba(255, 209, 99, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  padding: 1rem;
  border-radius: 18px;
  min-height: 10rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 1rem 0;
}

.game-status {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 209, 99, 0.12);
  font-weight: 700;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.tic-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, transform 0.15s ease;
}

.tic-cell:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

#mouseBanner {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  background: rgba(255, 209, 99, 0.95);
  color: #102030;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  transform-origin: left center;
  animation: waveFlag 1.2s ease-in-out infinite alternate;
  white-space: nowrap;
}

@keyframes waveFlag {
  from {
    transform: rotate(4deg);
  }
  to {
    transform: rotate(-4deg);
  }
}

.site-footer {
  margin: 3rem auto 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 950px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .content-grid,
  .gallery-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 1rem;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    flex-direction: column;
    display: none;
    width: 100%;
  }
  .site-nav.open {
    display: flex;
  }
}
