/* Shared arcade skin for Letter Rain and Word Rain. */
.arcade-page {
  --arcade-ink: #203252;
  --arcade-muted: #66758d;
  --arcade-line: #d8e8ef;
  --arcade-surface: #ffffff;
  --arcade-soft: #f5fbfd;
  --arcade-cream: #fff8e7;
  --arcade-pink: #f4517d;
  --arcade-pink-dark: #d83c68;
  --arcade-blue: #35aee0;
  --arcade-mint: #58c98e;
  --arcade-yellow: #ffc94f;
  background:
    linear-gradient(180deg, #eaf9ff 0 46%, #f3fff9 68%, #fff9e9 100%);
  color: var(--arcade-ink);
}

.arcade-page--words {
  --arcade-accent: #ef557a;
  --arcade-accent-dark: #b83f65;
  --arcade-accent-soft: #fff2f6;
}

.arcade-page--letters {
  --arcade-accent: #f4517d;
  --arcade-accent-dark: #c93a63;
  --arcade-accent-soft: #fff0f5;
}

.arcade-page::before,
.arcade-page::after {
  display: none;
}

.arcade-page .falling-shell,
.arcade-page .word-shell {
  align-items: start;
  background: transparent;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 304px;
  height: auto;
  margin: 0 auto;
  max-width: 1500px;
  min-height: 100vh;
  overflow: visible;
  padding: 12px;
}

.arcade-page .falling-main,
.arcade-page .word-main {
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto auto;
  min-width: 0;
}

.arcade-page .word-main {
  grid-template-rows: auto auto;
}

/* One clear banner, without a badge card floating over another card. */
.arcade-page .falling-hero {
  align-items: center;
  background: #dff7ff;
  border: 1px solid #c8e3ee;
  border-radius: 8px;
  box-shadow: 0 9px 24px rgba(49, 90, 119, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  height: 136px;
  min-height: 136px;
  overflow: hidden;
  padding: 12px 16px 12px 206px;
  position: relative;
}

.arcade-page--words .falling-hero {
  height: 116px;
  min-height: 116px;
}

.arcade-page .falling-hero::before {
  background:
    linear-gradient(90deg, transparent 0 31%, rgba(223, 247, 255, 0.14) 44%, #dff7ff 84%),
    image-set(
      url("assets/hero-candy-island.webp") type("image/webp"),
      url("assets/hero-candy-island.png") type("image/png")
    );
  background-position: left center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  border-radius: 0;
  display: block;
  inset: 0;
  opacity: 1;
  position: absolute;
  width: auto;
}

.arcade-page .falling-hero::after {
  background: linear-gradient(
    90deg,
    #ff6f91 0 20%,
    #ffc857 20% 40%,
    #61cf92 40% 60%,
    #43b9e8 60% 80%,
    #9a83e8 80% 100%
  );
  bottom: 0;
  height: 4px;
  left: 0;
  opacity: 1;
  right: 0;
}

.arcade-page .falling-hero > div:first-child {
  align-items: start;
  display: grid;
  justify-items: start;
  margin: 0;
  max-width: 590px;
  min-width: 0;
  padding: 0;
  position: relative;
  text-align: left;
  z-index: 1;
}

.arcade-page .falling-hero .eyebrow {
  color: var(--arcade-accent-dark);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.arcade-page .falling-hero h1 {
  color: var(--arcade-accent);
  font-size: clamp(32px, 3.3vw, 43px);
  line-height: 1;
  margin-top: 1px;
  text-shadow:
    0 2px 0 #ffffff,
    0 4px 0 rgba(255, 255, 255, 0.86),
    0 7px 12px rgba(44, 92, 123, 0.14);
}

.arcade-page .falling-hero .hero__copy {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #405473;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
  max-width: 520px;
  padding: 0;
  text-shadow: none;
}

.arcade-page .falling-hero .hero-back-link {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #cbe2ec;
  border-radius: 7px;
  box-shadow: none;
  color: #35617d;
  font-size: 11px;
  margin-top: 7px;
  min-height: 30px;
  padding: 0 10px;
}

.arcade-page .falling-hero .hero__badge {
  align-items: center;
  align-self: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: none;
  border: 1px solid #cfe4ed;
  border-radius: 999px;
  box-shadow: none;
  display: flex;
  gap: 9px;
  min-width: 0;
  padding: 7px 11px;
  position: relative;
  right: auto;
  text-align: left;
  top: auto;
  z-index: 1;
}

.arcade-page .falling-hero .hero__badge span {
  color: #607089;
  font-size: 10px;
}

.arcade-page .falling-hero .hero__badge strong {
  color: var(--arcade-accent-dark);
  font-size: 17px;
}

/* The stage owns the page. Everything above it is a compact control rail. */
.arcade-page .falling-game-panel,
.arcade-page .word-game-panel {
  background: var(--arcade-surface);
  backdrop-filter: none;
  border: 1px solid #cfe2eb;
  border-radius: 8px;
  box-shadow: 0 11px 28px rgba(49, 84, 111, 0.1);
  display: grid;
  gap: 0;
  grid-template-rows: auto auto auto minmax(300px, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.arcade-page .word-game-panel {
  grid-template-rows: auto auto auto auto;
}

.arcade-page .falling-game-panel::before,
.arcade-page .word-game-panel::before {
  display: none;
}

.arcade-page .falling-toolbar {
  align-items: center;
  background: #fbfdfe;
  border: 0;
  border-bottom: 1px solid var(--arcade-line);
  border-radius: 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 11px;
}

.arcade-page .mode-tabs,
.arcade-page .word-practice-tabs,
.arcade-page .word-session-tabs {
  background: #edf5f8;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 3px;
  max-height: 66px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px;
  scrollbar-width: thin;
}

.arcade-page .mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
}

.arcade-page .mode-tab,
.arcade-page .word-practice-tabs button,
.arcade-page .word-session-tabs button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: none;
  color: #506179;
  flex: 0 0 auto;
  font-size: 12px;
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.arcade-page .mode-tab.is-active,
.arcade-page .word-practice-tabs button.is-active,
.arcade-page .word-session-tabs button.is-active {
  background: var(--arcade-surface);
  border-color: #c9dfe9;
  box-shadow: 0 2px 6px rgba(50, 89, 115, 0.1);
  color: var(--arcade-accent-dark);
}

.arcade-page .word-setup {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.arcade-page .word-group-picker {
  align-items: center;
  background: #edf5f8;
  border-radius: 7px;
  display: flex;
  flex: 1 1 220px;
  gap: 7px;
  min-width: 190px;
  padding: 3px 4px 3px 9px;
}

.arcade-page .word-group-picker span {
  color: #6d7c90;
  font-size: 10px;
  font-weight: 800;
}

.arcade-page .word-group-picker select {
  background: #ffffff;
  border: 1px solid #c9dfe9;
  border-radius: 6px;
  color: #35536c;
  flex: 1;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  height: 32px;
  min-width: 0;
  padding: 0 7px;
}

.arcade-page .word-practice-tabs {
  display: grid;
  flex: 2 1 360px;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  max-width: 390px;
}

.arcade-page .word-session-tabs {
  background: #f7f2ea;
  display: grid;
  flex: 1 1 210px;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  max-height: 66px;
  min-width: 190px;
}

.arcade-page .word-session-tabs button.is-active {
  border-color: #efd7ac;
  color: #8d621c;
}

.arcade-page .falling-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.arcade-page .game-control {
  background: #ffffff;
  border: 1px solid #d1e2ea;
  border-radius: 7px;
  box-shadow: none;
  color: #53647c;
  font-size: 12px;
  gap: 5px;
  min-height: 34px;
  min-width: 66px;
  padding: 0 9px;
}

.arcade-page .game-control::before {
  background: transparent;
  border: 0;
  border-radius: 0;
  flex-basis: auto;
  font-size: 10px;
  height: auto;
  width: auto;
}

.arcade-page .game-control::after {
  display: none;
}

.arcade-page .game-control--start {
  background: var(--arcade-accent);
  border-color: var(--arcade-accent);
  color: #ffffff;
  text-shadow: none;
}

.arcade-page .game-control--start::before {
  color: #ffffff;
}

.arcade-page .game-control--pause {
  color: #2f6884;
}

.arcade-page .game-control--end {
  color: #b94b67;
}

.arcade-page .falling-stats {
  background: #ffffff;
  border-bottom: 1px solid var(--arcade-line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 10px;
}

.arcade-page .falling-stats div {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e6eff3;
  box-shadow: none;
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 47px;
  padding: 6px 10px;
}

.arcade-page .falling-stats div:last-child {
  border-right: 0;
}

.arcade-page .falling-stats span {
  color: #748198;
  font-size: 10px;
}

.arcade-page .falling-stats strong {
  color: #294460;
  font-size: 17px;
}

.arcade-page .quest-panel {
  align-items: center;
  background: var(--arcade-cream);
  border: 0;
  border-bottom: 1px solid #efdfb6;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) auto;
  min-height: 54px;
  padding: 7px 12px;
}

.arcade-page .quest-title {
  color: var(--arcade-accent-dark);
  font-size: 12px;
}

.arcade-page .quest-panel p {
  color: #6d7482;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 2px;
}

.arcade-page .candy-jar {
  background: #eceff1;
  border: 0;
  border-radius: 999px;
  height: 9px;
}

.arcade-page .candy-jar span {
  background: linear-gradient(90deg, var(--arcade-mint), var(--arcade-blue), var(--arcade-yellow), var(--arcade-pink));
}

.arcade-page .quest-meta {
  gap: 1px;
}

.arcade-page .quest-meta strong {
  color: var(--arcade-accent-dark);
  font-size: 16px;
}

.arcade-page .quest-meta span {
  color: #737d8e;
  font-size: 9px;
}

.arcade-page .falling-stage,
.arcade-page .word-stage {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.8) 0 20px, transparent 21px),
    radial-gradient(circle at 83% 22%, rgba(255, 255, 255, 0.7) 0 28px, transparent 29px),
    linear-gradient(180deg, #dff7ff 0%, #f2fcff 48%, #fff9e7 100%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 300px;
  overflow: hidden;
  position: relative;
}

/* Word Rain keeps the learning prompt inside the playfield, so the eye stays on one surface. */
.arcade-page--words .word-stage {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(159, 214, 233, 0.4);
  display: grid;
  grid-template-rows: auto minmax(230px, 31vh);
  min-height: 0;
  overflow: hidden;
}

.arcade-page--words .word-rain-arena {
  background:
    linear-gradient(90deg, rgba(232, 249, 255, 0.94) 0 55%, rgba(255, 251, 231, 0.76) 100%),
    #eefcff;
  min-height: 230px;
  overflow: hidden;
  position: relative;
}

.arcade-page--words .word-rain-arena .falling-layer {
  z-index: 2;
}

.arcade-page--words .word-rain-arena .catch-line {
  z-index: 3;
}

.arcade-page--words .quest-panel {
  background: linear-gradient(90deg, #edfbff, #fffdf5 62%, #fff4e5);
}

.arcade-page .falling-stage::before,
.arcade-page .word-stage::before {
  background:
    radial-gradient(ellipse at 18% 96%, rgba(89, 201, 142, 0.3) 0 58px, transparent 59px),
    radial-gradient(ellipse at 83% 96%, rgba(255, 201, 79, 0.26) 0 70px, transparent 71px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.arcade-page--words .word-stage::before {
  display: none;
}

.arcade-page--words .word-rain-arena::before {
  background-image: image-set(
    url("assets/map-candy-island.webp") type("image/webp"),
    url("assets/map-candy-island.png") type("image/png")
  );
  background-position: right 52%;
  background-repeat: no-repeat;
  background-size: auto 150%;
  filter: saturate(1.05);
  -webkit-mask-image: linear-gradient(90deg, transparent 0 54%, rgba(0, 0, 0, 0.42) 67%, #000 88%);
  mask-image: linear-gradient(90deg, transparent 0 54%, rgba(0, 0, 0, 0.42) 67%, #000 88%);
  opacity: 0.38;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

/* Letter Rain uses the island artwork as scenery, not another UI layer. */
.arcade-page--letters .falling-stage {
  background:
    linear-gradient(180deg, rgba(225, 248, 255, 0.86), rgba(242, 252, 255, 0.72) 52%, rgba(255, 249, 226, 0.76)),
    #e4f8ff;
  box-shadow: inset 0 0 0 1px rgba(156, 215, 239, 0.42);
  min-height: clamp(340px, 43vh, 460px);
}

.arcade-page--letters .falling-stage::before {
  background-image: image-set(
    url("assets/map-candy-island.webp") type("image/webp"),
    url("assets/map-candy-island.png") type("image/png")
  );
  background-position: right 44%;
  background-repeat: no-repeat;
  background-size: auto 142%;
  filter: saturate(1.08);
  -webkit-mask-image: linear-gradient(90deg, transparent 0 62%, rgba(0, 0, 0, 0.4) 72%, #000 90%);
  mask-image: linear-gradient(90deg, transparent 0 62%, rgba(0, 0, 0, 0.4) 72%, #000 90%);
  opacity: 0.45;
  z-index: 0;
}

.arcade-page--letters .falling-stage::after {
  background:
    linear-gradient(180deg, transparent 0 76%, rgba(255, 255, 255, 0.18) 77% 80%, transparent 81%),
    linear-gradient(90deg, rgba(87, 198, 135, 0.28), rgba(255, 201, 79, 0.18) 50%, rgba(244, 81, 125, 0.2));
  bottom: 0;
  content: "";
  height: 58px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 0;
}

.arcade-page--letters .falling-layer {
  z-index: 1;
}

.arcade-page .catch-line {
  background: repeating-linear-gradient(90deg, #f4517d 0 20px, #ffc94f 20px 40px, #35aee0 40px 60px, #58c98e 60px 80px);
  bottom: 54px;
  box-shadow: 0 2px 6px rgba(54, 98, 127, 0.12);
  height: 5px;
}

.arcade-page--letters .catch-line {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent),
    repeating-linear-gradient(90deg, #f4517d 0 24px, #ffc94f 24px 48px, #35aee0 48px 72px, #58c98e 72px 96px);
  box-shadow:
    0 3px 8px rgba(43, 91, 118, 0.16),
    0 0 0 3px rgba(255, 255, 255, 0.38);
  height: 7px;
}

.arcade-page .falling-letter,
.arcade-page .word-falling-letter {
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.65),
    0 7px 13px rgba(73, 91, 113, 0.15);
}

.arcade-page--letters .falling-letter {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94) 0 8%, transparent 9%),
    linear-gradient(180deg, #ff86a6, #ef4b7b);
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(145, 39, 77, 0.22);
}

.arcade-page--letters .falling-letter:nth-child(3n + 2) {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94) 0 8%, transparent 9%),
    linear-gradient(180deg, #74d5f4, #2ea7dc);
  text-shadow: 0 2px 0 rgba(31, 100, 133, 0.22);
}

.arcade-page--letters .falling-letter:nth-child(3n + 3) {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94) 0 8%, transparent 9%),
    linear-gradient(180deg, #ffe47f, #f5ba36);
  color: #704b12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
}

.arcade-page--words .word-falling-letter:not(.is-distractor) {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.95) 0 8%, transparent 9%),
    linear-gradient(180deg, #69d5ee, #259bcf);
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(29, 91, 124, 0.24);
}

.arcade-page--words .word-falling-letter.is-distractor {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94) 0 8%, transparent 9%),
    linear-gradient(180deg, #ffb2c7, #f06f98);
  color: #ffffff;
  opacity: 0.82;
  text-shadow: 0 2px 0 rgba(135, 47, 78, 0.18);
}

.arcade-page .game-overlay {
  background: rgba(246, 252, 255, 0.9);
  backdrop-filter: none;
  gap: 5px;
}

.arcade-page--letters .game-overlay {
  background: linear-gradient(90deg, rgba(247, 253, 255, 0.86) 0 46%, rgba(247, 253, 255, 0.58) 62%, rgba(247, 253, 255, 0.24) 100%);
  padding-right: 34%;
}

.arcade-page--words .word-rain-arena .game-overlay {
  background: linear-gradient(90deg, rgba(246, 252, 255, 0.9) 0 48%, rgba(246, 252, 255, 0.58) 64%, rgba(246, 252, 255, 0.22) 100%);
  padding-right: 30%;
}

.arcade-page .game-overlay strong {
  color: var(--arcade-accent-dark);
  font-size: 24px;
}

.arcade-page .game-overlay span {
  color: #64738a;
  font-size: 12px;
}

/* Keep the learning prompt in document flow so it cannot cover the playfield. */
.arcade-page .word-target-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.91);
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(191, 221, 233, 0.86);
  box-shadow: none;
  display: grid;
  gap: 10px;
  grid-template-areas:
    "identity meaning slots sound"
    "identity meaning answer sound";
  grid-template-columns: minmax(160px, 0.75fr) minmax(180px, 1fr) minmax(260px, 1.35fr) 108px;
  min-height: 104px;
  padding: 12px 14px;
  position: relative;
  z-index: 4;
}

.arcade-page .word-target-card div:first-child {
  display: grid;
  gap: 1px;
  grid-area: identity;
}

.arcade-page .word-target-card span,
.arcade-page .word-target-card em,
.arcade-page .word-target-card p {
  color: #6c798c;
  font-size: 10px;
}

.arcade-page .word-target-card strong {
  color: var(--arcade-accent-dark);
  font-size: 25px;
}

.arcade-page .word-target-card strong.is-hidden-word {
  color: #d64e75;
  font-size: 16px;
}

.arcade-page .word-target-card p {
  grid-area: meaning;
  line-height: 1.35;
  margin: 0;
  max-width: 30ch;
}

.arcade-page .word-letter-slots {
  display: grid;
  gap: 4px;
  grid-area: slots;
  grid-template-columns: repeat(var(--slot-count, 1), minmax(18px, 30px));
  max-width: 100%;
}

.arcade-page .word-answer-field {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-area: answer;
  min-width: 0;
}

.arcade-page .word-answer-field span {
  color: #748198;
  font-size: 9px;
  font-weight: 800;
}

.arcade-page .word-answer-field input {
  background: transparent;
  border: 0;
  border-bottom: 2px solid #b9d9e6;
  border-radius: 0;
  color: #234963;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  height: 32px;
  letter-spacing: 0;
  min-width: 0;
  outline: 0;
  padding: 0 2px;
  width: 100%;
}

.arcade-page .word-answer-field input:focus {
  border-bottom-color: var(--arcade-accent);
  box-shadow: 0 3px 0 rgba(239, 85, 122, 0.12);
}

.arcade-page .word-answer-field input.is-wrong {
  border-bottom-color: #e26464;
  color: #b83f4d;
}

.arcade-page .word-letter-slots span {
  background: var(--arcade-soft);
  border: 1px solid #cfdee6;
  border-radius: 6px;
  box-shadow: none;
  font-size: 14px;
  height: 32px;
  min-width: 0;
  width: 100%;
}

.arcade-page .word-letter-slots span.is-current {
  border-color: var(--arcade-yellow);
  box-shadow: 0 0 0 3px rgba(255, 201, 79, 0.2);
}

.arcade-page .word-letter-slots span.is-filled {
  background: #eafaf2;
  border-color: #83d7ac;
  color: #287957;
}

.arcade-page .word-sound-button {
  background: var(--arcade-blue);
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  color: #ffffff;
  font-size: 11px;
  min-height: 34px;
  min-width: 96px;
  grid-area: sound;
}

.arcade-page .word-result-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  max-height: 170px;
  max-width: 660px;
  overflow: auto;
  width: min(100%, 660px);
}

.arcade-page .word-result-list:empty {
  display: none;
}

.arcade-page .word-result-list > div {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid #dce9ee;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1.4fr) auto;
  padding: 5px 7px;
}

.arcade-page .word-result-list strong {
  color: #244d67;
  font-size: 14px;
}

.arcade-page .word-result-list span,
.arcade-page .word-result-list em {
  font-size: 10px;
  font-style: normal;
}

.arcade-page .word-result-list em.is-mastered {
  color: #24865a;
}

.arcade-page .word-result-list em.is-review {
  color: #c84966;
}

.arcade-page .word-review-button,
.arcade-page .word-review-entry {
  background: #fff4e3;
  border: 1px solid #efd29d;
  border-radius: 7px;
  color: #825c1b;
  font-size: 11px;
  min-height: 34px;
  padding: 0 12px;
}

.arcade-page .word-review-button[hidden] {
  display: none !important;
}

.arcade-page .word-review-button {
  margin-top: 8px;
}

.arcade-page .word-review-entry:disabled {
  color: #8793a4;
  opacity: 0.7;
}

.arcade-page .word-learning-summary {
  min-height: 112px;
}

.arcade-page .word-learning-summary p {
  overflow-wrap: anywhere;
}

.arcade-page .daily-plan {
  display: grid;
  gap: 10px;
}

.arcade-page .daily-plan__heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.arcade-page .daily-plan__heading > span {
  color: #8b6b28;
  font-size: 10px;
  font-weight: 900;
}

.arcade-page .daily-plan__field {
  display: grid;
  gap: 4px;
}

.arcade-page .daily-plan__field > span {
  color: #6c7a8d;
  font-size: 9px;
  font-weight: 800;
}

.arcade-page .daily-plan__field select {
  background: #f7fbfd;
  border: 1px solid #d3e4eb;
  border-radius: 6px;
  color: #294d67;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  height: 34px;
  min-width: 0;
  padding: 0 7px;
  width: 100%;
}

.arcade-page .daily-plan__progress {
  display: grid;
  gap: 5px;
}

.arcade-page .daily-plan__progress > div:first-child {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.arcade-page .daily-plan__progress span {
  color: #6c7a8d;
  font-size: 10px;
  font-weight: 800;
}

.arcade-page .daily-plan__progress strong {
  color: var(--arcade-accent-dark);
  font-size: 16px;
}

.arcade-page .daily-plan__bar {
  background: #e7eff2;
  height: 8px;
  overflow: hidden;
}

.arcade-page .daily-plan__bar span {
  background: linear-gradient(90deg, #55c892, #36b3dc, #ffc958);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.arcade-page .daily-plan__progress p {
  font-size: 10px;
  margin: 0;
}

.arcade-page .daily-plan__start {
  background: var(--arcade-accent);
  border: 1px solid var(--arcade-accent);
  border-radius: 7px;
  box-shadow: none;
  color: #ffffff;
  font-size: 12px;
  min-height: 38px;
  width: 100%;
}

.arcade-page .falling-keyboard-panel {
  background: #ffffff;
  border: 1px solid #cfe2eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(49, 84, 111, 0.08);
  min-height: 154px;
  padding: 10px;
}

.arcade-page .falling-keyboard-panel::before,
.arcade-page .falling-keyboard-panel .keyboard::before {
  display: none;
}

.arcade-page .falling-keyboard-panel .keyboard {
  gap: 5px;
}

.arcade-page .falling-keyboard-panel .key-row {
  gap: 5px;
}

.arcade-page .falling-keyboard-panel .key-row--home {
  padding-left: 34px;
}

.arcade-page .falling-keyboard-panel .key-row--bottom {
  padding-left: 68px;
}

.arcade-page .falling-keyboard-panel .key {
  border-radius: 6px;
  box-shadow:
    0 3px 0 rgba(125, 150, 166, 0.22),
    inset 0 1px 0 #ffffff;
  font-size: 14px;
  height: 27px;
  min-height: 27px;
  min-width: clamp(34px, 4vw, 50px);
  padding: 0 5px;
}

.arcade-page--letters .falling-keyboard-panel {
  background: linear-gradient(180deg, #ffffff, #fffaf0);
  border-color: #eddcb3;
}

.arcade-page--letters .falling-keyboard-panel .key:not(:disabled) {
  background: linear-gradient(180deg, #fff8b8, #ffd85f);
  border-color: #e7bd4c;
  box-shadow:
    0 3px 0 rgba(190, 132, 25, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #674515;
}

.arcade-page--letters .falling-keyboard-panel .key:disabled {
  filter: grayscale(0.45);
  opacity: 0.42;
}

.arcade-page--letters .falling-keyboard-panel .key.is-target {
  background: linear-gradient(180deg, #98e8ff, #35afe2) !important;
  border-color: #2498c8 !important;
  box-shadow:
    0 0 0 4px rgba(53, 175, 226, 0.2),
    0 3px 0 rgba(30, 116, 153, 0.35) !important;
  color: #ffffff !important;
}

.arcade-page--letters .quest-panel {
  background: linear-gradient(90deg, #fff8e6, #fffdf7 58%, #fff5e9);
}

.arcade-page--letters .candy-jar {
  height: 11px;
}

/* One helper surface with separators, instead of stacked floating cards. */
.arcade-page .falling-side {
  align-content: start;
  background: #ffffff;
  border: 1px solid #cfe2eb;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(49, 84, 111, 0.09);
  display: grid;
  gap: 0;
  grid-template-rows: auto auto auto auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: sticky;
  top: 12px;
}

.arcade-page .falling-side .score-strip {
  background: #fbfdfe;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  padding: 0;
  order: 0;
}

.arcade-page .falling-side .score-strip div {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e7eff3;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  min-height: 54px;
  padding: 7px 12px;
  text-align: left;
}

.arcade-page .falling-side .score-strip div::before {
  height: 28px;
  width: 28px;
}

.arcade-page .falling-side .score-strip span {
  color: #68778d;
  font-size: 11px;
}

.arcade-page .falling-side .score-strip strong {
  color: #2c4863;
  font-size: 17px;
}

.arcade-page .falling-side .tips {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e4edf2;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 14px;
}

.arcade-page .falling-side .tips:last-child {
  border-bottom: 0;
}

.arcade-page .falling-side .tips h2 {
  color: var(--arcade-accent-dark);
  font-size: 15px;
}

.arcade-page .falling-side .tips h2::before {
  background: var(--arcade-accent);
  height: 14px;
  width: 4px;
}

.arcade-page .falling-side .tips p {
  color: #5e6d82;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.65;
  margin-top: 8px;
}

.arcade-page .falling-side .page-link {
  background: var(--arcade-soft);
  border: 1px solid #d5e6ed;
  border-radius: 7px;
  box-shadow: none;
  color: #35617d;
  font-size: 11px;
  margin-top: 10px;
  min-height: 34px;
  width: 100%;
}

.arcade-page button,
.arcade-page .page-link {
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .arcade-page button:hover:not(:disabled),
  .arcade-page .page-link:hover {
    border-color: #9fcbdc;
    box-shadow: 0 4px 10px rgba(47, 84, 109, 0.11);
    transform: none;
  }
}

@media (max-width: 1050px) {
  .arcade-page .falling-shell,
  .arcade-page .word-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .arcade-page .falling-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    position: static;
  }

  .arcade-page .falling-side .score-strip,
  .arcade-page .falling-side .tips {
    border-bottom: 0;
    border-right: 1px solid #e4edf2;
  }

  .arcade-page .falling-side .tips:last-child {
    border-right: 0;
  }

  .arcade-page .falling-side > :nth-child(even) {
    border-right: 0;
  }
}

@media (max-width: 1220px) and (min-width: 721px) {
  .arcade-page .falling-toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arcade-page .word-group-picker {
    flex-basis: 210px;
  }

  .arcade-page .word-practice-tabs {
    max-width: none;
  }

  .arcade-page .word-session-tabs {
    max-width: none;
  }

  .arcade-page .word-target-card {
    grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(230px, 1.25fr) 96px;
  }
}

@media (max-width: 720px) {
  .arcade-page .falling-shell,
  .arcade-page .word-shell {
    padding: 8px;
  }

  .arcade-page .falling-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: 210px;
    min-height: 210px;
    padding: 16px;
  }

  .arcade-page--words .falling-hero {
    height: 164px;
    min-height: 164px;
  }

  .arcade-page .falling-hero::before {
    background:
      linear-gradient(90deg, rgba(223, 247, 255, 0.12), rgba(223, 247, 255, 0.86) 58%, #dff7ff 100%),
      image-set(
        url("assets/hero-candy-island.webp") type("image/webp"),
        url("assets/hero-candy-island.png") type("image/png")
      );
    background-position: 15% center;
    background-size: auto 100%;
  }

  .arcade-page .falling-hero > div:first-child {
    justify-self: end;
    max-width: 68%;
    text-align: right;
  }

  .arcade-page .falling-hero h1 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .arcade-page .falling-hero .hero__copy {
    font-size: 10px;
  }

  .arcade-page .falling-hero .hero-back-link {
    justify-self: end;
  }

  .arcade-page .falling-hero .hero__badge {
    bottom: 14px;
    left: auto;
    position: absolute;
    right: 14px;
    top: auto;
  }

  .arcade-page .falling-toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .arcade-page .word-setup {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .arcade-page .word-group-picker {
    flex-basis: auto;
    width: 100%;
  }

  .arcade-page .word-practice-tabs {
    max-width: none;
    width: 100%;
  }

  .arcade-page .word-session-tabs {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .arcade-page .mode-tabs {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
  }

  .arcade-page .falling-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arcade-page .game-control {
    min-width: 0;
  }

  .arcade-page .falling-stats {
    padding: 0 4px;
  }

  .arcade-page .falling-stats div {
    display: grid;
    gap: 1px;
    min-height: 48px;
    padding: 5px 3px;
  }

  .arcade-page .quest-panel {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arcade-page .quest-panel .candy-jar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .arcade-page .quest-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .arcade-page .falling-stage,
  .arcade-page .word-stage {
    min-height: 320px;
  }

  .arcade-page--words .word-stage {
    grid-template-rows: auto minmax(250px, 38vh);
    min-height: 0;
  }

  .arcade-page--words .game-overlay {
    padding-right: 18%;
  }

  .arcade-page--letters .game-overlay {
    padding-right: 24%;
  }

  .arcade-page .word-target-card {
    grid-template-areas:
      "identity sound"
      "meaning meaning"
      "slots slots"
      "answer answer";
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 184px;
  }

  .arcade-page .word-target-card p,
  .arcade-page .word-letter-slots,
  .arcade-page .word-answer-field {
    grid-column: 1 / -1;
  }

  .arcade-page .word-target-card div:first-child {
    grid-area: identity;
  }

  .arcade-page .word-target-card p {
    grid-area: meaning;
  }

  .arcade-page .word-letter-slots {
    grid-area: slots;
  }

  .arcade-page .word-answer-field {
    grid-area: answer;
  }

  .arcade-page .word-letter-slots span {
    height: 28px;
  }

  .arcade-page .word-letter-slots {
    gap: 2px;
    grid-template-columns: repeat(var(--slot-count, 1), minmax(0, 1fr));
    width: 100%;
  }

  .arcade-page .word-sound-button {
    grid-area: sound;
  }

  .arcade-page .word-result-list > div {
    grid-template-columns: minmax(72px, 0.7fr) minmax(100px, 1.2fr) auto;
  }

  .arcade-page .falling-keyboard-panel {
    overflow: hidden;
    padding-left: 5px;
    padding-right: 5px;
  }

  .arcade-page .falling-keyboard-panel .keyboard {
    gap: 3px;
    min-width: 0;
  }

  .arcade-page .falling-keyboard-panel .key-row {
    gap: 2px;
  }

  .arcade-page .falling-keyboard-panel .key-row--home {
    padding-left: 10px;
  }

  .arcade-page .falling-keyboard-panel .key-row--bottom {
    padding-left: 20px;
  }

  .arcade-page .falling-keyboard-panel .key {
    font-size: 12px;
    min-width: 28px;
    padding: 0 2px;
  }

  .arcade-page .falling-keyboard-panel .key--wide {
    min-width: min(62vw, 220px);
  }

  .arcade-page .falling-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .arcade-page .falling-side .score-strip,
  .arcade-page .falling-side .tips {
    border-bottom: 1px solid #e4edf2;
    border-right: 0;
  }

  .arcade-page .falling-side .tips:last-child {
    border-bottom: 0;
  }
}

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