[hidden] {
  display: none !important;
}

/* Immersive full-viewport interface */
html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background: #efe9dc;
}

.topbar {
  min-height: 72px;
  padding: 14px clamp(20px, 3.5vw, 68px);
  background: rgba(10, 15, 28, 0.94);
  border-color: rgba(255, 255, 255, 0.13);
  color: white;
}

.topbar .brand,
.topbar .nav a {
  color: white;
}

.topbar .nav a:hover {
  color: #0b1020;
  background: var(--lime);
}

.topbar .account-button {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

main,
.section {
  width: 100%;
  max-width: none;
  margin: 0;
}

.section {
  padding: clamp(90px, 9vw, 165px) clamp(24px, 5vw, 96px);
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 72px);
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  gap: clamp(42px, 6vw, 118px);
  overflow: hidden;
  color: white;
  background: #0a0f1c;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 84% 18%, rgba(98, 184, 255, 0.25), transparent 27%),
    radial-gradient(circle at 10% 86%, rgba(255, 107, 61, 0.22), transparent 30%),
    linear-gradient(125deg, #0a0f1c 0 55%, #151e36 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, black, transparent 78%);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-backdrop span {
  position: absolute;
  left: -2vw;
  bottom: -5vw;
  color: rgba(255, 255, 255, 0.035);
  font: italic 900 clamp(160px, 25vw, 460px)/0.72 Georgia, serif;
  letter-spacing: -0.08em;
}

.hero-backdrop i {
  position: absolute;
  width: 46vw;
  height: 46vw;
  right: -14vw;
  top: -18vw;
  border: 1px solid rgba(199, 255, 61, 0.38);
  border-radius: 50%;
  box-shadow: 0 0 0 8vw rgba(199, 255, 61, 0.025), 0 0 0 16vw rgba(199, 255, 61, 0.018);
}

.hero-backdrop b {
  position: absolute;
  right: 2vw;
  bottom: -0.16em;
  color: rgba(199, 255, 61, 0.08);
  font: 900 clamp(150px, 18vw, 340px)/1 Georgia, serif;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: none;
}

.hero .eyebrow {
  color: var(--lime);
}

.hero h1 {
  max-width: 980px;
  margin: 28px 0 36px;
  font-size: clamp(78px, 9.2vw, 172px);
  line-height: 0.78;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: #ff7b55;
  text-shadow: 0 14px 60px rgba(255, 107, 61, 0.2);
}

.hero-lead {
  max-width: 760px;
  color: #b8c0d2;
  font-size: clamp(16px, 1.25vw, 21px);
}

.hero .button-ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.035);
}

.hero .button:hover {
  box-shadow: 6px 7px 0 var(--orange);
}

.hero .sync-line {
  color: #8f98ad;
}

.hero-visual {
  width: 100%;
  min-height: min(72vh, 760px);
  aspect-ratio: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px 72px 2px 72px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 42px 130px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.visual-grid {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
}

.hero-visual::before {
  inset: 11%;
  border-color: rgba(199, 255, 61, 0.44);
}

.hero-visual::after {
  display: none;
}

.planet-card {
  width: min(62%, 430px);
  background: #f7f0e5;
  box-shadow: 22px 22px 0 var(--orange), -18px -18px 0 rgba(98, 184, 255, 0.34);
}

.planet-card > strong {
  font-size: clamp(96px, 10vw, 174px);
}

.visual-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  color: white;
  background: rgba(10, 15, 28, 0.78);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
}

.visual-footer i {
  width: 5px;
  height: 5px;
  background: var(--lime);
  border-radius: 50%;
}

.mission-board {
  color: white;
  background: #0a0f1c;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mission-board .section-heading > p:last-child {
  color: #9099ad;
}

.section-heading {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.35fr);
}

.section-heading h2 {
  font-size: clamp(62px, 8vw, 142px);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(270px, 34vh);
  gap: 12px;
}

.mission-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  padding: clamp(24px, 2.7vw, 46px);
  color: #11182b;
  border: 0;
  border-radius: 3px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.mission-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: repeating-linear-gradient(135deg, transparent 0 22px, rgba(17, 24, 43, 0.25) 23px 24px);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.mission-card:hover {
  z-index: 2;
  transform: translateY(-8px) rotate(-0.35deg);
  filter: saturate(1.1);
}

.mission-card:hover::after {
  transform: translateX(0);
}

.mission-code {
  position: absolute;
  top: 25px;
  left: 28px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.mission-card > strong,
.card-symbol {
  position: absolute;
  top: 16px;
  right: 28px;
  font: 900 clamp(72px, 8vw, 138px)/1 Georgia, serif;
  letter-spacing: -0.08em;
}

.mission-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font: 800 clamp(32px, 3.6vw, 62px)/0.95 "Bodoni 72", "Songti SC", serif;
}

.mission-card p {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 0 26px;
  line-height: 1.7;
}

.mission-card > i {
  position: relative;
  z-index: 1;
  padding-bottom: 5px;
  border-bottom: 2px solid currentColor;
  font-size: 13px;
  font-weight: 900;
  font-style: normal;
}

.mission-daily {
  grid-column: span 7;
  grid-row: span 2;
  background: var(--lime);
}

.mission-review {
  grid-column: span 5;
  color: white;
  background: #2736db;
}

.mission-rescue {
  grid-column: span 5;
  background: #68c8ff;
}

.mission-game {
  grid-column: span 4;
  background: #ff7047;
}

.mission-family {
  grid-column: span 4;
  background: #f4eee2;
}

.mission-status {
  grid-column: span 4;
  color: white;
  cursor: default;
  background: #1b243b;
}

.mission-status:hover {
  transform: none;
}

.mission-status > strong {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.mission-status strong b {
  font: inherit;
}

.mission-status strong small {
  font: 900 10px/1.2 "Avenir Next", sans-serif;
  letter-spacing: 2px;
}

.mission-status .route-progress {
  position: relative;
  z-index: 1;
  width: 100%;
}

.wordbank > *,
.dashboard > * {
  width: 100%;
  max-width: none;
}

.wordbank {
  background: #c7e7fa;
}

.wordbank.is-collapsed {
  padding-bottom: clamp(70px, 7vw, 110px);
}

.wordbank.is-collapsed .search-shell {
  margin-bottom: 0;
}

.word-row {
  grid-template-columns: 90px minmax(160px, 1fr) minmax(140px, 0.8fr) minmax(260px, 2fr) 44px auto;
  padding-block: 24px;
}

.pronunciation-button,
.speak-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: var(--lime);
  font: 900 10px/1 "Avenir Next", sans-serif;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pronunciation-button {
  margin: 18px 0 4px;
  padding: 11px 17px;
  border-radius: 999px;
}

.speak-mini {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

.pronunciation-button:hover,
.speak-mini:hover {
  transform: translateY(-2px);
  box-shadow: 3px 4px 0 var(--ink);
}

.pronunciation-button span,
.speak-mini span {
  position: relative;
  width: 10px;
  height: 14px;
  border-left: 5px solid currentColor;
}

.pronunciation-button span::before,
.speak-mini span::before,
.pronunciation-button span::after,
.speak-mini span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 6px;
  height: 8px;
  border: 1px solid currentColor;
  border-left: 0;
  border-block-color: transparent;
  border-radius: 0 50% 50% 0;
}

.pronunciation-button span::after,
.speak-mini span::after {
  left: 6px;
  top: 0;
  width: 8px;
  height: 12px;
}

.flashcard .pronunciation-button + .definition {
  margin-top: 20px;
}

.support-dialog {
  width: min(540px, 94vw);
}

.support-card {
  position: relative;
  padding: clamp(28px, 5vw, 54px);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 32px;
  background: var(--lime);
  text-align: center;
  box-shadow: 12px 14px 0 var(--orange);
}

.support-card > span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
}

.support-card h2 {
  margin: 14px 0 22px;
  font: 800 clamp(34px, 6vw, 54px)/1 "Bodoni 72", "Songti SC", serif;
}

.support-card img {
  display: block;
  width: min(100%, 360px);
  margin: 0 auto;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: white;
}

.support-card p {
  margin: 22px auto 0;
  max-width: 360px;
  line-height: 1.7;
}

.record {
  background: #efe9dc;
}

.record-grid {
  grid-template-columns: 1fr 1.65fr;
}

.level-card,
.heatmap-card,
.mastery-card {
  min-height: 260px;
}

footer {
  min-height: 48vh;
  padding: clamp(70px, 8vw, 150px) clamp(24px, 5vw, 96px);
  align-content: space-between;
}

.study-dialog {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
}

.study-dialog::backdrop {
  background: #0a0f1c;
}

.study-shell {
  display: grid;
  align-content: center;
  width: 100%;
  min-height: 100svh;
  padding: clamp(34px, 6vw, 110px) clamp(22px, 10vw, 190px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 90% 5%, rgba(98, 184, 255, 0.3), transparent 26%),
    linear-gradient(135deg, #f8f1e5, #eee6d9);
  box-shadow: none;
}

.study-shell::before {
  content: "ROSEWORD / LEARNING SESSION";
  position: absolute;
  top: 28px;
  left: clamp(22px, 5vw, 90px);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
}

.study-shell .dialog-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 3;
}

.flashcard {
  min-height: min(52vh, 520px);
  background: rgba(255, 255, 255, 0.78);
}

@media (min-width: 1600px) {
  .section {
    padding-inline: 4vw;
  }

  .hero {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    min-height: 650px;
  }

  .mission-daily,
  .mission-review,
  .mission-rescue {
    grid-column: span 6;
    grid-row: auto;
  }

  .mission-game,
  .mission-family,
  .mission-status {
    grid-column: span 4;
  }
}

@media (max-width: 850px) {
  .section {
    padding-inline: 18px;
  }

  .hero {
    padding-top: 76px;
  }

  .hero h1 {
    font-size: clamp(68px, 19vw, 116px);
  }

  .hero-visual {
    min-height: min(115vw, 620px);
    border-radius: 2px 44px 2px 44px;
  }

  .mission-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(330px, auto);
  }

  .mission-card,
  .mission-daily,
  .mission-review,
  .mission-rescue,
  .mission-game,
  .mission-family,
  .mission-status {
    grid-column: auto;
    grid-row: auto;
  }

  .mission-card > strong,
  .card-symbol {
    font-size: 72px;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 64px;
  }

  .hero {
    min-height: calc(100svh - 64px);
    padding: 54px 18px 64px;
  }

  .hero-copy {
    min-height: calc(100svh - 170px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero h1 {
    margin-block: 24px 30px;
    font-size: clamp(67px, 20vw, 98px);
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .button {
    text-align: center;
  }

  .hero-visual {
    min-height: 500px;
  }

  .planet-card {
    width: 68%;
  }

  .section-heading h2 {
    font-size: clamp(54px, 17vw, 80px);
  }

  .mission-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(360px, auto);
  }

  .mission-card h3 {
    font-size: 42px;
  }

  .word-row {
    grid-template-columns: 42px 1fr 40px auto;
  }

  .word-phonetic,
  .word-definition {
    grid-column: 2 / -1;
  }

  .study-shell {
    padding-top: 86px;
  }
}
