@import url("assets/fonts/marhey.css");

:root {
  --app-height: 100svh;
  --ink: #f8f3df;
  --muted: #ead8cf;
  --terracotta: #af5131;
  --terracotta-light: #cf7859;
  --terracotta-dark: #74301f;
  --terracotta-deep: #3f1b13;
  --night: #af5131;
  --night-2: #8f3f29;
  --panel: rgba(116, 48, 31, 0.95);
  --panel-soft: rgba(143, 63, 41, 0.9);
  --gold: #e7c56b;
  --gold-light: #ffe5a0;
  --green: #4b9b72;
  --green-bright: #75d09a;
  --pink: #dc83a2;
  --danger: #c95f60;
  --line: rgba(231, 197, 107, 0.25);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
  --playful-font: "Marhey", "SF Arabic", "Geeza Pro", "Segoe UI", Arial, sans-serif;
  --type-game-kicker: 12px;
  --type-game-title: clamp(23px, 2.5vw, 34px);
  --type-panel-title: clamp(24px, 3vw, 38px);
  --type-instruction: 14px;
  --type-status: 13px;
  --type-command: 16px;
  --net-opacity-base: 0.55;
  --net-opacity-active: 0.55;
  --net-opacity-cut: 0.13;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--playful-font);
}

body {
  height: var(--app-height);
}

#app {
  width: 100%;
  height: var(--app-height);
  min-height: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

img {
  user-select: none;
  -webkit-user-drag: none;
}

.is-hidden {
  display: none !important;
}

.cover-screen {
  position: relative;
  height: var(--app-height);
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left));
  background: var(--terracotta);
}

.cover-backdrop,
.cover-vignette {
  position: absolute;
  inset: 0;
}

.cover-backdrop {
  z-index: -4;
  background: url("assets/oasis-background.webp") center / cover no-repeat;
  transform: scale(1.025);
}

.cover-vignette {
  z-index: -3;
  background:
    radial-gradient(circle at 50% 40%, rgba(175, 81, 49, 0.04) 0 28%, rgba(63, 27, 19, 0.76) 90%),
    linear-gradient(90deg, rgba(63, 27, 19, 0.84), rgba(116, 48, 31, 0.16) 42%, rgba(63, 27, 19, 0.6));
  backdrop-filter: saturate(0.9);
}

.cover-copy {
  position: relative;
  z-index: 5;
  width: min(680px, 68vw);
  justify-self: center;
  align-self: center;
  margin: 0;
  text-align: center;
  padding: clamp(18px, 3vw, 34px);
}

.cover-copy::before,
.cover-copy::after {
  content: none;
}

.cover-copy::before {
  top: 15px;
}

.cover-copy::after {
  bottom: 15px;
}

.eyebrow,
.modal-kicker {
  margin: 0 0 13px;
  color: var(--gold);
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 800;
  font-family: var(--playful-font);
  letter-spacing: 0;
}

.cover-copy h1 {
  margin: 0;
  color: var(--gold-light);
  font-family: var(--playful-font);
  font-size: clamp(56px, 7vw, 94px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.cover-copy h1 span {
  display: block;
  margin-bottom: 11px;
  color: var(--gold-light);
  font-size: 0.55em;
  letter-spacing: 0;
}

.cover-subtitle {
  max-width: 520px;
  margin: 24px auto 18px;
  color: #f6f1dd;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.75;
}

.language-choice {
  width: min(340px, 88%);
  margin: 0 auto 22px;
  padding: 10px;
  border: 1px solid rgba(255, 229, 160, 0.38);
  border-radius: 18px;
  background: rgba(63, 27, 19, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.language-choice > p {
  margin: 0 0 8px;
  color: #fff3d2;
  font-size: 13px;
  font-weight: 800;
}

.language-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.language-button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #f9eee8;
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.language-button:hover,
.language-button:focus-visible {
  border-color: var(--gold-light);
}

.language-button.is-active {
  color: var(--terracotta-deep);
  border-color: var(--gold-light);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 6px 18px rgba(231, 197, 107, 0.18);
}

.language-button:active {
  transform: scale(0.97);
}

.primary-button,
.soft-button,
.preview-button,
.icon-button,
.mini-button,
.open-panel-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 54px;
  padding: 13px 28px;
  border-radius: 18px;
  color: var(--terracotta-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 12px 30px rgba(231, 197, 107, 0.24), inset 0 1px rgba(255, 255, 255, 0.75);
  font-weight: 900;
}

.primary-button:hover,
.preview-button:hover,
.start-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.preview-button:active,
.start-button:active,
.asset-card:active {
  transform: scale(0.97);
}

.start-button {
  min-width: min(260px, 80%);
  font-size: 20px;
}

.button-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(63, 27, 19, 0.92);
}

.cover-note {
  position: absolute;
  z-index: 5;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: 24px;
  margin: 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 13px;
}

.cover-animal {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.36));
}

.cover-dove {
  z-index: 3;
  width: min(43vw, 680px);
  top: -5vw;
  left: -2vw;
  animation: coverFloat 5.6s ease-in-out infinite;
}

.cover-deer {
  width: min(24vw, 330px);
  left: 4vw;
  bottom: -7vh;
}

.cover-mouse {
  width: min(11vw, 160px);
  right: 4vw;
  bottom: -1vh;
}

.cover-crow {
  width: min(13vw, 190px);
  right: 16vw;
  bottom: -2vh;
}

.cover-tortoise {
  width: min(14vw, 210px);
  left: 27vw;
  bottom: -4vh;
}

@keyframes coverFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(14px) rotate(1deg); }
}

.game-menu-screen {
  position: relative;
  height: var(--app-height);
  min-height: 0;
  overflow: auto;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vh, 34px);
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background:
    linear-gradient(rgba(116, 48, 31, 0.78), rgba(63, 27, 19, 0.94)),
    url("assets/oasis-background.webp") center / cover no-repeat;
}

.game-menu-glow {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 218, 126, 0.18), transparent 30%),
    radial-gradient(circle at 15% 75%, rgba(75, 155, 114, 0.16), transparent 30%);
}

.game-menu-header {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.game-menu-header p,
.game-menu-header h1,
.game-menu-header span {
  margin: 0;
}

.game-menu-header p {
  color: var(--gold);
  font-family: var(--playful-font);
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 700;
  letter-spacing: 0;
}

.game-menu-header h1 {
  margin-top: 4px;
  color: var(--gold-light);
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.15;
}

.game-menu-header div > span {
  display: block;
  margin-top: 5px;
  color: #f0ddd3;
  font-size: clamp(13px, 1.5vw, 18px);
}

.menu-back-button,
.mini-nav-button {
  justify-self: start;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(63, 27, 19, 0.78);
  cursor: pointer;
  font-weight: 800;
}

.menu-back-button:hover,
.mini-nav-button:hover {
  border-color: rgba(231, 197, 107, 0.58);
  background: rgba(231, 197, 107, 0.12);
}

.menu-header-star {
  justify-self: end;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(231, 197, 107, 0.45);
  border-radius: 16px;
  color: var(--gold-light);
  background: rgba(231, 197, 107, 0.08);
  font-size: 24px;
}

.game-choice-grid {
  width: min(1380px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.5vw, 28px);
  margin: auto 0;
}

.game-choice-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(231, 197, 107, 0.44);
  border-radius: clamp(20px, 2.5vw, 32px);
  color: var(--ink);
  background: linear-gradient(160deg, rgba(175, 81, 49, 0.98), rgba(84, 34, 23, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: start;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-choice-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-light);
  box-shadow: 0 30px 75px rgba(0, 0, 0, 0.42), 0 0 0 5px rgba(231, 197, 107, 0.07);
}

.game-choice-card:active {
  transform: scale(0.985);
}

.oasis-choice {
  background: linear-gradient(160deg, #af5131, #6f2c1c);
}

.oasis-choice .game-card-copy {
  background: linear-gradient(145deg, rgba(175, 81, 49, 0.98), rgba(101, 40, 26, 0.99));
}

.game-card-art {
  position: relative;
  min-height: 0;
  flex: 1;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(rgba(175, 81, 49, 0.06), rgba(63, 27, 19, 0.46)),
    url("assets/oasis-background.webp") center / cover no-repeat;
}

.game-card-art img {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35));
}

.choice-dove {
  width: 55%;
  top: -7%;
  left: -6%;
}

.choice-deer {
  width: 35%;
  right: 5%;
  bottom: -5%;
}

.choice-tortoise {
  width: 29%;
  left: 29%;
  bottom: -6%;
}

.leader-choice .game-card-art {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 224, 149, 0.16), transparent 38%),
    linear-gradient(rgba(175, 81, 49, 0.2), rgba(63, 27, 19, 0.66)),
    url("assets/oasis-background.webp") center / cover no-repeat;
}

.choice-leader-bird {
  z-index: 2;
  bottom: -2%;
}

.choice-leader-bird-left {
  width: 39%;
  left: -4%;
}

.choice-leader-bird-center {
  width: 36%;
  left: 31%;
  bottom: 3%;
}

.choice-leader-bird-right {
  width: 38%;
  right: 1%;
  transform: scaleX(-1);
}

.choice-leader-net {
  z-index: 4;
  inset: -7% -7% -4%;
  width: 114%;
  height: 112%;
  opacity: var(--net-opacity-base);
  object-fit: fill !important;
  transform: rotate(-2deg) scaleY(0.82);
  pointer-events: none;
}

.choice-leader-mouse {
  z-index: 5;
  width: 28%;
  right: -2%;
  bottom: -4%;
}

.wings-choice .game-card-art {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 224, 149, 0.24), transparent 38%),
    linear-gradient(rgba(175, 81, 49, 0.14), rgba(63, 27, 19, 0.6)),
    url("assets/oasis-background.webp") center / cover no-repeat;
}

.choice-wings-halo {
  position: absolute;
  z-index: 1;
  top: 48%;
  left: 50%;
  width: 48%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 229, 160, 0.58);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(255, 218, 126, 0.3);
  transform: translate(-50%, -50%);
  animation: choiceWingsPulse 1.8s ease-in-out infinite;
}

.choice-wings-net {
  z-index: 5;
  top: 4%;
  left: -10%;
  width: 120%;
  height: 94%;
  opacity: var(--net-opacity-base);
}

.choice-wings-dove {
  z-index: 3;
}

.choice-wings-dove-one {
  top: 25%;
  left: 1%;
  width: 42%;
}

.choice-wings-leader {
  top: 8%;
  left: 31%;
  width: 43%;
}

.choice-wings-dove-two {
  top: 26%;
  right: 0;
  width: 42%;
  transform: scaleX(-1);
}

.missions-choice .game-card-art {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 225, 151, 0.25), transparent 42%),
    linear-gradient(rgba(175, 81, 49, 0.1), rgba(63, 27, 19, 0.58)),
    url("assets/oasis-background.webp") center / cover no-repeat;
}

.choice-missions-glow {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 68%;
  aspect-ratio: 1;
  border: 2px dashed rgba(255, 229, 160, 0.52);
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(231, 197, 107, 0.24), inset 0 0 28px rgba(231, 197, 107, 0.12);
  transform: translate(-50%, -50%);
  animation: choiceMissionsTurn 11s linear infinite;
}

.choice-mission-friend {
  z-index: 2;
}

.choice-mission-crow {
  top: 2%;
  left: 3%;
  width: 36%;
}

.choice-mission-mouse {
  bottom: -5%;
  left: 29%;
  width: 24%;
}

.choice-mission-tortoise {
  right: 25%;
  bottom: -7%;
  width: 31%;
}

.choice-mission-deer {
  right: 0;
  bottom: -4%;
  width: 31%;
}

.choice-mission-net {
  z-index: 3;
  right: 22%;
  bottom: -8%;
  width: 38%;
  opacity: var(--net-opacity-base);
  filter: drop-shadow(0 7px 6px rgba(0, 0, 0, 0.34));
  transform: rotate(-6deg) scaleY(0.76);
  pointer-events: none;
}

@keyframes choiceMissionsTurn {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes choiceWingsPulse {
  0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.86); }
  50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.08); }
}

.game-card-copy {
  position: relative;
  display: block;
  padding: clamp(14px, 2vw, 22px) clamp(16px, 2.3vw, 25px) clamp(16px, 2vw, 23px);
  padding-inline-end: 58px;
  border-top: 1px solid rgba(231, 197, 107, 0.2);
  background: linear-gradient(145deg, rgba(175, 81, 49, 0.98), rgba(91, 37, 25, 0.99));
}

.game-card-copy small,
.game-card-copy strong,
.game-card-copy > span {
  display: block;
}

.game-card-copy small {
  color: var(--gold);
  font-family: var(--playful-font);
  font-size: 12px;
  font-weight: 700;
}

.game-card-copy strong {
  margin-top: 4px;
  color: var(--gold-light);
  font-size: clamp(20px, 2.7vw, 31px);
}

.game-card-copy > span {
  margin-top: 4px;
  color: #ead8cf;
  font-size: clamp(12px, 1.35vw, 16px);
}

.game-card-arrow {
  position: absolute;
  bottom: 20px;
  inset-inline-end: 18px;
  z-index: 5;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--terracotta-deep);
  background: var(--gold);
  font-size: 19px;
  font-weight: 900;
}

.game-menu-wisdom {
  margin: 0;
  color: rgba(255, 229, 160, 0.86);
  text-align: center;
  font-size: clamp(13px, 1.45vw, 17px);
  font-weight: 700;
}

.leader-game-screen {
  height: var(--app-height);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 0, rgba(231, 197, 107, 0.16), transparent 38%),
    linear-gradient(145deg, var(--terracotta), var(--terracotta-deep));
}

.mini-game-topbar {
  position: relative;
  z-index: 30;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 9px max(18px, env(safe-area-inset-right)) 9px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(116, 48, 31, 0.97);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
}

.mini-game-title {
  text-align: center;
}

.mini-game-title p,
.mini-game-title h1 {
  margin: 0;
}

.mini-game-title p {
  color: var(--gold);
  font-family: var(--playful-font);
  font-size: var(--type-game-kicker);
  font-weight: 700;
  letter-spacing: 0;
}

.mini-game-title h1 {
  margin-top: 2px;
  color: var(--gold-light);
  font-size: var(--type-game-title);
}

.mini-game-actions {
  justify-self: end;
  display: flex;
  gap: 7px;
}

.leader-game-layout {
  width: min(1420px, 100%);
  min-height: 0;
  flex: 1;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(12px, 2vw, 24px);
}

.leader-brief {
  min-height: 0;
  align-self: center;
  padding: clamp(18px, 2.3vw, 28px);
  border: 1px solid rgba(231, 197, 107, 0.28);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(175, 81, 49, 0.97), rgba(84, 34, 23, 0.98));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.leader-value {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(231, 197, 107, 0.3);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(231, 197, 107, 0.07);
  font-family: var(--playful-font);
  font-size: 12px;
  font-weight: 700;
}

.leader-brief h2 {
  margin: 14px 0 8px;
  color: var(--gold-light);
  font-size: var(--type-panel-title);
  line-height: 1.25;
}

.leader-brief > p:not(.leader-message) {
  margin: 0;
  color: #efddd3;
  font-size: var(--type-instruction);
  line-height: 1.75;
}

.leader-progress-wrap {
  margin-top: 22px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
}

.leader-progress-wrap > span {
  color: #ecf1ef;
  font-size: 12px;
  font-weight: 800;
}

.leader-progress-dots {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  direction: inherit;
}

.leader-progress-dots i {
  width: 19px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.leader-progress-dots i.is-done {
  background: var(--green-bright);
  box-shadow: 0 0 14px rgba(117, 208, 154, 0.38);
}

.leader-progress-dots .leader-dot {
  width: 11px;
  border-radius: 50%;
  background: rgba(231, 197, 107, 0.28);
}

.leader-progress-dots .leader-dot.is-ready,
.leader-progress-dots .leader-dot.is-done {
  background: var(--gold-light);
  box-shadow: 0 0 17px rgba(255, 229, 160, 0.5);
}

.leader-message {
  min-height: 76px;
  margin: 18px 0 0;
  padding: 12px 13px;
  border-inline-start: 3px solid var(--gold);
  border-radius: 13px;
  color: #f4ead0;
  background: rgba(231, 197, 107, 0.075);
  font-size: var(--type-status);
  line-height: 1.65;
}

.leader-board {
  position: relative;
  min-width: 0;
  align-self: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(231, 197, 107, 0.48);
  border-radius: clamp(20px, 2.6vw, 34px);
  background: var(--terracotta-dark);
  box-shadow: var(--shadow), 0 0 0 7px rgba(231, 197, 107, 0.045);
  isolation: isolate;
}

.leader-board-background,
.leader-board-shade,
.leader-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.leader-board-background {
  z-index: -4;
  object-fit: cover;
}

.leader-board-shade {
  z-index: -3;
  background: linear-gradient(180deg, rgba(116, 48, 31, 0.1), rgba(63, 27, 19, 0.36));
}

.leader-net {
  z-index: 6;
  inset: auto;
  top: -6%;
  left: -20%;
  width: 140%;
  height: 112%;
  opacity: var(--net-opacity-base);
  pointer-events: none;
  object-fit: fill;
  object-position: center;
  filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.28));
  transition: opacity 180ms ease;
}

.rescue-mouse {
  --mouse-scale: 1;
  position: absolute;
  z-index: 9;
  left: 92%;
  top: 86%;
  width: clamp(74px, 13%, 155px);
  pointer-events: none;
  filter: drop-shadow(0 13px 13px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%) scaleX(var(--mouse-facing, -1)) scale(var(--mouse-scale));
  transform-origin: center bottom;
  transition: left 360ms ease, top 360ms ease, transform 180ms ease;
}

.rescue-mouse img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: opacity 100ms ease;
}

.mouse-idle-img {
  transform: scaleX(-1);
}

.mouse-chew-img {
  position: absolute;
  top: 4%;
  left: -42.5%;
  width: 185% !important;
  max-width: none;
  opacity: 0;
  transform-origin: 42% 58%;
}

.leader-board.mouse-traveling .rescue-mouse,
.leader-board.mouse-cutting .rescue-mouse {
  left: var(--mouse-target-x, 82%);
  top: var(--mouse-target-y, 74%);
}

.leader-board.mouse-cutting .rescue-mouse {
  --mouse-scale: 1.08;
}

.leader-board.mouse-cutting .mouse-idle-img {
  opacity: 0;
}

.leader-board.mouse-cutting .mouse-chew-img {
  opacity: 1;
  animation: mouseGnaw 180ms steps(2, end) infinite;
}

.leader-board.net-cutting .leader-net {
  opacity: var(--net-opacity-active);
  animation: netTug 180ms steps(2, end) infinite;
}

.leader-board::after {
  content: "";
  position: absolute;
  z-index: 8;
  left: var(--cut-target-x, 50%);
  top: var(--cut-target-y, 50%);
  width: clamp(48px, 8vw, 92px);
  aspect-ratio: 1;
  border: 4px dashed rgba(255, 229, 160, 0.9);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.55);
}

.leader-board.net-cutting::after {
  animation: netCutPulse 560ms ease-out infinite;
}

@keyframes mouseGnaw {
  0%, 100% { transform: translate(-2px, 0) rotate(-1.5deg); }
  50% { transform: translate(3px, 2px) rotate(2.5deg); }
}

@keyframes netTug {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -1px); }
}

@keyframes netCutPulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45) rotate(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15) rotate(18deg); }
}

.captive-dove {
  position: absolute;
  z-index: 4;
  width: clamp(76px, 11vw, 150px);
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  filter: drop-shadow(0 13px 13px rgba(0, 0, 0, 0.37));
  transition: filter 180ms ease, opacity 180ms ease;
  touch-action: manipulation;
}

.captive-dove::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 11%;
  bottom: 1%;
  left: 11%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 12, 18, 0.7), rgba(2, 12, 18, 0) 72%);
  filter: blur(5px);
  transform: scaleX(1.12);
}

.captive-dove:hover {
  filter: drop-shadow(0 0 18px rgba(255, 229, 160, 0.64));
}

.captive-dove img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.captive-dove .bird-flight-img {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.captive-dove.is-releasing {
  z-index: 7;
}

.captive-dove.is-releasing .bird-trapped-img {
  opacity: 0;
}

.captive-dove.is-releasing .bird-flight-img {
  opacity: 1;
}

.dove-friend-two img,
.dove-friend-four img {
  transform: scaleX(-1);
}

.dove-friend-three img {
  transform: rotate(-4deg);
}

.dove-friend-one { left: 20%; top: 56%; }
.dove-friend-two { left: 80%; top: 56%; }
.dove-friend-three { left: 33%; top: 77%; }
.dove-friend-four { left: 67%; top: 77%; }

.leader-dove {
  left: 50%;
  top: 64%;
  width: clamp(92px, 13vw, 175px);
}

.rope-knot {
  position: absolute;
  right: 10%;
  bottom: 2%;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 3px solid #9b7147;
  border-radius: 50%;
  color: #fff1c4;
  background: #5e412b;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  font-size: 17px;
  font-weight: 900;
  transition: opacity 160ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.captive-dove.is-releasing .rope-knot {
  opacity: 0;
  transform: scale(0.2) rotate(45deg);
}

.captive-dove:hover .rope-knot,
.leader-dove.is-ready .rope-knot {
  transform: scale(1.13);
  background: #a86936;
  box-shadow: 0 0 18px rgba(255, 229, 160, 0.62);
}

.leader-crown {
  position: absolute;
  z-index: 5;
  top: -15px;
  left: 50%;
  color: var(--gold-light);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  font-size: 27px;
}

.leader-name {
  position: absolute;
  left: 50%;
  bottom: -17px;
  padding: 4px 9px;
  border: 1px solid rgba(231, 197, 107, 0.5);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(63, 27, 19, 0.92);
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.captive-dove.is-denied .rope-knot,
.captive-dove.is-denied .leader-name {
  animation: captiveDenied 420ms ease-in-out;
}

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

.captive-dove.is-free {
  z-index: 7;
  pointer-events: none;
  animation: birdFreedom 900ms cubic-bezier(.2,.75,.25,1) forwards;
}

@keyframes birdFreedom {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  55% { opacity: 1; transform: translate(-50%, -115%) rotate(-5deg) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -215%) rotate(4deg) scale(0.85); }
}

.wings-board {
  --wings-lift: 0px;
}

.wings-board-shade {
  background:
    linear-gradient(180deg, rgba(116, 48, 31, 0.08), rgba(63, 27, 19, 0.34)),
    radial-gradient(circle at 50% 42%, transparent 0 30%, rgba(63, 27, 19, 0.24) 76%);
}

.wings-sky-glow {
  position: absolute;
  z-index: 1;
  top: 10%;
  left: 50%;
  width: 62%;
  height: 64%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 225, 151, 0.3), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.wings-flock {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  transform: translateY(var(--wings-lift));
  transition: transform 500ms cubic-bezier(.2,.72,.25,1);
}

.wings-net {
  position: absolute;
  z-index: 6;
  top: 5%;
  left: -12%;
  width: 124%;
  height: 87%;
  object-fit: fill;
  opacity: var(--net-opacity-base);
  pointer-events: none;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.3));
  transform: translateY(var(--wings-lift));
  transition: transform 500ms cubic-bezier(.2,.72,.25,1), opacity 220ms ease;
}

.wings-bird {
  position: absolute;
  width: clamp(76px, 11vw, 145px);
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.34));
  transform: translate(-50%, -50%);
  transform-origin: center bottom;
}

.wings-bird img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 130ms ease;
}

.wings-flight {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.wings-bird-one { top: 43%; left: 17%; }
.wings-bird-two { top: 43%; left: 83%; }
.wings-bird-leader { top: 48%; left: 50%; width: clamp(94px, 13vw, 170px); }
.wings-bird-three { top: 64%; left: 32%; }
.wings-bird-four { top: 64%; left: 68%; }

.wings-bird-two img,
.wings-bird-four img {
  transform: scaleX(-1);
}

.wings-leader-crown {
  position: absolute;
  z-index: 4;
  top: -16px;
  left: 50%;
  color: var(--gold-light);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.52);
  transform: translateX(-50%);
  font-size: 27px;
}

.wings-board.is-airborne .wings-grounded {
  opacity: 0;
}

.wings-board.is-airborne .wings-flight {
  opacity: 1;
}

.wings-board.is-beating .wings-bird {
  animation: synchronizedWingBeat 430ms cubic-bezier(.2,.8,.3,1);
}

.wings-board.is-beating .wings-net {
  opacity: var(--net-opacity-active);
}

@keyframes synchronizedWingBeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -64%) scale(1.08); }
}

.wings-rhythm {
  position: absolute;
  z-index: 11;
  bottom: 4%;
  left: 50%;
  display: grid;
  width: clamp(92px, 12vw, 126px);
  aspect-ratio: 1;
  place-items: center;
  transform: translateX(-50%);
}

.wings-pulse {
  position: absolute;
  inset: -4px;
  border: 4px solid var(--gold-light);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(255, 224, 146, 0.42), inset 0 0 18px rgba(255, 224, 146, 0.18);
  animation: cooperationPulse 1.6s linear infinite;
}

.wings-beat-button {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 10px;
  border: 2px solid rgba(255, 238, 190, 0.9);
  border-radius: 50%;
  color: var(--terracotta-deep);
  background: radial-gradient(circle at 42% 32%, #fff3bf, #e7c56b 72%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36), 0 0 25px rgba(231, 197, 107, 0.25);
  cursor: pointer;
  touch-action: manipulation;
}

.wings-beat-button small,
.wings-beat-button strong {
  display: block;
}

.wings-beat-button small {
  font-size: clamp(8px, 0.9vw, 11px);
  font-weight: 800;
}

.wings-beat-button strong {
  font-family: var(--playful-font);
  font-size: clamp(15px, 1.7vw, 21px);
  line-height: 1.2;
}

.wings-board.is-beating .wings-beat-button {
  box-shadow: 0 0 0 9px rgba(117, 208, 154, 0.2), 0 0 40px rgba(117, 208, 154, 0.65);
}

.wings-board.is-missed .wings-beat-button {
  animation: wingsMiss 300ms ease-in-out;
}

@keyframes cooperationPulse {
  0% { opacity: 0; transform: scale(1.95); }
  12% { opacity: 0.85; }
  70% { opacity: 1; transform: scale(1.04); }
  86%, 100% { opacity: 0; transform: scale(0.88); }
}

@keyframes wingsMiss {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-7px); }
  65% { transform: translateX(7px); }
}

.wings-progress-dots i {
  flex: 1;
}

.wings-success blockquote {
  max-width: 640px;
}

.leader-success {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
  background: rgba(63, 27, 19, 0.84);
  backdrop-filter: blur(10px);
}

.success-feather {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(231, 197, 107, 0.55);
  border-radius: 20px;
  color: var(--gold-light);
  background: rgba(231, 197, 107, 0.12);
  box-shadow: 0 0 34px rgba(231, 197, 107, 0.2);
  font-size: 28px;
}

.leader-success p {
  margin: 13px 0 3px;
  color: var(--gold);
  font-family: var(--playful-font);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 700;
  letter-spacing: 0;
}

.leader-success h2 {
  margin: 0;
  color: var(--gold-light);
  font-size: clamp(29px, 4vw, 50px);
}

.leader-success blockquote {
  max-width: 620px;
  margin: 0;
  color: #f3ecd8;
  font-family: inherit;
  font-size: clamp(15px, 1.8vw, 21px);
  font-weight: 700;
  line-height: 1.6;
}

.wisdom-card {
  width: min(680px, 92%);
  margin: 15px 0 18px;
  padding: clamp(11px, 1.6vw, 16px) clamp(14px, 2vw, 22px);
  border: 1px solid rgba(231, 197, 107, 0.52);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 229, 160, 0.13), transparent 56%),
    rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.wisdom-card-label {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-family: inherit;
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 900;
}

.leader-success-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.missions-game-screen {
  background:
    radial-gradient(circle at 18% 10%, rgba(231, 197, 107, 0.15), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(207, 120, 89, 0.18), transparent 34%),
    linear-gradient(145deg, var(--terracotta), var(--terracotta-deep));
}

.missions-board-shade {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 226, 151, 0.11), transparent 44%),
    linear-gradient(180deg, rgba(116, 48, 31, 0.18), rgba(63, 27, 19, 0.58));
}

.missions-progress-dots i {
  flex: 1;
}

.mission-finish-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  border: 1px solid rgba(255, 229, 160, 0.7);
  border-radius: 15px;
  color: var(--terracotta-deep);
  background: linear-gradient(135deg, #ffe59b, #e7c56b);
  box-shadow: 0 12px 28px rgba(231, 197, 107, 0.2);
  cursor: pointer;
  font-size: var(--type-command);
}

.mission-finish-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-light);
  background: var(--terracotta-dark);
}

.mission-finish-button:disabled {
  cursor: default;
  filter: grayscale(0.5);
  opacity: 0.4;
}

.missions-board {
  display: block;
  padding: clamp(8px, 1.3vw, 15px);
}

.missions-brief .action-picker-group {
  margin-top: 16px;
}

.mission-picker {
  position: relative;
  z-index: 5;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(7px, 1vw, 12px);
}

.mission-picker-group {
  min-width: 0;
  padding: clamp(7px, 1vw, 11px);
  border: 1px solid rgba(255, 229, 160, 0.3);
  border-radius: clamp(14px, 1.8vw, 20px);
  background: linear-gradient(145deg, rgba(175, 81, 49, 0.95), rgba(84, 34, 23, 0.97));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.06);
}

.mission-picker-group header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.mission-picker-group header span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--terracotta-deep);
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.mission-picker-group h3 {
  margin: 0;
  color: var(--gold-light);
  font-size: clamp(12px, 1.35vw, 16px);
}

.mission-animal-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.mission-animal-option {
  position: relative;
  min-width: 0;
  min-height: clamp(68px, 8.2vw, 90px);
  display: grid;
  grid-template-rows: minmax(34px, 1fr) auto;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mission-animal-option:hover,
.mission-animal-option:focus-visible,
.mission-animal-option.is-selected {
  border-color: var(--gold-light);
  background: rgba(231, 197, 107, 0.12);
  box-shadow: 0 0 0 3px rgba(231, 197, 107, 0.09);
  transform: translateY(-2px);
}

.mission-animal-option.is-assigned::after {
  content: "●";
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--terracotta-dark);
  background: var(--gold-light);
  font-size: 8px;
  font-weight: 900;
}

.mission-animal-option.has-error {
  border-color: rgba(222, 120, 119, 0.95);
  background: rgba(222, 120, 119, 0.12);
  box-shadow: 0 0 0 3px rgba(222, 120, 119, 0.1);
}

.mission-animal-option img {
  width: 100%;
  max-width: clamp(38px, 5vw, 58px);
  max-height: clamp(36px, 5vw, 54px);
  object-fit: contain;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.32));
  pointer-events: none;
}

.mission-animal-option > span,
.mission-animal-option strong,
.mission-animal-option small {
  display: block;
  max-width: 100%;
}

.mission-animal-option > span {
  min-width: 0;
  text-align: center;
}

.mission-animal-option strong {
  color: var(--gold-light);
  font-size: clamp(9px, 1vw, 12px);
}

.mission-animal-option small {
  overflow: hidden;
  color: #e1cfc6;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(7px, 0.72vw, 9px);
}

.mission-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mission-action-option {
  min-width: 0;
  min-height: clamp(31px, 4vw, 41px);
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #f5e6de;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: start;
  touch-action: manipulation;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mission-action-option:hover,
.mission-action-option:focus-visible,
.mission-action-option.is-active {
  border-color: var(--gold-light);
  background: rgba(231, 197, 107, 0.14);
  box-shadow: 0 0 0 3px rgba(231, 197, 107, 0.09);
  transform: translateY(-1px);
}

.mission-action-option:disabled,
.mission-scene-animal:disabled {
  cursor: default;
}

.mission-action-option > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--gold-light);
  background: rgba(231, 197, 107, 0.1);
  font-size: 16px;
}

.mission-action-option strong {
  min-width: 0;
  font-size: clamp(9px, 1vw, 12px);
  line-height: 1.25;
}

.mission-live-scene {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 229, 160, 0.25);
  border-radius: clamp(16px, 2vw, 24px);
  background:
    linear-gradient(180deg, rgba(175, 81, 49, 0.04), rgba(63, 27, 19, 0.3)),
    rgba(116, 48, 31, 0.14);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.mission-scene-caption {
  position: absolute;
  z-index: 7;
  top: 8px;
  right: 50%;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #f0ddd3;
  background: rgba(63, 27, 19, 0.76);
  transform: translateX(50%);
  font-size: clamp(8px, 0.9vw, 11px);
  font-weight: 800;
  white-space: nowrap;
}

.mission-turtle-net {
  position: absolute;
  z-index: 6;
  top: 68%;
  left: 65%;
  width: clamp(128px, 25%, 270px);
  height: auto;
  opacity: var(--net-opacity-base);
  filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.38));
  transform: translate(-50%, -50%) rotate(-5deg) scaleY(0.78);
  transform-origin: center;
  pointer-events: none;
  transition: opacity 300ms ease, filter 300ms ease, transform 340ms ease;
}

.missions-board.is-cutting .mission-turtle-net {
  animation: missionNetGnaw 170ms ease-in-out 7;
}

.missions-board.has-cut-action:not(.is-approaching-net):not(.is-cutting) .mission-turtle-net {
  opacity: var(--net-opacity-cut);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.18)) saturate(0.7);
  transform: translate(-50%, -50%) rotate(-11deg) scale(1.08, 0.62);
  transition-delay: 850ms;
}

.missions-board.has-cut-action.net-cleared:not(.is-approaching-net):not(.is-cutting) .mission-turtle-net {
  opacity: 0;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08)) saturate(0.45);
  transform: translate(-50%, -50%) rotate(-13deg) scale(1.12, 0.54);
  transition-delay: 0ms;
}

.mission-scene-lake {
  position: absolute;
  z-index: 1;
  top: 45%;
  left: 83%;
  width: 30%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 229, 160, 0.12), rgba(88, 164, 173, 0.08) 44%, transparent 72%);
  opacity: 0.16;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.missions-board.is-hiding .mission-scene-lake {
  animation: missionLakeRipple 820ms 1.65s ease-out 2;
}

.mission-scene-animal {
  --mission-dx: 0px;
  --mission-dy: 0px;
  --mission-dx-third: 0px;
  --mission-dx-two-thirds: 0px;
  --mission-dx-three-quarters: 0px;
  --mission-dy-third: 0px;
  --mission-dy-three-quarters: 0px;
  position: absolute;
  z-index: 5;
  width: clamp(66px, 11%, 126px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.36));
  transform: translate(-50%, -50%);
  transform-origin: center bottom;
  touch-action: manipulation;
  transition: width 280ms ease, filter 180ms ease, opacity 180ms ease;
}

.mission-scene-animal::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6% 4%;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mission-scene-animal.is-selected::before {
  border-color: var(--gold-light);
  box-shadow: 0 0 24px rgba(231, 197, 107, 0.58);
}

.mission-scene-animal.has-error::before {
  border-color: rgba(222, 120, 119, 0.95);
  box-shadow: 0 0 24px rgba(222, 120, 119, 0.58);
}

.mission-scene-animal img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mission-scene-animal .mission-action-pose {
  opacity: 0;
}

.mission-scene-animal > span {
  position: absolute;
  top: 96%;
  left: 50%;
  max-width: 150px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 229, 160, 0.3);
  border-radius: 999px;
  color: #f0e8d4;
  background: rgba(63, 27, 19, 0.86);
  transform: translateX(-50%);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(7px, 0.8vw, 10px);
  font-weight: 800;
}

.mission-scene-crow { top: 42%; left: 14%; width: clamp(66px, 10%, 112px); aspect-ratio: 0.96; }
.mission-scene-deer { top: 64%; left: 35%; width: clamp(78px, 13%, 142px); aspect-ratio: 0.72; }
.mission-scene-tortoise { top: 67%; left: 65%; width: clamp(72px, 12%, 132px); aspect-ratio: 0.96; }
.mission-scene-mouse { top: 70%; left: 86%; width: clamp(55px, 8%, 92px); aspect-ratio: 0.72; }

.mission-scene-animal.move-scout {
  z-index: 8;
  animation:
    missionMoveScout 1.55s cubic-bezier(.2,.72,.2,1) both,
    missionHover 780ms 1.55s ease-in-out infinite alternate;
}

.mission-scene-animal.move-feign {
  z-index: 7;
  animation: missionMoveFeign 1.45s cubic-bezier(.2,.78,.28,1) both;
}

.mission-scene-animal.move-cut {
  z-index: 8;
  animation: missionMoveCut 1.55s cubic-bezier(.2,.72,.25,1) both;
}

.mission-scene-animal.move-water {
  z-index: 8;
  animation: missionMoveWater 2.1s cubic-bezier(.28,.7,.24,1) both;
}

.mission-scene-crow:is(.move-scout, .move-feign, .move-cut, .move-water) {
  width: clamp(96px, 16%, 178px);
  aspect-ratio: 1.22;
}

.mission-scene-deer:is(.move-scout, .move-feign, .move-cut, .move-water) {
  width: clamp(118px, 20%, 220px);
  aspect-ratio: 1.42;
}

.mission-scene-mouse:is(.move-scout, .move-feign, .move-cut, .move-water) {
  width: clamp(78px, 12%, 134px);
  aspect-ratio: 1.2;
}

.mission-scene-tortoise:is(.move-scout, .move-feign, .move-cut, .move-water) {
  width: clamp(102px, 17%, 188px);
  aspect-ratio: 1.28;
}

.mission-scene-crow.move-scout { aspect-ratio: 1.08; }
.mission-scene-crow.move-feign { aspect-ratio: 2.7; }
.mission-scene-crow.move-cut { aspect-ratio: 1.5; }
.mission-scene-crow.move-water { aspect-ratio: 1; }

.mission-scene-deer.move-scout { aspect-ratio: 1.2; }
.mission-scene-deer.move-feign { aspect-ratio: 1.3; }
.mission-scene-deer.move-cut { aspect-ratio: 1.2; }
.mission-scene-deer.move-water { width: clamp(92px, 16%, 176px); aspect-ratio: 0.7; }

.mission-scene-mouse.move-scout { aspect-ratio: 1; }
.mission-scene-mouse.move-feign { aspect-ratio: 1.8; }
.mission-scene-mouse.move-cut {
  width: clamp(92px, 14%, 154px);
  aspect-ratio: 1.3;
  animation: missionMouseReachNet 3.3s cubic-bezier(.2,.72,.25,1) both;
}
.mission-scene-mouse.move-water { aspect-ratio: 0.85; }

.mission-scene-tortoise.move-scout { aspect-ratio: 1.7; }
.mission-scene-tortoise.move-feign { aspect-ratio: 1.9; }
.mission-scene-tortoise.move-cut { aspect-ratio: 1.55; }
.mission-scene-tortoise.move-water {
  z-index: 4;
  aspect-ratio: 1.2;
  animation: missionTortoiseToLake 2.8s cubic-bezier(.24,.7,.2,1) both;
}

.mission-scene-animal:is(.move-scout, .move-cut, .move-water) .mission-idle-pose {
  opacity: 0;
}

.mission-scene-animal.move-feign .mission-idle-pose {
  transform-origin: 50% 86%;
  animation: missionBodyFold 780ms ease-in both;
}

.mission-scene-animal.move-scout .mission-scout-pose {
  opacity: 1;
  transform-origin: center;
  animation: missionAirPose 290ms ease-in-out infinite alternate;
}

.mission-scene-animal.move-feign .mission-feign-pose {
  animation: missionFeignReveal 1.2s ease-out both;
}

.mission-scene-animal.move-cut .mission-cut-pose {
  opacity: 1;
  transform-origin: 76% 58%;
  animation: missionGnawPose 165ms 520ms ease-in-out infinite alternate;
}

.mission-scene-mouse.move-cut .mission-idle-pose {
  opacity: 1;
  animation: missionMouseApproachPose 3.3s linear both;
}

.mission-scene-mouse.move-cut .mission-cut-pose {
  opacity: 0;
  transform-origin: 86% 62%;
  animation:
    missionMouseGnawReveal 3.3s linear both,
    missionGnawPose 150ms 1.02s ease-in-out 15 alternate both;
}

.mission-scene-animal.move-cut.is-action-complete .mission-idle-pose {
  opacity: 1;
  animation: none;
  transform: none;
}

.mission-scene-animal.move-cut.is-action-complete .mission-cut-pose {
  opacity: 0;
  animation: none;
}

.mission-scene-animal.move-water .mission-water-pose {
  opacity: 1;
  animation: missionWalkPose 310ms ease-in-out infinite alternate;
}

.mission-scene-tortoise.move-water .mission-water-pose {
  transform-origin: center bottom;
  animation: missionTortoiseWalk 240ms ease-in-out infinite alternate;
}

.missions-board.has-review .mission-live-scene {
  animation: missionReview 420ms ease-in-out;
}

.missions-failure .success-feather {
  border-color: rgba(222, 120, 119, 0.65);
  color: #ffd4d4;
  background: rgba(222, 120, 119, 0.15);
  box-shadow: 0 0 34px rgba(222, 120, 119, 0.2);
}

.missions-failure > p {
  color: #f0b2b1;
}

.missions-failure blockquote {
  max-width: 720px;
}

@keyframes missionMoveScout {
  0% { transform: translate(-50%, -50%) rotate(0); }
  28% { transform: translate(calc(-50% + var(--mission-dx-third)), calc(-50% + var(--mission-dy-third))) rotate(-7deg) scale(1.05); }
  62% { transform: translate(calc(-50% + var(--mission-dx-three-quarters)), calc(-50% + var(--mission-dy-three-quarters) - 8px)) rotate(5deg) scale(1.08); }
  100% { transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(0); }
}

@keyframes missionHover {
  from { transform: translate(calc(-50% + var(--mission-dx) - 5px), calc(-50% + var(--mission-dy) - 4px)) rotate(-2deg); }
  to { transform: translate(calc(-50% + var(--mission-dx) + 5px), calc(-50% + var(--mission-dy) + 5px)) rotate(2deg); }
}

@keyframes missionAirPose {
  from { transform: scaleY(0.91) rotate(-2deg); }
  to { transform: scaleY(1.04) rotate(2deg); }
}

@keyframes missionMoveFeign {
  0% { transform: translate(-50%, -50%) scale(1); }
  38% { transform: translate(-50%, calc(-50% + 4px)) scale(0.98); }
  72% { transform: translate(-50%, calc(-50% + 12px)) scale(0.94); }
  100% { transform: translate(-50%, calc(-50% + 15px)) scale(0.93); }
}

@keyframes missionBodyFold {
  0%, 28% { opacity: 1; transform: translateY(0) scaleY(1); }
  62% { opacity: 0.9; transform: translateY(15%) scaleY(0.72); }
  100% { opacity: 0; transform: translateY(25%) scaleY(0.48); }
}

@keyframes missionFeignReveal {
  0%, 46% { opacity: 0; transform: translateY(9%) scale(0.86); }
  74% { opacity: 1; transform: translateY(2%) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes missionMoveCut {
  0% { transform: translate(-50%, -50%) rotate(0); }
  38% { transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(-3deg) scale(1.03); }
  54% { transform: translate(calc(-50% + var(--mission-dx) - 4px), calc(-50% + var(--mission-dy) + 2px)) rotate(-4deg) scale(1.06); }
  70% { transform: translate(calc(-50% + var(--mission-dx) + 3px), calc(-50% + var(--mission-dy) - 1px)) rotate(4deg) scale(1.06); }
  86% { transform: translate(calc(-50% + var(--mission-dx) - 3px), calc(-50% + var(--mission-dy) + 2px)) rotate(-3deg) scale(1.04); }
  100% { transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(0); }
}

@keyframes missionMouseReachNet {
  0% { transform: translate(-50%, -50%) rotate(0); }
  14% { transform: translate(calc(-50% + var(--mission-dx-third)), calc(-50% + var(--mission-dy-third) - 6px)) rotate(-3deg) scale(1.02); }
  29% { transform: translate(calc(-50% + var(--mission-dx-two-thirds)), calc(-50% + var(--mission-dy-three-quarters) + 3px)) rotate(2deg) scale(1.02); }
  39% { transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(0) scale(1.04); }
  52% { transform: translate(calc(-50% + var(--mission-dx) + 2px), calc(-50% + var(--mission-dy) + 1px)) rotate(1deg) scale(1.04); }
  68% { transform: translate(calc(-50% + var(--mission-dx) - 2px), calc(-50% + var(--mission-dy) - 1px)) rotate(-1deg) scale(1.04); }
  84% { transform: translate(calc(-50% + var(--mission-dx) + 2px), calc(-50% + var(--mission-dy) + 1px)) rotate(1deg) scale(1.04); }
  100% { transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(0) scale(1.04); }
}

@keyframes missionMouseApproachPose {
  0%, 9%, 19%, 29% { opacity: 1; transform: translateY(0) rotate(0); }
  5%, 14%, 24%, 34% { opacity: 1; transform: translateY(-6px) rotate(-2deg); }
  38% { opacity: 1; transform: translateY(0) scale(0.96); }
  42%, 94% { opacity: 0; transform: translateY(3px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes missionMouseGnawReveal {
  0%, 37% { opacity: 0; }
  41%, 94% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes missionGnawPose {
  from { transform: translateX(-2px) rotate(-2deg); }
  to { transform: translateX(3px) rotate(3deg); }
}

@keyframes missionMoveWater {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  22% { opacity: 1; transform: translate(calc(-50% + var(--mission-dx-third)), calc(-50% + var(--mission-dy-third) - 4px)) rotate(-2deg) scale(0.99); }
  48% { opacity: 0.9; transform: translate(calc(-50% + var(--mission-dx-two-thirds)), calc(-50% + var(--mission-dy-three-quarters) - 2px)) rotate(2deg) scale(0.95); }
  76% { opacity: 0.56; transform: translate(calc(-50% + var(--mission-dx-three-quarters)), calc(-50% + var(--mission-dy-three-quarters))) rotate(-1deg) scale(0.82); }
  100% { opacity: 0.28; transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy))) rotate(0) scale(0.68); }
}

@keyframes missionTortoiseToLake {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
  22% { opacity: 1; transform: translate(calc(-50% + var(--mission-dx-third)), calc(-50% + var(--mission-dy-third) - 3px)) rotate(-2deg) scale(0.92); }
  52% { opacity: 0.92; transform: translate(calc(-50% + var(--mission-dx-two-thirds)), calc(-50% + var(--mission-dy-three-quarters) + 2px)) rotate(2deg) scale(0.7); }
  78% { opacity: 0.68; transform: translate(calc(-50% + var(--mission-dx-three-quarters)), calc(-50% + var(--mission-dy-three-quarters))) rotate(-1deg) scale(0.5); }
  100% { opacity: 0.18; transform: translate(calc(-50% + var(--mission-dx)), calc(-50% + var(--mission-dy) + 3px)) rotate(0) scale(0.34); }
}

@keyframes missionWalkPose {
  from { transform: translateY(1px) rotate(-1deg); }
  to { transform: translateY(-4px) rotate(1deg); }
}

@keyframes missionTortoiseWalk {
  from { transform: translateY(2px) rotate(-1.5deg) scaleY(0.98); }
  to { transform: translateY(-3px) rotate(1.5deg) scaleY(1.02); }
}

@keyframes missionNetGnaw {
  0%, 100% { transform: translate(-50%, -50%) rotate(-5deg) scaleY(0.78); }
  50% { transform: translate(calc(-50% + 4px), calc(-50% - 2px)) rotate(-8deg) scale(1.02, 0.75); }
}

@keyframes missionLakeRipple {
  0% { opacity: 0.08; transform: translate(-50%, -50%) scale(0.62); }
  55% { opacity: 0.34; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.34); }
}

@keyframes missionReview {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-7px); }
  65% { transform: translateX(7px); }
}

.missions-success blockquote {
  max-width: 700px;
}

.studio-screen {
  position: relative;
  height: var(--app-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 0, rgba(231, 197, 107, 0.16), transparent 38%),
    linear-gradient(145deg, var(--terracotta), var(--terracotta-deep));
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 9px max(18px, env(safe-area-inset-right)) 9px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(116, 48, 31, 0.97);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
}

.studio-topbar .studio-games-button {
  justify-self: start;
}

.studio-topbar .studio-game-title {
  min-width: 0;
  text-align: center;
}

.studio-topbar .top-actions {
  justify-self: end;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(231, 197, 107, 0.55);
  border-radius: 15px;
  color: var(--gold-light);
  background: linear-gradient(145deg, rgba(231, 197, 107, 0.22), rgba(231, 197, 107, 0.05));
  font-size: 22px;
}

.brand-lockup p,
.brand-lockup h2 {
  margin: 0;
}

.brand-lockup p {
  color: var(--gold);
  font-family: var(--playful-font);
  font-size: var(--type-game-kicker);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-lockup h2 {
  margin-top: 3px;
  color: var(--gold-light);
  font-size: var(--type-game-title);
  line-height: 1.1;
}

.friend-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(116, 48, 31, 0.92);
  backdrop-filter: blur(10px);
}

.friend-chip {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  transition: border-color 180ms ease, filter 180ms ease, transform 180ms ease;
}

.friend-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) brightness(0.62);
}

.friend-chip.is-ready {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(231, 197, 107, 0.13), 0 0 22px rgba(231, 197, 107, 0.28);
  transform: translateY(-1px);
}

.friend-chip.is-ready img {
  filter: none;
}

.friend-chip.is-ready::after {
  content: "✓";
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--night);
  border-radius: 50%;
  color: #0d3525;
  background: var(--green-bright);
  font-size: 11px;
  font-weight: 900;
}

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

.studio-games-button {
  flex: 0 0 auto;
}

.icon-button,
.soft-button,
.mini-button,
.open-panel-button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
}

.sound-button {
  line-height: 1;
  font-size: 18px;
}

.soft-button {
  padding: 9px 18px;
  font-weight: 800;
}

.icon-button:hover,
.soft-button:hover,
.mini-button:hover,
.open-panel-button:hover {
  border-color: rgba(231, 197, 107, 0.55);
  background: rgba(231, 197, 107, 0.12);
}

.danger-hover:hover {
  border-color: rgba(201, 95, 96, 0.7);
  background: rgba(201, 95, 96, 0.18);
}

.workspace {
  width: min(1420px, 100%);
  min-height: 0;
  flex: 1;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(12px, 2vw, 24px);
  direction: inherit;
}

.builder-panel {
  position: relative;
  z-index: 15;
  min-width: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(231, 197, 107, 0.28);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(175, 81, 49, 0.97), rgba(84, 34, 23, 0.98));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.step-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.panel-heading h3 {
  margin: 4px 0 0;
  font-size: 23px;
}

.studio-instruction {
  margin: 5px 0 0;
  color: #efddd3;
  font-size: var(--type-instruction);
  line-height: 1.55;
}

.mobile-close,
.modal-close {
  display: none;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 15px;
}

.category-tab {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 800;
}

.category-tab:last-child {
  grid-column: span 2;
}

.category-tab.is-active {
  border-color: rgba(231, 197, 107, 0.56);
  color: var(--terracotta-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 8px 18px rgba(231, 197, 107, 0.15);
}

.asset-tray {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-card {
  position: relative;
  min-width: 0;
  min-height: 124px;
  overflow: hidden;
  padding: 8px 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(231, 197, 107, 0.46);
  background: rgba(231, 197, 107, 0.1);
}

.asset-card img {
  width: 100%;
  height: 85px;
  object-fit: contain;
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.26));
}

.asset-card span {
  display: block;
  overflow: hidden;
  color: #eef2ee;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card small {
  color: var(--gold);
  font-size: 10px;
}

.mood-card {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: start;
  background-size: cover;
  background-position: center;
}

.mood-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(63, 27, 19, 0.84), rgba(116, 48, 31, 0.05));
}

.mood-card span,
.mood-card small {
  position: relative;
  z-index: 1;
}

.mood-card[data-mood="sunset"] { background: linear-gradient(145deg, #f7c87a, #a5573c); }
.mood-card[data-mood="day"] { background: linear-gradient(145deg, #b9ebff, #77b976); }
.mood-card[data-mood="moon"] { background: linear-gradient(145deg, #4d2030, #8e5b71); }
.mood-card[data-mood="mist"] { background: linear-gradient(145deg, #b7c9c3, #728c87); }

.panel-hint {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px dashed rgba(231, 197, 107, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(231, 197, 107, 0.045);
}

.panel-hint span {
  font-size: 23px;
}

.panel-hint p {
  margin: 0;
  font-size: var(--type-status);
  line-height: 1.5;
}

.canvas-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 14px 13px;
  direction: inherit;
}

.canvas-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-panel-button {
  display: none;
  padding: 7px 13px;
  color: var(--gold-light);
  font-size: var(--type-command);
  font-weight: 800;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.canvas-toolbar .history-actions {
  display: none;
}

.mini-button {
  width: 38px;
  min-height: 34px;
  padding: 0;
  border-radius: 11px;
  color: var(--muted);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.mini-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.canvas-hint {
  flex: 1;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: var(--type-status);
}

.scene-frame {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
}

.scene-canvas {
  position: relative;
  width: min(100%, calc((var(--app-height) - 265px) * 1.7778));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(231, 197, 107, 0.48);
  border-radius: clamp(15px, 2vw, 28px);
  background: var(--terracotta-dark);
  box-shadow: var(--shadow), 0 0 0 6px rgba(231, 197, 107, 0.05);
  touch-action: none;
}

.scene-background,
.atmosphere-overlay,
.scene-items,
.sparkles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-background {
  z-index: 0;
  object-fit: cover;
  pointer-events: none;
  transition: filter 550ms ease;
}

.atmosphere-overlay {
  z-index: 1;
  pointer-events: none;
  transition: background 550ms ease, opacity 550ms ease;
}

.scene-items {
  z-index: 3;
}

.mood-sunset .scene-background { filter: saturate(1.03) contrast(1.02); }
.mood-sunset .atmosphere-overlay { background: linear-gradient(100deg, rgba(231, 171, 87, 0.03), rgba(255, 188, 102, 0.12)); }
.mood-day .scene-background { filter: brightness(1.1) saturate(1.06) hue-rotate(-8deg); }
.mood-day .atmosphere-overlay { background: linear-gradient(rgba(169, 222, 255, 0.12), rgba(67, 147, 126, 0.02)); }
.mood-moon .scene-background { filter: brightness(0.58) saturate(0.8) hue-rotate(18deg); }
.mood-moon .atmosphere-overlay { background: radial-gradient(circle at 78% 18%, rgba(255, 229, 216, 0.22), transparent 18%), linear-gradient(rgba(83, 37, 54, 0.25), rgba(43, 24, 33, 0.46)); }
.mood-mist .scene-background { filter: brightness(0.95) saturate(0.66) contrast(0.88); }
.mood-mist .atmosphere-overlay { background: linear-gradient(90deg, rgba(217, 232, 224, 0.22), rgba(199, 216, 211, 0.4), rgba(217, 232, 224, 0.18)); }

.scene-item {
  position: absolute;
  z-index: var(--z, 1);
  width: var(--w, 20%);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transform-origin: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.27));
}

.scene-item:active {
  cursor: grabbing;
}

.scene-item > img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.scene-item.is-selected::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid var(--gold-light);
  border-radius: 16px;
  box-shadow: 0 0 0 3px rgba(63, 27, 19, 0.58), 0 0 22px rgba(255, 229, 160, 0.26);
  pointer-events: none;
}

.resize-handle,
.rotate-handle {
  position: absolute;
  z-index: 5;
  display: none;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid rgba(63, 27, 19, 0.82);
  border-radius: 50%;
  color: var(--terracotta-deep);
  background: var(--gold-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 900;
  touch-action: none;
}

.scene-item.is-selected .resize-handle,
.scene-item.is-selected .rotate-handle {
  display: grid;
}

.resize-handle {
  right: -17px;
  bottom: -17px;
  cursor: nwse-resize;
}

.rotate-handle {
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}

.scene-corner {
  position: absolute;
  z-index: 8;
  width: 70px;
  height: 70px;
  pointer-events: none;
  opacity: 0.75;
}

.corner-top {
  top: 10px;
  right: 10px;
  border-top: 2px solid rgba(255, 229, 160, 0.7);
  border-right: 2px solid rgba(255, 229, 160, 0.7);
  border-radius: 0 16px 0 0;
}

.corner-bottom {
  left: 10px;
  bottom: 10px;
  border-bottom: 2px solid rgba(255, 229, 160, 0.7);
  border-left: 2px solid rgba(255, 229, 160, 0.7);
  border-radius: 0 0 0 16px;
}

.selection-bar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(104, 41, 27, 0.9);
  backdrop-filter: blur(10px);
}

.selection-bar.is-empty {
  opacity: 0.48;
  pointer-events: none;
}

.selection-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.selected-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.selection-label small,
.selection-label strong {
  display: block;
}

.selection-label small {
  color: var(--gold);
  font-size: 10px;
}

.selection-label strong {
  margin-top: 2px;
  font-size: 14px;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.selection-actions button {
  min-width: 38px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.selection-actions button:hover {
  border-color: var(--gold);
  background: rgba(231, 197, 107, 0.14);
}

.selection-actions .delete-action:hover {
  border-color: var(--danger);
  background: rgba(201, 95, 96, 0.18);
}

.primary-actions {
  display: flex;
  justify-content: center;
}

.preview-button {
  min-width: min(330px, 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 10px 25px;
  border-radius: 18px;
  color: var(--terracotta-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 12px 30px rgba(231, 197, 107, 0.2);
}

.preview-button small,
.preview-button strong {
  display: block;
  text-align: start;
}

.preview-button small {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.7;
}

.preview-button strong {
  font-size: var(--type-command);
}

.play-orb {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  padding-right: 2px;
  border-radius: 50%;
  color: var(--gold-light);
  background: var(--terracotta-deep);
}

.sparkles {
  z-index: 9;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 13px var(--gold);
  animation: sparkleRise 2.3s ease-out forwards;
}

@keyframes sparkleRise {
  0% { opacity: 0; transform: translateY(15px) scale(0.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

.scene-canvas.is-alive .scene-item[data-key="dove"] {
  animation: doveAlive 2s ease-in-out infinite;
}

.scene-canvas.is-alive .scene-item[data-key="crow"] {
  animation: crowAlive 2.4s ease-in-out infinite 0.2s;
}

.scene-canvas.is-alive .scene-item[data-key="mouse"] {
  animation: mouseAlive 1s ease-in-out infinite;
}

.scene-canvas.is-alive .scene-item[data-key="tortoise"] {
  animation: tortoiseAlive 4s ease-in-out infinite;
}

.scene-canvas.is-alive .scene-item[data-key="deer"] {
  animation: deerAlive 2.5s ease-in-out infinite;
}

.scene-canvas.is-alive .scene-item[data-key="banyan"],
.scene-canvas.is-alive .scene-item[data-key="flower-tree"],
.scene-canvas.is-alive .scene-item[data-key="flowers"],
.scene-canvas.is-alive .scene-item[data-key="meadow"] {
  animation: natureAlive 3.6s ease-in-out infinite;
}

.scene-canvas.is-alive .scene-item[data-key="waterfall"],
.scene-canvas.is-alive .scene-item[data-key="lotus"],
.scene-canvas.is-alive .scene-item[data-key="lily-pads"] {
  animation: waterAlive 2.7s ease-in-out infinite;
}

@keyframes doveAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(calc(var(--r) + 3deg)) translateY(-16px) scale(1.02); }
}

@keyframes crowAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)); }
  50% { transform: translate(-50%, -50%) rotate(calc(var(--r) - 2deg)) translateY(-9px); }
}

@keyframes mouseAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(-5px); }
}

@keyframes tortoiseAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)) translateX(0); }
  50% { transform: translate(-50%, -50%) rotate(var(--r)) translateX(8px); }
}

@keyframes deerAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(-8px) rotate(1deg); }
}

@keyframes natureAlive {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r)); }
  50% { transform: translate(-50%, -50%) rotate(calc(var(--r) + 1.5deg)); }
}

@keyframes waterAlive {
  0%, 100% { filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.27)) brightness(1); }
  50% { filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.27)) brightness(1.13); }
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(48, 20, 14, 0.76);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(var(--app-height) - 44px));
  overflow: auto;
  padding: clamp(25px, 4vw, 42px);
  border: 1px solid rgba(231, 197, 107, 0.42);
  border-radius: 30px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(231, 197, 107, 0.18), transparent 37%),
    linear-gradient(145deg, var(--terracotta), var(--terracotta-deep));
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.08);
}

.modal-close {
  position: absolute;
  z-index: 5;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 25px;
}

.tutorial-icon {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(231, 197, 107, 0.5);
  border-radius: 24px;
  color: var(--gold-light);
  background: rgba(231, 197, 107, 0.1);
  box-shadow: 0 0 35px rgba(231, 197, 107, 0.18);
  font-size: 34px;
}

.modal-card h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.35;
}

.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 27px 0;
}

.tutorial-steps div {
  padding: 17px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.tutorial-steps span {
  display: grid;
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 50%;
  color: var(--terracotta-deep);
  background: var(--gold);
  font-weight: 900;
}

.tutorial-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.needs-card {
  overflow: visible;
  padding-top: 105px;
}

.modal-animal-stack {
  position: absolute;
  top: -70px;
  left: 50%;
  width: 230px;
  height: 170px;
  transform: translateX(-50%);
  pointer-events: none;
}

.modal-animal-stack img {
  position: absolute;
  bottom: 0;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.38));
}

.modal-animal-stack img:first-child {
  right: 20px;
}

.modal-animal-stack img:last-child {
  left: 20px;
  height: 145px;
}

.missing-list {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  text-align: start;
}

.missing-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(231, 197, 107, 0.2);
  border-radius: 14px;
  color: #f3ead0;
  background: rgba(231, 197, 107, 0.07);
}

.missing-item span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(231, 197, 107, 0.12);
}

.finish-card {
  overflow: hidden;
}

.celebration-rays {
  position: absolute;
  z-index: -1;
  top: -230px;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translateX(-50%);
  opacity: 0.22;
  background: repeating-conic-gradient(from 0deg, var(--gold) 0 7deg, transparent 7deg 15deg);
  animation: raysSpin 25s linear infinite;
}

@keyframes raysSpin {
  to { transform: translateX(-50%) rotate(360deg); }
}

.oasis-name-field {
  display: block;
  margin: 25px auto;
  text-align: start;
}

.oasis-name-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.oasis-name-field input {
  width: 100%;
  min-height: 54px;
  padding: 10px 15px;
  border: 1px solid rgba(231, 197, 107, 0.3);
  border-radius: 15px;
  color: var(--ink);
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  font-size: 20px;
  font-weight: 800;
}

.finish-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 17px;
}

.final-wisdom {
  margin: 0;
  color: var(--gold-light);
  font-family: inherit;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.55;
}

.oasis-wisdom-card {
  width: 100%;
  margin: 20px 0 0;
}

.export-card {
  width: min(680px, 100%);
}

.export-help {
  margin: 8px 0 15px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.export-preview-image {
  display: block;
  width: 100%;
  max-height: min(52svh, 430px);
  margin: 0 auto 16px;
  border: 1px solid rgba(231, 197, 107, 0.42);
  border-radius: 17px;
  object-fit: contain;
  background: rgba(63, 27, 19, 0.5);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
  -webkit-touch-callout: default;
  user-select: auto;
}

.export-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.compact-card {
  width: min(460px, 100%);
}

.compact-card p {
  color: var(--muted);
}

.danger-button {
  color: white;
  background: linear-gradient(135deg, #db7777, #ad4749);
  box-shadow: 0 12px 30px rgba(201, 95, 96, 0.18);
}

.toast {
  position: fixed;
  z-index: 160;
  left: 50%;
  bottom: 28px;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border: 1px solid rgba(231, 197, 107, 0.35);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(84, 34, 23, 0.97);
  box-shadow: 0 13px 35px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, 22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  font-size: 13px;
  font-weight: 800;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 1040px) {
  .game-choice-grid {
    width: min(760px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-choice-card {
    aspect-ratio: 4 / 3;
  }

  .topbar {
    grid-template-columns: 1fr auto 1fr;
  }

  .studio-screen .friend-progress {
    background: rgba(111, 44, 28, 0.92);
  }

  .friend-chip {
    width: 38px;
    height: 38px;
  }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .canvas-column {
    padding-top: 10px;
  }

  .selection-bar {
    align-items: flex-start;
  }

  .selection-actions button {
    min-height: 34px;
  }
}

@media (min-width: 701px) and (max-width: 1440px) and (min-height: 601px) {
  .game-card-art {
    flex: 0 0 52%;
  }

  .game-card-copy {
    min-height: 0;
    flex: 1 1 auto;
    padding: 12px 16px 14px;
    padding-inline-end: 52px;
  }

  .game-card-copy small {
    font-size: 12px;
  }

  .game-card-copy strong {
    font-size: clamp(22px, 2.1vw, 27px);
    line-height: 1.25;
  }

  .game-card-copy > span {
    font-size: 14px;
    line-height: 1.35;
  }

  .game-card-arrow {
    bottom: 14px;
    inset-inline-end: 14px;
  }
}

@media (max-width: 700px), (max-height: 600px) and (orientation: landscape) and (max-width: 1000px) {
  .cover-screen {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(72px, env(safe-area-inset-bottom));
  }

  .cover-copy {
    width: min(600px, 92vw);
    margin: 0;
    padding-inline: 10px;
    transform: translateY(-2vh);
  }

  .cover-dove {
    width: 62vw;
    top: -9vw;
    left: -13vw;
    opacity: 0.72;
  }

  .cover-deer {
    width: 30vw;
    left: -3vw;
  }

  .cover-tortoise {
    left: 21vw;
  }

  .cover-crow {
    right: 15vw;
  }

  .workspace {
    display: block;
    position: relative;
  }

  .builder-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(350px, 88vw);
    padding-top: max(20px, env(safe-area-inset-top));
    transform: translateX(105%);
    transition: transform 220ms ease;
    box-shadow: -28px 0 75px rgba(0, 0, 0, 0.46);
  }

  .builder-panel.is-open {
    transform: translateX(0);
  }

  .mobile-close {
    display: block;
    width: 38px;
    height: 38px;
    font-size: 28px;
  }

  .canvas-column {
    height: calc(var(--app-height) - 78px);
    padding: 41px 9px 10px;
  }

  .open-panel-button {
    display: block;
  }

  .canvas-hint {
    display: none;
  }

  .scene-canvas {
    width: min(100%, calc((var(--app-height) - 310px) * 1.7778));
  }

  .selection-label {
    display: none;
  }

  .selection-actions {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 701px) and (max-width: 900px) and (min-height: 601px) {
  .cover-copy {
    width: min(620px, 82vw);
    margin: 0;
    padding-inline: 18px;
    transform: translateY(-2vh);
  }

  .cover-dove {
    width: 54vw;
    top: -7vw;
    left: -12vw;
    opacity: 0.78;
  }

  .cover-deer {
    width: 28vw;
    left: -2vw;
  }

  .workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .builder-panel {
    padding: 14px;
  }

  .panel-heading h3 {
    font-size: 20px;
  }

  .asset-tray {
    gap: 7px;
  }

  .asset-card {
    min-height: 108px;
    padding: 6px;
    border-radius: 15px;
  }

  .asset-card img {
    height: 68px;
  }

  .panel-hint {
    display: none;
  }

  .canvas-column {
    padding-inline: 10px;
  }

  .scene-canvas {
    width: min(100%, calc((var(--app-height) - 300px) * 1.7778));
  }
}

@media (max-width: 640px) {
  :root {
    --type-game-kicker: 11px;
    --type-game-title: 19px;
    --type-panel-title: 23px;
    --type-instruction: 12px;
    --type-status: 11px;
    --type-command: 14px;
  }

  .game-menu-screen {
    gap: 15px;
    padding-inline: 12px;
  }

  .game-menu-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
  }

  .game-menu-header h1 {
    font-size: 34px;
  }

  .game-menu-header p {
    font-size: 12px;
  }

  .game-menu-header div > span {
    font-size: 12px;
  }

  .menu-back-button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .menu-header-star {
    display: none;
  }

  .game-choice-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
  }

  .game-choice-card {
    aspect-ratio: 16 / 9;
    border-radius: 18px;
  }

  .oasis-choice .choice-dove {
    width: 47%;
    top: 2%;
    left: 2%;
  }

  .oasis-choice .choice-deer {
    width: 31%;
    right: 4%;
    bottom: 0;
  }

  .oasis-choice .choice-tortoise {
    width: 25%;
    left: 36%;
    bottom: 0;
  }

  .game-card-copy {
    padding: 10px 11px 12px;
    padding-inline-end: 36px;
  }

  .game-card-copy small {
    font-size: 11px;
  }

  .game-card-copy strong {
    font-size: 15px;
    line-height: 1.25;
  }

  .game-card-copy > span {
    display: none;
  }

  .game-card-arrow {
    inset-inline-end: 8px;
    bottom: 10px;
    width: 25px;
    height: 25px;
    font-size: 14px;
  }

  .game-menu-wisdom {
    font-size: 11px;
  }

  .leader-game-screen {
    overflow: auto;
  }

  .mini-game-topbar {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 8px;
  }

  .mini-nav-button {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .mini-game-title p {
    display: none;
  }

  .mini-game-title h1 {
    font-size: var(--type-game-title);
  }

  .mini-game-actions {
    gap: 4px;
  }

  .mini-game-actions .icon-button {
    width: 35px;
    min-height: 35px;
  }

  .leader-game-layout {
    width: 100%;
    min-height: auto;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .leader-brief {
    align-self: stretch;
    padding: 14px;
    border-radius: 18px;
  }

  .leader-value {
    padding: 4px 8px;
    font-size: 10px;
  }

  .leader-brief h2 {
    margin: 8px 0 4px;
    font-size: var(--type-panel-title);
  }

  .leader-brief > p:not(.leader-message) {
    font-size: var(--type-instruction);
    line-height: 1.55;
  }

  .leader-progress-wrap {
    margin-top: 10px;
    padding: 9px;
  }

  .leader-message {
    min-height: 0;
    margin-top: 9px;
    padding: 8px 10px;
    font-size: var(--type-status);
  }

  .leader-board {
    aspect-ratio: 4 / 5;
    border-radius: 20px;
  }

  .captive-dove {
    width: clamp(76px, 25vw, 104px);
  }

  .leader-dove {
    width: clamp(88px, 28vw, 116px);
  }

  .leader-net {
    top: -4%;
    left: -25%;
    width: 150%;
    height: 110%;
  }
  .dove-friend-one { left: 24%; top: 55%; }
  .dove-friend-two { left: 76%; top: 55%; }
  .dove-friend-three { left: 29%; top: 77%; }
  .dove-friend-four { left: 71%; top: 77%; }
  .leader-dove { left: 50%; top: 66%; }

  .wings-net {
    top: 3%;
    left: -25%;
    width: 150%;
    height: 86%;
  }

  .wings-bird {
    width: clamp(70px, 22vw, 98px);
  }

  .wings-bird-one { top: 39%; left: 22%; }
  .wings-bird-two { top: 39%; left: 78%; }
  .wings-bird-leader { top: 50%; left: 50%; width: clamp(86px, 27vw, 116px); }
  .wings-bird-three { top: 63%; left: 27%; }
  .wings-bird-four { top: 63%; left: 73%; }

  .wings-rhythm {
    bottom: 3%;
    width: clamp(88px, 25vw, 108px);
  }

  .rescue-mouse {
    width: 28%;
  }

  .leader-success {
    padding: 16px;
  }

  .leader-success-actions {
    width: min(280px, 100%);
    flex-direction: column;
  }

  .leader-success-actions button {
    width: 100%;
  }

  .missions-board {
    display: block;
    padding: 7px;
  }

  .missions-brief .action-picker-group {
    margin-top: 10px;
  }

  .mission-picker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mission-picker-group {
    padding: 6px;
    border-radius: 12px;
  }

  .mission-picker-group header {
    gap: 5px;
    margin-bottom: 4px;
  }

  .mission-picker-group header span {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
  }

  .mission-picker-group h3 {
    font-size: 10px;
  }

  .mission-animal-list,
  .mission-action-list {
    gap: 4px;
  }

  .mission-animal-option {
    min-height: 52px;
    padding: 2px;
    border-radius: 9px;
  }

  .mission-animal-option img {
    max-width: 32px;
    max-height: 31px;
  }

  .mission-animal-option strong {
    font-size: 9px;
  }

  .mission-animal-option small {
    display: none;
  }

  .mission-action-option {
    min-height: 32px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 3px;
    padding: 3px 4px;
    border-radius: 9px;
  }

  .mission-action-option > span {
    width: 21px;
    height: 21px;
    border-radius: 6px;
    font-size: 13px;
  }

  .mission-action-option strong {
    font-size: 8px;
  }

  .mission-live-scene {
    border-radius: 14px;
  }

  .mission-scene-caption {
    top: 5px;
    padding: 3px 7px;
    font-size: 7px;
  }

  .mission-scene-crow { width: 18%; }
  .mission-scene-deer { width: 23%; }
  .mission-scene-tortoise { width: 21%; }
  .mission-scene-mouse { width: 14%; }

  .mission-scene-animal > span {
    max-width: 80px;
    padding: 2px 4px;
    font-size: 6px;
  }

  .mission-finish-button {
    min-height: 42px;
    margin-top: 8px;
    font-size: var(--type-command);
  }

  .cover-copy h1 {
    font-size: clamp(48px, 14.5vw, 70px);
    line-height: 1.08;
  }

  .cover-subtitle {
    max-width: 320px;
    margin: 15px auto 20px;
    font-size: 16px;
    line-height: 1.6;
  }

  .start-button {
    min-width: min(238px, 82vw);
    min-height: 52px;
    font-size: 18px;
  }

  .cover-note {
    display: none;
  }

  .cover-dove {
    width: 56vw;
    top: -5vw;
    left: -9vw;
  }

  .topbar {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-lockup p {
    display: none;
  }

  .brand-lockup h2 {
    font-size: var(--type-game-title);
  }

  .top-actions {
    gap: 5px;
  }

  .top-actions .soft-button {
    display: none;
  }

  .icon-button {
    width: 38px;
    min-height: 38px;
  }

  .friend-chip {
    width: 34px;
    height: 34px;
  }

  .canvas-column {
    height: auto;
    padding-top: 10px;
  }

  .canvas-toolbar {
    min-height: 36px;
  }

  .history-actions .mini-button {
    padding-inline: 0;
    font-size: 21px;
  }

  .studio-screen {
    overflow: auto;
  }

  .studio-screen .workspace {
    min-height: auto;
    flex: 0 0 auto;
    padding: 10px;
  }

  .studio-screen .canvas-column {
    min-height: auto;
  }

  .studio-screen .scene-frame {
    min-height: auto;
    flex: 0 0 auto;
  }

  .scene-canvas {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 14px;
  }

  .selection-bar {
    overflow-x: auto;
    padding: 6px;
  }

  .selection-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .selection-actions button {
    flex: 0 0 auto;
  }

  .primary-actions {
    margin-top: 0;
  }

  .preview-button {
    min-height: 48px;
    padding: 7px 16px;
  }

  .play-orb {
    width: 32px;
    height: 32px;
  }

  .tutorial-steps {
    grid-template-columns: 1fr;
  }

  .tutorial-steps div {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    text-align: start;
  }

  .tutorial-steps span {
    margin: 0;
    flex: 0 0 auto;
  }

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

@media (min-width: 641px) and (max-width: 900px) {
  :root {
    --type-game-kicker: 12px;
    --type-game-title: 28px;
    --type-panel-title: 28px;
    --type-instruction: 14px;
    --type-status: 13px;
    --type-command: 16px;
  }

  .leader-game-screen {
    overflow: auto;
  }

  .leader-game-layout {
    min-height: auto;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(850px, 100%);
  }

  .leader-brief {
    align-self: stretch;
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.2fr);
    gap: 10px 18px;
    padding: 16px 20px;
  }

  .leader-value,
  .leader-brief h2 {
    grid-column: 1;
  }

  .leader-brief h2 {
    margin: 0;
    font-size: var(--type-panel-title);
  }

  .leader-brief > p:not(.leader-message),
  .leader-progress-wrap,
  .leader-message {
    grid-column: 2;
  }

  .leader-brief > p:not(.leader-message) {
    grid-row: 1;
  }

  .leader-progress-wrap {
    grid-row: 2;
    margin: 0;
  }

  .leader-message {
    grid-row: 3;
    min-height: 0;
    margin: 0;
  }

  .missions-brief .mission-finish-button {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    margin: 0;
  }

  .missions-brief .action-picker-group {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }

  .leader-board {
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 900px) and (min-height: 601px) {
  .studio-screen {
    overflow: auto;
  }

  .studio-screen .workspace {
    width: min(850px, 100%);
    min-height: auto;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .studio-screen .builder-panel {
    position: relative;
    inset: auto;
    width: 100%;
    max-height: 300px;
    padding: 16px 20px;
    transform: none;
  }

  .studio-screen .mobile-close,
  .studio-screen .open-panel-button {
    display: none;
  }

  .studio-screen .asset-tray {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .studio-screen .asset-card {
    min-height: 100px;
  }

  .studio-screen .asset-card img {
    height: 64px;
  }

  .studio-screen .canvas-column {
    height: auto;
    padding: 10px;
  }

  .studio-screen .scene-frame {
    min-height: auto;
    flex: 0 0 auto;
  }

  .studio-screen .scene-canvas {
    width: 100%;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .topbar {
    min-height: 64px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .canvas-column {
    padding-top: 7px;
    gap: 6px;
  }

  .scene-canvas {
    width: min(100%, calc((var(--app-height) - 216px) * 1.7778));
  }

  .selection-bar {
    min-height: 52px;
  }

  .preview-button {
    padding-block: 7px;
  }
}

@media (max-height: 600px) and (orientation: landscape) and (max-width: 1000px) {
  :root {
    --type-game-kicker: 10px;
    --type-game-title: 19px;
    --type-panel-title: 19px;
    --type-instruction: 12px;
    --type-status: 10px;
    --type-command: 13px;
  }

  .game-menu-screen {
    gap: 8px;
    padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }

  .game-menu-header h1 {
    font-size: 30px;
  }

  .game-menu-header div > span,
  .game-menu-wisdom {
    display: none;
  }

  .game-choice-grid {
    width: min(570px, 74vw);
    gap: 12px;
  }

  .game-card-copy {
    padding-block: 9px;
  }

  .game-card-copy strong {
    font-size: 18px;
  }

  .leader-game-screen {
    overflow: hidden;
  }

  .mini-game-topbar {
    min-height: 56px;
    padding-block: 4px;
  }

  .leader-game-layout {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
  }

  .leader-brief {
    display: block;
    align-self: stretch;
    overflow: hidden;
    padding: 10px;
    border-radius: 15px;
  }

  .leader-value {
    font-size: 10px;
  }

  .leader-brief h2 {
    margin: 5px 0;
    font-size: var(--type-panel-title);
  }

  .leader-brief > p:not(.leader-message) {
    display: none;
  }

  .missions-brief .action-picker-group {
    margin-top: 7px;
    padding: 6px;
  }

  .missions-brief .action-picker-group header {
    display: none;
  }

  .missions-brief .mission-action-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .missions-brief .mission-action-option {
    min-height: 30px;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 3px;
    padding: 3px 4px;
  }

  .missions-brief .mission-action-option > span {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .missions-brief .mission-action-option strong {
    font-size: 8px;
  }

  .leader-progress-wrap {
    margin-top: 7px;
    padding: 7px;
  }

  .leader-message {
    min-height: 0;
    margin-top: 7px;
    padding: 7px;
    font-size: var(--type-status);
    line-height: 1.35;
  }

  .mission-finish-button {
    min-height: 38px;
    margin-top: 7px;
    font-size: var(--type-command);
  }

  .leader-board {
    align-self: center;
    width: min(100%, calc((var(--app-height) - 72px) * 1.7778));
    aspect-ratio: 16 / 9;
  }

  .cover-screen {
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .cover-copy {
    width: min(560px, 72vw);
    padding: 6px 12px;
    transform: none;
  }

  .cover-copy h1 {
    font-size: clamp(38px, 8vw, 58px);
  }

  .cover-subtitle {
    max-width: 520px;
    margin: 6px auto 10px;
    font-size: 14px;
    line-height: 1.45;
  }

  .start-button {
    min-width: 220px;
    min-height: 43px;
    padding-block: 7px;
    font-size: 16px;
  }

  .cover-note {
    display: none;
  }

  .cover-dove {
    width: 34vw;
    top: -11vw;
    left: -5vw;
  }

  .cover-deer {
    width: 20vw;
    bottom: -18vh;
  }

  .cover-mouse,
  .cover-crow,
  .cover-tortoise {
    max-height: 34vh;
  }

  .topbar {
    min-height: 56px;
    padding-block: 5px;
  }

  .brand-lockup p,
  .top-actions .soft-button {
    display: none;
  }

  .brand-mark,
  .icon-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .friend-progress { gap: 4px; }

  .friend-chip {
    width: 29px;
    height: 29px;
  }

  .builder-panel {
    width: min(330px, 58vw);
  }

  .canvas-column {
    height: calc(var(--app-height) - 56px);
    padding: 33px 8px 6px;
  }

  .scene-canvas {
    width: min(100%, calc((var(--app-height) - 205px) * 1.7778));
    border-radius: 12px;
  }

  .selection-bar {
    min-height: 45px;
    padding-block: 4px;
  }

  .selection-actions button {
    min-height: 32px;
  }

  .preview-button {
    min-height: 40px;
    padding: 5px 16px;
  }

  .preview-button small {
    display: none;
  }

  .play-orb {
    width: 29px;
    height: 29px;
  }
}

@media (min-width: 901px) and (min-height: 601px) {
  :root {
    --type-game-kicker: 15px;
    --type-game-title: clamp(31px, 2.5vw, 39px);
    --type-panel-title: clamp(34px, 3vw, 43px);
    --type-instruction: 17px;
    --type-status: 15px;
    --type-command: 18px;
  }

  .game-menu-header p {
    font-size: 16px;
  }

  .game-menu-header div > span,
  .game-menu-wisdom {
    font-size: 18px;
  }

  .menu-back-button {
    min-height: 48px;
    padding: 10px 19px;
    font-size: 17px;
  }

  .game-card-copy small {
    font-size: 14px;
  }

  .game-card-copy > span {
    font-size: 16px;
    line-height: 1.45;
  }

  .mini-game-topbar {
    min-height: 82px;
  }

  .topbar {
    min-height: 82px;
  }

  .mini-game-title p {
    font-size: var(--type-game-kicker);
  }

  .mini-game-title h1 {
    font-size: var(--type-game-title);
  }

  .mini-nav-button {
    min-height: 48px;
    padding: 10px 19px;
    font-size: 17px;
  }

  .leader-game-layout {
    grid-template-columns: minmax(330px, 370px) minmax(0, 1fr);
    gap: clamp(18px, 2vw, 28px);
  }

  .leader-brief {
    padding: clamp(24px, 2.2vw, 30px);
  }

  .leader-value {
    font-size: 14px;
  }

  .leader-brief h2 {
    font-size: var(--type-panel-title);
  }

  .leader-brief > p:not(.leader-message) {
    color: #eef2f4;
    font-size: var(--type-instruction);
    line-height: 1.75;
  }

  .leader-progress-wrap > span {
    font-size: 14px;
  }

  .leader-progress-dots i {
    height: 10px;
  }

  .leader-message {
    color: #fff8e8;
    font-size: var(--type-status);
  }

  .leader-name {
    padding: 5px 11px;
    font-size: 14px;
  }

  .wings-rhythm {
    width: clamp(132px, 10vw, 156px);
  }

  .wings-beat-button small {
    font-size: 13px;
  }

  .wings-beat-button strong {
    font-size: 24px;
  }

  .mission-scene-caption {
    padding: 6px 13px;
    font-size: 14px;
  }

  .mission-scene-animal > span {
    padding: 4px 9px;
    font-size: 12px;
  }

  .leader-success-actions button {
    min-height: 48px;
    font-size: 17px;
  }

  .missions-game-layout {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .missions-brief {
    padding: 20px;
  }

  .missions-brief h2 {
    margin: 10px 0 6px;
  }

  .missions-brief > p:not(.leader-message) {
    line-height: 1.55;
  }

  .missions-brief .action-picker-group {
    margin-top: 12px;
    padding: 9px;
  }

  .missions-brief .mission-picker-group h3 {
    font-size: 17px;
  }

  .missions-brief .mission-action-option {
    min-height: 48px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.085);
  }

  .missions-brief .mission-action-option > span {
    width: 30px;
    height: 30px;
  }

  .missions-brief .mission-action-option strong {
    color: #fff8e8;
    font-size: 15px;
    line-height: 1.4;
  }

  .missions-brief .leader-progress-wrap > span {
    font-size: 14px;
  }

  .missions-brief .leader-progress-wrap {
    margin-top: 12px;
    padding: 10px;
  }

  .missions-brief .leader-message {
    min-height: 58px;
    margin-top: 10px;
    padding: 9px 11px;
    color: #fff8e8;
    font-size: var(--type-status);
  }

  .missions-brief .mission-finish-button {
    min-height: 48px;
    margin-top: 10px;
    font-size: var(--type-command);
  }

  .studio-screen .workspace {
    grid-template-columns: minmax(310px, 340px) minmax(0, 1fr);
  }

  .studio-screen .soft-button {
    font-size: 15px;
  }

  .studio-screen .brand-lockup p {
    font-size: var(--type-game-kicker);
  }

  .studio-screen .brand-lockup h2 {
    font-size: var(--type-game-title);
  }

  .studio-screen .step-label {
    font-size: 13px;
  }

  .studio-screen .panel-heading h3 {
    font-size: 25px;
  }

  .studio-screen .asset-card span {
    font-size: 15px;
  }

  .studio-screen .asset-card small,
  .studio-screen .panel-hint p {
    font-size: 13px;
  }

  .studio-screen .canvas-hint {
    color: #fff3e7;
    font-size: var(--type-status);
    font-weight: 700;
  }

  .studio-screen .selection-label small {
    font-size: 12px;
  }

  .studio-screen .selection-label strong,
  .studio-screen .selection-actions button {
    font-size: 14px;
  }

  .studio-screen .preview-button strong {
    font-size: var(--type-command);
  }
}

@media (min-width: 1600px) and (min-height: 900px) {
  .game-choice-grid {
    width: min(1320px, 100%);
  }

  .cover-copy {
    width: min(820px, 58vw);
  }

  .cover-copy h1 {
    font-size: clamp(92px, 6vw, 128px);
  }

  .cover-subtitle {
    max-width: 700px;
    font-size: 28px;
  }

  .start-button {
    min-width: 320px;
    min-height: 66px;
    font-size: 23px;
  }

  .topbar {
    min-height: 92px;
    padding-inline: 28px;
  }

  .workspace {
    grid-template-columns: 380px minmax(0, 1fr);
  }

  .builder-panel {
    padding: 24px;
  }

  .asset-card {
    min-height: 148px;
  }

  .asset-card img {
    height: 104px;
  }

  .canvas-column {
    padding: 16px 24px 20px;
  }

  .scene-canvas {
    width: min(100%, calc((var(--app-height) - 310px) * 1.7778), 1600px);
  }

  .selection-bar {
    min-height: 72px;
  }

  .preview-button {
    min-width: 390px;
    min-height: 64px;
  }
}

@media (max-width: 640px) {
  :root {
    --type-game-kicker: 13px;
    --type-game-title: 24px;
    --type-panel-title: 30px;
    --type-instruction: 16px;
    --type-status: 15px;
    --type-command: 18px;
  }

  .mini-game-topbar {
    min-height: 68px;
  }

  .mini-nav-button {
    min-height: 40px;
    padding: 7px 11px;
    font-size: 14px;
    font-weight: 800;
  }

  .mini-game-title h1 {
    font-size: var(--type-game-title);
    line-height: 1.2;
  }

  .mini-game-actions .icon-button {
    width: 40px;
    min-height: 40px;
    font-size: 17px;
  }

  .leader-brief {
    padding: 18px;
  }

  .leader-value {
    padding: 5px 10px;
    font-size: 13px;
  }

  .leader-brief h2 {
    margin: 10px 0 6px;
    font-size: var(--type-panel-title);
    line-height: 1.28;
  }

  .leader-brief > p:not(.leader-message) {
    color: #fff2e9;
    font-size: var(--type-instruction);
    font-weight: 500;
    line-height: 1.7;
  }

  .leader-progress-wrap {
    margin-top: 13px;
    padding: 11px;
  }

  .leader-progress-wrap > span {
    font-size: 15px;
    line-height: 1.45;
  }

  .leader-message {
    min-height: 52px;
    margin-top: 11px;
    padding: 10px 12px;
    color: #fff8e8;
    font-size: var(--type-status);
    font-weight: 500;
    line-height: 1.6;
  }

  .missions-brief .action-picker-group {
    margin-top: 12px;
    padding: 10px;
  }

  .mission-picker-group header {
    gap: 7px;
    margin-bottom: 7px;
  }

  .mission-picker-group header span {
    width: 27px;
    height: 27px;
    font-size: 13px;
  }

  .mission-picker-group h3 {
    font-size: 15px;
  }

  .mission-action-list {
    gap: 7px;
  }

  .mission-action-option {
    min-height: 48px;
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.075);
  }

  .mission-action-option > span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 16px;
  }

  .mission-action-option strong {
    color: #fff8e8;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
  }

  .mission-finish-button {
    min-height: 52px;
    margin-top: 11px;
    font-size: var(--type-command);
  }

  .mission-scene-caption {
    top: 7px;
    max-width: calc(100% - 24px);
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
  }

  .mission-scene-animal > span {
    max-width: 112px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
  }

  .leader-name {
    padding: 4px 8px;
    font-size: 12px;
  }

  .wings-beat-button small {
    font-size: 11px;
  }

  .wings-beat-button strong {
    font-size: 18px;
  }

  .leader-success blockquote,
  .final-wisdom {
    font-size: 17px;
  }

  .wisdom-card-label {
    font-size: 12px;
  }
}

html[dir="ltr"] body {
  text-align: left;
}

html[dir="ltr"] .cover-copy h1 {
  font-size: clamp(42px, 5.8vw, 76px);
  letter-spacing: -0.045em;
}

html[dir="ltr"] .button-arrow,
html[dir="ltr"] .game-card-arrow {
  transform: scaleX(-1);
}

html[dir="ltr"] .game-card-copy strong {
  font-size: clamp(17px, 2.1vw, 26px);
  line-height: 1.2;
}

html[dir="ltr"] .mini-game-title h1 {
  font-size: calc(var(--type-game-title) * 0.88);
}

html[dir="ltr"] .leader-brief,
html[dir="ltr"] .modal-card,
html[dir="ltr"] .builder-panel,
html[dir="ltr"] .game-card-copy {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .language-choice {
    width: min(310px, 90%);
    margin-bottom: 15px;
    padding: 8px;
  }

  .language-choice > p {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .language-button {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 13px;
  }

  html[dir="ltr"] .game-card-copy strong {
    font-size: 14px;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .language-choice,
  .start-button {
    position: relative;
    top: clamp(24px, 3.5vh, 32px);
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .cover-subtitle {
    margin: 8px auto 10px;
  }

  .language-choice {
    width: min(300px, 72%);
    margin-bottom: 10px;
    padding: 6px;
  }

  .language-choice > p {
    display: none;
  }

  .language-button {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 12px;
  }
}

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