:root {
  --pink: #ff5fac;
  --pink-soft: #ff8fc9;
  --purple: #7d5ce6;
  --purple-deep: #34215f;
  --gold: #ffd34e;
  --blue: #85dcff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #fff7ff;
  --shadow: rgba(55, 39, 122, 0.28);
}

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

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

body {
  color: var(--purple-deep);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 237, 163, 0.95), rgba(255, 192, 222, 0.9) 22%, transparent 48%),
    linear-gradient(160deg, #86b8ff 0%, #f5c5ff 48%, #c7f3ff 100%);
  touch-action: none;
  user-select: none;
}

button {
  appearance: none;
  border: 0;
  color: inherit;
  font: inherit;
}

img {
  max-width: 100%;
}

#app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.desktop-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
}

.desktop-panel {
  display: none;
  position: relative;
  min-height: min(76vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 20%, rgba(255, 248, 186, 0.34), transparent 34%),
    rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 70px rgba(55, 39, 122, 0.16);
}

.desktop-panel-left {
  display: none;
  place-items: center;
}

.desktop-panel-right {
  display: none;
  align-content: center;
  gap: 16px;
  padding: 26px;
}

.panel-cloud,
.panel-gate,
.panel-catie {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.panel-cloud-large {
  width: min(92%, 360px);
  left: -20px;
  bottom: 8%;
  opacity: 0.5;
}

.panel-gate {
  width: min(74%, 300px);
  top: 10%;
  left: 50%;
  opacity: 0.72;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 26px rgba(239, 184, 68, 0.18));
}

.panel-logo {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(42px, 4vw, 70px);
  font-weight: 1000;
  line-height: 0.86;
  text-align: center;
  text-shadow:
    0 5px 0 var(--pink),
    0 -1px 0 #fff,
    4px 0 0 var(--pink),
    -4px 0 0 var(--pink),
    0 14px 26px rgba(75, 48, 127, 0.24);
}

.panel-logo span {
  color: #ffe28a;
  text-shadow:
    0 5px 0 #d67422,
    0 -1px 0 #fff,
    4px 0 0 #d67422,
    -4px 0 0 #d67422,
    0 14px 26px rgba(75, 48, 127, 0.24);
}

.panel-catie {
  width: min(68%, 270px);
  top: 8%;
  right: 2%;
  opacity: 0.85;
  filter: drop-shadow(0 20px 28px rgba(55, 39, 122, 0.18));
}

.desktop-stat-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  width: min(100%, 300px);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--purple);
  box-shadow:
    0 14px 34px rgba(86, 58, 164, 0.12),
    inset 0 2px 5px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.desktop-stat-card strong {
  color: var(--pink);
  font-size: 25px;
  line-height: 1;
}

.desktop-stat-card span {
  font-weight: 850;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  max-height: none;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 244, 180, 0.36), transparent 34%),
    linear-gradient(135deg, #8ec3ff 0%, #f9c6f1 48%, #c7f5ff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

#stage::before {
  content: "";
  position: absolute;
  inset: -28px;
  z-index: 0;
  background: url("../public/assets/raw/gameplay_reference.png") center / cover no-repeat;
  filter: blur(22px) saturate(1.08) brightness(1.04);
  opacity: 0.28;
  pointer-events: none;
}

.game-frame {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #bfe9ff;
  box-shadow:
    0 24px 72px rgba(55, 39, 122, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 -70px 120px rgba(255, 255, 255, 0.24);
}

.hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 8;
  display: none;
  width: 92%;
  pointer-events: none;
  transform: translateX(-50%);
}

.game-title {
  display: none;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
}

.hud-row-end {
  justify-content: flex-end;
  margin-top: 5px;
}

.hud-cluster {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.hud-actions {
  pointer-events: auto;
}

.stat-pill,
.power-card,
.jump-panel,
.modal-panel {
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: var(--panel);
  box-shadow:
    0 10px 26px rgba(86, 58, 164, 0.16),
    inset 0 2px 5px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.stat-pill {
  min-width: 48px;
  padding: 4px 6px;
  border-radius: 13px;
  text-align: center;
  color: var(--purple);
  font-weight: 1000;
}

.stat-pill-hot strong {
  color: var(--pink);
}

.stat-pill strong {
  display: block;
  color: var(--purple);
  font-size: 16px;
  line-height: 0.95;
}

.stat-pill strong small {
  font-size: 9px;
}

.stat-label,
.power-card small {
  display: block;
  color: #8c74ce;
  font-size: 8px;
}

.power-card small {
  display: none;
}

.round-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(125, 92, 230, 0.66);
  color: #fff;
  box-shadow:
    0 10px 26px rgba(74, 42, 139, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font-size: 9px;
  font-weight: 1000;
}

.power-card {
  min-width: 96px;
  max-width: 108px;
  padding: 4px 6px;
  border-radius: 13px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.meter {
  position: relative;
  height: 7px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(67, 43, 121, 0.18);
  box-shadow: inset 0 2px 7px rgba(58, 38, 101, 0.22);
  padding: 2px;
}

.meter-fill {
  position: relative;
  z-index: 1;
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), #ffb02e, #ffd941, var(--purple));
  transition: width 70ms linear;
}

.perfect-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 55%;
  width: 20%;
  border-right: 1px dashed rgba(255, 255, 255, 0.95);
  border-left: 1px dashed rgba(255, 255, 255, 0.95);
  background: rgba(255, 211, 78, 0.28);
}

.feedback {
  position: absolute;
  top: 126px;
  left: 18px;
  z-index: 9;
  display: none;
  min-width: 150px;
  pointer-events: none;
}

.feedback.show {
  display: block;
  animation: feedback-pop 720ms ease both;
}

.feedback img {
  display: block;
  width: min(230px, 46vw);
  filter: drop-shadow(0 10px 18px rgba(55, 39, 122, 0.18));
}

.feedback-text {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe68f, #f0a42e);
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(117, 82, 20, 0.35);
  box-shadow:
    0 10px 26px rgba(76, 159, 52, 0.22),
    inset 0 2px 5px rgba(255, 255, 255, 0.65);
}

@keyframes feedback-pop {
  0% {
    opacity: 0;
    transform: scale(0.78) translateY(8px);
  }
  35% {
    opacity: 1;
    transform: scale(1.06) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.controls {
  position: absolute;
  bottom: max(4px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 10;
  display: none;
  width: min(52%, 206px);
  grid-template-columns: 1fr;
  align-items: end;
  pointer-events: none;
  transform: translateX(-50%);
}

.asset-button {
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}

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

.asset-button.down {
  filter: brightness(1.06);
  transform: translateY(3px) scale(0.985);
}

.jump-panel {
  min-width: 0;
  padding: 4px 6px 5px;
  border-radius: 14px;
  pointer-events: none;
  text-align: center;
}

.aim-panel {
  position: relative;
}

.aim-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 22px) scale(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.aim-panel:has(.jump-button.down)::before {
  opacity: 0.88;
  transform: translate(-50%, 4px) scale(1);
}

.jump-panel > span {
  display: block;
  margin-bottom: 0;
  color: var(--purple);
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.jump-button {
  width: min(100%, 158px);
  height: 35px;
  margin-top: 3px;
  margin-right: auto;
  margin-left: auto;
}

.tip {
  display: none;
}

.control-note {
  position: absolute;
  left: 50%;
  bottom: 11.6%;
  z-index: 2;
  width: min(72%, 350px);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--purple);
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
  box-shadow: 0 12px 28px rgba(63, 39, 126, 0.14);
  transform: translateX(-50%);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: auto;
}

.screen.is-hidden {
  display: none;
}

.screen-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.screen-art-backdrop {
  display: none;
}

.screen-art-main {
  z-index: 1;
}

.static-art-shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}

.screen-art.dim {
  filter: brightness(0.76) saturate(0.95);
}

.screen-loading {
  background: linear-gradient(180deg, #91c6ff, #ffd0ed);
}

.loading-card {
  width: min(80%, 340px);
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  color: var(--purple);
  font-weight: 1000;
  box-shadow: 0 18px 50px rgba(63, 39, 126, 0.18);
}

.hotspot {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
}

.hotspot:focus-visible,
.round-button:focus-visible,
.asset-button:focus-visible,
.modal-button:focus-visible,
.result-button:focus-visible,
.skin-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.hot-play {
  left: 15%;
  right: 15%;
  top: 68.7%;
  height: 9%;
}

.hot-story {
  left: 14%;
  top: 79.4%;
  width: 34%;
  height: 6.8%;
}

.hot-skins {
  right: 14%;
  top: 79.4%;
  width: 34%;
  height: 6.8%;
}

.hot-daily {
  left: 11%;
  right: 11%;
  top: 87.7%;
  height: 6.8%;
}

.hot-settings {
  right: 6.5%;
  top: 13.3%;
  width: 9%;
  height: 5.5%;
}

.hot-next {
  left: 28%;
  right: 28%;
  top: 85.8%;
  height: 6.8%;
}

.hot-start {
  left: 13%;
  right: 13%;
  top: 84.2%;
  height: 7.8%;
}

.screen-menu .menu-actions,
.screen-menu .wide-menu-actions,
.screen-menu .desktop-menu-actions,
.screen-menu .corner-action,
.screen-menu .menu-sidebar {
  display: none !important;
}

@media (min-aspect-ratio: 4 / 3) {
  .screen-menu .screen-art,
  .screen-story1 .screen-art,
  .screen-story2 .screen-art,
  .screen-story3 .screen-art {
    object-fit: contain;
    filter: drop-shadow(0 18px 46px rgba(55, 39, 122, 0.16));
  }

  .screen-menu .screen-art-backdrop,
  .screen-story1 .screen-art-backdrop,
  .screen-story2 .screen-art-backdrop,
  .screen-story3 .screen-art-backdrop {
    display: block;
    z-index: 0;
    object-fit: cover;
    opacity: 0.42;
    filter: blur(22px) saturate(1.1) brightness(1.03);
    transform: scale(1.08);
  }

  .screen-menu .screen-art-main,
  .screen-story1 .screen-art-main,
  .screen-story2 .screen-art-main,
  .screen-story3 .screen-art-main {
    z-index: 1;
    object-fit: cover;
  }

  .screen-menu .static-art-shell,
  .screen-story1 .static-art-shell,
  .screen-story2 .static-art-shell,
  .screen-story3 .static-art-shell {
    position: relative;
    inset: auto;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: 100%;
    border-radius: inherit;
  }

  .screen-menu,
  .screen-story1,
  .screen-story2,
  .screen-story3 {
    background:
      radial-gradient(circle at 50% 18%, rgba(255, 245, 185, 0.34), transparent 32%),
      linear-gradient(135deg, #91c6ff 0%, #ffd1f0 48%, #c8f4ff 100%);
  }

}

.modal-panel {
  position: relative;
  z-index: 3;
  width: min(86%, 410px);
  max-height: min(88%, 760px);
  padding: 18px;
  border-radius: 28px;
  text-align: center;
}

.modal-panel.wide {
  width: min(92%, 448px);
}

.modal-panel.scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-panel h1,
.modal-panel h2 {
  margin: 0 0 7px;
  color: var(--pink);
  font-size: clamp(28px, 8vw, 44px);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 0 2px 0 #fff;
}

.modal-panel p {
  margin: 7px auto;
  color: #735fbd;
  font-weight: 850;
  line-height: 1.35;
}

.modal-actions,
.skin-grid,
.stats-grid {
  display: grid;
  gap: 10px;
}

.modal-actions {
  margin-top: 12px;
}

.modal-actions.two {
  grid-template-columns: 1fr 1fr;
}

.modal-button {
  min-height: 54px;
  padding: 11px 15px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ff8ecc, #ff5faf 55%, #eb459c);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0;
  box-shadow:
    0 14px 28px rgba(255, 95, 172, 0.28),
    inset 0 3px 5px rgba(255, 255, 255, 0.5);
}

.modal-button.purple {
  background: linear-gradient(180deg, #a894ff, #7356d5);
}

.modal-button.gold {
  background: linear-gradient(180deg, #ffe084, #f0a92f);
}

.modal-button.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--purple);
  border: 1px solid rgba(125, 92, 230, 0.18);
}

.stats-grid {
  grid-template-columns: 1fr 1fr;
  margin: 12px 0;
}

.stat-box {
  min-width: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  color: var(--purple);
  font-weight: 1000;
}

.stat-box strong {
  display: block;
  color: var(--pink);
  font-size: 34px;
  line-height: 1;
}

.fail-emotion {
  display: block;
  width: min(32%, 128px);
  margin: 4px auto 8px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(55, 39, 122, 0.18));
  pointer-events: none;
}

.skin-grid {
  grid-template-columns: repeat(2, 1fr);
  margin: 12px 0;
}

.mode-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.mode-card {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--purple);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 24px rgba(63, 39, 126, 0.12);
}

.mode-card strong,
.shop-card strong,
.achievement-row strong {
  color: var(--pink);
  font-size: 16px;
  line-height: 1;
}

.mode-card span,
.achievement-row span {
  color: #745fbd;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.mode-card small,
.shop-card small,
.achievement-row small {
  color: #8b73ce;
  font-size: 11px;
  font-weight: 1000;
}

.shop-section {
  margin-top: 12px;
}

.shop-section h3 {
  margin: 0 0 6px;
  color: var(--purple);
  font-size: 14px;
  text-align: left;
  text-transform: uppercase;
}

.skin-card {
  border: 2px solid rgba(125, 92, 230, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  color: var(--purple);
  cursor: pointer;
  font-weight: 1000;
}

.skin-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.42);
  opacity: 0.62;
}

.skin-card[aria-pressed="true"] {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 95, 172, 0.15);
}

.skin-card img {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 4px;
  object-fit: contain;
}

.shop-card {
  display: grid;
  gap: 5px;
  align-content: start;
}

.cosmetic-preview {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.8);
}

.cosmetic-preview img {
  width: 66px;
  height: 66px;
  margin: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(58, 38, 101, 0.16));
}

.achievement-list {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.achievement-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 11px 12px;
  border: 1px solid rgba(125, 92, 230, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.achievement-row span {
  grid-column: 1 / -1;
}

.achievement-row.done {
  border-color: rgba(255, 211, 78, 0.72);
  background: rgba(255, 248, 210, 0.82);
}

.reward-line {
  font-size: 12px;
}

.result-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 238, 181, 0.15), transparent 34%),
    rgba(22, 27, 76, 0.58);
  backdrop-filter: blur(2px) saturate(0.9);
}

.victory-backdrop {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 228, 121, 0.34), transparent 38%),
    rgba(45, 42, 95, 0.44);
}

.run-result-card {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(84%, 398px);
  max-height: 92%;
  justify-items: center;
  overflow: hidden;
  padding: 19px 20px 18px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.34), transparent 16%),
    linear-gradient(180deg, rgba(168, 132, 255, 0.98), rgba(233, 218, 255, 0.96));
  box-shadow:
    0 22px 64px rgba(26, 23, 80, 0.36),
    inset 0 3px 8px rgba(255, 255, 255, 0.42);
}

.run-result-card::before,
.run-result-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.run-result-card::before {
  left: -58px;
  bottom: 70px;
}

.run-result-card::after {
  right: -56px;
  bottom: 102px;
}

.victory-result-card {
  border-color: rgba(255, 224, 132, 0.96);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, rgba(255, 226, 126, 0.98), rgba(255, 246, 199, 0.98));
  box-shadow:
    0 22px 64px rgba(105, 67, 20, 0.28),
    inset 0 3px 8px rgba(255, 255, 255, 0.5);
}

.result-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff8fb;
  font-size: clamp(46px, 12vw, 64px);
  line-height: 0.92;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #f74c9d,
    0 -1px 0 #fff,
    3px 0 0 #f74c9d,
    -3px 0 0 #f74c9d,
    0 11px 22px rgba(72, 45, 128, 0.22);
}

.victory-title {
  color: #ffe889;
  text-shadow:
    0 4px 0 #d8752a,
    0 -1px 0 #fff,
    3px 0 0 #c85b8d,
    -3px 0 0 #c85b8d,
    0 11px 22px rgba(72, 45, 128, 0.22);
}

.result-message {
  position: relative;
  z-index: 1;
  margin: 8px 0 4px;
  color: #6f56be;
  font-size: 17px;
  font-weight: 1000;
  text-align: center;
}

.result-catie {
  position: relative;
  z-index: 1;
  display: block;
  width: min(54%, 210px);
  margin: 3px auto 8px;
  object-fit: contain;
  filter: drop-shadow(0 15px 20px rgba(64, 44, 126, 0.2));
  pointer-events: none;
}

.result-catie-happy {
  width: min(60%, 230px);
  margin-top: 0;
}

.result-stat-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 25px;
  background: rgba(255, 248, 255, 0.78);
  box-shadow:
    0 12px 26px rgba(75, 45, 130, 0.14),
    inset 0 2px 7px rgba(255, 255, 255, 0.84);
}

.result-stat {
  display: grid;
  min-width: 0;
  gap: 2px;
  justify-items: center;
  color: var(--purple);
  font-weight: 1000;
  text-align: center;
}

.result-stat span {
  color: var(--purple);
  font-size: 15px;
}

.result-stat-hot span,
.result-stat-hot strong {
  color: var(--pink);
}

.result-stat strong {
  color: var(--purple);
  font-size: 42px;
  line-height: 0.9;
}

.result-stat small {
  font-size: 17px;
}

.result-stat em {
  color: #8a6fd3;
  font-size: 12px;
  font-style: normal;
}

.result-divider {
  width: 1px;
  height: 70px;
  background: rgba(125, 92, 230, 0.18);
}

.result-progress {
  width: min(100%, 118px);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 92, 230, 0.16);
}

.result-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), #ff86c5);
}

.result-subline {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  color: #6f56be;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.result-subline.muted {
  margin-top: 3px;
  color: #876fd0;
  font-size: 11px;
}

.result-actions {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 12px;
}

.result-actions.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.result-button {
  min-height: 50px;
  padding: 10px 13px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(84, 48, 125, 0.22);
  box-shadow:
    0 12px 22px rgba(82, 48, 142, 0.22),
    inset 0 3px 5px rgba(255, 255, 255, 0.5);
}

.result-button-purple {
  background: linear-gradient(180deg, #a694ff, #7458d7);
}

.result-button-pink {
  background: linear-gradient(180deg, #ff91ce, #ff5fac 58%, #ea459b);
}

.result-button-gold {
  min-height: 44px;
  width: min(82%, 280px);
  justify-self: center;
  border-color: rgba(255, 239, 177, 0.9);
  background: linear-gradient(180deg, #ffe98e, #f3ae32);
  color: #fff;
  font-size: 14px;
}

.screen-fail .modal-panel {
  width: min(84%, 382px);
  padding: 14px;
  border-radius: 24px;
}

.screen-fail .modal-panel h1 {
  margin-bottom: 4px;
  font-size: clamp(26px, 7vw, 38px);
}

.screen-fail .modal-panel p {
  margin: 5px auto;
  font-size: 13px;
}

.screen-fail .stats-grid {
  gap: 7px;
  margin: 8px 0;
}

.screen-fail .stat-box {
  padding: 7px;
  border-radius: 16px;
  font-size: 12px;
}

.screen-fail .stat-box strong {
  font-size: 27px;
}

.screen-fail .modal-actions {
  gap: 8px;
  margin-top: 8px;
}

.screen-fail .modal-button {
  min-height: 45px;
  padding: 9px 12px;
  border-radius: 18px;
  font-size: 15px;
}

.screen-fail .result-backdrop {
  animation: fail-backdrop-in 280ms ease-out both;
}

.screen-fail .run-result-card {
  transform-origin: 50% 62%;
  animation: fail-card-in 460ms cubic-bezier(0.18, 0.9, 0.24, 1.12) both;
}

.screen-fail .result-catie-sad {
  animation: fail-catie-in 560ms ease-out 90ms both;
}

@keyframes fail-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fail-card-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  64% {
    opacity: 1;
    transform: translateY(-4px) scale(1.018);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fail-catie-in {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.92) rotate(-3deg);
  }
  52% {
    opacity: 1;
    transform: translateY(3px) scale(1.04) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (min-width: 460px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mode-card {
    min-height: 106px;
  }
}

@media (min-aspect-ratio: 1 / 1) {
  .game-frame {
    width: min(100vw, calc(100dvh * 1.15));
    height: 100vh;
    height: 100dvh;
    border-radius: clamp(14px, 2vw, 28px);
  }
}

@media (max-width: 920px) {
  .desktop-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .desktop-panel {
    display: none;
  }

  #stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .game-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 560px) {
  .desktop-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .desktop-panel {
    display: none;
  }

  #stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .game-title {
    display: none;
  }

  .stat-pill {
    min-width: 46px;
    padding: 4px 5px;
    border-radius: 12px;
  }

  .stat-pill strong {
    font-size: 15px;
  }

  .power-card {
    min-width: 92px;
    max-width: 104px;
  }

  .round-button {
    width: 29px;
    height: 29px;
    font-size: 9px;
  }

  .controls {
    width: min(54%, 202px);
  }

  .jump-panel {
    padding: 4px 6px 5px;
  }

  .jump-button {
    width: min(100%, 156px);
    height: 34px;
  }

  .run-result-card {
    width: min(88%, 382px);
    padding: 16px;
    border-radius: 30px;
  }

  .result-title {
    font-size: clamp(40px, 12vw, 58px);
  }

  .result-catie {
    width: min(50%, 190px);
  }

  .result-catie-happy {
    width: min(56%, 208px);
  }

  .result-stat-panel {
    padding: 11px;
  }

  .result-stat strong {
    font-size: 36px;
  }

  .result-button {
    min-height: 46px;
    font-size: 15px;
  }

  .modal-panel {
    width: min(90%, 390px);
    padding: 16px;
  }
}

@media (max-height: 680px) {
  .run-result-card {
    padding: 12px 14px;
    border-radius: 26px;
  }

  .result-title {
    font-size: clamp(34px, 10vw, 48px);
  }

  .result-message {
    margin-top: 5px;
    font-size: 14px;
  }

  .result-catie {
    width: min(42%, 152px);
    margin-bottom: 5px;
  }

  .result-stat-panel {
    padding: 9px;
    border-radius: 20px;
  }

  .result-stat strong {
    font-size: 30px;
  }

  .result-subline {
    margin-top: 5px;
    font-size: 10px;
  }

  .result-button {
    min-height: 40px;
    border-radius: 18px;
    font-size: 13px;
  }
}

@media (max-aspect-ratio: 1 / 1) {
  .game-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (min-aspect-ratio: 1 / 1) {
  .game-frame {
    width: min(100vw, calc(100dvh * 1.15));
    height: 100vh;
    height: 100dvh;
    border-radius: clamp(14px, 2vw, 28px);
  }
}
