:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #050819;
  color: #f4f7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050819;
}

body {
  display: grid;
  place-items: center;
}

button {
  font: inherit;
}

#app {
  position: relative;
  width: min(100vw, 480px);
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: #070b1f;
  isolation: isolate;
  touch-action: none;
}

@media (min-width: 620px) {
  #app {
    height: min(100dvh, 900px);
    border: 1px solid rgba(85, 245, 255, 0.14);
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.46);
  }
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}

.start-screen,
.hud,
.stage-panel,
.settings-panel,
.result-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.start-screen {
  display: grid;
  grid-template-rows: 1fr auto 150px;
  align-items: center;
  justify-items: center;
  padding: max(34px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  text-align: center;
  opacity: 1;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.start-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

.start-copy {
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.start-copy h1 {
  margin: 0;
  color: #54f3ff;
  font-size: clamp(54px, 16vw, 78px);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    0 0 12px rgba(84, 243, 255, 0.96),
    0 0 28px rgba(84, 243, 255, 0.52);
}

.subtitle {
  margin: 0;
  color: rgba(244, 247, 255, 0.78);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 16px rgba(244, 247, 255, 0.24);
}

.start-guide {
  display: grid;
  gap: 18px;
  margin-top: clamp(48px, 11dvh, 86px);
  color: #f4f7ff;
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(5, 8, 25, 0.8);
}

.start-guide p {
  margin: 0;
}

.start-actions {
  pointer-events: auto;
  align-self: start;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.start-button,
.ghost-button {
  pointer-events: auto;
  min-width: min(74vw, 238px);
  height: 74px;
  padding: 0 28px;
  font-size: clamp(18px, 5vw, 21px);
  font-weight: 950;
  letter-spacing: 0;
  border: 0;
  border-radius: 999px;
}

.start-button {
  color: #071127;
  background: #54f3ff;
  box-shadow:
    inset 0 -7px 0 rgba(6, 96, 121, 0.2),
    0 0 18px rgba(84, 243, 255, 0.65),
    0 18px 42px rgba(3, 8, 24, 0.48);
}

.start-button:active {
  transform: translateY(3px) scale(0.985);
  box-shadow:
    inset 0 -3px 0 rgba(6, 96, 121, 0.22),
    0 0 14px rgba(84, 243, 255, 0.55),
    0 10px 26px rgba(3, 8, 24, 0.46);
}

.ghost-button {
  color: #54f3ff;
  height: 48px;
  border: 1px solid rgba(84, 243, 255, 0.38);
  background: rgba(7, 17, 39, 0.58);
  box-shadow:
    inset 0 0 18px rgba(84, 243, 255, 0.06),
    0 0 20px rgba(84, 243, 255, 0.16);
}

.ghost-button:active {
  transform: translateY(2px) scale(0.985);
}

.daily-button {
  color: #ffd84f;
  border-color: rgba(255, 216, 79, 0.46);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 79, 0.13), transparent 62%),
    rgba(7, 17, 39, 0.58);
}

.daily-copy,
.mastery-copy {
  margin: -1px 0 3px;
  color: rgba(244, 247, 255, 0.62);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 2px 12px rgba(3, 8, 24, 0.8);
}

.mastery-copy {
  margin-top: -5px;
  color: rgba(255, 216, 79, 0.86);
}

.ghost-button.danger {
  color: #ff91b7;
  border-color: rgba(255, 93, 151, 0.46);
  box-shadow:
    inset 0 0 18px rgba(255, 93, 151, 0.08),
    0 0 20px rgba(255, 93, 151, 0.14);
}

.compact {
  min-width: min(68vw, 220px);
  height: 58px;
  font-size: 18px;
}

.hud {
  inset: max(38px, env(safe-area-inset-top)) 20px auto;
  height: 78px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: opacity 160ms ease;
}

.hud.is-hidden {
  opacity: 0;
}

.hud-left,
.hud-right {
  display: grid;
  gap: 9px;
}

.hud-right {
  justify-items: end;
  text-align: right;
}

.hud-topline {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.hud-main {
  color: #f4f7ff;
  font-size: clamp(18px, 5vw, 23px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.92;
  text-shadow: 0 2px 12px rgba(3, 8, 24, 0.85);
}

.hud-sub {
  color: rgba(244, 247, 255, 0.64);
  font-size: clamp(12px, 3.3vw, 14px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(3, 8, 24, 0.85);
}

.cyan {
  color: #54f3ff;
}

.hot {
  color: #ff5d97;
}

.mini-button,
.icon-button,
.hud-settings-button {
  pointer-events: auto;
  color: #071127;
  border: 0;
  background: #54f3ff;
  box-shadow: 0 0 18px rgba(84, 243, 255, 0.34);
}

.mini-button {
  width: 76px;
  height: 26px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.hud-settings-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f4f7ff;
  font-size: 22px;
  font-weight: 950;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(180deg, rgba(84, 243, 255, 0.34), rgba(8, 18, 43, 0.92));
  border: 1px solid rgba(84, 243, 255, 0.62);
  text-shadow: 0 2px 10px rgba(3, 8, 24, 0.8);
}

.hud-settings-button:active {
  transform: translateY(2px) scale(0.96);
}

.stage-panel,
.settings-panel,
.result-panel {
  z-index: 3;
  padding: max(34px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(5, 8, 25, 0.88), rgba(5, 8, 25, 0.96)),
    radial-gradient(circle at 50% 28%, rgba(84, 243, 255, 0.14), transparent 48%);
  backdrop-filter: blur(12px);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 170ms ease,
    transform 170ms ease,
    visibility 170ms ease;
}

.stage-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
  pointer-events: auto;
}

.settings-panel {
  z-index: 4;
  display: grid;
  place-items: center;
  padding-inline: 24px;
  pointer-events: auto;
}

.settings-card {
  width: min(100%, 340px);
  display: grid;
  gap: 22px;
  padding: 24px 20px;
  border: 1px solid rgba(84, 243, 255, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(84, 243, 255, 0.13), transparent 56%),
    rgba(8, 18, 43, 0.9);
  box-shadow:
    inset 0 0 30px rgba(84, 243, 255, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.38);
}

.settings-stage {
  margin: 0;
  color: rgba(244, 247, 255, 0.7);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
}

.settings-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.result-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 36px;
  text-align: center;
  pointer-events: auto;
}

.stage-panel.is-hidden,
.settings-panel.is-hidden,
.result-panel.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
}

.stage-panel:not(.is-hidden),
.settings-panel:not(.is-hidden),
.result-panel:not(.is-hidden) {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.stage-panel,
.settings-panel,
.result-panel {
  transition: none !important;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-kicker {
  margin: 0 0 5px;
  color: #ff5d97;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.panel-summary {
  margin: 9px 0 0;
  color: rgba(255, 216, 79, 0.82);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}

.panel-top h2,
.result-copy h2 {
  margin: 0;
  color: #54f3ff;
  font-size: clamp(38px, 12vw, 58px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow:
    0 0 12px rgba(84, 243, 255, 0.78),
    0 0 30px rgba(84, 243, 255, 0.36);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 2px 0 18px;
}

.stage-card {
  position: relative;
  min-height: 112px;
  padding: 12px 10px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  color: #f4f7ff;
  text-align: left;
  border: 1px solid rgba(84, 243, 255, 0.22);
  border-radius: 8px;
  background: rgba(8, 18, 43, 0.76);
  box-shadow:
    inset 0 0 24px rgba(84, 243, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.24);
}

.stage-card.is-selected {
  border-color: rgba(84, 243, 255, 0.86);
  box-shadow:
    inset 0 0 26px rgba(84, 243, 255, 0.13),
    0 0 18px rgba(84, 243, 255, 0.34);
}

.stage-card.is-cleared {
  border-color: rgba(255, 216, 79, 0.5);
}

.stage-card.is-mastered {
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 216, 79, 0.16), transparent 42%),
    rgba(8, 18, 43, 0.78);
}

.stage-number {
  color: #54f3ff;
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
}

.stage-meta,
.stage-tag,
.stage-stamps {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.15;
}

.stage-meta {
  color: rgba(244, 247, 255, 0.66);
}

.stage-tag {
  width: fit-content;
  padding: 5px 7px;
  color: #071127;
  border-radius: 999px;
  background: #ffd84f;
}

.stage-stamps {
  color: rgba(255, 216, 79, 0.88);
}

.result-copy {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.result-copy p {
  margin: 0;
  color: rgba(244, 247, 255, 0.72);
  font-size: 15px;
  font-weight: 950;
}

.stamp-row {
  min-height: 31px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.stamp-pill {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 6px 9px;
  color: #071127;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  border-radius: 999px;
  background: #ffd84f;
  box-shadow:
    inset 0 -3px 0 rgba(105, 63, 0, 0.16),
    0 0 16px rgba(255, 216, 79, 0.26);
}

.stamp-pill.is-new {
  padding-left: 11px;
  padding-right: 11px;
  color: #071127;
  background: #54f3ff;
  box-shadow:
    inset 0 -3px 0 rgba(6, 96, 121, 0.16),
    0 0 18px rgba(84, 243, 255, 0.36);
}

.stamp-pill.is-new::before {
  content: "NEW";
  margin-right: 5px;
  color: rgba(7, 17, 39, 0.72);
}

.stamp-pill.is-empty {
  color: rgba(244, 247, 255, 0.62);
  border: 1px solid rgba(244, 247, 255, 0.2);
  background: rgba(7, 17, 39, 0.42);
  box-shadow: none;
}

.result-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.home-screen {
  grid-template-rows: auto auto 1fr auto auto;
  align-items: stretch;
  justify-items: stretch;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(92px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 53%, rgba(7, 170, 235, 0.48), transparent 25%),
    linear-gradient(180deg, #124f89 0%, #0d5795 38%, #0a4a82 100%);
  text-align: initial;
  pointer-events: auto;
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(255, 255, 255, 0.08) 49.5% 50.5%, transparent 51%),
    radial-gradient(circle at 50% 50%, rgba(35, 195, 255, 0.32), transparent 18%);
  opacity: 0.34;
  pointer-events: none;
}

.home-topbar,
.home-progress,
.home-side,
.home-center,
.home-play-button,
.bottom-nav {
  position: relative;
  z-index: 1;
}

.home-topbar {
  display: grid;
  grid-template-columns: 58px minmax(116px, 1fr) minmax(104px, 0.82fr) 50px;
  align-items: center;
  gap: 7px;
}

.home-avatar,
.settings-button {
  position: relative;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  background:
    radial-gradient(circle at 28% 25%, #fffaaf, transparent 22%),
    linear-gradient(145deg, #f1b263, #764a34);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.22),
    0 3px 0 rgba(0, 0, 0, 0.22);
  color: #fff;
}

.settings-button {
  justify-self: end;
  border-radius: 50%;
  border-color: rgba(156, 232, 255, 0.95);
  background: radial-gradient(circle, #effcff 0 34%, #55b8ec 35% 100%);
  color: #17639d;
  font-size: 27px;
  font-weight: 950;
}

.avatar-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 27px;
  margin: 12px auto 0;
  border-radius: 8px;
  background: #75d6ff;
  color: #315978;
  font-size: 18px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.reward-alert::after,
.notice {
  content: "!";
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
  border-radius: 50%;
  border: 2px solid rgba(115, 0, 0, 0.35);
  background: linear-gradient(#ff5c5c, #d61228);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
}

.reward-alert::after {
  top: -10px;
  right: -12px;
}

.resource-pill {
  position: relative;
  min-width: 0;
  height: 46px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  border-radius: 24px;
  background: linear-gradient(#3b3f55, #252a3f);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.14),
    inset 0 -4px 0 rgba(0, 0, 0, 0.24),
    0 3px 0 rgba(0, 0, 0, 0.22);
}

.resource-icon {
  position: relative;
  left: -4px;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
  border-radius: 50%;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.heart {
  background: linear-gradient(145deg, #ff444d, #bf1838);
}

.coin {
  background: radial-gradient(circle at 36% 30%, #ffef8c, #f7a715 66%, #bf6715 100%);
  color: #bd5e16;
  border: 3px solid #ffd858;
}

.resource-time {
  overflow: hidden;
  padding-right: 12px;
  color: #fff;
  font-size: clamp(16px, 4.9vw, 23px);
  font-weight: 950;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
}

.plus-badge,
.count-badge {
  position: absolute;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #fff;
  font-weight: 950;
  border-radius: 50%;
  background: linear-gradient(#80f95c, #20af25);
  border: 2px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.plus-badge {
  left: 32px;
  bottom: -7px;
}

.home-progress {
  margin-top: 14px;
  height: 78px;
  display: grid;
  grid-template-columns: 54px 1fr 48px;
  align-items: center;
  padding: 0 12px;
  border: 4px solid #c2ddff;
  border-radius: 13px;
  background: linear-gradient(#4c5271, #2c304c);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.26),
    inset 0 -5px 0 rgba(0, 0, 0, 0.22),
    0 3px 0 rgba(0, 0, 0, 0.22);
}

.gem-icon {
  width: 43px;
  height: 43px;
  clip-path: polygon(50% 0, 92% 25%, 76% 83%, 50% 100%, 24% 83%, 8% 25%);
  background: linear-gradient(135deg, #8dff74 0 26%, #16cf2e 27% 68%, #078d39 69%);
  border-radius: 8px;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.22));
}

.progress-track {
  position: relative;
  height: 26px;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(#d8eef4, #7499a6);
  border: 2px solid rgba(32, 42, 68, 0.45);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(#69eaff, #1296c7);
}

.progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.event-bubble {
  position: relative;
  right: -4px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  border-radius: 50%;
  background: linear-gradient(#ff4c61, #ca1738);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.event-bubble b {
  position: absolute;
  right: -9px;
  bottom: -14px;
  font-size: 17px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.time-ribbon {
  position: absolute;
  left: 50%;
  bottom: -21px;
  transform: translateX(-50%);
  min-width: 126px;
  height: 33px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  border-radius: 18px;
  background: linear-gradient(#7cefff, #21a7db);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    0 3px 0 rgba(0, 0, 0, 0.22);
}

.home-side {
  position: absolute;
  top: 226px;
  display: grid;
  gap: 9px;
}

.left-side {
  left: 28px;
}

.right-side {
  right: 10px;
}

.side-reward {
  position: relative;
  width: 68px;
  min-height: 70px;
  padding: 0;
  color: #fff;
  border: 0;
  background: transparent;
  text-align: center;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.26));
}

.side-visual {
  position: relative;
  width: 56px;
  height: 44px;
  margin: 0 auto -4px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  border-radius: 50% 50% 16px 16px;
  border: 3px solid rgba(255, 220, 90, 0.95);
  background: radial-gradient(circle at 36% 24%, #fff58f, #ffb11a 62%, #e4671b);
  box-shadow:
    inset 0 -5px 0 rgba(151, 47, 12, 0.24),
    0 3px 0 rgba(0, 0, 0, 0.18);
}

.side-reward b {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  max-width: 76px;
  padding: 3px 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.05;
  border-radius: 5px;
  background: linear-gradient(#ff8b2d, #d94e18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.notice {
  top: -5px;
  right: 2px;
  z-index: 2;
}

.count-badge {
  top: -3px;
  left: 13px;
  z-index: 2;
}

.sale-label {
  position: absolute;
  top: -9px;
  left: 8px;
  z-index: 2;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  transform: rotate(-10deg);
  text-shadow:
    -2px 0 #4858d6,
    0 2px #4858d6,
    2px 0 #4858d6,
    0 -2px #4858d6;
}

.chest .side-visual {
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(135deg, #ffe45c 0 32%, #e94731 33% 64%, #8d2369 65%);
}

.wheel .side-visual {
  background: conic-gradient(#f64333, #ffd838, #46da62, #41a7ff, #f64333);
}

.dice .side-visual {
  background: radial-gradient(circle at 50% 50%, #fff 0 8%, transparent 9%),
    radial-gradient(circle at 25% 28%, #f33 0 12%, transparent 13%),
    radial-gradient(circle at 70% 70%, #f33 0 12%, transparent 13%),
    linear-gradient(#fff4d3, #ff5c45);
}

.race .side-visual {
  background: linear-gradient(#e6fbff 0 16%, #2bc5ff 17% 50%, #ffcf32 51%);
}

.tent .side-visual {
  background: linear-gradient(135deg, #ff4446 0 46%, #ffe047 47% 54%, #2be084 55%);
}

.gift .side-visual {
  background: linear-gradient(135deg, #5cf36f, #1bb252);
}

.ads .side-visual {
  border-color: rgba(107, 227, 255, 0.95);
  border-radius: 16px;
  background: linear-gradient(#fff, #78d9ff);
  color: #ff7d20;
  font-size: 13px;
}

.home-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.level-orb {
  width: min(44vw, 258px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 50% 78%, rgba(20, 155, 206, 0.5), transparent 54%),
    linear-gradient(180deg, #071d54, #052b50);
  box-shadow:
    0 0 0 36px rgba(27, 184, 238, 0.08),
    0 0 58px rgba(24, 176, 235, 0.45);
}

.level-orb span {
  font-size: clamp(22px, 7vw, 35px);
  font-weight: 950;
  line-height: 1;
}

.level-orb b {
  font-size: clamp(64px, 19vw, 95px);
  font-weight: 950;
  line-height: 0.86;
  letter-spacing: 0;
}

.home-play-button {
  align-self: end;
  justify-self: center;
  width: min(58vw, 300px);
  height: 106px;
  margin-bottom: clamp(18px, 5vh, 44px);
  color: #fff;
  font-size: clamp(36px, 9.2vw, 50px);
  font-weight: 950;
  letter-spacing: 0;
  border: 4px solid rgba(0, 111, 18, 0.55);
  border-radius: 24px;
  background: linear-gradient(#97ff51 0%, #24db17 48%, #05af12 100%);
  text-shadow:
    -2px 0 rgba(25, 85, 28, 0.9),
    0 2px rgba(25, 85, 28, 0.9),
    2px 0 rgba(25, 85, 28, 0.9),
    0 -2px rgba(25, 85, 28, 0.9);
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, 0.32),
    inset 0 -10px 0 rgba(0, 104, 17, 0.24),
    0 8px 0 rgba(0, 74, 24, 0.38);
}

.home-play-button:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.26),
    inset 0 -5px 0 rgba(0, 104, 17, 0.22),
    0 3px 0 rgba(0, 74, 24, 0.38);
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(82px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 3px solid rgba(255, 255, 255, 0.58);
  background: linear-gradient(#74d7ff, #36a9e8);
  box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.22);
}

.bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  color: #fff;
  border: 0;
  background: transparent;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0, 63, 118, 0.65);
}

.bottom-nav button.is-active {
  background: linear-gradient(#ffca3a, #ff9f12);
}

.bottom-nav span {
  font-size: 32px;
  line-height: 1;
}

.bottom-nav b {
  font-size: clamp(11px, 3.3vw, 16px);
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .hud {
    left: 16px;
    right: 16px;
  }

  .start-screen {
    padding-inline: 16px;
  }

  .start-button {
    min-width: min(78vw, 228px);
    height: 68px;
  }

  .ghost-button {
    min-width: min(78vw, 228px);
  }

  .stage-panel,
  .result-panel {
    padding-inline: 16px;
  }

  .stage-grid {
    gap: 8px;
  }

  .stage-card {
    min-height: 104px;
    padding: 10px 8px;
  }

  .home-screen {
    padding-inline: 14px;
  }

  .home-topbar {
    grid-template-columns: 54px 1fr 1fr 46px;
    gap: 7px;
  }

  .home-avatar,
  .settings-button {
    width: 48px;
    height: 48px;
  }

  .resource-pill {
    height: 40px;
    grid-template-columns: 39px 1fr;
  }

  .resource-icon {
    width: 41px;
    height: 41px;
    font-size: 24px;
  }

  .home-side {
    top: 238px;
    gap: 11px;
  }

  .left-side {
    left: 18px;
  }

  .right-side {
    right: 8px;
  }

  .side-reward {
    width: 68px;
    min-height: 79px;
  }

  .side-visual {
    width: 56px;
    height: 48px;
  }

  .side-reward b {
    font-size: 10px;
  }

  .home-play-button {
    height: 104px;
  }
}
