:root {
  --bg: #e8f5f0;
  --ink: #25333a;
  --muted: #7b8a8d;
  --panel: #fffaf0;
  --line: #efbf68;
  --wall: #80beb8;
  --wall-deep: #5b9c98;
  --floor: #e8b875;
  --floor-deep: #d99c58;
  --rug: #f7e68a;
  --rug-edge: #9fca67;
  --green: #5fbd7f;
  --orange: #ff9e36;
  --blue: #2f8ed8;
  --purple: #8b5bd2;
  --red: #ee4e51;
  --shadow: rgba(80, 49, 25, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button {
  border: 0;
  font: inherit;
  touch-action: manipulation;
}

.app {
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(132px, 18vh, 190px);
  width: 100vw;
  height: 100dvh;
  min-width: 760px;
  padding: clamp(12px, 1.6vw, 20px);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(180deg, #dff3f0 0%, #f8efd8 82%, #fff7e7 100%);
  gap: clamp(10px, 1.4vw, 16px);
}

.stage {
  position: relative;
  min-height: 0;
}

.progress {
  position: absolute;
  top: clamp(14px, 2vw, 22px);
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  transform: translateX(-50%);
}

.dot {
  position: relative;
  width: 21px;
  height: 21px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #d8d0bf;
  box-shadow: 0 3px 8px rgba(62, 54, 42, 0.18);
}

.dot + .dot {
  margin-left: 15px;
}

.dot + .dot::before {
  position: absolute;
  left: -18px;
  top: 50%;
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  content: "";
  transform: translateY(-50%);
}

.dot.active {
  width: 26px;
  height: 26px;
  background: var(--blue);
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 430px;
  overflow: hidden;
  border: 3px solid #dfaf5b;
  border-radius: 24px;
  background: var(--wall);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.38),
    0 10px 25px rgba(112, 83, 40, 0.16);
}

.room-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: url("./assets/visuals/raster/toy-room-background.png") center / cover no-repeat;
}

.room-backdrop::before {
  position: absolute;
  left: 0;
  right: 0;
  top: 66%;
  height: 12px;
  background: rgba(255, 255, 255, 0.4);
  content: "";
}

.room-backdrop::after {
  position: absolute;
  inset: 66% 0 0;
  background:
    linear-gradient(90deg, transparent 0 96px, rgba(166, 103, 47, 0.12) 96px 99px, transparent 99px 198px),
    linear-gradient(180deg, transparent, rgba(196, 124, 57, 0.22));
  content: "";
}

.room-backdrop::before,
.room-backdrop::after,
.window,
.wall-art,
.bunting,
.shelf,
.rug {
  display: none;
}

.window {
  position: absolute;
  left: 12%;
  top: 7%;
  width: clamp(170px, 22vw, 310px);
  height: clamp(112px, 16vw, 190px);
  border: 10px solid #fff5dd;
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 70%, #a8d876 0 18%, transparent 19%),
    radial-gradient(circle at 28% 70%, #87c864 0 18%, transparent 19%),
    linear-gradient(180deg, #aee5ff 0 58%, #d9f4ff 58% 100%);
  box-shadow: 0 8px 16px rgba(63, 79, 70, 0.18);
}

.window::before,
.window::after {
  position: absolute;
  background: #fff5dd;
  content: "";
}

.window::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 8px;
  transform: translateX(-50%);
}

.window::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
}

.curtain {
  position: absolute;
  top: -18px;
  bottom: -36px;
  width: 32%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 36%),
    #ffe8c6;
  opacity: 0.9;
  filter: drop-shadow(0 8px 8px rgba(107, 83, 45, 0.15));
}

.curtain-left {
  left: -26%;
  border-radius: 0 0 34px 8px;
  transform: skewX(-6deg);
}

.curtain-right {
  right: -26%;
  border-radius: 0 0 8px 34px;
  transform: skewX(6deg);
}

.sun {
  position: absolute;
  right: 15%;
  top: 15%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffe15f;
  box-shadow: 0 0 24px rgba(255, 222, 83, 0.7);
}

.wall-art {
  position: absolute;
  top: 10%;
  width: clamp(118px, 12vw, 166px);
  height: clamp(76px, 8vw, 112px);
  border: 9px solid #c48651;
  border-radius: 8px;
  background: #f8e7c5;
  box-shadow: 0 8px 12px rgba(68, 67, 56, 0.15);
}

.art-balloon {
  left: 41%;
}

.art-balloon::before {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 32px;
  height: 42px;
  border-radius: 50% 50% 46% 46%;
  background:
    linear-gradient(90deg, #5fbdd2 0 33%, #f6cf4d 33% 66%, #ec674d 66%);
  content: "";
  transform: translateX(-50%);
}

.art-balloon::after {
  position: absolute;
  left: 50%;
  top: 61%;
  width: 18px;
  height: 12px;
  border-radius: 0 0 4px 4px;
  background: #a56739;
  content: "";
  transform: translateX(-50%);
}

.art-rainbow {
  left: 57%;
}

.art-rainbow::before {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 82px;
  height: 48px;
  border: 11px solid #e76e55;
  border-bottom: 0;
  border-radius: 82px 82px 0 0;
  box-shadow:
    inset 0 0 0 10px #f0c25a,
    inset 0 0 0 21px #7cba8a;
  content: "";
  transform: translateX(-50%);
}

.bunting {
  position: absolute;
  right: 10%;
  top: 7%;
  display: flex;
  gap: 8px;
  transform: rotate(7deg);
}

.bunting span {
  width: 32px;
  height: 46px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: #f5b947;
  filter: drop-shadow(0 5px 4px rgba(44, 69, 63, 0.16));
}

.bunting span:nth-child(2) {
  background: #ee6a55;
}

.bunting span:nth-child(3) {
  background: #4e9ecf;
}

.bunting span:nth-child(4) {
  background: #b4c75c;
}

.bunting span:nth-child(5) {
  background: #a875d4;
}

.shelf {
  position: absolute;
  background: #d69b58;
  box-shadow:
    inset 0 -8px 0 rgba(129, 82, 35, 0.16),
    0 8px 12px rgba(79, 59, 36, 0.16);
}

.shelf-left {
  left: 2%;
  top: 21%;
  width: clamp(120px, 14vw, 190px);
  height: clamp(170px, 24vh, 260px);
  border-radius: 10px;
}

.shelf-left::before {
  position: absolute;
  left: 17%;
  top: -76px;
  width: 92px;
  height: 82px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #d75a3c 0 48%, transparent 49%),
    linear-gradient(225deg, #b64431 0 48%, transparent 49%),
    #f0c46d;
  box-shadow: inset 0 -12px 0 rgba(111, 78, 37, 0.15);
  content: "";
}

.shelf-left::after {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 48%;
  height: 10px;
  border-radius: 999px;
  background: rgba(125, 79, 33, 0.28);
  box-shadow:
    10px -42px 0 -1px #4e9ecf,
    34px -42px 0 -1px #86bf56,
    58px -42px 0 -1px #efb94d,
    0 48px 0 0 rgba(125, 79, 33, 0.24);
  content: "";
}

.shelf-right {
  right: 2%;
  top: 25%;
  width: clamp(124px, 14vw, 180px);
  height: clamp(160px, 22vh, 236px);
  border-radius: 10px;
}

.shelf-right::before {
  position: absolute;
  left: 22%;
  top: 14%;
  width: 62px;
  height: 58px;
  border-radius: 14px 14px 9px 9px;
  background: #d99a5f;
  box-shadow:
    22px 0 0 -10px #a9653f,
    -22px 0 0 -10px #a9653f,
    4px 70px 0 18px #9ccfaa;
  content: "";
}

.rug {
  position: absolute;
  left: 9%;
  bottom: 4%;
  width: 82%;
  height: 31%;
  border: 9px solid var(--rug-edge);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.35), transparent 48%),
    var(--rug);
  box-shadow: 0 10px 18px rgba(101, 94, 45, 0.16);
}

.toy {
  position: absolute;
  z-index: 2;
  display: block;
  min-width: 76px;
  min-height: 76px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 11px 9px rgba(84, 54, 28, 0.18));
  transition:
    transform 900ms ease,
    opacity 720ms ease,
    filter 240ms ease,
    left 1260ms ease,
    top 1260ms ease,
    bottom 1260ms ease,
    right 1260ms ease;
}

.toy:active {
  transform: scale(0.96);
}

.asset-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.bear {
  right: 12%;
  bottom: 13%;
  width: clamp(190px, 17vw, 270px);
  height: clamp(214px, 20vw, 310px);
  z-index: 4;
  animation: idleBear 4.2s ease-in-out infinite;
}

.box {
  left: 39%;
  bottom: 17%;
  width: clamp(250px, 25vw, 370px);
  height: clamp(188px, 19vw, 280px);
  z-index: 3;
  overflow: visible;
}

.box.open {
  transform: translateY(-5px) scale(1.03);
}

.ball {
  left: 24%;
  bottom: 10%;
  width: clamp(112px, 10vw, 152px);
  height: clamp(112px, 10vw, 152px);
  border-radius: 50%;
  overflow: hidden;
  z-index: 5;
  animation: idleBall 3.8s ease-in-out infinite;
}

.car {
  left: 43%;
  bottom: 6%;
  width: clamp(150px, 13vw, 210px);
  height: clamp(104px, 9vw, 146px);
  z-index: 5;
  animation: idleCar 5s ease-in-out infinite;
}

.apple {
  right: 27%;
  bottom: 9%;
  width: clamp(96px, 8.4vw, 130px);
  height: clamp(108px, 9.4vw, 146px);
  z-index: 5;
}

.blocks {
  left: 7%;
  top: auto;
  bottom: 23%;
  z-index: 4;
  display: block;
  width: clamp(280px, 27vw, 390px);
  min-height: 174px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.blocks:not(.math-blocks) {
  background: url("./assets/visuals/raster/blocks.png") center / contain no-repeat;
}

.block {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 37%),
    linear-gradient(145deg, var(--block-light), var(--block-main) 52%, var(--block-dark));
  box-shadow:
    inset -9px -10px 0 rgba(0, 0, 0, 0.12),
    0 9px 0 rgba(103, 66, 28, 0.14);
  --block-main: #ffcf3f;
  --block-light: #ffe98c;
  --block-dark: #d69b1e;
  --block-accent: #f35a67;
}

.blocks:not(.math-blocks) .block {
  display: none;
}

.blocks:not(.math-blocks) .block {
  position: absolute;
}

.blocks:not(.math-blocks) .block[data-shape="cube"] {
  left: 0;
  bottom: 0;
}

.blocks:not(.math-blocks) .block[data-shape="brick"] {
  left: 77px;
  bottom: 0;
}

.blocks:not(.math-blocks) .block[data-shape="arch"] {
  left: 158px;
  bottom: 0;
}

.blocks:not(.math-blocks) .block[data-shape="triangle"] {
  left: 184px;
  bottom: 66px;
}

.block::before,
.block::after {
  content: none;
}

.block[data-shape="brick"] {
  width: 98px;
  height: 64px;
  border-radius: 13px;
}

.block[data-shape="arch"] {
  width: 80px;
  height: 94px;
  border-radius: 42px 42px 13px 13px;
}

.block[data-shape="triangle"] {
  width: 86px;
  height: 78px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.block[data-shape="triangle"]::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(150deg, var(--block-light), var(--block-main) 54%, var(--block-dark));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 9px 0 rgba(103, 66, 28, 0.14));
}

.blocks.math-blocks {
  left: 9%;
  bottom: 24%;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  width: clamp(460px, 42vw, 590px);
  gap: 14px;
  min-height: 140px;
}

.blocks.math-blocks .block {
  position: relative;
  left: auto;
  bottom: auto;
}

.blocks.math-blocks .block[data-shape="cube"] {
  width: 102px;
  height: 102px;
}

.blocks.math-blocks .block[data-shape="brick"] {
  width: 132px;
  height: 82px;
}

.blocks.math-blocks .block[data-shape="arch"] {
  width: 112px;
  height: 116px;
}

.blocks.math-blocks .block[data-shape="triangle"] {
  width: 118px;
  height: 104px;
}

.train {
  right: 5%;
  bottom: 6%;
  top: auto;
  display: block;
  width: clamp(180px, 16vw, 250px);
  height: clamp(116px, 10vw, 156px);
  z-index: 5;
  animation: idleTrain 4.8s ease-in-out infinite;
}

.stars {
  right: 8%;
  top: 17%;
  z-index: 5;
  display: flex;
  gap: 8px;
  min-width: 198px;
  min-height: 48px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  filter: none;
}

.star {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: url("./assets/visuals/star-filled.svg") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  opacity: 0.38;
}

.star.filled {
  opacity: 1;
}

.count-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1f84e5;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.18);
}

.start-card {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.82), rgba(255, 250, 231, 0.78) 34%, rgba(255, 250, 231, 0.35) 62%),
    rgba(245, 239, 217, 0.34);
  color: var(--ink);
}

.start-title {
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.72);
}

.start-action {
  display: grid;
  place-items: center;
  min-width: clamp(170px, 16vw, 240px);
  height: clamp(78px, 8vw, 112px);
  padding: 0 36px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: var(--green);
  color: #fff;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 900;
  box-shadow:
    0 12px 0 #3d9862,
    0 18px 28px rgba(58, 100, 67, 0.2);
}

.math-game-entry {
  position: absolute;
  left: calc(50% - clamp(230px, 25vw, 330px));
  bottom: clamp(34px, 7vh, 78px);
  z-index: 11;
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: clamp(190px, 18vw, 280px);
  min-height: clamp(82px, 8vw, 116px);
  padding: 12px 32px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: #2f8ed8;
  color: #fff;
  font-weight: 900;
  transform: translateX(-50%);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.16),
    0 12px 0 #226ca7,
    0 20px 30px rgba(47, 85, 117, 0.2);
}

.math-game-entry-title {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1;
  white-space: nowrap;
}

.math-game-entry-subtitle {
  color: #d9f3ff;
  font-size: clamp(14px, 1.45vw, 20px);
  white-space: nowrap;
}

.tv-video-entry {
  position: absolute;
  left: 50%;
  bottom: clamp(34px, 7vh, 78px);
  z-index: 11;
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: clamp(190px, 18vw, 280px);
  min-height: clamp(82px, 8vw, 116px);
  padding: 12px 32px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: #ff9e36;
  color: #fff;
  font-weight: 900;
  transform: translateX(-50%);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.16),
    0 12px 0 #c8731c,
    0 20px 30px rgba(129, 79, 34, 0.2);
}

.tv-video-entry-title {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1;
  white-space: nowrap;
}

.tv-video-entry-subtitle {
  color: #fff4cf;
  font-size: clamp(14px, 1.45vw, 20px);
  white-space: nowrap;
}

.elevator-game-entry {
  position: absolute;
  left: calc(50% + clamp(230px, 25vw, 330px));
  bottom: clamp(34px, 7vh, 78px);
  z-index: 11;
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: clamp(190px, 18vw, 280px);
  min-height: clamp(82px, 8vw, 116px);
  padding: 12px 32px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: #5fbd7f;
  color: #fff;
  font-weight: 900;
  transform: translateX(-50%);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.16),
    0 12px 0 #3d9862,
    0 20px 30px rgba(62, 109, 75, 0.2);
}

.elevator-game-entry-title {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1;
  white-space: nowrap;
}

.elevator-game-entry-subtitle {
  color: #e4ffe8;
  font-size: clamp(14px, 1.45vw, 20px);
  white-space: nowrap;
}

.sticker-album-entry {
  position: absolute;
  right: clamp(22px, 3vw, 42px);
  top: clamp(22px, 3vw, 42px);
  z-index: 11;
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: clamp(146px, 13vw, 210px);
  min-height: clamp(70px, 7vw, 96px);
  padding: 10px 24px;
  border: 5px solid #fff;
  border-radius: 22px;
  background: #d95757;
  color: #fff;
  font-weight: 900;
  box-shadow:
    inset 0 -9px 0 rgba(0, 0, 0, 0.16),
    0 10px 0 #a93f43,
    0 18px 28px rgba(104, 52, 52, 0.2);
}

.sticker-album-entry-title {
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1;
  white-space: nowrap;
}

.sticker-album-entry-subtitle {
  color: #ffe4de;
  font-size: clamp(12px, 1.25vw, 17px);
  white-space: nowrap;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(260px, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: center;
  padding: clamp(14px, 1.7vw, 24px) clamp(18px, 2vw, 30px) max(clamp(14px, 1.7vw, 24px), env(safe-area-inset-bottom));
  border: 3px solid #efc476;
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.58),
    0 10px 25px rgba(117, 81, 35, 0.12);
}

.spoken-line {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(90px, 12vh, 134px);
  padding: 18px 22px 18px clamp(110px, 10vw, 148px);
  border: 3px solid #efb45b;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 221, 0.82)),
    #fffaf0;
  color: #27343b;
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  box-shadow: 0 7px 0 rgba(210, 157, 74, 0.18);
}

.spoken-line::before {
  position: absolute;
  left: clamp(14px, 1.7vw, 24px);
  top: 50%;
  width: clamp(76px, 7.6vw, 104px);
  height: clamp(76px, 7.6vw, 104px);
  border: 4px solid #ffe09e;
  border-radius: 50%;
  background: #fff1bf url("./assets/visuals/raster/dialog-corgi.png") center / cover no-repeat;
  box-shadow:
    0 4px 0 rgba(210, 157, 74, 0.16),
    0 8px 18px rgba(117, 81, 35, 0.14);
  content: "";
  transform: translateY(-50%);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 1.6vw, 22px);
  justify-content: flex-end;
  align-items: center;
}

.choice,
.next-button {
  min-width: clamp(124px, 11vw, 176px);
  min-height: clamp(88px, 10vh, 128px);
  padding: 0 30px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: var(--blue);
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 900;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.16),
    0 10px 18px rgba(47, 85, 117, 0.18);
}

.next-button {
  min-width: clamp(190px, 18vw, 270px);
  background: var(--orange);
  font-size: clamp(30px, 3.2vw, 46px);
}

.scene-choices {
  position: absolute;
  left: 50%;
  top: 37%;
  z-index: 7;
  display: flex;
  gap: clamp(22px, 4vw, 52px);
  justify-content: center;
  align-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.scene-choice {
  display: grid;
  place-items: center;
  width: clamp(140px, 14vw, 196px);
  height: clamp(140px, 14vw, 196px);
  border: 7px solid #ffffff;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8), transparent 34%),
    #eaf6ff;
  color: var(--blue);
  font-size: clamp(62px, 7vw, 100px);
  font-weight: 900;
  box-shadow:
    0 18px 32px rgba(56, 58, 63, 0.2),
    inset 0 -10px 0 rgba(47, 142, 216, 0.2);
  pointer-events: auto;
}

.scene-choice:nth-child(2) {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8), transparent 34%),
    #eef9e9;
  color: #45a84b;
}

.scene-choice:nth-child(3) {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8), transparent 34%),
    #f5edff;
  color: var(--purple);
}

.scene-choice:active {
  transform: scale(0.96);
}

.math-game {
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 9;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  width: min(1040px, 86vw);
  min-height: min(520px, 70%);
  padding: clamp(20px, 3vw, 36px);
  border: 7px solid #fff;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 221, 0.92)),
    #fff8df;
  color: #24343d;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 48px rgba(89, 63, 28, 0.24);
}

.math-game-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: #5d714f;
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 900;
}

.math-game h2 {
  margin: 0;
  color: #26353d;
  font-size: clamp(28px, 3.5vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
  text-align: center;
}

.math-game-body {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: clamp(22px, 4vw, 58px);
  min-height: 0;
}

.balloon-option {
  position: relative;
  display: grid;
  place-items: center;
  align-self: end;
  width: var(--balloon-size);
  height: calc(var(--balloon-size) * 1.18);
  border: 0;
  background: transparent;
}

.balloon-face {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--balloon-size);
  height: calc(var(--balloon-size) * 1.04);
  border: 6px solid #fff;
  border-radius: 50% 50% 47% 47%;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 255, 255, 0.85) 0 13%, transparent 14%),
    hsl(var(--balloon-hue) 78% 58%);
  color: #fff;
  font-size: clamp(54px, 7vw, 106px);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.14);
  box-shadow:
    inset -12px -18px 0 rgba(0, 0, 0, 0.12),
    0 18px 28px rgba(76, 63, 51, 0.2);
}

.balloon-face::after {
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 24px;
  height: 22px;
  background: inherit;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
  transform: translateX(-50%);
}

.balloon-string {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: #7b8a8d;
  transform: translateX(-50%);
}

.count-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  width: min(360px, 34vw);
  min-height: clamp(260px, 34vh, 360px);
  padding: clamp(16px, 2vw, 24px);
  border: 6px solid #fff;
  border-radius: 24px;
  background: #eaf6ff;
  box-shadow:
    inset 0 -10px 0 rgba(47, 142, 216, 0.13),
    0 16px 28px rgba(56, 58, 63, 0.16);
}

.count-side:nth-child(2) {
  background: #eef9e9;
  box-shadow:
    inset 0 -10px 0 rgba(95, 189, 127, 0.14),
    0 16px 28px rgba(56, 58, 63, 0.16);
}

.count-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  place-items: center;
  align-content: center;
  gap: clamp(8px, 1vw, 13px);
}

.count-items img {
  width: clamp(48px, 5vw, 72px);
  height: clamp(48px, 5vw, 72px);
  object-fit: contain;
  transform: rotate(var(--item-tilt));
  filter: drop-shadow(0 7px 8px rgba(69, 47, 25, 0.16));
}

.count-label {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 18px;
  background: #fff;
  color: #24343d;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
}

.balloon-option.correct .balloon-face,
.count-side.correct {
  outline: 8px solid #ffcf4a;
  outline-offset: 6px;
  animation: pulse 900ms ease-in-out infinite;
}

.balloon-option.wrong .balloon-face,
.count-side.wrong {
  opacity: 0.55;
  transform: scale(0.96);
}

.math-game-finish {
  place-items: center;
  min-height: min(450px, 62%);
}

.math-game-stars {
  display: flex;
  gap: 18px;
  color: #ffcf4a;
  font-size: clamp(70px, 9vw, 128px);
  text-shadow:
    0 5px 0 #fff,
    0 14px 18px rgba(107, 83, 45, 0.18);
}

.home-button {
  background: var(--green);
  font-size: clamp(28px, 3vw, 42px);
}

.math-park {
  position: absolute;
  inset: clamp(20px, 3vw, 38px);
  z-index: 9;
  overflow: hidden;
  border: 7px solid #fff;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #bfefff 0 43%, transparent 43%),
    radial-gradient(ellipse at 50% 110%, #8fd46e 0 58%, #6abc64 59% 100%);
  box-shadow: 0 24px 48px rgba(89, 63, 28, 0.24);
}

.park-title {
  position: absolute;
  left: 50%;
  top: 6%;
  z-index: 4;
  display: grid;
  gap: 4px;
  place-items: center;
  min-width: min(520px, 70vw);
  padding: 16px 28px;
  border: 5px solid #fff;
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.92);
  color: #26353d;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 900;
  transform: translateX(-50%);
}

.park-title strong {
  color: #5d714f;
  font-size: clamp(15px, 1.55vw, 22px);
}

.park-sun {
  position: absolute;
  right: 9%;
  top: 8%;
  width: clamp(54px, 7vw, 90px);
  height: clamp(54px, 7vw, 90px);
  border-radius: 50%;
  background: #ffcf4a;
  box-shadow: 0 0 34px rgba(255, 207, 74, 0.7);
}

.park-cloud {
  position: absolute;
  width: clamp(88px, 11vw, 150px);
  height: clamp(34px, 4vw, 56px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.park-cloud::before,
.park-cloud::after {
  position: absolute;
  bottom: 8px;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.park-cloud::before {
  left: 18%;
  width: 42%;
  height: 92%;
}

.park-cloud::after {
  right: 16%;
  width: 48%;
  height: 118%;
}

.cloud-a {
  left: 8%;
  top: 13%;
}

.cloud-b {
  right: 22%;
  top: 22%;
  transform: scale(0.72);
}

.park-path {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: #f5d18c;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.24);
}

.path-main {
  left: 48%;
  bottom: -20%;
  width: 18%;
  height: 68%;
  transform: rotate(12deg);
}

.path-branch {
  left: 22%;
  bottom: 19%;
  width: 58%;
  height: 13%;
  transform: rotate(-5deg);
}

.park-zone {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 10px;
  width: clamp(150px, 17vw, 236px);
  min-height: clamp(136px, 17vw, 218px);
  padding: 14px;
  border: 5px solid #fff;
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.9);
  color: #26353d;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(67, 72, 42, 0.18);
}

.park-zone.open {
  outline: 8px solid rgba(255, 207, 74, 0.64);
  outline-offset: 5px;
}

.park-zone.locked {
  opacity: 0.82;
}

.train-zone {
  left: 10%;
  bottom: 24%;
}

.necklace-zone {
  right: 13%;
  bottom: 26%;
}

.cake-zone {
  left: 40%;
  bottom: 11%;
}

.orchard-zone {
  left: 42%;
  top: 24%;
}

.zone-label {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: #26353d;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.08;
}

.zone-building {
  position: relative;
  display: block;
  width: clamp(96px, 10vw, 138px);
  height: clamp(78px, 9vw, 118px);
}

.train-station {
  border: 6px solid #7f5733;
  border-radius: 12px 12px 8px 8px;
  background:
    linear-gradient(90deg, transparent 0 38%, #7f5733 38% 44%, transparent 44% 56%, #7f5733 56% 62%, transparent 62%),
    #ffd66b;
}

.station-roof {
  position: absolute;
  left: 50%;
  top: -26px;
  width: 118%;
  height: 42px;
  border-radius: 9px 9px 0 0;
  background: #ef4f52;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.station-clock {
  position: absolute;
  left: 50%;
  top: 15%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #2f8ed8;
  color: #fff;
  transform: translateX(-50%);
}

.station-track {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 10px;
  height: 10px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #7f5733 0 14px, #fff 14px 22px);
}

.necklace-shop {
  border-radius: 50% 50% 20px 20px;
  background:
    radial-gradient(circle at 28% 68%, #ef4f52 0 10px, transparent 11px),
    radial-gradient(circle at 50% 72%, #ffcf4a 0 10px, transparent 11px),
    radial-gradient(circle at 72% 68%, #2f8ed8 0 10px, transparent 11px),
    #f6b7cb;
}

.cake-house {
  border-radius: 18px 18px 12px 12px;
  background:
    linear-gradient(180deg, #fff 0 20%, transparent 20%),
    radial-gradient(circle at 35% 42%, #ef4f52 0 8px, transparent 9px),
    radial-gradient(circle at 63% 42%, #ffcf4a 0 8px, transparent 9px),
    #d59be8;
}

.orchard {
  background:
    radial-gradient(circle at 30% 28%, #ef4f52 0 8px, transparent 9px),
    radial-gradient(circle at 66% 34%, #ffcf4a 0 8px, transparent 9px),
    radial-gradient(circle at 44% 60%, #ef4f52 0 8px, transparent 9px),
    radial-gradient(circle at 50% 44%, #5fbd7f 0 46%, transparent 47%),
    linear-gradient(90deg, transparent 0 43%, #8a5a2b 43% 57%, transparent 57%);
}

.pattern-train .math-game-body {
  display: grid;
  grid-template-rows: minmax(130px, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
}

.train-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 1.4vw, 16px);
  min-height: 160px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, transparent 0 68%, rgba(127, 87, 51, 0.18) 68% 73%, transparent 73%),
    rgba(255, 255, 255, 0.45);
}

.train-engine,
.train-car,
.train-choice {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(92px, 9vw, 128px);
  min-height: clamp(96px, 9vw, 128px);
  border: 5px solid #fff;
  border-radius: 20px;
  background: #2f8ed8;
  color: #fff;
  font-weight: 900;
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.15),
    0 12px 18px rgba(47, 85, 117, 0.18);
}

.train-engine {
  width: clamp(112px, 10vw, 150px);
  background:
    radial-gradient(circle at 78% 28%, #ffcf4a 0 12px, transparent 13px),
    #ef4f52;
  font-size: clamp(18px, 1.7vw, 24px);
}

.train-engine::before,
.train-car::before,
.train-choice::before {
  position: absolute;
  left: 18%;
  bottom: -15px;
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #26353d;
  content: "";
  box-shadow: clamp(48px, 5vw, 68px) 0 0 #26353d;
}

.train-car:nth-child(odd),
.train-choice:nth-child(2) {
  background: #5fbd7f;
}

.train-car:nth-child(3n),
.train-choice:nth-child(3) {
  background: #8b5bd2;
}

.train-gap {
  border-style: dashed;
  background: #fff7d9;
  color: #947336;
  box-shadow: inset 0 0 0 6px rgba(255, 207, 74, 0.28);
}

.car-number {
  display: block;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 1;
}

.car-dots {
  display: grid;
  grid-template-columns: repeat(3, 10px);
  gap: 5px;
  justify-content: center;
  min-height: 28px;
  margin-top: 8px;
}

.car-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.candidate-yard {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
}

.train-choice {
  background: #ff9e36;
}

.train-choice.correct,
.train-car.filled,
.train-car.lit {
  outline: 8px solid #ffcf4a;
  outline-offset: 5px;
}

.train-car.lit {
  animation: pulse 700ms ease-in-out;
}

.train-choice.wrong {
  opacity: 0.56;
  transform: scale(0.96);
}

.art-park {
  inset: 0;
  border: 0;
  border-radius: 22px;
  background: #bfefff;
  overflow: hidden;
}

.art-park::before,
.train-static-art::before {
  position: absolute;
  inset: -18px;
  z-index: 0;
  background: url("./assets/visuals/raster/math-park-main.png") center / cover no-repeat;
  content: "";
  filter: blur(16px);
  opacity: 0.62;
  transform: scale(1.04);
}

.train-static-art::before {
  display: none;
}

.art-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  overflow: hidden;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 38px rgba(74, 92, 54, 0.12);
}

.math-park-art,
.pattern-train-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.pattern-train-art-frame::after {
  position: absolute;
  left: 18.5%;
  top: 57.6%;
  z-index: 2;
  width: 64.5%;
  height: 24.6%;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background: rgba(81, 169, 153, 0.2);
  box-shadow:
    inset 0 0 0 4px rgba(255, 207, 74, 0.32),
    0 14px 26px rgba(63, 88, 62, 0.16);
  content: "";
  pointer-events: none;
}

.train-art-value-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.train-art-progress {
  position: absolute;
  left: 50%;
  top: 19.1%;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 42%;
  height: 7%;
  padding: 0 4.8%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 250, 232, 0.98) 0 48%, rgba(255, 239, 199, 0.98) 100%);
  box-shadow:
    0 5px 10px rgba(102, 72, 28, 0.1),
    inset 0 0 0 2px rgba(255, 255, 255, 0.72);
  transform: translateX(-50%);
  pointer-events: none;
}

.train-art-progress::before,
.train-art-progress::after {
  position: absolute;
  left: 13%;
  top: 50%;
  z-index: 0;
  height: clamp(4px, 0.48vw, 7px);
  border-radius: 999px;
  content: "";
  transform: translateY(-50%);
}

.train-art-progress::before {
  right: 13%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(92, 66, 32, 0.14);
}

.train-art-progress::after {
  width: calc(74% * var(--train-progress));
  background: linear-gradient(90deg, #77c62d, #49aa16);
}

.train-art-progress-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(22px, 2.5vw, 36px);
  height: clamp(22px, 2.5vw, 36px);
  border: 3px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9d5c8, #bdb7aa);
  color: #fff;
  font-size: clamp(14px, 1.5vw, 22px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(83, 54, 16, 0.25);
  box-shadow:
    0 3px 8px rgba(88, 66, 34, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.train-art-progress-dot.is-done,
.train-art-progress-dot.is-current {
  background: linear-gradient(180deg, #83cf32, #48a914);
}

.train-art-progress-dot.is-current {
  transform: scale(1.08);
}

.train-art-slot,
.train-choice-label,
.train-art-choice {
  position: absolute;
  display: grid;
  align-content: center;
  grid-template-rows: auto auto;
  gap: 8px;
  place-items: center;
  border: 2px solid rgba(255, 249, 224, 0.9);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff7dc 0%, #fff0c6 100%);
  color: #5b3615;
  font-weight: 900;
  box-shadow:
    inset 0 -4px 0 rgba(116, 78, 32, 0.08),
    0 5px 9px rgba(93, 57, 26, 0.08);
}

.train-art-slot {
  --train-slot-start: 37.9%;
  --train-slot-step: 13.35%;
  top: 41%;
  width: 11.6%;
  height: 8.8%;
  font-size: clamp(20px, 2.4vw, 37px);
  transform: translateX(-50%);
}

.train-art-slot-a {
  left: var(--train-slot-start);
}

.train-art-slot-b {
  left: calc(var(--train-slot-start) + var(--train-slot-step));
}

.train-art-slot-gap {
  left: calc(var(--train-slot-start) + var(--train-slot-step) * 2);
  top: 41%;
  width: 11.6%;
  height: 8.8%;
  border: 0;
  background: transparent;
  font-size: clamp(34px, 4.5vw, 66px);
  box-shadow: none;
}

.train-art-slot-d {
  left: calc(var(--train-slot-start) + var(--train-slot-step) * 3);
}

.train-art-slot .car-number,
.train-choice-label .car-number,
.train-art-choice .car-number,
.static-fill-label .car-number {
  font-size: 1em;
}

.train-art-slot .car-dots,
.train-choice-label .car-dots,
.train-art-choice .car-dots,
.static-fill-label .car-dots {
  grid-template-columns: repeat(4, 8px);
  gap: 3px 5px;
  min-height: 18px;
  margin-top: 0;
  margin-bottom: 0;
}

.train-art-slot .car-dots i,
.train-choice-label .car-dots i,
.train-art-choice .car-dots i,
.static-fill-label .car-dots i {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(130, 72, 16, 0.42);
  background:
    radial-gradient(circle at 35% 30%, #fff9b8 0 23%, #ffd349 32%, #f0a22e 100%);
  box-shadow:
    0 1px 0 rgba(90, 48, 15, 0.22),
    inset 0 -1px 1px rgba(129, 67, 13, 0.22);
}

.park-hotspot {
  position: absolute;
  z-index: 5;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.01);
}

.park-hotspot:active {
  background: rgba(255, 207, 74, 0.18);
  transform: scale(0.98);
}

.train-hotspot {
  left: 13%;
  top: 27%;
  width: 30%;
  height: 36%;
}

.necklace-hotspot {
  left: 45%;
  top: 26%;
  width: 20%;
  height: 26%;
}

.construction-hotspot {
  left: 44%;
  top: 22%;
  width: 23%;
  height: 32%;
}

.cake-hotspot {
  left: 64%;
  top: 26%;
  width: 19%;
  height: 29%;
}

.orchard-hotspot {
  left: 66%;
  top: 53%;
  width: 26%;
  height: 25%;
}

.park-badge {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 96px;
  padding: 8px 12px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(255, 248, 221, 0.94);
  color: #314047;
  font-size: clamp(13px, 1.4vw, 20px);
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(70, 78, 55, 0.18);
  pointer-events: none;
}

.train-badge {
  left: 20%;
  top: 24%;
  transform: translateX(-50%) rotate(-3deg);
}

.construction-badge {
  left: 55%;
  top: 20%;
  background: rgba(255, 232, 150, 0.96);
  transform: translateX(-50%) rotate(3deg);
}

.park-choice-button {
  min-width: clamp(150px, 14vw, 196px);
  min-height: clamp(64px, 8vh, 82px);
  padding: 0 20px;
  border-radius: 20px;
  font-size: clamp(22px, 2.2vw, 32px);
}

.construction-choice-button {
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.7), transparent 24%),
    #ee9940;
}

.park-home-button {
  background: var(--green);
}

.train-static-art {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: #f8efd8;
  box-shadow: none;
  transform: none;
}

.train-art-choice {
  position: absolute;
  z-index: 6;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  width: 12.4%;
  height: 8.6%;
  font-size: clamp(21px, 2.8vw, 38px);
  transform: translate(-50%, -50%);
}

.train-art-choice:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.train-art-choice-a {
  left: 30.1%;
  top: 70.9%;
}

.train-art-choice-b {
  left: 49.6%;
  top: 70.9%;
}

.train-art-choice-c {
  left: 68.9%;
  top: 70.9%;
}

.train-choice-label {
  left: 18%;
  top: 29%;
  width: 64%;
  height: 42%;
  z-index: 6;
  font-size: clamp(21px, 2.8vw, 38px);
  pointer-events: none;
}

.train-art-choice.correct {
  outline: 9px solid rgba(255, 207, 74, 0.85);
  outline-offset: 5px;
  background: rgba(255, 207, 74, 0.2);
}

.train-art-choice.wrong {
  outline: 7px solid rgba(239, 79, 82, 0.66);
  outline-offset: 4px;
  background: rgba(239, 79, 82, 0.12);
}

.static-fill-car {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background-repeat: no-repeat;
  box-shadow:
    0 14px 26px rgba(82, 51, 24, 0.22),
    0 0 0 5px rgba(255, 255, 255, 0.74);
  transition:
    transform 820ms cubic-bezier(0.2, 0.8, 0.22, 1);
  transform-origin: left top;
}

.static-fill-car.moving {
  transform: translate(var(--move-x), var(--move-y)) scale(var(--scale-x), var(--scale-y));
}

.static-fill-label {
  position: absolute;
  left: 18%;
  top: 19%;
  display: grid;
  align-content: center;
  grid-template-rows: auto auto;
  gap: 8px;
  place-items: center;
  width: 64%;
  height: 50%;
  border: 2px solid rgba(255, 249, 224, 0.9);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff7dc 0%, #fff0c6 100%);
  color: #5b3615;
  font-size: clamp(18px, 3vw, 44px);
  font-weight: 900;
  box-shadow:
    inset 0 -4px 0 rgba(116, 78, 32, 0.08),
    0 5px 9px rgba(93, 57, 26, 0.08);
}

.train-departure-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 222, 0.2), rgba(255, 235, 174, 0.16)),
    rgba(255, 250, 235, 0.08);
  pointer-events: none;
}

.departure-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 10px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, #b87937 0 28px, #e1ad65 28px 42px),
    #b87937;
  box-shadow:
    0 7px 0 rgba(94, 56, 20, 0.14),
    0 -8px 0 rgba(255, 255, 255, 0.26);
}

.departure-train {
  position: absolute;
  right: -74%;
  bottom: 21.5%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: max-content;
  animation: trainDepart 4800ms cubic-bezier(0.22, 0.72, 0.28, 1) forwards;
  filter: drop-shadow(0 18px 18px rgba(78, 49, 23, 0.18));
}

.departure-engine,
.departure-carriage {
  position: relative;
  flex: 0 0 auto;
}

.departure-engine {
  width: clamp(170px, 18vw, 252px);
  height: clamp(118px, 12.6vw, 176px);
}

.departure-engine-nose {
  position: absolute;
  left: 0;
  bottom: 34%;
  width: 58%;
  height: 42%;
  border-radius: 999px 28px 24px 999px;
  background: linear-gradient(180deg, #2b98d0, #1673aa);
  border: 3px solid rgba(20, 94, 141, 0.35);
  box-shadow: inset 0 8px 12px rgba(255, 255, 255, 0.28);
}

.departure-engine-nose::before {
  content: "";
  position: absolute;
  left: -7%;
  top: 20%;
  width: 18%;
  height: 58%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6251, #d63832);
}

.departure-stack {
  position: absolute;
  left: 22%;
  top: 4%;
  width: 17%;
  height: 38%;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, #ffd458 0 32%, #196f9f 33% 100%);
  box-shadow: inset 0 4px 5px rgba(255, 255, 255, 0.38);
}

.departure-cab {
  position: absolute;
  right: 0;
  bottom: 30%;
  width: 43%;
  height: 58%;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #ef463a 0 24%, #197fb9 25% 100%);
  border: 3px solid rgba(17, 93, 143, 0.35);
}

.departure-cab::before {
  content: "";
  position: absolute;
  left: 26%;
  top: 33%;
  width: 32%;
  height: 34%;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff6d6, #bfe5eb);
  border: 3px solid #ffd45c;
}

.departure-engine-base {
  position: absolute;
  left: 0;
  right: 2%;
  bottom: 14%;
  height: 23%;
  border-radius: 10px;
  background: linear-gradient(180deg, #ae753d, #7a4a24);
}

.departure-engine-base::before {
  content: "";
  position: absolute;
  left: -6%;
  bottom: -8%;
  width: 22%;
  height: 52%;
  transform: skewX(-18deg);
  border-radius: 6px;
  background: linear-gradient(180deg, #ff6a50, #dc3e32);
}

.departure-wheel {
  position: absolute;
  bottom: 0;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #3f3730 0 23%, #ffd457 25% 57%, #de982a 60% 100%);
  border: 3px solid rgba(122, 73, 25, 0.42);
}

.departure-wheel::after {
  content: "";
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: #5d3f23;
}

.wheel-a {
  left: 28%;
}

.wheel-b {
  left: 54%;
}

.wheel-c {
  right: 0;
}

.departure-coupler {
  flex: 0 0 clamp(18px, 2vw, 32px);
  height: clamp(12px, 1.2vw, 18px);
  margin-bottom: clamp(42px, 4.5vw, 66px);
  border-radius: 999px;
  background: linear-gradient(180deg, #1c73a7, #0d5e8e);
  box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.25);
}

.departure-carriage {
  width: clamp(130px, 14.8vw, 220px);
  height: clamp(104px, 11.6vw, 172px);
  border-radius: 16px 16px 10px 10px;
  background:
    linear-gradient(180deg, #ef463a 0 22%, transparent 23%),
    linear-gradient(180deg, #1988c5 0 75%, #a66c35 76% 100%);
  border: 3px solid rgba(17, 93, 143, 0.32);
  box-shadow:
    inset 0 7px 10px rgba(255, 255, 255, 0.28),
    0 5px 0 rgba(255, 255, 255, 0.7);
}

.departure-carriage::before,
.departure-carriage::after {
  content: "";
  position: absolute;
  bottom: -13%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #3f3730 0 22%, #ffd457 24% 57%, #de982a 60% 100%);
  border: 3px solid rgba(122, 73, 25, 0.42);
}

.departure-carriage::before {
  left: 12%;
}

.departure-carriage::after {
  right: 12%;
}

.departure-carriage span {
  position: absolute;
  left: 18%;
  top: 30%;
  width: 64%;
  height: 40%;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8dc, #d8eff1);
  border: 3px solid rgba(255, 247, 215, 0.95);
}

.carriage-yellow {
  background:
    linear-gradient(180deg, #ffcf53 0 22%, transparent 23%),
    linear-gradient(180deg, #36a871 0 75%, #a66c35 76% 100%);
}

.carriage-red {
  background:
    linear-gradient(180deg, #ef463a 0 22%, transparent 23%),
    linear-gradient(180deg, #906bc5 0 75%, #a66c35 76% 100%);
}

.departure-smoke {
  position: absolute;
  left: 7%;
  top: -8%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
  animation: smokePuff 900ms ease-out infinite;
}

.smoke-b {
  left: 10%;
  top: -16%;
  animation-delay: 180ms;
}

.smoke-c {
  left: 4%;
  top: -20%;
  animation-delay: 340ms;
}

.construction-game {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(211, 241, 248, 0.92) 0 48%, rgba(255, 247, 221, 0.95) 48%),
    #fff8df;
}

.construction-scene {
  position: relative;
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background:
    linear-gradient(180deg, transparent 0 58%, rgba(138, 102, 64, 0.16) 58%),
    repeating-linear-gradient(90deg, rgba(96, 119, 104, 0.08) 0 36px, transparent 36px 72px),
    #e8f5f0;
}

.construction-skyline {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crane-mast {
  position: absolute;
  right: 14%;
  top: 10%;
  width: clamp(16px, 1.8vw, 26px);
  height: 52%;
  border-radius: 5px;
  background:
    repeating-linear-gradient(180deg, #f0ad32 0 12px, #915f22 12px 16px);
}

.crane-boom {
  position: absolute;
  right: 13%;
  top: 9%;
  width: 36%;
  height: clamp(16px, 1.8vw, 24px);
  border-radius: 5px;
  background:
    repeating-linear-gradient(90deg, #f0ad32 0 22px, #915f22 22px 28px);
  transform: rotate(-7deg);
  transform-origin: right center;
}

.crane-hook {
  position: absolute;
  right: 39%;
  top: 16%;
  width: 3px;
  height: 62px;
  background: #4d5961;
}

.crane-hook::after {
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 20px;
  height: 20px;
  border-right: 5px solid #4d5961;
  border-bottom: 5px solid #4d5961;
  border-radius: 0 0 14px 0;
  content: "";
  transform: translateX(-50%);
}

.steel-beam {
  position: relative;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: clamp(12px, 2vw, 28px);
  width: min(860px, 88%);
  min-height: clamp(150px, 20vh, 230px);
  padding: clamp(22px, 3vw, 36px);
  border: 6px solid #e9f1f3;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #9db6c0 0%, #6c8792 52%, #59737f 100%);
  box-shadow:
    inset 0 10px 0 rgba(255, 255, 255, 0.28),
    inset 0 -12px 0 rgba(37, 54, 63, 0.24),
    0 24px 34px rgba(61, 76, 55, 0.22);
}

.beam-rivet {
  position: absolute;
  inset: 14px;
  border: 3px dashed rgba(238, 248, 249, 0.42);
  border-radius: 14px;
  pointer-events: none;
}

.screw-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: clamp(96px, 13vw, 150px);
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    radial-gradient(circle, rgba(26, 39, 47, 0.34) 0 34%, transparent 35%),
    rgba(255, 255, 255, 0.14);
}

.screw-slot.is-gap {
  border-style: dashed;
  background:
    radial-gradient(circle, rgba(34, 51, 61, 0.44) 0 37%, transparent 38%),
    rgba(255, 218, 95, 0.18);
}

.screw-slot.locked {
  outline: 8px solid rgba(255, 207, 74, 0.7);
  outline-offset: 4px;
}

.screw-question {
  display: grid;
  place-items: center;
  width: clamp(66px, 8vw, 112px);
  height: clamp(66px, 8vw, 112px);
  border: 7px dashed #edf6f8;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(184, 200, 207, 0.5) 0 58%, rgba(109, 133, 143, 0.5) 59% 100%);
  color: #4a5f69;
  font-size: clamp(44px, 5vw, 74px);
  font-weight: 900;
  box-shadow: inset 0 -7px 0 rgba(42, 63, 74, 0.12);
}

.screw-head {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(74px, 8vw, 118px);
  height: clamp(74px, 8vw, 118px);
  border: 7px solid #edf6f8;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    radial-gradient(circle, #b8c8cf 0 58%, #6d858f 59% 100%);
  color: #26333a;
  font-weight: 900;
  box-shadow:
    inset 0 -10px 0 rgba(42, 63, 74, 0.18),
    0 12px 18px rgba(37, 47, 54, 0.2);
}

.screw-head.installed {
  filter: saturate(0.95);
}

.screw-slot-line {
  position: absolute;
  left: 24%;
  right: 24%;
  top: 50%;
  z-index: 1;
  height: 16%;
  border-radius: 999px;
  background: #455963;
  transform: translateY(-50%);
}

.screw-slot-line::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  content: "";
  transform: rotate(90deg);
}

.screw-number {
  position: absolute;
  right: -10%;
  top: -8%;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 42%;
  height: 42%;
  border: 4px solid #fff8d6;
  border-radius: 50%;
  background: #ffcf4a;
  color: #2f2b19;
  font-size: clamp(21px, 2.3vw, 34px);
  line-height: 1;
  box-shadow: 0 5px 8px rgba(45, 46, 42, 0.18);
}

.screw-dots {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, clamp(8px, 0.8vw, 11px));
  gap: clamp(4px, 0.45vw, 6px);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 250, 225, 0.82);
  box-shadow: 0 5px 9px rgba(45, 46, 42, 0.12);
  transform: translateX(-50%);
}

.screw-dots i {
  width: clamp(8px, 0.8vw, 11px);
  height: clamp(8px, 0.8vw, 11px);
  border-radius: 50%;
  background: #455963;
}

.screw-tray {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 36px);
  padding: clamp(16px, 2vw, 26px);
  background:
    linear-gradient(180deg, rgba(120, 91, 57, 0.18), rgba(83, 61, 40, 0.26)),
    #e0b06f;
}

.screw-choice,
.screw-tighten {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.screw-choice {
  min-width: clamp(96px, 10vw, 142px);
  min-height: clamp(96px, 10vw, 142px);
  border-radius: 50%;
}

.screw-choice:active {
  transform: scale(0.96);
}

.screw-tighten:active .screw-head {
  filter: brightness(1.05);
}

.screw-choice.correct .screw-head {
  outline: 8px solid rgba(68, 168, 75, 0.7);
  outline-offset: 5px;
}

.screw-choice.wrong .screw-head {
  outline: 8px solid rgba(239, 79, 82, 0.7);
  outline-offset: 5px;
  opacity: 0.64;
}

.flying-screw {
  position: absolute;
  z-index: 8;
  width: 0;
  height: 0;
  transition: transform 620ms cubic-bezier(0.2, 0.8, 0.22, 1);
}

.flying-screw .screw-head {
  transform: translate(-50%, -50%);
}

.flying-screw.moving {
  transform: translate(var(--fly-x), var(--fly-y)) rotate(240deg);
}

.screw-tighten {
  --screw-turn: 0deg;
  --screw-depth: 0px;
  --driver-turn: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(144px, 13vw, 198px);
  height: clamp(178px, 17vw, 250px);
  border-radius: 18px;
  transform: translate(-50%, -50%) translateY(var(--screw-depth));
  touch-action: none;
  user-select: none;
  overflow: visible;
}

.screw-tighten .screw-head {
  z-index: 2;
  transform: rotate(var(--screw-turn));
  transition: transform 230ms ease-out;
}

.screw-tighten.turning .screw-head {
  animation: screwPulse 260ms ease-out;
}

.screwdriver {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  grid-template-rows: 38% 50% 12%;
  justify-items: center;
  width: clamp(26px, 3vw, 44px);
  height: clamp(96px, 10.5vw, 142px);
  pointer-events: none;
  transform: translate(-50%, -95%) rotate(calc(1deg + var(--driver-turn)));
  transform-origin: 50% 92%;
  transition:
    opacity 180ms ease,
    transform 220ms ease-out;
}

.screwdriver-handle {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 244, 211, 0.9);
  border-radius: 13px 13px 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.44), transparent 34%),
    #ef4f52;
  box-shadow:
    inset 0 -7px 0 rgba(126, 38, 36, 0.22),
    0 8px 13px rgba(47, 52, 57, 0.18);
}

.screwdriver-shaft {
  width: 28%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #f4fbff 0 35%, #8aa1ac 36% 100%);
  box-shadow: 0 5px 9px rgba(36, 45, 52, 0.18);
}

.screwdriver-tip {
  width: 44%;
  height: 100%;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: #556a75;
}

.screw-tighten.driving .screwdriver {
  animation: screwdriverDrive 220ms ease-out;
}

.screw-tighten.holding .screwdriver-handle {
  box-shadow:
    inset 0 -7px 0 rgba(126, 38, 36, 0.22),
    0 0 0 8px rgba(255, 207, 74, 0.32),
    0 8px 13px rgba(47, 52, 57, 0.18);
}

.screw-tighten.locked .screw-head {
  border-color: #f5fbfc;
  box-shadow:
    inset 0 -5px 0 rgba(42, 63, 74, 0.14),
    0 5px 8px rgba(37, 47, 54, 0.16);
}

.screw-tighten.locked .screwdriver {
  opacity: 0;
  transform: translate(-50%, -118%) rotate(calc(2deg + var(--driver-turn)));
}

.screw-modal {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 36px);
  background: rgba(34, 48, 56, 0.28);
}

.screw-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 18px);
  width: min(780px, 82vw);
  height: min(620px, 78vh);
  padding: clamp(20px, 3vw, 34px);
  border: 7px solid #fff;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #dff6fb 0 46%, #fff5d9 46% 100%);
  box-shadow: 0 26px 54px rgba(32, 43, 48, 0.34);
}

.screw-modal-title {
  color: #506a54;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
  text-align: center;
}

.screw-action-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 207, 74, 0.18) 0 26%, transparent 27%),
    linear-gradient(180deg, rgba(156, 184, 194, 0.18), rgba(104, 129, 139, 0.2)),
    #edf7f6;
}

.screw-action-area::before {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(430px, 48vw);
  height: min(220px, 25vh);
  border: 6px solid #e9f1f3;
  border-radius: 22px;
  background: linear-gradient(180deg, #9db6c0 0%, #6c8792 52%, #59737f 100%);
  box-shadow:
    inset 0 10px 0 rgba(255, 255, 255, 0.28),
    inset 0 -12px 0 rgba(37, 54, 63, 0.24),
    0 20px 30px rgba(61, 76, 55, 0.2);
  content: "";
  transform: translate(-50%, -50%);
}

.screw-hold-meter {
  position: absolute;
  left: 50%;
  bottom: clamp(22px, 4vh, 42px);
  z-index: 5;
  overflow: hidden;
  width: min(360px, 48vw);
  height: clamp(18px, 2.2vh, 26px);
  border: 4px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  transform: translateX(-50%);
}

.screw-hold-meter span {
  display: block;
  width: calc(var(--screw-progress) * 100%);
  height: 100%;
  border-radius: inherit;
  background: #ffcf4a;
  transition: width 120ms linear;
}

.screw-modal .screw-tighten {
  z-index: 6;
  width: min(360px, 44vw);
  height: min(450px, 58vh);
}

.screw-modal .screw-head {
  width: clamp(150px, 18vw, 236px);
  height: clamp(150px, 18vw, 236px);
  border-width: 11px;
}

.screw-modal .screw-slot-line {
  height: 15%;
}

.screw-modal .screw-number {
  right: -8%;
  top: -7%;
  min-width: 38%;
  height: 38%;
  border-width: 6px;
  font-size: clamp(36px, 4vw, 58px);
}

.screw-modal .screw-dots {
  top: calc(100% + 14px);
  grid-template-columns: repeat(4, clamp(13px, 1.4vw, 18px));
  gap: clamp(7px, 0.8vw, 10px);
  padding: 7px 13px;
}

.screw-modal .screw-dots i {
  width: clamp(13px, 1.4vw, 18px);
  height: clamp(13px, 1.4vw, 18px);
}

.screw-modal .screwdriver {
  width: clamp(42px, 5vw, 68px);
  height: clamp(170px, 21vw, 260px);
  transform: translate(-50%, -93%) rotate(calc(1deg + var(--driver-turn)));
}

.screw-modal .screwdriver-handle {
  border-width: 6px;
  border-radius: 18px 18px 10px 10px;
}

.screw-modal .screw-tighten.holding .screwdriver-handle {
  box-shadow:
    inset 0 -10px 0 rgba(126, 38, 36, 0.22),
    0 0 0 12px rgba(255, 207, 74, 0.34),
    0 10px 16px rgba(47, 52, 57, 0.18);
}

.construction-finish {
  place-items: center;
  min-height: min(450px, 62%);
}

.finish-beam {
  display: grid;
  grid-template-columns: repeat(4, 82px);
  gap: 16px;
  padding: 24px;
  border: 6px solid #eef6f7;
  border-radius: 18px;
  background: linear-gradient(180deg, #8da8b3, #607a85);
  box-shadow: 0 18px 28px rgba(65, 73, 61, 0.22);
}

.finish-beam span {
  width: 72px;
  height: 72px;
  border: 7px solid #edf6f8;
  border-radius: 50%;
  background:
    linear-gradient(0deg, transparent 0 42%, #455963 43% 57%, transparent 58%),
    linear-gradient(90deg, transparent 0 42%, #455963 43% 57%, transparent 58%),
    radial-gradient(circle, #b8c8cf 0 58%, #6d858f 59% 100%);
}

.elevator-game {
  position: absolute;
  inset: clamp(18px, 2.4vw, 34px);
  z-index: 9;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  padding: clamp(16px, 2.4vw, 28px);
  border: 7px solid #fff;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(228, 247, 249, 0.94) 0 48%, rgba(255, 247, 221, 0.96) 48%),
    #f9f3df;
  color: #24343d;
  box-shadow: 0 24px 48px rgba(74, 69, 52, 0.22);
}

.elevator-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
}

.elevator-title,
.elevator-turn {
  font-weight: 900;
  line-height: 1;
}

.elevator-title {
  font-size: clamp(30px, 3.6vw, 54px);
}

.elevator-turn {
  display: grid;
  place-items: center;
  min-width: clamp(190px, 20vw, 300px);
  min-height: clamp(54px, 6vw, 76px);
  padding: 8px 22px;
  border: 5px solid #fff;
  border-radius: 999px;
  background: #ffcf4a;
  color: #26353d;
  font-size: clamp(24px, 2.7vw, 38px);
  box-shadow:
    inset 0 -7px 0 rgba(0, 0, 0, 0.12),
    0 10px 18px rgba(99, 70, 25, 0.16);
}

.elevator-score {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: clamp(28px, 3.6vw, 50px);
  color: rgba(80, 88, 90, 0.22);
}

.elevator-score .filled {
  color: #ffcf4a;
  text-shadow: 0 3px 0 #fff;
}

.elevator-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);
  gap: clamp(18px, 3vw, 38px);
  min-height: 0;
}

.elevator-shaft {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(79, 127, 155, 0.12) 0 33%, transparent 33% 66%, rgba(79, 127, 155, 0.12) 66%),
    repeating-linear-gradient(180deg, transparent 0 18%, rgba(255, 255, 255, 0.62) 18% calc(18% + 5px)),
    linear-gradient(180deg, #bde9f7, #e9f5ef 56%, #f3d7a2);
}

.floor-line {
  position: absolute;
  left: clamp(14px, 2vw, 26px);
  display: grid;
  place-items: center;
  width: clamp(46px, 5vw, 68px);
  height: clamp(46px, 5vw, 68px);
  border: 4px solid #fff;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.9);
  color: #37515c;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(72, 87, 91, 0.14);
  transform: translateY(50%);
}

.floor-line-1 {
  bottom: 8%;
}

.floor-line-2 {
  bottom: 26%;
}

.floor-line-3 {
  bottom: 44%;
}

.floor-line-4 {
  bottom: 62%;
}

.floor-line-5 {
  bottom: 80%;
}

.elevator-car {
  --floor: 0;
  position: absolute;
  left: 50%;
  bottom: calc(7% + var(--floor) * 18%);
  width: min(330px, 38vw);
  aspect-ratio: 1.05;
  overflow: hidden;
  border: 7px solid #fdfdf7;
  border-radius: 18px 18px 14px 14px;
  background:
    linear-gradient(90deg, transparent calc(50% - 3px), rgba(42, 73, 84, 0.2) calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)),
    linear-gradient(180deg, #91d7e7 0 18%, #f6fbf5 18% 100%);
  box-shadow:
    inset 0 -12px 0 rgba(50, 84, 96, 0.12),
    0 18px 30px rgba(52, 68, 75, 0.22);
  transform: translateX(-50%);
  transition: bottom 700ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.car-light {
  position: absolute;
  left: 50%;
  top: 7%;
  width: 18%;
  height: 10%;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #ffcf4a;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(255, 207, 74, 0.8);
}

.car-door {
  position: absolute;
  top: 22%;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 40%),
    #6fb4c9;
  transition: transform 360ms ease;
}

.car-door-left {
  left: 0;
  border-right: 3px solid rgba(42, 73, 84, 0.24);
}

.car-door-right {
  right: 0;
  border-left: 3px solid rgba(255, 255, 255, 0.28);
}

.elevator-car.doors-open .car-door-left {
  transform: translateX(-72%);
}

.elevator-car.doors-open .car-door-right {
  transform: translateX(72%);
}

.elevator-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 2vw, 20px);
  min-height: 0;
  padding: clamp(14px, 2vw, 24px);
  border: 6px solid #fff;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 240, 0.86)),
    #d7e6e2;
  box-shadow: inset 0 -10px 0 rgba(62, 84, 90, 0.1);
}

.elevator-signal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: clamp(64px, 7vw, 88px);
  padding: 10px 14px;
  border-radius: 18px;
  background: #25333a;
  color: #fff;
}

.signal-light {
  width: clamp(34px, 4vw, 52px);
  height: clamp(34px, 4vw, 52px);
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #ffcf4a;
  box-shadow: 0 0 18px rgba(255, 207, 74, 0.8);
}

.signal-label {
  overflow: hidden;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-countdown {
  display: grid;
  place-items: center;
  min-width: clamp(40px, 4.4vw, 58px);
  min-height: clamp(40px, 4.4vw, 58px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffcf4a;
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 900;
}

.elevator-game[data-phase="childWait"] .signal-light {
  background: #ee4e51;
  box-shadow: 0 0 18px rgba(238, 78, 81, 0.82);
}

.elevator-game[data-phase="child"] .signal-light {
  background: #5fbd7f;
  box-shadow: 0 0 20px rgba(95, 189, 127, 0.86);
}

.elevator-game[data-phase="child"] .elevator-turn {
  background: #5fbd7f;
  color: #fff;
}

.elevator-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 16px);
  align-content: center;
}

.elevator-button {
  display: grid;
  place-items: center;
  min-height: clamp(70px, 8vh, 104px);
  border: 5px solid #fff;
  border-radius: 18px;
  background: #eef4f2;
  color: #24343d;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 900;
  box-shadow:
    inset 0 -8px 0 rgba(45, 67, 73, 0.12),
    0 8px 12px rgba(61, 74, 78, 0.12);
}

.elevator-button-open,
.elevator-button-close {
  font-size: clamp(20px, 2.2vw, 30px);
}

.elevator-button.active-target {
  background: #ffcf4a;
  color: #26353d;
  box-shadow:
    inset 0 -8px 0 rgba(148, 96, 18, 0.16),
    0 0 0 8px rgba(255, 255, 255, 0.58),
    0 0 30px rgba(255, 207, 74, 0.72);
  animation: elevatorTargetPulse 1200ms ease-in-out infinite;
}

.elevator-button.waiting-target {
  background: #f5dad5;
  color: #8e3337;
}

.elevator-button.picked {
  transform: scale(0.96);
}

.elevator-button.wrong {
  background: #ee4e51;
  color: #fff;
}

.elevator-finish {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: grid;
  gap: 10px;
  place-items: center;
  min-width: min(520px, 76vw);
  padding: clamp(24px, 4vw, 44px);
  border: 7px solid #fff;
  border-radius: 26px;
  background: rgba(255, 250, 240, 0.96);
  color: #26353d;
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 48px rgba(74, 69, 52, 0.22);
}

.elevator-finish span + span {
  color: #ffcf4a;
  font-size: clamp(42px, 6vw, 86px);
}

.formula-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(255, 248, 214, 0.32);
}

.formula-card {
  display: grid;
  gap: 18px;
  place-items: center;
  min-width: min(740px, 82vw);
  padding: clamp(36px, 5vw, 68px);
  border: 8px solid #fff;
  border-radius: 28px;
  background: #ffcf4a;
  color: #24343d;
  font-size: clamp(76px, 10vw, 136px);
  font-weight: 900;
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.24);
}

.formula-hint {
  color: #5f4a16;
  font-size: clamp(18px, 2.1vw, 26px);
}

.retry-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(255, 248, 214, 0.2);
  pointer-events: none;
}

.retry-card {
  display: grid;
  gap: 12px;
  place-items: center;
  min-width: min(540px, 72vw);
  padding: clamp(30px, 4vw, 52px);
  border: 8px solid #fff;
  border-radius: 28px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.22);
  animation: retryPop 680ms ease-out;
}

.wait-cue {
  position: absolute;
  left: 50%;
  top: 22%;
  z-index: 14;
  display: grid;
  place-items: center;
  min-width: 220px;
  padding: 20px 32px;
  border: 6px solid #fff;
  border-radius: 28px;
  background: #ffcf4a;
  color: #26353d;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 900;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 20px 40px rgba(93, 67, 25, 0.22);
  animation: cuePop 900ms ease-out;
}

.watch-waiting .toy {
  cursor: default;
}

.gesture-guide {
  position: absolute;
  z-index: 13;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.gesture-path {
  position: absolute;
  left: 0;
  top: 0;
  height: 10px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #ffcf4a 0 18px, #ff8f3d 18px 30px);
  box-shadow: 0 7px 18px rgba(99, 70, 25, 0.18);
  transform-origin: left center;
}

.gesture-hand {
  position: absolute;
  left: -31px;
  top: -31px;
  width: 62px;
  height: 62px;
  border: 5px solid #23404c;
  border-radius: 50%;
  background:
    radial-gradient(circle at 58% 42%, #fff 0 4px, transparent 5px),
    #ffe1a5;
  box-shadow:
    inset -7px -8px 0 rgba(159, 103, 46, 0.18),
    0 14px 28px rgba(85, 57, 24, 0.22);
  animation: gestureHandMove 2100ms ease-in-out infinite;
}

.gesture-hand::after {
  position: absolute;
  left: 38px;
  top: 21px;
  width: 42px;
  height: 20px;
  border: 5px solid #23404c;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #ffe1a5;
  content: "";
}

.gesture-label {
  position: absolute;
  left: calc(var(--dx) / 2);
  top: calc(var(--dy) / 2 - 74px);
  min-width: 190px;
  padding: 12px 18px;
  border: 4px solid #fff;
  border-radius: 18px;
  background: #5fbd7f;
  color: #fff;
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 14px 24px rgba(46, 86, 56, 0.2);
}

.retry-title {
  font-size: clamp(54px, 7vw, 92px);
  font-weight: 900;
}

.retry-subtitle {
  color: #eaf8ef;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
}

.explore-on .toy:not(.dimmed):not(.blocks) {
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)) drop-shadow(0 13px 10px rgba(84, 54, 28, 0.16));
}

.explore-on .block {
  filter: drop-shadow(0 0 13px rgba(255, 255, 255, 0.9));
}

body:has(.tv-room) .app {
  grid-template-rows: minmax(0, 1fr);
}

body:has(.tv-room) .control-panel,
body:has(.tv-room) .progress {
  display: none;
}

.tv-room {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  padding: clamp(14px, 2.2vw, 28px);
  background:
    linear-gradient(180deg, rgba(153, 213, 203, 0.94), rgba(255, 238, 196, 0.96)),
    var(--wall);
}

.tv-set {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(1160px, 94vw);
  height: min(640px, 76vh);
  min-height: 360px;
  padding: clamp(26px, 3vw, 42px) clamp(30px, 3.6vw, 54px) clamp(48px, 5vw, 76px);
  border: clamp(12px, 1.6vw, 20px) solid #fff1c9;
  border-radius: 36px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 36%),
    #ef6f58;
  box-shadow:
    inset 0 -18px 0 rgba(132, 43, 40, 0.18),
    0 24px 40px rgba(93, 60, 34, 0.24);
}

.tv-set::before {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 18px;
  height: 16px;
  border-radius: 999px;
  background: rgba(114, 45, 39, 0.22);
  content: "";
}

.tv-antenna {
  position: absolute;
  top: -54px;
  left: 50%;
  width: 8px;
  height: 70px;
  border-radius: 999px;
  background: #4c5961;
  transform-origin: bottom;
}

.tv-antenna::before {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 5px solid #fff1c9;
  border-radius: 50%;
  background: #5fbd7f;
  content: "";
  transform: translateX(-50%);
}

.tv-antenna-left {
  transform: translateX(-50%) rotate(-28deg);
}

.tv-antenna-right {
  transform: translateX(-50%) rotate(28deg);
}

.tv-screen-shell {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(12px, 1.6vw, 18px);
  border: 9px solid #713e38;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent),
    #3d3136;
  box-shadow:
    inset 0 0 0 7px rgba(255, 255, 255, 0.12),
    0 12px 0 rgba(103, 43, 37, 0.2);
}

.tv-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 6px solid #18262e;
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #193847, #0d1d27 68%);
}

.tv-standby {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 18px),
    radial-gradient(circle at 50% 42%, rgba(111, 198, 181, 0.56), transparent 38%),
    #12303e;
}

.tv-video-picker {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(900px, 92%);
  height: min(360px, 86%);
  gap: 14px;
}

.tv-picker-title {
  color: #e9fbff;
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.24);
}

.tv-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  max-height: 100%;
  overflow: auto;
  padding: 4px 8px 10px;
  scrollbar-color: #ffcf3f rgba(255, 255, 255, 0.18);
  scrollbar-width: thin;
}

.tv-picker-grid::-webkit-scrollbar {
  width: 10px;
}

.tv-picker-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.tv-picker-grid::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18, 48, 62, 0.9);
  border-radius: 999px;
  background: #ffcf3f;
}

.tv-local-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 58px;
  padding: 10px 12px;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  background: #ffcf3f;
  color: #25333a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.18;
  text-align: left;
  box-shadow:
    inset 0 -7px 0 rgba(0, 0, 0, 0.12),
    0 8px 0 rgba(201, 141, 30, 0.72);
}

.tv-card-source {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #2f8ed8;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.tv-picker-loading {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: #e9fbff;
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 900;
  text-align: center;
}

.tv-play-card {
  display: grid;
  place-items: center;
  min-width: 230px;
  min-height: 116px;
  padding: 0 36px;
  border: 6px solid #fff;
  border-radius: 24px;
  background: #ffcf3f;
  color: #25333a;
  font-size: 34px;
  font-weight: 900;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.12),
    0 14px 0 #c98d1e,
    0 22px 30px rgba(0, 0, 0, 0.22);
}

.tv-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #05080a;
}

.tv-local-player {
  object-fit: contain;
}

.tv-knob-panel {
  position: absolute;
  right: clamp(18px, 2vw, 30px);
  bottom: clamp(12px, 1.5vw, 22px);
  display: flex;
  gap: 12px;
}

.tv-knob-panel span {
  width: 22px;
  height: 22px;
  border: 4px solid #fff1c9;
  border-radius: 50%;
  background: #5fbd7f;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}

.tv-knob-panel span:nth-child(2) {
  background: #2f8ed8;
}

.tv-knob-panel span:nth-child(3) {
  background: #ffcf3f;
}

.tv-foot {
  position: absolute;
  bottom: -34px;
  width: 122px;
  height: 40px;
  border-radius: 0 0 22px 22px;
  background: #713e38;
}

.tv-foot-left {
  left: 18%;
  transform: rotate(6deg);
}

.tv-foot-right {
  right: 18%;
  transform: rotate(-6deg);
}

.tv-actions {
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.tv-action {
  min-width: 132px;
  min-height: 58px;
  padding: 0 22px;
  border: 4px solid #fff;
  border-radius: 18px;
  background: #2f8ed8;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow:
    inset 0 -7px 0 rgba(0, 0, 0, 0.16),
    0 8px 0 rgba(34, 108, 167, 0.72);
}

.tv-home-action {
  background: #5fbd7f;
  box-shadow:
    inset 0 -7px 0 rgba(0, 0, 0, 0.16),
    0 8px 0 rgba(61, 152, 98, 0.72);
}

.hidden {
  display: none !important;
}

.dimmed {
  opacity: 0.26;
  pointer-events: none;
}

.highlight {
  filter: drop-shadow(0 0 16px #fff) drop-shadow(0 0 26px #ffcf4a);
  animation: pulse 1800ms ease-in-out infinite;
}

.big-hit {
  outline: 8px solid rgba(255, 255, 255, 0.58);
  outline-offset: 20px;
}

.big-hit.highlight {
  outline-color: rgba(255, 213, 69, 0.82);
}

.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.98)) drop-shadow(0 22px 22px rgba(84, 54, 28, 0.25));
}

.bounce {
  animation: bounce 1800ms ease-in-out;
}

.shake {
  animation: shake 900ms ease-in-out;
}

.arrived {
  animation: arrive 1800ms ease-in-out;
}

.happy {
  animation: happy 1800ms ease-in-out;
}

.sticker {
  position: absolute;
  left: 50%;
  top: 39%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 230px;
  height: 164px;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%) rotate(-5deg);
  box-shadow: none;
  transition:
    top 420ms ease,
    transform 420ms ease;
}

.sticker-face {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 14px 18px 12px;
  border: 7px solid #fff;
  border-radius: 26px;
  background: #ef4f52;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 22px 34px rgba(82, 51, 24, 0.23);
}

.sticker-face .asset-img {
  width: 100%;
  max-height: 92px;
  object-fit: contain;
}

.sticker-art {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
}

.sticker-art-svg {
  display: block;
  width: 100%;
  max-width: 178px;
  max-height: 100%;
}

.sticker-label {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(18px, 1.8vw, 24px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-yellow .sticker-face {
  background: #f3b63f;
  color: #26353d;
}

.reward-orange .sticker-face {
  background: #ef7c52;
}

.reward-blue .sticker-face {
  background: #4d91c8;
}

.reward-sky .sticker-face {
  background: #66b8d5;
  color: #26353d;
}

.reward-green .sticker-face {
  background: #5fbd7f;
}

.reward-teal .sticker-face {
  background: #4aa9a0;
}

.reward-red .sticker-face {
  background: #d95757;
}

.reward-ball .sticker-face {
  background: #2f8ed8;
}

.reward-apple .sticker-face {
  background: #5fbd7f;
}

.reward-train .sticker-face {
  background: #8b5bd2;
}

.sticker-board {
  position: absolute;
  left: 50%;
  bottom: 10%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 320px;
  height: 132px;
  border: 5px dashed #d6ae4a;
  border-radius: 22px;
  background: #fff7d9;
  color: #8a6b22;
  font-size: 30px;
  font-weight: 900;
  transform: translateX(-50%);
  box-shadow: 0 10px 18px rgba(109, 79, 32, 0.14);
}

.sticker-board strong {
  color: #5c704d;
  font-size: clamp(16px, 1.4vw, 20px);
}

.sticker-reward {
  position: absolute;
  inset: clamp(16px, 3vw, 36px);
  z-index: 26;
  overflow: hidden;
  border: 7px solid #fff;
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 22%, rgba(255, 207, 74, 0.32) 0 15%, transparent 16%),
    linear-gradient(180deg, #dff6fb 0 42%, #fff0c8 42% 100%);
  box-shadow: 0 26px 54px rgba(42, 48, 55, 0.3);
}

.sticker-reward::before {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 31%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 8%, transparent 8% 16%) 0 0 / 96px 100%,
    #d6b07a;
  content: "";
}

.sticker-reward-header {
  position: absolute;
  left: 50%;
  top: clamp(18px, 5vh, 42px);
  z-index: 3;
  display: grid;
  gap: 6px;
  place-items: center;
  width: min(620px, 84vw);
  color: #26353d;
  text-align: center;
  transform: translateX(-50%);
}

.sticker-reward-kicker {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 5px 16px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #5fbd7f;
  color: #fff;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 900;
}

.sticker-reward h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 66px);
  line-height: 1.02;
}

.sticker-reward p {
  margin: 0;
  color: #55725f;
  font-size: clamp(18px, 2.1vw, 28px);
  font-weight: 900;
}

.sticker-reward .sticker {
  top: 48%;
  z-index: 5;
  width: clamp(205px, 24vw, 280px);
  height: clamp(160px, 17vw, 202px);
  animation: stickerPop 680ms cubic-bezier(0.2, 1.3, 0.34, 1);
}

.sticker-reward .sticker-face {
  border-radius: 24px;
}

.sticker-reward .sticker-face .asset-img {
  max-width: 100%;
  max-height: clamp(96px, 11vw, 128px);
}

.sticker-reward .sticker-art-svg {
  max-width: clamp(178px, 20vw, 236px);
}

.sticker-reward .sticker.is-placed {
  top: 79%;
  transform: translate(-50%, -50%) rotate(0deg) scale(0.74);
}

.sticker-reward .sticker-board {
  bottom: 7%;
  z-index: 4;
  gap: 2px;
  width: min(410px, 76vw);
  height: clamp(112px, 15vh, 148px);
  padding: 16px 22px;
  border-color: #b98535;
  background: #fff8dd;
  font-size: clamp(24px, 3vw, 34px);
}

.sticker-complete-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(190px, 24vw, 280px);
  height: clamp(150px, 18vw, 210px);
  border: 8px solid #fff;
  border-radius: 26px;
  background: #5fbd7f;
  color: #fff;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 900;
  transform: translate(-50%, -50%) rotate(-4deg);
  box-shadow: 0 22px 34px rgba(82, 51, 24, 0.23);
}

.sticker-gallery {
  position: absolute;
  inset: clamp(16px, 3vw, 34px);
  z-index: 24;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  padding: clamp(18px, 2.6vw, 30px);
  border: 7px solid #fff;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(223, 246, 251, 0.96), rgba(255, 247, 217, 0.96)),
    #fff4d2;
  box-shadow: 0 26px 54px rgba(42, 48, 55, 0.3);
}

.sticker-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: clamp(56px, 7vh, 82px);
  padding: 8px 18px;
  border: 5px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  color: #26353d;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
}

.sticker-gallery-header strong {
  color: #5c704d;
  font-size: clamp(17px, 1.8vw, 24px);
}

.sticker-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 4px 4px 12px;
}

.sticker-gallery-item {
  display: grid;
  place-items: center;
  min-height: clamp(132px, 15vw, 180px);
}

.sticker-gallery-item .sticker-face {
  width: min(100%, 190px);
  height: clamp(128px, 14vw, 166px);
  padding: 12px 14px 10px;
  border-radius: 22px;
}

.sticker-gallery-item .asset-img {
  width: 100%;
  max-height: clamp(78px, 8vw, 104px);
  object-fit: contain;
}

.sticker-gallery-item .sticker-art-svg {
  max-width: 142px;
}

.sticker-gallery-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 5px dashed #d6ae4a;
  border-radius: 24px;
  background: #fff8dd;
  color: #8a6b22;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
  text-align: center;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes stickerPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-10deg) scale(0.62);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-3deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-5deg) scale(1);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

@keyframes screwPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.16);
  }
}

@keyframes screwdriverDrive {
  0% {
    transform: translate(-50%, -104%) rotate(calc(-3deg + var(--driver-turn)));
  }
  34% {
    transform: translate(-50%, -88%) rotate(calc(4deg + var(--driver-turn)));
  }
  70% {
    transform: translate(-50%, -88%) rotate(calc(8deg + var(--driver-turn)));
  }
  100% {
    transform: translate(-50%, -95%) rotate(calc(1deg + var(--driver-turn)));
  }
}

@keyframes elevatorTargetPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes arrive {
  0% {
    transform: translateX(-120px) scale(0.85);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

@keyframes happy {
  0%,
  100% {
    transform: rotate(0);
  }
  35% {
    transform: rotate(-5deg) translateY(-8px);
  }
  70% {
    transform: rotate(5deg) translateY(-8px);
  }
}

@keyframes retryPop {
  0% {
    transform: scale(0.86);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes cuePop {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  24%,
  78% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.94);
    opacity: 0;
  }
}

@keyframes gestureHandMove {
  0%,
  18% {
    transform: translate(0, 0) scale(1);
  }
  58%,
  76% {
    transform: translate(var(--dx), var(--dy)) scale(1.02);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes idleBear {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

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

@keyframes idleCar {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(7px);
  }
}

@keyframes idleTrain {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-5px);
  }
}

@keyframes trainDepart {
  0% {
    transform: translateX(0) translateY(0) scale(0.92);
  }
  18% {
    transform: translateX(-24vw) translateY(-2px) scale(0.98);
  }
  100% {
    transform: translateX(-158vw) translateY(0) scale(1.04);
  }
}

@keyframes smokePuff {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.45);
  }
  20% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(34px, -32px) scale(1.65);
  }
}

@media (orientation: portrait) {
  .app {
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) 218px;
  }

  .control-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  }

  .choices {
    justify-content: center;
  }

  .spoken-line {
    min-height: 82px;
  }

  .next-button {
    min-height: 80px;
  }

  .math-game-entry {
    bottom: 24px;
    left: 20%;
    min-width: 188px;
    padding: 10px 18px;
  }

  .tv-video-entry {
    bottom: 24px;
    left: 50%;
    min-width: 188px;
    padding: 10px 18px;
  }

  .elevator-game-entry {
    bottom: 24px;
    left: 80%;
    min-width: 188px;
    padding: 10px 18px;
  }

  .sticker-album-entry {
    top: 18px;
    right: 18px;
    min-width: 150px;
    min-height: 66px;
    padding: 8px 16px;
  }

  .math-game-entry-title,
  .tv-video-entry-title,
  .elevator-game-entry-title,
  .sticker-album-entry-title {
    font-size: clamp(24px, 3.3vw, 34px);
  }

  .math-game-entry-subtitle,
  .tv-video-entry-subtitle,
  .elevator-game-entry-subtitle,
  .sticker-album-entry-subtitle {
    font-size: clamp(12px, 1.8vw, 18px);
  }

  .math-game {
    width: min(680px, 90vw);
    min-height: 66%;
  }

  .elevator-game {
    inset: 16px;
  }

  .elevator-status {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  .elevator-score {
    justify-content: center;
  }

  .elevator-scene {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .elevator-panel {
    grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .elevator-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .elevator-button {
    min-height: 64px;
  }

  .math-game-body {
    gap: 14px;
  }

  .count-side {
    width: min(300px, 41vw);
    min-height: 260px;
  }

  .count-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tv-room {
    padding: 18px 12px;
  }

  .tv-set {
    width: 94vw;
    height: 68vh;
    min-height: 380px;
    padding: 30px 20px 54px;
  }

  .tv-action {
    min-width: 118px;
    min-height: 52px;
    padding: 0 16px;
    font-size: 18px;
  }

  .tv-play-card {
    min-width: 210px;
    min-height: 104px;
    font-size: 30px;
  }

  .tv-video-picker {
    width: 92%;
    height: 88%;
  }

  .tv-picker-grid {
    grid-template-columns: 1fr;
  }

  .tv-local-card {
    min-height: 56px;
    font-size: 15px;
  }
}

body:has(.train-static-art) .app {
  grid-template-rows: minmax(0, 1fr);
}

body:has(.train-static-art) .control-panel {
  position: fixed;
  left: clamp(16px, 2vw, 28px);
  right: clamp(16px, 2vw, 28px);
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 40;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:has(.train-static-art) .spoken-line {
  width: min(640px, 58vw);
  min-height: 78px;
  margin: 0 auto;
  padding: 9px 20px 9px clamp(92px, 8vw, 118px);
  font-size: clamp(17px, 1.9vw, 24px);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 246, 221, 0.9)),
    #fffaf0;
}

body:has(.train-static-art) .spoken-line::before {
  display: block;
  width: clamp(58px, 5.6vw, 76px);
  height: clamp(58px, 5.6vw, 76px);
}

body:has(.train-static-art) .choices {
  display: none;
}

@media (orientation: landscape) and (max-height: 820px) {
  .app {
    grid-template-rows: minmax(0, 1fr) clamp(112px, 16vh, 146px);
    padding: 10px 14px;
    gap: 10px;
  }

  .progress {
    top: 12px;
  }

  .scene-choice {
    width: clamp(124px, 12vw, 164px);
    height: clamp(124px, 12vw, 164px);
  }

  .spoken-line {
    min-height: 76px;
    font-size: clamp(16px, 1.7vw, 24px);
  }

  .next-button {
    min-height: 78px;
  }

  .math-game-entry {
    bottom: 22px;
    min-height: 78px;
  }

  .tv-video-entry,
  .elevator-game-entry,
  .sticker-album-entry {
    bottom: 22px;
    min-height: 78px;
  }

  .sticker-album-entry {
    top: 18px;
    bottom: auto;
    min-height: 64px;
  }

  .tv-set {
    height: min(500px, 70vh);
    min-height: 320px;
    padding-bottom: 48px;
  }

  .tv-action {
    min-height: 50px;
    font-size: 18px;
  }

  .tv-video-picker {
    height: 88%;
  }

  .tv-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-game {
    top: 52%;
    min-height: min(390px, 74%);
    padding: 18px 24px;
    gap: 12px;
  }

  .math-game h2 {
    font-size: clamp(24px, 2.7vw, 38px);
  }

  .balloon-option {
    width: calc(var(--balloon-size) * 0.82);
    height: calc(var(--balloon-size) * 0.96);
  }

  .balloon-face {
    width: calc(var(--balloon-size) * 0.82);
    height: calc(var(--balloon-size) * 0.86);
  }

  .count-side {
    min-height: 220px;
  }

  .count-items img {
    width: clamp(40px, 4vw, 56px);
    height: clamp(40px, 4vw, 56px);
  }

  .elevator-game {
    inset: 12px;
    gap: 10px;
    padding: 14px;
  }

  .elevator-button {
    min-height: 58px;
  }
}

.math-game.train-static-art {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  transform: none;
}

/* Polished iPad layout for the turn-taking elevator game. */
.elevator-game {
  inset: clamp(14px, 2vw, 26px);
  gap: clamp(12px, 1.7vw, 20px);
  padding: clamp(16px, 2.2vw, 26px);
  border-width: 6px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(240, 252, 252, 0.96), rgba(255, 248, 225, 0.96)),
    #f7f1df;
}

.elevator-status {
  min-height: clamp(56px, 7vh, 78px);
}

.elevator-title {
  color: #20323c;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.72);
}

.elevator-turn {
  min-width: clamp(188px, 20vw, 286px);
  min-height: clamp(50px, 6vw, 68px);
  border-width: 4px;
  border-radius: 22px;
}

.elevator-score {
  align-items: center;
  line-height: 1;
}

.elevator-scene {
  grid-template-columns: minmax(0, 1fr) clamp(250px, 26vw, 330px);
  gap: clamp(16px, 2.2vw, 28px);
}

.elevator-shaft {
  border-width: 5px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0 1.2%, transparent 1.2% 32%, rgba(255, 255, 255, 0.34) 32% 33.3%, transparent 33.3% 66%, rgba(255, 255, 255, 0.34) 66% 67.2%, transparent 67.2% 98.8%, rgba(255, 255, 255, 0.42) 98.8%),
    repeating-linear-gradient(180deg, transparent 0 calc(20% - 4px), rgba(255, 255, 255, 0.74) calc(20% - 4px) 20%),
    linear-gradient(180deg, #b9e7f3 0%, #d8f0ec 55%, #f4d79e 100%);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.34),
    inset 0 -16px 0 rgba(138, 101, 54, 0.12);
}

.floor-line {
  left: clamp(16px, 2vw, 28px);
  width: clamp(42px, 4.5vw, 60px);
  height: clamp(42px, 4.5vw, 60px);
  border-width: 4px;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.9), transparent 28%),
    #fffaf0;
  font-size: clamp(21px, 2.25vw, 32px);
}

.elevator-car {
  width: min(340px, 35vw);
  border-width: 6px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, transparent calc(50% - 3px), rgba(45, 88, 102, 0.25) calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)),
    linear-gradient(180deg, #97dce8 0 17%, #ffffff 17% 20%, #7ac4d5 20% 100%);
}

.elevator-car::before {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 24%;
  height: 14%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  content: "";
  pointer-events: none;
}

.car-light {
  top: 6%;
  width: 17%;
  height: 9%;
}

.car-door {
  top: 21%;
}

.elevator-panel {
  gap: clamp(12px, 1.6vw, 18px);
  padding: clamp(14px, 1.8vw, 22px);
  border-width: 5px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 242, 238, 0.92)),
    #dcebe7;
}

.elevator-signal {
  min-height: clamp(66px, 7vw, 88px);
  padding: 10px 12px;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 50%, rgba(255, 255, 255, 0.14) 0 18%, transparent 19%),
    linear-gradient(180deg, #2a3d44, #1c2b31);
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.18),
    0 10px 18px rgba(38, 58, 64, 0.14);
}

.signal-light {
  width: clamp(36px, 4.1vw, 52px);
  height: clamp(36px, 4.1vw, 52px);
}

.signal-label {
  min-width: 0;
  font-size: clamp(19px, 2vw, 30px);
}

.elevator-buttons {
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  align-content: stretch;
}

.elevator-button {
  min-height: clamp(64px, 7.4vh, 88px);
  border-width: 4px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #f8fffb, #dfeae7),
    #eef4f2;
  font-size: clamp(26px, 3vw, 42px);
  transition:
    transform 140ms ease,
    filter 140ms ease,
    background 140ms ease;
}

.elevator-button-open,
.elevator-button-close {
  font-size: clamp(19px, 2vw, 28px);
}

.elevator-button.active-target {
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.72), transparent 28%),
    #ffdf4f;
  box-shadow:
    inset 0 -8px 0 rgba(171, 111, 20, 0.16),
    0 0 0 6px rgba(255, 255, 255, 0.74),
    0 0 26px rgba(255, 207, 74, 0.8);
}

.elevator-button.waiting-target {
  background:
    linear-gradient(180deg, #ffe9e6, #f4d7d2),
    #f5dad5;
}

.elevator-finish {
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), transparent 30%),
    #fffaf0;
}

@media (orientation: portrait) {
  .elevator-game {
    inset: 14px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .elevator-status {
    grid-template-columns: 1fr auto 1fr;
    min-height: 58px;
    gap: 8px;
  }

  .elevator-title {
    font-size: clamp(24px, 4.4vw, 34px);
  }

  .elevator-turn {
    min-width: 168px;
    min-height: 52px;
    padding: 6px 16px;
    font-size: clamp(22px, 4vw, 30px);
  }

  .elevator-score {
    gap: 3px;
    font-size: clamp(22px, 4vw, 30px);
  }

  .elevator-scene {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(340px, 1fr) auto;
    gap: 12px;
  }

  .elevator-car {
    width: min(300px, 44vw);
  }

  .elevator-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 12px;
  }

  .elevator-signal {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .signal-label {
    overflow: visible;
    font-size: clamp(20px, 4vw, 30px);
    text-overflow: clip;
  }

  .signal-countdown {
    min-width: 46px;
    min-height: 46px;
  }

  .elevator-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .elevator-button {
    min-height: 66px;
    border-radius: 18px;
    font-size: clamp(25px, 4.3vw, 34px);
  }

  .elevator-button-open,
  .elevator-button-close {
    font-size: clamp(18px, 3.3vw, 24px);
  }
}

@media (orientation: landscape) and (max-height: 820px) {
  .elevator-game {
    inset: 10px;
    padding: 12px;
  }

  .elevator-status {
    min-height: 50px;
  }

  .elevator-title {
    font-size: clamp(28px, 3.2vw, 42px);
  }

.elevator-turn {
  min-height: 48px;
  font-size: clamp(22px, 2.4vw, 30px);
  }

  .elevator-scene {
    grid-template-columns: minmax(0, 1fr) clamp(230px, 25vw, 300px);
    gap: 14px;
  }

  .elevator-button {
    min-height: 58px;
  }
}

/* Interior elevator view: the child is "inside" the elevator, facing the doors. */
.elevator-shaft {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) clamp(58px, 8vh, 82px);
  align-items: stretch;
  padding: clamp(16px, 2vw, 28px) clamp(18px, 2.4vw, 34px) 0;
  border-color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 10%, transparent 10% 90%, rgba(255, 255, 255, 0.45) 90%),
    linear-gradient(90deg, #ccdfe3 0 1.5%, transparent 1.5% 49.6%, rgba(117, 145, 153, 0.22) 49.6% 50.4%, transparent 50.4% 98.5%, #ccdfe3 98.5%),
    linear-gradient(180deg, #f6fbf8 0%, #e4f0ed 47%, #d7e4e0 100%);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.42),
    inset 0 -18px 0 rgba(102, 122, 126, 0.12),
    0 18px 30px rgba(64, 79, 82, 0.12);
}

.elevator-shaft::before,
.elevator-shaft::after {
  position: absolute;
  top: 18%;
  bottom: 14%;
  width: clamp(48px, 7vw, 82px);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), transparent),
    rgba(185, 207, 211, 0.42);
  content: "";
  pointer-events: none;
}

.elevator-shaft::before {
  left: clamp(18px, 2.4vw, 34px);
}

.elevator-shaft::after {
  right: clamp(18px, 2.4vw, 34px);
  transform: scaleX(-1);
}

.cabin-top-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(12px, 2vw, 22px);
  align-items: center;
  min-height: clamp(58px, 7vh, 82px);
  padding: 8px clamp(12px, 2vw, 22px);
  border: 5px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(224, 237, 235, 0.76)),
    #e4efec;
  box-shadow:
    inset 0 -8px 0 rgba(91, 111, 116, 0.08),
    0 12px 18px rgba(78, 93, 97, 0.12);
}

.cabin-floor-screen {
  justify-self: center;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
  min-width: clamp(112px, 14vw, 160px);
  min-height: clamp(46px, 5.5vw, 62px);
  padding: 4px 20px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 207, 74, 0.2), transparent 26%),
    #24343d;
  color: #ffcf4a;
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 900;
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.22),
    0 8px 14px rgba(43, 61, 66, 0.16);
}

.cabin-arrow {
  color: #5fbd7f;
  font-size: 0.62em;
}

.cabin-speaker {
  justify-self: end;
  width: clamp(58px, 8vw, 96px);
  height: clamp(26px, 3.5vw, 38px);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(74, 92, 96, 0.42) 0 2px, transparent 3px) 0 0 / 12px 12px,
    rgba(255, 255, 255, 0.34);
}

.cabin-light-strip {
  justify-self: start;
  width: clamp(72px, 10vw, 126px);
  height: clamp(22px, 3vw, 32px);
  border-radius: 999px;
  background: #fff6bd;
  box-shadow: 0 0 24px rgba(255, 235, 143, 0.8);
}

.cabin-side-rail {
  position: absolute;
  top: 42%;
  z-index: 3;
  width: clamp(110px, 15vw, 180px);
  height: 12px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #edf5f3, #b9c9ca);
  box-shadow: 0 7px 10px rgba(71, 88, 91, 0.14);
  pointer-events: none;
}

.cabin-side-rail-left {
  left: clamp(36px, 5vw, 72px);
}

.cabin-side-rail-right {
  right: clamp(36px, 5vw, 72px);
}

.elevator-car {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 2;
  align-self: stretch;
  justify-self: center;
  width: min(520px, 58vw);
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border-color: #ffffff;
  border-radius: 24px 24px 16px 16px;
  background:
    linear-gradient(90deg, transparent calc(50% - 4px), rgba(37, 66, 75, 0.22) calc(50% - 4px) calc(50% + 4px), transparent calc(50% + 4px)),
    linear-gradient(180deg, #cdeef4 0 16%, #ffffff 16% 18%, #8fcfdc 18% 100%);
  transform: none;
  transition: filter 220ms ease;
}

.elevator-car::before {
  left: 12%;
  right: 12%;
  top: 25%;
  height: 10%;
}

.car-light {
  top: 6%;
  width: clamp(74px, 10vw, 112px);
  height: clamp(24px, 3vw, 34px);
}

.car-door {
  top: 18%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent 32%),
    linear-gradient(180deg, #93d5e2, #70baca);
}

.cabin-floor {
  position: relative;
  z-index: 1;
  margin: 0 calc(clamp(18px, 2.4vw, 34px) * -1);
  border-top: 5px solid rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(125, 95, 57, 0.14) 49% 51%, transparent 51%),
    repeating-linear-gradient(90deg, rgba(125, 95, 57, 0.1) 0 2px, transparent 2px 92px),
    linear-gradient(180deg, #ead7b0, #d5ad75);
  box-shadow: inset 0 14px 18px rgba(255, 255, 255, 0.22);
}

.cabin-moving .cabin-floor-screen,
.cabin-moving .car-light {
  animation: elevatorTargetPulse 520ms ease-in-out;
}

@media (orientation: portrait) {
  .elevator-shaft {
    grid-template-rows: auto minmax(0, 1fr) 54px;
    padding: 12px 14px 0;
  }

  .cabin-top-panel {
    grid-template-columns: 1fr auto 1fr;
    min-height: 56px;
    padding: 7px 10px;
    border-radius: 20px;
  }

  .cabin-floor-screen {
    min-width: 112px;
    min-height: 44px;
    font-size: 30px;
  }

  .cabin-speaker {
    width: 54px;
  }

  .cabin-light-strip {
    width: 62px;
  }

  .cabin-side-rail {
    top: 45%;
    width: 118px;
  }

  .cabin-side-rail-left {
    left: 28px;
  }

  .cabin-side-rail-right {
    right: 28px;
  }

  .elevator-car {
    width: min(430px, 70vw);
  }
}

@media (orientation: landscape) and (max-height: 820px) {
  .elevator-shaft {
    grid-template-rows: auto minmax(0, 1fr) 46px;
    padding: 12px 16px 0;
  }

  .cabin-top-panel {
    min-height: 48px;
    padding: 5px 10px;
  }

  .cabin-floor-screen {
    min-height: 38px;
    font-size: 26px;
  }

  .cabin-side-rail {
    top: 43%;
  }

  .elevator-car {
    width: min(420px, 46vw);
  }
}

.elevator-turn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.1vw, 14px);
  padding: 6px clamp(14px, 1.6vw, 22px) 6px 8px;
}

.turn-avatar {
  width: clamp(48px, 5.4vw, 66px);
  height: clamp(48px, 5.4vw, 66px);
  flex: 0 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: #fffaf0;
  object-fit: cover;
  box-shadow:
    0 5px 10px rgba(67, 64, 45, 0.18),
    inset 0 0 0 2px rgba(255, 255, 255, 0.66);
}

.elevator-turn span {
  white-space: nowrap;
}

.elevator-game[data-phase="childWait"] .elevator-turn,
.elevator-game[data-phase="child"] .elevator-turn {
  background: #5fbd7f;
  color: #fff;
}

.elevator-game[data-phase="parent"] .turn-avatar {
  background: #ffe39b;
}

.elevator-game[data-phase="childWait"] .turn-avatar,
.elevator-game[data-phase="child"] .turn-avatar {
  background: #c9f1ff;
}

@media (orientation: portrait) {
  .elevator-turn {
    min-width: 190px;
    padding-right: 14px;
    font-size: clamp(21px, 3.6vw, 28px);
  }

  .turn-avatar {
    width: clamp(46px, 7vw, 58px);
    height: clamp(46px, 7vw, 58px);
    border-width: 3px;
  }
}

@media (orientation: landscape) and (max-height: 820px) {
  .turn-avatar {
    width: clamp(42px, 4.8vw, 56px);
    height: clamp(42px, 4.8vw, 56px);
  }
}
