:root {
  --game-navy: #173766;
  --game-navy-light: #2d5f9b;
  --game-gold: #f2b83f;
  --game-gold-dark: #c87916;
  --game-cream: #fffaf0;
  --game-ink: #24344d;
  --game-muted: #66758d;
  --game-green: #2f9b61;
  --game-red: #d94a4a;
  --game-blue: #2f7ed8;
  --game-purple: #8557c7;
  --game-hud-height: 92px;
  --game-shadow: 0 20px 55px rgba(23, 55, 102, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body.game-body {
  margin: 0;
  overflow: hidden;
  color: var(--game-ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 220, 126, 0.38), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(123, 201, 255, 0.34), transparent 28%),
    linear-gradient(180deg, #dff2ff 0%, #f7fbff 48%, #e6f3dc 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.game-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.noscript-message {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1000;
  width: min(90vw, 480px);
  margin: 0;
  padding: 24px;
  transform: translate(-50%, -50%);
  border-radius: 24px;
  background: white;
  text-align: center;
  font-weight: 800;
  box-shadow: var(--game-shadow);
}

.asset-sprite {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  vertical-align: middle;
}

.asset-sprite > img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.game-hud {
  position: fixed;
  inset: 0 0 auto;
  z-index: 400;
  height: var(--game-hud-height);
  padding: 10px clamp(14px, 2.4vw, 34px);
  border-bottom: 3px solid rgba(242, 184, 63, 0.72);
  background: rgba(255, 252, 242, 0.94);
  box-shadow: 0 10px 30px rgba(23, 55, 102, 0.12);
  backdrop-filter: blur(14px);
}

.game-hud__bar,
.game-hud > header {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  height: 100%;
}

.game-title-block {
  display: grid;
  justify-self: start;
  line-height: 1.1;
}

.game-title-block strong {
  color: var(--game-navy);
  font-size: clamp(0.92rem, 1.55vw, 1.22rem);
  font-weight: 900;
}

.game-title-block small {
  margin-top: 4px;
  color: var(--game-gold-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.game-title-mark {
  margin-bottom: 4px;
  color: var(--game-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stage-progress__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 12px 5px 6px;
  border: 2px solid #d9e0ea;
  border-radius: 999px;
  color: #7a8799;
  background: #f5f7fa;
  font-size: 0.76rem;
  font-weight: 800;
  transition: 240ms ease;
}

.stage-progress__number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: white;
  background: #9aa7b8;
  font-size: 0.72rem;
}

.stage-progress__state {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 0.8rem;
}

.stage-progress__item[data-status="available"] {
  border-color: var(--game-gold);
  color: var(--game-navy);
  background: #fff4d3;
}

.stage-progress__item[data-status="available"] .stage-progress__number {
  color: var(--game-navy);
  background: var(--game-gold);
}

.stage-progress__item[data-status="complete"] {
  border-color: #60bf83;
  color: #226944;
  background: #e6f8ec;
}

.stage-progress__item[data-status="complete"] .stage-progress__number {
  background: var(--game-green);
}

.stage-progress__arrow {
  color: #9ba7b7;
  font-weight: 900;
}

.hud-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.star-counter,
.hud-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid #d7dfeb;
  border-radius: 15px;
  color: var(--game-navy);
  background: white;
  box-shadow: 0 5px 14px rgba(23, 55, 102, 0.09);
}

.star-counter {
  gap: 3px;
  padding: 0 11px;
  color: #d99218;
}

.star-counter > span {
  font-size: 1.25rem;
}

.star-counter strong {
  color: var(--game-navy);
  font-size: 0.95rem;
}

.star-counter small {
  color: var(--game-muted);
  font-size: 0.68rem;
}

.hud-button {
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hud-button .material-symbols-rounded {
  font-size: 1.35rem;
}

.hud-button:hover {
  transform: translateY(-2px);
  border-color: var(--game-gold);
  background: #fff8e8;
}

.hud-button[aria-pressed="true"] {
  color: white;
  border-color: var(--game-navy-light);
  background: var(--game-navy-light);
}

.hud-button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.map-zone:focus-visible,
.stone-piece:focus-visible,
.paint-source:focus-visible,
.mixing-pot:focus-visible,
.answer-form input:focus-visible {
  outline: 4px solid rgba(47, 126, 216, 0.34);
  outline-offset: 3px;
}

kingdom-map {
  position: fixed;
  inset: var(--game-hud-height) 0 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 14px clamp(14px, 2.2vw, 34px) 70px;
}

.palace-map {
  width: min(100%, calc((100dvh - var(--game-hud-height) - 90px) * 1.326), 1193px);
  max-width: 100%;
  aspect-ratio: 968 / 730;
}

.map-visual {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 968 / 730;
  overflow: hidden;
  border: 6px solid #f3d58f;
  border-radius: 32px;
  background: linear-gradient(180deg, #bfe6fb 0%, #dcf2ff 30%, #cfe8b8 31%, #a8d18f 62%, #7fb873 100%);
  box-shadow: var(--game-shadow), inset 0 0 0 3px rgba(255, 255, 255, 0.65);
  isolation: isolate;
}

.map-image,
.map-color-layer {
  display: none;
}

.map-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34%;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(180deg, #7cc4f2 0%, #bfe6fb 70%, #dcf2ff 100%);
}

.map-mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 82%;
  object-fit: cover;
  object-position: bottom center;
  user-select: none;
  pointer-events: none;
}

.map-mountains--gray {
  opacity: 1;
  transition: opacity 900ms ease;
}

.map-mountains--color {
  opacity: 0;
  transition: opacity 900ms ease;
}

.map-visual.is-restored .map-mountains--color {
  opacity: 1;
}

.map-visual.is-restored .map-mountains--gray {
  opacity: 0;
}

.map-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68%;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.35), transparent 60%),
    linear-gradient(180deg, #c9e7a8 0%, #a4d18c 35%, #82bd74 70%, #6aa862 100%);
  transition: filter 900ms ease;
}

.map-visual:not(.is-restored) .map-ground {
  filter: grayscale(0.55) brightness(0.94);
}

.map-world {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.map-location {
  position: absolute;
}

.map-location--gate {
  left: 3%;
  top: 30%;
  width: 30%;
}

.map-location--bridge {
  left: 4%;
  bottom: 5%;
  width: 38%;
}

.map-location--garden {
  right: 3%;
  top: 34%;
  width: 34%;
}

.world-tree {
  position: absolute;
  filter: drop-shadow(0 6px 6px rgba(23,55,102,0.2));
  transition: filter 800ms ease;
}

.world-tree--a {
  left: 1%;
  bottom: 30%;
  width: 13%;
}

.world-tree--b {
  right: 1%;
  bottom: 8%;
  width: 11%;
}

.map-visual:not(.is-restored) .world-tree {
  filter: grayscale(1) brightness(0.92);
}

.map-visual.is-restored .world-tree {
  filter: sepia(0.35) hue-rotate(60deg) saturate(1.9) brightness(1.02);
}

.map-location img.world-art {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  transition: opacity 700ms ease, filter 700ms ease;
}

.map-location--gate [data-gate-gray],
.map-location--gate [data-gate-color] {
  width: 100%;
}

.map-location--gate [data-gate-color] {
  position: absolute;
  top: 0;
  left: 0;
}

.map-visual[data-stage1="done"] [data-gate-gray] {
  opacity: 0;
}

.map-visual[data-stage1="todo"] [data-gate-color] {
  opacity: 0;
}

.map-visual[data-stage1="todo"] [data-gate-gray] {
  filter: grayscale(0.4) brightness(0.94);
}

.world-lock {
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 22%;
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 6px rgba(23,30,43,0.35));
  transition: transform 300ms ease, opacity 300ms ease;
}

.map-visual[data-stage1="done"] .world-lock {
  width: 18%;
  opacity: 0.95;
  transform: translateX(-50%) rotate(-8deg);
}

.map-location--bridge {
  left: 3%;
  bottom: 4%;
  width: 42%;
  display: flex;
  align-items: flex-end;
  gap: 2%;
}

.map-location--bridge .pair {
  position: relative;
  display: block;
}

.map-location--bridge .pair--bridge {
  flex: 0 0 56%;
}

.map-location--bridge .pair--fountain {
  flex: 0 0 42%;
}

.map-location--bridge .pair .world-art--color,
.map-location--bridge .pair .world-art--fountain-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-location--bridge [data-bridge-color] {
  filter: saturate(1.5) brightness(1.04) drop-shadow(0 0 10px rgba(255, 220, 105, 0.55));
}

.map-visual[data-stage2="done"] [data-bridge-gray] {
  opacity: 0;
}

.map-visual[data-stage2="todo"] [data-bridge-color] {
  opacity: 0;
}

.map-visual[data-stage2="done"] [data-fountain-gray] {
  opacity: 0;
}

.map-visual[data-stage2="todo"] [data-fountain-color] {
  opacity: 0;
}

.map-location--bridge [data-fountain-color] {
  filter: drop-shadow(0 0 12px rgba(123, 201, 255, 0.65));
}

.map-visual[data-stage2="todo"] [data-bridge-gray],
.map-visual[data-stage2="todo"] [data-fountain-gray] {
  filter: grayscale(0.5) brightness(0.93);
}

.map-location--garden [data-garden-gray],
.map-location--garden [data-garden-color] {
  width: 100%;
}

.map-location--garden [data-garden-color] {
  position: absolute;
  top: 0;
  left: 0;
}

.map-location--garden [data-flowerbed] {
  width: 92%;
  margin: -4% auto 0;
  opacity: 0.95;
}

.map-visual[data-stage3="done"] [data-garden-gray] {
  opacity: 0;
}

.map-visual[data-stage3="todo"] [data-garden-color] {
  opacity: 0;
}

.map-visual[data-stage3="todo"] [data-garden-gray] {
  filter: grayscale(0.35) brightness(0.95);
}

.map-visual[data-stage3="todo"] [data-flowerbed] {
  filter: grayscale(1) brightness(0.92);
  opacity: 0.55;
}

.map-shade {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(17, 40, 73, 0.06), transparent 30%, transparent 68%, rgba(17, 40, 73, 0.12)),
    radial-gradient(circle at 50% 45%, transparent 55%, rgba(26, 58, 107, 0.14));
}

.map-zone {
  position: absolute;
  z-index: 8;
  display: block;
  border: 0;
  border-radius: 24px;
  outline: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 250ms ease;
}

.map-zone::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 4px solid transparent;
  border-radius: 28px;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.map-zone:hover,
.map-zone:focus-visible {
  transform: translateY(-3px);
}

.map-zone[data-status="available"]::before {
  border-color: rgba(255, 231, 141, 0.88);
  box-shadow: 0 0 0 7px rgba(255, 220, 105, 0.2), inset 0 0 28px rgba(255, 240, 177, 0.16);
  animation: mapPulse 2.2s ease-in-out infinite;
}

.map-zone[data-status="complete"]::before {
  border-color: rgba(100, 218, 144, 0.55);
  box-shadow: 0 0 0 3px rgba(76, 202, 125, 0.12);
}

.map-zone[data-status="locked"] {
  filter: grayscale(0.7) brightness(0.8);
}

.map-zone--gate {
  left: 2%;
  top: 28%;
  width: 32%;
  height: 32%;
}

.map-zone--bridge {
  left: 3%;
  bottom: 2%;
  top: auto;
  width: 40%;
  height: 34%;
}

.map-zone--garden {
  right: 2%;
  left: auto;
  top: 32%;
  width: 36%;
  height: 60%;
}

.map-zone__number {
  position: absolute;
  top: 7%;
  left: 8%;
  display: grid;
  place-items: center;
  width: clamp(30px, 3vw, 44px);
  height: clamp(30px, 3vw, 44px);
  border: 3px solid white;
  border-radius: 50%;
  color: var(--game-navy);
  background: var(--game-gold);
  box-shadow: 0 5px 12px rgba(23, 55, 102, 0.25);
  font-size: clamp(0.78rem, 1.2vw, 1rem);
  font-weight: 900;
}

.map-zone__label,
.map-zone__status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 900;
}

.map-zone__label {
  bottom: 11%;
  padding: 8px 15px;
  border: 3px solid white;
  border-radius: 999px;
  color: var(--game-navy);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 18px rgba(23, 55, 102, 0.2);
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
}

.map-zone__status {
  bottom: 2%;
  padding: 3px 9px;
  border-radius: 999px;
  color: white;
  background: rgba(23, 55, 102, 0.8);
  font-size: clamp(0.58rem, 0.8vw, 0.72rem);
}

.map-zone[data-status="complete"] .map-zone__status {
  background: var(--game-green);
}

.map-zone__lock {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(48px, 6vw, 86px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 7px rgba(23, 30, 43, 0.35));
}

.map-lock-sprite {
  display: block;
  width: 100%;
  height: auto;
}

.king-portrait {
  position: absolute;
  z-index: 7;
  left: 58%;
  bottom: 2%;
  width: clamp(64px, 8vw, 112px);
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 8px rgba(23, 30, 43, 0.3));
}

.king-sprite {
  display: block;
  width: 100%;
  height: auto;
}

.map-instruction {
  position: absolute;
  z-index: 7;
  top: 10px;
  left: 50%;
  padding: 7px 14px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: var(--game-navy);
  background: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.58rem, 0.8vw, 0.75rem);
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

@keyframes mapPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255, 220, 105, 0.17), inset 0 0 28px rgba(255, 240, 177, 0.12); }
  50% { box-shadow: 0 0 0 13px rgba(255, 220, 105, 0), inset 0 0 34px rgba(255, 240, 177, 0.25); }
}

genta-guide {
  position: fixed;
  z-index: 800;
  left: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: min(470px, 48vw);
  pointer-events: none;
}

.genta-bubble {
  position: relative;
  max-width: 350px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 3px solid #d9e3ef;
  border-radius: 19px 19px 19px 5px;
  color: var(--game-ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 28px rgba(23, 55, 102, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.genta-bubble::after {
  content: "";
  position: absolute;
  left: -13px;
  bottom: 12px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-right: 14px solid white;
  border-bottom: 9px solid transparent;
}

.genta-figure {
  width: 106px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 8px rgba(23, 55, 102, 0.25));
  transform-origin: bottom center;
}

.genta-sprite {
  display: block;
  width: 100%;
  height: auto;
}

genta-guide[data-pose="talking"] .genta-figure {
  animation: gentaTalk 520ms ease-in-out infinite alternate;
}

genta-guide[data-pose="celebrating"] .genta-figure {
  animation: gentaCheer 650ms ease-in-out infinite alternate;
}

@keyframes gentaTalk {
  to { transform: rotate(1.5deg) translateY(-2px); }
}

@keyframes gentaCheer {
  to { transform: translateY(-8px) rotate(2deg); }
}

.game-dialog-open genta-guide {
  transform: scale(0.78);
  transform-origin: left bottom;
}

gate-stage,
syllable-stage,
color-stage,
game-help,
game-menu {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 22px 22px 116px;
  visibility: hidden;
  opacity: 0;
  background: rgba(18, 42, 76, 0.58);
  backdrop-filter: blur(5px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

gate-stage.open,
syllable-stage.open,
color-stage.open,
game-help.open,
game-menu.open {
  visibility: visible;
  opacity: 1;
}

.stage-dialog,
.utility-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 150px);
  overflow: auto;
  padding: 28px;
  border: 5px solid #f1d083;
  border-radius: 30px;
  background: var(--game-cream);
  box-shadow: 0 28px 80px rgba(8, 26, 51, 0.38);
  transform: translateY(20px) scale(0.97);
  transition: transform 240ms cubic-bezier(0.2, 0.85, 0.25, 1.15);
  scrollbar-width: thin;
}

gate-stage.open .stage-dialog,
syllable-stage.open .stage-dialog,
color-stage.open .stage-dialog,
game-help.open .utility-dialog,
game-menu.open .utility-dialog {
  transform: translateY(0) scale(1);
}

.stage-close {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--game-navy);
  background: #e9eff7;
  cursor: pointer;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

.stage-close:hover {
  background: #ffedbd;
}

.stage-eyebrow {
  margin: 0 54px 5px 0;
  color: var(--game-gold-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.level-slot {
  margin-bottom: 12px;
}

.level-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 14px;
  border: 2px solid #e8d9ae;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff8e2, #fffdf6);
}

.level-indicator__text {
  color: var(--game-navy);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.level-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #cfdae8;
  color: #8a97a8;
  background: white;
  font-size: 0.68rem;
  font-weight: 900;
}

.level-dot--done {
  border-color: #60bf83;
  color: white;
  background: var(--game-green);
}

.level-dot--current {
  border-color: var(--game-gold-dark);
  color: #55330a;
  background: var(--game-gold);
  box-shadow: 0 0 0 3px rgba(242, 184, 63, 0.3);
}

.task-title {
  margin: 2px 0 4px;
  color: var(--game-navy);
  font-size: clamp(1.15rem, 2.8vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-align: center;
}

.task-sub {
  margin: 0 0 12px;
  color: #41648c;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 700;
  text-align: center;
}

.clue-label,
.slots-label {
  margin: 0;
  color: var(--game-gold-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slots-label {
  margin-top: 10px;
}

.tray-guide {
  margin: 12px 0 2px;
  color: var(--game-navy);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 900;
  text-align: center;
}

.mic-guide {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  color: #285b91;
  background: #e8f2ff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.mixture-line {
  margin: 0 0 2px;
  color: var(--game-navy);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 900;
  text-align: center;
}

.replay-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.replay-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 18px;
  border: 2px solid #ced9e8;
  border-radius: 999px;
  color: var(--game-navy);
  background: white;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease;
}

.replay-button:hover {
  transform: translateY(-2px);
  border-color: var(--game-gold);
}

.stone-piece__order {
  position: absolute;
  z-index: 3;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  background: var(--game-navy-light);
  font-size: 0.68rem;
  font-weight: 900;
}

.blank-slot {
  border-radius: 18px;
  outline: 3px dashed rgba(200, 121, 22, 0.55);
  outline-offset: -3px;
}

.blank-slot.is-filled {
  outline-style: solid;
  outline-color: rgba(200, 121, 22, 0.85);
}

.gate-stage:not(.is-solved) .speech-button {
  animation: micGlow 1.8s ease-in-out infinite;
}

@keyframes micGlow {
  0%, 100% { box-shadow: 0 10px 24px rgba(23, 55, 102, 0.28); }
  50% { box-shadow: 0 10px 24px rgba(23, 55, 102, 0.28), 0 0 0 10px rgba(242, 184, 63, 0.35); }
}

.stage-dialog h2,
.utility-dialog h2,
.victory-dialog h2 {
  margin: 0 48px 18px 0;
  color: var(--game-navy);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 900;
  line-height: 1.18;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  border: 2px solid var(--game-gold-dark);
  color: #55330a;
  background: linear-gradient(180deg, #ffd96f, var(--game-gold));
  box-shadow: 0 8px 18px rgba(200, 121, 22, 0.24);
}

.secondary-action {
  border: 2px solid #ced9e8;
  color: var(--game-navy);
  background: white;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.gate-scene {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto 14px;
  min-height: 150px;
}

.gate-scene__gray,
.gate-scene__color {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.gate-scene__color {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}

.gate-stage.is-solved .gate-scene__color {
  opacity: 1;
}

.gate-stage.is-solved .gate-scene__gray {
  opacity: 0;
}

.gate-stage.is-unlocking .gate-scene__color {
  opacity: 1;
}

.gate-stage.is-unlocking .gate-scene__gray {
  opacity: 0;
}

.gate-challenge {
  display: grid;
  grid-template-columns: 126px 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 2px solid #e2d4b1;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff6d8, #fffdf7);
}

.gate-lock-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 118px;
}

.large-lock-sprite {
  width: 112px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 8px rgba(84, 54, 12, 0.28));
}

.challenge-question {
  margin: 0 0 8px;
  color: var(--game-ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.55;
}

.challenge-hint,
.drag-hint,
.help-note {
  margin: 0;
  color: var(--game-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

.speech-panel {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #e6f1ff, #f5f9ff);
}

.speech-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--game-navy-light), var(--game-navy));
  box-shadow: 0 10px 24px rgba(23, 55, 102, 0.28);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 900;
}

.speech-button .material-symbols-rounded {
  font-size: 1.35rem;
}

.speech-button.is-listening {
  background: linear-gradient(135deg, #3bb875, #237a50);
  animation: listenPulse 1.15s ease-in-out infinite;
}

.speech-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.listening-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--game-green);
}

.listening-state span {
  width: 6px;
  height: 12px;
  border-radius: 999px;
  background: var(--game-green);
  animation: listenBar 650ms ease-in-out infinite alternate;
}

.listening-state span:nth-child(2) { animation-delay: 120ms; }
.listening-state span:nth-child(3) { animation-delay: 240ms; }
.listening-state span:nth-child(4) { animation-delay: 360ms; }

.listening-state strong {
  margin-left: 7px;
  font-size: 0.78rem;
}

.answer-form {
  margin-top: 18px;
}

.answer-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--game-navy);
  font-size: 0.8rem;
  font-weight: 900;
}

.answer-form__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.answer-form input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 11px 16px;
  border: 3px solid #cfdae8;
  border-radius: 16px;
  color: var(--game-ink);
  background: white;
  font-weight: 700;
}

.stage-feedback {
  min-height: 28px;
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--game-navy);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.stage-feedback:empty {
  display: none;
}

.stage-feedback[data-tone="success"] {
  color: #216842;
  background: #e5f7eb;
}

.stage-feedback[data-tone="error"] {
  color: #9a3535;
  background: #fdeaea;
}

.stage-feedback[data-tone="info"] {
  color: #285b91;
  background: #e8f2ff;
}

.stage-success {
  margin-top: 14px;
  padding: 18px;
  border: 3px solid #70c88e;
  border-radius: 22px;
  background: linear-gradient(135deg, #e8f9ed, #f8fff9);
  text-align: center;
}

.stage-success strong {
  display: block;
  color: #226b43;
  font-size: 1.3rem;
  font-weight: 900;
}

.stage-success p {
  margin: 7px 0 14px;
  color: #416a52;
  font-size: 0.85rem;
  font-weight: 700;
}

.gate-stage.is-unlocking .gate-lock-visual {
  animation: lockShake 700ms ease-in-out infinite alternate;
}

.gate-stage.is-unlocking .gate-lock-visual::after {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(255, 215, 89, 0.72) 9% 13%, transparent 14% 28%, rgba(255, 215, 89, 0.72) 29% 33%, transparent 34% 53%, rgba(255, 215, 89, 0.72) 54% 58%, transparent 59% 78%, rgba(255, 215, 89, 0.72) 79% 83%, transparent 84%);
  animation: rotateRays 1.1s linear infinite;
}

.word-bridge {
  padding: 18px;
  border: 2px solid #d8e4ef;
  border-radius: 24px;
  background: linear-gradient(180deg, #dff3ff, #f7fcff);
  text-align: center;
}

.word-preview,
.word-slots,
.syllable-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.word-preview {
  min-height: 92px;
  margin-bottom: 8px;
}

.word-bridge .challenge-hint {
  margin-bottom: 13px;
}

.word-slots {
  padding-top: 12px;
  border-top: 2px dashed #bed1e3;
}

.syllable-tray {
  min-height: 100px;
  margin: 16px 0 8px;
  padding: 14px;
  border: 2px solid #e1d6b9;
  border-radius: 22px;
  background: #fff8e7;
}

.stone-piece {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(66px, 11vw, 92px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 7px 5px rgba(63, 77, 93, 0.2));
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.stone-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stone-piece__text {
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  min-width: 68%;
  min-height: 52%;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--game-navy);
  background: #ece0cc;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.7);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 900;
  text-transform: lowercase;
  text-shadow: 0 1px white;
}

.stone-piece:hover {
  transform: translateY(-3px) rotate(-1deg);
  filter: drop-shadow(0 10px 6px rgba(63, 77, 93, 0.24));
}

.syllable-tile.is-selected {
  transform: translateY(-7px) scale(1.08);
  filter: drop-shadow(0 0 9px rgba(242, 184, 63, 0.9));
}

.syllable-tile.is-used {
  opacity: 0.25;
  pointer-events: none;
}

.blank-slot:not(.is-filled) .stone-piece__text {
  color: #8390a0;
}

.blank-slot.is-filled .stone-piece__text,
.preview-stone.is-filled .stone-piece__text {
  color: #704000;
}

.syllable-stage.is-solved .stone-sprite {
  filter: saturate(1.25) brightness(1.08);
}

.stage-actions,
.victory-actions,
.menu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.paint-props-strip {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  width: min(100%, 680px);
  margin: -4px auto 12px;
}

.paint-props-strip img.paint-props-sprite {
  display: block;
  width: 20%;
  max-width: 110px;
  height: auto;
  object-fit: contain;
}

.garden-challenge {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  align-items: center;
  gap: 20px;
  min-height: 280px;
  padding: 14px 18px;
  border: 2px solid #d9e6d0;
  border-radius: 26px;
  background: linear-gradient(145deg, #eef9e8, #fffdf3);
}

.flower-progression {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: visible;
}

.garden-flower-sprite {
  display: block;
  width: min(100%, 310px);
  height: auto;
  filter: drop-shadow(0 10px 8px rgba(44, 91, 48, 0.22));
}

.garden-flower-sprite.is-blooming {
  animation: bloomIn 700ms cubic-bezier(0.2, 1.35, 0.35, 1) both;
}

.mixing-area {
  display: grid;
  place-items: center;
  text-align: center;
}

.recipe-prompt {
  min-height: 48px;
  margin: 0 0 4px;
  color: var(--game-navy);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.45;
}

.mixing-pot {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 1.1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 10px 8px rgba(23, 55, 102, 0.2));
  transition: transform 170ms ease, filter 170ms ease;
}

.mixing-pot:hover {
  transform: translateY(-3px);
}

.mixing-pot__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mixing-pot__art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mixing-pot__color {
  position: absolute;
  z-index: 2;
  top: 30%;
  left: 50%;
  width: 42%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: var(--mixed-color, transparent);
  box-shadow: inset 0 5px 12px rgba(255, 255, 255, 0.35);
  transition: background 250ms ease;
}

.mixing-pot__label {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0;
  min-width: 42%;
  padding: 5px 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  color: white;
  background: rgba(23, 55, 102, 0.86);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.mixing-pot.is-over {
  transform: scale(1.05);
  filter: drop-shadow(0 0 13px rgba(242, 184, 63, 0.92));
}

.mixing-pot.is-wrong {
  animation: potShake 420ms ease;
}

.mixing-pot.is-mixed {
  animation: mixPop 500ms cubic-bezier(0.2, 1.4, 0.3, 1);
}

.paint-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.paint-source {
  display: grid;
  grid-template-columns: 66px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 78px;
  padding: 8px 12px;
  border: 3px solid #d7dfeb;
  border-radius: 20px;
  background: white;
  box-shadow: 0 6px 14px rgba(23, 55, 102, 0.08);
  cursor: grab;
  transition: transform 150ms ease, border-color 150ms ease;
}

.paint-source:hover {
  transform: translateY(-3px);
  border-color: var(--game-gold);
}

.paint-source__art {
  width: 66px;
}

.paint-source__art .asset-sprite,
.paint-source__art img {
  display: block;
  width: 100%;
  height: auto;
}

.paint-source strong {
  color: var(--game-navy);
  font-size: 0.85rem;
}

.paint-source--red { border-color: #e98787; }
.paint-source--yellow { border-color: #e8c64f; }
.paint-source--blue { border-color: #78aee7; }

.color-particle {
  position: absolute;
  z-index: 4;
  top: 45%;
  left: 50%;
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
  animation: particlePop 850ms ease-out var(--particle-delay) both;
}

.help-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 24px;
  color: var(--game-ink);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
}

.help-list li::marker {
  color: var(--game-gold-dark);
  font-weight: 900;
}

.help-note {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef5fc;
}

.menu-actions {
  flex-direction: column;
}

.menu-actions > * {
  width: min(100%, 340px);
}

@keyframes listenPulse {
  50% { box-shadow: 0 0 0 12px rgba(59, 184, 117, 0); }
}

@keyframes listenBar {
  to { height: 28px; }
}

@keyframes lockShake {
  to { transform: scale(1.08) rotate(2deg); filter: drop-shadow(0 0 15px rgba(255, 209, 55, 0.95)); }
}

@keyframes rotateRays {
  to { transform: rotate(360deg); }
}

@keyframes bloomIn {
  0% { transform: scale(0.6) rotate(-5deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes potShake {
  25% { transform: translateX(-6px) rotate(-2deg); }
  50% { transform: translateX(6px) rotate(2deg); }
  75% { transform: translateX(-3px); }
}

@keyframes mixPop {
  50% { transform: scale(1.1) rotate(2deg); }
}

@keyframes particlePop {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(1.15) rotate(80deg); opacity: 0; }
}

victory-screen {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 18px 18px 112px;
  visibility: hidden;
  opacity: 0;
  overflow: auto;
  background: linear-gradient(150deg, rgba(24, 57, 105, 0.9), rgba(94, 53, 126, 0.82));
  backdrop-filter: blur(7px);
  transition: opacity 280ms ease, visibility 280ms ease;
}

victory-screen.open {
  visibility: visible;
  opacity: 1;
}

.victory-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100dvh - 140px);
  overflow: auto;
  padding: 30px 28px 26px;
  border: 6px solid #f6d675;
  border-radius: 34px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 220, 100, 0.3), transparent 25%),
    linear-gradient(180deg, #fffef9, #f5fbff);
  box-shadow: 0 30px 100px rgba(10, 20, 45, 0.45);
  text-align: center;
  transform: translateY(24px) scale(0.92);
  transition: transform 420ms cubic-bezier(0.18, 1.2, 0.3, 1.1);
}

victory-screen.open .victory-dialog {
  transform: translateY(0) scale(1);
}

.victory-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(115, 199, 255, 0.2), transparent 48%);
}

.victory-dialog .stage-eyebrow {
  position: relative;
  margin-right: 0;
}

.victory-dialog h2 {
  position: relative;
  margin-right: 0;
  color: #71429d;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
}

.victory-lead {
  position: relative;
  max-width: 520px;
  margin: -7px auto 10px;
  color: #53657b;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
}

.victory-badge {
  position: relative;
  width: min(72%, 300px);
  margin: 0 auto -8px;
  filter: drop-shadow(0 0 24px rgba(242, 184, 63, 0.68));
  animation: badgeFloat 2.2s ease-in-out infinite alternate;
}

.badge-sprite {
  display: block;
  width: 100%;
  height: auto;
}

.victory-dialog h3 {
  position: relative;
  margin: 0;
  color: var(--game-navy);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 900;
}

.victory-king {
  position: relative;
  width: 125px;
  margin: 6px auto 0;
}

.victory-king-sprite {
  display: block;
  width: 100%;
  height: auto;
}

.victory-burst {
  position: absolute;
  width: 105px;
  opacity: 0.75;
  animation: victorySpark 1.5s ease-in-out infinite alternate;
}

.victory-burst--one {
  top: 18%;
  left: 4%;
}

.victory-burst--two {
  right: 5%;
  bottom: 18%;
  animation-delay: 500ms;
}

.victory-effect {
  display: block;
  width: 100%;
  height: auto;
}

.victory-actions {
  position: relative;
}

@keyframes badgeFloat {
  to { transform: translateY(-7px) rotate(1deg); }
}

@keyframes victorySpark {
  from { transform: scale(0.85) rotate(-4deg); opacity: 0.5; }
  to { transform: scale(1.08) rotate(5deg); opacity: 0.95; }
}

@media (max-width: 1080px) {
  :root {
    --game-hud-height: 124px;
  }

  .game-hud > header {
    grid-template-columns: minmax(220px, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
  }

  .game-title-block {
    grid-column: 1;
    grid-row: 1;
  }

  .hud-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .stage-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .stage-progress__item {
    min-height: 32px;
    padding: 3px 9px 3px 4px;
  }

  .stage-progress__number {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 720px) {
  :root {
    --game-hud-height: 112px;
  }

  body.game-body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100dvh;
    overflow: visible;
  }

  .game-hud {
    padding: 7px 8px;
  }

  .game-hud > header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 7px;
  }

  .game-title-mark,
  .game-title-block small {
    display: none;
  }

  .game-title-block strong {
    max-width: 180px;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .hud-actions {
    gap: 5px;
  }

  .star-counter,
  .hud-button {
    min-width: 36px;
    min-height: 36px;
    border-radius: 12px;
  }

  .star-counter {
    padding: 0 7px;
  }

  .star-counter > span {
    font-size: 1rem;
  }

  .hud-button {
    font-size: 1rem;
  }

  .hud-button .material-symbols-rounded {
    font-size: 1.1rem;
  }

  .stage-progress {
    gap: 3px;
  }

  .stage-progress__item {
    gap: 4px;
    min-height: 29px;
    border-width: 1px;
    font-size: 0.57rem;
  }

  .stage-progress__number {
    width: 21px;
    height: 21px;
    font-size: 0.58rem;
  }

  .stage-progress__state {
    width: 12px;
    font-size: 0.6rem;
  }

  .stage-progress__arrow {
    font-size: 0.7rem;
  }

  kingdom-map {
    position: relative;
    inset: auto;
    min-height: 0;
    padding: calc(var(--game-hud-height) + 8px) 7px 130px;
  }

  .palace-map,
  .map-visual {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .map-visual {
    aspect-ratio: 4 / 3;
    border-width: 4px;
    border-radius: 22px;
  }

  .map-zone--gate {
    left: 1%;
    top: 26%;
    width: 34%;
    height: 42%;
  }

  .map-zone--bridge {
    left: 2%;
    top: auto;
    bottom: 1%;
    width: 42%;
    height: 40%;
  }

  .map-zone--garden {
    left: auto;
    right: 1%;
    top: 30%;
    width: 38%;
    height: 62%;
  }

  .map-zone__label {
    padding: 5px 8px;
    border-width: 2px;
    font-size: 0.58rem;
  }

  .map-zone__status {
    font-size: 0.48rem;
  }

  .map-zone__number {
    border-width: 2px;
    font-size: 0.62rem;
  }

  .map-instruction {
    display: none;
  }

  .king-portrait {
    width: 56px;
  }

  genta-guide {
    left: 8px;
    right: 8px;
    bottom: 7px;
    max-width: none;
    gap: 3px;
  }

  .genta-bubble {
    max-width: calc(100vw - 108px);
    margin-bottom: 11px;
    padding: 8px 10px;
    border-width: 2px;
    border-radius: 14px 14px 14px 4px;
    font-size: 0.68rem;
  }

  .genta-figure {
    width: 80px;
  }

  gate-stage,
  syllable-stage,
  color-stage,
  game-help,
  game-menu {
    align-items: end;
    padding: 8px 8px 108px;
  }

  .stage-dialog,
  .utility-dialog {
    max-height: calc(100dvh - 126px);
    padding: 20px 15px 17px;
    border-width: 4px;
    border-radius: 24px;
  }

  .stage-dialog h2,
  .utility-dialog h2 {
    margin-bottom: 13px;
    font-size: 1.25rem;
  }

  .stage-close {
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
  }

  .gate-challenge {
    grid-template-columns: 74px 1fr;
    gap: 10px;
    padding: 11px;
  }

  .gate-lock-visual {
    min-height: 80px;
  }

  .large-lock-sprite {
    width: 72px;
  }

  .challenge-question {
    font-size: 0.8rem;
  }

  .speech-button {
    width: 100%;
    min-height: 50px;
    font-size: 0.78rem;
  }

  .answer-form__row {
    grid-template-columns: 1fr;
  }

  .word-preview {
    min-height: 68px;
  }

  .stone-piece {
    width: clamp(54px, 18vw, 74px);
  }

  .word-preview,
  .word-slots,
  .syllable-tray {
    gap: 7px;
  }

  .syllable-tray {
    padding: 9px;
  }

  .paint-props-strip {
    display: none;
  }

  .garden-challenge {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    padding: 10px;
  }

  .flower-progression {
    min-height: 130px;
  }

  .garden-flower-sprite {
    width: 175px;
  }

  .mixing-pot {
    width: 145px;
  }

  .recipe-prompt {
    min-height: 0;
  }

  .paint-sources {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .paint-source {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 76px;
    padding: 5px;
    text-align: center;
  }

  .paint-source__art {
    width: 52px;
  }

  .paint-source strong {
    font-size: 0.66rem;
  }

  .game-dialog-open genta-guide {
    transform: scale(0.68);
  }

  victory-screen {
    align-items: end;
    padding: 7px 7px 100px;
  }

  .victory-dialog {
    max-height: calc(100dvh - 115px);
    padding: 20px 13px;
    border-width: 4px;
    border-radius: 25px;
  }

  .victory-badge {
    width: min(64%, 220px);
  }

  .victory-king {
    width: 92px;
  }

  .victory-burst {
    width: 68px;
  }
}

@media (max-width: 360px) {
  .game-title-block strong {
    font-size: 0.7rem;
  }

  .hud-actions {
    gap: 3px;
  }

  .stage-progress {
    gap: 2px;
  }

  .stage-progress__item {
    gap: 2px;
    padding: 2px 4px 2px 3px;
    font-size: 0.52rem;
  }

  .stage-progress__number {
    width: 19px;
    height: 19px;
    font-size: 0.52rem;
  }

  .stage-progress__state {
    width: 10px;
    height: 10px;
    font-size: 0.52rem;
  }

  .stage-progress__arrow {
    font-size: 0.55rem;
  }
}

@media (max-height: 680px) and (min-width: 721px) {
  :root {
    --game-hud-height: 78px;
  }

  .game-title-mark,
  .game-title-block small {
    display: none;
  }

  .genta-bubble {
    max-width: 280px;
    font-size: 0.72rem;
  }

  .genta-figure {
    width: 88px;
  }

  .stage-dialog,
  .utility-dialog {
    max-height: calc(100dvh - 110px);
    padding: 21px;
  }

  gate-stage,
  syllable-stage,
  color-stage,
  game-help,
  game-menu {
    padding-bottom: 90px;
  }
}

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