:root {
  color-scheme: dark;
  --bg-0: #06080f;
  --bg-1: #0b1019;
  --bg-2: #121b2a;
  --panel-0: rgba(13, 18, 28, 0.78);
  --panel-1: rgba(20, 28, 42, 0.92);
  --panel-2: rgba(26, 36, 55, 0.95);
  --line-0: rgba(153, 180, 220, 0.2);
  --line-1: rgba(166, 203, 255, 0.36);
  --text-0: #eff4ff;
  --text-1: #cad7ef;
  --text-2: #8ea0bf;
  --accent-ice: #77e8ff;
  --accent-sky: #7fb8ff;
  --accent-mint: #58ffc3;
  --accent-gold: #ffd275;
  --accent-danger: #ff7e89;
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.42);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --planet-mercury-image-url: url("assets/planets/mercury.jpg");
  --planet-venus-image-url: url("assets/planets/venus.jpg");
  --planet-earth-image-url: url("assets/planets/earth.jpg");
  --planet-moon-image-url: url("assets/planets/moon.jpg");
  --planet-mars-image-url: url("assets/planets/mars.jpg");
  --planet-jupiter-image-url: url("assets/planets/jupiter.jpg");
  --planet-uranus-image-url: url("assets/planets/uranus.jpg");
  --planet-neptune-image-url: url("assets/planets/neptune.jpg");
  --stage-poster-image-url: url("assets/planets/poster.jpg");
  --nasa-sun-image-url: url("assets/planets/sun.jpg");
  --sun-image-fallback-url: url("assets/planets/sun.jpg");
  --nasa-saturn-image-url: url("assets/planets/saturn.png");
  --saturn-image-fallback-url: url("assets/planets/saturn.png");
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100svh;
  padding: 18px;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  font-family: "Barlow", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text-0);
  background:
    radial-gradient(1100px 620px at -12% -15%, rgba(77, 150, 255, 0.24), transparent 58%),
    radial-gradient(860px 520px at 112% 112%, rgba(61, 255, 197, 0.14), transparent 58%),
    linear-gradient(155deg, var(--bg-2), var(--bg-1) 44%, var(--bg-0));
  overscroll-behavior-x: none;
  -webkit-tap-highlight-color: transparent;
}

#screen-game,
#screen-game * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.nickname-gate {
  overflow: hidden;
  overscroll-behavior: contain;
}

body.app-standalone {
  min-height: 100svh;
  padding:
    max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  touch-action: manipulation;
}

body.app-standalone .screen {
  width: min(100%, 1260px);
}

body.native-app:not(.nickname-gate) {
  min-height: 100dvh;
  min-height: 100svh;
  padding: 0;
  place-items: stretch;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-y: contain;
  background: #050913;
  --nasa-sun-image-url: url("assets/planets/sun-native.jpg");
  --sun-image-fallback-url: url("assets/planets/sun-native.jpg");
}

body.native-app:not(.nickname-gate) .screen {
  width: 100%;
  max-width: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.42;
}

body.native-app::before {
  display: none;
}

body.nickname-gate #screen-nickname {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 320;
  width: 100vw !important;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
  animation: none !important;
  background: transparent;
  touch-action: manipulation;
}

body.native-app.nickname-gate {
  min-height: 100dvh;
  min-height: 100svh;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: #050913;
}

body.native-app.nickname-gate #screen-nickname {
  width: 100vw !important;
  min-height: 100svh;
}

body.native-app.nickname-gate #screen-nickname .modal-card {
  width: min(100%, 560px);
}

body.nickname-gate #screen-nickname .modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: auto;
  pointer-events: auto;
}

body.nickname-gate #hubPortal {
  display: none !important;
}

body.nickname-gate #screen-stage,
body.nickname-gate #screen-mapselect,
body.nickname-gate #screen-editor,
body.nickname-gate #screen-game {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.screen {
  width: min(96vw, 1260px);
  animation: screen-fade 260ms ease;
}

.hidden {
  display: none !important;
}

#screen-nickname {
  width: min(95vw, 520px);
  animation: none;
}

.modal-card {
  width: min(95vw, 520px);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-1);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 196, 255, 0.2), transparent 38%),
    linear-gradient(165deg, rgba(28, 39, 58, 0.96), rgba(13, 20, 30, 0.98));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.nickname-card {
  margin: 0 auto;
}

.modal-kicker {
  margin: 0;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.14em;
  color: #97ddff;
}

.modal-card h2 {
  margin: 10px 0 8px;
  font: 700 clamp(28px, 5vw, 36px) / 1.05 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
}

.modal-desc {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 15px;
}

.auth-identity-hint,
.auth-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font: 600 13px/1.45 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
}

.auth-identity-hint {
  border: 1px solid rgba(130, 182, 244, 0.34);
  background: rgba(10, 17, 29, 0.7);
  color: #d7e7ff;
}

.auth-status {
  border: 1px solid rgba(112, 202, 255, 0.3);
  background: rgba(8, 18, 28, 0.72);
  color: #9edfff;
}

.auth-choice-panel,
#nicknameSetupPanel {
  display: grid;
  gap: 10px;
}

.auth-secondary-btn {
  width: 100%;
  min-width: 0;
}

.nickname-input {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(143, 175, 222, 0.5);
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.95), rgba(12, 19, 30, 0.95));
  color: var(--text-0);
  padding: 0 14px;
  font: 600 16px/1 "Barlow", "Noto Sans KR", sans-serif;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  outline: none;
}

.nickname-input:focus {
  border-color: rgba(123, 223, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(108, 214, 255, 0.16);
}

.primary-btn,
.secondary-btn {
  position: relative;
  height: 48px;
  border-radius: 12px;
  border: 0;
  font: 700 15px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-btn {
  width: 100%;
  margin-top: 14px;
  color: #03111a;
  background: linear-gradient(180deg, #8ceeff 0%, #59c9ff 52%, #58ffc3 100%);
  box-shadow: 0 10px 22px rgba(64, 177, 228, 0.35);
}

.secondary-btn {
  min-width: 120px;
  padding: 0 14px;
  color: #e6f0ff;
  border: 1px solid rgba(153, 178, 216, 0.5);
  background: linear-gradient(180deg, rgba(66, 79, 101, 0.92), rgba(41, 50, 67, 0.92));
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active {
  transform: translateY(1px);
}

.nickname-error {
  min-height: 18px;
  margin: 8px 2px 0;
  font-size: 13px;
  color: #ff8d9b;
}

.account-btn {
  min-width: 82px;
}

.stage-hub {
  width: min(96vw, 1140px);
  padding: 26px;
  border-radius: 24px;
  border: 1px solid rgba(162, 189, 230, 0.5);
  background:
    radial-gradient(circle at 86% -12%, rgba(130, 183, 255, 0.24), transparent 34%),
    radial-gradient(circle at 8% 115%, rgba(104, 255, 202, 0.1), transparent 42%),
    linear-gradient(165deg, rgba(18, 28, 44, 0.97), rgba(8, 13, 23, 0.99));
  box-shadow: var(--shadow-lg);
}

#screen-stage {
  width: min(96vw, 1260px);
  height: calc(100dvh - 36px);
  max-height: 920px;
}

#screen-stage .stage-hub {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.stage-scroll-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.stage-hero-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.stage-orbit-scroll-spacer {
  display: none;
}

.stage-head {
  margin-bottom: clamp(8px, 1.2vw, 14px);
  flex: 0 0 auto;
}

.stage-kicker {
  margin: 0;
  color: #9dc7ff;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.12em;
}

.stage-head h1 {
  margin: 6px 0 4px;
  font: 700 clamp(24px, 3.2vw, 40px) / 1.04 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.01em;
}

.stage-subtext {
  margin: 0;
  color: #c4d7f4;
  font-size: clamp(12px, 1.3vw, 14px);
}

.language-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  z-index: 16;
}

.lang-btn {
  min-width: 74px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(182, 208, 245, 0.4);
  background: linear-gradient(180deg, rgba(11, 18, 29, 0.88), rgba(8, 13, 21, 0.92));
  color: #d7e8ff;
  font: 700 12px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.utility-btn {
  min-width: 58px;
}

.lang-btn.is-locked,
.lang-btn:disabled {
  border-style: dashed;
  border-color: rgba(124, 144, 176, 0.42);
  color: rgba(201, 213, 233, 0.58);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

.lang-btn.is-locked:hover,
.lang-btn:disabled:hover {
  border-color: rgba(124, 144, 176, 0.42);
  box-shadow: none;
}

.lang-btn:hover {
  border-color: rgba(185, 223, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(117, 184, 255, 0.22);
}

.lang-btn.is-active {
  border-color: rgba(138, 219, 255, 0.76);
  color: #f4fbff;
  box-shadow:
    0 0 0 1px rgba(122, 209, 255, 0.28),
    0 0 16px rgba(116, 187, 255, 0.2);
}

.solar-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: auto;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(142, 178, 230, 0.32);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(130% 102% at 50% 48%, rgba(8, 20, 42, 0.9) 0%, rgba(4, 11, 25, 0.96) 54%, rgba(1, 3, 8, 1) 100%),
    radial-gradient(72% 62% at 82% 14%, rgba(52, 114, 220, 0.18), transparent 64%),
    radial-gradient(54% 46% at 16% 84%, rgba(30, 141, 183, 0.14), transparent 72%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.42), inset 0 -24px 64px rgba(0, 0, 0, 0.5);
}

.solar-viewport::before,
.solar-viewport::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
}

.solar-viewport::before {
  z-index: 0;
  background:
    radial-gradient(circle at 14% 24%, rgba(224, 238, 255, 0.2) 0 1px, transparent 1px),
    radial-gradient(circle at 66% 18%, rgba(224, 238, 255, 0.14) 0 1px, transparent 1px),
    radial-gradient(circle at 86% 62%, rgba(224, 238, 255, 0.13) 0 1px, transparent 1px),
    radial-gradient(circle at 36% 74%, rgba(224, 238, 255, 0.1) 0 1px, transparent 1px);
  background-size: 220px 220px, 320px 320px, 390px 390px, 460px 460px;
  opacity: 0.54;
  animation: space-drift 72s linear infinite;
}

.solar-viewport::after {
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(1, 3, 8, 0.32) 78%, rgba(1, 3, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(2, 4, 10, 0) 62%, rgba(2, 4, 10, 0.36) 100%);
}

#screen-stage .stage-head {
  position: absolute;
  top: clamp(8px, 1.2vw, 14px);
  left: clamp(8px, 1.2vw, 14px);
  right: auto;
  width: min(52%, 620px);
  max-width: calc(100% - clamp(16px, 2.4vw, 28px));
  z-index: 8;
  margin: 0;
  padding: clamp(8px, 1.1vw, 12px) clamp(10px, 1.4vw, 14px);
  border-radius: 12px;
  border: 1px solid rgba(151, 186, 236, 0.34);
  background:
    radial-gradient(circle at 95% -20%, rgba(131, 190, 255, 0.16), transparent 42%),
    linear-gradient(170deg, rgba(13, 21, 34, 0.82), rgba(8, 12, 20, 0.84));
  backdrop-filter: blur(4px);
  pointer-events: none;
}

#screen-stage .stage-head h1 {
  margin: 4px 0 2px;
  font-size: clamp(19px, 2.8vw, 34px);
}

#screen-stage .stage-subtext {
  font-size: clamp(11px, 1.2vw, 13px);
}

.chapter-quick-select {
  position: absolute;
  top: clamp(92px, 12vw, 132px);
  left: clamp(8px, 1.2vw, 14px);
  width: min(52%, 620px);
  max-width: calc(100% - clamp(16px, 2.4vw, 28px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9;
  overflow: visible;
  contain: layout;
}

.chapter-quick-toggle {
  position: relative;
  width: min(100%, 228px);
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(153, 188, 236, 0.56);
  padding: 0 42px 0 14px;
  color: #e8f3ff;
  font: 700 13px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  background:
    radial-gradient(circle at 92% -20%, rgba(138, 201, 255, 0.2), transparent 44%),
    linear-gradient(170deg, rgba(14, 24, 39, 0.9), rgba(9, 15, 26, 0.94));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.chapter-quick-toggle::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid rgba(222, 238, 255, 0.9);
  border-bottom: 2px solid rgba(222, 238, 255, 0.9);
  transform: rotate(45deg);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.chapter-quick-toggle:hover {
  transform: translateY(-1px) scale(1.01);
  border-color: rgba(172, 214, 255, 0.82);
}

.chapter-quick-select.is-open .chapter-quick-toggle {
  border-color: rgba(172, 214, 255, 0.92);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(147, 206, 255, 0.2);
}

.chapter-quick-select.is-open .chapter-quick-toggle::after {
  transform: translateY(2px) rotate(225deg);
}

.chapter-quick-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: min(36vh, 268px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  border-radius: 12px;
  border: 1px solid rgba(141, 176, 222, 0.36);
  background:
    radial-gradient(circle at 92% -18%, rgba(122, 190, 255, 0.18), transparent 40%),
    linear-gradient(170deg, rgba(10, 17, 28, 0.92), rgba(7, 12, 20, 0.95));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  transform: translate3d(0, -8px, 0) scale(0.992);
  transform-origin: top left;
  transition:
    opacity 160ms ease,
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 200ms;
  padding: 10px;
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout;
  z-index: 20;
}

.chapter-quick-select.is-open .chapter-quick-panel {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  transition:
    opacity 160ms ease,
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.chapter-quick-scroll-panel {
  display: none;
}

.chapter-quick-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
  max-height: min(34vh, 236px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
}

.chapter-quick-chip {
  appearance: none;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(139, 174, 221, 0.52);
  padding: 6px 8px;
  text-align: left;
  color: #ecf4ff;
  background:
    radial-gradient(circle at 94% -16%, rgba(136, 196, 255, 0.18), transparent 54%),
    linear-gradient(180deg, rgba(41, 57, 80, 0.94), rgba(27, 37, 55, 0.94));
  box-shadow: inset 0 -2px 0 rgba(8, 13, 21, 0.42), 0 4px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 120ms ease, border-color 120ms ease, filter 120ms ease, box-shadow 120ms ease;
  backface-visibility: hidden;
  touch-action: manipulation;
}

.chapter-quick-chip:hover {
  transform: translate3d(0, -1px, 0) scale(1.01);
}

.chapter-quick-chip.is-current {
  border-color: rgba(168, 227, 255, 0.92);
  box-shadow: inset 0 -2px 0 rgba(8, 13, 21, 0.45), 0 8px 14px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(149, 216, 255, 0.3);
}

.chapter-quick-chip.is-locked {
  filter: grayscale(0.72) brightness(0.7);
  cursor: not-allowed;
}

.chapter-quick-chip-name {
  display: block;
  font: 700 12px/1.1 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.chapter-quick-chip-sub {
  display: block;
  margin-top: 3px;
  font: 600 9px/1 "Barlow", "Noto Sans KR", sans-serif;
  color: #b8cef0;
  letter-spacing: 0.04em;
}

.space-stars,
.space-nebula,
.solar-scene {
  position: absolute;
}

.space-stars,
.space-nebula {
  inset: 0;
  z-index: 2;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
  pointer-events: none;
}

.space-stars {
  background-repeat: repeat;
}

.stars-a {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1px),
    radial-gradient(circle at 35% 72%, rgba(255, 255, 255, 0.48) 0 1px, transparent 1px),
    radial-gradient(circle at 64% 26%, rgba(255, 255, 255, 0.43) 0 1px, transparent 1px),
    radial-gradient(circle at 85% 62%, rgba(255, 255, 255, 0.52) 0 1px, transparent 1px);
  background-size: 280px 280px;
  opacity: 0.64;
  animation: stars-twinkle-a 7s ease-in-out infinite, space-drift 86s linear infinite reverse;
}

.stars-b {
  background-image:
    radial-gradient(circle at 18% 44%, rgba(197, 220, 255, 0.32) 0 1px, transparent 1px),
    radial-gradient(circle at 49% 18%, rgba(197, 220, 255, 0.24) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 78%, rgba(197, 220, 255, 0.28) 0 1px, transparent 1px);
  background-size: 360px 360px;
  opacity: 0.52;
  animation: stars-twinkle-b 5.8s ease-in-out infinite, space-drift 128s linear infinite;
}

.nebula-a {
  background:
    radial-gradient(56% 44% at 78% 14%, rgba(80, 132, 238, 0.24), transparent 72%),
    radial-gradient(42% 30% at 20% 78%, rgba(90, 215, 255, 0.1), transparent 80%);
  filter: blur(2px);
  opacity: 0.82;
}

.nebula-b {
  background:
    radial-gradient(50% 36% at 70% 84%, rgba(57, 165, 197, 0.18), transparent 76%),
    radial-gradient(38% 24% at 26% 36%, rgba(89, 118, 212, 0.14), transparent 80%);
  filter: blur(2.8px);
  opacity: 0.78;
}

.solar-scene {
  left: 50%;
  top: 50%;
  width: 1760px;
  height: 980px;
  transform: translate(-50%, -50%) scale(var(--scene-scale, 1));
  z-index: 3;
  transform-origin: center center;
}

.solar-scene::before {
  content: "";
  position: absolute;
  inset: 10% -6% 2%;
  pointer-events: none;
  background:
    radial-gradient(58% 52% at 50% 44%, rgba(255, 229, 150, 0.2), transparent 80%),
    radial-gradient(46% 34% at 46% 58%, rgba(255, 216, 118, 0.12), transparent 82%),
    radial-gradient(74% 48% at 50% 48%, rgba(255, 241, 194, 0.06), transparent 86%);
  filter: blur(14px);
}

.sun-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  aspect-ratio: 1/1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: none;
  filter: none;
  animation: none;
  will-change: auto;
  backface-visibility: hidden;
  pointer-events: none;
}

.sun-halo::before,
.sun-halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.sun-halo::before {
  inset: 16%;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 236, 176, 0.12) 0%, rgba(255, 214, 120, 0.07) 56%, rgba(255, 180, 82, 0) 78%),
    var(--nasa-sun-image-url),
    var(--sun-image-fallback-url);
  background-size: 100% 100%, 108% 108%, 108% 108%;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-blend-mode: screen, normal, normal;
  box-shadow:
    0 0 0 1px rgba(255, 214, 130, 0.1),
    0 0 10px rgba(255, 210, 118, 0.12),
    0 0 18px rgba(255, 190, 102, 0.08);
  filter: saturate(1.03) brightness(1.01) contrast(1.04);
  animation: none;
  opacity: 0.58;
}

.sun-halo::after {
  inset: -112%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 239, 180, 0.12) 0%, rgba(255, 224, 146, 0.08) 24%, rgba(255, 214, 120, 0.045) 48%, rgba(255, 202, 112, 0) 76%);
  filter: blur(34px);
  opacity: 0.92;
  mix-blend-mode: screen;
}

.sun-core {
  display: none;
}

.sun-core::before,
.sun-core span {
  display: none;
}

.orbit-item {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit-line ellipse {
  fill: none;
  stroke: rgba(202, 219, 248, 0.42);
  stroke-width: 0.56;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 1px rgba(126, 163, 229, 0.3));
}

.orbit-item.orbit-hidden .orbit-line {
  display: none;
}

.stage-node {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--planet-base-size, var(--planet-size, 40px));
  height: var(--planet-base-size, var(--planet-size, 40px));
  transform: translate3d(calc(var(--px, 0px) - 50%), calc(var(--py, 0px) - 50%), 0)
    scale(var(--planet-scale, 1))
    scale(var(--planet-hover-scale, 1));
  transform-origin: center center;
  border-radius: 50%;
  border: 0;
  outline: 1px solid rgba(223, 238, 255, 0.34);
  outline-offset: 0;
  background-color: #05080f;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f4f8ff;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.46),
    0 0 22px rgba(120, 176, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 180ms ease;
  will-change: transform;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  overflow: visible;
  z-index: 3;
  isolation: isolate;
  pointer-events: auto;
}

.stage-node:hover {
  --planet-hover-scale: 1.1;
  filter: brightness(1.14);
}

.stage-node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(var(--light-angle, 90deg), rgba(255, 255, 255, 0.08) 12%, rgba(9, 14, 26, 0.24) 76%);
  pointer-events: none;
  z-index: 1;
}

.stage-node:disabled {
  cursor: not-allowed;
}

.stage-node-name {
  position: absolute;
  left: calc(50% + var(--label-shift-x, 0px));
  top: calc(100% + 8px + var(--label-shift-y, 0px));
  transform: translateX(-50%) scale(var(--planet-label-scale, 1));
  transform-origin: center top;
  white-space: nowrap;
  font: 700 10px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
  color: rgba(238, 245, 255, 0.95);
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.78);
}

.stage-node-en {
  position: absolute;
  left: calc(50% + var(--label-shift-x, 0px));
  top: calc(100% + 24px + var(--label-shift-y, 0px));
  transform: translateX(-50%) scale(var(--planet-label-scale, 1));
  transform-origin: center top;
  white-space: nowrap;
  font: 600 7px/1 "Barlow", "Noto Sans KR", sans-serif;
  opacity: 0.74;
  letter-spacing: 0.04em;
  color: rgba(192, 214, 248, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.72);
}

.stage-node.is-current {
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(160, 224, 255, 0.26),
    0 0 34px rgba(126, 206, 255, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.stage-node.is-locked {
  filter: saturate(0.72) brightness(0.84) contrast(0.9);
  opacity: 0.88;
}

.stage-node.is-locked::after {
  content: "\1F512";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  background: rgba(8, 13, 22, 0.92);
  border: 1px solid rgba(170, 182, 206, 0.76);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

#screen-stage .stage-node.is-locked::after {
  content: none;
}

.orbit-item:has(.stage-node.is-locked) .orbit-line ellipse {
  stroke: rgba(173, 206, 247, 0.22);
  filter: blur(0.1px);
}

.orbit-item.is-locked .orbit-line ellipse {
  stroke: rgba(173, 206, 247, 0.22);
  filter: blur(0.1px);
}

.chapter-focus-hud {
  position: absolute;
  left: 72%;
  top: 54%;
  transform: translate(-50%, -50%);
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(151, 191, 243, 0.44);
  background:
    radial-gradient(circle at 95% -10%, rgba(126, 189, 255, 0.26), transparent 42%),
    linear-gradient(165deg, rgba(15, 25, 42, 0.94), rgba(8, 14, 25, 0.95));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
  z-index: 4;
  pointer-events: none;
}

.chapter-focus-name {
  margin: 0;
  color: #ebf3ff;
  font: 700 13px/1.1 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.chapter-focus-progress {
  margin: 4px 0 0;
  color: #b9d4fa;
  font: 600 11px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.planet-mercury {
  border-color: rgba(210, 214, 222, 0.62);
  filter: saturate(0.98) contrast(1.02);
}

body.stage-assets-rich .planet-mercury,
body.native-app #screen-stage .planet-mercury {
  background-image: var(--planet-mercury-image-url);
}

.planet-venus {
  border-color: rgba(235, 220, 171, 0.64);
  filter: saturate(1.04) contrast(1.02);
}

body.stage-assets-rich .planet-venus,
body.native-app #screen-stage .planet-venus {
  background-image: var(--planet-venus-image-url);
}

.planet-earth {
  border-color: rgba(182, 226, 255, 0.78);
  background-size: 118% 118%;
  background-position: 50% 50%;
  filter: saturate(1.08) contrast(1.05);
}

body.stage-assets-rich .planet-earth,
body.native-app #screen-stage .planet-earth {
  background-image: var(--planet-earth-image-url);
}

.planet-earth::before {
  inset: 0;
}

.planet-earth::after {
  content: none;
}

.planet-moon {
  border-color: rgba(210, 221, 239, 0.74);
  filter: saturate(0.9) contrast(1.04);
}

body.stage-assets-rich .planet-moon,
body.native-app #screen-stage .planet-moon {
  background-image: var(--planet-moon-image-url);
}

.planet-mars {
  border-color: rgba(221, 159, 126, 0.62);
  background-size: 128% 128%;
  background-position: 52% 52%;
  filter: saturate(1.08) contrast(1.03);
}

body.stage-assets-rich .planet-mars,
body.native-app #screen-stage .planet-mars {
  background-image: var(--planet-mars-image-url);
}

.planet-jupiter {
  border-color: rgba(236, 206, 168, 0.68);
  filter: saturate(1.06) contrast(1.02);
}

body.stage-assets-rich .planet-jupiter,
body.native-app #screen-stage .planet-jupiter {
  background-image: var(--planet-jupiter-image-url);
}

.planet-saturn {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  isolation: isolate;
}

body.stage-assets-rich .planet-saturn::before,
body.native-app #screen-stage .planet-saturn::before {
  content: "";
  position: absolute;
  left: 53%;
  top: 52%;
  width: 270%;
  height: 132%;
  transform: translate(-50%, -50%);
  border-radius: 0;
  border: 0;
  background-image: var(--nasa-saturn-image-url);
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  mix-blend-mode: normal;
  filter: saturate(1.04) contrast(1.04) brightness(1.02);
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

.planet-saturn::after {
  content: none;
}

.planet-saturn.is-current {
  box-shadow: none;
}

.poster-layout .planet-saturn {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.planet-moon::after {
  content: none;
}

.planet-uranus {
  border-color: rgba(186, 239, 247, 0.68);
  filter: saturate(1.02) contrast(1.03);
}

body.stage-assets-rich .planet-uranus,
body.native-app #screen-stage .planet-uranus {
  background-image: var(--planet-uranus-image-url);
}

.planet-neptune {
  border-color: rgba(156, 191, 245, 0.72);
  filter: saturate(1.08) contrast(1.04);
}

body.stage-assets-rich .planet-neptune,
body.native-app #screen-stage .planet-neptune {
  background-image: var(--planet-neptune-image-url);
}

.planet-sunchapter {
  border: 0;
  outline: 1px solid rgba(255, 224, 146, 0.26);
  outline-offset: 0;
  background-image:
    radial-gradient(circle at 48% 44%, rgba(255, 239, 186, 0.14) 0%, rgba(255, 181, 74, 0.08) 48%, rgba(255, 144, 52, 0) 74%);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.08) brightness(1.02) contrast(1.08);
  animation: sun-core-flicker 5.8s ease-in-out infinite;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(255, 170, 88, 0.44),
    0 0 26px rgba(255, 122, 40, 0.28);
}

body.stage-assets-rich .planet-sunchapter,
body.native-app #screen-stage .planet-sunchapter {
  background-image:
    radial-gradient(circle at 48% 44%, rgba(255, 239, 186, 0.14) 0%, rgba(255, 181, 74, 0.08) 48%, rgba(255, 144, 52, 0) 74%),
    var(--nasa-sun-image-url),
    var(--sun-image-fallback-url);
  background-size: 100% 100%, 124% 124%, 124% 124%;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-blend-mode: screen, normal, normal;
}

.planet-sunchapter.is-current {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 215, 136, 0.3),
    0 0 18px rgba(255, 170, 88, 0.5),
    0 0 28px rgba(255, 122, 40, 0.34);
}

.planet-sunchapter::before {
  content: "";
  background:
    radial-gradient(circle at 26% 24%, rgba(255, 245, 208, 0.2), transparent 36%),
    radial-gradient(circle at 70% 66%, rgba(255, 184, 82, 0.12), transparent 54%),
    conic-gradient(from 22deg, rgba(255, 214, 128, 0.11), rgba(255, 170, 72, 0.04), rgba(255, 222, 144, 0.08), rgba(255, 175, 76, 0.04), rgba(255, 214, 128, 0.11));
  mix-blend-mode: normal;
  opacity: 0.45;
}

.planet-sunchapter::after {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 222, 138, 0.22) 0%, rgba(255, 196, 98, 0.08) 52%, rgba(255, 170, 74, 0) 78%);
}

.poster-layout {
  border-color: rgba(197, 220, 255, 0.26);
  background:
    radial-gradient(140% 110% at 52% 52%, rgba(15, 20, 36, 0.8) 0%, rgba(6, 8, 16, 0.96) 46%, rgba(2, 3, 8, 1) 100%);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.64), inset 0 -36px 84px rgba(0, 0, 0, 0.7);
}

body.stage-assets-rich .poster-layout,
body.native-app #screen-stage .poster-layout {
  background:
    radial-gradient(140% 110% at 52% 52%, rgba(15, 20, 36, 0.8) 0%, rgba(6, 8, 16, 0.96) 46%, rgba(2, 3, 8, 1) 100%),
    var(--stage-poster-image-url);
  background-size: cover, cover;
}

.poster-layout::before,
.poster-layout::after {
  display: none;
}

#screen-stage .poster-layout .stage-head {
  top: 16px;
  left: 16px;
  width: min(44%, 520px);
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.6), rgba(4, 7, 14, 0.7));
  backdrop-filter: blur(2px);
}

#screen-stage .poster-layout .stage-kicker {
  color: #f8f4e3;
  letter-spacing: 0.13em;
}

#screen-stage .poster-layout .stage-head h1 {
  color: #ffffff;
  font-size: clamp(22px, 2.8vw, 38px);
}

#screen-stage .poster-layout .stage-subtext {
  color: rgba(245, 245, 245, 0.82);
}

.poster-layout .chapter-quick-select {
  top: clamp(104px, 12vw, 142px);
  left: 16px;
  right: auto;
  width: min(44%, 520px);
  max-width: calc(100% - 32px);
}

.poster-layout .chapter-quick-toggle {
  border-color: rgba(255, 255, 255, 0.38);
  background: linear-gradient(180deg, rgba(18, 24, 37, 0.88), rgba(10, 14, 24, 0.92));
}

.poster-layout .chapter-quick-panel {
  border-color: rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.9), rgba(7, 10, 18, 0.95));
}

.poster-layout .space-stars,
.poster-layout .space-nebula {
  opacity: 0.28;
}

.poster-layout .solar-scene {
  width: 1760px;
  height: 980px;
}

.poster-layout .solar-scene::before {
  inset: -8% -8% 4%;
  background:
    radial-gradient(52% 38% at 51% 52%, rgba(255, 214, 118, 0.16), transparent 70%),
    radial-gradient(40% 26% at 68% 34%, rgba(88, 164, 255, 0.2), transparent 78%),
    radial-gradient(32% 20% at 18% 70%, rgba(95, 157, 214, 0.14), transparent 80%);
  filter: blur(8px);
}

.poster-layout .solar-scene::after {
  content: none;
}

.poster-layout .orbit-line {
  display: block;
}

.poster-layout .orbit-line ellipse {
  stroke: rgba(228, 236, 248, 0.62);
  stroke-width: 1.52;
  filter: drop-shadow(0 0 3px rgba(204, 222, 247, 0.24));
}

.poster-layout .sun-halo {
  width: 34%;
  filter: blur(16px);
  animation: none;
  opacity: 0.72;
}

.poster-layout .stage-node {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.48),
    0 0 30px rgba(126, 178, 255, 0.2),
    inset -8px -11px 13px rgba(0, 0, 0, 0.2),
    inset 8px 10px 10px rgba(255, 255, 255, 0.08);
}

.poster-layout .stage-node-name {
  font: 800 clamp(14px, 1.45vw, 22px) / 1 "Barlow Condensed", "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.86);
  text-align: center;
}

.poster-layout .stage-node-en {
  font: 700 clamp(10px, 0.95vw, 15px) / 1 "Barlow Condensed", "Barlow", "Noto Sans KR", sans-serif;
  text-transform: uppercase;
  color: rgba(247, 247, 247, 0.94);
  opacity: 0.92;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.poster-layout .stage-node[data-body-id="sun"] .stage-node-name,
.poster-layout .stage-node[data-body-id="sun"] .stage-node-en {
  opacity: 0;
}

.poster-layout .stage-node[data-body-id="saturn"] .stage-node-name,
.poster-layout .stage-node[data-body-id="saturn"] .stage-node-en {
  opacity: 0;
}

.poster-layout .chapter-focus-hud {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.9), rgba(3, 5, 12, 0.92));
}

.poster-layout .chapter-focus-name {
  color: #ffffff;
  font-size: 14px;
}

.poster-layout .chapter-focus-progress {
  color: rgba(245, 245, 245, 0.86);
}


.lobby {
  position: relative;
  width: 100%;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line-1);
  background:
    radial-gradient(circle at 102% -16%, rgba(133, 194, 255, 0.25), transparent 34%),
    radial-gradient(circle at -12% 108%, rgba(99, 255, 204, 0.12), transparent 40%),
    linear-gradient(165deg, rgba(21, 30, 46, 0.95), rgba(10, 14, 24, 0.98));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.lobby-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-utility-switch {
  position: absolute;
  top: 102px;
  right: 16px;
  left: auto;
  bottom: auto;
  display: inline-flex;
  justify-content: flex-end;
  width: max-content;
  max-width: calc(100% - 32px);
  z-index: 16;
  margin-left: 0;
  transform: none;
}

.daily-visitors-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(139, 211, 255, 0.42);
  background: linear-gradient(180deg, rgba(7, 15, 26, 0.84), rgba(6, 10, 18, 0.9));
  color: #d9efff;
  box-shadow: inset 0 1px 0 rgba(201, 232, 255, 0.14), 0 8px 18px rgba(0, 0, 0, 0.22);
  font: 700 12px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 15;
}

.daily-visitors-badge span {
  color: #a9d7ff;
}

.daily-visitors-badge strong {
  color: #ffffff;
  font-size: 14px;
}

.stage-daily-visitors-badge {
  top: 52px;
  right: 12px;
}

.map-daily-visitors-badge {
  top: 58px;
  right: 16px;
  min-width: 112px;
  justify-content: center;
}

.lobby-kicker {
  margin: 0;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.13em;
  color: #9ec9ff;
}

.lobby h1 {
  margin: 10px 0 6px;
  font: 700 clamp(30px, 4.2vw, 44px) / 1.03 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.015em;
}

.welcome {
  margin: 0;
  color: var(--text-1);
  font-size: 15px;
}

.map-swipe-hint {
  margin: 0 0 12px;
  color: #95abd0;
  font-size: 13px;
}

.stage-back-btn {
  min-width: 100px;
  height: 42px;
  text-transform: uppercase;
}

.editor-wrap {
  width: min(96vw, 1280px);
  height: min(96vh, 1080px);
  max-width: 96vw;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line-1);
  background:
    radial-gradient(circle at 92% -20%, rgba(133, 194, 255, 0.2), transparent 38%),
    linear-gradient(165deg, rgba(21, 30, 46, 0.96), rgba(10, 14, 24, 0.98));
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto auto auto minmax(380px, 1fr) auto 170px;
  gap: 10px;
  overflow: hidden;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.editor-head h1 {
  margin: 8px 0 4px;
  font: 700 clamp(28px, 3.6vw, 40px)/1.04 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.editor-toolbar,
.editor-subtools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.editor-field {
  display: grid;
  gap: 5px;
  min-width: 110px;
}

.editor-field span {
  color: #a8c4ea;
  font: 600 11px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.05em;
}

.editor-field input,
.editor-field select {
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(145, 177, 224, 0.46);
  background: rgba(11, 17, 28, 0.9);
  color: #e9f2ff;
  padding: 0 9px;
  font: 600 13px/1 "Barlow", "Noto Sans KR", sans-serif;
}

.editor-canvas-wrap {
  min-width: 0;
  min-height: 0;
}

.editor-scroll {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  overflow-x: scroll;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(145, 177, 224, 0.45);
  background: rgba(6, 10, 16, 0.95);
}

#mapEditorCanvas {
  display: block;
}

.editor-panbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.editor-panbar span {
  color: #a8c4ea;
  font: 700 12px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.editor-hbar {
  width: 100%;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 999px;
  border: 1px solid rgba(145, 177, 224, 0.45);
  background: rgba(8, 13, 21, 0.92);
}

.editor-hbar-track {
  height: 1px;
  min-width: 100%;
}

.editor-hbar::-webkit-scrollbar,
.editor-scroll::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.editor-hbar::-webkit-scrollbar-thumb,
.editor-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(142, 184, 236, 0.72);
}

.editor-hbar::-webkit-scrollbar-track,
.editor-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(9, 14, 23, 0.86);
}

.editor-output {
  min-width: 0;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(145, 177, 224, 0.46);
  background: rgba(7, 11, 18, 0.95);
  color: #d8e8ff;
  padding: 10px 12px;
  font: 600 12px/1.4 "Consolas", "Monaco", monospace;
}

.editor-head,
.editor-toolbar,
.editor-subtools,
.editor-panbar {
  min-width: 0;
}

.map-empty-hint {
  margin: 6px 0 12px;
  border: 1px solid rgba(149, 177, 223, 0.44);
  border-radius: 10px;
  padding: 10px 12px;
  color: #c9d9f4;
  font-size: 14px;
  background: rgba(12, 19, 31, 0.58);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.stage-chip {
  appearance: none;
  min-height: 96px;
  padding: 10px 11px 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(146, 178, 221, 0.48);
  color: #ecf4ff;
  background:
    radial-gradient(circle at 90% -10%, rgba(136, 196, 255, 0.2), transparent 54%),
    linear-gradient(180deg, rgba(52, 70, 99, 0.95), rgba(32, 42, 62, 0.95));
  box-shadow: inset 0 -2px 0 rgba(10, 16, 26, 0.55), 0 8px 18px rgba(0, 0, 0, 0.28);
  font: 700 14px/1.15 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.stage-chip-label {
  display: block;
}

.stage-chip-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: -2px;
  color: #c8dcff;
  font: 600 11px/1.2 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
}

.stage-chip-lock {
  color: #93a6c8;
  font: 600 11px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.06em;
}

.stage-chip-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.stage-chip-difficulty {
  color: #9ed4ff;
}

.stage-chip-stars {
  color: #ffd67a;
}

.stage-chip:hover {
  transform: translateY(-1px);
}

.stage-chip.is-selected {
  border-color: rgba(165, 229, 255, 0.94);
  box-shadow:
    inset 0 -2px 0 rgba(10, 16, 26, 0.55),
    0 10px 20px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(125, 211, 255, 0.28);
}

.stage-chip.is-cleared {
  border-color: rgba(132, 238, 188, 0.86);
  box-shadow:
    inset 0 -2px 0 rgba(10, 16, 26, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(126, 237, 182, 0.32);
}

.stage-chip.is-locked {
  filter: grayscale(0.95) brightness(0.72);
  cursor: not-allowed;
}

.map-carousel {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

.map-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 10px;
  touch-action: pan-x;
}

.map-track::-webkit-scrollbar {
  height: 8px;
}

.map-track::-webkit-scrollbar-thumb {
  background: rgba(135, 170, 220, 0.45);
  border-radius: 999px;
}

.map-card {
  appearance: none;
  scroll-snap-align: center;
  flex: 0 0 min(86vw, 530px);
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(140, 170, 216, 0.5);
  padding: 16px;
  color: #eef4ff;
  background:
    radial-gradient(circle at 92% 0%, rgba(134, 190, 255, 0.22), transparent 44%),
    linear-gradient(165deg, #253146, #1a2232 72%);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.map-card:hover,
.map-card:focus-visible {
  transform: translateY(-2px) scale(1.003);
  border-color: rgba(151, 208, 255, 0.9);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.map-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.map-title {
  margin: 6px 0;
  font: 700 clamp(22px, 4vw, 30px) / 1.06 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.map-badge {
  display: inline-block;
  margin: 0;
  font: 700 11px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.1em;
  color: #ccffd7;
}

.map-tag {
  margin: 0;
  font: 700 10px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.1em;
  color: #c6d9ff;
}

.map-preview {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(183, 217, 255, 0.62);
  background:
    radial-gradient(circle at 88% -24%, rgba(143, 204, 255, 0.26), transparent 42%),
    linear-gradient(#121a2a, #09101b);
  box-shadow:
    inset 0 1px 0 rgba(225, 239, 255, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(170, 208, 255, 0.08);
  margin: 8px 0 10px;
  image-rendering: auto;
}

.map-preview-large {
  margin: 8px 0 12px;
}

.map-card.is-locked {
  opacity: 0.68;
  filter: saturate(0.72);
}

.map-card.is-cleared {
  border-color: rgba(145, 236, 186, 0.74);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(116, 235, 176, 0.28);
}

.map-card:disabled {
  cursor: not-allowed;
}

.map-desc {
  margin: 0;
  color: var(--text-1);
}

.map-meta {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  color: #9eb4d7;
  font-size: 13px;
}

.map-confirm {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(6, 9, 14, 0.8);
  backdrop-filter: blur(7px);
}

.map-confirm-card {
  width: min(94vw, 760px);
  border-radius: 18px;
  border: 1px solid rgba(151, 186, 234, 0.52);
  padding: 18px;
  background:
    radial-gradient(circle at 90% -12%, rgba(149, 203, 255, 0.25), transparent 36%),
    linear-gradient(165deg, rgba(21, 30, 46, 0.97), rgba(11, 16, 26, 0.99));
  box-shadow: var(--shadow-lg);
}

.map-confirm-kicker {
  margin: 0;
  color: #9ec9ff;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.11em;
}

.map-confirm-card h3 {
  margin: 6px 0 0;
  font: 700 30px/1.06 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.map-confirm-progress {
  margin: 0;
  color: #ffe39e;
  font: 800 clamp(16px, 3vw, 24px)/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.05em;
  text-shadow: 0 3px 12px rgba(255, 190, 92, 0.35);
}

.map-confirm-difficulty {
  margin: 6px 0 0;
  color: #9ed4ff;
  font: 700 clamp(15px, 2.9vw, 21px)/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.timeattack-box {
  margin-top: 10px;
  border: 1px solid rgba(173, 204, 249, 0.48);
  border-radius: 16px;
  width: 100%;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 92% -44%, rgba(131, 196, 255, 0.28), transparent 46%),
    linear-gradient(175deg, rgba(10, 17, 28, 0.78), rgba(7, 12, 20, 0.94));
}

.timeattack-title {
  margin: 0;
  color: #dcedff;
  font: 700 13px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.12em;
}

.timeattack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeattack-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  color: #e8f0ff;
  max-height: min(38vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.timeattack-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  font-size: 15px;
  border-radius: 10px;
  padding: 7px 10px;
}

.timeattack-row.is-current {
  border: 1px solid rgba(117, 255, 205, 0.56);
  background: linear-gradient(90deg, rgba(88, 255, 195, 0.18), rgba(119, 232, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(206, 255, 239, 0.12), 0 0 18px rgba(88, 255, 195, 0.14);
}

.timeattack-row.is-message {
  grid-template-columns: minmax(0, 1fr) auto;
  color: #b9c8df;
  background: rgba(8, 14, 24, 0.42);
}

.timeattack-row.is-message .timeattack-rank {
  display: none;
}

.timeattack-row.is-message .timeattack-name {
  color: #cbd9ee;
}

.timeattack-row.is-message strong {
  color: #91d7ff;
}

.timeattack-row.rank-1 {
  background: linear-gradient(90deg, rgba(250, 210, 113, 0.2), rgba(250, 210, 113, 0.02));
}

.timeattack-row.rank-2 {
  background: linear-gradient(90deg, rgba(211, 223, 238, 0.16), rgba(211, 223, 238, 0.02));
}

.timeattack-row.rank-3 {
  background: linear-gradient(90deg, rgba(206, 154, 118, 0.18), rgba(206, 154, 118, 0.02));
}

.timeattack-rank {
  color: #f9e0a3;
  font-weight: 700;
}

.timeattack-name {
  color: #d9e8ff;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeattack-list strong {
  color: #ffecaf;
  font: 700 19px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.02em;
}

.map-confirm-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.map-start-btn {
  margin-top: 0;
}

.game-wrap {
  width: min(98vw, 1240px);
  padding: 10px;
  background: var(--panel-0);
  border: 1px solid var(--line-0);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-md);
}

#screen-game.screen {
  width: 100vw;
  height: 100dvh;
}

#screen-game .game-wrap {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(180deg, #08111f, #06090f);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.game-viewport {
  --game-ui-scale: 1;
  --pause-btn-size: clamp(42px, calc(62px * var(--game-ui-scale)), 76px);
  --pause-btn-radius: clamp(13px, calc(18px * var(--game-ui-scale)), 22px);
  --pause-btn-font-size: clamp(14px, calc(18px * var(--game-ui-scale)), 22px);
  --pause-btn-top: clamp(10px, calc(16px * var(--game-ui-scale)), 18px);
  --stage-info-font-size: clamp(10px, calc(16px * var(--game-ui-scale)), 21px);
  --stage-info-padding-y: 0px;
  --stage-info-padding-x: 0px;
  --stage-info-top: clamp(9px, calc(14px * var(--game-ui-scale)), 18px);
  --ctrl-btn-size: clamp(94px, calc(170px * var(--game-ui-scale)), 188px);
  --ctrl-btn-offset: clamp(6px, calc(10px * var(--game-ui-scale)), 14px);
  --ctrl-bottom-offset: clamp(6px, calc(14px * var(--game-ui-scale)), 16px);
  --ctrl-arrow-size: clamp(15px, calc(26px * var(--game-ui-scale)), 30px);
  --ctrl-arrow-stroke: clamp(2px, calc(4px * var(--game-ui-scale)), 5px);
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: linear-gradient(#111a28, #080d15);
  overscroll-behavior: contain;
  touch-action: none;
}

.game-viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  border: 0;
  touch-action: none;
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}

body.native-app #screen-game .canvas-wrap,
body.native-app #screen-game .game-viewport,
body.native-app #screen-game .game-viewport canvas {
  contain: layout paint style;
}

.game-hudbar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  height: 74px;
  pointer-events: none;
}

.hud-left {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 198px;
  padding: 9px 12px 8px;
  border: 1px solid rgba(146, 178, 221, 0.42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% -10%, rgba(136, 192, 255, 0.25), transparent 42%),
    linear-gradient(170deg, var(--panel-2), var(--panel-1) 70%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.hud-label {
  margin: 0;
  color: #a7c2e6;
  font: 700 10px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.1em;
}

.hud-time {
  margin: 3px 0 2px;
  color: #f6f9ff;
  font: 700 24px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
}

.hud-player {
  margin: 0 0 2px;
  font-size: 12px;
  color: #c7dcff;
  letter-spacing: 0.03em;
}

.hud-life {
  margin: 0;
  position: absolute;
  top: 78px;
  left: 10px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 193, 0.66);
  background: linear-gradient(180deg, rgba(68, 33, 43, 0.88), rgba(34, 17, 24, 0.9));
  font: 800 23px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  color: #ffd6e4;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  text-shadow: 0 0 10px rgba(255, 164, 191, 0.4);
}

.pause-btn {
  position: absolute;
  top: var(--pause-btn-top);
  right: 0;
  width: var(--pause-btn-size);
  height: var(--pause-btn-size);
  border-radius: var(--pause-btn-radius);
  border: 1px solid rgba(184, 212, 250, 0.26);
  color: rgba(242, 246, 255, 0.9);
  font: 700 var(--pause-btn-font-size) / 1 "Chakra Petch", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(79, 105, 145, 0.2), rgba(45, 63, 94, 0.18));
  cursor: pointer;
  pointer-events: auto;
  box-shadow: inset 0 -1px 0 rgba(10, 16, 26, 0.2), 0 7px 14px rgba(0, 0, 0, 0.16);
}

.game-stage-info {
  margin: 0;
  position: absolute;
  top: var(--stage-info-top);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  padding: var(--stage-info-padding-y) var(--stage-info-padding-x);
  border: 0;
  background: none;
  color: #f3f9ff;
  font: 800 var(--stage-info-font-size)/1.08 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.08em;
  pointer-events: none;
  white-space: nowrap;
  max-width: min(54vw, calc(100% - 280px));
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  z-index: 7;
}

.pause-btn:active {
  transform: translateY(1px);
}

.clear-banner {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  font: 900 clamp(42px, 10vw, 92px) / 1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 2px 0 #0c6144, 0 0 24px #1de095;
  background: rgba(21, 214, 146, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.clear-banner.show {
  opacity: 1;
}

.pause-overlay,
.clear-overlay,
.gameover-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(7, 11, 18, 0.76);
  backdrop-filter: blur(6px);
}

.pause-overlay {
  z-index: 9;
}

.clear-overlay {
  z-index: 10;
}

.gameover-overlay {
  z-index: 11;
}

.pause-card,
.clear-card,
.gameover-card {
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop-in 220ms ease;
}

.pause-card {
  width: min(90vw, 380px);
  border: 1px solid rgba(151, 186, 234, 0.5);
  background:
    radial-gradient(circle at 100% -18%, rgba(170, 215, 255, 0.24), transparent 40%),
    linear-gradient(165deg, #1b2a40, #101a2a 72%);
}

.pause-title {
  margin: 0;
  font: 700 28px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.pause-sub {
  margin: 6px 0 12px;
  color: #c7d8f4;
  font-size: 14px;
}

.pause-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clear-card {
  width: min(90vw, 400px);
  border: 1px solid rgba(126, 213, 242, 0.52);
  background:
    radial-gradient(circle at 100% -20%, rgba(144, 236, 255, 0.24), transparent 42%),
    linear-gradient(165deg, #182a3d, #101b2a 72%);
}

.clear-kicker,
.gameover-kicker {
  margin: 0;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.11em;
}

.clear-kicker {
  color: #9fe1ff;
}

.clear-title,
.gameover-title {
  margin: 8px 0 10px;
  font: 700 27px/1.06 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.clear-star-text {
  margin: 8px 0 12px;
  font: 700 30px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.12em;
  color: #ffe390;
  text-shadow: 0 0 15px rgba(255, 224, 123, 0.4);
}

.clear-stats,
.gameover-stats {
  border: 1px solid rgba(150, 187, 242, 0.38);
  border-radius: 12px;
  background: rgba(9, 13, 20, 0.52);
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.clear-stats p,
.gameover-stats p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d8e8ff;
  font-size: 13px;
}

.clear-stats strong,
.gameover-stats strong {
  color: #fff6b5;
  font: 700 15px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
}

.clear-rules {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #d1e2fb;
  font-size: 13px;
  display: grid;
  gap: 3px;
}

.clear-actions,
.gameover-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clear-actions .primary-btn,
.clear-actions .secondary-btn,
.gameover-actions .primary-btn,
.gameover-actions .secondary-btn {
  margin-top: 0;
  width: 100%;
}

.gameover-card {
  width: min(90vw, 400px);
  border: 1px solid rgba(238, 151, 175, 0.45);
  background:
    radial-gradient(circle at 100% -20%, rgba(255, 158, 188, 0.2), transparent 42%),
    linear-gradient(165deg, #2d1d2a, #1a1118 72%);
  position: relative;
  overflow: hidden;
}

.gameover-kicker {
  color: #ffc3d6;
}

.ad-revive-banner {
  width: 100%;
  margin-top: 12px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid #c8984f;
  color: #2b1800;
  font: 700 14px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffe69a, #f8bf62);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.ad-revive-banner:active {
  transform: translateY(1px);
}

.ad-revive-banner:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.controls.in-canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--ctrl-bottom-offset);
  z-index: 6;
  margin-top: 0;
  height: calc(var(--ctrl-btn-size) + var(--ctrl-bottom-offset));
  pointer-events: none;
  touch-action: none;
}

.controls.in-canvas .ctrl-btn {
  position: absolute;
  width: var(--ctrl-btn-size);
  height: var(--ctrl-btn-size);
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 217, 255, 0.12);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.04), transparent 44%),
    linear-gradient(180deg, rgba(52, 75, 112, 0.08), rgba(31, 45, 71, 0.06));
  backdrop-filter: blur(3px);
  box-shadow: inset 0 -1px 0 rgba(8, 14, 24, 0.1), 0 5px 10px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  touch-action: none;
  user-select: none;
}

.controls.in-canvas #leftBtn {
  left: var(--ctrl-btn-offset);
}

.controls.in-canvas #rightBtn {
  right: var(--ctrl-btn-offset);
}

.controls.in-canvas #leftBtn::before,
.controls.in-canvas #rightBtn::before {
  content: "";
  width: var(--ctrl-arrow-size);
  height: var(--ctrl-arrow-size);
  border-top: var(--ctrl-arrow-stroke) solid rgba(244, 250, 255, 0.56);
  border-right: var(--ctrl-arrow-stroke) solid rgba(244, 250, 255, 0.56);
}

.controls.in-canvas #leftBtn::before {
  transform: rotate(-135deg) translate(-1px, 1px);
}

.controls.in-canvas #rightBtn::before {
  transform: rotate(45deg) translate(-1px, 1px);
}

.ctrl-btn {
  appearance: none;
  border: 1px solid rgba(146, 178, 221, 0.48);
  border-radius: 14px;
  padding: 12px 10px;
  font: 700 15px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.06em;
  color: #ecf4ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(136, 196, 255, 0.2), transparent 56%),
    linear-gradient(180deg, rgba(52, 70, 99, 0.95), rgba(32, 42, 62, 0.95));
  box-shadow: inset 0 -2px 0 rgba(10, 16, 26, 0.55), 0 8px 18px rgba(0, 0, 0, 0.28);
  touch-action: none;
}

.ctrl-btn:active {
  transform: translateY(1px);
}

.pause-actions .primary-btn,
.pause-actions .secondary-btn {
  margin-top: 0;
  width: 100%;
}

/* Galaxy + Neon theme for all screens except chapter select (#screen-stage). */
:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) {
  --neon-cyan: #83f5ff;
  --neon-blue: #74b3ff;
  --neon-violet: #9484ff;
  --neon-pink: #ff8fda;
  --neon-mint: #6dffd1;
  position: relative;
  isolation: isolate;
}

#screen-mapselect {
  position: relative;
}

#screen-mapselect .lobby {
  margin-top: 42px;
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(860px 460px at -8% -10%, rgba(129, 193, 255, 0.26), transparent 64%),
    radial-gradient(760px 420px at 112% 112%, rgba(136, 118, 255, 0.22), transparent 64%),
    radial-gradient(560px 320px at 50% 116%, rgba(87, 255, 209, 0.12), transparent 68%);
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 18%, rgba(230, 245, 255, 0.34) 0.6px, transparent 1px),
    radial-gradient(circle at 28% 68%, rgba(187, 215, 255, 0.26) 0.7px, transparent 1px),
    radial-gradient(circle at 74% 22%, rgba(208, 171, 255, 0.28) 0.7px, transparent 1px),
    radial-gradient(circle at 88% 84%, rgba(174, 255, 233, 0.24) 0.7px, transparent 1px);
  background-size: 156px 156px, 188px 188px, 214px 214px, 242px 242px;
  opacity: 0.56;
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .primary-btn,
:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .secondary-btn {
  border: 1px solid rgba(152, 208, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(232, 245, 255, 0.24),
    0 10px 22px rgba(20, 38, 68, 0.5),
    0 0 0 1px rgba(109, 201, 255, 0.12);
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .primary-btn {
  color: #031018;
  background:
    linear-gradient(122deg, var(--neon-cyan), var(--neon-blue) 46%, var(--neon-violet) 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .secondary-btn {
  color: #eef6ff;
  background:
    linear-gradient(162deg, rgba(55, 76, 117, 0.88), rgba(28, 38, 63, 0.9) 70%);
}

:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .primary-btn:hover,
:is(#screen-nickname, #screen-mapselect, #screen-editor, #screen-game) .secondary-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(242, 250, 255, 0.28),
    0 12px 24px rgba(24, 44, 76, 0.56),
    0 0 0 1px rgba(138, 217, 255, 0.2),
    0 0 22px rgba(120, 204, 255, 0.18);
}

#screen-nickname .modal-card {
  border: 1px solid rgba(166, 214, 255, 0.62);
  background:
    radial-gradient(circle at 100% -10%, rgba(137, 207, 255, 0.28), transparent 42%),
    radial-gradient(circle at -8% 118%, rgba(150, 126, 255, 0.18), transparent 48%),
    linear-gradient(163deg, rgba(20, 30, 49, 0.96), rgba(8, 13, 24, 0.98));
  box-shadow:
    0 22px 52px rgba(4, 9, 17, 0.64),
    0 0 0 1px rgba(126, 199, 255, 0.2),
    0 0 30px rgba(118, 192, 255, 0.14);
}

#screen-nickname .modal-kicker {
  color: #9cedff;
}

#screen-nickname .modal-card h2 {
  color: #f3f8ff;
  text-shadow: 0 0 24px rgba(114, 186, 255, 0.2);
}

#screen-nickname .modal-desc {
  color: #b7caf0;
}

#screen-nickname .nickname-input {
  border: 1px solid rgba(145, 208, 255, 0.56);
  background:
    linear-gradient(175deg, rgba(10, 17, 30, 0.94), rgba(7, 11, 20, 0.96));
  box-shadow: inset 0 1px 0 rgba(201, 228, 255, 0.16);
}

#screen-nickname .nickname-input:focus {
  border-color: rgba(122, 236, 255, 0.95);
  box-shadow:
    0 0 0 4px rgba(108, 214, 255, 0.2),
    0 0 24px rgba(117, 210, 255, 0.26);
}

#screen-mapselect .lobby {
  position: relative;
  --map-top-controls-space: 146px;
  padding-top: var(--map-top-controls-space);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(142, 221, 255, 0.62);
  background:
    radial-gradient(130% 100% at 102% -18%, rgba(95, 237, 255, 0.18), transparent 48%),
    radial-gradient(112% 94% at -14% 118%, rgba(110, 151, 255, 0.24), transparent 52%),
    linear-gradient(160deg, rgba(15, 24, 43, 0.95), rgba(6, 10, 19, 0.98) 56%, rgba(4, 8, 15, 0.99));
  box-shadow:
    0 28px 64px rgba(2, 6, 14, 0.72),
    0 0 0 1px rgba(133, 214, 255, 0.2),
    0 0 48px rgba(88, 208, 255, 0.16);
}

#screen-mapselect .lobby::before {
  content: "";
  position: absolute;
  inset: -14% -10% -18%;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 18%, rgba(113, 248, 255, 0.2) 0%, rgba(113, 248, 255, 0) 38%),
    radial-gradient(circle at 20% 76%, rgba(137, 149, 255, 0.2) 0%, rgba(137, 149, 255, 0) 34%),
    radial-gradient(circle at 64% 46%, rgba(140, 184, 255, 0.12) 0%, rgba(140, 184, 255, 0) 38%);
  filter: blur(8px);
  opacity: 0.84;
  animation: mapselect-nebula-drift 16s ease-in-out infinite alternate;
  z-index: 0;
}

#screen-mapselect .lobby::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(133, 209, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 202, 255, 0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.36;
  mix-blend-mode: screen;
  animation: mapselect-grid-pan 26s linear infinite;
  z-index: 0;
}

#screen-mapselect .lobby > * {
  position: relative;
  z-index: 1;
}

#screen-mapselect .map-utility-switch {
  position: absolute;
}

#screen-mapselect .map-daily-visitors-badge {
  position: absolute;
  top: 66px;
  right: 16px;
  z-index: 17;
}

body.native-app #screen-mapselect.screen {
  height: 100svh;
  padding: 8px 8px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.native-app #screen-mapselect .lobby {
  width: min(97%, 1080px);
  margin: 0 auto;
  min-height: calc(100svh - 24px);
  overflow-x: hidden;
  overflow-y: visible;
  backdrop-filter: none;
}

body.native-app #screen-mapselect .lobby::before {
  animation: none;
  filter: blur(4px);
  opacity: 0.58;
}

body.native-app #screen-mapselect .lobby::after {
  animation: none;
  opacity: 0.2;
}

#screen-mapselect .lobby-head {
  position: relative;
  padding-right: 0;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

#screen-mapselect .lobby-head-actions {
  position: absolute;
  top: calc(-1 * var(--map-top-controls-space) + 16px);
  right: 16px;
  z-index: 17;
}

#screen-mapselect .lobby-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(120, 219, 255, 0), rgba(120, 219, 255, 0.66), rgba(120, 219, 255, 0));
  box-shadow: 0 0 16px rgba(105, 196, 255, 0.22);
}

#screen-mapselect .lobby-kicker {
  color: #8ef5ff;
  text-shadow: 0 0 12px rgba(116, 239, 255, 0.36);
}

#screen-mapselect .lobby h1 {
  color: #f6fbff;
  text-shadow:
    0 0 14px rgba(129, 213, 255, 0.22),
    0 0 26px rgba(79, 189, 255, 0.18);
}

#screen-mapselect .welcome,
#screen-mapselect .map-swipe-hint {
  color: #c8dcff;
}

#screen-mapselect .map-swipe-hint {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(131, 206, 255, 0.42);
  background: linear-gradient(180deg, rgba(8, 16, 28, 0.82), rgba(7, 12, 21, 0.86));
  box-shadow: inset 0 1px 0 rgba(201, 232, 255, 0.18);
  font-size: 12px;
  letter-spacing: 0.03em;
}

#screen-mapselect .stage-select-notice {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 136, 0.46);
  background:
    radial-gradient(circle at 96% -28%, rgba(255, 214, 140, 0.16), transparent 40%),
    linear-gradient(165deg, rgba(47, 35, 18, 0.88), rgba(23, 17, 10, 0.92));
  color: #ffe2a2;
  font-size: 13px;
  line-height: 1.45;
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 192, 0.12),
    0 12px 22px rgba(0, 0, 0, 0.24);
}

#screen-mapselect .map-empty-hint {
  border-color: rgba(145, 220, 255, 0.58);
  background:
    radial-gradient(circle at 90% -40%, rgba(122, 219, 255, 0.2), transparent 56%),
    rgba(8, 15, 27, 0.82);
  color: #d8ecff;
}

#screen-mapselect .stage-grid {
  position: relative;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  contain: layout paint style;
}

body.native-app #screen-mapselect .stage-grid {
  overflow: visible;
  will-change: transform, opacity;
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

#screen-mapselect .lobby-head > *,
#screen-mapselect .map-swipe-hint,
#screen-mapselect .stage-select-notice,
#screen-mapselect .map-empty-hint {
  transition:
    opacity 280ms ease,
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

#screen-mapselect.is-activating .lobby-head > *,
#screen-mapselect.is-activating .map-swipe-hint,
#screen-mapselect.is-activating .stage-select-notice,
#screen-mapselect.is-activating .map-empty-hint {
  opacity: 0.01;
  transform: translate3d(0, 16px, 0);
}

#screen-mapselect.is-activating.is-ready .lobby-head > *,
#screen-mapselect.is-activating.is-ready .map-swipe-hint,
#screen-mapselect.is-activating.is-ready .stage-select-notice,
#screen-mapselect.is-activating.is-ready .map-empty-hint {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#screen-mapselect .stage-chip {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(140, 211, 255, 0.52);
  background:
    radial-gradient(circle at 98% -24%, rgba(128, 226, 255, 0.28), transparent 56%),
    linear-gradient(174deg, rgba(26, 40, 64, 0.95), rgba(12, 20, 35, 0.95));
  box-shadow:
    inset 0 -2px 0 rgba(7, 11, 21, 0.62),
    inset 0 1px 0 rgba(194, 234, 255, 0.16),
    0 12px 24px rgba(2, 6, 14, 0.58);
  backdrop-filter: blur(2px);
  contain: paint;
  transition:
    opacity 320ms ease,
    transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease,
    border-color 220ms ease,
    filter 220ms ease;
}

body.native-app #screen-mapselect .stage-chip {
  backdrop-filter: none;
  box-shadow:
    inset 0 -2px 0 rgba(7, 11, 21, 0.56),
    inset 0 1px 0 rgba(194, 234, 255, 0.12),
    0 9px 18px rgba(2, 6, 14, 0.44);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    filter 180ms ease;
}

#screen-mapselect.is-activating .stage-chip {
  opacity: 0.01;
  transform: translate3d(0, 18px, 0) scale(0.985);
  transition-delay: calc(70ms + var(--stage-chip-index, 0) * 24ms);
}

body.native-app #screen-mapselect.is-activating .stage-grid {
  opacity: 0.01;
  transform: translate3d(0, 14px, 0);
}

body.native-app #screen-mapselect.is-activating.is-ready .stage-grid {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.native-app #screen-mapselect.is-activating .stage-chip,
body.native-app #screen-mapselect.is-activating.is-ready .stage-chip {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}

#screen-mapselect.is-activating.is-ready .stage-chip {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

#screen-mapselect:not(.is-activating) .stage-chip {
  transition-delay: 0ms;
}

#screen-mapselect .stage-chip::before {
  content: "";
  position: absolute;
  left: -40%;
  top: -18%;
  width: 86%;
  height: 138%;
  background: linear-gradient(90deg, rgba(188, 240, 255, 0), rgba(188, 240, 255, 0.18), rgba(188, 240, 255, 0));
  transform: rotate(16deg) translateX(-24%);
  transition: transform 220ms ease;
  pointer-events: none;
}

#screen-mapselect .stage-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(148, 222, 255, 0.18);
  pointer-events: none;
}

#screen-mapselect .stage-chip:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 -2px 0 rgba(8, 12, 22, 0.6),
    inset 0 1px 0 rgba(198, 241, 255, 0.22),
    0 14px 30px rgba(2, 6, 14, 0.62),
    0 0 22px rgba(108, 210, 255, 0.24);
}

#screen-mapselect .stage-chip:hover::before {
  transform: rotate(16deg) translateX(34%);
}

#screen-mapselect .stage-chip.is-selected {
  border-color: rgba(138, 240, 255, 0.96);
  background:
    radial-gradient(circle at 98% -24%, rgba(125, 242, 255, 0.34), transparent 56%),
    linear-gradient(174deg, rgba(22, 49, 80, 0.95), rgba(10, 24, 42, 0.96));
  box-shadow:
    inset 0 -2px 0 rgba(8, 13, 22, 0.62),
    inset 0 1px 0 rgba(210, 248, 255, 0.24),
    0 14px 28px rgba(2, 7, 16, 0.64),
    0 0 0 1px rgba(119, 224, 255, 0.38),
    0 0 28px rgba(117, 212, 255, 0.3);
}

#screen-mapselect .stage-chip.is-cleared {
  border-color: rgba(127, 255, 201, 0.9);
  box-shadow:
    inset 0 -2px 0 rgba(8, 13, 22, 0.62),
    inset 0 1px 0 rgba(198, 255, 230, 0.2),
    0 14px 28px rgba(2, 7, 16, 0.62),
    0 0 0 1px rgba(118, 245, 186, 0.32),
    0 0 24px rgba(116, 255, 192, 0.18);
}

#screen-mapselect .stage-chip-label,
#screen-mapselect .stage-chip-name {
  color: #eef8ff;
  text-shadow:
    0 0 12px rgba(119, 204, 255, 0.2),
    0 0 20px rgba(76, 177, 255, 0.12);
}

#screen-mapselect .stage-chip-meta,
#screen-mapselect .stage-chip-difficulty,
#screen-mapselect .stage-chip-stars {
  color: #d4e9ff;
}

#screen-mapselect .stage-chip.is-locked {
  border-color: rgba(113, 142, 184, 0.48);
  background:
    radial-gradient(circle at 98% -24%, rgba(125, 151, 184, 0.16), transparent 56%),
    linear-gradient(174deg, rgba(22, 30, 45, 0.9), rgba(10, 15, 26, 0.9));
  box-shadow:
    inset 0 -2px 0 rgba(8, 12, 20, 0.66),
    0 10px 20px rgba(1, 3, 8, 0.56);
}

#screen-mapselect .lobby-head-actions .stage-back-btn {
  border-color: rgba(136, 210, 255, 0.56);
  background:
    radial-gradient(circle at 88% -26%, rgba(111, 214, 255, 0.28), transparent 56%),
    linear-gradient(180deg, rgba(20, 35, 56, 0.94), rgba(10, 18, 31, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(196, 232, 255, 0.16),
    0 8px 16px rgba(2, 6, 14, 0.48);
}

#screen-mapselect .lobby-head-actions .stage-back-btn:hover {
  border-color: rgba(143, 232, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(210, 244, 255, 0.24),
    0 10px 20px rgba(2, 6, 14, 0.56),
    0 0 20px rgba(112, 206, 255, 0.24);
}

#screen-mapselect .map-confirm,
.map-confirm.map-confirm-portal {
  position: fixed;
  inset: 0;
  z-index: 180;
  padding: clamp(12px, 2.2vw, 24px);
  display: grid;
  place-items: center;
  background: rgba(6, 9, 14, 0.82);
  backdrop-filter: blur(8px);
}

#screen-mapselect .map-confirm-card,
#screen-mapselect .timeattack-box,
.map-confirm.map-confirm-portal .map-confirm-card,
.map-confirm.map-confirm-portal .timeattack-box {
  border: 1px solid rgba(153, 219, 255, 0.6);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -14%, rgba(122, 223, 255, 0.24), transparent 42%),
    linear-gradient(164deg, rgba(15, 28, 47, 0.97), rgba(7, 12, 22, 0.99));
  box-shadow:
    0 20px 44px rgba(3, 6, 14, 0.72),
    0 0 0 1px rgba(112, 205, 255, 0.24);
}

#screen-mapselect .map-confirm-card,
.map-confirm.map-confirm-portal .map-confirm-card {
  width: min(92vw, 760px);
  max-width: 760px;
}

#screen-mapselect .map-confirm-card::after,
#screen-mapselect .timeattack-box::after,
.map-confirm.map-confirm-portal .map-confirm-card::after,
.map-confirm.map-confirm-portal .timeattack-box::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(170, 229, 255, 0.2);
  pointer-events: none;
}

#screen-mapselect .map-preview,
.map-confirm.map-confirm-portal .map-preview {
  width: min(100%, 640px);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  border-color: rgba(156, 226, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(214, 243, 255, 0.14),
    0 16px 28px rgba(1, 4, 10, 0.52),
    0 0 20px rgba(105, 197, 255, 0.14);
}

#screen-mapselect .map-confirm-kicker,
#screen-mapselect .map-confirm-card h3,
#screen-mapselect .map-confirm-difficulty,
#screen-mapselect .timeattack-title,
#screen-mapselect .timeattack-list,
.map-confirm.map-confirm-portal .map-confirm-kicker,
.map-confirm.map-confirm-portal .map-confirm-card h3,
.map-confirm.map-confirm-portal .map-confirm-difficulty,
.map-confirm.map-confirm-portal .timeattack-title,
.map-confirm.map-confirm-portal .timeattack-list {
  text-shadow: 0 0 16px rgba(97, 201, 255, 0.2);
}

#screen-mapselect .timeattack-row,
.map-confirm.map-confirm-portal .timeattack-row {
  border: 1px solid rgba(142, 210, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(202, 236, 255, 0.09);
}

#screen-mapselect .map-confirm-actions .primary-btn,
.map-confirm.map-confirm-portal .map-confirm-actions .primary-btn {
  box-shadow:
    0 14px 24px rgba(62, 186, 245, 0.34),
    0 0 22px rgba(78, 202, 255, 0.24);
}

#screen-mapselect .map-confirm-actions .secondary-btn,
.map-confirm.map-confirm-portal .map-confirm-actions .secondary-btn {
  box-shadow:
    inset 0 1px 0 rgba(206, 236, 255, 0.1),
    0 10px 18px rgba(2, 6, 14, 0.44);
}

.hub-card {
  width: min(92vw, 760px);
  max-height: min(88vh, 900px);
  display: grid;
  gap: 18px;
}

.hub-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hub-close-btn {
  min-width: 82px;
}

.hub-panel {
  display: grid;
  gap: 14px;
}

.hub-section {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(142, 215, 255, 0.34);
  background:
    radial-gradient(circle at 98% -28%, rgba(118, 221, 255, 0.12), transparent 42%),
    linear-gradient(174deg, rgba(18, 28, 46, 0.94), rgba(8, 13, 23, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(196, 235, 255, 0.12),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

.hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-section-label {
  margin: 0;
  color: #eff8ff;
  font: 700 15px/1.1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.hub-section-desc,
.hub-panel-desc {
  margin: 6px 0 0;
  color: #b8d0ef;
  font: 500 13px/1.5 "Barlow", "Noto Sans KR", sans-serif;
}

.hub-panel-desc {
  margin-top: 0;
}

.hub-toggle-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hub-slider-stack {
  display: grid;
  gap: 10px;
}

.hub-slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #eff8ff;
  font: 600 13px/1.2 "Barlow", "Noto Sans KR", sans-serif;
}

.hub-slider-row strong {
  color: #8ef5ff;
  font: 700 12px/1 "Chakra Petch", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.hub-range {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
}

.hub-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 183, 255, 0.82), rgba(88, 255, 195, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hub-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1px solid rgba(216, 245, 255, 0.82);
  background: radial-gradient(circle at 35% 30%, #fbffff, #87ecff 64%, #5fd4ff 100%);
  box-shadow: 0 6px 16px rgba(40, 148, 255, 0.32);
}

.hub-range::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 183, 255, 0.82), rgba(88, 255, 195, 0.74));
}

.hub-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(216, 245, 255, 0.82);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbffff, #87ecff 64%, #5fd4ff 100%);
  box-shadow: 0 6px 16px rgba(40, 148, 255, 0.32);
}

.hub-debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hub-debug-btn {
  min-width: 0;
  min-height: 42px;
  height: auto;
  padding: 9px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.hub-audio-last-played {
  min-height: 20px;
  margin: 2px 0 0;
  color: #dff4ff;
  font: 600 12px/1.45 "Barlow", "Noto Sans KR", sans-serif;
}

.hub-toggle-btn.is-selected,
.hub-item-card.is-selected {
  border-color: rgba(134, 242, 255, 0.92) !important;
  box-shadow:
    inset 0 1px 0 rgba(220, 249, 255, 0.18),
    0 0 0 1px rgba(125, 233, 255, 0.32),
    0 0 26px rgba(111, 218, 255, 0.18) !important;
}

.hub-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hub-item-card {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(136, 209, 255, 0.34);
  background:
    radial-gradient(circle at 96% -24%, rgba(122, 218, 255, 0.18), transparent 40%),
    linear-gradient(174deg, rgba(19, 30, 49, 0.96), rgba(7, 13, 24, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(198, 235, 255, 0.1),
    0 12px 24px rgba(0, 0, 0, 0.26);
}

.hub-item-card h4 {
  margin: 8px 0 4px;
  color: #f2f8ff;
  font: 700 16px/1.15 "Chakra Petch", "Noto Sans KR", sans-serif;
}

.hub-item-card p {
  margin: 0;
  color: #b7cfea;
  font: 500 12px/1.45 "Barlow", "Noto Sans KR", sans-serif;
}

.hub-item-kicker {
  color: #8ef5ff !important;
  font: 700 11px/1 "Chakra Petch", "Noto Sans KR", sans-serif !important;
  letter-spacing: 0.12em;
}

.hub-item-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 12px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 215, 255, 0.36);
  background: rgba(7, 14, 24, 0.66);
  color: #d9ecff;
  font: 600 11px/1 "Barlow", "Noto Sans KR", sans-serif;
  letter-spacing: 0.04em;
}

.hub-item-card button {
  width: 100%;
  margin-top: 12px;
}

.hub-skin-grid .hub-item-card {
  display: flex;
  flex-direction: column;
}

.hub-skin-preview {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 20px rgba(0, 0, 0, 0.24);
}

.hub-skin-preview.skin-classic {
  background: radial-gradient(circle at 30% 28%, #fff7d5 0%, #f7db79 34%, #d7b14b 76%, #8e6d2a 100%);
}

.hub-skin-preview.skin-nebula {
  background: radial-gradient(circle at 30% 28%, #f3fbff 0%, #9ce8ff 34%, #4297e8 76%, #123d82 100%);
}

.hub-skin-preview.skin-comet {
  background: radial-gradient(circle at 30% 28%, #f6fff8 0%, #92ffd0 34%, #2bc990 76%, #0f6e53 100%);
}

#screen-editor .editor-wrap {
  border: 1px solid rgba(161, 213, 255, 0.62);
  background:
    radial-gradient(circle at 96% -12%, rgba(141, 201, 255, 0.24), transparent 40%),
    radial-gradient(circle at -10% 120%, rgba(142, 118, 255, 0.2), transparent 42%),
    linear-gradient(164deg, rgba(17, 27, 44, 0.96), rgba(7, 11, 20, 0.98));
  box-shadow:
    0 24px 56px rgba(4, 8, 16, 0.66),
    0 0 0 1px rgba(112, 192, 255, 0.2),
    0 0 34px rgba(103, 183, 255, 0.1);
}

#screen-editor .editor-head h1 {
  color: #f3f8ff;
}

#screen-editor .editor-head .welcome {
  color: #bed1f0;
}

#screen-editor .editor-field span,
#screen-editor .editor-panbar span {
  color: #c4e6ff;
}

#screen-editor .editor-field input,
#screen-editor .editor-field select,
#screen-editor .editor-output {
  border: 1px solid rgba(143, 210, 255, 0.58);
  background:
    linear-gradient(175deg, rgba(10, 16, 28, 0.95), rgba(6, 10, 18, 0.97));
  color: #eaf4ff;
  box-shadow: inset 0 1px 0 rgba(189, 221, 255, 0.12);
}

#screen-editor .editor-output::placeholder,
#screen-editor .editor-field input::placeholder {
  color: #9eb9de;
}

#screen-editor .editor-scroll,
#screen-editor .editor-hbar {
  border: 1px solid rgba(150, 211, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.97), rgba(4, 8, 14, 0.98));
}

#screen-editor .editor-hbar::-webkit-scrollbar-thumb,
#screen-editor .editor-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 212, 255, 0.9), rgba(106, 175, 255, 0.82));
}

#screen-game .game-wrap {
  background:
    radial-gradient(1200px 620px at -8% -12%, rgba(117, 187, 255, 0.24), transparent 62%),
    radial-gradient(860px 520px at 110% 114%, rgba(140, 121, 255, 0.2), transparent 62%),
    linear-gradient(180deg, #071022, #050913);
}

#screen-game .game-viewport {
  background:
    radial-gradient(720px 440px at 78% -20%, rgba(127, 185, 255, 0.12), transparent 58%),
    linear-gradient(180deg, #0d182b, #060d19);
}

#screen-game .game-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(223, 238, 255, 0.26) 0.7px, transparent 1px),
    radial-gradient(circle at 34% 66%, rgba(184, 213, 255, 0.2) 0.8px, transparent 1px),
    radial-gradient(circle at 78% 24%, rgba(211, 177, 255, 0.2) 0.8px, transparent 1px),
    radial-gradient(circle at 88% 82%, rgba(168, 255, 233, 0.2) 0.8px, transparent 1px);
  background-size: 168px 168px, 198px 198px, 226px 226px, 246px 246px;
  opacity: 0.54;
}

body.native-app #screen-game .game-wrap {
  background: linear-gradient(180deg, #07101c, #050913);
}

body.native-app #screen-game .game-viewport {
  background: linear-gradient(180deg, #0b1524, #060d18);
}

body.native-app #screen-game .game-viewport::before {
  background-size: 220px 220px, 248px 248px, 278px 278px, 298px 298px;
  opacity: 0.26;
}

#screen-game .hud-left {
  border: 1px solid rgba(151, 215, 255, 0.52);
  background:
    radial-gradient(circle at 98% -8%, rgba(147, 206, 255, 0.24), transparent 42%),
    linear-gradient(170deg, rgba(24, 36, 58, 0.95), rgba(12, 19, 32, 0.96));
  box-shadow:
    0 10px 22px rgba(2, 7, 14, 0.52),
    0 0 0 1px rgba(117, 194, 255, 0.16);
}

body.native-app #screen-game .hud-left {
  box-shadow: 0 8px 20px rgba(2, 7, 14, 0.44);
}

#screen-game .hud-label,
#screen-game .hud-time,
#screen-game .hud-player,
#screen-game .game-stage-info {
  text-shadow:
    0 1px 0 rgba(3, 7, 14, 0.88),
    0 0 8px rgba(112, 195, 255, 0.14);
}

#screen-game .pause-btn {
  border: 1px solid rgba(146, 220, 255, 0.58);
  color: #eff8ff;
  background:
    radial-gradient(circle at 28% 22%, rgba(233, 245, 255, 0.16), transparent 42%),
    linear-gradient(172deg, rgba(28, 43, 68, 0.96), rgba(13, 21, 35, 0.98));
  box-shadow:
    inset 0 -1px 0 rgba(9, 14, 23, 0.4),
    0 10px 18px rgba(3, 8, 16, 0.46),
    0 0 12px rgba(122, 200, 255, 0.16);
}

body.native-app #screen-game .pause-btn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    inset 0 -1px 0 rgba(9, 14, 23, 0.24),
    0 7px 14px rgba(3, 8, 16, 0.36);
}

#screen-game .game-stage-info {
  border: 0;
  background: none;
  color: #f5fbff;
}

#screen-game .controls.in-canvas .ctrl-btn {
  border: 1px solid rgba(146, 221, 255, 0.32);
  background:
    radial-gradient(circle at 34% 24%, rgba(228, 243, 255, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(57, 83, 127, 0.22), rgba(31, 45, 74, 0.18));
  box-shadow:
    inset 0 -1px 0 rgba(8, 14, 24, 0.26),
    0 8px 16px rgba(1, 6, 12, 0.38),
    0 0 18px rgba(110, 194, 255, 0.14);
}

body.native-app #screen-game .controls.in-canvas .ctrl-btn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    inset 0 -1px 0 rgba(8, 14, 24, 0.18),
    0 6px 12px rgba(1, 6, 12, 0.28);
}

#screen-game .controls.in-canvas #leftBtn::before,
#screen-game .controls.in-canvas #rightBtn::before {
  border-top-color: rgba(236, 247, 255, 0.86);
  border-right-color: rgba(236, 247, 255, 0.86);
}

#screen-game .pause-overlay,
#screen-game .clear-overlay,
#screen-game .gameover-overlay {
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(10px);
}

body.native-app #screen-game .pause-overlay,
body.native-app #screen-game .clear-overlay,
body.native-app #screen-game .gameover-overlay {
  background: rgba(4, 8, 16, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#screen-game .pause-card,
#screen-game .clear-card,
#screen-game .gameover-card {
  border: 1px solid rgba(160, 214, 255, 0.5);
  box-shadow:
    0 20px 44px rgba(2, 6, 14, 0.7),
    0 0 0 1px rgba(114, 193, 255, 0.16);
}

#screen-game .pause-card {
  background:
    radial-gradient(circle at 96% -18%, rgba(147, 206, 255, 0.24), transparent 40%),
    linear-gradient(164deg, #1a2a43, #0f1829 72%);
}

#screen-game .clear-card {
  background:
    radial-gradient(circle at 96% -18%, rgba(132, 255, 217, 0.22), transparent 42%),
    linear-gradient(164deg, #162b42, #0d1827 72%);
}

body.native-app #screen-game .clear-card {
  width: min(84vw, 336px);
  padding: 14px;
}

body.native-app #screen-game .clear-title {
  margin: 6px 0 8px;
  font-size: 23px;
}

body.native-app #screen-game .clear-star-text {
  margin: 6px 0 8px;
  font-size: 24px;
}

body.native-app #screen-game .clear-stats {
  padding: 8px 10px;
  gap: 4px;
}

body.native-app #screen-game .clear-stats p {
  font-size: 12px;
}

body.native-app #screen-game .clear-stats strong {
  font-size: 14px;
}

body.native-app #screen-game .clear-rules {
  margin-top: 8px;
  font-size: 12px;
  gap: 2px;
}

body.native-app #screen-game .clear-actions {
  margin-top: 10px;
  gap: 8px;
}

#screen-game .gameover-card {
  border-color: rgba(238, 157, 220, 0.48);
  background:
    radial-gradient(circle at 96% -18%, rgba(255, 166, 222, 0.18), transparent 42%),
    linear-gradient(164deg, #2a1d3c, #170f24 72%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .lobby,
  .game-wrap {
    padding: 12px;
  }

  .stage-hub {
    padding: 14px;
  }

  #screen-stage {
    height: calc(100dvh - 20px);
  }

  #screen-stage .stage-hub {
    padding: 0;
  }

  #screen-stage .solar-viewport {
    min-height: 0;
  }

  .chapter-quick-select {
    top: clamp(86px, 17vw, 118px);
    width: min(72%, 520px);
  }

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

  .poster-layout .chapter-quick-select {
    top: clamp(86px, 17vw, 118px);
    left: 10px;
    right: auto;
    width: min(72%, 520px);
    max-width: calc(100% - 20px);
  }

  .poster-layout .stage-node-name {
    font-size: clamp(12px, 2.1vw, 19px);
  }

  .poster-layout .stage-node-en {
    font-size: clamp(9px, 1.4vw, 14px);
  }

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

  #screen-mapselect .stage-grid {
    padding: 10px;
    border-radius: 16px;
  }

  .map-card {
    flex-basis: min(90vw, 520px);
  }

  .map-title {
    font-size: 24px;
  }

  .game-hudbar {
    top: 8px;
    left: 8px;
    right: 8px;
    height: 116px;
  }

  .hud-left {
    min-width: 0;
    right: 58px;
    padding-right: 8px;
  }

  .hud-life {
    top: 54px;
    left: 0;
    padding: 6px 11px;
    font-size: 18px;
  }

  .pause-btn {
    top: clamp(9px, calc(14px * var(--game-ui-scale)), 15px);
  }

  .game-stage-info {
    top: var(--stage-info-top);
    font-size: var(--stage-info-font-size);
    padding: var(--stage-info-padding-y) var(--stage-info-padding-x);
  }

  .controls.in-canvas {
    bottom: var(--ctrl-bottom-offset);
  }
}

@media (max-width: 520px) {
  .stage-hub {
    padding: 10px;
  }

  #screen-stage {
    height: calc(100dvh - 12px);
  }

  #screen-stage .stage-hub {
    padding: 0;
  }

  #screen-stage .stage-head {
    top: 6px;
    left: 6px;
    right: auto;
    width: min(88%, 420px);
    max-width: calc(100% - 12px);
    padding: 7px 9px;
  }

  #screen-stage .poster-layout .stage-head {
    width: min(94%, 440px);
  }

  .language-switch {
    top: 6px;
    right: 6px;
    gap: 4px;
  }

  .stage-daily-visitors-badge {
    top: 40px;
    right: 6px;
  }

  .daily-visitors-badge {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .daily-visitors-badge strong {
    font-size: 13px;
  }

  .lang-btn {
    min-width: 66px;
    height: 28px;
    font-size: 11px;
  }

  .chapter-quick-select {
    top: 76px;
    left: 6px;
    width: min(92%, 430px);
    max-width: calc(100% - 12px);
  }

  .poster-layout .chapter-quick-select {
    top: 76px;
    left: 6px;
    right: auto;
    bottom: auto;
    width: min(92%, 430px);
    max-width: calc(100% - 12px);
    z-index: 12;
  }

  .chapter-quick-toggle {
    height: 36px;
    font-size: 12px;
  }

  .chapter-quick-panel {
    border-radius: 10px;
  }

  .chapter-quick-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .chapter-quick-chip {
    min-height: 46px;
    padding: 6px 7px;
  }

  .chapter-quick-chip-name {
    font-size: 11px;
  }

  .chapter-quick-chip-sub {
    font-size: 8px;
  }

  #screen-stage .stage-head h1 {
    margin: 2px 0 1px;
    font-size: clamp(18px, 5.6vw, 24px);
  }

  #screen-stage .stage-kicker {
    font-size: 10px;
  }

  #screen-stage .stage-subtext {
    font-size: 10px;
  }

  #screen-stage .solar-viewport {
    min-height: 0;
  }

  .sun-core span {
    font-size: 10px;
  }

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

  #screen-mapselect .stage-grid {
    padding: 8px;
    border-radius: 14px;
  }

  .stage-chip {
    min-height: 74px;
    padding: 8px 9px 7px;
    font-size: 13px;
  }

  .stage-chip-meta {
    font-size: 11px;
  }

  .poster-layout .chapter-focus-hud {
    display: none;
  }

}

@media (max-width: 820px) {
  #screen-game .game-wrap {
    padding: 0;
  }

  #screen-game .game-viewport {
    border-radius: 0;
  }
}

@media (pointer: coarse), (max-width: 820px) {
  body.nickname-gate {
    min-height: 100vh;
    min-height: 100svh;
  }

  body.nickname-gate::before {
    display: none;
  }

  body.nickname-gate #screen-nickname {
    width: 100vw !important;
    padding:
      max(12px, env(safe-area-inset-top, 0px))
      12px
      max(12px, env(safe-area-inset-bottom, 0px));
  }

  #screen-nickname::before,
  #screen-nickname::after {
    display: none;
  }

  #screen-nickname .modal-card {
    width: 100%;
    padding: 20px 16px 18px;
    border-radius: 18px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
      0 18px 40px rgba(4, 9, 17, 0.56),
      0 0 0 1px rgba(126, 199, 255, 0.18);
  }

  #screen-nickname .modal-card h2 {
    font-size: clamp(24px, 8vw, 30px);
  }

  #screen-nickname .modal-desc,
  #screen-nickname .nickname-error {
    font-size: 13px;
  }

  #screen-nickname .nickname-input {
    height: 48px;
    font-size: 16px;
  }

  #screen-nickname .primary-btn,
  #screen-nickname .secondary-btn {
    height: 46px;
    font-size: 14px;
  }

  #screen-stage {
    width: 100%;
    height: auto;
    min-height: calc(100svh - 24px);
    max-height: none;
  }

  #screen-stage .stage-hub {
    display: block;
    height: auto;
  }

  #screen-stage .solar-viewport {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100svh - 24px);
    padding: 12px;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #screen-stage .stage-head {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: none;
    padding: 10px 12px;
    pointer-events: auto;
  }

  #screen-stage .language-switch {
    position: relative;
    top: auto;
    right: auto;
    align-self: flex-end;
    gap: 6px;
  }

  #screen-stage .stage-daily-visitors-badge {
    position: relative;
    top: auto;
    right: auto;
    align-self: flex-end;
    z-index: 16;
  }

  #screen-stage .chapter-quick-select {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: none;
    gap: 0;
  }

  #screen-stage .chapter-quick-toggle {
    display: none;
  }

  #screen-stage .chapter-quick-panel {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-height: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    pointer-events: auto;
    contain: none;
    transition: none;
  }

  #screen-stage .chapter-quick-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #screen-stage .chapter-quick-chip {
    min-height: 58px;
    padding: 10px 11px;
  }

  #screen-stage .chapter-quick-chip-name {
    font-size: 12px;
  }

  #screen-stage .chapter-quick-chip-sub {
    margin-top: 4px;
    font-size: 10px;
  }

  #screen-stage .space-stars,
  #screen-stage .space-nebula,
  #screen-stage .sun-halo,
  #screen-stage .orbit-line,
  #screen-stage .solar-scene::before,
  #screen-stage .solar-scene {
    display: none !important;
  }

  #screen-stage .stage-node,
  #screen-stage .stage-node::before,
  #screen-stage .planet-sunchapter,
  #screen-stage .planet-sunchapter::before,
  #screen-stage .planet-sunchapter::after {
    animation: none !important;
    transition: none !important;
  }

  body.native-app #screen-stage {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    max-height: none;
    overflow: hidden;
  }

  body.native-app #screen-stage .stage-hub {
    display: block;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  body.native-app #screen-stage .stage-scroll-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.native-app #screen-stage .stage-hero-frame {
    min-height: 100svh;
    height: 100svh;
    padding: 0;
    display: block;
    position: relative;
  }

  body.native-app #screen-stage .solar-viewport {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  body.native-app #screen-stage .stage-head {
    position: absolute;
    top: 16px;
    left: 16px;
    right: auto;
    width: min(44%, 520px);
    max-width: calc(100% - 32px);
    padding: 10px 12px;
    pointer-events: none;
    z-index: 6;
    background: linear-gradient(180deg, rgba(8, 14, 24, 0.88), rgba(5, 9, 16, 0.92));
    backdrop-filter: none;
  }

  body.native-app #screen-stage .language-switch {
    position: absolute;
    top: 12px;
    right: 12px;
    align-self: auto;
    gap: 6px;
    max-width: min(62vw, 520px);
    z-index: 16;
  }

  body.native-app #screen-stage .stage-daily-visitors-badge {
    position: absolute;
    top: 52px;
    right: 12px;
  }

  body.native-app #screen-stage .lang-btn {
    min-width: 74px;
    height: 32px;
    font-size: 12px;
  }

  body.native-app #screen-stage .utility-btn {
    min-width: 58px;
  }

  body.native-app #screen-stage .chapter-quick-select {
    position: absolute;
    top: var(--stage-overlay-top, 136px);
    left: var(--stage-overlay-left, 16px);
    right: auto;
    width: min(var(--stage-overlay-width, 520px), calc(100% - 32px));
    max-width: calc(100% - 32px);
    gap: 8px;
    z-index: 30;
    isolation: isolate;
  }

  body.native-app #screen-stage .chapter-quick-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    height: 38px;
    font-size: 13px;
    transform: none !important;
  }

  body.native-app #screen-stage .chapter-quick-toggle:hover {
    transform: none;
    border-color: rgba(153, 188, 236, 0.56);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
  }

  body.native-app #screen-stage .chapter-quick-select.is-open .chapter-quick-toggle {
    border-color: rgba(172, 214, 255, 0.86);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(147, 206, 255, 0.16);
    transform: none;
  }

  body.native-app #screen-stage .chapter-quick-panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    width: 100%;
    max-height: min(46svh, 360px);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(141, 176, 222, 0.36);
    background:
      radial-gradient(circle at 92% -18%, rgba(122, 190, 255, 0.18), transparent 40%),
      linear-gradient(170deg, rgba(10, 17, 28, 0.94), rgba(7, 12, 20, 0.96));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
    transform: translate3d(0, -8px, 0) scale(0.992);
    pointer-events: none;
    contain: layout paint;
    will-change: transform, opacity;
    z-index: 31;
    transition:
      opacity 150ms ease,
      transform 190ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 190ms;
  }

  body.native-app #screen-stage .chapter-quick-select.is-open .chapter-quick-panel {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
    pointer-events: auto;
    transition:
      opacity 150ms ease,
      transform 190ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  body.native-app #screen-stage .chapter-quick-list {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-height: min(42svh, 332px);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 32;
  }

  body.native-app #screen-stage .chapter-quick-chip {
    position: relative;
    box-shadow: inset 0 -2px 0 rgba(8, 13, 21, 0.38), 0 3px 8px rgba(0, 0, 0, 0.16);
    z-index: 33;
  }

  body.native-app #screen-stage .chapter-quick-scroll-panel {
    display: block;
    position: absolute;
    top: calc(var(--stage-overlay-top, 136px) + 46px);
    left: var(--stage-overlay-left, 16px);
    width: min(var(--stage-overlay-width, 520px), calc(100% - 32px));
    max-width: calc(100% - 32px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, -8px, 0) scale(0.992);
    z-index: 32;
    transition:
      opacity 150ms ease,
      transform 190ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 190ms;
  }

  body.native-app #screen-stage .chapter-quick-scroll-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    transition:
      opacity 150ms ease,
      transform 190ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  body.native-app #screen-stage .chapter-quick-scroll-card {
    position: relative;
    width: 100%;
    max-height: min(46svh, 360px);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(141, 176, 222, 0.34);
    background:
      radial-gradient(circle at 88% -18%, rgba(122, 190, 255, 0.16), transparent 40%),
      linear-gradient(170deg, rgba(10, 17, 28, 0.94), rgba(7, 12, 20, 0.96));
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26);
    overflow: hidden;
  }

  body.native-app #screen-stage .chapter-quick-scroll-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
      radial-gradient(circle at 12% 0%, rgba(119, 232, 255, 0.12), transparent 34%);
  }

  body.native-app #screen-stage .chapter-quick-scroll-list {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-height: min(42svh, 332px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0;
  }

  body.native-app #screen-stage .space-stars,
  body.native-app #screen-stage .space-nebula,
  body.native-app #screen-stage .sun-halo,
  body.native-app #screen-stage .orbit-line,
  body.native-app #screen-stage .solar-scene {
    display: block !important;
  }

  body.native-app #screen-stage .solar-scene::before {
    display: block !important;
  }

  body.native-app #screen-stage .solar-scene,
  body.native-app #screen-stage .orbit-item,
  body.native-app #screen-stage .stage-node,
  body.native-app #screen-stage .sun-halo,
  body.native-app #screen-stage .space-stars,
  body.native-app #screen-stage .space-nebula {
    contain: paint;
    backface-visibility: hidden;
  }

  body.native-app #screen-stage .orbit-item,
  body.native-app #screen-stage .space-stars,
  body.native-app #screen-stage .space-nebula,
  body.native-app #screen-stage .sun-halo {
    will-change: auto;
  }

  body.native-app #screen-stage .stage-node {
    will-change: transform;
  }

  body.native-app #screen-stage .orbit-line ellipse {
    stroke-width: 1.08;
    filter: none;
  }

  body.native-app #screen-stage .space-stars {
    opacity: 0.42;
  }

  body.native-app #screen-stage .nebula-a {
    opacity: 0.54;
    filter: blur(1px);
  }

  body.native-app #screen-stage .nebula-b {
    opacity: 0.48;
    filter: blur(1.2px);
  }

  body.native-app #screen-stage .solar-scene::before {
    filter: blur(6px);
    opacity: 0.42;
  }

  body.native-app #screen-stage .sun-halo {
    filter: blur(6px);
  }

  body.native-app #screen-stage .sun-halo::after {
    opacity: 0.66;
    filter: blur(16px);
    animation: none;
  }

  body.native-app #screen-stage .stage-node:not(.planet-saturn) {
    box-shadow:
      0 8px 16px rgba(0, 0, 0, 0.34),
      0 0 12px rgba(120, 176, 255, 0.1),
      inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  body.native-app #screen-stage .planet-saturn {
    contain: none !important;
    z-index: 5;
  }

  body.native-app #screen-stage .planet-saturn::before {
    left: 53%;
    top: 52%;
    right: auto;
    bottom: auto;
    width: 270%;
    height: 132%;
    transform: translate(-50%, -50%);
  }

  body.native-app #screen-stage .stars-a {
    animation: none;
  }

  body.native-app #screen-stage .stars-b {
    animation: none;
  }

  body.native-app #screen-stage .sun-halo::before {
    animation: none;
    opacity: 0.56;
  }

  body.native-app #screen-stage.is-quick-panel-open .space-stars,
  body.native-app #screen-stage.is-quick-panel-open .space-nebula,
  body.native-app #screen-stage.is-quick-panel-open .sun-halo::after {
    opacity: 0.18;
  }

  body.native-app #screen-stage.is-quick-panel-open .solar-scene {
    pointer-events: none;
  }

  body.native-app #screen-stage.is-quick-panel-open .orbit-line ellipse {
    stroke: rgba(228, 236, 248, 0.28);
  }

  #screen-mapselect .lobby {
    --map-top-controls-space: 150px;
    margin-top: 0;
    padding: var(--map-top-controls-space) 12px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
    backdrop-filter: none;
  }

  #screen-mapselect .lobby::before {
    animation: none;
    filter: blur(4px);
    opacity: 0.58;
  }

  #screen-mapselect .lobby::after {
    animation: none;
    opacity: 0.2;
  }

  #screen-mapselect .lobby-head {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding-right: 0;
  }

  #screen-mapselect .lobby-head-actions {
    position: absolute;
    top: calc(-1 * var(--map-top-controls-space) + 12px);
    right: 12px;
    justify-content: flex-start;
    width: auto;
  }

  #screen-mapselect .lobby-head-actions .stage-back-btn {
    flex: 0 0 auto;
    min-width: 100px;
  }

  #screen-mapselect .map-utility-switch {
    position: absolute !important;
    top: 104px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    width: max-content;
    max-width: calc(100% - 24px);
    margin-left: 0 !important;
    transform: none !important;
  }

  #screen-mapselect .map-daily-visitors-badge {
    position: absolute;
    top: 62px;
    right: 12px;
  }

  #screen-mapselect .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #screen-mapselect .stage-chip {
    min-height: 82px;
    box-shadow:
      inset 0 -2px 0 rgba(7, 11, 21, 0.58),
      inset 0 1px 0 rgba(194, 234, 255, 0.14),
      0 10px 18px rgba(2, 6, 14, 0.5);
  }

  #screen-mapselect .map-confirm {
    align-items: end;
    padding: 10px;
    backdrop-filter: none;
  }

  #screen-mapselect .map-confirm-card,
  .map-confirm.map-confirm-portal .map-confirm-card {
    width: min(100%, 560px);
    max-height: calc(100svh - 20px);
    overflow: auto;
    padding: 14px;
    border-radius: 16px;
  }

  #screen-mapselect .map-preview,
  .map-confirm.map-confirm-portal .map-preview {
    height: clamp(96px, 28svh, 150px);
    margin: 6px 0 8px;
    object-fit: contain;
  }

  #screen-mapselect .timeattack-box,
  .map-confirm.map-confirm-portal .timeattack-box {
    margin-top: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  #screen-mapselect .timeattack-head,
  .map-confirm.map-confirm-portal .timeattack-head {
    margin-bottom: 6px;
  }

  #screen-mapselect .timeattack-title,
  .map-confirm.map-confirm-portal .timeattack-title {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  #screen-mapselect .timeattack-list,
  .map-confirm.map-confirm-portal .timeattack-list {
    max-height: min(32svh, 210px);
    gap: 5px;
  }

  #screen-mapselect .map-confirm-actions,
  .map-confirm.map-confirm-portal .map-confirm-actions {
    grid-template-columns: 1fr;
  }

  .hub-item-grid {
    grid-template-columns: 1fr;
  }

  .hub-section-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  #screen-mapselect .timeattack-row,
  .map-confirm.map-confirm-portal .timeattack-row {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    column-gap: 8px;
    padding: 6px 8px;
    font-size: 12px;
  }

  #screen-mapselect .timeattack-list strong,
  .map-confirm.map-confirm-portal .timeattack-list strong {
    font-size: 14px;
  }

  #screen-mapselect .timeattack-row.is-message,
  .map-confirm.map-confirm-portal .timeattack-row.is-message {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #screen-game.screen {
    height: 100svh;
  }

  #screen-game .canvas-wrap {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #screen-game .game-viewport {
    --pause-btn-size: clamp(36px, 11vw, 48px);
    --pause-btn-radius: clamp(12px, 4vw, 16px);
    --pause-btn-font-size: clamp(13px, 4vw, 17px);
    --pause-btn-top: max(6px, env(safe-area-inset-top, 0px));
    --stage-info-font-size: clamp(10px, 2.9vw, 13px);
    --stage-info-padding-y: 0px;
    --stage-info-padding-x: 0px;
    --stage-info-top: max(8px, env(safe-area-inset-top, 0px));
    --ctrl-btn-size: clamp(78px, 24vw, 112px);
    --ctrl-btn-offset: 8px;
    --ctrl-bottom-offset: max(10px, env(safe-area-inset-bottom, 0px));
    --ctrl-arrow-size: clamp(14px, 4.5vw, 20px);
    --ctrl-arrow-stroke: clamp(2px, 0.9vw, 3px);
  }

  #screen-game .game-hudbar {
    top: max(6px, env(safe-area-inset-top, 0px));
    left: 6px;
    right: 6px;
    height: 94px;
  }

  #screen-game .hud-left {
    min-width: 0;
    width: min(72%, 232px);
    padding: 8px 10px 7px;
    border-radius: 12px;
  }

  #screen-game .hud-time {
    font-size: clamp(18px, 5vw, 22px);
  }

  #screen-game .hud-player {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }

  #screen-game .hud-life {
    top: 64px;
    left: 6px;
    padding: 6px 10px;
    font-size: 16px;
  }

  #screen-game .game-stage-info {
    max-width: calc(100vw - 128px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #screen-game .controls.in-canvas {
    height: var(--ctrl-btn-size);
  }

  #screen-game .controls.in-canvas .ctrl-btn {
    backdrop-filter: none;
    background:
      radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.06), transparent 44%),
      linear-gradient(180deg, rgba(62, 92, 140, 0.18), rgba(28, 41, 66, 0.16));
  }

  #screen-game .pause-card,
  #screen-game .clear-card,
  #screen-game .gameover-card {
    width: min(100%, 360px);
    padding: 16px 14px;
  }

  #screen-game .pause-actions,
  #screen-game .clear-actions,
  #screen-game .gameover-actions {
    grid-template-columns: 1fr;
  }

  #screen-game .ad-revive-banner {
    min-height: 46px;
    height: auto;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.3;
  }

  body.native-app #screen-game.screen {
    width: 100%;
    height: 100svh;
  }

  body.native-app #screen-game .canvas-wrap {
    padding: 0;
  }

  body.native-app #screen-game .game-viewport {
    --pause-btn-size: clamp(30px, 7vw, 38px);
    --pause-btn-radius: clamp(10px, 2.8vw, 14px);
    --pause-btn-font-size: clamp(11px, 2.8vw, 14px);
    --pause-btn-top: 4px;
    --stage-info-font-size: clamp(9px, 2.2vw, 11px);
    --stage-info-padding-y: 0px;
    --stage-info-padding-x: 0px;
    --stage-info-top: 6px;
    --ctrl-btn-size: clamp(56px, 13vw, 70px);
    --ctrl-btn-offset: 4px;
    --ctrl-bottom-offset: max(4px, env(safe-area-inset-bottom, 0px));
    --ctrl-arrow-size: clamp(11px, 2.8vw, 15px);
    --ctrl-arrow-stroke: clamp(2px, 0.65vw, 2.5px);
  }

  body.native-app #screen-game .game-hudbar {
    top: 4px;
    left: 4px;
    right: 4px;
    height: 72px;
  }

  body.native-app #screen-game .hud-left {
    width: min(60%, 186px);
    padding: 6px 8px 5px;
    border-radius: 10px;
  }

  body.native-app #screen-game .hud-label {
    font-size: 9px;
  }

  body.native-app #screen-game .hud-time {
    margin: 2px 0 1px;
    font-size: clamp(15px, 3.8vw, 18px);
  }

  body.native-app #screen-game .hud-player {
    font-size: 9px;
  }

  body.native-app #screen-game .hud-life {
    top: 56px;
    left: 4px;
    padding: 4px 8px;
    font-size: 14px;
  }

  body.native-app #screen-game .pause-btn {
    right: 0;
  }

  body.native-app #screen-game .game-stage-info {
    max-width: calc(100vw - 92px);
    font-size: clamp(9px, 2.2vw, 11px);
  }

  body.native-app #screen-game .controls.in-canvas {
    height: var(--ctrl-btn-size);
  }

  body.native-app #screen-game .controls.in-canvas .ctrl-btn {
    opacity: 0.86;
  }

  body.native-app #screen-game .controls.in-canvas #leftBtn {
    left: max(4px, env(safe-area-inset-left, 0px));
  }

  body.native-app #screen-game .controls.in-canvas #rightBtn {
    right: max(4px, env(safe-area-inset-right, 0px));
  }
}

@keyframes mapselect-nebula-drift {
  0% {
    transform: translate3d(-1.8%, -0.8%, 0) scale(1);
  }
  100% {
    transform: translate3d(1.6%, 1.1%, 0) scale(1.04);
  }
}

@keyframes mapselect-grid-pan {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, 30px, 0);
  }
}

@keyframes stars-twinkle-a {
  0%,
  100% {
    opacity: 0.68;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes stars-twinkle-b {
  0%,
  100% {
    opacity: 0.46;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes sun-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0.84;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.98;
  }
}

@keyframes solar-flare {
  from {
    transform: scale(1.14) rotate(0deg);
  }
  to {
    transform: scale(1.14) rotate(360deg);
  }
}

@keyframes earth-cloud-drift {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes sun-grain-shift {
  from {
    transform: rotate(0deg);
    filter: saturate(1) brightness(1);
  }
  50% {
    transform: rotate(180deg);
    filter: saturate(1.12) brightness(1.04);
  }
  to {
    transform: rotate(360deg);
    filter: saturate(1) brightness(1);
  }
}

@keyframes sun-surface-roll {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.03);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes sun-core-flicker {
  0%,
  100% {
    opacity: 0.94;
    filter: saturate(1.12) brightness(1.04) contrast(1.18);
  }
  50% {
    opacity: 1;
    filter: saturate(1.18) brightness(1.08) contrast(1.24);
  }
}

@keyframes sun-texture-drift {
  0% {
    background-position: 50% 50%;
  }
  50% {
    background-position: 50% 50%;
  }
  100% {
    background-position: 50% 50%;
  }
}


@keyframes orbit-line-shift {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -220;
  }
}

@keyframes space-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-54px, -30px, 0);
  }
}

@keyframes screen-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
