:root {
  --ink: #202036;
  --muted: #6d6b7c;
  --cream: #fffaf1;
  --paper: #ffffff;
  --purple: #6d4aff;
  --purple-dark: #5133d7;
  --coral: #ff786b;
  --blue: #70a7ff;
  --gold: #ffc95c;
  --border: rgba(32, 32, 54, 0.12);
  --shadow: 0 22px 55px rgba(74, 55, 45, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.page-glow {
  position: fixed;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.3;
  pointer-events: none;
}

.page-glow--one {
  top: -18rem;
  right: -8rem;
  background: #d8cbff;
}

.page-glow--two {
  top: 38rem;
  left: -22rem;
  background: #ffd8bd;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.brand__mark {
  display: grid;
  width: 39px;
  height: 39px;
  color: white;
  background: var(--purple);
  border-radius: 13px;
  place-items: center;
  transform: rotate(-5deg);
  box-shadow: 0 5px 0 #4228bd;
}

.sound-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.sound-toggle:hover {
  color: var(--ink);
  background: white;
}

.sound-toggle__icon {
  display: grid;
  width: 24px;
  height: 24px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  place-items: center;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 560px;
  padding: 110px 20px 90px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.hero h1 span {
  position: relative;
  color: var(--purple);
}

.hero__copy {
  max-width: 590px;
  margin: 28px auto 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.site-address {
  margin: -13px 0 25px;
  color: var(--coral);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.primary-button {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  padding: 15px 18px 15px 23px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 8px 0 rgba(32, 32, 54, 0.15);
}

.primary-button span {
  display: grid;
  width: 28px;
  height: 28px;
  color: var(--ink);
  background: white;
  border-radius: 50%;
  place-items: center;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 11px 0 rgba(32, 32, 54, 0.12);
}

.hero__message {
  position: relative;
  z-index: 2;
  max-width: 430px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  text-align: center;
}

.hero__doodle {
  position: absolute;
  z-index: 1;
  display: grid;
  font-size: 2.2rem;
  place-items: center;
  animation: float 4s ease-in-out infinite;
}

.hero__doodle--left {
  top: 30%;
  left: 8%;
  color: var(--gold);
  transform: rotate(-14deg);
}

.hero__doodle--right {
  right: 9%;
  bottom: 22%;
  color: var(--coral);
  animation-delay: -1.5s;
}

.games-section {
  width: min(1180px, calc(100% - 40px));
  margin: 20px auto 0;
  padding: 72px 0 100px;
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.035em;
}

.game-count {
  margin: 0 0 8px;
  color: var(--muted);
}

.game-count strong {
  color: var(--ink);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.game-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  outline: none;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-8px) rotate(-0.4deg);
  box-shadow: 0 30px 65px rgba(74, 55, 45, 0.16);
}

.game-card__art {
  position: relative;
  min-height: 235px;
  overflow: hidden;
}

.game-card--coral .game-card__art {
  background: var(--coral);
}

.game-card--blue .game-card__art {
  background: var(--blue);
}

.game-card--gold .game-card__art {
  background: var(--gold);
}

.game-card--purple .game-card__art { background: #8d6dea; }
.shape--ballet-ring { top: 30px; left: 42px; width: 92px; height: 92px; border: 12px solid rgba(255,255,255,.68); border-radius: 50%; }
.shape--ballet-star { top: 20px; right: 45px; color: var(--gold); font-size: 4rem; transform: rotate(12deg); }

.game-number {
  position: absolute;
  right: 18px;
  bottom: -26px;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Fredoka", sans-serif;
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.08em;
}

.shape {
  position: absolute;
  display: block;
}

.shape--circle {
  top: 35px;
  left: 30px;
  width: 78px;
  height: 78px;
  border: 15px solid #ffd3ce;
  border-radius: 50%;
}

.shape--pill {
  top: 35px;
  right: 65px;
  width: 24px;
  height: 80px;
  background: #844a7b;
  border-radius: 999px;
  transform: rotate(43deg);
}

.shape--diamond {
  top: 28px;
  left: 42px;
  width: 68px;
  height: 68px;
  background: #d8e7ff;
  border-radius: 15px;
  transform: rotate(45deg);
}

.shape--dot-grid {
  top: 32px;
  right: 42px;
  width: 70px;
  height: 60px;
  opacity: 0.55;
  background-image: radial-gradient(#254f92 3px, transparent 4px);
  background-size: 17px 17px;
}

.shape--sun {
  top: 28px;
  left: 38px;
  width: 80px;
  height: 80px;
  background: #fff4c9;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 244, 201, 0.25);
}

.shape--squiggle {
  top: 15px;
  right: 38px;
  color: #a06710;
  font-family: "Fredoka", sans-serif;
  font-size: 5rem;
  transform: rotate(-20deg);
}

.game-card__body {
  display: flex;
  min-height: 255px;
  padding: 25px;
  flex-direction: column;
  justify-content: space-between;
}

.game-card__label {
  margin: 0 0 7px;
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card h3 {
  margin: 0 0 7px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.75rem;
}

.game-card__body p:not(.game-card__label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-button {
  align-self: flex-start;
  padding: 10px 15px;
  color: var(--muted);
  background: #f3f1ee;
  border: 0;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.card-button--play {
  color: white;
  background: var(--ink);
  cursor: pointer;
}

.card-button--play span { margin-left: 8px; }

body.game-open { overflow: hidden; }

.game-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  min-height: 100dvh;
  visibility: hidden;
  flex-direction: column;
  background: #f5f0e7;
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms;
}

.game-screen,
.link-screen,
.orbit-screen {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.game-screen *,
.link-screen *,
.orbit-screen * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-screen.is-open { visibility: visible; opacity: 1; transform: none; }

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
}

.game-header__title { display: flex; gap: 10px; align-items: center; }
.game-header__title p, .game-header__title h2 { margin: 0; line-height: .9; }
.game-header__title p { color: var(--muted); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.game-header__title h2 { font-family: "Fredoka"; font-size: 1.5rem; }
.mini-brand { display: grid; width: 38px; height: 38px; color: white; background: var(--coral); border-radius: 12px; font-family: "Fredoka"; font-weight: 700; place-items: center; transform: rotate(-5deg); }
.mini-brand--link { background: var(--blue); }
.mini-brand--orbit { color: var(--ink); background: var(--gold); }
.mini-brand--ballet { background: #d75889; }
.icon-button { display: grid; width: 42px; height: 42px; color: var(--ink); background: white; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; font-size: 1.2rem; place-items: center; }

.fall-layout {
  display: grid;
  grid-template-columns: 150px minmax(300px, 680px) 150px;
  gap: 22px;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 2px 20px;
  flex: 1;
}

.fall-panel { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.fall-panel--score { display: grid; gap: 22px; }
.fall-panel--score div { display: grid; gap: 4px; }
.fall-panel strong { color: var(--ink); font-family: "Fredoka"; font-size: 1.65rem; letter-spacing: 0; text-transform: none; }
.fall-panel--next { padding: 18px; background: rgba(255,255,255,.65); border: 1px solid var(--border); border-radius: 18px; }
.fall-panel--next strong { display: block; margin: 8px 0; color: var(--purple); overflow-wrap: anywhere; }
.fall-panel--next p { margin: 0; line-height: 1.5; font-size: .68rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.used-words-box { min-width: 0; }
.used-words-box span { display: flex; gap: 6px; align-items: center; }
.used-words-box b { display: grid; min-width: 20px; height: 20px; color: white; background: var(--purple); border-radius: 999px; font-size: .62rem; place-items: center; }
.used-words-list { display: flex !important; gap: 5px !important; align-content: flex-start; flex-wrap: wrap; max-height: 165px; margin-top: 7px; padding-right: 4px; overflow-y: auto; scrollbar-width: thin; }
.used-word-chip { padding: 4px 6px; color: var(--ink); background: white; border: 1px solid var(--border); border-radius: 6px; font-size: .58rem; font-weight: 700; letter-spacing: .04em; animation: chip-in 260ms cubic-bezier(.2,.9,.3,1.3) both; }

.board-wrap { position: relative; width: 100%; min-width: 0; }
.fall-board {
  --cell: min(5.4vh, 42px);
  position: relative;
  width: 100%;
  height: calc(var(--cell) * 15);
  max-height: calc(100vh - 190px);
  overflow: hidden;
  background: #fffdf9;
  border: 2px solid var(--ink);
  border-top: 3px dashed rgba(255, 120, 107, .8);
  border-radius: 8px 8px 18px 18px;
  box-shadow: 0 18px 45px rgba(46, 39, 31, .12);
  touch-action: none;
}
.board-grid { position: absolute; inset: 0; opacity: .75; background-image: linear-gradient(rgba(32,32,54,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(32,32,54,.055) 1px, transparent 1px); background-size: var(--cell) var(--cell); }
.danger-line { position: absolute; top: 0; right: 0; left: 0; border-top: 3px dashed var(--coral); opacity: .65; }
.danger-label { position: absolute; z-index: 2; top: -18px; right: 8px; color: var(--coral); font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.danger-label span { display: none; }
.tiles-layer, .falling-word { position: absolute; inset: 0; pointer-events: none; }
.letter-tile {
  position: absolute;
  display: grid;
  width: var(--cell);
  height: var(--cell);
  color: var(--ink);
  background: #ffe5d0;
  border: 1px solid rgba(32,32,54,.25);
  border-radius: 7px;
  font-family: "Fredoka";
  font-size: calc(var(--cell) * .55);
  font-weight: 700;
  place-items: center;
  box-shadow: inset 0 -3px 0 rgba(98,55,27,.1), 0 2px 3px rgba(32,32,54,.1);
  transition: left 100ms ease, bottom 240ms cubic-bezier(.2,.8,.3,1), opacity 180ms ease, transform 180ms ease;
}
.letter-tile:nth-child(3n+2) { background: #e4ddff; }
.letter-tile:nth-child(3n) { background: #d9edff; }
.falling-word .letter-tile { background: var(--gold); border-color: #a06c09; box-shadow: inset 0 -3px 0 rgba(120,76,0,.15), 0 4px 6px rgba(32,32,54,.16); }
.letter-tile.is-clearing { opacity: 0; transform: scale(.5) rotate(12deg); }
.letter-tile.is-selected { color: white; background: var(--purple) !important; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,74,255,.2), 0 5px 9px rgba(65,41,178,.35); transform: scale(1.08); z-index: 3; }
.letter-tile.just-placed { animation: tile-land 420ms cubic-bezier(.2,1.6,.4,1) both; }
.word-callout { position: absolute; z-index: 5; top: 44%; left: 50%; padding: 10px 17px; color: white; background: var(--purple); border-radius: 999px; font-family: "Fredoka"; font-size: 1.2rem; opacity: 0; pointer-events: none; transform: translate(-50%, 15px) scale(.8); }
.word-callout.show { animation: word-pop 1.25s ease both; }
.word-callout.is-invalid { color: white; background: var(--coral); font-size: 1rem; animation: short-word-pop 700ms ease both; }
.word-callout.londo-bundo { padding: 15px 24px; color: var(--ink); background: var(--gold); border: 2px solid var(--ink); font-size: clamp(1.5rem, 5vw, 2.35rem); box-shadow: 0 8px 0 rgba(32,32,54,.18); animation: londo-pop 1.8s cubic-bezier(.2,.9,.3,1.2) both; }
.clear-flash { position: absolute; inset: 0; background: white; opacity: 0; pointer-events: none; }
.clear-flash.flash { animation: flash 350ms ease; }
.celebration-layer { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.celebration-bit { position: absolute; left: 50%; top: 47%; width: 9px; height: 15px; background: var(--bit-color); border-radius: 3px; animation: burst 900ms cubic-bezier(.1,.7,.2,1) forwards; }
.fall-board.impact { animation: board-impact 260ms ease; }
.fall-board.big-impact { animation: board-celebrate 600ms ease; }
.score-pop { animation: score-pop 480ms cubic-bezier(.2,1.7,.4,1); }

.fall-controls { display: flex; gap: 16px; justify-content: center; padding: 16px 16px 7px; }
.fall-controls button { min-width: 68px; height: 56px; color: var(--ink); background: white; border: 1px solid var(--border); border-radius: 18px; cursor: pointer; font-size: 1.4rem; font-weight: 700; box-shadow: 0 5px 0 rgba(32,32,54,.1); transition: transform 100ms ease, box-shadow 100ms ease; }
.fall-controls button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(32,32,54,.1); }
.fall-controls .drop-button { min-width: 148px; color: white; background: var(--ink); font-size: 1rem; }
.drop-button span { margin-left: 14px; }
.keyboard-hint { margin: 4px 0 12px; color: var(--muted); text-align: center; font-size: .72rem; }
kbd { padding: 2px 5px; color: var(--ink); background: white; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 0 var(--border); }

.game-dialog { position: absolute; inset: 0; z-index: 20; display: grid; padding: 20px; background: rgba(32,32,54,.42); backdrop-filter: blur(6px); place-items: center; }
.game-dialog[hidden] { display: none; }
.game-dialog__card { width: min(440px, 100%); padding: 36px; background: var(--cream); border-radius: 28px; box-shadow: 0 30px 80px rgba(32,32,54,.25); }
.game-dialog__card h2 { margin: 0 0 18px; font-family: "Fredoka"; font-size: 2.2rem; }
.game-dialog__card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.dialog-button { margin-top: 10px; border: 0; cursor: pointer; }

.link-screen { position: fixed; inset: 0; z-index: 21; visibility: hidden; min-height: 100dvh; overflow-y: auto; color: var(--ink); background: #f3f7ff; opacity: 0; transform: translateY(25px); transition: opacity 220ms ease, transform 220ms ease, visibility 220ms; }
.link-screen.is-open { visibility: visible; opacity: 1; transform: none; }
.link-header { position: sticky; z-index: 10; top: 0; width: 100%; padding: 15px max(20px, calc((100% - 1180px) / 2)); background: rgba(243,247,255,.88); border-bottom: 1px solid rgba(32,32,54,.08); backdrop-filter: blur(12px); }
.link-main { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 70px; }
.link-mission { position: sticky; z-index: 9; top: calc(74px + env(safe-area-inset-top)); display: grid; grid-template-columns: minmax(110px,1fr) minmax(140px,1.2fr) minmax(110px,1fr); gap: 15px; align-items: center; padding: 20px 24px; color: white; background: var(--ink); border-radius: 24px; box-shadow: 0 13px 0 rgba(32,32,54,.1), 0 16px 28px rgba(32,32,54,.15); }
.mission-word { display: grid; gap: 3px; }
.mission-word span { color: rgba(255,255,255,.6); font-size: .67rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.mission-word strong { overflow: hidden; font-family: "Fredoka"; font-size: clamp(1.25rem,4vw,2rem); text-overflow: ellipsis; }
.mission-word--goal { text-align: right; }
.mission-word--goal strong { color: var(--gold); }
.mission-route { display: flex; gap: 8px; align-items: center; color: rgba(255,255,255,.62); font-size: .65rem; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.mission-route span { height: 1px; background: rgba(255,255,255,.25); flex: 1; }
.mission-route b { white-space: nowrap; }
.link-stats { display: flex; gap: 20px; align-items: center; margin: 22px 4px 12px; }
.link-stats p { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.link-stats strong { margin-left: 5px; color: var(--ink); font-family: "Fredoka"; font-size: 1.2rem; }
.link-stats button { margin-left: auto; padding: 8px 12px; color: var(--muted); background: white; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: .75rem; font-weight: 700; }
.word-path { display: flex; gap: 7px; padding: 5px 4px 17px; overflow-x: auto; }
.path-step { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.path-step:not(:last-child)::after { content: "→"; color: #a7a4b0; }
.path-step:last-child { color: var(--purple); }
.dictionary-card { position: relative; overflow: hidden; padding: clamp(26px,5vw,52px); background: white; border: 1px solid rgba(32,32,54,.1); border-radius: 30px; box-shadow: 0 24px 60px rgba(56,76,110,.12); }
.dictionary-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 7px; background: linear-gradient(90deg,var(--blue),var(--purple),var(--coral)); }
.dictionary-card.is-changing { animation: page-turn 300ms ease; }
.dictionary-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 25px; border-bottom: 1px solid var(--border); }
.dictionary-heading h1 { margin: 0; font-family: "Fredoka"; font-size: clamp(2.8rem,9vw,5.5rem); line-height: .9; letter-spacing: -.05em; text-transform: lowercase; }
.part-of-speech { padding: 7px 11px; color: var(--purple); background: #f0ebff; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.dictionary-content { display: grid; gap: 26px; padding-top: 27px; }
.dictionary-section h3 { margin: 0 0 9px; color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.definition-item { margin: 0 0 12px; font-family: "DM Sans"; font-size: clamp(1.05rem,2.4vw,1.3rem); line-height: 1.75; }
.definition-number { display: inline-grid; width: 24px; height: 24px; margin-right: 7px; color: white; background: var(--ink); border-radius: 50%; font-size: .68rem; font-weight: 700; vertical-align: 2px; place-items: center; }
.lex-link { display: inline; padding: 0 2px; color: #3d50a5; background: linear-gradient(transparent 76%,rgba(112,167,255,.32) 0); border: 0; cursor: pointer; font: inherit; font-weight: 600; transition: color 120ms ease, background 120ms ease; }
.lex-link:hover { color: var(--purple); background: rgba(109,74,255,.12); border-radius: 4px; }
.relation-list { display: flex; gap: 8px; flex-wrap: wrap; }
.relation-pill { min-height: 44px; padding: 9px 14px; color: #315b8f; background: #edf5ff; border: 1px solid #cfe2fa; border-radius: 999px; cursor: pointer; font-weight: 700; }
.relation-pill--antonym { color: #9c413b; background: #fff0ed; border-color: #ffd2cb; }
.example-item { margin: 0 0 8px; padding-left: 17px; color: var(--muted); border-left: 3px solid var(--gold); font-size: 1rem; font-style: italic; line-height: 1.65; }
.link-tip { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: .75rem; }
.link-dialog-card { border-top: 7px solid var(--blue); }
.link-win-icon { display: grid; width: 65px; height: 65px; margin-bottom: 15px; color: var(--ink); background: var(--gold); border-radius: 20px; font-size: 2rem; place-items: center; transform: rotate(-5deg); }
@keyframes page-turn { 0% { opacity: .6; transform: translateX(8px) scale(.99); } 100% { opacity: 1; transform: none; } }

.orbit-screen { position: fixed; inset: 0; z-index: 22; display: flex; visibility: hidden; min-height: 100dvh; flex-direction: column; overflow: hidden; color: var(--ink); background: #17172a; opacity: 0; transform: translateY(25px); transition: opacity 220ms ease, transform 220ms ease, visibility 220ms; }
.orbit-screen.is-open { visibility: visible; opacity: 1; transform: none; }
.orbit-header { width: 100%; padding: 14px max(18px,calc((100% - 1180px)/2)); color: white; background: rgba(23,23,42,.9); border-bottom: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(10px); }
.orbit-header .game-header__title p { color: rgba(255,255,255,.55); }
.orbit-header .icon-button { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.13); }
.orbit-main { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.orbit-hud { display: flex; gap: clamp(20px,7vw,80px); align-items: center; justify-content: center; min-height: 62px; color: rgba(255,255,255,.52); }
.orbit-hud div { display: flex; gap: 8px; align-items: baseline; }
.orbit-hud span { font-size: .63rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.orbit-hud strong { color: white; font-family: "Fredoka"; font-size: 1.25rem; }
.orbit-hud b { color: var(--gold); }
.orbit-stage { position: relative; min-height: 250px; overflow: hidden; flex: 1; background: radial-gradient(circle at center,rgba(109,74,255,.14),transparent 55%); }
#orbit-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.orbit-message { position: absolute; z-index: 2; top: 50%; left: 50%; padding: 12px 20px; color: var(--ink); background: var(--gold); border: 2px solid white; border-radius: 999px; font-family: "Fredoka"; font-size: clamp(1.3rem,5vw,2.2rem); opacity: 0; pointer-events: none; transform: translate(-50%,-35%) scale(.6); box-shadow: 0 8px 25px rgba(0,0,0,.3); }
.orbit-message.show { animation: orbit-word-pop 1.35s cubic-bezier(.2,1.2,.3,1) both; }
.orbit-message.bonus { color: white; background: var(--purple); border-color: #cfc2ff; font-size: clamp(1.15rem,4vw,1.85rem); }
.orbit-controls { display: flex; gap: 15px; justify-content: center; padding: 14px 18px 5px; }
.orbit-controls button { min-width: 165px; height: 55px; color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 18px; cursor: pointer; font-weight: 700; box-shadow: 0 5px 0 rgba(0,0,0,.25); touch-action: none; user-select: none; }
.orbit-controls button.is-held { color: var(--ink); background: var(--gold); border-color: var(--gold); transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.orbit-controls button.is-held span { color: var(--ink); }
.orbit-controls button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.orbit-controls span { margin: 0 10px; color: var(--gold); font-size: 1.4rem; }
.orbit-hint { color: rgba(255,255,255,.42); }
.orbit-dialog-card { color: var(--ink); border-top: 7px solid var(--gold); }
@keyframes orbit-word-pop { 0% { opacity: 0; transform: translate(-50%,-20%) scale(.45) rotate(-8deg); } 18%,72% { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0); } 100% { opacity: 0; transform: translate(-50%,-85%) scale(.9); } }

.ballet-screen { position: fixed; inset: 0; z-index: 23; display: flex; visibility: hidden; min-height: 100dvh; flex-direction: column; overflow: hidden; color: white; background: #130e1b; opacity: 0; transform: translateY(25px); transition: opacity 220ms ease, transform 220ms ease, visibility 220ms; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
.ballet-screen.is-open { visibility: visible; opacity: 1; transform: none; }
.ballet-header { width: 100%; padding: 12px max(18px,calc((100% - 1180px)/2)); color: white; background: rgba(19,14,27,.92); border-bottom: 1px solid rgba(255,255,255,.09); }
.ballet-header .game-header__title p { color: rgba(255,255,255,.55); }
.ballet-header .icon-button { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.game-header-actions { display: flex; gap: 8px; }
.ballet-header .icon-button.is-muted { color: rgba(255,255,255,.42); text-decoration: line-through; }
.ballet-main { display: grid; grid-template-rows: auto minmax(230px,1fr) auto auto; min-height: 0; flex: 1; }
.ballet-hud { display: flex; gap: clamp(24px,8vw,90px); align-items: center; justify-content: center; min-height: 54px; color: rgba(255,255,255,.55); }
.ballet-hud div { display: flex; gap: 7px; align-items: baseline; }
.ballet-hud span { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ballet-hud strong { color: white; font-family: "Fredoka"; font-size: 1.2rem; }
.ballet-hud .ballet-hearts { color: #ff7194; letter-spacing: .08em; }
.ballet-stage { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 35%,#563652 0,#241329 42%,#110c18 80%); touch-action: none; }
.ballet-song-title { position: absolute; z-index: 8; top: 14px; right: 72px; left: 72px; color: rgba(255,255,255,.72); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; text-shadow: 0 2px 12px rgba(0,0,0,.7); pointer-events: none; }
.stage-curtain { position: absolute; z-index: 3; top: 0; bottom: 0; width: 18%; pointer-events: none; background: repeating-linear-gradient(90deg,#4b1028 0,#7f2043 22%,#3b0b20 47%,#741c3d 72%,#3d0d23 100%); box-shadow: 0 0 28px rgba(0,0,0,.6); }
.stage-curtain--left { left: 0; border-radius: 0 0 80% 0; }
.stage-curtain--right { right: 0; border-radius: 0 0 0 80%; transform: scaleX(-1); }
.stage-spotlight { position: absolute; top: -12%; left: 50%; width: min(68vw,520px); height: 115%; background: linear-gradient(100deg,transparent 8%,rgba(255,238,207,.12) 46%,rgba(255,255,241,.25) 50%,rgba(255,238,207,.12) 54%,transparent 92%); clip-path: polygon(45% 0,55% 0,100% 100%,0 100%); opacity: calc(.72 + var(--music-pulse,0)*.28); transform: translateX(-50%); pointer-events: none; }
.stage-floor { position: absolute; right: 0; bottom: 0; left: 0; height: 18%; background: linear-gradient(#6b3d43,#2b1820); border-top: 2px solid rgba(255,220,187,.35); box-shadow: inset 0 12px 25px rgba(0,0,0,.35); }
.ballerina { position: absolute; z-index: 2; bottom: 5%; left: 50%; width: min(46vh,390px); aspect-ratio: 1; background-image: url("assets/bundo-ballet-poses-clean.png"); background-repeat: no-repeat; background-size: 300% 200%; mix-blend-mode: screen; transform: translateX(-50%); transform-origin: 50% 80%; pointer-events: none; }
.ballerina.pose-plie { background-position: 0 0; animation: ballet-plie 650ms ease both; }
.ballerina.pose-releve { background-position: 50% 0; animation: ballet-releve 700ms ease both; }
.ballerina.pose-pirouette { background-position: 100% 0; animation: ballet-pirouette 850ms cubic-bezier(.3,.8,.3,1) both; }
.ballerina.pose-arabesque { background-position: 0 100%; animation: ballet-arabesque 1050ms ease both; }
.ballerina.pose-jete { background-position: 50% 100%; animation: ballet-jete 800ms cubic-bezier(.2,.8,.25,1) both; }
.ballerina.pose-chasse { background-position: 100% 100%; animation: ballet-chasse 720ms ease both; }
.ballet-feedback { position: absolute; z-index: 6; top: 16%; left: 50%; color: var(--gold); font-family: "Fredoka"; font-size: clamp(1.5rem,7vw,2.7rem); opacity: 0; pointer-events: none; text-shadow: 0 4px 18px rgba(0,0,0,.6); transform: translate(-50%,12px) scale(.7); }
.ballet-feedback.show { animation: ballet-feedback 850ms ease both; }
.ballet-feedback.miss { color: var(--coral); }
.gesture-trail { position: absolute; z-index: 7; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.75); border-radius: 50%; opacity: 0; pointer-events: none; transform: translate(-50%,-50%); }
.gesture-trail.show { animation: touch-ring 500ms ease-out; }
.ballet-cue-panel { position: relative; width: 100%; margin: 8px 0 0; padding: 0; background: rgba(255,255,255,.055); border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.ballet-rhythm-track { position: relative; width: 100%; height: 82px; overflow: hidden; background: linear-gradient(90deg,rgba(109,74,255,.12),rgba(215,88,137,.14),rgba(109,74,255,.12)); }
.rhythm-guide { position: absolute; top: 50%; right: 0; left: 0; height: 4px; background: rgba(255,255,255,.13); transform: translateY(-50%); }
.rhythm-hit-zone { position: absolute; z-index: 4; top: 50%; left: 50%; display: grid; width: 62px; height: 62px; border: 4px solid var(--gold); border-radius: 50%; place-items: center; transform: translate(-50%,-50%); box-shadow: 0 0 0 7px rgba(255,201,92,.12),0 0 28px rgba(255,201,92,.25); }
.rhythm-hit-zone::before { content: ""; width: 7px; height: 7px; background: white; border-radius: 50%; box-shadow: 0 0 12px white; }
.rhythm-hit-zone span { position: absolute; top: -12px; bottom: -12px; left: 50%; width: 2px; background: rgba(255,255,255,.28); transform: translateX(-50%); }
.rhythm-notes { position: absolute; inset: 0; }
.rhythm-note { position: absolute; z-index: 3; top: 50%; display: grid; width: 46px; height: 46px; color: var(--ink); background: #fff4e2; border: 2px solid #eab64d; border-radius: 50%; font-family: "Fredoka"; font-size: 1.35rem; place-items: center; transform: translate(-50%,-50%); box-shadow: 0 5px 12px rgba(0,0,0,.35); }
.rhythm-note.is-current { background: white; border-width: 3px; }
.rhythm-note.is-hit { color: white; background: #78c995; border-color: #a9f0c4; transform: translate(-50%,-50%) scale(1.12); }
.rhythm-note.is-departing { z-index: 2; box-shadow: 0 0 0 5px rgba(120,201,149,.16),0 5px 12px rgba(0,0,0,.28); }
.rhythm-note--hold { border-color: #e66d9c; }
.rhythm-hold-tail { position: absolute; z-index: -1; top: 50%; left: 50%; width: var(--hold-tail-width,110px); height: 22px; overflow: hidden; background: rgba(146,93,205,.35); border: 2px solid rgba(255,255,255,.55); border-left: 0; border-radius: 0 999px 999px 0; transform: translateY(-50%); box-shadow: 12px 0 20px rgba(159,107,231,.3); }
.rhythm-hold-tail::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--hold-fill,0%); background: linear-gradient(90deg,#ff7eae,#b985ff); border-radius: inherit; box-shadow: 0 0 15px rgba(255,126,174,.65); }
.rhythm-note.is-holding { color: white; background: #d75889; border-color: white; box-shadow: 0 0 0 7px rgba(215,88,137,.2),0 5px 12px rgba(0,0,0,.35); }
.ballet-touch-hint { margin: 7px 0 calc(9px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.38); text-align: center; font-size: .65rem; }
.ballet-dialog-card { border-top: 7px solid #d75889; }
.ballet-move-key { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin: 15px 0; }
.ballet-move-key span { padding: 8px 10px; color: var(--ink); background: #f5ebff; border-radius: 9px; font-size: .76rem; font-weight: 700; }
@keyframes ballet-plie { 0%,100% { transform: translateX(-50%) translateY(0) scale(1); } 45% { transform: translateX(-50%) translateY(18px) scale(1.04,.94); } }
@keyframes ballet-releve { 0%,100% { transform: translateX(-50%) translateY(0); } 45% { transform: translateX(-50%) translateY(-19px) scale(.98,1.04); } }
@keyframes ballet-pirouette { 0% { transform: translateX(-50%) rotateY(0) scale(1); } 50% { transform: translateX(-50%) rotateY(540deg) scale(.93,1.03); } 100% { transform: translateX(-50%) rotateY(1080deg) scale(1); } }
@keyframes ballet-arabesque { 0%,100% { transform: translateX(-50%) rotate(0); } 35%,70% { transform: translateX(-50%) rotate(-3deg) translateY(-7px); } }
@keyframes ballet-jete { 0% { transform: translateX(-75%) translateY(18px) scale(.9); } 45% { transform: translateX(-50%) translateY(-38px) scale(1.08); } 100% { transform: translateX(-25%) translateY(0) scale(1); } }
@keyframes ballet-chasse { 0% { transform: translateX(-70%); } 30% { transform: translateX(-38%) translateY(-8px); } 60% { transform: translateX(-60%); } 100% { transform: translateX(-50%); } }
@keyframes ballet-feedback { 20%,65% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-25px) scale(.95); } }
@keyframes touch-ring { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.4); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(2); } }

@keyframes word-pop { 0% { opacity: 0; transform: translate(-50%,15px) scale(.8); } 20%,70% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-25px) scale(.95); } }
@keyframes short-word-pop { 0% { opacity: 0; transform: translate(-50%,8px) scale(.85); } 24%,62% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-12px) scale(.96); } }
@keyframes flash { 50% { opacity: .65; } }
@keyframes tile-land { 0% { transform: translateY(-16px) scale(1.07); filter: brightness(1.25); } 55% { transform: translateY(3px) scale(.96,1.06); } 100% { transform: none; filter: none; } }
@keyframes board-impact { 35% { transform: translateY(4px); } 70% { transform: translateY(-2px); } }
@keyframes board-celebrate { 25% { transform: scale(1.012) rotate(-.25deg); } 55% { transform: scale(.995) rotate(.2deg); } }
@keyframes score-pop { 45% { color: var(--purple); transform: scale(1.28) rotate(-3deg); } }
@keyframes chip-in { from { opacity: 0; transform: translateY(5px) scale(.8); } }
@keyframes burst { to { opacity: 0; transform: translate(var(--bit-x), var(--bit-y)) rotate(var(--bit-r)); } }
@keyframes londo-pop { 0% { opacity: 0; transform: translate(-50%,30px) scale(.35) rotate(-8deg); } 18% { opacity: 1; transform: translate(-50%,-5px) scale(1.14) rotate(2deg); } 30%,75% { opacity: 1; transform: translate(-50%,0) scale(1) rotate(-1deg); } 100% { opacity: 0; transform: translate(-50%,-45px) scale(.9); } }

.love-note {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto 110px;
  padding: 27px 40px;
  text-align: center;
  background: #f1ebff;
  border: 1px solid #dfd2ff;
  border-radius: 24px;
  transform: rotate(-1deg);
}

.love-note p {
  margin: 0;
}

.love-note__heart {
  color: var(--coral);
  font-size: 1.4rem;
}

.love-note__sparkle {
  color: var(--purple);
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 25px 0 35px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

footer p {
  margin: 0;
}

.domain-link {
  color: var(--purple);
  font-weight: 700;
}

.domain-link:hover {
  color: var(--purple-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes float {
  0%,
  100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-12px) rotate(7deg); }
}

@media (max-width: 850px) {
  .hero { min-height: 510px; padding-top: 90px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { display: grid; grid-template-columns: 0.85fr 1fr; }
  .game-card__art { min-height: 280px; }
  .game-card__body { min-height: 280px; }
  .fall-layout { grid-template-columns: 1fr; padding-inline: 12px; }
  .fall-panel--score { display: grid; grid-template-columns: auto auto 1fr; align-items: start; order: -1; text-align: center; }
  .used-words-list { justify-content: center; max-height: 55px; }
  .fall-panel--next { display: none; }
  .fall-board { --cell: min(4.3vh, 34px); width: min(100%, 560px); margin: auto; }
}

@media (max-width: 600px) {
  .site-header { width: min(100% - 28px, 1180px); }
  .sound-toggle__label { display: none; }
  .hero { min-height: 520px; padding: 100px 16px 75px; }
  .hero__doodle--left { top: 19%; left: 6%; }
  .hero__doodle--right { right: 4%; bottom: 3%; }
  .games-section { width: min(100% - 28px, 1180px); padding-top: 55px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .game-card { display: block; }
  .game-card__art { min-height: 210px; }
  .game-card__body { min-height: 240px; }
  .love-note { align-items: flex-start; padding: 24px 22px; }
  footer { gap: 10px; align-items: center; flex-direction: column; text-align: center; }
  .game-header { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px; }
  .icon-button { width: 48px; height: 48px; }
  .fall-layout { align-content: center; }
  .fall-panel--score { gap: 10px; }
  .fall-panel strong { font-size: 1.15rem; }
  .fall-panel--score span { font-size: .58rem; }
  .keyboard-hint { display: none; }
  .fall-controls { gap: 14px; padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); }
  .fall-controls button { min-width: 72px; height: 62px; border-radius: 20px; font-size: 1.55rem; }
  .fall-controls .drop-button { min-width: 150px; font-size: 1.05rem; }
  .link-header { padding-top: calc(10px + env(safe-area-inset-top)); }
  .link-main { width: min(100% - 20px,920px); padding-top: 16px; }
  .link-mission { top: calc(68px + env(safe-area-inset-top)); }
  .link-mission { grid-template-columns: 1fr auto 1fr; padding: 16px; }
  .mission-route b { display: none; }
  .dictionary-card { padding: 30px 21px; border-radius: 23px; }
  .dictionary-heading { align-items: flex-start; }
  .link-tip { padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
  .orbit-hud { gap: 18px; min-height: 54px; }
  .orbit-header { padding-top: calc(10px + env(safe-area-inset-top)); }
  .orbit-hud div { display: grid; gap: 1px; text-align: center; }
  .orbit-hud span { font-size: .52rem; }
  .orbit-controls { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .orbit-controls button { min-width: 0; height: 60px; flex: 1; }
  .orbit-hint { display: none; }
  .ballet-header { padding-top: calc(10px + env(safe-area-inset-top)); }
  .ballet-hud { min-height: 46px; gap: 20px; }
  .ballet-hud div { display: grid; gap: 0; text-align: center; }
  .ballet-hud span { font-size: .5rem; }
  .ballet-hud strong { font-size: 1rem; }
  .ballerina { width: min(58vw,39vh); bottom: 6%; }
  .ballet-rhythm-track { height: 76px; }
  .rhythm-hit-zone { width: 56px; height: 56px; }
  .rhythm-note { width: 43px; height: 43px; }
  .ballet-song-title { top: 10px; right: 58px; left: 58px; font-size: .64rem; }
  .ballet-touch-hint { margin-bottom: calc(13px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
