:root {
  --foam: #f3fff8;
  --mint: #3dffb5;
  --teal: #0f8f73;
  --amber: #ffb347;
  --coral: #ff6b4a;
  --panel: rgba(8, 36, 30, 0.72);
  --line: rgba(243, 255, 248, 0.12);
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  --safe-top: max(env(safe-area-inset-top, 0px), 8px);
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
  --nav-h: 72px;
  --tg-vh: 100dvh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  position: fixed;
  inset: 0;
  height: var(--tg-vh);
  overflow: hidden;
  font-family: "Outfit", sans-serif;
  color: var(--foam);
  background: #041510;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.app.is-blocked {
  pointer-events: none;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 70% at 50% -8%, #1a5c48 0%, transparent 52%),
    radial-gradient(80% 55% at 100% 100%, #4a2818 0%, transparent 42%),
    linear-gradient(168deg, #06261f 0%, #041510 48%, #081820 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.42;
  animation: drift 12s ease-in-out infinite alternate;
}

.bg-orb-a {
  width: clamp(140px, 42vw, 200px);
  height: clamp(140px, 42vw, 200px);
  left: -48px;
  top: 10%;
  background: #1f9d78;
}

.bg-orb-b {
  width: clamp(120px, 36vw, 170px);
  height: clamp(120px, 36vw, 170px);
  right: -32px;
  bottom: 16%;
  background: #c45c2c;
  animation-delay: -4s;
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(20px, -14px, 0) scale(1.06); }
}

.top {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(6px + var(--safe-top)) 10px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--mint), var(--teal) 55%, var(--amber));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  animation: pulse-mark 2.4s ease-in-out infinite;
}

@keyframes pulse-mark {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.brand-name {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-sub {
  margin: 0;
  opacity: 0.62;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--foam);
  font-size: 0.95rem;
  cursor: pointer;
}

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 8px;
}

.hud,
.hud-sub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

.hud-sub {
  margin-bottom: 8px;
}

.stat {
  min-width: 0;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  text-align: center;
}

.stat-label {
  display: block;
  margin-bottom: 1px;
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.58;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  display: block;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(0.68rem, 3vw, 0.88rem);
  font-weight: 800;
  color: var(--mint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value.essence {
  color: #c9a0ff;
}

.stat-value.dust {
  color: #9ad0ff;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.hint {
  margin: 0;
  text-align: center;
  opacity: 0.52;
  font-size: 0.72rem;
  line-height: 1.35;
  padding: 0 4px 4px;
}

.arena {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(160px, 32dvh, 240px);
  margin: 2px 0 6px;
}

.combo {
  position: absolute;
  top: 2px;
  right: 6px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--amber));
  color: #1a1008;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  animation: combo-pop 0.35s ease;
}

@keyframes combo-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.crystal {
  position: relative;
  z-index: 2;
  width: clamp(120px, 36vw, 168px);
  height: clamp(120px, 36vw, 168px);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 0.08s ease;
  touch-action: manipulation;
}

.crystal:active,
.crystal.is-hit {
  transform: scale(0.92);
}

.crystal-core,
.crystal-face,
.crystal-facet,
.crystal-ring,
.crystal-shine {
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
}

.crystal-core {
  width: 66%;
  height: 66%;
  border-radius: 28% 72% 40% 60% / 55% 35% 65% 45%;
  background:
    radial-gradient(circle at 35% 30%, #e8fff5 0%, #7dffc8 18%, #1db889 48%, #0a5f4c 100%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.38),
    inset 0 -10px 20px rgba(4, 40, 30, 0.42),
    inset 0 8px 14px rgba(255, 255, 255, 0.32);
  animation: morph 5s ease-in-out infinite;
}

.crystal.has-skin .crystal-core {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  animation: none;
  opacity: 0.18;
  filter: blur(1px);
}

.crystal-face {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 3px rgba(61, 255, 181, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.15);
  z-index: 2;
  display: none;
}

.crystal.has-skin .crystal-face {
  display: block;
}

.crystal-boss {
  display: none;
  position: absolute;
  z-index: 3;
  font-size: clamp(52px, 20vw, 78px);
  line-height: 1;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
  animation: bossPulse 1.1s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.crystal.fighting .crystal-face {
  display: none !important;
}

.crystal.fighting .crystal-boss {
  display: block;
}

.crystal.fighting.has-skin .crystal-core {
  opacity: 0.28;
  background:
    radial-gradient(circle at 35% 30%, #ffe8e8 0%, #ff7d7d 18%, #b81d3a 48%, #5f0a18 100%);
}

.crystal.fighting .crystal-ring {
  border-color: rgba(255, 90, 110, 0.55);
  box-shadow: 0 0 24px rgba(255, 70, 90, 0.35);
}

.crystal.shield .crystal-boss {
  filter: drop-shadow(0 0 12px #7ec8ff) grayscale(0.2);
}

.crystal.rage .crystal-boss {
  animation: bossRage 0.45s ease-in-out infinite;
}

@keyframes bossPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes bossRage {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.12) rotate(2deg); }
}

.fight-bar {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(40, 8, 14, 0.72);
  border: 1px solid rgba(255, 90, 110, 0.35);
}

.fight-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.fight-hp {
  height: 10px;
  margin: 0;
}

.fight-phase {
  margin: 6px 0 4px;
  font-size: 11px;
  opacity: 0.9;
  color: #ffc9d2;
}

.fight-flee {
  width: 100%;
  margin-top: 4px;
}

.arena-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.arena-btn {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #052219;
  background: linear-gradient(180deg, #7dffc8, #2fd69a);
  box-shadow: 0 4px 0 #0f6b4d;
}

.arena-btn.dim {
  color: #1a1030;
  background: linear-gradient(180deg, #d4b3ff, #9b6dff);
  box-shadow: 0 4px 0 #5a3a9a;
}

.arena-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 transparent;
}

.dims-card {
  padding: 4px 2px 16px;
}

.dims-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(12, 28, 36, 0.75);
  border: 1px solid rgba(140, 220, 255, 0.18);
}

.dim-card.active {
  border-color: rgba(125, 255, 200, 0.55);
  box-shadow: inset 0 0 0 1px rgba(125, 255, 200, 0.2);
}

.dim-card.locked {
  opacity: 0.72;
}

.dim-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.06);
}

.dim-name {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
}

.dim-desc {
  margin: 2px 0 8px;
  font-size: 12px;
  opacity: 0.78;
  line-height: 1.35;
}

.dim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dim-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  color: #041820;
  background: #8ce7ff;
}

.dim-btn:disabled {
  opacity: 0.45;
}

.dim-badge {
  font-size: 11px;
  font-weight: 700;
  color: #7dffc8;
  align-self: center;
}

.boss-mech {
  font-size: 12px;
  opacity: 0.8;
  margin: 0 0 8px;
}

.app.dim-theme-frost {
  --accent: #8ce7ff;
}
.app.dim-theme-ember {
  --accent: #ff9a5c;
}
.app.dim-theme-void {
  --accent: #b388ff;
}
.app.dim-theme-chrono {
  --accent: #ffe08a;
}
.app.dim-theme-dream {
  --accent: #ff8ad8;
}

.crystal.skin-amina .crystal-face {
  box-shadow: 0 0 0 3px rgba(61, 255, 181, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45);
}

.crystal.skin-olya .crystal-face {
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.65), 0 10px 24px rgba(0, 0, 0, 0.45);
}

.crystal.skin-eldar .crystal-face {
  box-shadow: 0 0 0 3px rgba(155, 109, 255, 0.75), 0 0 22px rgba(155, 109, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45);
}

.crystal.has-skin .crystal-facet {
  opacity: 0.25;
}

.crystal.has-skin .f1,
.crystal.has-skin .f2,
.crystal.has-skin .f3 {
  z-index: 3;
}

.crystal-facet {
  width: 40%;
  height: 40%;
  opacity: 0.55;
  mix-blend-mode: screen;
}

.f1 {
  top: 12%;
  left: 18%;
  right: auto;
  bottom: auto;
  border-radius: 40% 60% 55% 45%;
  background: linear-gradient(135deg, #fff, transparent 70%);
}

.f2 {
  right: 14%;
  bottom: 22%;
  left: auto;
  top: auto;
  border-radius: 60% 40%;
  background: linear-gradient(210deg, rgba(255, 179, 71, 0.9), transparent 65%);
}

.f3 {
  left: 16%;
  bottom: 18%;
  right: auto;
  top: auto;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(61, 255, 181, 0.35);
}

.crystal-ring {
  width: 94%;
  height: 94%;
  border-radius: 50%;
  border: 1px solid rgba(61, 255, 181, 0.35);
  box-shadow: 0 0 0 6px rgba(61, 255, 181, 0.05);
  animation: spin 14s linear infinite;
}

.crystal-shine {
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: conic-gradient(from 40deg, transparent 0 60%, rgba(255, 255, 255, 0.16) 75%, transparent 90%);
  animation: spin 9s linear infinite reverse;
}

@keyframes morph {
  0%, 100% { border-radius: 28% 72% 40% 60% / 55% 35% 65% 45%; }
  50% { border-radius: 58% 42% 62% 38% / 42% 58% 42% 58%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.floaters {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  left: 50%;
  top: 45%;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  color: var(--amber);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  animation: float-up 0.85s ease-out forwards;
  transform: translate(-50%, -50%);
}

.floater.crit {
  color: var(--coral);
  font-size: clamp(0.98rem, 3.8vw, 1.12rem);
}

@keyframes float-up {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -110px) scale(1.12); }
}

.event-banner {
  margin: 0 0 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 179, 71, 0.42);
  background: rgba(255, 179, 71, 0.11);
  text-align: center;
  font-size: 0.74rem;
}

.shop,
.world-card,
.leaders-card,
.stats-card,
.boss-card,
.quests-card,
.prestige-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.shop-tabs.scroll-tabs {
  margin-bottom: 8px;
}

.scroll-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.scroll-tabs::-webkit-scrollbar {
  display: none;
}

.scroll-tabs > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.shop-tab {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.shop-tab.is-active {
  border-color: rgba(61, 255, 181, 0.48);
  background: rgba(61, 255, 181, 0.13);
  color: var(--mint);
}

.upgrades {
  display: grid;
  gap: 6px;
}

.upgrade {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.upgrade:active {
  transform: scale(0.98);
}

.upgrade.affordable {
  border-color: rgba(61, 255, 181, 0.42);
  background: rgba(61, 255, 181, 0.07);
}

.upgrade.locked {
  opacity: 0.52;
}

.upgrade.maxed {
  opacity: 0.72;
  border-color: rgba(255, 179, 71, 0.32);
}

.upgrade-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(61, 255, 181, 0.22), rgba(255, 179, 71, 0.18));
  font-size: 1.05rem;
}

.upgrade-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.82rem;
}

.upgrade-desc {
  margin: 2px 0 0;
  font-size: 0.66rem;
  opacity: 0.62;
}

.upgrade-meta {
  text-align: right;
}

.upgrade-lvl {
  display: block;
  font-size: 0.62rem;
  opacity: 0.52;
}

.upgrade-cost {
  display: block;
  margin-top: 2px;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  color: var(--amber);
  font-size: 0.74rem;
}

.upgrade.essence-cost .upgrade-cost {
  color: #c9a0ff;
}

.world-card h2,
.leaders-head h2,
.stats-card h2,
.quests-card h2,
.prestige-card h2 {
  margin: 0 0 6px;
  font-family: "Exo 2", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.world-intro {
  margin: 0 0 8px;
  font-size: 0.74rem;
  opacity: 0.68;
  line-height: 1.38;
}

.hud-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 8px;
}

.world-modules {
  display: grid;
  gap: 8px;
}

.module {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.module.locked {
  opacity: 0.52;
}

.module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.module-title {
  margin: 0;
  font-weight: 800;
  font-family: "Exo 2", sans-serif;
  font-size: 0.84rem;
}

.module-desc {
  margin: 3px 0 0;
  font-size: 0.68rem;
  opacity: 0.62;
}

.module-lock {
  font-size: 0.66rem;
  color: var(--amber);
  white-space: nowrap;
}

.module-actions {
  display: grid;
  gap: 5px;
}

.module-btn {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(61, 255, 181, 0.09);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.module-btn:disabled {
  opacity: 0.42;
}

.module-btn.primary {
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: #041510;
  border: 0;
  text-align: center;
}

.module-progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 5px 0;
}

.module-progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6ecbff, #3dffb5);
  width: 0%;
}

.module-note {
  margin: 0;
  font-size: 0.68rem;
  opacity: 0.62;
}

.leaders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ghost-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--foam);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.leaders-list {
  display: grid;
  gap: 5px;
}

.leader-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.76rem;
}

.leader-row.me {
  border-color: rgba(61, 255, 181, 0.45);
  background: rgba(61, 255, 181, 0.1);
}

.leader-rank {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  opacity: 0.7;
  text-align: center;
}

.leader-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  color: var(--mint);
  white-space: nowrap;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.skins-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.skins-card h2 {
  margin: 0 0 6px;
  font-family: "Exo 2", sans-serif;
  font-size: 0.95rem;
}

.skins-grid {
  display: grid;
  gap: 10px;
}

.skin-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.skin-card.equipped {
  border-color: rgba(61, 255, 181, 0.5);
  background: rgba(61, 255, 181, 0.1);
}

.skin-card.locked {
  opacity: 0.72;
}

.skin-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-size: cover;
  background-position: center top;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 8px 16px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.skin-info {
  min-width: 0;
}

.skin-name {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
}

.skin-desc {
  margin: 3px 0 8px;
  font-size: 0.72rem;
  opacity: 0.65;
  line-height: 1.35;
}

.skin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skin-btn {
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: #041510;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  touch-action: manipulation;
}

.skin-btn.buy {
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.skin-btn:disabled {
  opacity: 0.45;
}

.skin-badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--mint);
}

.more-btn {
  min-height: 72px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  font-family: "Exo 2", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.more-btn:active {
  transform: scale(0.98);
}

.boss-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.boss-icon {
  font-size: clamp(1.6rem, 6vw, 2rem);
}

.boss-head h2 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: 0.9rem;
}

.boss-sub {
  margin: 3px 0 0;
  opacity: 0.58;
  font-size: 0.68rem;
}

.boss-hp-wrap {
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 5px;
}

.boss-hp-bar {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--amber));
  transition: width 0.15s ease;
}

.boss-hp-text {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.74rem;
  opacity: 0.66;
}

.boss-btn,
.prestige-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  color: #1a1008;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  touch-action: manipulation;
}

.prestige-btn {
  background: linear-gradient(135deg, #9b6dff, #c9a0ff);
  color: #fff;
}

.boss-reward {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.74rem;
  opacity: 0.62;
}

.quests-list {
  display: grid;
  gap: 5px;
}

.quest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.quest.done {
  border-color: rgba(61, 255, 181, 0.32);
  opacity: 0.68;
}

.quest-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.78rem;
}

.quest-progress {
  margin: 2px 0 0;
  font-size: 0.64rem;
  opacity: 0.58;
}

.quest-reward {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  color: var(--amber);
  font-size: 0.74rem;
}

.quest-claim {
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  color: #041510;
  font-weight: 800;
  font-size: 0.66rem;
  cursor: pointer;
}

.quest-claim:disabled {
  opacity: 0.38;
}

.section-gap {
  margin-top: 12px;
}

.prestige-desc {
  margin: 0 0 8px;
  font-size: 0.76rem;
  opacity: 0.72;
  line-height: 1.38;
}

.prestige-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(155, 109, 255, 0.11);
  border: 1px solid rgba(201, 160, 255, 0.22);
  font-size: 0.8rem;
}

.prestige-preview strong {
  font-family: "Exo 2", sans-serif;
  color: #c9a0ff;
  font-size: 0.92rem;
}

.stats-grid {
  display: grid;
  gap: 5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.stat-row span {
  opacity: 0.62;
  font-size: 0.76rem;
}

.stat-row strong {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  color: var(--mint);
  font-size: 0.78rem;
  text-align: right;
}

.tabs {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-height: var(--nav-h);
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: rgba(4, 21, 16, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font-family: "Exo 2", sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05;
  cursor: pointer;
  touch-action: manipulation;
}

.tab span {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.tab.is-active {
  border-color: rgba(61, 255, 181, 0.48);
  background: rgba(61, 255, 181, 0.13);
  color: var(--mint);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 6px + var(--safe-bottom));
  z-index: 30;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(10, 28, 22, 0.94);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  text-align: center;
  pointer-events: none;
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.session-block {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 21, 16, 0.88);
  backdrop-filter: blur(6px);
}

.session-block[hidden] {
  display: none !important;
}

.session-block-card {
  width: min(100%, 320px);
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  box-shadow: var(--shadow);
}

.session-block-card h2 {
  margin: 0 0 8px;
  font-family: "Exo 2", sans-serif;
  font-size: 1rem;
}

.session-block-card p {
  margin: 0 0 14px;
  font-size: 0.82rem;
  opacity: 0.72;
  line-height: 1.42;
}

.session-retry {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: #041510;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
}

@media (max-height: 640px) {
  .hint {
    display: none;
  }

  .arena {
    min-height: clamp(120px, 26dvh, 160px);
  }

  .arena-actions {
    gap: 6px;
    margin-top: 4px;
  }

  .arena-btn {
    min-height: 36px;
    font-size: 12px;
  }

  .fight-bar {
    padding: 6px 8px;
  }

  .hud,
  .hud-sub {
    gap: 4px;
    margin-bottom: 4px;
  }

  .stat {
    padding: 4px 2px;
  }
}

@media (max-width: 480px) {
  .crystal-core {
    animation: none;
  }
  .bg-orb {
    animation: none;
    opacity: 0.55;
  }
  .crystal-boss {
    animation: none;
  }
  .crystal.rage .crystal-boss {
    animation: none;
  }
}

@media (min-width: 480px) {
  .top {
    padding-inline: 12px;
  }

  .stage {
    padding-inline: 12px;
  }

  .tab {
    font-size: 0.66rem;
  }

  .stat-value {
    font-size: 0.88rem;
  }
}
