:root {
  --bg-deep: #0e101c;
  --bg-panel: #151829;
  --bg-card: #1c2036;
  --bg-card-hover: #242945;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 211, 105, 0.35);
  --text-main: #f4f5fa;
  --text-muted: #9aa2c2;
  --gold: #ffd166;
  --gold-deep: #e09f24;
  --coral: #ff6b6b;
  --mint: #4ade80;
  --sky: #56ccf2;
  --milk-a: rgba(98, 179, 255, 0.24);
  --milk-b: rgba(74, 144, 226, 0.38);
  --milk-height: 6%;
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.frenzy-active .stage-column::after {
  opacity: 1;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(310px, 370px) 1fr minmax(330px, 390px);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* =========================================
   LEFT COLUMN: MAIN FACE STAGE
   ========================================= */
.stage-column {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 209, 102, 0.14), transparent 58%),
    linear-gradient(180deg, #161a30 0%, #0d1020 100%);
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
  padding: 18px 16px 14px;
}

.stage-column::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: inset 0 0 85px rgba(255, 209, 102, 0.48);
  z-index: 6;
}

.stage-top {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empire-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.empire-banner:hover {
  background: rgba(255, 209, 102, 0.12);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.empire-banner .edit-icon {
  font-size: 0.8rem;
  opacity: 0.65;
}

.score-panel {
  width: 100%;
  text-align: center;
  background: rgba(8, 10, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
}

.face-count {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(1.7rem, 2.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(255, 209, 102, 0.35);
}

.fps-display {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fps-display span {
  color: var(--gold);
  font-weight: 700;
}

.active-buffs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
}

.buff-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffd166, #f59e0b);
  color: #1b1304;
  box-shadow: 0 4px 16px rgba(255, 209, 102, 0.45);
  animation: pulse-buff 1.1s ease-in-out infinite;
}

.buff-pill.storm {
  background: linear-gradient(135deg, #56ccf2, #3b82f6);
  color: #061325;
  box-shadow: 0 4px 16px rgba(86, 204, 242, 0.45);
}

@keyframes pulse-buff {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* CLICKER ARENA */
.clicker-arena {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  min-height: 270px;
}

.sunbeams {
  position: absolute;
  width: 340px;
  height: 340px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(1px);
  opacity: 0.55;
}

.beam-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 209, 102, 0.24) 0deg 12deg,
    transparent 12deg 30deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 20%, transparent 72%);
  mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 20%, transparent 72%);
}

.beam-layer-a {
  animation: spin-cw 28s linear infinite;
}

.beam-layer-b {
  opacity: 0.5;
  transform: scale(0.86);
  animation: spin-ccw 40s linear infinite;
}

@keyframes spin-cw {
  to { transform: rotate(360deg); }
}

@keyframes spin-ccw {
  to { transform: rotate(-360deg); }
}

/* ORBITING MINI CURSORS */
.cursor-orbit {
  position: absolute;
  width: 310px;
  height: 310px;
  pointer-events: none;
  animation: spin-cw 36s linear infinite;
}

.orbit-pointer {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.05rem;
  transform-origin: 0 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
  transition: transform 0.14s ease;
}

/* THE BIG FACE BUTTON */
.face-btn {
  position: relative;
  width: 226px;
  height: 226px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  perspective: 700px;
  transform: scale(1);
  transition: transform 0.12s cubic-bezier(0.22, 1.4, 0.36, 1), filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.face-btn:hover {
  transform: scale(1.045);
  filter: drop-shadow(0 0 24px rgba(255, 209, 102, 0.38));
}

.face-btn.pressed {
  transform: scale(0.92, 0.89) !important;
}

.face-ring-outer {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ffe28a,
    #e09f24,
    #fff0bc,
    #c67c11,
    #ffe28a
  );
  box-shadow:
    0 16px 35px rgba(0, 0, 0, 0.65),
    0 0 36px rgba(255, 209, 102, 0.25);
  z-index: 1;
}

.face-medallion {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  background: #22263c;
  box-shadow:
    inset 0 0 0 4px rgba(255, 240, 190, 0.45),
    inset 0 -14px 26px rgba(0, 0, 0, 0.42);
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out;
}

.face-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
  transform: scale(1.06);
  pointer-events: none;
}

.face-gloss {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 24%,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.08) 28%,
    transparent 55%
  );
  pointer-events: none;
}

/* PARTICLES */
.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 8;
}

.float-number {
  position: fixed;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #ffffff;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 209, 102, 0.55);
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
  animation: float-up 0.9s cubic-bezier(0.18, 0.85, 0.32, 1) forwards;
}

.float-number.crit {
  font-size: 1.7rem;
  color: var(--gold);
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.85);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -85%) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -180%) scale(0.95);
  }
}

.mini-face-crumb {
  position: fixed;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 38%;
  border: 2px solid rgba(255, 209, 102, 0.8);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 45;
  will-change: transform, opacity;
}

/* STAGE FOOTER & MILK WAVES */
.stage-footer {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.click-power-pill,
.milk-badge {
  background: rgba(10, 12, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.8rem;
  color: var(--text-muted);
  backdrop-filter: blur(6px);
}

.click-power-pill strong {
  color: var(--mint);
}

.milk-badge strong {
  color: var(--gold);
}

.milk-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--milk-height);
  min-height: 28px;
  max-height: 55%;
  pointer-events: none;
  z-index: 1;
  transition: height 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.milk-fill {
  position: absolute;
  inset: 16px 0 0 0;
  background: linear-gradient(180deg, var(--milk-b), rgba(14, 16, 28, 0.92));
}

.milk-wave {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 32px;
  border-radius: 45% 55% 0 0;
}

.milk-wave-back {
  top: 0;
  background: var(--milk-a);
  animation: wave-slide 8s ease-in-out infinite alternate;
}

.milk-wave-front {
  top: 7px;
  background: var(--milk-b);
  animation: wave-slide 5.5s ease-in-out infinite alternate-reverse;
}

@keyframes wave-slide {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

/* =========================================
   CENTER COLUMN: NEWS, SHOWCASE, TABS
   ========================================= */
.center-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  overflow: hidden;
  min-width: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.ticker-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 12px;
}

.ticker-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--coral);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 5px;
}

.news-text {
  font-size: 0.85rem;
  color: #dfe4f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.35s ease;
}

.news-text.fading {
  opacity: 0;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.center-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  padding: 8px 14px 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
}

.center-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* MILESTONE CARD */
.milestone-card {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(86, 204, 242, 0.08));
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.milestone-progress-label {
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.milestone-title {
  margin: 5px 0 10px;
  font-size: 0.98rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--mint));
  transition: width 0.25s ease;
}

.progress-fill.gold {
  background: linear-gradient(90deg, #f59e0b, #ffd166);
}

/* SHOWCASE ROWS */
.showcase-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-row {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

.showcase-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.showcase-row-header .row-meta {
  color: var(--text-muted);
  font-weight: 600;
}

.showcase-row-stage {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  min-height: 60px;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 209, 102, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0.22));
}

.showcase-unit {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  animation: unit-bob 2.8s ease-in-out infinite;
}

.showcase-unit .mini-face-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 38%;
  border: 1.5px solid var(--gold);
}

.showcase-overflow {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.25);
  padding: 4px 9px;
  border-radius: 999px;
}

@keyframes unit-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.showcase-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-panel);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
}

.empty-face-preview {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 24px rgba(255, 209, 102, 0.2);
}

.empty-face-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
}

.showcase-empty h3 {
  margin: 0 0 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
}

.showcase-empty p {
  margin: 0 auto;
  max-width: 380px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ACHIEVEMENTS */
.ach-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.ach-summary h3 {
  margin: 0 0 4px;
  font-family: 'Fredoka', sans-serif;
}

.ach-summary p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.ach-meter {
  min-width: 150px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.ach-meter .progress-track {
  margin-top: 6px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.ach-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ach-card.unlocked {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(28, 32, 54, 0.9));
  border-color: rgba(255, 209, 102, 0.42);
}

.ach-card.locked {
  opacity: 0.5;
}

.ach-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
}

.ach-card.unlocked .ach-icon {
  background: rgba(255, 209, 102, 0.18);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.25);
}

.ach-info {
  min-width: 0;
}

.ach-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  margin-top: 5px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.save-management {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
}

.save-management h3 {
  margin: 0 0 6px;
  font-family: 'Fredoka', sans-serif;
}

.save-note {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.save-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.action-btn.primary {
  background: var(--gold);
  color: #1c1303;
  border-color: var(--gold);
}

.action-btn.primary:hover {
  background: #ffdc85;
}

.action-btn.danger {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff9c9c;
}

.action-btn.danger:hover {
  background: rgba(255, 107, 107, 0.16);
}

/* =========================================
   RIGHT COLUMN: STORE
   ========================================= */
.store-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  overflow: hidden;
}

.store-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.store-header h2 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

.upgrades-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.16);
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.muted-count {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.upgrades-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 112px;
  overflow-y: auto;
  padding-right: 2px;
}

.upgrades-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 0;
}

.upgrade-tile {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.13s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.upgrade-tile.affordable {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.2), rgba(28, 32, 54, 0.95));
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.25);
}

.upgrade-tile.affordable:hover {
  transform: translateY(-2px) scale(1.06);
}

.upgrade-tile.locked {
  opacity: 0.48;
  cursor: not-allowed;
}

.buildings-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.buildings-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.buy-mode-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
}

.buy-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.buy-mode-btn.active {
  background: var(--gold);
  color: #1b1304;
}

.buildings-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.building-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.building-card.affordable {
  border-color: rgba(255, 209, 102, 0.35);
}

.building-card.affordable:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.building-card.affordable:active {
  transform: scale(0.985);
}

.building-card.unaffordable {
  opacity: 0.56;
  cursor: not-allowed;
}

.building-card.mystery {
  opacity: 0.38;
  cursor: not-allowed;
}

.building-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}

.building-main {
  min-width: 0;
}

.building-name {
  font-weight: 700;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mint);
}

.mone-coin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 38%;
  border: 1.5px solid var(--gold);
  vertical-align: -2px;
  flex-shrink: 0;
}

.building-card.unaffordable .building-cost,
.building-card.mystery .building-cost {
  color: var(--coral);
}

.building-fps {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.building-owned {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  min-width: 30px;
  text-align: right;
}

.building-card.affordable .building-owned {
  color: rgba(255, 255, 255, 0.72);
}

/* =========================================
   GOLDEN FACE OVERLAY
   ========================================= */
.golden-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.golden-face-btn {
  position: fixed;
  width: 82px;
  height: 82px;
  padding: 0;
  border: 3px solid #fff3b0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  background: #ffd166;
  box-shadow:
    0 0 28px rgba(255, 209, 102, 0.95),
    0 0 60px rgba(255, 180, 0, 0.65);
  animation: golden-bob 1.6s ease-in-out infinite, golden-appear 0.4s ease-out;
  transition: transform 0.12s ease;
}

.golden-face-btn:hover {
  transform: scale(1.14);
}

.golden-face-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: sepia(0.85) saturate(3.2) hue-rotate(4deg) brightness(1.12);
}

@keyframes golden-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes golden-appear {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================
   TOASTS, TOOLTIP, MODAL
   ========================================= */
.toast-stack {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(21, 24, 41, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.86rem;
  animation: toast-in 0.28s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.toast-icon {
  font-size: 1.3rem;
}

.toast-title {
  font-weight: 800;
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toast-body {
  font-size: 0.84rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tooltip {
  position: fixed;
  z-index: 95;
  width: 270px;
  background: rgba(13, 16, 30, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  font-size: 0.82rem;
  line-height: 1.45;
}

.tooltip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.tooltip-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
}

.tooltip-price {
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.tooltip-effect {
  color: var(--mint);
  font-weight: 600;
  margin-bottom: 5px;
}

.tooltip-flavor {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.77rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.72);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #dfe4f8;
}

.modal-body textarea,
.modal-body input[type="text"] {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
}

/* SCROLLBARS */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* =========================================
   AUTH & NAME SELECTION GATE
   ========================================= */
body.gate-locked .app-shell {
  filter: blur(8px) brightness(0.45);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 209, 102, 0.16), transparent 55%),
    rgba(9, 11, 22, 0.86);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.auth-gate[hidden] {
  display: none;
}

.auth-bg-glow {
  position: fixed;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.16), transparent 68%);
  pointer-events: none;
  filter: blur(20px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, rgba(25, 29, 51, 0.98), rgba(16, 19, 34, 0.98));
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: 22px;
  padding: 28px 26px 26px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo-ring {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 0deg, #ffe28a, #e09f24, #fff0bc, #c67c11, #ffe28a);
  box-shadow: 0 10px 28px rgba(255, 209, 102, 0.35);
}

.auth-logo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}

.auth-brand {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.85rem;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.auth-subtitle {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-loading[hidden],
.auth-step[hidden] {
  display: none;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--gold);
  animation: spin-cw 0.75s linear infinite;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.34);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.auth-mode-btn {
  border: none;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-mode-btn.active {
  background: var(--gold);
  color: #1c1303;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group[hidden] {
  display: none;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #dfe4f8;
}

.field-group input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 22, 0.85);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.16);
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.signed-in-chip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 11px;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: #d7fbe3;
}

.text-link-btn {
  border: none;
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.name-preview-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.25);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.name-preview-pill strong {
  color: var(--gold);
  font-size: 0.92rem;
}

.auth-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ffb8b8;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-error[hidden] {
  display: none;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd166, #f59e0b);
  color: #1c1303;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 209, 102, 0.28);
  transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* TOP BAR PLAYER BADGE */
.player-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background: rgba(255, 209, 102, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 190px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.player-badge-btn:hover {
  background: rgba(255, 209, 102, 0.18);
  transform: translateY(-1px);
}

.player-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  flex-shrink: 0;
}

.player-badge-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-mini-pill {
  background: var(--gold);
  color: #1c1303;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* =========================================
   GLOBAL LEADERBOARD TAB
   ========================================= */
.lb-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.lb-header-card h3 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
}

.lb-subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lb-my-rank {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 13px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(86, 204, 242, 0.1));
  border: 1px solid rgba(255, 209, 102, 0.42);
  font-size: 0.88rem;
}

.lb-my-rank[hidden] {
  display: none;
}

.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.lb-podium:empty {
  display: none;
}

.podium-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 12px;
  text-align: center;
  position: relative;
}

.podium-card.rank-1 {
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.18), rgba(21, 24, 41, 0.95));
  border-color: rgba(255, 209, 102, 0.55);
}

.podium-card.rank-2 {
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.14), rgba(21, 24, 41, 0.95));
  border-color: rgba(203, 213, 225, 0.35);
}

.podium-card.rank-3 {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.16), rgba(21, 24, 41, 0.95));
  border-color: rgba(217, 119, 6, 0.4);
}

.podium-medal {
  font-size: 1.55rem;
  line-height: 1;
}

.podium-name {
  margin-top: 6px;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-score {
  margin-top: 4px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  color: var(--gold);
}

.podium-mps {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.lb-table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.lb-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.lb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-table tr:last-child td {
  border-bottom: none;
}

.lb-table tr.is-me {
  background: rgba(255, 209, 102, 0.12);
}

.lb-table tr.is-me td:first-child {
  color: var(--gold);
  font-weight: 800;
}

.you-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c1303;
  font-size: 0.65rem;
  font-weight: 800;
  vertical-align: 1px;
}

.lb-empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 26px 14px !important;
}

@media (max-width: 640px) {
  .lb-podium {
    grid-template-columns: 1fr;
  }
  .player-badge-name {
    max-width: 72px;
  }
  .extras-strip {
    grid-template-columns: 1fr;
  }
  .ascend-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================
   HYPE COMBO METER & MEDALLION SKINS
   ========================================= */
.hype-wrap {
  width: 100%;
  max-width: 280px;
  background: rgba(10, 12, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 7px 11px;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hype-wrap.hot {
  border-color: rgba(255, 145, 77, 0.55);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.28);
}

.hype-wrap.maxed {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.45);
}

.hype-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.hype-header strong {
  color: var(--gold);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
}

.hype-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.hype-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #56ccf2, #ffd166, #ff6b6b);
  transition: width 0.08s linear;
}

.footer-pills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.prestige-footer-pill {
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: #ddd6fe;
  backdrop-filter: blur(6px);
}

.prestige-footer-pill strong {
  color: #c4b5fd;
}

/* MEDALLION SKINS */
.face-btn.skin-cyber .face-ring-outer {
  background: conic-gradient(from 0deg, #00f5d4, #00bbf9, #9b5de5, #f15bb5, #00f5d4);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65), 0 0 42px rgba(0, 245, 212, 0.45);
}

.face-btn.skin-emerald .face-ring-outer {
  background: conic-gradient(from 0deg, #a7f3d0, #10b981, #34d399, #047857, #a7f3d0);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65), 0 0 42px rgba(16, 185, 129, 0.42);
}

.face-btn.skin-crimson .face-ring-outer {
  background: conic-gradient(from 0deg, #fde047, #f97316, #ef4444, #991b1b, #fde047);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65), 0 0 44px rgba(239, 68, 68, 0.48);
}

.face-btn.skin-galactic .face-ring-outer {
  background: conic-gradient(from 0deg, #e0e7ff, #818cf8, #c084fc, #38bdf8, #e0e7ff);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65), 0 0 50px rgba(168, 85, 247, 0.55);
}

.face-btn.skin-rainbow .face-ring-outer {
  background: conic-gradient(from 0deg, #ff595e, #ffca3a, #8ac926, #1982c4, #6a4c93, #ff595e);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65), 0 0 55px rgba(255, 202, 58, 0.55);
  animation: spin-cw 6s linear infinite;
}

body.transcendent-active .face-ring-outer {
  box-shadow: 0 0 56px rgba(192, 132, 252, 0.72), 0 0 90px rgba(255, 209, 102, 0.42);
}

.float-number.mega-crit {
  font-size: 2.05rem;
  color: #fde047;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9), 0 0 22px rgba(239, 68, 68, 0.9);
}

/* =========================================
   SHOWCASE EXTRAS: SPIN WHEEL & SKINS
   ========================================= */
.extras-strip {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.extra-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
}

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

.extra-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--gold);
}

.extra-desc {
  margin-top: 3px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.spin-btn {
  flex-shrink: 0;
  min-width: 78px;
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.spin-result-line {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.skins-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.skin-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 2px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s ease;
}

.skin-swatch:hover:not(.locked) {
  transform: scale(1.12);
}

.skin-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.skin-swatch.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.skin-swatch-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 0.78rem;
}

/* =========================================
   ASCENSION TAB & HEAVENLY TREE
   ========================================= */
.tab-pill.ascend-pill {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  font-weight: 800;
  animation: pulse-buff 1.4s ease-in-out infinite;
}

.tab-pill[hidden] {
  display: none;
}

.ascend-hero {
  background:
    radial-gradient(circle at 85% 18%, rgba(168, 85, 247, 0.25), transparent 52%),
    radial-gradient(circle at 12% 85%, rgba(255, 209, 102, 0.14), transparent 50%),
    linear-gradient(160deg, #1a1636 0%, #111327 100%);
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}

.ascend-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.ascend-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #c084fc;
}

.ascend-hero h3 {
  margin: 4px 0 6px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
}

.ascend-lead {
  margin: 0;
  max-width: 520px;
  font-size: 0.84rem;
  color: #d1d5f0;
  line-height: 1.45;
}

.ascend-now-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #a855f7, #ec4899, #f59e0b);
  color: #ffffff;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(168, 85, 247, 0.42);
  transition: transform 0.14s ease, filter 0.15s ease, opacity 0.15s ease;
}

.ascend-now-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
}

.ascend-now-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
}

.ascend-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 14px;
}

.ascend-metric {
  background: rgba(8, 10, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.ascend-metric.highlight {
  border-color: rgba(192, 132, 252, 0.45);
}

.ascend-metric.pending {
  border-color: rgba(255, 209, 102, 0.45);
}

.ascend-metric-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ascend-metric strong {
  display: block;
  margin-top: 4px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
}

.ascend-metric.highlight strong {
  color: #d8b4fe;
}

.ascend-metric.pending strong {
  color: var(--gold);
}

.ascend-progress-wrap {
  margin-bottom: 12px;
}

.ascend-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5f5;
  margin-bottom: 6px;
}

.progress-fill.cosmic {
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #ffd166);
}

.ascend-note {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 9px 12px;
}

.ascend-note span {
  display: block;
  margin-top: 3px;
  color: #fca5a5;
}

.heavenly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.heavenly-header h4 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.12rem;
}

.heavenly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.heavenly-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--bg-panel);
  border: 1px solid rgba(168, 85, 247, 0.24);
  transition: transform 0.14s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.heavenly-card.affordable {
  border-color: rgba(192, 132, 252, 0.72);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.22);
}

.heavenly-card.owned {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.18), rgba(21, 24, 41, 0.96));
  border-color: rgba(74, 222, 128, 0.55);
}

.heavenly-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.heavenly-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.16);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.heavenly-name {
  font-weight: 800;
  font-size: 0.9rem;
}

.heavenly-desc {
  margin-top: 3px;
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.38;
}

.heavenly-buy-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: rgba(168, 85, 247, 0.22);
  color: #f3e8ff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.heavenly-buy-btn:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.38);
}

.heavenly-buy-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.heavenly-buy-btn.owned {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--mint);
  opacity: 1;
  cursor: default;
}

.asc-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.28);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: 1px;
}

/* =========================================
   EXTRA MEDALLION SKINS (VOID & SOLAR)
   ========================================= */
.face-btn.skin-obsidian .face-ring-outer {
  background: conic-gradient(from 0deg, #1e1b4b, #a855f7, #0f172a, #ec4899, #1e1b4b);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.8), 0 0 48px rgba(168, 85, 247, 0.52);
}

.face-btn.skin-solar .face-ring-outer {
  background: conic-gradient(from 0deg, #fef08a, #fb923c, #fde047, #f43f5e, #fef08a);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.7), 0 0 56px rgba(251, 146, 60, 0.6);
  animation: spin-cw 10s linear infinite;
}

/* =========================================
   ACTIVE CHALLENGE BANNER & ENDLESS CONTRACTS
   ========================================= */
.active-challenge-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.24), rgba(168, 85, 247, 0.22));
  border-bottom: 1px solid rgba(248, 113, 113, 0.45);
  font-size: 0.84rem;
}

.active-challenge-banner[hidden] {
  display: none;
}

.challenge-banner-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-badge-live {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
}

.challenge-banner-progress {
  color: var(--gold);
  font-weight: 700;
}

.small-btn {
  padding: 6px 11px;
  font-size: 0.76rem;
}

.contract-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(255, 209, 102, 0.08));
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
}

.contract-card.ready {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.22);
}

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

.contract-title {
  margin-top: 4px;
  font-size: 0.94rem;
  font-weight: 700;
}

.contract-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.contract-reward {
  color: var(--mint);
  font-weight: 700;
}

/* =========================================
   CONSTELLATION SKILL TREE (COOKIE CLICKER STYLE)
   ========================================= */
.skill-tree-section {
  margin-bottom: 22px;
}

.tree-legend {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-item .dot.owned {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.legend-item .dot.ready {
  background: #ffd166;
  box-shadow: 0 0 8px #ffd166;
}

.legend-item .dot.locked {
  background: rgba(148, 163, 184, 0.4);
}

.skill-tree-viewport {
  position: relative;
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background:
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.2), transparent 58%),
    radial-gradient(2px 2px at 14% 22%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(2px 2px at 82% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 26% 78%, rgba(255, 209, 102, 0.55), transparent),
    radial-gradient(2px 2px at 74% 82%, rgba(192, 132, 252, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 52% 12%, rgba(255, 255, 255, 0.45), transparent),
    linear-gradient(180deg, #0b0d1e 0%, #121029 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.65);
}

.skill-tree-canvas {
  position: relative;
  width: 760px;
  height: 560px;
  margin: 0 auto;
}

.skill-tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tree-edge {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 2.5;
  stroke-dasharray: 5 5;
  transition: stroke 0.25s ease;
}

.tree-edge.available {
  stroke: rgba(255, 209, 102, 0.58);
  stroke-dasharray: none;
}

.tree-edge.owned {
  stroke: #a855f7;
  stroke-width: 3.5;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.75));
}

.tree-branch-label {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.45);
  pointer-events: none;
}

.skill-tree-nodes {
  position: absolute;
  inset: 0;
}

.skill-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.28);
  background: rgba(19, 22, 42, 0.94);
  color: #ffffff;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.skill-node:hover {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 4;
}

.skill-node.selected {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
  z-index: 5;
}

.skill-node.locked {
  opacity: 0.42;
  filter: grayscale(0.65);
}

.skill-node.available {
  border-color: var(--gold);
  background: radial-gradient(circle at 30% 30%, rgba(255, 209, 102, 0.3), rgba(24, 22, 50, 0.96));
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.42);
}

.skill-node.cant-afford {
  border-color: rgba(255, 209, 102, 0.45);
  opacity: 0.78;
}

.skill-node.owned {
  border-color: #4ade80;
  background: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.42), rgba(20, 32, 48, 0.96));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.42);
}

.skill-node.root-node {
  width: 66px;
  height: 66px;
  font-size: 1.65rem;
}

.skill-node-cost {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: #0d1020;
  border: 1px solid rgba(192, 132, 252, 0.55);
  color: #e9d5ff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}

.skill-node.owned .skill-node-cost {
  border-color: rgba(74, 222, 128, 0.65);
  color: #4ade80;
}

.skill-inspector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-panel);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.inspector-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 220px;
}

.inspector-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.38);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.inspector-branch {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c084fc;
}

.inspector-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  margin-top: 2px;
}

.inspector-desc {
  font-size: 0.82rem;
  color: #dfe4f8;
  margin-top: 3px;
  line-height: 1.4;
}

.inspector-req {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.inspector-buy-btn {
  min-width: 155px;
}

/* =========================================
   CHALLENGES & LEADERBOARD SORT BAR
   ========================================= */
.challenges-section {
  margin-top: 6px;
}

.challenges-intro {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 13px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.challenge-card.completed {
  border-color: rgba(74, 222, 128, 0.5);
  background: linear-gradient(145deg, rgba(74, 222, 128, 0.1), rgba(21, 24, 41, 0.96));
}

.challenge-card.active-run {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.challenge-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
}

.challenge-rule {
  font-size: 0.78rem;
  color: #dfe4f8;
  margin-top: 5px;
  line-height: 1.4;
}

.challenge-reward {
  font-size: 0.76rem;
  color: var(--gold);
  font-weight: 700;
  margin-top: 6px;
}

.lb-sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.lb-sort-btn {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lb-sort-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.lb-sort-btn.active {
  background: var(--gold);
  color: #1c1303;
  border-color: var(--gold);
}

/* =========================================
   RARITY COLORS & MONE LUMPS WIDGET
   ========================================= */
:root {
  --rarity-common: #94a3b8;
  --rarity-uncommon: #4ade80;
  --rarity-rare: #38bdf8;
  --rarity-epic: #c084fc;
  --rarity-legendary: #fbbf24;
  --rarity-mythic: #fb7185;
}

.lump-widget {
  width: 100%;
  max-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(12, 15, 30, 0.78);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lump-widget:hover {
  border-color: rgba(255, 209, 102, 0.45);
  transform: translateY(-1px);
}

.lump-widget.mature {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.28);
}

.lump-widget.ripe {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(20, 22, 42, 0.92));
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.48);
  animation: pulse-buff 1.3s ease-in-out infinite;
}

.lump-icon {
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
}

.lump-info {
  flex: 1;
  min-width: 0;
}

.lump-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}

.lump-type-label {
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lump-count-val {
  color: var(--gold);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.lump-sub-row {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 2px 0 4px;
}

.lump-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.lump-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #c084fc, #ffd166);
  transition: width 0.4s linear;
}

.equipped-skin-pill {
  border-radius: 999px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  background: rgba(15, 18, 34, 0.78);
  border: 1px solid var(--rarity-common);
  color: #f8fafc;
  max-width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipped-skin-pill.rarity-uncommon { border-color: var(--rarity-uncommon); color: #bbf7d0; }
.equipped-skin-pill.rarity-rare { border-color: var(--rarity-rare); color: #bae6fd; }
.equipped-skin-pill.rarity-epic { border-color: var(--rarity-epic); color: #e9d5ff; }
.equipped-skin-pill.rarity-legendary { border-color: var(--rarity-legendary); color: #fef08a; box-shadow: 0 0 12px rgba(251, 191, 36, 0.3); }
.equipped-skin-pill.rarity-mythic { border-color: var(--rarity-mythic); color: #fecdd3; box-shadow: 0 0 16px rgba(251, 113, 133, 0.45); }

.spin-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lump-refill-btn[hidden] {
  display: none;
}

/* GENERATOR LEVEL BADGE & +LV BUTTON IN STORE */
.building-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.building-lv-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  flex-shrink: 0;
}

.building-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.building-lv-btn {
  border: 1px solid rgba(255, 209, 102, 0.4);
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, transform 0.12s ease;
}

.building-lv-btn:hover:not(:disabled) {
  background: rgba(255, 209, 102, 0.28);
  transform: scale(1.05);
}

.building-lv-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* =========================================
   CRATES & SKIN WARDROBE TAB
   ========================================= */
.crates-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  background:
    radial-gradient(circle at 85% 20%, rgba(251, 191, 36, 0.18), transparent 55%),
    var(--bg-panel);
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 15px;
  padding: 15px 17px;
  margin-bottom: 14px;
}

.crates-banner h3 {
  margin: 0 0 5px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.32rem;
}

.crates-banner p {
  margin: 0;
  max-width: 520px;
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.crates-currencies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.curr-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.curr-pill strong {
  color: var(--gold);
}

.crates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 11px;
  margin-bottom: 22px;
}

.crate-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  transition: transform 0.14s ease, box-shadow 0.16s ease;
}

.crate-card:hover {
  transform: translateY(-2px);
}

.crate-card.rarity-common { border-color: rgba(148, 163, 184, 0.4); }
.crate-card.rarity-uncommon { border-color: rgba(74, 222, 128, 0.45); background: linear-gradient(160deg, rgba(74, 222, 128, 0.08), var(--bg-panel)); }
.crate-card.rarity-rare { border-color: rgba(56, 189, 248, 0.5); background: linear-gradient(160deg, rgba(56, 189, 248, 0.1), var(--bg-panel)); }
.crate-card.rarity-epic { border-color: rgba(192, 132, 252, 0.58); background: linear-gradient(160deg, rgba(192, 132, 252, 0.13), var(--bg-panel)); }
.crate-card.rarity-legendary { border-color: rgba(251, 191, 36, 0.68); background: linear-gradient(160deg, rgba(251, 191, 36, 0.15), var(--bg-panel)); box-shadow: 0 6px 22px rgba(251, 191, 36, 0.12); }
.crate-card.rarity-mythic { border-color: rgba(251, 113, 133, 0.8); background: linear-gradient(160deg, rgba(251, 113, 133, 0.18), rgba(168, 85, 247, 0.14), var(--bg-panel)); box-shadow: 0 8px 26px rgba(251, 113, 133, 0.2); }

.crate-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crate-emoji {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  flex-shrink: 0;
}

.crate-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.02rem;
}

.crate-odds {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.crate-buy-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crate-open-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}

.crate-open-btn:hover:not(:disabled) {
  background: rgba(255, 209, 102, 0.24);
  border-color: var(--gold);
}

.crate-open-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rarity-pill {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.rarity-pill.rarity-common { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.rarity-pill.rarity-uncommon { background: rgba(74, 222, 128, 0.2); color: #86efac; }
.rarity-pill.rarity-rare { background: rgba(56, 189, 248, 0.22); color: #7dd3fc; }
.rarity-pill.rarity-epic { background: rgba(192, 132, 252, 0.25); color: #d8b4fe; }
.rarity-pill.rarity-legendary { background: rgba(251, 191, 36, 0.26); color: #fde047; }
.rarity-pill.rarity-mythic { background: linear-gradient(90deg, rgba(251, 113, 133, 0.35), rgba(168, 85, 247, 0.35)); color: #fda4af; }

/* WARDROBE GRID */
.wardrobe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.wardrobe-header h4 {
  margin: 0 0 2px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.16rem;
}

.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.wardrobe-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 11px;
  border-radius: 13px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  text-align: center;
}

.wardrobe-card.locked {
  opacity: 0.56;
}

.wardrobe-card.equipped {
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.32);
}

.wardrobe-card.rarity-common { border-color: rgba(148, 163, 184, 0.35); }
.wardrobe-card.rarity-uncommon { border-color: rgba(74, 222, 128, 0.45); }
.wardrobe-card.rarity-rare { border-color: rgba(56, 189, 248, 0.55); }
.wardrobe-card.rarity-epic { border-color: rgba(192, 132, 252, 0.62); }
.wardrobe-card.rarity-legendary { border-color: rgba(251, 191, 36, 0.75); }
.wardrobe-card.rarity-mythic { border-color: rgba(251, 113, 133, 0.85); }

.wardrobe-thumb {
  width: 78px;
  height: 78px;
  margin: 4px auto 2px;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  background: #0d1020;
}

.wardrobe-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wardrobe-card.locked .wardrobe-thumb img {
  filter: brightness(0.18) contrast(1.4) blur(1.5px);
}

.wardrobe-name {
  font-weight: 800;
  font-size: 0.86rem;
}

.wardrobe-stars {
  font-size: 0.72rem;
  color: var(--gold);
  min-height: 14px;
}

.wardrobe-buff {
  font-size: 0.72rem;
  color: var(--mint);
  line-height: 1.35;
}

.wardrobe-card.locked .wardrobe-buff {
  color: var(--text-muted);
}

.frames-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 15px;
}

/* =========================================
   CRATE UNBOXING ROULETTE MODAL
   ========================================= */
.crate-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 18, 0.84);
  backdrop-filter: blur(8px);
}

.crate-modal[hidden] {
  display: none;
}

.crate-modal-card {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, #1a1e38 0%, #101325 100%);
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
}

.crate-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.crate-modal-head h3 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.35rem;
}

.roulette-stage {
  position: relative;
  height: 146px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(7, 9, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.roulette-stage::before,
.roulette-stage::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 68px;
  z-index: 3;
  pointer-events: none;
}

.roulette-stage::before {
  left: 0;
  background: linear-gradient(90deg, #070912, transparent);
}

.roulette-stage::after {
  right: 0;
  background: linear-gradient(270deg, #070912, transparent);
}

.roulette-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--gold);
  font-size: 1.2rem;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.9);
}

.roulette-track {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 10px;
  will-change: transform;
}

.roulette-item {
  width: 106px;
  height: 114px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--rarity-common);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
}

.roulette-item.rarity-uncommon { border-color: var(--rarity-uncommon); }
.roulette-item.rarity-rare { border-color: var(--rarity-rare); }
.roulette-item.rarity-epic { border-color: var(--rarity-epic); }
.roulette-item.rarity-legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 16px rgba(251, 191, 36, 0.35); }
.roulette-item.rarity-mythic { border-color: var(--rarity-mythic); box-shadow: 0 0 22px rgba(251, 113, 133, 0.5); }

.roulette-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.roulette-item span {
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 92px;
}

.crate-reveal {
  text-align: center;
  padding-top: 18px;
  animation: toast-in 0.35s ease;
}

.crate-reveal[hidden] {
  display: none;
}

.reveal-img-wrap {
  width: 120px;
  height: 120px;
  margin: 10px auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: var(--rarity-common);
  box-shadow: 0 0 32px rgba(255, 255, 255, 0.25);
}

.reveal-img-wrap.rarity-uncommon { background: var(--rarity-uncommon); box-shadow: 0 0 34px rgba(74, 222, 128, 0.45); }
.reveal-img-wrap.rarity-rare { background: var(--rarity-rare); box-shadow: 0 0 38px rgba(56, 189, 248, 0.5); }
.reveal-img-wrap.rarity-epic { background: var(--rarity-epic); box-shadow: 0 0 42px rgba(192, 132, 252, 0.55); }
.reveal-img-wrap.rarity-legendary { background: var(--rarity-legendary); box-shadow: 0 0 50px rgba(251, 191, 36, 0.7); }
.reveal-img-wrap.rarity-mythic { background: conic-gradient(#fb7185, #c084fc, #38bdf8, #fde047, #fb7185); box-shadow: 0 0 60px rgba(251, 113, 133, 0.85); }

.reveal-img-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.crate-reveal h4 {
  margin: 0 0 4px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
}

.reveal-status-note {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}

.reveal-buff-line {
  font-size: 0.86rem;
  color: var(--mint);
  font-weight: 700;
  margin-bottom: 16px;
}

.reveal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* =========================================
   WARDROBE FILTER & ADMIN PANEL (KIKIII)
   ========================================= */
.wardrobe-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.7);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.25), rgba(192, 132, 252, 0.2));
  color: #ffe4e6;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.28);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.admin-quick-btn[hidden] {
  display: none;
}

.admin-quick-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.4), rgba(192, 132, 252, 0.32));
  box-shadow: 0 0 18px rgba(251, 113, 133, 0.48);
}

.admin-tab-btn {
  color: #fda4af;
}

.admin-tab-btn[hidden] {
  display: none;
}

.admin-tab-btn.active {
  color: #fb7185;
  border-bottom-color: #fb7185;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 17px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 85% 20%, rgba(251, 113, 133, 0.22), transparent 55%),
    var(--bg-panel);
  border: 1px solid rgba(251, 113, 133, 0.45);
  margin-bottom: 14px;
}

.admin-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fb7185;
}

.admin-hero h3 {
  margin: 3px 0 4px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.32rem;
}

.admin-hero p {
  margin: 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-card h4 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.02rem;
  color: #f8fafc;
}

.admin-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-input-row input,
.admin-input-row select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
}

.admin-server-box {
  background: var(--bg-panel);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 14px;
  padding: 14px;
}

.admin-server-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-server-head h4 {
  margin: 0 0 2px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.08rem;
}

/* RESPONSIVE */
@media (max-width: 1020px) {
  html,
  body {
    overflow: auto;
    height: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    width: 100%;
    overflow: visible;
  }

  .stage-column {
    min-height: 520px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .store-column {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}
