﻿:root {
  --bg: #100d14;
  --panel: rgba(34, 19, 31, 0.78);
  --panel-strong: rgba(21, 12, 20, 0.88);
  --line: rgba(255, 216, 180, 0.34);
  --text: #f9efe5;
  --sub: #d4c0ba;
  --accent: #efb86e;
  --accent-2: #f8ddaa;
  --danger: #f47b7b;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 14%,
    #4d1832 0%,
    #211222 46%,
    #0a0c13 100%
  );
  color: var(--text);
  font-family: "Palatino Linotype", "Book Antiqua", "Georgia", serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
}

.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 27, 40, 0.97);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rotate-overlay.is-visible {
  display: flex;
}

.rotate-overlay-inner {
  text-align: center;
  max-width: 280px;
}

.rotate-overlay-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border: 4px solid rgba(174, 216, 255, 0.5);
  border-radius: 16px;
  background: rgba(30, 50, 70, 0.6);
  transform: rotate(-90deg);
  position: relative;
}

.rotate-overlay-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 4px;
  margin: -2px 0 0 -12px;
  background: rgba(174, 216, 255, 0.8);
  border-radius: 2px;
}

.rotate-overlay-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #c8e4ff;
  line-height: 1.35;
}

.fullscreen-prompt {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(15, 27, 40, 0.85);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fullscreen-prompt.is-visible {
  display: flex;
}

.fullscreen-prompt-text {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(200, 228, 255, 0.9);
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #0f1b28;
  box-shadow: none;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#uiRoot {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(10, 8, 13, 0.84),
    rgba(18, 10, 20, 0.88)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
}

.loading-screen {
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(90, 140, 200, 0.18),
      transparent 42%
    ),
    radial-gradient(
      circle at 16% 82%,
      rgba(50, 90, 140, 0.14),
      transparent 40%
    ),
    linear-gradient(165deg, rgba(18, 24, 38, 0.94), rgba(8, 12, 20, 0.96));
}

.loading-gif {
  width: 96px;
  height: 96px;
  max-width: 26vw;
  max-height: 26vw;
  object-fit: contain;
}
/* From Uiverse.io by andrew-manzyk */
.loader {
  --main-size: 4em;
  --text-color: #ffffff;
  --shine-color: #ffffff40;
  --shadow-color: #aaaaaa;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
  position: relative;
  font-size: var(--main-size);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-color);
  width: 7.3em;
  height: 1em;
  filter: drop-shadow(0 0 0.05em var(--shine-color));
}

.loader .text {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  position: absolute;
}

.loader .text:nth-child(1) {
  clip-path: polygon(0% 0%, 11.11% 0%, 11.11% 100%, 0% 100%);
  font-size: calc(var(--main-size) / 20);
  margin-left: -2.1em;
  opacity: 0.6;
}

.loader .text:nth-child(2) {
  clip-path: polygon(11.11% 0%, 22.22% 0%, 22.22% 100%, 11.11% 100%);
  font-size: calc(var(--main-size) / 16);
  margin-left: -0.98em;
  opacity: 0.7;
}

.loader .text:nth-child(3) {
  clip-path: polygon(22.22% 0%, 33.33% 0%, 33.33% 100%, 22.22% 100%);
  font-size: calc(var(--main-size) / 13);
  margin-left: -0.33em;
  opacity: 0.8;
}

.loader .text:nth-child(4) {
  clip-path: polygon(33.33% 0%, 44.44% 0%, 44.44% 100%, 33.33% 100%);
  font-size: calc(var(--main-size) / 11);
  margin-left: -0.05em;
  opacity: 0.9;
}

.loader .text:nth-child(5) {
  clip-path: polygon(44.44% 0%, 55.55% 0%, 55.55% 100%, 44.44% 100%);
  font-size: calc(var(--main-size) / 10);
  margin-left: 0em;
  opacity: 1;
}

.loader .text:nth-child(6) {
  clip-path: polygon(55.55% 0%, 66.66% 0%, 66.66% 100%, 55.55% 100%);
  font-size: calc(var(--main-size) / 11);
  margin-left: 0.05em;
  opacity: 0.9;
}

.loader .text:nth-child(7) {
  clip-path: polygon(66.66% 0%, 77.77% 0%, 77.77% 100%, 66.66% 100%);
  font-size: calc(var(--main-size) / 13);
  margin-left: 0.33em;
  opacity: 0.8;
}

.loader .text:nth-child(8) {
  clip-path: polygon(77.77% 0%, 88.88% 0%, 88.88% 100%, 77.77% 100%);
  font-size: calc(var(--main-size) / 16);
  margin-left: 0.98em;
  opacity: 0.7;
}

.loader .text:nth-child(9) {
  clip-path: polygon(88.88% 0%, 100% 0%, 100% 100%, 88.88% 100%);
  font-size: calc(var(--main-size) / 20);
  margin-left: 2.1em;
  opacity: 0.6;
}

.loader .text span {
  animation:
    scrolling 2s cubic-bezier(0.1, 0.6, 0.9, 0.4) infinite,
    shadow 2s cubic-bezier(0.1, 0.6, 0.9, 0.4) infinite;
}

.loader .text:nth-child(1) span {
  background: linear-gradient(
    to right,
    var(--text-color) 4%,
    var(--shadow-color) 7%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(2) span {
  background: linear-gradient(
    to right,
    var(--text-color) 9%,
    var(--shadow-color) 13%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(3) span {
  background: linear-gradient(
    to right,
    var(--text-color) 15%,
    var(--shadow-color) 18%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(4) span {
  background: linear-gradient(
    to right,
    var(--text-color) 20%,
    var(--shadow-color) 23%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(6) span {
  background: linear-gradient(
    to right,
    var(--shadow-color) 29%,
    var(--text-color) 32%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(7) span {
  background: linear-gradient(
    to right,
    var(--shadow-color) 34%,
    var(--text-color) 37%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(8) span {
  background: linear-gradient(
    to right,
    var(--shadow-color) 39%,
    var(--text-color) 42%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .text:nth-child(9) span {
  background: linear-gradient(
    to right,
    var(--shadow-color) 45%,
    var(--text-color) 48%
  );
  background-size: 200% auto;
  background-clip: text;
  color: transparent;
}

.loader .line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 0.05em;
  width: calc(var(--main-size) / 2);
  margin-top: 0.9em;
  border-radius: 0.05em;
}

.loader .line::before {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: var(--text-color);
  opacity: 0.3;
}

.loader .line::after {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 0.05em;
  transform: translateX(-90%);
  animation: wobble 2s cubic-bezier(0.5, 0.8, 0.5, 0.2) infinite;
}

@keyframes wobble {
  0% {
    transform: translateX(-90%);
  }
  50% {
    transform: translateX(90%);
  }
  100% {
    transform: translateX(-90%);
  }
}

@keyframes scrolling {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes shadow {
  0% {
    background-position: -98% 0;
  }
  100% {
    background-position: 102% 0;
  }
}

.menu-screen {
  justify-content: space-between;
  padding: clamp(16px, 3vw, 30px);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(
      circle at 50% 42%,
      rgba(156, 60, 88, 0.27),
      transparent 45%
    ),
    url("https://ik.imagekit.io/6rsuaxauw/axo-quest/main-screen_ughyy1.webp");
}

.menu-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(208, 228, 255, 0.1),
      transparent 40%
    ),
    linear-gradient(180deg, rgba(4, 8, 14, 0.82), rgba(3, 6, 12, 0.84));
  pointer-events: none;
}

.menu-fx {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.18;
  pointer-events: none;
}

.menu-fx-a {
  width: 36vw;
  height: 36vw;
  min-width: 240px;
  min-height: 240px;
  right: -6vw;
  top: -14vw;
  background: radial-gradient(
    circle,
    rgba(228, 81, 114, 0.44),
    transparent 70%
  );
  animation: drift-fx-a 8s ease-in-out infinite;
}

.menu-fx-b {
  width: 44vw;
  height: 44vw;
  min-width: 260px;
  min-height: 260px;
  left: -15vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(121, 37, 89, 0.4), transparent 70%);
  animation: drift-fx-b 10s ease-in-out infinite;
}

.menu-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hero-ring-size);
  height: var(--hero-ring-size);
  border-radius: 50%;
  border: 2px solid rgba(249, 215, 159, 0.15);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 12px rgba(249, 215, 159, 0.05),
    0 0 60px rgba(230, 107, 87, 0.2);
  pointer-events: none;
  z-index: 0;
}

.menu-topbar {
  width: min(1300px, 95vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  z-index: 2;
  /* padding-top: 2rem; */
}

.menu-top-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.menu-brand {
  margin-bottom: 1.2rem;
}
.menu-brand .menu-kicker {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(245, 217, 160, 0.32);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1.4px;
  background: rgba(30, 15, 24, 0.56);
  margin-bottom: 8px;
}

.menu-brand h1 {
  margin: 0;
  font-size: clamp(60px, 9vw, 80px);
  letter-spacing: 4px;
  line-height: 0.95;
  font-weight: 900;
  /* font-family: Impact, Haettenschweiler, "Arial Black", sans-serif; */
  text-transform: uppercase;
  color: #dce5ef;
  text-shadow:
    0 2px 0 rgba(12, 18, 28, 0.95),
    0 8px 24px rgba(0, 0, 0, 0.58);
}

.menu-brand h2 {
  margin: 6px 0 0;
  color: rgba(223, 233, 245, 0.86);
  font-size: clamp(12px, 1.5vw, 18px);
  letter-spacing: 2.6px;
  text-align: center;
}

.menu-status-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  /* background: rgba(12, 18, 28, 0.7);
  border: 1px solid rgba(197, 219, 244, 0.24); */
}

.status-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #f3dbd3;
  font-weight: 600;
  background-image: linear-gradient(
    180deg,
    rgba(44, 63, 88, 0.92),
    rgba(21, 31, 45, 0.92)
  );
  border: 1px solid rgba(246, 208, 160, 0.2);
}

.wallet-pill {
  max-width: min(360px, 58vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill.is-on {
  color: #ffe7c4;
  border-color: rgba(255, 218, 156, 0.5);
  box-shadow: 0 0 18px rgba(238, 173, 96, 0.22);
}

.menu-stage {
  width: min(1300px, 95vw);
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.menu-side-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-side-btn {
  text-align: center;
  padding: 10px 18px;
  font-size: 14px;
  letter-spacing: 1.4px;
  border-radius: 999px;
  border: 1px solid rgba(192, 214, 238, 0.54);
  color: #e8f0fa;
  background: linear-gradient(
    180deg,
    rgba(23, 35, 51, 0.8),
    rgba(9, 14, 22, 0.85)
  );
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

.menu-side-btn.danger {
  border-color: rgba(232, 130, 130, 0.48);
}

.menu-hero-panel {
  --hero-frame-size: min(58vh, 58vw);
  --hero-ring-size: calc(var(--hero-frame-size) + clamp(42px, 8vw, 92px));
  position: relative;
  width: min(72vh, 72vw);
  min-width: 300px;
  min-height: max(var(--hero-ring-size), 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.menu-hero-glow {
  position: absolute;
  width: calc(var(--hero-frame-size) * 0.78);
  height: calc(var(--hero-frame-size) * 0.78);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 222, 168, 0.26),
    rgba(247, 117, 88, 0.18) 46%,
    transparent 72%
  );
  filter: blur(8px);
}

.menu-hero-frame {
  position: relative;
  width: var(--hero-frame-size);
  height: var(--hero-frame-size);
  min-width: 240px;
  min-height: 240px;
  border-radius: 50%;
  border: 2px solid rgba(248, 213, 152, 0.42);
  /* background:
    radial-gradient(
      circle at 50% 33%,
      rgba(244, 207, 142, 0.22),
      transparent 58%
    ),
    radial-gradient(
      circle at 46% 78%,
      rgba(73, 29, 45, 0.92),
      rgba(18, 11, 17, 0.95)
    ); */
  box-shadow:
    inset 0 0 60px rgba(17, 12, 16, 0.76),
    0 12px 34px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 1;
}

.menu-showcase {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.menu-showcase-single .carousel-hero {
  opacity: 1;
  animation: none;
}

.carousel-hero {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: min(44vh, 44vw);
  height: min(44vh, 44vw);
  min-width: 220px;
  min-height: 220px;
  transform: translateX(-50%);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.45));
  opacity: 0;
  animation: hero-slide-cycle 12s cubic-bezier(0.35, 0, 0.2, 1) infinite;
}

.hero-ninja {
  background-image: url("https://ik.imagekit.io/6rsuaxauw/axo-quest/axo_ninja_olg2gr.webp");
  /* background-image: url("/assets/sprites/heroes/ninja/title.png"); */
  animation-delay: 0s;
}

/* .hero-flora {
  background-image: url(https://ik.imagekit.io/6rsuaxauw/axo-quest/6104798070395571347-removebg-preview_xli3u9.png);
  animation-delay: 4s;
}

.hero-jelly {
  background-image: url("https://ik.imagekit.io/6rsuaxauw/axo-quest/axo_ninja_olg2gr.webp");
  animation-delay: 8s;
} */

.menu-hero-caption {
  max-width: 460px;
  text-align: center;
  margin-top: 12px;
  color: #dfc8bf;
  letter-spacing: 0.4px;
}

.menu-right-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(180, 205, 232, 0.24);
  background: linear-gradient(
    170deg,
    rgba(18, 26, 38, 0.84),
    rgba(10, 14, 22, 0.84)
  );
  box-shadow: inset 0 0 26px rgba(166, 199, 235, 0.09);
}

.menu-right-card h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.5vw, 30px);
}

.menu-right-card p {
  margin: 0 0 16px;
  color: #d2bab1;
  line-height: 1.45;
}

.menu-bottom {
  width: min(1300px, 95vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}

.menu-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 6, 11, 0.68);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 6;
}

.menu-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.menu-modal-card {
  width: min(760px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(192, 214, 238, 0.45);
  background: linear-gradient(
    170deg,
    rgba(26, 38, 54, 0.95),
    rgba(12, 19, 30, 0.95)
  );
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 30px rgba(176, 206, 238, 0.12);
  overflow: hidden;
}

.wallet-modal-card {
  width: min(700px, 92vw);
  border-radius: 26px;
  border: 1px solid rgba(123, 157, 198, 0.72);
  background: linear-gradient(
    180deg,
    rgba(30, 44, 65, 0.96) 0%,
    rgba(19, 31, 49, 0.98) 100%
  );
  box-shadow:
    0 28px 80px rgba(4, 10, 20, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -18px 34px rgba(0, 0, 0, 0.16);
}

.leaderboard-modal-card {
  width: min(1400px, 92vw);
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 1px solid rgba(123, 157, 198, 0.72);
  background: linear-gradient(
    180deg,
    rgba(30, 44, 65, 0.96) 0%,
    rgba(19, 31, 49, 0.98) 100%
  );
  box-shadow:
    0 28px 80px rgba(4, 10, 20, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -18px 34px rgba(0, 0, 0, 0.16);
}

.leaderboard-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  overflow: auto;
  scrollbar-width: none;
  padding: 20px;
}

.leaderboard-panel {
  border: 1px solid rgba(102, 137, 177, 0.56);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(17, 29, 45, 0.9),
    rgba(13, 23, 37, 0.96)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(67, 95, 128, 0.12);
  overflow: hidden;
}

.leaderboard-panel h4 {
  margin: 0;
  padding: 18px 18px 16px;
  font-size: clamp(18px, 1.8vw, 24px);
  letter-spacing: 0.04em;
  color: #e7eef9;
  font-family: "Cinzel", "Palatino Linotype", "Georgia", serif;
  font-weight: 700;
  border-bottom: 1px solid rgba(102, 137, 177, 0.36);
  background: rgba(17, 28, 43, 0.55);
}

.leaderboard-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 0 0 18px 18px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(102, 137, 177, 0.22);
  font-size: 14px;
  color: #dde7f6;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #eef4ff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(15, 24, 36, 0.96);
}

.leaderboard-table tbody tr:hover {
  background: rgba(74, 101, 136, 0.1);
}

.leaderboard-hero-selector {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 14px 14px 8px;
  flex-wrap: wrap;
}

.leaderboard-hero-avatar {
  border: 1px solid rgba(192, 214, 238, 0.35);
  /* background: rgba(14, 22, 34, 0.72); */
  /* border-radius: 999px; */
  /* padding: 8px 10px; */
  min-width: 110px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.leaderboard-hero-avatar-image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(192, 214, 238, 0.5);
  background-position: center 70%;
  background-repeat: no-repeat;
  background-size: 90% auto;
  background-color: rgba(8, 14, 22, 0.92);
}

.leaderboard-hero-avatar-name {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #d8e7f8;
}

.leaderboard-hero-avatar.active {
  border-color: rgba(214, 230, 247, 0.88);
  box-shadow: 0 0 0 1px rgba(214, 230, 247, 0.3) inset;
}

.leaderboard-hero-avatar.active .leaderboard-hero-avatar-image {
  border-color: rgba(214, 230, 247, 0.95);
  box-shadow: 0 0 14px rgba(166, 199, 235, 0.45);
}

.leaderboard-hero-tables {
  width: 100%;
}

.leaderboard-hero-table {
  display: none;
}

.leaderboard-hero-table.active {
  display: block;
}

.leaderboard-loading,
.leaderboard-error {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(102, 137, 177, 0.42);
  background: rgba(14, 24, 39, 0.9);
}

.leaderboard-error {
  border-color: rgba(236, 127, 127, 0.4);
  color: #ffd6d6;
}

.hero-pick-modal-card {
  width: min(860px, 94vw);
}

.hero-pick-content {
  display: grid;
  gap: 18px;
}

.hero-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 18px;
}

.hero-pick-card {
  border: 1px solid rgba(250, 216, 166, 0.3);
  border-radius: 18px;
  background: linear-gradient(170deg, rgb(14 21 31), rgba(25, 14, 26, 0.88));
  padding: 14px 10px 12px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.hero-pick-card:hover {
  border-color: rgba(255, 224, 176, 0.7);
}

.hero-pick-card.selected {
  border-color: rgb(255 171 1 / 82%);
  box-shadow:
    0 0 0 2px rgba(255, 206, 128, 0.2) inset,
    0 0px 5px rgb(255 133 2);
}

.hero-pick-portrait {
  width: clamp(116px, 15vw, 148px);
  height: clamp(116px, 15vw, 148px);
  border-radius: 50%;
  border: 2px solid rgba(252, 219, 164, 0.5);
  /* background-color: rgba(31, 15, 24, 0.92); */
  background-size: contain;
  background-position: center 75%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 24px rgba(7, 4, 8, 0.72),
    0 0 4px rgb(12 22 34);
}

.hero-pick-name {
  font-size: 14px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #f5dfc2;
}

.hero-pick-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-arrow-btn {
  min-width: 56px;
  height: 46px;
  border-radius: 12px;
  font-size: 26px;
  line-height: 1;
  padding: 0;
}

.hero-arrow-btn.is-next {
  border-color: rgba(255, 225, 173, 0.62);
  background: linear-gradient(180deg, #f8e7be 0%, #f2ce94 100%);
  color: #3d1f1a;
}

.wallet-status {
  min-height: 132px;
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px 16px;
  border: 1px solid rgba(102, 137, 177, 0.56);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(17, 29, 45, 0.92),
    rgba(13, 23, 37, 0.96)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(67, 95, 128, 0.14);
  color: #e4cfc1;
  font:
    400 clamp(16px, 1.45vw, 18px) "Cinzel",
    "Palatino Linotype",
    "Georgia",
    serif;
  line-height: 1.5;
}

.wallet-status-success {
  color: #a7ebb0;
  font-weight: 600;
}

.wallet-option-btn {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  min-height: 54px;
  padding: 12px 16px;
  text-align: center;
  font:
    700 clamp(16px, 1.5vw, 18px) "Trebuchet MS",
    system-ui,
    sans-serif;
  color: #edf4ff;
  background: linear-gradient(
    180deg,
    rgba(58, 77, 106, 0.96),
    rgba(37, 51, 72, 0.96)
  );
  border: 1px solid rgba(121, 151, 189, 0.66);
  border-radius: 14px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 20px rgba(5, 12, 24, 0.18);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}

.wallet-option-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(70, 94, 127, 0.98),
    rgba(43, 61, 86, 0.98)
  );
  border-color: rgba(214, 230, 247, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 24px rgba(5, 12, 24, 0.24);
}

.menu-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(192, 214, 238, 0.24);
}

.menu-modal-head h3 {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: 1px;
  color: #e8f2ff;
}

.menu-modal-close {
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.menu-modal-content {
  display: grid;
  gap: 10px;
  padding: 16px;
  color: #d8e7f8;
  line-height: 1.5;
}

#wallet-modal.menu-modal {
  background: rgba(8, 13, 23, 0.56);
  backdrop-filter: blur(8px);
}

.wallet-modal-card .menu-modal-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(120, 152, 190, 0.28);
}

.wallet-modal-card .menu-modal-head h3 {
  font-size: clamp(28px, 3.1vw, 48px);
  letter-spacing: 0.02em;
  color: #f2f5fb;
  font-family: "Cinzel", "Palatino Linotype", "Georgia", serif;
  font-weight: 700;
}

.wallet-modal-card .menu-modal-content {
  gap: 18px;
  padding: 20px;
}

.wallet-modal-card .menu-modal-close {
  width: 56px;
  min-width: 56px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(155, 129, 103, 0.72);
  background: linear-gradient(
    180deg,
    rgba(18, 26, 40, 0.98),
    rgba(10, 16, 28, 1)
  );
  color: #f1f3f6;
  font-size: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(2, 6, 12, 0.18);
}

.wallet-modal-card .menu-modal-close:hover:not(:disabled) {
  border-color: rgba(199, 176, 150, 0.86);
  background: linear-gradient(
    180deg,
    rgba(25, 35, 52, 1),
    rgba(13, 21, 35, 1)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 22px rgba(2, 6, 12, 0.24);
}

.wallet-empty-note {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(102, 137, 177, 0.42);
  background: rgba(14, 24, 39, 0.9);
  color: #dfe8f6;
  text-align: center;
}

#leaderboard-modal.menu-modal {
  background: rgba(8, 13, 23, 0.56);
  backdrop-filter: blur(8px);
}

.leaderboard-modal-card .menu-modal-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(120, 152, 190, 0.28);
}

.leaderboard-modal-card .menu-modal-head h3 {
  font-size: clamp(28px, 3.1vw, 48px);
  letter-spacing: 0.02em;
  color: #f2f5fb;
  font-family: "Cinzel", "Palatino Linotype", "Georgia", serif;
  font-weight: 700;
}

.leaderboard-modal-card .menu-modal-close {
  width: 56px;
  min-width: 56px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(155, 129, 103, 0.72);
  background: linear-gradient(
    180deg,
    rgba(18, 26, 40, 0.98),
    rgba(10, 16, 28, 1)
  );
  color: #f1f3f6;
  font-size: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(2, 6, 12, 0.18);
}

.leaderboard-modal-card .menu-modal-close:hover:not(:disabled) {
  border-color: rgba(199, 176, 150, 0.86);
  background: linear-gradient(
    180deg,
    rgba(25, 35, 52, 1),
    rgba(13, 21, 35, 1)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 22px rgba(2, 6, 12, 0.24);
}

#rules-modal.menu-modal {
  background: rgba(8, 13, 23, 0.56);
  backdrop-filter: blur(8px);
}

#rules-modal .menu-modal-card {
  width: min(980px, 92vw);
  border-radius: 28px;
  border: 1px solid rgba(123, 157, 198, 0.72);
  background: linear-gradient(
    180deg,
    rgba(30, 44, 65, 0.96) 0%,
    rgba(19, 31, 49, 0.98) 100%
  );
  box-shadow:
    0 28px 80px rgba(4, 10, 20, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -18px 34px rgba(0, 0, 0, 0.16);
}

#rules-modal .menu-modal-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(120, 152, 190, 0.28);
}

#rules-modal .menu-modal-head h3 {
  font-size: clamp(28px, 3.1vw, 48px);
  letter-spacing: 0.02em;
  color: #f2f5fb;
  font-family: "Cinzel", "Palatino Linotype", "Georgia", serif;
  font-weight: 700;
}

#rules-modal .menu-modal-close {
  width: 56px;
  min-width: 56px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(155, 129, 103, 0.72);
  background: linear-gradient(
    180deg,
    rgba(18, 26, 40, 0.98),
    rgba(10, 16, 28, 1)
  );
  color: #f1f3f6;
  font-size: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(2, 6, 12, 0.18);
}

#rules-modal .menu-modal-close:hover:not(:disabled) {
  border-color: rgba(199, 176, 150, 0.86);
  background: linear-gradient(
    180deg,
    rgba(25, 35, 52, 1),
    rgba(13, 21, 35, 1)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 22px rgba(2, 6, 12, 0.24);
}

#rules-modal .menu-modal-content {
  gap: 22px;
  padding: 24px 20px 26px;
}

#rules-modal .menu-modal-content p {
  margin: 0;
  color: #e2e9f6;
  font:
    400 clamp(16px, 1.45vw, 18px) "Cinzel",
    "Palatino Linotype",
    "Georgia",
    serif;
  line-height: 1.9;
}

/* Warm island modal theme for wallet, leaderboard, and rules */
#wallet-modal.menu-modal,
#leaderboard-modal.menu-modal,
#rules-modal.menu-modal {
  background: rgba(52, 33, 15, 0.2);
  backdrop-filter: blur(14px) saturate(1.04);
}

#wallet-modal .menu-modal-card,
#leaderboard-modal .menu-modal-card,
#rules-modal .menu-modal-card {
  border-radius: 28px;
  border: 1px solid rgba(145, 103, 60, 0.46);
  background: linear-gradient(
    180deg,
    rgba(252, 244, 227, 0.94) 0%,
    rgba(243, 223, 183, 0.92) 42%,
    rgba(227, 191, 126, 0.9) 100%
  );
  box-shadow:
    0 24px 64px rgba(50, 27, 10, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    inset 0 -22px 34px rgba(141, 90, 38, 0.08);
  color: #4d3019;
}

#wallet-modal .menu-modal-head,
#leaderboard-modal .menu-modal-head,
#rules-modal .menu-modal-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(146, 104, 60, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 241, 0.44),
    rgba(255, 255, 255, 0)
  );
}

#wallet-modal .menu-modal-head h3,
#leaderboard-modal .menu-modal-head h3,
#rules-modal .menu-modal-head h3 {
  color: #4b2f18;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

#wallet-modal .menu-modal-content,
#leaderboard-modal .menu-modal-content,
#rules-modal .menu-modal-content {
  color: #5c3a1f;
}

#wallet-modal .menu-modal-close,
#leaderboard-modal .menu-modal-close,
#rules-modal .menu-modal-close {
  border: 1px solid rgba(122, 78, 40, 0.72);
  background: linear-gradient(
    180deg,
    rgba(172, 114, 61, 0.98),
    rgba(133, 83, 40, 0.98)
  );
  color: #fff7ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 198, 0.22),
    0 10px 18px rgba(84, 44, 16, 0.14);
}

#wallet-modal .menu-modal-close:hover:not(:disabled),
#leaderboard-modal .menu-modal-close:hover:not(:disabled),
#rules-modal .menu-modal-close:hover:not(:disabled) {
  border-color: rgba(147, 92, 46, 0.88);
  background: linear-gradient(
    180deg,
    rgba(184, 123, 66, 1),
    rgba(143, 90, 45, 1)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 209, 0.3),
    0 12px 22px rgba(84, 44, 16, 0.18);
}

#wallet-modal .wallet-option-btn {
  color: #fff9ef;
  background: linear-gradient(
    180deg,
    rgba(164, 107, 57, 0.98),
    rgba(124, 77, 38, 0.98)
  );
  border: 1px solid rgba(104, 61, 28, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 191, 0.24),
    0 12px 20px rgba(84, 44, 16, 0.16);
  text-shadow: 0 1px 0 rgba(67, 35, 12, 0.45);
}

#wallet-modal .wallet-option-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(180, 118, 62, 0.98),
    rgba(137, 85, 42, 0.98)
  );
  border-color: rgba(120, 72, 34, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 234, 203, 0.28),
    0 14px 24px rgba(84, 44, 16, 0.18);
}

#wallet-modal .wallet-status,
#wallet-modal .wallet-empty-note {
  border: 1px solid rgba(154, 113, 72, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 241, 0.74),
    rgba(245, 225, 187, 0.56)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 0 0 1px rgba(171, 127, 83, 0.06);
  color: #6a4425;
}

#wallet-modal .wallet-status-success {
  color: #3f7b31;
}

#leaderboard-modal .leaderboard-panel {
  border: 1px solid rgba(154, 113, 72, 0.26);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 241, 0.7),
    rgba(245, 225, 187, 0.5)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 0 1px rgba(171, 127, 83, 0.05);
}

#leaderboard-modal .leaderboard-panel h4 {
  color: #53341a;
  border-bottom: 1px solid rgba(154, 113, 72, 0.22);
  background: rgba(255, 246, 223, 0.42);
}

#leaderboard-modal .leaderboard-table th,
#leaderboard-modal .leaderboard-table td {
  color: #614022;
  border-bottom: 1px solid rgba(133, 92, 54, 0.12);
}

#leaderboard-modal .leaderboard-table th {
  color: #4c2c14;
  background: rgba(248, 233, 198, 0.66);
}

#leaderboard-modal .leaderboard-table tbody tr:hover {
  background: rgba(223, 181, 110, 0.14);
}

#leaderboard-modal .leaderboard-loading,
#leaderboard-modal .leaderboard-error {
  border: 1px solid rgba(154, 113, 72, 0.22);
  background: rgba(255, 247, 227, 0.58);
  color: #5d3c20;
}

#leaderboard-modal .leaderboard-error {
  border-color: rgba(186, 92, 63, 0.45);
  color: #8b3d2d;
}

#rules-modal .menu-modal-content p {
  color: #614021;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgb(17 25 39), rgb(3, 10, 21));
  color: var(--text);
  padding: 11px 16px;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 151, 0.72);
  background: linear-gradient(180deg, rgb(45, 65, 95), rgb(28, 42, 65));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: #f3f3f3;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.footer-row {
  margin-top: 2px;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--sub);
}

.menu-utility-btn {
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  /* min-width: 148px; */
  background: linear-gradient(
    180deg,
    rgba(44, 63, 88, 0.92),
    rgba(21, 31, 45, 0.92)
  );
  font-weight: 600;
}

.menu-utility-btn.is-connected {
  color: #e8f0fa;
  background: rgba(32, 48, 68, 0.9);
  border-color: rgba(192, 214, 238, 0.55);
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

.menu-leave-guest-btn {
  background: rgba(44, 63, 88, 0.92);
  border-color: rgba(200, 160, 180, 0.4);
}

.menu-settings-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: #f8e7c4;
  cursor: pointer;
}

.menu-settings-glyph {
  display: inline-block;
  line-height: 1;
}

.menu-settings-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 151, 0.72);
  background: linear-gradient(180deg, rgb(45, 65, 95), rgb(28, 42, 65));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: #f3f3f3;
}

.menu-settings-btn:active {
  transform: scale(0.96);
  background: linear-gradient(180deg, rgb(38, 55, 82), rgb(24, 36, 52));
}

.menu-settings-btn:focus-visible {
  outline: 2px solid rgba(214, 242, 255, 0.72);
  outline-offset: 2px;
}

.menu-start-btn {
  min-width: min(420px, 72vw);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 800;
  letter-spacing: 2.2px;
  color: #e8f0fa;
  background: linear-gradient(
    180deg,
    rgba(44, 63, 88, 0.92),
    rgba(21, 31, 45, 0.92)
  );
  border: 1px solid rgba(192, 214, 238, 0.7);
  clip-path: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 0 10px rgba(191, 217, 245, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

.menu-start-btn:hover:not(:disabled) {
  color: #f4f8ff;
  border-color: rgba(214, 230, 247, 0.95);
  background: linear-gradient(
    180deg,
    rgba(56, 79, 108, 0.95),
    rgba(26, 39, 56, 0.95)
  );
}

.card-screen {
  /* background: linear-gradient(
    155deg,
    rgba(8, 14, 23, 0.88),
    rgba(10, 18, 29, 0.92)
  ); */
}

.wallet-options {
  display: grid;
  gap: 12px;
  width: min(460px, 88vw);
}

.status-box {
  /* width: min(560px, 90vw); */
  min-height: 80px;
  border: 2px solid rgba(123, 168, 210, 0.33);
  border-radius: 12px;
  padding: 12px;
  color: var(--sub);
}

.row-buttons {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-screen {
  justify-content: center;
  background:
    radial-gradient(
      circle at 50% 36%,
      rgba(130, 50, 71, 0.24),
      transparent 42%
    ),
    linear-gradient(170deg, rgba(11, 9, 16, 0.85), rgba(16, 10, 19, 0.88));
}

.hero-modal {
  width: min(1040px, 96vw);
  max-height: calc(100vh - 110px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(245, 214, 158, 0.36);
  background: linear-gradient(
    170deg,
    rgba(48, 22, 35, 0.93),
    rgba(20, 12, 23, 0.94)
  );
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 36px rgba(248, 189, 109, 0.08);
  padding: 18px;
}

.hero-modal h2 {
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: 1.2px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  width: min(1000px, 94vw);
}

.hero-card {
  padding: 14px;
  min-height: 250px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(127, 216, 255, 0.22) inset;
}

.hero-visual {
  position: relative;
  width: 100%;
  height: 176px;
  border-radius: 12px;
  border: 2px solid rgba(140, 184, 224, 0.28);
  background: radial-gradient(
    circle at 50% 42%,
    rgba(92, 139, 189, 0.42),
    rgba(24, 38, 59, 0.86)
  );
  overflow: hidden;
}

.hero-sprite {
  position: absolute;
  left: 50%;
  background-image: var(--sheet-url);
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.hero-sprite {
  bottom: 6px;
  width: 154px;
  height: 154px;
  transform: translateX(-50%);
  background-size: calc(var(--frames, 6) * 100%) 100%;
  /* animation: hero-sheet-6 1s steps(6) infinite; */
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.hero-meta {
  color: var(--sub);
  margin-top: 4px;
}

.hero-selected-line {
  width: 100%;
  background: rgba(18, 30, 47, 0.82);
  border: 2px solid rgba(133, 171, 209, 0.36);
  border-radius: 12px;
  padding: 12px 14px;
  color: #d9e9ff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.attune-details {
  width: min(900px, 92vw);
  background: var(--panel-strong);
  border: 2px solid rgba(246, 211, 152, 0.24);
  border-radius: 12px;
  padding: 30px;
  display: grid;
  gap: 8px;
}

.attune-title {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.attune-row {
  display: flex;
  gap: 10px;
}

.attune-row button.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(243, 203, 113, 0.18) inset;
}

.settings-screen {
  justify-content: flex-start;
  align-items: stretch;
  padding: 12px 16px 16px;
  max-height: 100%;
  overflow: hidden;
}

.settings-screen .settings-title {
  flex-shrink: 0;
  margin: 0 0 8px;
}

.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.settings-layout {
  width: min(1160px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: stretch;
}

.settings-panel-left {
  width: 100%;
  margin-top: 0;
}

.settings-character-stage {
  position: relative;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.settings-character-frame {
  width: min(280px, 100%);
  aspect-ratio: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.settings-character-glow {
  position: absolute;
  width: 70%;
  height: 64%;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 206, 130, 0.42),
    rgba(233, 124, 95, 0.2) 45%,
    transparent 74%
  );
  filter: blur(10px);
  animation: control-char-glow 2.6s ease-in-out infinite;
}

.settings-character-image {
  width: 88%;
  max-width: 250px;
  height: auto;
  object-fit: contain;
  transform-origin: 50% 82%;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 14px rgba(255, 173, 122, 0.2));
  animation: control-char-float 2.8s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.settings-character-caption {
  display: none;
}

.settings-footer {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-back-btn {
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8e7be 0%, #f2ce94 100%);
  border: 1px solid rgba(255, 234, 194, 0.8);
  color: #3e1d1a;
  cursor: pointer;
}

.settings-back-btn:hover {
  filter: brightness(1.08);
}

.settings-scroll .keybind-sections {
  max-height: none;
  overflow: visible;
}

/* Laptop/desktop: full-width layout, uses whole screen */
.settings-screen-laptop {
  justify-content: flex-start;
  align-items: stretch;
  padding: 16px 24px 24px;
  min-height: 100vh;
  overflow: hidden;
  max-height: 100%;
}

.settings-screen-laptop .settings-title {
  width: 100%;
  text-align: center;
  margin: 0 0 16px;
  font-size: clamp(24px, 2.8vw, 32px);
}

.settings-screen-laptop .settings-scroll {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  padding-right: 0;
}

.settings-screen-laptop .keybind-panel {
  max-width: 100%;
  width: 100%;
}

.settings-screen-laptop .settings-layout {
  width: min(1240px, 98vw);
  grid-template-columns: minmax(640px, 1fr) minmax(300px, 360px);
}

.settings-screen-laptop .attune-title {
  font-size: 15px;
  margin-bottom: 6px;
}

.settings-screen-laptop .settings-scheme-row {
  max-width: 560px;
}

.settings-screen-laptop .settings-scheme-desc {
  font-size: 13px;
  margin-bottom: 12px;
  max-width: 560px;
}

.settings-screen-laptop .keybind-subtitle {
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.settings-screen-laptop .keybind-sections {
  max-height: min(62vh, 480px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
  scrollbar-width: none;
}

.settings-screen-laptop .bind-section {
  min-width: 0;
}

.settings-screen-laptop .bind-row {
  padding: 8px 12px;
}

.settings-screen-laptop .keybind-hint,
.settings-screen-laptop .settings-pending-hint {
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.settings-screen-laptop .row-buttons.settings-actions-row {
  display: none;
}

.settings-screen-laptop .settings-footer {
  margin-top: 20px;
  padding-top: 16px;
  width: min(1240px, 98vw);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: flex-start;
}

.settings-screen-laptop .settings-footer .settings-back-btn {
  max-width: 200px;
}

/* Mobile/tablet: all on one screen, no scroll */
.settings-screen-compact {
  padding: 8px 12px 12px;
  justify-content: flex-start;
  max-height: 100dvh;
  height: 100%;
}

.settings-screen-compact .settings-title {
  font-size: clamp(18px, 4vw, 22px);
  margin: 0 0 4px;
}

.settings-screen-compact .settings-scroll {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-right: 0;
  align-items: center;
  justify-content: center;
}

.settings-screen-compact .settings-layout {
  width: 100%;
  grid-template-columns: 1fr;
  gap: 10px;
}

.settings-screen-compact .settings-footer {
  display: none;
}

.settings-screen-compact .settings-character-stage {
  min-height: 180px;
  padding: 0;
}

.settings-screen-compact .settings-character-frame {
  width: min(220px, 92vw);
}

.settings-screen-compact .settings-character-image {
  width: 84%;
}

.settings-screen-compact .keybind-panel {
  margin-top: 0;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.settings-screen-compact .attune-title {
  font-size: 14px;
  margin-bottom: 2px;
}

.settings-screen-compact .settings-scheme-row {
  margin-bottom: 4px;
}

.settings-screen-compact .settings-scheme-label {
  font-size: 14px;
}

.settings-screen-compact .settings-scheme-select {
  padding: 6px 8px;
  font-size: 12px;
}

.settings-screen-compact .settings-scheme-desc {
  font-size: 11px;
  margin-bottom: 6px;
  line-height: 1.25;
}

.settings-screen-compact .keybind-subtitle {
  font-size: 12px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.settings-screen-compact .keybind-sections {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
}

.settings-screen-compact .bind-section {
  gap: 2px;
}

.settings-screen-compact .bind-section-title {
  font-size: 10px;
  margin-bottom: 2px;
}

.settings-screen-compact .bind-grid {
  gap: 2px;
}

.settings-screen-compact .bind-row {
  display: grid;
  /* grid-template-columns: 1fr auto 1fr; */
  gap: 4px;
  align-items: center;
  font-size: 14px;
  padding: 6px 10px;
}

.settings-screen-compact .bind-action {
  font-size: 14px;
}

.settings-screen-compact .bind-key {
  font-size: 14px;
}

.settings-screen-compact .bind-change {
  padding: 4px 6px;
  font-size: 14px;
}

.settings-screen-compact .keybind-hint,
.settings-screen-compact .settings-pending-hint {
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.settings-screen-compact .row-buttons.settings-actions-row {
  margin-top: 6px;
  gap: 8px;
  flex-shrink: 0;
}

.settings-screen-compact .settings-actions-row button {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
}

.keybind-panel {
  margin-top: 8px;
  max-width: min(560px, 92vw);
}

.settings-scheme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.settings-scheme-label {
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.settings-scheme-select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(126, 171, 215, 0.45);
  background: rgba(18, 28, 42, 0.9);
  color: var(--text);
  font-size: 14px;
}

.settings-scheme-desc {
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.35;
}

.keybind-subtitle {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 14px;
}

.keybind-sections {
  max-height: min(50vh, 380px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bind-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bind-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(180, 220, 255, 0.85);
}

.bind-grid {
  display: grid;
  gap: 6px;
}

.bind-section-fire-panel .bind-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .bind-section-fire-panel .bind-grid {
    grid-template-columns: 1fr;
  }
}

.keybind-hint {
  color: var(--sub);
  font-size: 12px;
  margin-top: 12px;
  margin-bottom: 4px;
  line-height: 1.35;
}

.bind-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  align-items: center;
  background: rgba(20, 34, 52, 0.026);
  border: 1px solid rgb(239 227 218 / 31%);
  border-radius: 10px;
  padding: 8px 10px;
}

.bind-action {
  font-weight: 600;
  font-size: 14px;
}

.bind-key {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.bind-change {
  min-width: 100px;
  padding: 6px 10px;
  font-size: 13px;
}

/* Sci-fi controls theme */
.settings-screen-war {
  position: relative;
  background: rgba(58, 36, 15, 0.18);
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
  padding: 8px 12px 10px;
}

.settings-screen-war::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("https://ik.imagekit.io/6rsuaxauw/axo-quest/main-screen_ughyy1.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.42;
  pointer-events: none;
  filter: blur(8px) saturate(1.02);
  transform: scale(1.03);
}

.settings-screen-war::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(255, 246, 223, 0.18),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      rgba(72, 45, 19, 0.2),
      rgba(50, 29, 10, 0.26)
    );
  pointer-events: none;
}

.settings-screen-war .settings-title,
.settings-screen-war .settings-scroll,
.settings-screen-war .settings-footer {
  position: relative;
  z-index: 1;
}

.settings-screen-war .settings-title {
  margin: 8px auto 10px;
  width: min(1120px, 96vw);
  color: #eef6ff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: clamp(22px, 2.2vw, 30px);
  text-shadow: 0 8px 22px rgba(3, 10, 20, 0.5);
}

.settings-screen-war .settings-scroll {
  padding-bottom: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-screen-war .settings-layout {
  width: min(1120px, 96vw);
  grid-template-columns: 1fr;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.settings-screen-war .settings-character-stage {
  display: none;
}

.settings-screen-war .settings-panel-left {
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(145, 103, 60, 0.42);
  background: linear-gradient(
    180deg,
    rgba(252, 244, 227, 0.94),
    rgba(243, 223, 183, 0.92) 42%,
    rgba(227, 191, 126, 0.9)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 22px 46px rgba(50, 27, 10, 0.18),
    inset 0 -22px 34px rgba(141, 90, 38, 0.08);
  padding: 14px 14px 14px;
  backdrop-filter: blur(8px);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.settings-screen-war .settings-panel-left::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(166, 124, 83, 0.12);
  border-radius: 16px;
  pointer-events: none;
}

.settings-screen-war .settings-panel-left::before {
  content: none;
}

.settings-screen-war .attune-title,
.settings-screen-war .keybind-subtitle,
.settings-screen-war .bind-section-title {
  color: #5b371d;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}

.settings-screen-war .settings-panel-left > .attune-title:first-of-type {
  text-align: center;
  font-size: clamp(22px, 2.3vw, 30px);
  letter-spacing: 0.08em;
  margin: 2px 0 10px;
  color: #4b2f18;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

.settings-screen-war .keybind-sections {
  padding-bottom: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-screen-war .keybind-sections::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.settings-screen-war .bind-grid {
  gap: 4px;
}

.settings-screen-war .bind-section {
  border: 1px solid rgba(154, 113, 72, 0.24);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 241, 0.64),
    rgba(245, 225, 187, 0.44)
  );
  border-radius: 16px;
  padding: 8px;
}

.settings-screen-war .bind-section-fire-panel {
  grid-column: 1 / -1;
}

.settings-screen-war .bind-row {
  border-radius: 12px;
  border: 1px solid rgba(154, 113, 72, 0.18);
  background: rgba(255, 247, 227, 0.54);
  padding: 4px 7px;
  min-height: 32px;
}

.settings-screen-war .bind-grid .bind-row:first-child {
  border-top-width: 1px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.settings-screen-war .bind-grid .bind-row:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.settings-screen-war .bind-action {
  color: #57371d;
  font-size: 13px;
  font-weight: 600;
}

.settings-screen-war .bind-key {
  color: #8a5a2e;
  font-size: 12px;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.settings-screen-war .bind-change {
  min-width: 82px;
  padding: 3px 7px;
  font-size: 12px;
  border-radius: 10px;
  border: 1px solid rgba(122, 78, 40, 0.58);
  background: linear-gradient(
    180deg,
    rgba(164, 107, 57, 0.98),
    rgba(124, 77, 38, 0.98)
  );
  color: #fff7ef;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(67, 35, 12, 0.45);
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    border-color 0.12s ease;
}

.settings-screen-war .bind-change:hover {
  filter: brightness(1.04);
  border-color: rgba(140, 90, 46, 0.8);
  transform: translateY(-1px);
}

.settings-screen-war #btn-reset-bind,
.settings-screen-war .settings-back-btn {
  border-radius: 12px;
  border: 1px solid rgba(122, 78, 40, 0.58);
  background: linear-gradient(
    180deg,
    rgba(164, 107, 57, 0.98),
    rgba(124, 77, 38, 0.98)
  );
  color: #fff7ef;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(67, 35, 12, 0.45);
}

.settings-screen-war #btn-reset-bind:hover:not(:disabled),
.settings-screen-war .settings-back-btn:hover:not(:disabled),
.settings-screen-war #btn-reset-bind:focus-visible,
.settings-screen-war .settings-back-btn:focus-visible {
  border-color: rgba(140, 90, 46, 0.8);
  background: linear-gradient(
    180deg,
    rgba(180, 118, 62, 0.98),
    rgba(137, 85, 42, 0.98)
  );
  color: #fffaf2;
  box-shadow:
    inset 0 1px 0 rgba(255, 234, 203, 0.28),
    0 14px 24px rgba(84, 44, 16, 0.18);
}

.settings-screen-war .settings-footer {
  display: none;
}

.settings-screen-war .settings-footer .settings-back-btn {
  max-width: 150px;
  padding: 8px 14px;
  font-size: 12px;
}

.settings-screen-war .row-buttons.settings-actions-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(154, 113, 72, 0.18);
}

.settings-screen-war .settings-actions-row button {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.settings-screen-war .keybind-hint,
.settings-screen-war .settings-pending-hint {
  color: rgba(98, 66, 37, 0.88);
  font-size: 13px;
  margin: 2px 0 0;
}

@media (max-width: 980px) {
  .settings-screen-war .keybind-sections {
    grid-template-columns: 1fr;
  }

  .settings-screen-war .bind-section-fire-panel {
    grid-column: auto;
  }
}

@media (max-height: 820px) {
  .settings-screen-war .settings-title {
    margin: 4px auto 6px;
    font-size: clamp(18px, 2vw, 24px);
  }

  .settings-screen-war .settings-panel-left {
    padding: 10px 10px 10px;
  }

  .settings-screen-war .attune-title,
  .settings-screen-war .keybind-subtitle,
  .settings-screen-war .bind-section-title {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .settings-screen-war .keybind-sections {
    gap: 6px 8px;
  }

  .settings-screen-war .bind-row {
    padding: 3px 6px;
    min-height: 30px;
  }

  .settings-screen-war .row-buttons.settings-actions-row {
    margin-top: 8px;
    padding-top: 6px;
    gap: 8px;
  }
}

@media (max-height: 760px) {
  .settings-screen-war .settings-panel-left {
    padding: 10px 10px 12px;
  }

  .settings-screen-war .keybind-sections {
    gap: 6px 8px;
  }

  .settings-screen-war .bind-row {
    padding: 4px 7px;
    min-height: 32px;
  }

  .settings-screen-war .bind-action {
    font-size: 11px;
  }

  .settings-screen-war .bind-key,
  .settings-screen-war .bind-change {
    font-size: 10px;
  }
}

.map-screen {
  justify-content: flex-start;
  padding-top: 26px;
}

.map-layout {
  width: min(980px, 94vw);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.level-list,
.level-info {
  background: var(--panel);
  border: 2px solid rgba(133, 171, 209, 0.3);
  border-radius: 12px;
  padding: 12px;
  max-height: min(58vh, 520px);
  overflow: auto;
}

.level-row {
  width: 100%;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-row.selected {
  border-color: var(--accent);
}

.status-grid {
  display: grid;
  gap: 8px;
  width: min(620px, 90vw);
  background: var(--panel);
  border: 2px solid rgba(130, 176, 217, 0.34);
  border-radius: 12px;
  padding: 14px;
  color: var(--sub);
}

.route-map-screen {
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  background-color: rgba(6, 18, 32, 0.98);
  background-image: var(--route-map-bg);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.route-map-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 18, 38, 0.14) 0%,
    rgba(6, 28, 58, 0.08) 45%,
    rgba(4, 22, 48, 0.12) 100%
  );
  pointer-events: none;
}

.route-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(20px, 4vh, 36px) 16px clamp(12px, 2vh, 20px);
  flex-shrink: 0;
}

.route-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--sub);
}

.route-map-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.route-map-layout-planet {
  height: 100%;
}

.route-grid.route-grid-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  align-items: start;
}

.route-node {
  position: relative;
  min-height: 220px;
}

.route-step-1 {
  transform: translateY(8px);
}

.route-step-2 {
  transform: translateY(56px);
}

.route-step-3 {
  transform: translateY(14px);
}

.route-step-4 {
  transform: translateY(48px);
}

.route-step-badge {
  position: absolute;
  top: 0px;
  left: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 999px;
  background: radial-gradient(circle, #ffe29e 0%, #e1ad52 55%, #8d652d 100%);
  color: #251708;
  border: 2px solid rgba(255, 244, 209, 0.65);
  box-shadow: 0 0 12px rgba(255, 219, 144, 0.55);
  z-index: 3;
}

.route-island {
  width: min(190px, 20vw);
  height: 100px;
  border-radius: 12px;
  margin: 16px auto 0;
  background-color: rgba(84, 72, 132, 0.86);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(217, 230, 255, 0.24);
  box-shadow:
    inset 0 0 20px rgba(14, 18, 32, 0.45),
    0 16px 26px rgba(0, 0, 0, 0.42);
}

.route-node-meta {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--sub);
}

.route-level-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-hero-tag {
  margin-top: 4px;
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(252, 219, 164, 0.14);
  border: 1px solid rgba(252, 219, 164, 0.6);
  color: #ffe7c4;
}

.route-hero-tag-next {
  margin-left: 6px;
  background: rgba(173, 210, 248, 0.16);
  border-color: rgba(192, 214, 238, 0.72);
  color: #e8f2ff;
}

.route-node.is-origin .route-island {
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 226, 190, 0.45),
    0 0 0 4px rgba(255, 224, 188, 0.14);
}

.route-node.is-target .route-island {
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(192, 214, 238, 0.52),
    0 0 0 4px rgba(173, 210, 248, 0.18);
}

.route-node.is-origin::after {
  content: "";
  position: absolute;
  left: calc(50% - 30px);
  top: -9px;
  width: 40px;
  height: 40px;
  background-image: var(
    --route-hero-icon,
    url(https://ik.imagekit.io/6rsuaxauw/axo-quest/icon-75-5_np9ann.png)
  );
  background-size: 78%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow:
    0 0 0 3px rgb(244 206 129),
    0 0 18px rgba(255, 214, 160, 0.6);
  border-radius: 50%;
  background-color: #120e18;
  padding: 5px;
  z-index: 3;
  animation:
    route-axo-float 1.9s ease-in-out infinite,
    route-axo-glow 1.9s ease-in-out infinite;
}

.route-node.is-origin::before {
  content: "";
  position: absolute;
  left: calc(50% - 22px);
  top: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 223, 170, 0.6) 0%,
    rgba(173, 210, 248, 0.35) 45%,
    rgba(173, 210, 248, 0) 100%
  );
  transform: scale(0.7);
  z-index: 2;
  pointer-events: none;
  animation: route-axo-ripple 1.9s ease-out infinite;
}

.route-map-screen.is-transitioning .route-node.is-origin::after,
.route-map-screen.is-transitioning .route-node.is-origin::before {
  display: none;
}

.route-travel-hero {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.route-travel-hero.is-running {
  opacity: 1;
  animation: route-hero-travel 1250ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.route-travel-hero-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #120e18;
  background-image: var(
    --route-hero-icon,
    url(https://ik.imagekit.io/6rsuaxauw/axo-quest/icon-75-5_np9ann.png)
  );
  background-repeat: no-repeat;
  background-position: center;
  background-size: 78%;
  box-shadow:
    0 0 0 3px rgba(244, 206, 129, 0.9),
    0 0 20px rgba(255, 214, 160, 0.7);
  animation:
    route-hero-live-float 900ms ease-in-out infinite,
    route-hero-live-glow 1.3s ease-in-out infinite;
}

.route-travel-hero-core::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(197, 224, 255, 0.55);
  opacity: 0;
  transform: scale(0.72);
  animation: route-hero-live-ripple 1.3s ease-out infinite;
}

.route-node.is-target::after {
  content: "";
  position: absolute;
  right: 28px;
  top: -14px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid rgba(192, 214, 238, 0.92);
  filter: drop-shadow(0 0 8px rgba(173, 210, 248, 0.6));
}

.route-connector {
  position: absolute;
  top: 58px;
  left: calc(50% + 64px);
  height: 12px;
  border-top: 8px dotted rgba(211, 236, 255, 0.82);
  transform-origin: left center;
  z-index: 1;
  opacity: 0.92;
}

.route-connector-1 {
  width: clamp(84px, 9vw, 126px);
  transform: rotate(26deg);
}

.route-connector-2 {
  width: clamp(84px, 9vw, 126px);
  transform: rotate(-26deg);
}

.route-connector-3 {
  width: clamp(84px, 9vw, 126px);
  transform: rotate(26deg);
}

@keyframes route-axo-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}

@keyframes route-axo-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(244, 206, 129, 0.8),
      0 0 16px rgba(255, 214, 160, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(192, 214, 238, 0.88),
      0 0 24px rgba(173, 210, 248, 0.8);
  }
}

@keyframes route-axo-ripple {
  0% {
    opacity: 0.8;
    transform: scale(0.6);
  }
  70% {
    opacity: 0.18;
    transform: scale(1.9);
  }
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes route-hero-travel {
  from {
    transform: translate(-50%, -50%);
  }
  to {
    transform: translate(
      calc(-50% + var(--route-travel-dx, 0px)),
      calc(-50% + var(--route-travel-dy, 0px))
    );
  }
}

@keyframes route-hero-live-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg) scale(1);
  }
  50% {
    transform: translateY(-3px) rotate(4deg) scale(1.03);
  }
}

@keyframes route-hero-live-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(244, 206, 129, 0.82),
      0 0 16px rgba(255, 214, 160, 0.52);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(192, 214, 238, 0.9),
      0 0 24px rgba(173, 210, 248, 0.86);
  }
}

@keyframes route-hero-live-ripple {
  0% {
    opacity: 0.7;
    transform: scale(0.74);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@media (max-width: 980px) {
  .route-grid.route-grid-map {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px 14px;
  }

  .route-step-1,
  .route-step-2,
  .route-step-3,
  .route-step-4 {
    transform: none;
  }

  .route-connector {
    display: none;
  }

  .route-node {
    min-height: 188px;
  }

  .route-island {
    width: min(190px, 40vw);
  }
}

.upgrade-box {
  width: min(620px, 90vw);
  background: var(--panel-strong);
  border: 2px solid rgba(169, 208, 247, 0.35);
  border-radius: 12px;
  padding: 12px;
  color: var(--sub);
  display: grid;
  gap: 8px;
}

.card-screen h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.04em;
}

.card-screen .status-grid,
.card-screen .upgrade-box {
  font-size: 15px;
  line-height: 1.4;
}

.card-screen p {
  font-size: 22px;
  line-height: 1.45;
  text-align: center;
  margin: 8px 0;
  padding: 0 100px;
  color: var(--sub);
}

.credits-screen {
  position: relative;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(9, 6, 24, 0.8), rgba(20, 8, 28, 0.78)),
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 181, 217, 0.3),
      transparent 40%
    ),
    radial-gradient(
      circle at 84% 78%,
      rgba(129, 188, 255, 0.24),
      transparent 38%
    ),
    url("https://ik.imagekit.io/6rsuaxauw/axo-quest/main-screen_ughyy1.webp");
  background-size: cover;
  background-position: center;
  animation: menu-bg-pan 24s ease-in-out infinite alternate;
  height: 100vh;
}

.credits-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  /* background:
    repeating-linear-gradient(
      -24deg,
      rgba(255, 255, 255, 0.06) 0 2px,
      transparent 2px 92px
    ),
    radial-gradient(
      circle at 52% 32%,
      rgba(254, 245, 255, 0.2),
      transparent 44%
    ),
    linear-gradient(180deg, rgba(8, 6, 20, 0.68), rgba(5, 8, 17, 0.76)); */
  pointer-events: none;
  animation: menu-sheen-drift 16s linear infinite;
}

.credits-screen::after {
  content: "";
  position: absolute;
  inset: -12% -6%;
  background:
    radial-gradient(
      circle at 74% 68%,
      rgba(255, 206, 230, 0.2),
      transparent 42%
    ),
    radial-gradient(
      circle at 18% 84%,
      rgba(128, 184, 255, 0.18),
      transparent 38%
    );
  filter: blur(18px);
  opacity: 0.72;
  pointer-events: none;
  animation: menu-aura-float 14s ease-in-out infinite;
}

.credits-panel {
  position: relative;
  z-index: 1;
  /* width: min(760px, 92vw); */
  border: 2px solid rgba(255, 205, 231, 0.6);
  border-radius: 28px;
  /* background: linear-gradient(170deg, rgba(255, 245, 252, 0.97), rgba(246, 235, 255, 0.96)); */
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  padding: 30px 30px 24px;
  text-align: center;
  animation: credits-panel-float 6s ease-in-out infinite;
  background: linear-gradient(
    170deg,
    rgba(26, 38, 54, 0.95),
    rgba(12, 19, 30, 0.95)
  );
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 30px rgba(176, 206, 238, 0.12);
}

.credits-title {
  margin: 0 0 12px;
  color: #4f2a4d;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.01em;
  /* text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.92),
    0 0 20px rgba(255, 123, 194, 0.18); */
}

.credits-lead {
  margin: 0 auto 16px;
  max-width: 640px;
  color: #6a365e;
  font-size: clamp(20px, 2.8vw, 36px);
  font-weight: 800;
  line-height: 1.2;
}

.credits-axo-image {
  display: block;
  width: min(280px, 62vw);
  max-height: 280px;
  object-fit: contain;
  margin: 6px auto 10px;
  filter: drop-shadow(0 14px 20px rgba(80, 38, 78, 0.28));
  animation: credits-hero-bob 3.5s ease-in-out infinite;
}

.credits-note {
  margin: 0 auto;
  max-width: 620px;
  color: #7b4b6d;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.28;
}

.credits-actions {
  margin-top: 16px;
}

.credits-go-btn {
  min-width: 220px;

  border-radius: 999px;
  padding: 14px 30px;
  color: #ffffff;
  font-weight: 900;
  font-size: clamp(18px, 2.8vw, 28px);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(76, 20, 54, 0.7);
  /* animation: menu-cta-pulse 2.7s ease-in-out infinite; */
  background: linear-gradient(
    180deg,
    rgba(44, 63, 88, 0.92),
    rgba(21, 31, 45, 0.92)
  );
  border: 1px solid rgba(192, 214, 238, 0.7);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 0 10px rgba(191, 217, 245, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

.credits-go-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 151, 0.72);
  background: linear-gradient(180deg, rgba(90, 44, 64, 0.92), rgb(13 21 31));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: #f3f3f3;
}

.leaderboard-screen {
  justify-content: flex-start;
  padding-top: 24px;
}

.leaderboard-layout {
  width: min(1040px, 96vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.leaderboard-layout > div {
  background: var(--panel);
  border: 2px solid rgba(125, 165, 201, 0.31);
  border-radius: 12px;
  padding: 10px 14px;
  max-height: min(58vh, 460px);
  overflow: auto;
}

.leaderboard-level {
  margin-bottom: 12px;
}

.toast-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  left: 0;
  transform: translateX(0);
  background: rgba(17, 28, 40, 0.96);
  border: 2px solid rgba(149, 203, 255, 0.5);
  border-radius: 9px;
  padding: 12px 20px;
  color: var(--text);
  font-size: 14px;
  max-width: min(90vw, 420px);
  white-space: normal;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.toast-visible {
  opacity: 1;
}

.gameplay-overlay-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gameplay-top-row {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(112, 74, 39, 0.78),
    rgba(62, 39, 20, 0.74)
  );
  border: 1px solid rgba(240, 205, 146, 0.34);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(255, 246, 228, 0.08);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.ios-performance-mode .gameplay-top-row {
  backdrop-filter: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.ios-performance-mode .menu-modal,
.ios-performance-mode .menu-modal-card,
.ios-performance-mode .wallet-modal-card,
.ios-performance-mode .leaderboard-modal-card,
.ios-performance-mode .leaderboard-panel,
.ios-performance-mode .credits-panel,
.ios-performance-mode .leaderboard-layout > div,
.ios-performance-mode .gameplay-top-row,
.ios-performance-mode .touch-esc-pill,
.ios-performance-mode .touch-settings-pill,
.ios-performance-mode .touch-music-pill,
.ios-performance-mode .touch-stick-base,
.ios-performance-mode .touch-stick-knob,
.ios-performance-mode .touch-btn,
.ios-performance-mode .touch-jump,
.ios-performance-mode .touch-fire,
.ios-performance-mode .touch-btn:focus,
.ios-performance-mode .touch-btn.is-down,
.ios-performance-mode .touch-btn:active,
.ios-performance-mode .touch-jump:active,
.ios-performance-mode .touch-fire:active {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

.ios-performance-mode .menu-modal {
  background: rgba(7, 6, 11, 0.82);
}

.ios-performance-mode .menu-modal-card,
.ios-performance-mode .wallet-modal-card,
.ios-performance-mode .leaderboard-modal-card,
.ios-performance-mode .leaderboard-panel,
.ios-performance-mode .credits-panel,
.ios-performance-mode .leaderboard-layout > div,
.ios-performance-mode .gameplay-top-row,
.ios-performance-mode .touch-esc-pill,
.ios-performance-mode .touch-settings-pill,
.ios-performance-mode .touch-music-pill,
.ios-performance-mode .touch-stick-base,
.ios-performance-mode .touch-stick-knob,
.ios-performance-mode .touch-btn,
.ios-performance-mode .touch-jump,
.ios-performance-mode .touch-fire,
.ios-performance-mode .status-pill,
.ios-performance-mode .status-pill.is-on,
.ios-performance-mode .menu-ring {
  box-shadow: none !important;
}

.ios-performance-mode .menu-modal-card,
.ios-performance-mode .wallet-modal-card,
.ios-performance-mode .leaderboard-modal-card,
.ios-performance-mode .leaderboard-panel,
.ios-performance-mode .credits-panel,
.ios-performance-mode .leaderboard-layout > div {
  background: rgba(16, 22, 32, 0.96);
}

.ios-performance-mode .gameplay-top-row,
.ios-performance-mode .touch-esc-pill,
.ios-performance-mode .touch-settings-pill,
.ios-performance-mode .touch-music-pill,
.ios-performance-mode .touch-stick-base,
.ios-performance-mode .touch-btn,
.ios-performance-mode .touch-jump,
.ios-performance-mode .touch-fire {
  background-image: none !important;
}

.ios-performance-mode .gameplay-top-row,
.ios-performance-mode .touch-esc-pill,
.ios-performance-mode .touch-settings-pill,
.ios-performance-mode .touch-music-pill {
  background: rgba(83, 52, 28, 0.92);
}

.ios-performance-mode .touch-stick-base,
.ios-performance-mode .touch-btn,
.ios-performance-mode .touch-jump,
.ios-performance-mode .touch-fire {
  background: rgba(16, 34, 52, 0.9);
}

.ios-performance-mode .menu-fx,
.ios-performance-mode .menu-hero-glow {
  display: none;
}

.ios-performance-mode .carousel-hero,
.ios-performance-mode .credits-axo-image {
  filter: none !important;
}

.touch-controls {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  padding: max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

.touch-panel {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  pointer-events: auto;
}

.touch-move {
  left: calc(36px + env(safe-area-inset-left));
  bottom: calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.touch-row {
  display: flex;
  gap: 12px;
}

.touch-action {
  right: calc(36px + env(safe-area-inset-right));
  bottom: calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.touch-controls-top-row {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Top row (ESC + Settings) always visible â€“ device sizes */
.gameplay-top-row-mobile.gameplay-top-row {
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  gap: 5px;
  padding: 4px;
}

.gameplay-top-row-mobile .touch-esc-pill,
.gameplay-top-row-mobile .touch-settings-pill,
.gameplay-top-row-mobile .touch-music-pill {
  min-width: 48px;
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.gameplay-top-row-mobile .touch-music-pill {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
}

.gameplay-top-row-mobile .touch-settings-pill {
  min-width: 30px;
  width: 30px;
  padding: 0;
}

.gameplay-top-row-mobile .touch-music-glyph {
  font-size: 14px;
}

.gameplay-top-row-mobile .touch-settings-glyph {
  font-size: 15px;
}

.gameplay-top-row-tablet .touch-esc-pill,
.gameplay-top-row-tablet .touch-settings-pill,
.gameplay-top-row-tablet .touch-music-pill {
  min-width: 52px;
  height: 32px;
}

.gameplay-top-row-tablet .touch-music-pill {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.gameplay-top-row-tablet .touch-settings-pill {
  min-width: 34px;
  width: 34px;
}

.gameplay-top-row-tablet .touch-music-glyph {
  font-size: 15px;
}

.gameplay-top-row-desktop .touch-esc-pill,
.gameplay-top-row-desktop .touch-settings-pill,
.gameplay-top-row-desktop .touch-music-pill,
.gameplay-top-row-laptop .touch-esc-pill,
.gameplay-top-row-laptop .touch-settings-pill,
.gameplay-top-row-laptop .touch-music-pill {
  min-width: 56px;
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
}

.gameplay-top-row-desktop .touch-music-pill,
.gameplay-top-row-laptop .touch-music-pill {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
}

.gameplay-top-row-desktop .touch-settings-pill,
.gameplay-top-row-laptop .touch-settings-pill {
  min-width: 36px;
  width: 36px;
}

.gameplay-top-row-desktop .touch-music-glyph,
.gameplay-top-row-laptop .touch-music-glyph {
  font-size: 16px;
}

.gameplay-top-row-desktop .touch-settings-glyph,
.gameplay-top-row-laptop .touch-settings-glyph {
  font-size: 17px;
}

.touch-esc-pill,
.touch-settings-pill,
.touch-music-pill {
  margin: 0;
  padding: 0 13px;
  min-width: 48px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    700 12px "Trebuchet MS",
    system-ui,
    sans-serif;
  letter-spacing: 0.04em;
  color: #fff0da;
  background: linear-gradient(
    180deg,
    rgba(121, 80, 43, 0.78),
    rgba(78, 49, 25, 0.72)
  );
  border: 1px solid rgba(244, 211, 154, 0.46);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 233, 0.06),
    0 4px 12px rgba(49, 25, 7, 0.16);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.touch-settings-pill {
  padding: 0;
  min-width: 32px;
  width: 32px;
}

.touch-music-pill {
  padding: 0;
  min-width: 32px;
  width: 32px;
  border-radius: 50%;
  color: #fff1db;
  background: linear-gradient(
    180deg,
    rgba(146, 97, 54, 0.84),
    rgba(96, 59, 30, 0.84)
  );
  border-color: rgba(244, 211, 154, 0.5);
}

.touch-music-pill.is-muted {
  color: #e6c9a0;
  background: linear-gradient(
    180deg,
    rgba(111, 77, 47, 0.68),
    rgba(69, 44, 25, 0.74)
  );
  border-color: rgba(195, 154, 96, 0.42);
}

.touch-music-glyph {
  display: inline-block;
  line-height: 1;
  font-size: 15px;
}

.touch-settings-glyph {
  display: inline-block;
  line-height: 1;
  font-size: 16px;
  color: #fff0da;
}

.touch-esc-pill:active,
.touch-settings-pill:active,
.touch-music-pill:active {
  transform: scale(0.96);
  background: linear-gradient(
    180deg,
    rgba(146, 97, 54, 0.84),
    rgba(88, 54, 28, 0.82)
  );
}

.touch-music-pill:active {
  background: linear-gradient(
    180deg,
    rgba(156, 107, 62, 0.9),
    rgba(98, 62, 33, 0.86)
  );
}

@media (hover: hover) {
  .touch-esc-pill:hover,
  .touch-settings-pill:hover,
  .touch-music-pill:hover {
    border-color: rgba(255, 229, 183, 0.66);
    background: linear-gradient(
      180deg,
      rgba(153, 102, 57, 0.86),
      rgba(92, 58, 30, 0.82)
    );
  }

  .touch-music-pill:hover {
    border-color: rgba(255, 229, 183, 0.7);
    background: linear-gradient(
      180deg,
      rgba(166, 114, 68, 0.9),
      rgba(103, 66, 36, 0.86)
    );
  }
}

/* Device-specific: mobile */
.touch-controls-mobile .touch-controls-top-row {
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  gap: 6px;
}

.touch-controls-mobile .touch-esc-pill,
.touch-controls-mobile .touch-settings-pill {
  min-width: 44px;
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
}

.touch-controls-mobile .touch-settings-pill {
  min-width: 28px;
  width: 28px;
  padding: 0;
}

.touch-controls-mobile .touch-settings-glyph {
  font-size: 14px;
}

/* Device-specific: tablet */
.touch-controls-tablet .touch-controls-top-row {
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  gap: 10px;
}

.touch-controls-tablet .touch-esc-pill,
.touch-controls-tablet .touch-settings-pill {
  min-width: 48px;
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.touch-controls-tablet .touch-settings-pill {
  min-width: 32px;
  width: 32px;
}

.touch-controls-tablet .touch-settings-glyph {
  font-size: 17px;
}

/* Device-specific: desktop (touch laptop / large tablet) */
.touch-controls-desktop .touch-controls-top-row,
.touch-controls-laptop .touch-controls-top-row {
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  gap: 12px;
}

.touch-controls-desktop .touch-esc-pill,
.touch-controls-desktop .touch-settings-pill,
.touch-controls-laptop .touch-esc-pill,
.touch-controls-laptop .touch-settings-pill {
  min-width: 52px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
}

.touch-controls-desktop .touch-settings-pill,
.touch-controls-laptop .touch-settings-pill {
  min-width: 34px;
  width: 34px;
}

.touch-controls-desktop .touch-settings-glyph,
.touch-controls-laptop .touch-settings-glyph {
  font-size: 18px;
}

.touch-controls-mobile .touch-panel {
  bottom: calc(8px + env(safe-area-inset-bottom));
}

.touch-controls-mobile .touch-move {
  left: calc(32px + env(safe-area-inset-left));
  bottom: calc(24px + env(safe-area-inset-bottom));
}

.touch-controls-mobile .touch-action {
  right: calc(32px + env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
}

.touch-controls-tablet .touch-panel {
  bottom: calc(10px + env(safe-area-inset-bottom));
}

.touch-controls-tablet .touch-move {
  left: calc(34px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
}

.touch-controls-tablet .touch-action {
  right: calc(34px + env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
}

.touch-controls-desktop .touch-panel,
.touch-controls-laptop .touch-panel {
  bottom: calc(14px + env(safe-area-inset-bottom));
}

.touch-controls-desktop .touch-move,
.touch-controls-laptop .touch-move {
  left: calc(38px + env(safe-area-inset-left));
  bottom: calc(30px + env(safe-area-inset-bottom));
}

.touch-controls-desktop .touch-action,
.touch-controls-laptop .touch-action {
  right: calc(38px + env(safe-area-inset-right));
  bottom: calc(30px + env(safe-area-inset-bottom));
}

.touch-move-label,
.touch-fire-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(216, 235, 255, 0.78);
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.touch-stick-base {
  position: relative;
  width: min(26vw, 145px);
  height: min(26vw, 145px);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(244, 249, 255, 0.05);
  border: 1px solid rgba(166, 203, 240, 0.08);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  box-shadow: 0 8px 16px rgba(3, 8, 16, 0.14);
}

.touch-stick-ring {
  display: none;
}

.touch-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  border: 2px solid rgba(202, 232, 255, 0.2);
  background: rgba(244, 249, 255, 0.08);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.06),
    0 4px 10px rgba(0, 0, 0, 0.12);
  transform: translate(-50%, -50%);
  transition:
    transform 0.04s linear,
    filter 0.08s ease;
  pointer-events: none;
}

.touch-stick-base.is-active .touch-stick-knob {
  filter: brightness(1.04);
}

.touch-action-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.touch-btn {
  position: relative;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(174, 216, 255, 0.3);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #eef7ff;
  font-size: 14px;
  font-weight: 700;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.06),
    0 8px 16px rgba(0, 0, 0, 0.16);
  touch-action: none;
  transition:
    transform 0.08s ease,
    filter 0.08s ease,
    border-color 0.08s ease;
  text-transform: uppercase;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent !important;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:focus {
  outline: none;
  background: rgba(244, 249, 255, 0.08);
  background-color: rgba(244, 249, 255, 0.08);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.touch-btn.is-down {
  transform: scale(0.93);
  filter: none;
  border-color: rgba(234, 246, 255, 0.55);
  background: rgba(244, 249, 255, 0.14) !important;
  background-color: rgba(244, 249, 255, 0.14) !important;
  background-image: none !important;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.touch-btn:active,
.touch-jump:active,
.touch-fire:active {
  background: rgba(244, 249, 255, 0.1) !important;
  background-color: rgba(244, 249, 255, 0.1) !important;
  background-image: none !important;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  filter: none;
}

.touch-jump {
  min-width: 76px;
  min-height: 76px;
  font-size: 17px;
  border-color: rgba(167, 210, 255, 0.34);
  background: rgba(244, 249, 255, 0.05);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.touch-fire {
  min-width: 76px;
  min-height: 76px;
  font-size: 17px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border-color: rgba(255, 189, 128, 0.4);
  background: rgba(255, 248, 238, 0.05);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  color: rgba(255, 245, 230, 0.9);
}

.touch-fire::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(255, 190, 124, 0.32);
  pointer-events: none;
}

/* PUBG-style touch control theme */
.touch-controls-pubg .touch-stick-base {
  background: rgba(244, 249, 255, 0.05);
  border: 2px solid rgba(210, 234, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.touch-controls-pubg .touch-stick-knob {
  width: 36%;
  height: 36%;
  background: rgba(244, 249, 255, 0.1);
  border: 2px solid rgba(224, 241, 255, 0.44);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.touch-controls-pubg .touch-btn {
  border-width: 2px;
  border-color: rgba(220, 240, 255, 0.44);
  color: rgba(242, 248, 255, 0.96);
  background: rgba(246, 251, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.touch-controls-pubg .touch-jump {
  border-color: rgba(177, 216, 255, 0.48);
  color: rgba(230, 244, 255, 0.96);
}

.touch-controls-pubg .touch-fire {
  border-color: rgba(255, 198, 136, 0.5);
  color: rgba(255, 241, 222, 0.96);
}

.touch-controls-pubg .touch-btn.is-down,
.touch-controls-pubg .touch-btn:active {
  transform: scale(0.94);
  background: rgba(244, 249, 255, 0.1) !important;
  background-color: rgba(244, 249, 255, 0.1) !important;
  background-image: none !important;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  border-color: rgba(236, 246, 255, 0.64);
}

@keyframes hero-sheet-6 {
  from {
    background-position-x: 0%;
  }
  to {
    background-position-x: 100%;
  }
}

@keyframes control-char-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.8deg) scale(1);
  }
  50% {
    transform: translateY(-8px) rotate(0.8deg) scale(1.012);
  }
}

@keyframes control-char-glow {
  0%,
  100% {
    opacity: 0.74;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes drift-fx-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-12px, 8px, 0);
  }
}

@keyframes drift-fx-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(10px, -10px, 0);
  }
}

@keyframes menu-bg-pan {
  0% {
    background-position:
      center,
      16% 20%,
      85% 80%,
      center;
  }
  100% {
    background-position:
      center,
      28% 14%,
      76% 86%,
      center;
  }
}

@keyframes menu-sheen-drift {
  0% {
    transform: translate3d(-2%, 0, 0);
    opacity: 0.74;
  }
  50% {
    transform: translate3d(2%, -2%, 0);
    opacity: 0.92;
  }
  100% {
    transform: translate3d(-2%, 0, 0);
    opacity: 0.74;
  }
}

@keyframes menu-aura-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.5%, -1.5%, 0) scale(1.04);
  }
}

@keyframes menu-cta-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.55),
      0 16px 28px rgba(135, 24, 85, 0.34);
  }
  50% {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.6),
      0 22px 34px rgba(172, 32, 108, 0.42);
  }
}

@keyframes credits-panel-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes credits-hero-bob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.015);
  }
}

@keyframes loading {
  0% {
    transform: rotateX(0) rotateY(0) rotateZ(0);
  }
  33% {
    transform: rotateX(180deg) rotateY(0) rotateZ(0);
  }
  67% {
    transform: rotateX(180deg) rotateY(180deg) rotateZ(0);
  }
  100% {
    transform: rotateX(180deg) rotateY(180deg) rotateZ(180deg);
  }
}

@keyframes hero-slide-cycle {
  0% {
    transform: translateX(calc(-50% - 210px));
    opacity: 0;
  }
  8%,
  24% {
    transform: translateX(-50%);
    opacity: 1;
  }
  33% {
    transform: translateX(calc(-50% + 210px));
    opacity: 0;
  }
  34% {
    transform: translateX(calc(-50% - 210px));
    opacity: 0;
  }
  35%,
  100% {
    transform: translateX(calc(-50% - 210px));
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .menu-screen {
    justify-content: flex-start;
    gap: 12px;
    overflow: hidden;
    padding: clamp(12px, 2vw, 20px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .menu-topbar,
  .menu-stage,
  .menu-bottom {
    width: 100%;
    max-width: 100%;
  }

  .menu-topbar {
    flex-direction: column;
    gap: 10px;
  }

  .menu-brand {
    margin-bottom: 0.6rem;
  }

  .menu-brand h1 {
    font-size: clamp(32px, 10vw, 60px);
    letter-spacing: 2px;
  }

  .menu-brand h2 {
    font-size: clamp(11px, 2.8vw, 16px);
  }

  .menu-status-panel {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 6px;
  }

  .menu-status-panel .status-pill {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .menu-utility-btn,
  .menu-leave-guest-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  .menu-settings-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .menu-top-links {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .menu-side-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .menu-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .menu-side-actions {
    order: 2;
  }

  .menu-hero-panel {
    --hero-frame-size: min(58vw, 260px);
    --hero-ring-size: calc(var(--hero-frame-size) + 42px);
    order: 1;
    width: 100%;
    min-width: 0;
    min-height: max(var(--hero-ring-size), 240px);
  }

  .menu-showcase {
    inset: 0;
  }

  .carousel-hero {
    width: min(62vw, 230px);
    height: min(62vw, 230px);
    min-width: 180px;
    min-height: 180px;
  }

  .menu-right-card {
    order: 3;
    width: 100%;
  }

  .menu-bottom {
    order: 4;
    flex-direction: column;
    padding-bottom: 8px;
  }

  .menu-start-btn {
    min-width: 100%;
    font-size: clamp(20px, 7vw, 30px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-modal {
    width: 100%;
    padding: 14px;
  }

  .menu-modal {
    padding: 12px;
  }

  .menu-modal-card,
  .wallet-modal-card {
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: auto;
  }

  .leaderboard-modal-card {
    width: 100%;
    max-height: calc(100vh - 40px);
  }

  .leaderboard-table {
    min-width: 560px;
  }

  .hero-pick-grid {
    grid-template-columns: 1fr;
  }

  .hero-pick-card {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    padding: 10px;
  }

  .hero-pick-portrait {
    width: 90px;
    height: 90px;
  }

  .map-layout,
  .leaderboard-layout {
    grid-template-columns: 1fr;
  }

  button {
    font-size: 14px;
    padding: 9px 10px;
  }

  .keybind-panel {
    max-width: 96vw;
  }

  .bind-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "action change" "key key";
  }

  .bind-action {
    grid-area: action;
  }
  .bind-key {
    grid-area: key;
    font-size: 12px;
  }
  .bind-change {
    grid-area: change;
    min-width: 90px;
  }
}

@media (max-width: 480px) {
  .menu-screen {
    padding: 10px;
  }

  .menu-brand h1 {
    font-size: clamp(28px, 12vw, 40px);
  }

  .menu-status-panel {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .menu-status-panel .status-pill {
    text-align: center;
  }

  .menu-status-panel .menu-utility-btn,
  .menu-status-panel .menu-leave-guest-btn {
    width: 100%;
  }

  .menu-status-panel .menu-settings-btn {
    align-self: center;
  }

  .menu-top-links {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-top-links .menu-side-btn {
    width: 100%;
  }

  .menu-hero-panel {
    --hero-frame-size: min(50vw, 200px);
    --hero-ring-size: calc(var(--hero-frame-size) + 32px);
    min-height: max(var(--hero-ring-size), 200px);
  }

  .carousel-hero {
    min-width: 140px;
    min-height: 140px;
    width: min(50vw, 180px);
    height: min(50vw, 180px);
  }

  .menu-start-btn {
    width: 100%;
    min-width: 0;
    font-size: clamp(18px, 5vw, 24px);
    padding: 14px 16px;
  }
}

@media (max-width: 900px), (pointer: coarse) {
  .bind-row {
    grid-template-columns: 1fr;
    grid-template-areas: unset;
  }

  .bind-action {
    grid-area: unset;
  }
  .bind-key {
    grid-area: unset;
  }
  .bind-change {
    width: 100%;
    min-width: 0;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  .touch-controls {
    display: block;
  }

  .touch-move {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .touch-action {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 900px), (pointer: coarse) {
  .card-screen h2 {
    font-size: clamp(18px, 4vw, 24px);
    margin: 0 0 8px;
  }

  .card-screen .status-grid,
  .card-screen .upgrade-box {
    font-size: 14px;
    padding: 12px;
    gap: 8px;
  }

  .card-screen p {
    font-size: 14px;
    margin: 6px 0;
  }

  .card-screen .row-buttons button {
    font-size: 14px;
    padding: 12px 18px;
  }

  .credits-panel {
    width: min(660px, 95vw);
    border-radius: 18px;
    padding: 20px 14px 16px;
  }

  .credits-title {
    font-size: clamp(28px, 8vw, 42px);
    margin-bottom: 10px;
  }

  .credits-lead {
    font-size: clamp(18px, 5.4vw, 30px);
    margin-bottom: 12px;
  }

  .credits-axo-image {
    width: min(210px, 58vw);
    max-height: 210px;
  }

  .credits-note {
    font-size: clamp(16px, 4.4vw, 24px);
  }

  .credits-go-btn {
    min-width: 180px;
    font-size: clamp(16px, 5vw, 24px);
    padding: 12px 24px;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  .touch-stick-base {
    width: min(24vw, 115px);
    height: min(24vw, 115px);
  }

  .touch-move-label,
  .touch-fire-label {
    font-size: 9px;
  }

  .touch-btn {
    min-width: 54px;
    min-height: 54px;
    font-size: 12px;
  }

  .touch-jump {
    min-width: 68px;
    min-height: 68px;
    font-size: 14px;
  }

  .touch-fire {
    min-width: 68px;
    min-height: 68px;
    font-size: 14px;
  }
}

@media (max-width: 1200px) {
  .menu-stage {
    grid-template-columns: minmax(160px, 220px) minmax(280px, 1fr) minmax(
        170px,
        230px
      );
    gap: 16px;
  }

  .menu-topbar,
  .menu-stage,
  .menu-bottom {
    width: min(1200px, 97vw);
  }

  .menu-hero-frame {
    min-width: 220px;
    min-height: 220px;
  }

  .menu-hero-panel {
    --hero-frame-size: min(52vh, 52vw);
    --hero-ring-size: calc(var(--hero-frame-size) + clamp(36px, 7vw, 78px));
  }

  .carousel-hero {
    width: min(47vh, 47vw);
    height: min(47vh, 47vw);
    min-width: 190px;
    min-height: 190px;
  }
}

@media (orientation: landscape) and (max-height: 900px) {
  .screen {
    padding: 12px;
    gap: 10px;
  }

  .menu-screen {
    overflow: hidden;
    padding: 10px;
    gap: 10px;
  }

  .menu-topbar {
    align-items: center;
    gap: 8px;
    padding-top: 0;
  }
  .menu-brand {
    margin-bottom: 0;
  }
  .settings-screen-compact .settings-scroll {
    overflow: scroll;
    justify-content: flex-start;
  }

  .menu-status-panel {
    padding: 6px;
    gap: 6px;
  }

  .menu-brand h1 {
    font-size: clamp(44px, 3.4vw, 70px);
  }

  .menu-brand h2 {
    font-size: clamp(12px, 1.2vw, 16px);
  }

  .menu-stage {
    grid-template-columns: minmax(130px, 180px) minmax(220px, 1fr) minmax(
        150px,
        220px
      );
    gap: 10px;
    min-height: 0;
    flex: 1;
  }

  .menu-side-actions {
    gap: 8px;
  }

  .menu-side-btn {
    /* padding: 8px 12px;
    font-size: 12px; */
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 999px;
  }

  .menu-hero-panel {
    --hero-frame-size: min(44vh, 44vw);
    --hero-ring-size: calc(var(--hero-frame-size) + 30px);
    min-height: max(var(--hero-ring-size), 180px);
  }

  .menu-hero-frame {
    min-width: 180px;
    min-height: 180px;
  }

  .carousel-hero {
    width: min(41vh, 41vw);
    height: min(41vh, 41vw);
    min-width: 140px;
    min-height: 140px;
  }

  .menu-right-card {
    padding: 10px;
    max-height: 40vh;
    overflow: auto;
  }

  .menu-right-card h3 {
    font-size: clamp(16px, 1.8vw, 22px);
  }

  .menu-right-card p {
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.3;
  }

  .menu-start-btn {
    min-width: min(440px, 78vw);
    font-size: clamp(18px, 2.6vw, 28px);
    padding: 11px 14px;
  }

  .menu-bottom {
    margin-top: auto;
    gap: 6px;
    padding-bottom: 4px;
  }

  .wallet-options {
    width: min(560px, 96vw);
  }

  .hero-modal {
    max-height: calc(100vh - 40px);
    padding: 12px;
  }

  .hero-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
  }

  .hero-card {
    min-height: 180px;
    padding: 10px;
    gap: 8px;
  }

  .hero-visual {
    height: 110px;
  }

  .hero-title {
    font-size: 18px;
  }

  .hero-selected-line {
    font-size: 18px;
    padding: 8px 10px;
  }

  .map-screen,
  .leaderboard-screen {
    padding-top: 10px;
    overflow: auto;
  }

  .map-layout,
  .leaderboard-layout {
    width: min(1200px, 98vw);
    gap: 10px;
  }

  .level-list,
  .level-info,
  .leaderboard-layout > div {
    max-height: min(50vh, 360px);
  }
}

/* ========== Mobile landscape: fit full menu in one screen ========== */
@media (orientation: landscape) and (max-width: 950px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  #game-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .screen {
    padding: 6px 10px;
    gap: 4px;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
  }

  .menu-screen {
    padding: 6px 10px;
    gap: 4px;
    overflow: hidden;
    justify-content: center;
  }

  .menu-topbar {
    gap: 4px;
    padding: 0;
    flex: 0 0 auto;
    min-height: 0;
  }

  .menu-brand {
    margin-bottom: 0;
  }

  .menu-brand h1 {
    font-size: clamp(18px, 4.2vh, 28px);
    letter-spacing: 1px;
    line-height: 1;
  }

  .menu-brand h2 {
    font-size: 10px;
    margin-top: 2px;
    letter-spacing: 1px;
  }

  .menu-status-panel {
    padding: 4px;
    gap: 4px;
  }

  .menu-status-panel .status-pill {
    padding: 4px 8px;
    font-size: 10px;
    min-height: 28px;
  }

  .menu-utility-btn,
  .menu-leave-guest-btn {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 32px;
  }

  .menu-settings-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .menu-top-links {
    gap: 4px;
  }

  .menu-side-btn {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 32px;
  }

  .menu-mobile-row {
    gap: 8px;
    flex: 1;
    min-height: 0;
  }

  .menu-mobile-left {
    gap: 4px;
  }

  .menu-stage {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-hero-panel {
    --hero-frame-size: min(30vh, 38vw);
    --hero-ring-size: calc(var(--hero-frame-size) + 20px);
    width: auto;
    min-width: 0;
    min-height: max(var(--hero-ring-size), 110px);
  }

  .menu-hero-glow {
    width: calc(var(--hero-frame-size) * 0.78);
    height: calc(var(--hero-frame-size) * 0.78);
  }

  .menu-hero-frame {
    min-width: 90px;
    min-height: 90px;
  }

  .carousel-hero {
    width: min(28vh, 34vw);
    height: min(28vh, 34vw);
    min-width: 80px;
    min-height: 80px;
  }

  .menu-bottom {
    flex: 0 0 auto;
    gap: 2px;
    padding: 2px 0;
  }

  .menu-start-btn {
    min-width: min(200px, 50vw);
    padding: 6px 12px;
    font-size: clamp(14px, 2.8vh, 20px);
    letter-spacing: 1px;
  }

  .footer-row {
    font-size: 11px;
    margin-top: 0;
  }

  .menu-modal {
    padding: 8px;
  }

  .menu-modal-card {
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .wallet-modal-card {
    max-height: calc(100dvh - 24px);
  }

  .leaderboard-modal-card {
    max-height: calc(100dvh - 24px);
  }
}

/* Make the leaderboard modal content not exceed the screen */
.leaderboard-modal-card {
  max-height: 85vh !important;
  display: flex;
  flex-direction: column;
}

/* Keep modal header fixed, scroll only the content area */
.leaderboard-modal-card .menu-modal-content {
  flex: 1;
  min-height: 0; /* important for flex children to allow scrolling */
}

/* âœ… Scroll the table vertically */
.leaderboard-table-wrap {
  max-height: 360px; /* pick what looks right, or use 50vh */
  overflow-y: auto;
}

/* Optional: sticky header while scrolling */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(14, 22, 34, 0.95); /* match start-screen blue theme */
}

.route-map-screen {
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  background-color: rgba(6, 18, 32, 0.98);
  background-image: var(--route-map-bg);
  background-position: center;
  /* Fill horizontally with no black side gaps. */
  background-size: cover;
  background-repeat: no-repeat;
}

.route-map-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 18, 38, 0.14) 0%,
    rgba(6, 28, 58, 0.08) 45%,
    rgba(4, 22, 48, 0.12) 100%
  );
  pointer-events: none;
}

.route-map-screen.route-map-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.route-map-screen.route-map-fullscreen .route-map-layout {
  flex: 1;
  width: 100%;
  padding: 0;
  min-height: 0;
}

.route-map-screen.route-map-fullscreen .route-atlas-stage {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 1594 / 658;
}

.route-header {
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  padding: clamp(20px, 4vh, 36px) 16px clamp(12px, 2vh, 20px);
  flex-shrink: 0;
}

.route-title {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff8ec;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(147, 220, 255, 0.18);
}

.route-subtitle {
  margin: 10px auto 0;
  max-width: 520px;
  color: rgba(233, 247, 255, 0.92);
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.route-map-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.route-atlas-stage {
  position: relative;
  width: 100%;
  max-width: min(1200px, 95vw);
  aspect-ratio: 1594 / 658;
  max-height: 100%;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
}

.route-atlas-stage::after {
  content: none;
}

.route-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: clamp(14px, 2.5vh, 24px) 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.route-footer-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.route-footer .route-btn {
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 12px;
  border: 2px solid rgba(239, 184, 110, 0.5);
  background: rgba(26, 38, 54, 0.9);
  color: var(--text);
  cursor: pointer;
}

.route-footer .route-btn-back {
  border-color: rgba(239, 184, 110, 0.5);
  background: rgba(26, 38, 54, 0.9);
}

.route-footer .route-btn-continue {
  border-color: rgba(130, 200, 255, 0.55);
  background: rgba(20, 55, 95, 0.85);
  color: var(--text);
}

.route-runner {
  position: absolute;
  width: 104px;
  height: 104px;
  opacity: 1;
  pointer-events: none;
  z-index: 12;
  transform: translate(-50%, -50%);
}

.route-runner-shadow {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 38px;
  height: 12px;
  border-radius: 50%;
  background: rgba(6, 29, 73, 0.28);
  filter: blur(5px);
  transform: translateX(-50%);
  animation: route-runner-shadow-pulse 0.5s ease-in-out infinite alternate;
}

.route-runner-image {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 82px;
  height: auto;
  display: block;
  transform: translateX(-50%);
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0, 20, 55, 0.22))
    drop-shadow(0 0 8px rgba(170, 240, 255, 0.12));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  animation: route-runner-idle-bob 1.1s ease-in-out infinite alternate;
}

.route-runner.is-traveling .route-runner-image {
  animation:
    route-runner-bob 0.34s ease-in-out infinite alternate,
    route-runner-sway 0.68s ease-in-out infinite alternate;
}

.route-auto-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: min(480px, 88vw);
  padding: 18px 28px;
  border-radius: 16px;
  border: 2px solid rgba(247, 231, 196, 0.35);
  background: rgba(12, 28, 48, 0.82);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.route-auto-copy {
  color: #fef4e0;
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.route-auto-continue strong {
  min-width: 3ch;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.route-auto-bar {
  width: min(280px, 40vw);
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.route-auto-bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe4a6, #7ee8ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform-origin: left center;
  animation: route-auto-bar-fill var(--route-auto-continue-ms, 180000ms) linear
    forwards;
}

@keyframes route-runner-bob {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes route-runner-idle-bob {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(-2px);
  }
}

@keyframes route-runner-sway {
  from {
    transform: translateX(-50%) translateY(0) rotate(-4deg) scale(0.98);
  }
  to {
    transform: translateX(-50%) translateY(-3px) rotate(4deg) scale(1.02);
  }
}

@keyframes route-runner-shadow-pulse {
  from {
    opacity: 0.2;
    transform: translateX(-50%) scaleX(0.92);
  }
  to {
    opacity: 0.34;
    transform: translateX(-50%) scaleX(1.06);
  }
}

@keyframes route-auto-bar-fill {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 980px) {
  .route-atlas-stage {
    border-radius: 28px;
  }

  .route-auto-continue {
    min-width: 0;
  }
}

/* ========== Portal Menu Redesign ========== */
.portal-menu-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  padding: clamp(18px, 2vw, 28px) clamp(18px, 2.5vw, 34px);
  overflow: hidden;
  isolation: isolate;
  --portal-card-border: rgba(156, 191, 208, 0.3);
  --portal-card-bg-top: rgba(27, 42, 56, 0.95);
  --portal-card-bg-bottom: rgba(9, 16, 25, 0.98);
  --portal-accent-top: rgba(88, 171, 214, 0.98);
  --portal-accent-bottom: rgba(29, 96, 136, 0.98);
  --portal-accent-border: rgba(198, 227, 242, 0.44);
  --portal-accent-glow: rgba(93, 178, 217, 0.24);
  background: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/axo%20quest%20banner%201%201%201.webp?updatedAt=1778170517895");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.portal-menu-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(18, 34, 47, 0.22),
      rgba(18, 34, 47, 0.05) 18%,
      rgba(18, 34, 47, 0.04) 76%,
      rgba(18, 34, 47, 0.28)
    ),
    linear-gradient(180deg, rgba(255, 196, 88, 0.08), rgba(7, 23, 35, 0.16) 86%);
  pointer-events: none;
}

.portal-menu-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 68%,
      rgba(11, 24, 34, 0.2) 100%
    );
  opacity: 1;
  pointer-events: none;
}

.portal-menu-screen .menu-fx {
  display: none;
}

.portal-menu-screen .menu-fx-a {
  right: -8vw;
  top: -16vw;
  background: radial-gradient(
    circle,
    rgba(99, 176, 207, 0.24),
    transparent 70%
  );
}

.portal-menu-screen .menu-fx-b {
  left: -14vw;
  bottom: -18vw;
  background: radial-gradient(
    circle,
    rgba(77, 162, 143, 0.28),
    transparent 72%
  );
}

.portal-menu-topbar {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;
  margin-bottom: clamp(8px, 1.5vh, 18px);
  z-index: 3;
}

.portal-menu-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 0;
  gap: 12px;
  background: none;
}

.portal-menu-coin {
  min-height: 52px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border-radius: 999px;
  border: 2px solid rgba(111, 59, 21, 0.45);
  background: linear-gradient(
    180deg,
    rgba(255, 246, 220, 0.94),
    rgba(245, 210, 139, 0.9)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 12px 24px rgba(84, 44, 16, 0.22);
  color: #5f3311;
}

.portal-menu-coin-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(117, 67, 27, 0.82);
}

.portal-menu-coin strong {
  font-size: 18px;
  color: #4b250b;
}

.portal-menu-settings-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(130, 86, 48, 0.58);
  background: linear-gradient(
    180deg,
    rgba(252, 244, 228, 0.96),
    rgba(236, 199, 132, 0.94)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 10px 20px rgba(84, 44, 16, 0.16);
  color: #6a4324;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.portal-menu-settings-btn .menu-settings-glyph,
.portal-menu-settings-btn .touch-settings-glyph {
  color: inherit;
}

.portal-menu-stage {
  width: min(1460px, 100%);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: clamp(14px, 3.2vw, 74px);
  z-index: 3;
}

.portal-banner-menu {
  width: min(100%, clamp(270px, 27vw, 390px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-left: auto;
  transform: translateY(clamp(14px, 3vh, 38px));
}

.portal-banner-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.4vh, 18px);
}

.menu-banner-hotspot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: clamp(16px, 2vw, 26px);
  background-color: transparent !important;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none !important;
  transition: none;
}

.menu-banner-hotspot::after {
  content: none;
}

.menu-banner-hotspot,
.menu-banner-hotspot:hover:not(:disabled),
.menu-banner-hotspot:focus-visible {
  border-color: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  transform: none !important;
}

.menu-banner-hotspot-play {
  --menu-banner-image: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/play.webp?updatedAt=1778169439344");
  width: 100%;
  min-height: clamp(116px, 16vh, 168px);
}

.menu-banner-hotspot-partnership {
  --menu-banner-image: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/partnewrship.webp?updatedAt=1778169439345");
  width: 93%;
  min-height: clamp(74px, 9.5vh, 102px);
}

.menu-banner-hotspot-wallet {
  --menu-banner-image: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/connect%20wallet.webp?updatedAt=1778169439327");
  width: 96%;
  min-height: clamp(72px, 9.3vh, 98px);
}

.menu-banner-hotspot-leaderboard {
  --menu-banner-image: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/leaderboard.webp?updatedAt=1778169439356");
  width: 97%;
  min-height: clamp(76px, 9.7vh, 102px);
}

.menu-banner-hotspot-rules {
  --menu-banner-image: url("https://ik.imagekit.io/6rsuaxauw/axo%20quest%20main%20menu/rules.webp?updatedAt=1778169439380");
  width: 74%;
  min-height: clamp(54px, 7vh, 74px);
}

.menu-banner-hotspot-play,
.menu-banner-hotspot-play:hover:not(:disabled),
.menu-banner-hotspot-play:focus-visible,
.menu-banner-hotspot-partnership,
.menu-banner-hotspot-partnership:hover:not(:disabled),
.menu-banner-hotspot-partnership:focus-visible,
.menu-banner-hotspot-wallet,
.menu-banner-hotspot-wallet:hover:not(:disabled),
.menu-banner-hotspot-wallet:focus-visible,
.menu-banner-hotspot-leaderboard,
.menu-banner-hotspot-leaderboard:hover:not(:disabled),
.menu-banner-hotspot-leaderboard:focus-visible,
.menu-banner-hotspot-rules,
.menu-banner-hotspot-rules:hover:not(:disabled),
.menu-banner-hotspot-rules:focus-visible {
  background:
    center / contain no-repeat var(--menu-banner-image) !important;
}

.portal-hero-panel {
  --hero-frame-size: clamp(250px, 29vw, 430px);
  --hero-ring-size: calc(var(--hero-frame-size) + clamp(36px, 5vw, 70px));
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: calc(var(--hero-ring-size) + 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: start;
}

.portal-hero-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hero-ring-size);
  height: var(--hero-ring-size);
  border-radius: 50%;
  border: 1px solid rgba(209, 232, 249, 0.22);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 12px rgba(198, 226, 247, 0.08),
    0 0 0 26px rgba(198, 226, 247, 0.05);
  pointer-events: none;
}

.portal-hero-ring-outer {
  width: calc(var(--hero-ring-size) + 64px);
  height: calc(var(--hero-ring-size) + 64px);
  border-color: rgba(209, 232, 249, 0.12);
  box-shadow: none;
  opacity: 0.8;
}

.portal-hero-glow {
  position: absolute;
  width: calc(var(--hero-frame-size) * 0.82);
  height: calc(var(--hero-frame-size) * 0.82);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(127, 219, 217, 0.22),
    rgba(95, 162, 218, 0.1) 46%,
    transparent 74%
  );
  filter: blur(18px);
}

.portal-hero-frame {
  position: relative;
  width: var(--hero-frame-size);
  height: var(--hero-frame-size);
  border: 1px solid rgba(197, 224, 245, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(17, 50, 84, 0.42), transparent 46%),
    radial-gradient(
      circle at 50% 58%,
      rgba(5, 14, 28, 0.96),
      rgba(2, 8, 18, 0.99) 74%
    );
  box-shadow:
    inset 0 0 0 10px rgba(201, 225, 244, 0.06),
    inset 0 -30px 90px rgba(0, 0, 0, 0.42),
    0 26px 56px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.portal-hero-showcase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-hero-figure {
  width: min(62%, 250px);
  height: 66%;
  align-self: center;
  margin-bottom: 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.34));
  animation: menu-hero-float 4.6s ease-in-out infinite;
}

.menu-portal-side {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 3;
  justify-self: end;
}

.portal-brand {
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  isolation: isolate;
}

.portal-brand h1 {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.22em;
  font-size: clamp(42px, 4vw, 72px);
  letter-spacing: 0.06em;
  line-height: 0.95;
  font-family: "Cinzel", "Trajan Pro", "Palatino Linotype", "Georgia", serif;
  font-weight: 700;
  color: #f5f8ff;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(10, 18, 28, 0.94),
    0 10px 26px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(108, 174, 255, 0.15);
}

.portal-brand-main,
.portal-brand-accent {
  position: relative;
  display: inline-block;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
}

.portal-brand-main {
  color: #ffffff;
}

.portal-brand-accent {
  letter-spacing: 0.06em;
  color: #ffffff;
}

.portal-brand-accent::after {
  content: none;
  position: absolute;
  left: 0.02em;
  right: 0.02em;
  bottom: 0.08em;
  height: 0.06em;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.42),
    rgba(255, 255, 255, 0)
  );
  opacity: 0.6;
  pointer-events: none;
}

.menu-portal-card,
.menu-action-card,
.menu-utility-card,
.menu-mini-action {
  border: 1px solid var(--portal-card-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.2);
}

.menu-portal-card {
  padding: 18px 20px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(19, 40, 65, 0.72), rgba(7, 16, 29, 0.82)),
    rgba(7, 16, 29, 0.74);
  backdrop-filter: blur(10px);
}

.menu-portal-kicker {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(190, 212, 233, 0.86);
}

.menu-portal-copy {
  margin: 0;
  max-width: 26ch;
  color: #edf4fb;
  font-size: clamp(14px, 1.25vw, 20px);
  line-height: 1.45;
}

.menu-portal-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-info-chip,
.menu-mini-action {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.menu-info-chip {
  border: 1px solid rgba(140, 188, 221, 0.28);
  background: rgba(8, 21, 38, 0.62);
  color: #e4eef8;
}

.menu-mini-action {
  background: rgba(18, 41, 66, 0.86);
  color: #f0f7ff;
}

.menu-action-card {
  width: 100%;
  padding: 18px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: linear-gradient(
    180deg,
    var(--portal-card-bg-top),
    var(--portal-card-bg-bottom)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -18px 36px rgba(0, 0, 0, 0.14),
    0 20px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.menu-action-card-accent {
  /* background:
    linear-gradient(135deg, var(--portal-accent-top), var(--portal-accent-bottom)); */
  border-color: var(--portal-accent-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -20px 40px rgba(0, 0, 0, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.2),
    0 0 28px var(--portal-accent-glow);
}

.menu-action-card-accent.is-connected {
  background: linear-gradient(
    180deg,
    var(--portal-card-bg-top),
    var(--portal-card-bg-bottom)
  );
  border-color: rgba(145, 170, 185, 0.28);
}

.portal-menu-screen .menu-action-card-accent:hover:not(:disabled) {
  border-color: rgba(228, 241, 249, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -20px 40px rgba(0, 0, 0, 0.12),
    0 22px 44px rgba(0, 0, 0, 0.26),
    0 0 34px rgba(100, 187, 224, 0.24);
}

.menu-action-card-secondary {
  background: linear-gradient(
    180deg,
    rgba(24, 39, 54, 0.95),
    rgba(10, 17, 26, 0.98)
  );
}

.menu-action-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.menu-action-title {
  color: #ffffff;
  font-size: clamp(18px, 1.65vw, 30px);
  font-weight: 800;
  line-height: 1.05;
}

.menu-action-body {
  color: rgba(234, 242, 250, 0.9);
  font-size: clamp(12px, 0.95vw, 16px);
  line-height: 1.35;
}

.menu-action-arrow {
  flex: 0 0 auto;
  color: rgba(233, 244, 255, 0.84);
  font-size: 34px;
  line-height: 1;
}

.menu-portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#btn-partnership.menu-utility-card {
  grid-column: 1 / -1;
}

.menu-utility-card {
  min-height: 66px;
  padding: 16px 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(
    180deg,
    rgba(22, 35, 48, 0.95),
    rgba(9, 15, 23, 0.98)
  );
  color: #f0f7ff;
  font-size: clamp(15px, 1.15vw, 20px);
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -16px 30px rgba(0, 0, 0, 0.12),
    0 22px 42px rgba(0, 0, 0, 0.24);
}

.menu-utility-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.menu-utility-arrow {
  font-size: 34px;
  color: rgba(233, 244, 255, 0.84);
}

.portal-menu-screen .menu-action-card:hover:not(:disabled),
.portal-menu-screen .menu-utility-card:hover:not(:disabled),
.portal-menu-screen .menu-mini-action:hover:not(:disabled),
.portal-menu-screen .portal-menu-settings-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(204, 223, 231, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 44px rgba(0, 0, 0, 0.28);
}

@keyframes menu-hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 1180px) and (pointer: coarse) {
  .portal-menu-screen {
    overflow-y: auto;
    padding: clamp(16px, 2vw, 24px);
  }

  .portal-menu-stage {
    width: min(980px, 100%);
    grid-template-columns: minmax(230px, 36vw) minmax(320px, 1fr);
    gap: clamp(16px, 2.6vw, 26px);
  }

  .portal-hero-panel {
    --hero-frame-size: clamp(220px, 30vw, 320px);
    --hero-ring-size: calc(var(--hero-frame-size) + 34px);
    min-height: calc(var(--hero-ring-size) + 20px);
  }

  .portal-hero-ring-outer {
    width: calc(var(--hero-ring-size) + 42px);
    height: calc(var(--hero-ring-size) + 42px);
  }

  .menu-portal-side {
    max-width: 620px;
  }

  .portal-brand h1 {
    font-size: clamp(34px, 4.8vw, 58px);
  }

  .menu-action-card {
    min-height: 92px;
    padding: 16px 18px;
  }

  .menu-action-title {
    font-size: clamp(18px, 2.3vw, 24px);
  }

  .menu-action-body {
    font-size: clamp(12px, 1.35vw, 14px);
  }
}

@media (max-width: 820px) and (pointer: coarse) {
  .portal-menu-screen {
    overflow-y: auto;
    justify-content: flex-start;
    padding: 14px;
  }

  .portal-menu-stage {
    width: min(640px, 100%);
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    justify-items: center;
  }

  .portal-hero-panel {
    --hero-frame-size: min(60vw, 300px);
    --hero-ring-size: calc(var(--hero-frame-size) + 34px);
    min-height: calc(var(--hero-ring-size) + 20px);
    justify-self: center;
  }

  .portal-hero-figure {
    width: min(64%, 220px);
    height: 68%;
  }

  .menu-portal-side {
    width: min(100%, 620px);
    max-width: 620px;
    justify-self: center;
    gap: 12px;
  }

  .portal-brand {
    margin-bottom: 2px;
    align-items: center;
    text-align: center;
  }

  .portal-brand h1 {
    font-size: clamp(34px, 9vw, 52px);
    justify-content: center;
    letter-spacing: 0.03em;
  }

  .menu-portal-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) and (pointer: coarse) {
  .portal-menu-screen {
    padding: 12px;
  }

  .portal-menu-status {
    gap: 8px;
  }

  .portal-menu-coin {
    min-height: 44px;
    padding: 0 12px;
    gap: 8px;
  }

  .portal-menu-coin-label {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .portal-menu-coin strong {
    font-size: 16px;
  }

  .portal-menu-settings-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .portal-menu-stage {
    gap: 16px;
  }

  .portal-hero-panel {
    --hero-frame-size: min(62vw, 260px);
    --hero-ring-size: calc(var(--hero-frame-size) + 28px);
    min-height: calc(var(--hero-ring-size) + 14px);
  }

  .portal-brand h1 {
    font-size: clamp(30px, 12vw, 44px);
  }

  .menu-portal-card,
  .menu-action-card,
  .menu-utility-card {
    padding: 15px 16px;
    border-radius: 18px;
  }

  .menu-action-card {
    min-height: 82px;
  }

  .menu-action-title {
    font-size: 18px;
  }

  .menu-action-body {
    font-size: 12px;
  }

  .menu-action-arrow {
    font-size: 28px;
  }

  .menu-utility-card {
    min-height: 58px;
    font-size: 16px;
  }

  .menu-utility-arrow {
    font-size: 28px;
  }

  .menu-portal-grid {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (max-height: 760px) and (pointer: coarse) {
  .portal-menu-screen {
    padding: 10px 12px;
    overflow: hidden;
  }

  .portal-menu-topbar {
    margin-bottom: 6px;
  }

  .portal-menu-status {
    gap: 6px;
  }

  .portal-menu-coin {
    min-height: 36px;
    padding: 0 10px;
    gap: 6px;
  }

  .portal-menu-coin-label {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .portal-menu-coin strong {
    font-size: 15px;
  }

  .portal-menu-settings-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .portal-menu-stage {
    width: min(980px, 100%);
    grid-template-columns: minmax(180px, 34vw) minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
  }

  .portal-hero-panel {
    --hero-frame-size: clamp(148px, 30vh, 220px);
    --hero-ring-size: calc(var(--hero-frame-size) + 18px);
    min-height: calc(var(--hero-ring-size) + 4px);
  }

  .portal-hero-ring-outer {
    width: calc(var(--hero-ring-size) + 28px);
    height: calc(var(--hero-ring-size) + 28px);
  }

  .menu-portal-side {
    gap: 8px;
  }

  .portal-brand {
    align-items: flex-start;
    text-align: left;
  }

  .portal-brand h1 {
    font-size: clamp(24px, 5.6vh, 34px);
    justify-content: flex-start;
  }

  .menu-action-card {
    min-height: 62px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .menu-action-title {
    font-size: clamp(14px, 2.8vh, 18px);
  }

  .menu-action-body {
    font-size: clamp(10px, 1.35vh, 11px);
    line-height: 1.2;
  }

  .menu-action-arrow {
    font-size: 22px;
  }

  .menu-portal-grid {
    gap: 8px;
  }

  .menu-utility-card {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: clamp(12px, 1.8vh, 14px);
  }

  .menu-utility-arrow {
    font-size: 20px;
  }
}

@media (max-width: 1180px) and (pointer: coarse) {
  .portal-menu-screen {
    background-position: 54% center;
  }

  .portal-menu-stage {
    width: min(1040px, 100%);
    padding-right: clamp(6px, 1vw, 18px);
  }

  .portal-banner-menu {
    width: min(100%, clamp(250px, 31vw, 340px));
    transform: translateY(clamp(10px, 2vh, 22px));
  }
}

@media (max-width: 820px) and (pointer: coarse) {
  .portal-menu-screen {
    justify-content: flex-start;
    padding: 14px;
    background-position: 58% center;
  }

  .portal-menu-stage {
    width: min(100%, 680px);
    justify-content: center;
    align-items: flex-end;
    padding-right: 0;
    padding-bottom: 8px;
  }

  .portal-banner-menu {
    width: min(100%, 330px);
    margin-left: 0;
    transform: none;
  }
}

@media (max-width: 560px) and (pointer: coarse) {
  .portal-menu-screen {
    padding: 12px;
  }

  .portal-menu-screen::before {
    background:
      linear-gradient(
        90deg,
        rgba(18, 34, 47, 0.22),
        rgba(18, 34, 47, 0.1) 18%,
        rgba(18, 34, 47, 0.1) 76%,
        rgba(18, 34, 47, 0.28)
      ),
      linear-gradient(180deg, rgba(255, 196, 88, 0.08), rgba(7, 23, 35, 0.22) 90%);
  }

  .portal-banner-menu {
    width: min(100%, 290px);
  }

  .portal-banner-stack {
    gap: 10px;
  }

  .menu-banner-hotspot-play {
    min-height: 100px;
  }

  .menu-banner-hotspot-partnership,
  .menu-banner-hotspot-wallet,
  .menu-banner-hotspot-leaderboard {
    min-height: 66px;
  }

  .menu-banner-hotspot-rules {
    min-height: 52px;
  }
}

@media (orientation: landscape) and (max-height: 760px) and (pointer: coarse) {
  .portal-menu-stage {
    width: min(100%, 980px);
    justify-content: flex-end;
    align-items: center;
    padding-right: 0;
  }

  .portal-banner-menu {
    width: min(100%, 270px);
    gap: 10px;
    transform: translateY(8px);
  }

  .portal-banner-stack {
    gap: 8px;
  }

  .menu-banner-hotspot-play {
    min-height: 86px;
  }

  .menu-banner-hotspot-partnership,
  .menu-banner-hotspot-wallet,
  .menu-banner-hotspot-leaderboard {
    min-height: 52px;
  }

  .menu-banner-hotspot-rules {
    min-height: 42px;
  }
}

.portal-menu-screen .portal-menu-settings-btn:hover:not(:disabled),
.portal-menu-screen .portal-menu-settings-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(147, 97, 53, 0.72);
  background: linear-gradient(
    180deg,
    rgba(255, 248, 234, 0.98),
    rgba(241, 206, 141, 0.96)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 14px 24px rgba(84, 44, 16, 0.18),
    0 0 0 5px rgba(232, 195, 123, 0.14);
  color: #6a4324;
}
