
/* 1. COLORS & GLOBAL STYLES */
:root {
  --bg: #171119;
  --surface: #2B1D2C;
  --surface2: #211724;
  --purple: #B985D6;
  --cyan: #F2A5D0;
  --coral: #E879B9;
  --text: #FFF0F7;
  --muted: #D7C1D2;
  --line: #5B4059;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.6; }
button { font: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
.container { width: min(1100px, calc(100% - 44px)); margin: auto; }
.section { padding: 110px 0; }
.section-alt { background: var(--surface2); }


/* 2. NAVIGATION */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px max(22px, calc((100vw - 1100px) / 2));
  background: rgba(23, 17, 25, 0.96);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}

.logo { font-size: 25px; font-weight: 900; letter-spacing: -2px; text-decoration: none; }
nav { display: flex; gap: 27px; }
nav a { font-size: 13px; text-decoration: none; color: var(--muted); transition: color 0.2s; }
nav a:hover, nav a:focus-visible { color: var(--cyan); }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 20; padding: 10px; background: var(--text); color: var(--bg); }
.skip-link:focus { top: 10px; }


/* 3. COMMON BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px;
  padding: 13px 22px; border: 1px solid transparent; border-radius: 9px;
  font-weight: 700; text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}

.btn:hover { transform: translateY(-3px); }
.primary { background: var(--coral); color: #241729; }
.primary:hover { background: #F4A4D3; }
.secondary { background: transparent; color: var(--text); border-color: var(--purple); }
.secondary:hover { background: #49304A; }
.text-btn { background: transparent; color: #E8CBE0; border-color: #654763; }


/* 4. HERO SECTION */
.hero {
  position: relative; min-height: calc(100svh - 70px);
  display: grid; place-items: center; overflow: hidden;
}

.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: clamp(112px, 21vw, 285px); font-weight: 900;
  line-height: 1; letter-spacing: -0.105em;
  margin: 20px 0 4px; padding-right: 0.09em;
  background: linear-gradient(115deg, #FFE0F0 5%, #E879B9 52%, #B985D6 100%);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
.hero h1 span { color: inherit; -webkit-text-fill-color: transparent; }
.hero h2 { font-size: clamp(27px, 4vw, 54px); line-height: 1.2; letter-spacing: -2px; margin: 0; }
.hero-copy { max-width: 550px; margin: 22px auto 30px; color: var(--muted); }
.scroll-hint { margin-top: 65px; color: var(--muted); font-size: 11px; letter-spacing: 2px; }

/* Hero decorations */
.hero-glow {
  position: absolute; width: 500px; height: 500px;
  border-radius: 50%; filter: blur(95px); opacity: 0.24; pointer-events: none;
}
.glow-one { background: var(--coral); top: -170px; right: -150px; }
.glow-two { background: var(--purple); bottom: -250px; left: -160px; }
.hero-orbit {
  position: absolute; width: 260px; height: 260px; left: -130px; top: 14%;
  border: 1px solid #B985D666; border-radius: 50%; transform: rotate(-30deg);
}
.hero-orbit div {
  position: absolute; width: 12px; height: 12px; top: 45px; right: 40px;
  background: var(--coral); border-radius: 50%; box-shadow: 0 0 20px #E879B988;
}


/* 5. COMMON SECTION STYLES */
.eyebrow {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: #EFA0CD; text-transform: uppercase;
}
.section-title { font-size: clamp(34px, 5vw, 62px); line-height: 1.12; letter-spacing: -2px; margin: 10px 0; }
.section-title em { font-style: normal; color: #EFA0CD; }
.section-lead { max-width: 650px; margin: 0 0 35px; color: var(--muted); }
.info-card, .lab-card, .quote, .origin-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}


/* 6. DECODE THE WORD */
.definition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.info-card { padding: 29px; min-height: 220px; transition: transform 0.2s, border-color 0.2s; }
.info-card:hover { transform: translateY(-6px); border-color: var(--coral); }
.card-number { font: 12px ui-monospace, monospace; color: var(--cyan); }
.info-card h3 { font-size: 23px; margin: 26px 0 8px; }
.info-card p, .origin-box p { color: var(--muted); }

/* Word origin */
.origin-box {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 30px;
  padding: 28px; margin-top: 20px;
}
.origin-box h3 { font-size: 25px; margin: 0; }
.origin-box p { margin: 0; }

/* Related words */
.subheading { margin-top: 52px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.word-chips span {
  padding: 9px 16px; background: #3B2840; color: #F7C7E4;
  border: 1px solid #99609A; border-radius: 50px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
}
.source-note { font-size: 12px; color: var(--muted); margin-top: 22px; }
.source-note a { color: var(--cyan); }


/* 7. MANY WORLDS */
.world-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 20px;
  align-items: stretch;
}

/* Left column */
.world-buttons {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.world-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 14px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: background 0.2s, border-color 0.2s;
}

.world-btn:hover,
.world-btn.active {
  background: #49304A;
  border-color: var(--coral);
}

/* Right column */
.world-display {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 500px;
  padding: 26px;
  background: radial-gradient(circle at 55% 25%, #52324F, #2B1D2C 75%);
  border: 1px solid #765474;
  border-radius: 18px;
}

/* Astronaut image */
.world-graphic {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  filter: drop-shadow(0 0 22px #E879B955);
}

.world-graphic img {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 16px;
}

/* Text */
.world-display h3 {
  font-size: 28px;
  margin: 0;
}

.world-display .eyebrow {
  margin: 0 0 6px;
}

#worldText {
  color: var(--muted);
  font-size: 15px;
}


/* 8. PERSPECTIVES */
.quotes-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.quote { margin: 0; padding: 28px; }
.main-quote {
  grid-row: span 2; display: flex;
  flex-direction: column; justify-content: center;
}
.main-quote p { font-size: clamp(18px, 2vw, 23px); line-height: 1.6; margin: 8px 0 22px; }
.main-quote footer { color: var(--muted); font-size: 13px; }
.placeholder { border-style: dashed; }
.placeholder p:not(.eyebrow) { font-size: 17px; line-height: 1.6; }


/* 9. PLAYGROUND - COMMON STYLES */
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lab-card { padding: 30px; }
.lab-heading { display: flex; justify-content: space-between; }
.lab-heading span:last-child { color: var(--cyan); }
.lab-card h3 { font-size: 28px; margin: 4px 0; }
.lab-card > p { color: var(--muted); }
.lab-card .btn { margin-top: 7px; }
.game-stats {
  display: flex; justify-content: space-between;
  gap: 12px; padding: 12px 0; color: var(--muted); font-size: 14px;
}
.game-stats strong { color: var(--text); }
.game-message { min-height: 46px; color: var(--muted); font-size: 14px; }


/* 10. MUSIC VIBE QUIZ */
.music-quiz { grid-column: 1 / -1; }
.music-quiz > p { max-width: 680px; }

/* Progress bar */
.quiz-progress-header {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 24px; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
}
.quiz-progress {
  height: 7px; margin: 10px 0 24px;
  background: #4A334D; border-radius: 20px; overflow: hidden;
}
.quiz-progress-fill {
  width: 0; height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--purple));
  transition: width 0.25s ease;
}

/* Questions and answers */
.music-quiz h4 { font-size: clamp(21px, 3vw, 29px); line-height: 1.3; margin: 0 0 20px; }
.quiz-options { display: grid; gap: 12px; }
.quiz-option {
  display: block; width: 100%; padding: 17px 20px;
  background: #37253B; color: var(--text); text-align: left; font-weight: 650;
  border: 1px solid #735573; border-radius: 12px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.quiz-option:hover { background: #513654; border-color: var(--coral); transform: translateY(-2px); }
.quiz-back { margin-top: 18px; }

/* Quiz result */
.quiz-result {
  padding: 28px 20px; text-align: center;
  background: #37253B; border: 1px solid #735573; border-radius: 16px;
}
.quiz-result-emoji { font-size: 58px; line-height: 1.4; }
.quiz-result h4 { margin: 8px 0; color: var(--cyan); }
.quiz-result > p:not(.eyebrow) {
  max-width: 550px; margin: 10px auto 20px; color: var(--muted);
}
.music-quiz [hidden] { display: none !important; }


/* 11. ROCK PAPER SCISSORS */
.rps-arena {
  display: flex; align-items: center; justify-content: space-around;
  gap: 12px; padding: 25px 12px; margin: 20px 0;
  background: var(--surface2); border-radius: 12px;
}
.rps-player { text-align: center; }
.rps-player > span { display: block; font-size: 55px; line-height: 1.5; }
.rps-player p {
  margin: 8px 0 0; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
}
.rps-vs { font-size: 20px; font-weight: 900; color: var(--coral); }
.rps-buttons { display: flex; gap: 10px; margin: 18px 0; }
.rps-btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 15px 8px; font-size: 30px;
  background: #37253B; color: var(--text);
  border: 1px solid #654763; border-radius: 12px; transition: 0.2s;
}
.rps-btn span { font-size: 13px; font-weight: 700; }
.rps-btn:hover { background: #503454; border-color: var(--coral); transform: translateY(-4px); }
.rps-btn:active { transform: scale(0.95); }
.rps-game #rpsReset { width: 100%; }


/* 12. HIGHER OR LOWER */
.hl-table {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; min-height: 185px; margin: 12px 0;
}
.playing-card, .next-card {
  width: 110px; height: 160px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 12px; font-size: 57px; font-weight: 900; line-height: 1.1;
}
.playing-card { background: var(--text); color: #241729; box-shadow: 0 8px 22px #100B1590; }
.playing-card.red-suit { color: #BF2A66; }
.playing-card span { font-size: 40px; }
.next-card { background: #38243D; color: var(--cyan); border: 2px dashed var(--purple); }
.game-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.game-actions .btn { flex: 1; white-space: nowrap; padding: 11px 12px; font-size: 14px; }


/* 13. CLOSING SECTION */
.closing { text-align: center; }
.closing h2 {
  max-width: 850px; margin: 25px auto;
  font-size: clamp(42px, 6vw, 80px); line-height: 1.1; letter-spacing: -3px;
}
.closing h2 span { color: var(--cyan); }
.closing > p:not(.eyebrow) { max-width: 600px; margin: 0 auto 30px; color: var(--muted); }


/* 14. FOOTER */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; padding: 32px 0;
}
.footer-inner p { color: var(--muted); font-size: 12px; }
.footer-inner div { display: flex; gap: 18px; }
.footer-inner a { color: var(--cyan); font-size: 12px; }


/* 15. RESPONSIVE - MOBILE */
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; justify-content: center; gap: 14px; }
  nav { flex-wrap: wrap; justify-content: center; gap: 12px 17px; }
  .section { padding: 73px 0; }

  .definition-grid, .lab-grid, .quotes-grid, .origin-box { grid-template-columns: 1fr; }
  .origin-box { gap: 12px; }

  .hero { min-height: 650px; }
  .hero h1 { font-size: clamp(95px, 24vw, 180px); }
  .hero-orbit { display: none; }

  .world-layout { grid-template-columns: 1fr; }
  .world-buttons { grid-template-rows: repeat(5, auto); }
  .world-btn { min-height: 65px; }
  .world-display { height: auto; min-height: 420px; }
  .world-graphic img { width: 220px; height: 220px; }

  .main-quote { grid-row: auto; }
  .main-quote p { font-size: 19px; }
  .placeholder p:not(.eyebrow) { font-size: 16px; }

  .music-quiz { grid-column: auto; }
  .quiz-option { padding: 14px; }

  .hl-table { gap: 15px; }
  .playing-card, .next-card { width: 95px; height: 140px; }

  .footer-inner { flex-direction: column; text-align: center; }
}


/* 16. ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
