:root {
  color: #243147;
  background: #dff5ff;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #243147;
  --muted: #68738a;
  --white: #ffffff;
  --cream: #fffaf0;
  --shadow: 0 18px 48px rgba(47, 69, 100, 0.17);
  --soft-shadow: 0 9px 24px rgba(47, 69, 100, 0.13);
  --focus: 0 0 0 4px rgba(68, 157, 255, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
  width: 100%;
}

html {
  background: #dff5ff;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: #dff5ff;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button:disabled {
  cursor: not-allowed;
}

canvas {
  display: block;
  touch-action: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: #718099;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.danger-outline-button {
  align-items: center;
  border: 0;
  border-radius: 1rem;
  display: inline-flex;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  gap: 0.65rem;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.78rem 1.25rem;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #ff6c9d, #ff8f56);
  box-shadow: 0 10px 22px rgba(240, 96, 111, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

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

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.danger-outline-button:active {
  transform: translateY(1px) scale(0.985);
}

.secondary-button {
  background: #f1f5fa;
  box-shadow: inset 0 0 0 2px #dfe7f1;
  color: #33415a;
}

.icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
  display: inline-flex;
  font-weight: 900;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.icon-button:hover {
  transform: translateY(-1px);
}

/* Welcome */
.welcome-screen {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.88), transparent 24rem),
    radial-gradient(circle at 92% 12%, rgba(255, 233, 167, 0.55), transparent 24rem),
    linear-gradient(145deg, #bcecff 0%, #e7f9d7 48%, #ffe5f2 100%);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2.3rem);
  position: relative;
}

.welcome-screen::after {
  background: linear-gradient(180deg, transparent, rgba(79, 174, 84, 0.2));
  border-radius: 50% 50% 0 0;
  bottom: -13rem;
  content: "";
  height: 25rem;
  left: -8%;
  position: absolute;
  width: 116%;
}

.welcome-cloud {
  background: rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  filter: blur(0.4px);
  height: 4.5rem;
  position: absolute;
  width: 12rem;
}

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

.welcome-cloud::before {
  height: 5.6rem;
  left: 1.8rem;
  top: -2.8rem;
  width: 5.6rem;
}

.welcome-cloud::after {
  height: 7rem;
  right: 1.5rem;
  top: -3.7rem;
  width: 7rem;
}

.cloud-one {
  left: -3rem;
  top: 13%;
}

.cloud-two {
  right: -4rem;
  top: 28%;
  transform: scale(0.8);
}

.welcome-layout {
  align-items: center;
  display: grid;
  gap: clamp(1.4rem, 4vw, 4rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  margin: 0 auto;
  max-width: 1420px;
  min-height: calc(100vh - clamp(2rem, 6vw, 4.6rem));
  position: relative;
  z-index: 2;
}

.welcome-visual {
  min-width: 0;
}

.brand-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
  color: #40506a;
  display: inline-flex;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding: 0.55rem 1rem;
}

.welcome-visual > h1 {
  color: #28364c;
  font-size: clamp(3.1rem, 6vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.91;
  margin-bottom: 1rem;
  max-width: 980px;
}

.welcome-visual > h1 span {
  color: #e84f87;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.72);
}

.welcome-lede {
  color: #53617a;
  font-size: clamp(1rem, 1.7vw, 1.28rem);
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  max-width: 800px;
}

.hero-frame {
  background: rgba(255, 255, 255, 0.63);
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  height: clamp(310px, 42vh, 510px);
  max-width: 850px;
  overflow: hidden;
  position: relative;
}

.hero-scene {
  height: 100%;
  width: 100%;
}

.hero-caption {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 1.1rem;
  bottom: 1rem;
  box-shadow: var(--soft-shadow);
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
  left: 1rem;
  padding: 0.7rem 0.9rem;
  position: absolute;
  right: 1rem;
}

.hero-caption strong {
  color: #2f405a;
  font-size: 1rem;
}

.hero-caption span {
  color: #6a7890;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.feature-chips span {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow: 0 5px 15px rgba(68, 91, 120, 0.09);
  color: #526078;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0.55rem 0.8rem;
}

.player-card {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 2rem;
  box-shadow: 0 26px 70px rgba(54, 79, 105, 0.22);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.player-card-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.player-card-heading h2 {
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1;
  margin: 0;
}

.large-paw {
  align-items: center;
  background: linear-gradient(135deg, #ffe68b, #ffb86a);
  border-radius: 1.25rem;
  box-shadow: 0 8px 18px rgba(245, 164, 72, 0.25);
  display: inline-flex;
  font-size: 2rem;
  height: 4rem;
  justify-content: center;
  transform: rotate(-5deg);
  width: 4rem;
}

.field-label,
.avatar-fieldset legend {
  color: #53617a;
  display: block;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.name-input {
  background: #f7fbff;
  border: 3px solid #dceaf5;
  border-radius: 1rem;
  color: #27364c;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
  transition: border-color 150ms ease, background 150ms ease;
  width: 100%;
}

.name-input:focus {
  background: #ffffff;
  border-color: #76bfff;
}

.name-input::placeholder {
  color: #a1acbb;
}

.avatar-fieldset {
  border: 0;
  margin: 1.35rem 0 0;
  padding: 0;
}

.avatar-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, 1fr);
}

.avatar-choice {
  align-items: center;
  background: #f6f8fc;
  border: 3px solid transparent;
  border-radius: 1.2rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.75rem 0.35rem 0.55rem;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.avatar-choice:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

.avatar-choice.is-selected {
  background: #fff8dc;
  border-color: #ffc95e;
  box-shadow: 0 7px 18px rgba(241, 175, 62, 0.2);
}

.avatar-choice strong {
  color: #34445e;
  font-size: 0.98rem;
  line-height: 1;
  margin-top: 0.35rem;
}

.avatar-choice small {
  margin-top: 0.2rem;
}

.avatar-preview {
  background: var(--skin);
  border-radius: 50%;
  display: block;
  height: 3.4rem;
  overflow: hidden;
  position: relative;
  width: 3.4rem;
}

.avatar-hair {
  background: var(--hair);
  border-radius: 50% 50% 36% 36%;
  height: 52%;
  left: 0;
  position: absolute;
  top: -5%;
  width: 100%;
}

.avatar-face {
  color: #3d2f30;
  font-size: 0.73rem;
  font-weight: 900;
  left: 50%;
  position: absolute;
  top: 38%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.avatar-shirt {
  background: var(--shirt);
  border-radius: 50% 50% 0 0;
  bottom: -25%;
  height: 55%;
  left: 10%;
  position: absolute;
  width: 80%;
}

.start-button {
  font-size: 1.12rem;
  justify-content: space-between;
  margin-top: 1.4rem;
  min-height: 3.75rem;
  width: 100%;
}

.welcome-actions {
  align-items: center;
  color: #8490a2;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 800;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 0.85rem;
}

.text-button {
  background: transparent;
  border: 0;
  color: #53617a;
  font-weight: 900;
  padding: 0.35rem 0;
}

/* World map */
.map-screen {
  background:
    radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.8), transparent 26rem),
    linear-gradient(180deg, #c5efff 0%, #e9f9e7 32%, #fff8e7 100%);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(0.8rem, 2.2vw, 2rem);
  position: relative;
}

.map-sky-orb {
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
  position: absolute;
}

.orb-one {
  background: rgba(255, 236, 143, 0.45);
  height: 19rem;
  right: -5rem;
  top: -7rem;
  width: 19rem;
}

.orb-two {
  background: rgba(201, 170, 255, 0.22);
  height: 25rem;
  left: -10rem;
  top: 35rem;
  width: 25rem;
}

.map-header,
.map-summary,
.world-list,
.explore-banner,
.map-footer {
  margin-left: auto;
  margin-right: auto;
  max-width: 1500px;
  position: relative;
  z-index: 1;
}

.map-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(180px, 0.7fr) 1.6fr minmax(180px, 0.7fr);
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
}

.profile-chip {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.25rem;
  text-align: left;
}

.profile-avatar {
  align-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(40, 60, 90, 0.16);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.5rem;
  height: 3.1rem;
  justify-content: center;
  width: 3.1rem;
}

.profile-chip span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-chip small {
  color: #7b8799;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-chip strong {
  color: #2f3d54;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-title {
  text-align: center;
}

.map-title h1 {
  color: #29374e;
  font-size: clamp(1.65rem, 3vw, 2.8rem);
  line-height: 1;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
}

.icon-button.labeled {
  border-radius: 1rem;
  flex-direction: column;
  gap: 0;
  height: 3.2rem;
  width: 4.2rem;
}

.icon-button.labeled span {
  font-size: 1.15rem;
  line-height: 1;
}

.icon-button.labeled small {
  color: #657187;
  font-size: 0.61rem;
  font-weight: 900;
}

.map-summary {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(360px, 2fr) repeat(3, minmax(145px, 0.56fr));
  margin-bottom: 1rem;
}

.continue-card,
.summary-stat {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.35rem;
  box-shadow: var(--soft-shadow);
}

.continue-card {
  align-items: center;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.8rem;
}

.continue-icon {
  align-items: center;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  box-shadow: 0 6px 14px rgba(50, 65, 90, 0.16);
  display: flex;
  font-size: 2rem;
  height: 4.2rem;
  justify-content: center;
  width: 4.2rem;
}

.continue-card h2 {
  color: #2d3c54;
  font-size: 1.35rem;
  line-height: 1;
  margin: 0 0 0.15rem;
}

.continue-card > div:nth-child(2) > span {
  color: #727e91;
  display: block;
  font-size: 0.77rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-card .primary-button {
  min-height: 2.85rem;
  white-space: nowrap;
}

.summary-stat {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  min-height: 5.9rem;
  padding: 0.75rem;
}

.summary-stat > span {
  font-size: 1.8rem;
}

.summary-stat div {
  display: flex;
  flex-direction: column;
}

.summary-stat strong {
  color: #304058;
  font-size: 1.25rem;
  line-height: 1;
}

.summary-stat small {
  color: #7b8698;
  font-size: 0.67rem;
  font-weight: 800;
}

.explore-banner {
  align-items: center;
  background: #fff6cb;
  border: 2px dashed #e7bb42;
  border-radius: 1rem;
  color: #6c5520;
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.72rem 1rem;
}

.world-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.world-card {
  background:
    radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--world-accent) 42%, transparent), transparent 24rem),
    linear-gradient(135deg, color-mix(in srgb, var(--world-color) 17%, white), rgba(255, 255, 255, 0.94));
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.7rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: clamp(1rem, 2vw, 1.4rem);
  position: relative;
}

.world-card.is-locked {
  filter: saturate(0.52);
}

.world-card-art {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.world-big-emoji {
  filter: saturate(0.9);
  font-size: 10rem;
  opacity: 0.11;
  position: absolute;
  right: -1.2rem;
  top: -2.8rem;
  transform: rotate(8deg);
}

.world-paw {
  color: var(--world-color);
  font-size: 2.2rem;
  opacity: 0.09;
  position: absolute;
}

.paw-a {
  bottom: 2rem;
  left: 25%;
  transform: rotate(-24deg);
}

.paw-b {
  right: 27%;
  top: 4rem;
  transform: rotate(22deg);
}

.world-card-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  position: relative;
}

.world-heading {
  max-width: 900px;
}

.world-index {
  background: var(--world-color);
  border-radius: 999px;
  color: #ffffff;
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  margin-bottom: 0.45rem;
  padding: 0.3rem 0.65rem;
  text-transform: uppercase;
}

.world-heading h2 {
  color: #2e3d54;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1;
  margin: 0 0 0.25rem;
}

.world-heading p {
  color: #657188;
  font-size: 0.91rem;
  font-weight: 700;
  margin: 0;
}

.badge-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
  max-width: 250px;
  padding: 0.55rem 0.7rem;
}

.badge-card.is-earned {
  background: #fff5c5;
  border-color: #ffd45a;
  box-shadow: 0 7px 18px rgba(224, 174, 54, 0.18);
}

.badge-card > span {
  font-size: 1.45rem;
}

.badge-card div {
  display: flex;
  flex-direction: column;
}

.badge-card small {
  color: #7b8698;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-card strong {
  color: #3b4658;
  font-size: 0.83rem;
  line-height: 1.08;
}

.world-progress-row {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  margin: 0.8rem 0;
  position: relative;
}

.progress-track {
  background: rgba(77, 94, 119, 0.13);
  border-radius: 999px;
  flex: 1;
  height: 0.52rem;
  overflow: hidden;
}

.progress-track span {
  background: linear-gradient(90deg, var(--world-color), var(--world-accent));
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 450ms ease;
}

.world-progress-row strong {
  color: #627087;
  font-size: 0.72rem;
  min-width: 76px;
  text-align: right;
}

.level-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: relative;
}

.level-button {
  background: rgba(255, 255, 255, 0.82);
  border: 3px solid transparent;
  border-radius: 1rem;
  box-shadow: 0 7px 16px rgba(60, 77, 100, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 9.7rem;
  min-width: 0;
  padding: 0.65rem;
  position: relative;
  text-align: left;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.level-button.is-open:hover {
  border-color: color-mix(in srgb, var(--world-color) 55%, white);
  box-shadow: 0 12px 24px rgba(60, 77, 100, 0.16);
  transform: translateY(-3px);
}

.level-button.is-complete {
  background: #fffef6;
  border-color: #ffe083;
}

.level-button.is-locked {
  background: rgba(235, 238, 242, 0.55);
  box-shadow: none;
  opacity: 0.58;
}

.level-number {
  align-items: center;
  background: #32415a;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  height: 1.85rem;
  justify-content: center;
  width: 1.85rem;
}

.level-status {
  font-size: 1.15rem;
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
}

.level-stage {
  align-items: center;
  align-self: flex-start;
  background: color-mix(in srgb, var(--world-color) 18%, white);
  border: 1px solid color-mix(in srgb, var(--world-color) 28%, white);
  border-radius: 999px;
  color: #5e6a7d;
  display: inline-flex;
  font-size: 0.53rem;
  font-weight: 900;
  gap: 0.2rem;
  letter-spacing: 0.025em;
  margin-top: 0.48rem;
  padding: 0.22rem 0.42rem;
  text-transform: uppercase;
}

.level-button > strong {
  color: #35445c;
  font-size: 0.94rem;
  line-height: 1.05;
  margin-top: 0.55rem;
}

.level-button > small {
  color: #7a8597;
  display: -webkit-box;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.24rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.level-result {
  color: #7d8798;
  display: flex;
  flex-direction: column;
  font-size: 0.6rem;
  font-weight: 900;
  margin-top: auto;
  padding-top: 0.55rem;
}

.rating-stars {
  display: inline-flex;
  gap: 0.12rem;
  justify-content: center;
}

.rating-stars span {
  color: #d9dee6;
  display: inline-block;
  font-size: 2.5rem;
  filter: drop-shadow(0 3px 4px rgba(87, 65, 24, 0.16));
  line-height: 1;
}

.rating-stars span.is-earned {
  color: #ffc928;
  text-shadow: 0 2px 0 #dc9f10;
}

.rating-stars.is-compact {
  justify-content: flex-start;
}

.rating-stars.is-compact span {
  font-size: 0.8rem;
}

.world-locked-message {
  align-items: center;
  background: rgba(255, 255, 255, 0.56);
  border: 2px dashed rgba(88, 101, 121, 0.24);
  border-radius: 1rem;
  display: flex;
  gap: 0.8rem;
  min-height: 7rem;
  padding: 1rem;
  position: relative;
}

.world-locked-message > span {
  font-size: 2.1rem;
}

.world-locked-message strong {
  color: #4c586b;
}

.world-locked-message p {
  color: #7d8796;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0.15rem 0 0;
}

.map-footer {
  color: #778395;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 1.4rem 0 0.4rem;
  text-align: center;
}

/* Game */
.game-screen {
  background:
    radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--world-color) 35%, transparent), transparent 33rem),
    linear-gradient(180deg, #d7f3ff, #f5fbf4);
  min-height: 100vh;
  padding: 0.65rem;
  position: relative;
}

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

.game-topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 1.25rem;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(160px, 1fr) minmax(240px, 1.5fr) minmax(160px, 1fr);
  margin: 0 auto 0.65rem;
  max-width: 1780px;
  min-height: 4.2rem;
  padding: 0.55rem 0.7rem;
}

.topbar-button {
  align-items: center;
  background: #eef3f8;
  border: 0;
  border-radius: 0.85rem;
  color: #3c4c64;
  display: inline-flex;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  gap: 0.45rem;
  justify-self: start;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
}

.game-level-id {
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  line-height: 1;
  text-align: center;
}

.game-level-id span,
.game-level-id small {
  color: #778398;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-level-id strong {
  color: #2d3b52;
  font-size: 1.35rem;
}

.topbar-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.topbar-icon {
  align-items: center;
  background: #f0f4f8;
  border: 0;
  border-radius: 0.8rem;
  display: inline-flex;
  font-size: 1.15rem;
  height: 2.7rem;
  justify-content: center;
  width: 2.7rem;
}

.topbar-icon:hover,
.topbar-button:hover {
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(54, 72, 98, 0.12);
}

.game-layout {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(250px, 310px) minmax(440px, 1fr) minmax(230px, 280px);
  margin: 0 auto;
  max-width: 1780px;
}

.mission-panel,
.control-panel,
.board-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 1.25rem;
  box-shadow: var(--soft-shadow);
  min-width: 0;
}

.mission-panel,
.control-panel {
  align-self: start;
  max-height: calc(100vh - 5.6rem);
  overflow-y: auto;
  padding: 0.9rem;
  scrollbar-color: #c7d1df transparent;
  scrollbar-width: thin;
}

.mission-world-mark {
  align-items: center;
  background: color-mix(in srgb, var(--world-color) 15%, white);
  border-radius: 0.95rem;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
  padding: 0.55rem 0.65rem;
}

.mission-world-mark > span {
  font-size: 1.65rem;
}

.mission-world-mark div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mission-world-mark small {
  color: #7c8798;
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mission-world-mark strong {
  color: #425067;
  font-size: 0.82rem;
  line-height: 1.08;
}

.mission-panel > h1 {
  color: #2d3d54;
  font-size: 1.7rem;
  line-height: 0.98;
  margin: 0 0 0.5rem;
}

.mission-story {
  color: #66738a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.goal-box {
  align-items: flex-start;
  background: #fff8d9;
  border: 2px solid #ffe38a;
  border-radius: 0.95rem;
  display: flex;
  gap: 0.55rem;
  padding: 0.65rem;
}

.goal-box > span {
  font-size: 1.25rem;
}

.goal-box div {
  display: flex;
  flex-direction: column;
}

.goal-box small {
  color: #927329;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-box strong {
  color: #5d4a22;
  font-size: 0.82rem;
  line-height: 1.18;
}

.read-button {
  background: transparent;
  border: 0;
  color: #51617a;
  font-size: 0.73rem;
  font-weight: 900;
  margin: 0.45rem 0 0.7rem;
  padding: 0.25rem;
  text-decoration: underline;
  text-decoration-color: #a9b5c5;
  text-underline-offset: 3px;
}

.panel-section-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.panel-section-heading span {
  color: #39485f;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.panel-section-heading small {
  color: #97a0ae;
  font-size: 0.55rem;
  font-weight: 800;
}

.objective-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.objective-row {
  align-items: center;
  background: #f3f6f9;
  border-radius: 0.75rem;
  color: #637087;
  display: grid;
  font-size: 0.73rem;
  font-weight: 800;
  gap: 0.45rem;
  grid-template-columns: auto 1fr auto;
  line-height: 1.18;
  min-height: 2.45rem;
  padding: 0.4rem 0.5rem;
}

.objective-row.is-complete {
  background: #e8f8e7;
  color: #3f6d43;
}

.objective-check {
  align-items: center;
  background: #ffffff;
  border: 2px solid #cfd8e3;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.64rem;
  height: 1.25rem;
  justify-content: center;
  width: 1.25rem;
}

.objective-row.is-complete .objective-check {
  background: #62b865;
  border-color: #62b865;
  color: #ffffff;
}

.objective-row > strong {
  color: inherit;
  font-size: 0.68rem;
}

.inventory-card {
  background: #f8f3ff;
  border: 2px solid #e8ddf7;
  border-radius: 0.9rem;
  margin-top: 0.75rem;
  padding: 0.6rem;
}

.inventory-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.inventory-heading strong {
  color: #4d4b68;
  font-size: 0.8rem;
}

.inventory-heading span {
  color: #7c6b43;
  font-size: 0.7rem;
  font-weight: 900;
}

.inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inventory-item {
  align-items: center;
  background: #ffffff;
  border-radius: 0.65rem;
  box-shadow: 0 3px 8px rgba(75, 67, 100, 0.08);
  display: inline-flex;
  gap: 0.25rem;
  min-width: 2.8rem;
  padding: 0.35rem 0.45rem;
}

.inventory-item > span {
  font-size: 1rem;
}

.inventory-item strong {
  color: #58556f;
  font-size: 0.75rem;
}

.inventory-empty {
  color: #8b879c;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.3;
}

.board-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 5.6rem);
  overflow: hidden;
  padding: 0.5rem;
  touch-action: none;
}

.board-toolbar {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto 1fr auto;
  min-height: 2.75rem;
  padding: 0.1rem 0.25rem 0.45rem;
}

.move-counter {
  background: #f0f5fa;
  border-radius: 999px;
  color: #536177;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.38rem 0.65rem;
}

.board-tip {
  color: #8791a1;
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
}

.camera-tools {
  display: flex;
  gap: 0.25rem;
}

.camera-tools button {
  align-items: center;
  background: #edf2f7;
  border: 0;
  border-radius: 0.58rem;
  display: inline-flex;
  font-weight: 900;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.game-canvas-shell {
  background: #bcecff;
  border-radius: 1rem;
  flex: 1;
  min-height: 480px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.game-canvas-shell > div,
.game-canvas-shell > div > div {
  height: 100% !important;
  inset: 0;
  position: absolute !important;
  width: 100% !important;
}

.game-canvas-shell canvas {
  height: 100% !important;
  width: 100% !important;
}

.scene-symbol {
  align-items: center;
  background: rgba(38, 45, 62, 0.92);
  border: 3px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 23px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  width: 44px;
}

.scene-symbol.is-active {
  background: #ffffff;
  color: #2e3d54;
  transform: scale(1.08);
}

.scene-win-bubble {
  animation: winBubble 850ms ease-in-out infinite alternate;
  background: rgba(255, 255, 255, 0.94);
  border: 4px solid #ffd84d;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(63, 63, 76, 0.18);
  color: #35445b;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
}

.board-legend {
  color: #7c8798;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.62rem;
  font-weight: 800;
  gap: 0.75rem;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.45rem 0.2rem 0;
}

.board-legend span {
  align-items: center;
  display: inline-flex;
  gap: 0.25rem;
}

.legend-glow {
  background: #fff08a;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 7px #ffe868;
  display: inline-block;
  height: 0.75rem;
  width: 0.75rem;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.helper-message {
  align-items: flex-start;
  background: #eff7ff;
  border: 2px solid #d7eaff;
  border-radius: 1rem;
  display: flex;
  gap: 0.55rem;
  min-height: 7.4rem;
  padding: 0.7rem;
}

.helper-message.is-good {
  background: #edf9eb;
  border-color: #caebc7;
}

.helper-message.is-try {
  background: #fff4e5;
  border-color: #f5d5a8;
}

.helper-message.is-hint {
  background: #fff9d9;
  border-color: #f2df7d;
}

.helper-message.is-win {
  background: #fff6ca;
  border-color: #ffd760;
}

.helper-face {
  align-items: center;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 11px rgba(61, 78, 99, 0.11);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.35rem;
  height: 2.55rem;
  justify-content: center;
  width: 2.55rem;
}

.helper-message div {
  display: flex;
  flex-direction: column;
}

.helper-message small {
  color: #8090a6;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.helper-message strong {
  color: #435169;
  font-size: 0.84rem;
  line-height: 1.27;
}

.dpad {
  display: grid;
  gap: 0.38rem;
  grid-template-areas:
    ". up ."
    "left center right"
    ". down .";
  grid-template-columns: repeat(3, 3.55rem);
  justify-content: center;
  margin: 0.25rem auto 0;
  user-select: none;
}

.dpad button,
.dpad-center {
  align-items: center;
  border: 0;
  border-radius: 1rem;
  display: flex;
  font-size: 1.05rem;
  height: 3.55rem;
  justify-content: center;
  width: 3.55rem;
}

.dpad button {
  background: linear-gradient(180deg, #ffffff, #e8eef5);
  box-shadow: 0 6px 0 #c2cfdd, 0 9px 15px rgba(52, 73, 98, 0.15);
  color: #40516b;
  font-weight: 900;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.dpad button:active:not(:disabled) {
  box-shadow: 0 2px 0 #c2cfdd, 0 4px 7px rgba(52, 73, 98, 0.12);
  transform: translateY(4px);
}

.dpad button:disabled {
  opacity: 0.5;
}

.dpad-up { grid-area: up; }
.dpad-left { grid-area: left; }
.dpad-right { grid-area: right; }
.dpad-down { grid-area: down; }

.dpad-center {
  background: color-mix(in srgb, var(--world-color) 30%, white);
  color: #ffffff;
  font-size: 1.55rem;
  grid-area: center;
}

.control-note {
  color: #949dab;
  font-size: 0.61rem;
  font-weight: 800;
  margin: 0;
  text-align: center;
}

.hint-button,
.paw-step-button {
  align-items: center;
  background: #fff7cf;
  border: 2px solid #f1db70;
  border-radius: 1rem;
  color: #65531f;
  display: flex;
  gap: 0.55rem;
  margin-top: 0.2rem;
  padding: 0.65rem;
  text-align: left;
}

.paw-step-button {
  background: linear-gradient(135deg, #eef8ff, #f6efff);
  border-color: #b9d8f5;
  color: #405777;
  margin-top: 0;
}

.hint-button > span,
.paw-step-button > span {
  font-size: 1.45rem;
}

.hint-button div,
.paw-step-button div {
  display: flex;
  flex-direction: column;
}

.hint-button strong,
.paw-step-button strong {
  font-size: 0.82rem;
  line-height: 1.05;
}

.hint-button small,
.paw-step-button small {
  color: #9b833a;
  font-size: 0.58rem;
  font-weight: 800;
}

.paw-step-button small {
  color: #6f83a1;
}

.hint-button:disabled,
.paw-step-button:disabled {
  opacity: 0.5;
}

.reset-button {
  background: transparent;
  border: 0;
  color: #778397;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Completion */
.complete-backdrop {
  align-items: center;
  backdrop-filter: blur(9px);
  background: rgba(28, 39, 59, 0.5);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 100;
}

.complete-card {
  animation: completePop 420ms cubic-bezier(0.17, 0.82, 0.36, 1.18);
  background:
    radial-gradient(circle at 50% 0, #fff5be, transparent 16rem),
    #ffffff;
  border: 5px solid #ffffff;
  border-radius: 2rem;
  box-shadow: 0 35px 100px rgba(16, 27, 48, 0.42);
  max-height: 95vh;
  max-width: 720px;
  overflow-y: auto;
  padding: clamp(1.15rem, 3vw, 2rem);
  position: relative;
  text-align: center;
  width: 100%;
}

.complete-puppy {
  align-items: center;
  background: linear-gradient(135deg, #ffe07a, #ff9e69);
  border: 5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 9px 22px rgba(218, 145, 57, 0.25);
  display: inline-flex;
  font-size: 3.2rem;
  height: 6rem;
  justify-content: center;
  margin: -0.25rem auto 0.7rem;
  width: 6rem;
}

.complete-card h2 {
  color: #2f3d53;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1.05;
  margin: 0.25rem auto 0.5rem;
  max-width: 600px;
}

.complete-stars-copy {
  color: #707b8d;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0.5rem 0 0.9rem;
}

.completion-details {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto 0.8rem;
}

.completion-details > div {
  align-items: center;
  background: #f4f7fb;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 5.3rem;
  padding: 0.6rem;
}

.completion-details span {
  font-size: 1.4rem;
}

.completion-details small {
  color: #8a94a4;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.completion-details strong {
  color: #46536a;
  font-size: 0.78rem;
  line-height: 1.12;
}

.think-card {
  align-items: center;
  background: #f6f0ff;
  border: 2px solid #e5d6fb;
  border-radius: 1rem;
  display: flex;
  gap: 0.7rem;
  margin: 0 auto 0.9rem;
  padding: 0.75rem;
  text-align: left;
}

.think-card > span {
  font-size: 1.6rem;
}

.think-card div {
  display: flex;
  flex-direction: column;
}

.think-card small {
  color: #8c79a5;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.think-card strong {
  color: #5c4f70;
  font-size: 0.84rem;
  line-height: 1.2;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.complete-actions button {
  flex: 1 1 150px;
}

.confetti {
  color: #ffca3a;
  font-size: 1.5rem;
  position: absolute;
}

.confetti-a { left: 8%; top: 12%; transform: rotate(-15deg); }
.confetti-b { color: #ff6fae; right: 10%; top: 15%; }
.confetti-c { color: #9b7cff; right: 18%; top: 35%; transform: rotate(25deg); }

/* Modals */
.modal-backdrop {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(29, 41, 61, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 200;
}

.modal-card {
  animation: modalIn 220ms ease-out;
  background: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.6rem;
  box-shadow: 0 30px 85px rgba(20, 31, 50, 0.36);
  max-height: 92vh;
  max-width: 580px;
  overflow-y: auto;
  padding: 1rem;
  width: 100%;
}

.modal-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.modal-header h2 {
  color: #2e3c52;
  font-size: 1.75rem;
  line-height: 1;
  margin: 0;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.setting-row {
  align-items: center;
  background: #f3f6f9;
  border: 2px solid transparent;
  border-radius: 1rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto 1fr auto;
  min-height: 4.2rem;
  padding: 0.65rem;
  text-align: left;
  width: 100%;
}

.setting-row.is-on {
  background: #edf9eb;
  border-color: #cce9ca;
}

.setting-icon {
  align-items: center;
  background: #ffffff;
  border-radius: 0.8rem;
  display: inline-flex;
  font-size: 1.25rem;
  height: 2.7rem;
  justify-content: center;
  width: 2.7rem;
}

.setting-copy {
  display: flex;
  flex-direction: column;
}

.setting-copy strong {
  color: #3c4b62;
  font-size: 0.9rem;
}

.setting-copy small {
  color: #7e899a;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.25;
}

.toggle-track {
  background: #c7cfda;
  border-radius: 999px;
  display: inline-flex;
  height: 1.65rem;
  padding: 0.2rem;
  transition: background 160ms ease;
  width: 3rem;
}

.toggle-track span {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(34, 44, 60, 0.18);
  display: block;
  height: 1.25rem;
  transform: translateX(0);
  transition: transform 160ms ease;
  width: 1.25rem;
}

.setting-row.is-on .toggle-track {
  background: #62b865;
}

.setting-row.is-on .toggle-track span {
  transform: translateX(1.35rem);
}

.modal-note {
  color: #8892a2;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.8rem 0 0;
  text-align: center;
}

.parent-modal {
  max-width: 760px;
}

.parent-summary-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 0.75rem;
}

.parent-summary-grid > div {
  align-items: center;
  background: #f4f7fa;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  padding: 0.65rem;
}

.parent-summary-grid span {
  font-size: 1.35rem;
}

.parent-summary-grid strong {
  color: #34445b;
  font-size: 1.2rem;
  line-height: 1;
}

.parent-summary-grid small {
  color: #818c9c;
  font-size: 0.61rem;
  font-weight: 800;
}

.parent-world-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.parent-world-row {
  align-items: center;
  background: #fafbfd;
  border: 1px solid #e8edf3;
  border-radius: 0.8rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.45rem 0.55rem;
}

.parent-world-icon {
  align-items: center;
  border-radius: 0.65rem;
  display: inline-flex;
  font-size: 1.25rem;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.parent-world-row div {
  display: flex;
  flex-direction: column;
}

.parent-world-row strong {
  color: #425067;
  font-size: 0.82rem;
}

.parent-world-row small,
.parent-world-row > span:last-child {
  color: #818b9a;
  font-size: 0.62rem;
  font-weight: 800;
}

.parent-tools {
  border-top: 2px solid #edf0f4;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.danger-outline-button {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #e8b4b8;
  color: #b34852;
  margin-top: 0.65rem;
  min-height: 2.75rem;
  width: 100%;
}

.danger-button {
  background: #c64e59;
  color: #ffffff;
  min-height: 2.7rem;
}

.reset-confirm {
  background: #fff0f1;
  border: 2px solid #f2c6ca;
  border-radius: 1rem;
  color: #7d343b;
  margin-top: 0.65rem;
  padding: 0.75rem;
  text-align: center;
}

.reset-confirm > strong {
  font-size: 0.88rem;
}

.reset-confirm > div {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.6rem;
}

.reset-confirm button:not(.danger-button) {
  background: #ffffff;
  border: 0;
  border-radius: 0.8rem;
  color: #5f6877;
  font-weight: 900;
  padding: 0.55rem 0.9rem;
}

/* Motion */
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes completePop {
  from { opacity: 0; transform: translateY(22px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 1250px) {
  .welcome-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  }

  .map-summary {
    grid-template-columns: minmax(360px, 1.8fr) repeat(3, minmax(130px, 0.5fr));
  }

  .level-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .level-button {
    min-height: 8.6rem;
  }

  .game-layout {
    grid-template-columns: minmax(225px, 270px) minmax(400px, 1fr) minmax(210px, 245px);
  }

  .dpad {
    grid-template-columns: repeat(3, 3.2rem);
  }

  .dpad button,
  .dpad-center {
    height: 3.2rem;
    width: 3.2rem;
  }
}

@media (max-width: 1020px) {
  .welcome-layout {
    grid-template-columns: 1fr;
    max-width: 800px;
  }

  .welcome-visual > h1,
  .welcome-lede {
    text-align: center;
  }

  .brand-pill {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
  }

  .feature-chips {
    justify-content: center;
  }

  .map-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .continue-card {
    grid-column: 1 / -1;
  }

  .game-layout {
    grid-template-areas:
      "board board"
      "mission controls";
    grid-template-columns: 1fr 1fr;
  }

  .board-panel {
    grid-area: board;
    min-height: 68vh;
  }

  .mission-panel {
    grid-area: mission;
  }

  .control-panel {
    grid-area: controls;
  }

  .mission-panel,
  .control-panel {
    max-height: none;
  }

  .game-canvas-shell {
    height: 58vh;
    min-height: 58vh;
  }
}

@media (max-width: 720px) {
  .welcome-screen,
  .map-screen {
    padding: 0.65rem;
  }

  .welcome-visual > h1 {
    font-size: clamp(2.7rem, 14vw, 4.4rem);
  }

  .hero-frame {
    height: 300px;
  }

  .hero-caption {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-card {
    border-radius: 1.4rem;
  }

  .map-header {
    grid-template-columns: 1fr auto;
    padding: 0.6rem;
  }

  .map-title {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .profile-chip {
    grid-column: 1;
    grid-row: 2;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 2;
  }

  .map-summary {
    gap: 0.55rem;
  }

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

  .continue-card .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .summary-stat {
    align-items: center;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 6.5rem;
    text-align: center;
  }

  .summary-stat > span {
    font-size: 1.45rem;
  }

  .world-card {
    border-radius: 1.25rem;
    padding: 0.85rem;
  }

  .world-card-header {
    flex-direction: column;
  }

  .badge-card {
    max-width: none;
    width: 100%;
  }

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

  .game-screen {
    padding: 0.35rem;
  }

  .game-topbar {
    border-radius: 0.95rem;
    gap: 0.35rem;
    grid-template-columns: auto 1fr auto;
    margin-bottom: 0.35rem;
    padding: 0.4rem;
  }

  .topbar-button {
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.65rem;
  }

  .topbar-button span {
    display: none;
  }

  .game-level-id strong {
    font-size: 1rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-level-id span,
  .game-level-id small {
    font-size: 0.52rem;
  }

  .topbar-icon {
    height: 2.35rem;
    width: 2.35rem;
  }

  .topbar-actions .topbar-icon:nth-child(2) {
    display: none;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .board-panel {
    min-height: 66vh;
    order: 1;
    padding: 0.35rem;
  }

  .mission-panel {
    order: 2;
  }

  .control-panel {
    order: 3;
  }

  .game-canvas-shell {
    height: 56vh;
    min-height: 56vh;
  }

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

  .board-tip {
    text-align: right;
  }

  .camera-tools {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .camera-tools button {
    height: 1.85rem;
    width: 2.4rem;
  }

  .mission-panel,
  .control-panel {
    padding: 0.75rem;
  }

  .control-panel {
    align-items: stretch;
  }

  .helper-message {
    min-height: 5.6rem;
  }

  .completion-details {
    grid-template-columns: 1fr;
  }

  .completion-details > div {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: auto 1fr;
    justify-items: start;
    min-height: 0;
    text-align: left;
  }

  .completion-details small,
  .completion-details strong {
    grid-column: 2;
  }

  .complete-card {
    border-radius: 1.35rem;
  }

  .rating-stars span {
    font-size: 2.1rem;
  }

  .parent-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .avatar-grid {
    gap: 0.4rem;
  }

  .avatar-choice {
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .feature-chips span {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
  }

  .map-title h1 {
    font-size: 1.55rem;
  }

  .icon-button.labeled {
    width: 3.5rem;
  }

  .summary-stat strong {
    font-size: 1rem;
  }

  .summary-stat small {
    font-size: 0.58rem;
  }

  .level-button {
    min-height: 9rem;
  }

  .game-canvas-shell {
    height: 52vh;
    min-height: 52vh;
  }

  .board-legend {
    gap: 0.4rem;
  }
}

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