:root {
  --sky: #5BC8F5;
  --sun: #FFE135;
  --accent: #FFE135;
  --accent2: #FFA500;
  --grass: #5CB85C;
  --red: #FF4757;
  --orange: #FF6348;
  --pink: #FF4FAD;
  --purple: #7B2FBE;
  --teal: #00C9A7;
  --dark: #1E1B2E;
  --ink: #2D2B3D;
  --card: #FFFFFF;
  --outline: 3px solid #1E1B2E;
  --shadow: 5px 5px 0 #1E1B2E;
  --shadow-sm: 3px 3px 0 #1E1B2E;
  --gem-color: #00C9A7;
}
body.theme-neon { --sun: #00FFFF; --accent: #00FFFF; --accent2: #0080FF; --red: #FF00FF; }
body.theme-fire { --sun: #FF6000; --accent: #FF6000; --accent2: #FF2200; --red: #FF6000; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--sky);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.4) 0%, transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(255,255,255,0.3) 0%, transparent 25%);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='6' fill='%23FFE135' stroke='%231E1B2E' stroke-width='3'/%3E%3C/svg%3E") 16 16, auto;
}

/* ═══ CLOUDS ═══ */
.clouds {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  border: 3px solid rgba(0,0,0,0.1);
  animation: driftCloud linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.08);
}
.cloud:nth-child(1) { width: 120px; height: 40px; top: 20px; animation-duration: 30s; animation-delay: 0s; }
.cloud:nth-child(1)::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud:nth-child(1)::after { width: 45px; height: 45px; top: -22px; left: 55px; }
.cloud:nth-child(2) { width: 90px; height: 30px; top: 50px; animation-duration: 45s; animation-delay: -10s; opacity: 0.7; }
.cloud:nth-child(2)::before { width: 45px; height: 45px; top: -22px; left: 15px; }
.cloud:nth-child(3) { width: 140px; height: 45px; top: 10px; animation-duration: 60s; animation-delay: -25s; opacity: 0.85; }
.cloud:nth-child(3)::before { width: 70px; height: 70px; top: -35px; left: 25px; }
.cloud:nth-child(3)::after { width: 55px; height: 55px; top: -28px; left: 70px; }
@keyframes driftCloud { from { transform: translateX(-200px); } to { transform: translateX(110vw); } }

/* ═══ HEADER — solo información ═══ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark);
  border-bottom: 3px solid var(--sun);
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

/* Fila 1: dinero + chips */
.hdr-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 3px;
  gap: 8px;
}
.hdr-money-block {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.hm-amount {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: var(--sun);
  line-height: 1;
  transition: transform 0.15s;
  white-space: nowrap;
}
.hm-amount.bounce { animation: moneyBounce 0.3s ease; }
@keyframes moneyBounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.25)} }
.hm-ips {
  font-size: 0.6rem;
  font-weight: 900;
  color: #2DC653;
  white-space: nowrap;
}
.hdr-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hdr-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 99px;
  padding: 3px 9px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  color: white;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.hdr-chip:hover { background: rgba(255,255,255,0.14); }
.hdr-chip.gems { color: #D4A8FF; border-color: rgba(155,93,229,0.4); }
.hdr-chip.level { color: #FFE135; border-color: rgba(255,225,53,0.4); }

/* ⚙️ settings button */
.hdr-settings-btn {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.hdr-settings-btn:hover { background: rgba(255,255,255,0.18); color: white; }

/* Fila 2: XP bar delgada */
.hdr-xp-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 5px;
}
.hdr-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #e040fb);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.header-money { display: none; } /* legacy — ocultar */
.logo-wrap { display: none; }    /* logo movido al panel ⚙️ */
.xp-circle-wrap { display: none; } /* reemplazado por barra */
.gem-display { display: none; }
.hdr-map-btn { display: none; }
.sound-btn { display: none; }
.company-name-display { display: none; }

/* ═══ PANEL SECUNDARIO ⚙️ ═══ */
#secondaryPanel {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
}
#secondaryPanel.open { display: block; }
.sec-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.sec-drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(300px, 85vw);
  background: var(--dark);
  border-left: 3px solid var(--sun);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
  overflow-y: auto;
  animation: drawerIn 0.22s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.sec-title {
  font-family: 'Boogaloo', cursive;
  font-size: 1.4rem;
  color: var(--sun);
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sec-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.sec-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 13px 16px;
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
}
.sec-btn:hover { background: rgba(255,255,255,0.12); }
.sec-btn-icon { font-size: 1.4rem; width: 28px; text-align: center; }
.sec-btn-sub { font-size: 0.6rem; color: rgba(255,255,255,0.5); font-family: 'Nunito', sans-serif; font-weight: 700; margin-top: 1px; }
.sec-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
.sec-game-info {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  font-weight: 700;
  text-align: center;
}

/* ═══ BOTTOM NAV — 4 tabs limpios ═══ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--dark);
  border-top: 3px solid rgba(255,255,255,0.08);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-btn {
  flex: 1;
  padding: 10px 4px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}
.nav-btn.active {
  background: rgba(255,225,53,0.1);
}
.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 3px;
  background: var(--sun);
  border-radius: 0 0 4px 4px;
}
.nav-btn:hover:not(.active) { background: rgba(255,255,255,0.05); }
.nav-emoji { font-size: 1.35rem; }
.nav-label { font-size: 0.52rem; font-weight: 900; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }
.nav-btn.active .nav-label { color: var(--sun); }

/* Ocultar tabs redundantes del centro — la nav de abajo los reemplaza */
.tabs { display: none; }
/* Stats strip — compactar */
.stats-strip { display: none; }
/* Level card — compactar, la info está en el header */
.level-card { display: none; }


/* ═══ SCREEN SYSTEM ═══ */
.screen { display: none; }
.screen.active { display: block; }

/* ═══ INTRO SCREEN ═══ */
#introScreen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  z-index: 10;
}
.intro-title {
  font-family: 'Boogaloo', cursive;
  font-size: 4.5rem;
  color: var(--dark);
  text-align: center;
  line-height: 0.9;
  -webkit-text-stroke: 3px var(--dark);
  paint-order: stroke fill;
  filter: drop-shadow(6px 6px 0 rgba(0,0,0,0.3));
}
.intro-title .line1 { color: var(--sun); display: block; }
.intro-title .line2 { color: white; display: block; font-size: 3rem; }
.intro-title .line3 { color: var(--red); display: block; font-size: 5rem; }

.intro-scene {
  margin: 24px 0;
  font-size: 5rem;
  display: flex;
  gap: 8px;
  filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.2));
  animation: sceneWobble 3s ease-in-out infinite;
}
@keyframes sceneWobble { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.intro-subtitle {
  background: white;
  border: var(--outline);
  border-radius: 16px;
  padding: 14px 24px;
  box-shadow: var(--shadow);
  font-size: 1rem;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  max-width: 320px;
  margin-bottom: 32px;
}
.intro-subtitle strong { color: var(--red); }

.btn-start {
  background: var(--red);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  padding: 16px 48px;
  border: var(--outline);
  border-radius: 99px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.btn-start:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn-start:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-start span { display: inline-block; animation: arrowBounce 1s ease infinite; }
@keyframes arrowBounce { 0%,100%{transform:translateX(0)} 50%{transform:translateX(6px)} }

/* ═══ GAME SCREEN ═══ */
#gameScreen {
  position: relative;
  z-index: 10;
  padding: 16px;
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* ═══ OFFLINE BANNER ═══ */
.offline-banner {
  background: linear-gradient(135deg, #FF6348, #FF4757);
  border: var(--outline);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.1s;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.offline-banner:hover { transform: translateY(-2px); }
.offline-banner.hidden { display: none; }
.ob-emoji { font-size: 2.5rem; }
.ob-text { flex: 1; }
.ob-text h3 { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: white; }
.ob-text p { font-size: 0.75rem; color: rgba(255,255,255,0.85); font-weight: 700; }
.ob-btn {
  background: white;
  color: var(--red);
  font-weight: 900;
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ═══ STATS ═══ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-pill {
  background: white;
  border: var(--outline);
  border-radius: 14px;
  padding: 10px 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
.stat-pill:nth-child(1) { background: #FFF3CD; animation-delay: 0.05s; }
.stat-pill:nth-child(2) { background: #D4EDDA; animation-delay: 0.1s; }
.stat-pill:nth-child(3) { background: #D1ECF1; animation-delay: 0.15s; }
.stat-pill:nth-child(4) { background: #F8D7DA; animation-delay: 0.2s; }
.stat-emo { font-size: 1.2rem; }
.stat-val { font-family: 'Fredoka One', cursive; font-size: 1rem; color: var(--ink); }
.stat-lbl { font-size: 0.55rem; font-weight: 900; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══ LEVEL BAR ═══ */
.level-card {
  background: white;
  border: var(--outline);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.lc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lc-badge {
  background: var(--purple);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  padding: 4px 14px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.lc-next { font-size: 0.7rem; font-weight: 900; color: #888; }
.lc-bar-bg {
  height: 18px;
  background: #f0f0f0;
  border-radius: 99px;
  border: 2px solid var(--ink);
  overflow: hidden;
}
.lc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #B24BF3);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.34,1.2,0.64,1);
  position: relative;
  overflow: hidden;
}
.lc-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

/* ═══ TABS ═══ */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  background: white;
  border: var(--outline);
  border-radius: 12px;
  padding: 10px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, background 0.15s;
  text-align: center;
}
.tab-btn.active {
  background: var(--dark);
  color: var(--sun);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.tab-btn:hover:not(.active) { transform: translate(-1px,-1px); }

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

/* ═══ BUSINESS CARDS ═══ */
/* ═══════════ BIZ CARDS v9 ═══════════ */
.biz-grid { display: flex; flex-direction: column; gap: 16px; }

.biz-card {
  background: white;
  border: var(--outline);
  border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards;
  position: relative;
  overflow: hidden;
  /* Chrome fix: forzar GPU compositing para evitar que overflow:hidden corte el contenido durante transform */
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 0;
  grid-template-columns: unset;
}
.biz-card:hover { transform: translate(-2px,-4px) translateZ(0); box-shadow: 7px 9px 0 var(--ink); }
.biz-card:not(:hover) { transform: translateZ(0); }
.biz-card.locked { opacity: 0.58; filter: grayscale(0.45); pointer-events: none; }
.biz-card::before { display: none; }

/* BANNER TOP */
.biz-banner {
  height: 80px;
  display: flex;
  align-items: flex-end;
  padding: 10px 14px 10px;
  position: relative;
  overflow: hidden;
  border-bottom: var(--outline);
  flex-shrink: 0;
  /* Chrome: aislar este contexto de composición */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  contain: paint;
}
.biz-banner-bg {
  position: absolute; inset: 0;
  opacity: 0.15;
  transition: opacity 0.3s;
}
.biz-banner-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.45) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: 0.7;
}
.biz-card:hover .biz-banner-bg { opacity: 0.22; }

.biz-icon-wrap {
  font-size: 2.8rem;
  line-height: 1;
  position: relative;
  z-index: 2;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.12));
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
}
.biz-icon-wrap:hover { transform: scale(1.15) rotate(-5deg); }

.biz-banner-info {
  flex: 1;
  padding-left: 12px;
  position: relative;
  z-index: 2;
  min-width: 0;
}
.biz-name {
  font-family: 'Boogaloo', cursive;
  font-size: 1.12rem;
  color: var(--ink);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.biz-custom-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(30,27,46,0.5);
  font-style: italic;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.biz-badge-row {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.biz-lvl-badge {
  color: white;
  font-weight: 900;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 99px;
  border: 2px solid rgba(0,0,0,0.2);
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,0.2);
}
.biz-hot-badge {
  background: #FF4757;
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1.5px solid rgba(0,0,0,0.15);
  animation: hotBadge 2s ease-in-out infinite;
}
@keyframes hotBadge { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.biz-top-badge {
  background: #9B5DE5;
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1.5px solid rgba(0,0,0,0.15);
}

/* EDIT PENCIL */
.biz-edit-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: all 0.15s;
  backdrop-filter: blur(3px);
  box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
}
.biz-edit-btn:hover { background: white; transform: scale(1.12) rotate(10deg); }

/* BODY */
.biz-body-inner {
  padding: 11px 14px 10px;
  flex: 1;
}

/* MICRO STORY */
.biz-story {
  font-size: 0.7rem;
  font-weight: 700;
  color: #555;
  padding: 6px 10px;
  background: #f9f9f9;
  border-radius: 10px;
  border-left: 3px solid var(--biz-accent, #ccc);
  margin-bottom: 9px;
  line-height: 1.4;
  min-height: 30px;
  transition: background 0.5s, color 0.5s;
}
.biz-story.story-flash {
  background: #fffae6;
  color: #333;
  border-left-color: #FFD200;
}

/* COLOR PICKER */
.biz-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}
.biz-color-lbl { font-size: 0.58rem; font-weight: 900; color: #bbb; text-transform: uppercase; letter-spacing: 0.5px; }
.biz-color-dot {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.biz-color-dot:hover { transform: scale(1.2); }
.biz-color-dot.sel { border: 2.5px solid var(--ink); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--ink); transform: scale(1.08); }

/* PROGRESS */
.biz-prog-wrap { margin-bottom: 9px; }
.biz-prog-bg {
  height: 13px;
  background: #f0f0f0;
  border-radius: 99px;
  border: 2.5px solid var(--ink);
  overflow: hidden;
  position: relative;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.biz-prog-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.2s linear;
  position: relative;
  will-change: width;
}
.biz-prog-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shine 2s linear infinite;
  will-change: transform;
}
@keyframes shine { from{transform:translateX(-100%) translateZ(0)} to{transform:translateX(200%) translateZ(0)} }

.biz-income-line {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.67rem;
  font-weight: 900;
}
.bil-income { color: var(--grass); font-size: 0.75rem; }
.bil-time { color: #bbb; }
.bil-total { color: #ccc; font-size: 0.62rem; }

/* STATS CHIPS */
.biz-stats-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.biz-stat-chip {
  background: #f5f5f5;
  border: 1.5px solid #ebebeb;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #777;
}

/* FOOTER */
.biz-footer-row {
  padding: 8px 14px 13px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1.5px solid #f3f3f3;
}

/* LOCK STATE */
.biz-lock-banner {
  padding: 14px;
  text-align: center;
  color: #aaa;
  font-size: 0.75rem;
  font-weight: 900;
}

/* CHALLENGES PANEL */
.ch-panel {
  background: linear-gradient(135deg, #1E1B2E 0%, #2d1b69 100%);
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ch-panel-title {
  font-family: 'Boogaloo', cursive;
  font-size: 1.05rem;
  color: #FFE135;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ch-item {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ch-icon { font-size: 1.2rem; flex-shrink: 0; }
.ch-mid { flex: 1; }
.ch-name { font-family: 'Fredoka One', cursive; font-size: 0.8rem; color: white; margin-bottom: 3px; }
.ch-prog-txt { font-size: 0.6rem; font-weight: 900; color: rgba(255,255,255,0.55); margin-bottom: 4px; }
.ch-bar { height: 6px; background: rgba(255,255,255,0.12); border-radius: 99px; overflow: hidden; }
.ch-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s; }
.ch-right { text-align: right; }
.ch-reward { font-size: 0.7rem; font-weight: 900; color: #FFE135; }
.ch-claim-btn {
  margin-top: 4px;
  background: #2DC653; color: white;
  border: 2px solid white; border-radius: 99px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.58rem; padding: 3px 9px;
  cursor: pointer; display: block;
}
.ch-done-txt { font-size: 0.58rem; color: rgba(255,255,255,0.4); margin-top: 4px; }

/* SUPER EMPRESA BANNER */
.super-emp-banner {
  display: none;
  background: linear-gradient(135deg, #7a5600, #FFD700, #7a5600);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
  animation: goldGlow 2.5s ease-in-out infinite;
}
.super-emp-banner.show { display: block; }
@keyframes goldGlow { 0%,100%{transform:scale(1)} 50%{transform:scale(1.02)} }

/* RENAME MODAL */
.rename-modal-bg {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(10,8,30,0.92);
  /* backdrop-filter: blur(8px); removed for mobile FPS */
  display: none; align-items: center; justify-content: center;
}
.rename-modal-bg.open { display: flex; }
.rename-box {
  background: white;
  border: var(--outline);
  border-radius: 26px;
  padding: 28px 24px 24px;
  box-shadow: 6px 6px 0 var(--ink);
  width: min(92vw, 350px);
  text-align: center;
}
.rename-preview-icon { font-size: 3rem; margin-bottom: 8px; }
.rename-title { font-family: 'Boogaloo', cursive; font-size: 1.5rem; color: var(--ink); margin-bottom: 4px; }
.rename-subtitle { font-size: 0.72rem; font-weight: 700; color: #999; margin-bottom: 18px; }
.rename-inp {
  width: 100%; font-family: 'Fredoka One', cursive; font-size: 1rem;
  padding: 11px 16px; border: var(--outline); border-radius: 14px;
  outline: none; background: #fafafa; text-align: center; margin-bottom: 14px;
}
.rename-inp:focus { background: white; border-color: var(--sky); }
.logo-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.logo-opt {
  width: 42px; height: 42px; border-radius: 11px;
  border: 2.5px solid #eee; background: #fafafa;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; cursor: pointer; transition: all 0.15s;
}
.logo-opt:hover { transform: scale(1.12); border-color: #ccc; }
.logo-opt.sel { border-color: var(--ink); background: #fffbe6; box-shadow: 0 0 0 3px rgba(255,225,53,0.4); }
.rename-btns { display: flex; gap: 10px; justify-content: center; }

/* COMPANY MODAL */
.company-modal-bg {
  position: fixed; inset: 0; z-index: 910;
  background: rgba(10,8,30,0.92);
  /* backdrop-filter: blur(8px); removed for mobile FPS */
  display: none; align-items: center; justify-content: center;
}
.company-modal-bg.open { display: flex; }
.company-box {
  background: white; border: var(--outline); border-radius: 26px;
  padding: 30px 24px 24px; box-shadow: 6px 6px 0 var(--ink);
  width: min(92vw, 360px); text-align: center;
}

/* SHARE BTN IN HUD */
.btn-share {
  background: linear-gradient(135deg, #5B21B6, #7C3AED);
  color: white; font-family: 'Fredoka One', cursive;
  font-size: 0.72rem; padding: 6px 13px;
  border: 2px solid var(--ink); border-radius: 99px;
  cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s; white-space: nowrap;
}
.btn-share:hover { transform: translateY(-1px); }

/* COMPANY NAME in header area */
.company-name-display {
  font-size: 0.58rem; font-weight: 900;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase; letter-spacing: 1px;
  text-align: center; margin-top: 1px;
  display: none;
}
.company-name-display.show { display: block; }

/* SUPER HEADER (unlocked when super empresa) */
body.super-empresa .hdr {
  background: linear-gradient(135deg, #7a5600 0%, #C8960C 40%, #FFD700 60%, #C8960C 80%, #7a5600 100%) !important;
  /* animation: goldHeaderPulse 3s ease-in-out infinite; removed for FPS */
}
/* @keyframes goldHeaderPulse { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.15)} } removed for FPS */

/* biz-header & biz-name needed later in file */
.biz-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.biz-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.1;
}
.biz-lvl-badge {
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.biz-desc { font-size: 0.7rem; color: #888; font-weight: 700; margin-bottom: 8px; }

/* Progress */
.biz-prog-wrap { margin-bottom: 8px; }
.biz-prog-bg {
  height: 10px;
  background: #f0f0f0;
  border-radius: 99px;
  border: 2px solid var(--ink);
  overflow: hidden;
}
.biz-prog-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.2s linear;
}
.biz-income-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.65rem;
  font-weight: 900;
}
.bil-income { color: var(--grass); }
.bil-time { color: #aaa; }

.biz-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

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

.btn-buy {
  background: var(--grass);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.8rem;
  padding: 7px 16px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}
.btn-buy:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-buy:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-buy:disabled { background: #ccc; color: #999; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 #aaa; }
.btn-buy.open-btn { background: var(--orange); }
.btn-buy.maxed { background: var(--purple); }

.biz-cost-tag {
  font-size: 0.65rem;
  font-weight: 900;
  color: #888;
}
.lock-tag {
  background: #eee;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══ UPGRADES ═══ */
.upg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.upg-card {
  background: white;
  border: var(--outline);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}
.upg-card:hover:not(.bought):not(.locked-upg) { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.upg-card.bought {
  background: #f5f5f5;
  opacity: 0.6;
  cursor: default;
}
.upg-card.locked-upg { opacity: 0.4; cursor: not-allowed; }
.upg-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 2px 2px 0 var(--ink);
}
.upg-name { font-family: 'Fredoka One', cursive; font-size: 0.9rem; color: var(--ink); }
.upg-desc { font-size: 0.65rem; color: #888; font-weight: 700; line-height: 1.4; }
.upg-cost {
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--orange);
  margin-top: auto;
}
.upg-cost.bought { color: var(--grass); }
.upg-ribbon {
  position: absolute;
  top: -2px; right: 10px;
  background: var(--teal);
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 0 0 8px 8px;
  border: 2px solid var(--ink);
  border-top: none;
}

/* ═══ LEADERBOARD ═══ */
.lb-card {
  background: white;
  border: var(--outline);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lb-head {
  background: var(--dark);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-head-title { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: var(--sun); }
.lb-head-sub { font-size: 0.65rem; color: rgba(255,255,255,0.6); font-weight: 700; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 2px solid #f0f0f0;
  transition: background 0.15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.you { background: #FFF3CD; }
.lb-row:hover { background: #f9f9f9; }
.lb-row.you:hover { background: #FFEAA0; }

.lb-rank {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  flex-shrink: 0;
}
.lb-rank.r1 { background: var(--sun); }
.lb-rank.r2 { background: #E0E0E0; }
.lb-rank.r3 { background: #FFCBA4; }
.lb-rank.rN { background: #f0f0f0; font-size: 0.8rem; }

.lb-avatar { font-size: 1.4rem; }
.lb-info { flex: 1; }
.lb-name { font-weight: 900; font-size: 0.85rem; color: var(--ink); }
.lb-detail { font-size: 0.6rem; color: #aaa; font-weight: 700; }
.lb-money { font-family: 'Fredoka One', cursive; font-size: 0.9rem; color: var(--grass); }

/* ═══ MAP ═══ */
.map-card {
  background: white;
  border: var(--outline);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}
.map-title-bar {
  background: linear-gradient(135deg, #1E1B2E, #3a2d5e);
  padding: 12px 18px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: #FFE135;
}

/* ═══ OVERLAY MAP MODAL ═══ */
#mapOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8,5,20,0.99);
  /* backdrop-filter: blur(8px); removed for mobile FPS */
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 100px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#mapOverlay.open { display: flex; }
.map-modal-header {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.map-modal-title {
  font-family: 'Boogaloo', cursive;
  font-size: 2rem;
  color: #FFE135;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.6);
}
.map-modal-close {
  background: #FF4757;
  color: white;
  border: 3px solid #1E1B2E;
  border-radius: 99px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1E1B2E;
  transition: transform 0.1s;
}
.map-modal-close:hover { transform: scale(1.05); }

/* ─── FLAT ZONE GRID ─── */
#flatZoneGrid {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fz-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #12102a;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform 0.1s, border-color 0.15s;
}
.fz-card:hover:not(.fz-locked) { transform: translateY(-2px); border-color: rgba(255,255,255,0.25); }
.fz-active { border-color: #FFE135 !important; background: #1e1a38; }
.fz-locked { opacity: 0.45; }
.fz-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.fz-info { flex: 1; min-width: 0; }
.fz-name { font-family: 'Fredoka One', cursive; font-size: 0.95rem; color: #fff; }
.fz-desc { font-size: 0.62rem; font-weight: 700; color: #778; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.fz-mult { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: #FFE135; }
.fz-status { font-size: 0.65rem; font-weight: 900; text-align: right; }

/* ═══ HUD MAP BUTTON ═══ */
.hdr-map-btn { background:linear-gradient(135deg,#7B2FBE,#B24BF3);color:white;font-family:"Fredoka One",cursive;font-size:0.85rem;padding:7px 14px;border:2px solid #1E1B2E;border-radius:99px;cursor:pointer;box-shadow:3px 3px 0 #1E1B2E;transition:transform 0.1s;white-space:nowrap;display:flex;align-items:center;gap:5px; }
.hdr-map-btn:hover { transform:translateY(-2px); }
.hdr-map-btn .zone-dot { width:8px;height:8px;background:#FFE135;border-radius:50%;animation:dotPulse 1.5s ease-in-out infinite; }
@keyframes dotPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.4)} }
.map-grid,.zone-cell,.zone-emoji,.zone-name,.zone-mult,.zone-cost,.zone-badge,.zone-locked-badge { display:none; }


/* ═══ ASCENSO SOCIAL ═══ */
.ascenso-wrap { padding: 0 0 24px; }

/* ═══ PROPERTY BANNER — clickeable, animated per stage ═══ */
.ascenso-scene {
  position: relative;
  border: 3px solid #1E1B2E;
  border-radius: 20px;
  overflow: hidden;
  height: 200px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ascenso-scene:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(0,0,0,0.4); }
.ascenso-scene:active { transform: scale(0.98); }

/* ── click ripple ── */
.ascenso-scene::after {
  content:''; position:absolute; inset:0;
  background: rgba(255,255,255,0);
  transition: background 0.3s;
  border-radius: 18px;
  pointer-events: none;
}
.ascenso-scene:active::after { background: rgba(255,255,255,0.08); }

.scene-bg { position: absolute; inset: 0; }

/* ── STAGE 0: El Comienzo — Barrio humilde ── */
.scene-stage-0 .scene-bg { background: linear-gradient(180deg,#87CEEB 0%,#c9dff0 55%,#8B7355 55%,#7a6345 100%); }

/* ── STAGE 1: Casa Propia ── */
.scene-stage-1 .scene-bg { background: linear-gradient(180deg,#a8e6cf 0%,#88d8b0 45%,#5cb85c 45%,#4a9e4a 100%); }

/* ── STAGE 2: Casa Moderna ── */
.scene-stage-2 .scene-bg { background: linear-gradient(180deg,#deeeff 0%,#b8d8f5 50%,#6aaa6a 50%,#5a9a5a 100%); }

/* ── STAGE 3: Villa con piscina ── */
.scene-stage-3 .scene-bg { background: linear-gradient(180deg,#ffe9a0 0%,#87ceeb 45%,#00b4d8 45%,#0096c7 70%,#48cae4 70%,#90e0ef 100%); }

/* ── STAGE 4: Penthouse — luxury night ── */
.scene-stage-4 .scene-bg {
  background: linear-gradient(180deg,#020412 0%,#050d2e 30%,#0a1554 55%,#0d1a60 70%,#1a2070 100%);
}

/* ── STAGE 5: Jet Privado ── */
.scene-stage-5 .scene-bg { background: linear-gradient(180deg,#e8f4fd 0%,#87ceeb 60%,#c8e6c9 100%); }

/* ── STAGE 6: Corporación ── */
.scene-stage-6 .scene-bg { background: linear-gradient(180deg,#050505 0%,#0d0d1a 40%,#16213e 75%,#1a1a2e 100%); }

/* ════ SHARED SCENE ELEMENTS ════ */

/* Walking characters */
.sc-person {
  position: absolute;
  bottom: 0;
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,0.4));
  animation: walkPerson var(--walk-dur, 8s) linear infinite var(--walk-del, 0s);
}
@keyframes walkPerson {
  0%   { left: -60px; transform: scaleX(1); }
  49%  { left: calc(100% + 60px); transform: scaleX(1); }
  50%  { left: calc(100% + 60px); transform: scaleX(-1); }
  99%  { left: -60px; transform: scaleX(-1); }
  100% { left: -60px; transform: scaleX(1); }
}
/* bob while walking */
.sc-person::before {
  content: attr(data-e);
  display: block;
  animation: bobWalk 0.4s ease-in-out infinite alternate;
}
@keyframes bobWalk { from{transform:translateY(0)} to{transform:translateY(-3px)} }

/* Floating money */
.sc-money {
  position: absolute;
  font-size: 0.85rem;
  font-family: 'Fredoka One',cursive;
  color: #FFE135;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  animation: floatMoney 3s ease-in-out infinite var(--md,0s);
  pointer-events: none;
}
@keyframes floatMoney { 0%,100%{transform:translateY(0) rotate(-5deg);opacity:.8} 50%{transform:translateY(-10px) rotate(5deg);opacity:1} }

/* Stars sky */
.sc-stars { position:absolute; inset:0; pointer-events:none; }
.sc-star {
  position:absolute; border-radius:50%;
  background:white;
  animation: scTwinkle var(--sd,2s) ease-in-out infinite var(--sl,0s);
}
@keyframes scTwinkle { 0%,100%{opacity:0.15} 50%{opacity:1} }

/* Ground / floor */
.sc-ground { position:absolute; bottom:0; left:0; right:0; }

/* Building silhouettes (penthouse BG) */
.sc-building {
  position: absolute; bottom: 0;
  background: var(--bc, #0a1040);
  border-radius: 4px 4px 0 0;
}
/* Windows on buildings */
.sc-win {
  position:absolute;
  background: var(--wc, #FFE135);
  border-radius: 2px;
  animation: winBlink var(--wd,3s) ease-in-out infinite var(--wdl,0s);
}
@keyframes winBlink { 0%,90%,100%{opacity:1} 93%{opacity:0.1} }

/* Pool */
.sc-pool {
  position:absolute; bottom:8px;
  height:22px; border-radius:12px;
  background: linear-gradient(90deg,#00b4d8,#48cae4,#90e0ef);
  border: 2px solid rgba(255,255,255,0.5);
  overflow:hidden;
}
.sc-pool::after {
  content:'';
  position:absolute; top:40%; left:-20%; right:-20%; height:40%;
  background: rgba(255,255,255,0.25);
  border-radius:50%;
  animation: waveAnim 2s ease-in-out infinite;
}
@keyframes waveAnim { 0%,100%{transform:scaleX(1) translateX(0)} 50%{transform:scaleX(1.2) translateX(5%)} }

/* Palm tree */
.sc-palm { position:absolute; bottom:0; font-size:2.5rem; animation:palmSway 3s ease-in-out infinite; transform-origin:bottom center; }
@keyframes palmSway { 0%,100%{transform:rotate(-3deg)} 50%{transform:rotate(3deg)} }

/* Penthouse floor terrace */
.sc-terrace {
  position:absolute; bottom:0; left:0; right:0;
  height:32px;
  background: linear-gradient(180deg,#c9a96e,#b8935a);
  border-top: 2px solid #d4af70;
}

/* City glow */
.sc-glow {
  position:absolute;
  border-radius:50%;
  filter: blur(20px);
  animation: glowPulse var(--gd,4s) ease-in-out infinite var(--gdl,0s);
  pointer-events:none;
}
@keyframes glowPulse { 0%,100%{opacity:0.3} 50%{opacity:0.7} }
@keyframes flyJet { from{left:-80px;opacity:0} 10%{opacity:1} 90%{opacity:1} to{left:110%;opacity:0} }
@keyframes floatScene { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(-8px)} }


/* Champagne bubbles */
.sc-bubble {
  position:absolute;
  border-radius:50%;
  background: rgba(255,225,53,0.6);
  animation: bubbleRise var(--bd,2s) ease-in infinite var(--bdl,0s);
  pointer-events:none;
}
@keyframes bubbleRise { 0%{transform:translateY(0);opacity:.8} 100%{transform:translateY(-40px);opacity:0} }

/* Scene label */
.scene-label {
  position: absolute;
  top: 12px; left: 16px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}
.scene-influence {
  position: absolute;
  top: 12px; right: 16px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: var(--ink);
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 99px;
  border: 2px solid var(--ink);
}

/* Stage cards */
.stage-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.stage-card {
  background: var(--card);
  border: var(--outline);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
  position: relative;
  overflow: hidden;
}
.stage-card.current-stage {
  background: linear-gradient(135deg, #FFE135, #FFA500);
  animation: pulseStage 2s ease-in-out infinite;
}
@keyframes pulseStage { 0%,100%{box-shadow: var(--shadow-sm)} 50%{box-shadow: 0 0 20px rgba(255,165,0,0.6), var(--shadow-sm)} }
.stage-card.completed-stage { background: linear-gradient(135deg, #d4edda, #a8d8a8); opacity: 0.85; }
.stage-card.locked-stage { opacity: 0.45; }
.stage-icon { font-size: 2.4rem; flex-shrink: 0; }
.stage-info { flex: 1; min-width: 0; }
.stage-name { font-family: 'Fredoka One', cursive; font-size: 1rem; color: var(--ink); }
.stage-bonus { font-size: 0.7rem; font-weight: 700; color: #555; margin-top: 2px; }
.stage-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.badge-current { background: var(--ink); color: var(--sun); }
.badge-done { background: #5CB85C; color: white; }
.badge-locked { background: #ddd; color: #888; }

/* Influence panel */
.influence-panel {
  background: linear-gradient(135deg, #1a1a3e, #2d2d6e);
  border: var(--outline);
  border-radius: 18px;
  padding: 18px;
  color: white;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.influence-title { font-family: 'Boogaloo', cursive; font-size: 1.5rem; margin-bottom: 12px; }
.influence-upgrades { display: flex; flex-direction: column; gap: 8px; }
.inf-upgrade {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.inf-upgrade:hover { background: rgba(255,255,255,0.15); transform: translateX(4px); }
.inf-upgrade.bought { opacity: 0.5; cursor: default; }
.inf-upgrade.bought:hover { transform: none; }
.inf-upgrade-icon { font-size: 1.5rem; }
.inf-upgrade-info { flex: 1; }
.inf-upgrade-name { font-family: 'Fredoka One', cursive; font-size: 0.9rem; }
.inf-upgrade-desc { font-size: 0.7rem; opacity: 0.75; }
.inf-upgrade-cost { font-size: 0.8rem; font-weight: 900; color: #FFD700; }

/* Ascend button */
.btn-ascend {
  width: 100%;
  background: linear-gradient(135deg, #FFE135, #FF8C00);
  color: #1E1B2E;
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem;
  padding: 18px 16px;
  border: 3px solid #1E1B2E;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 6px 0 #1E1B2E, 0 0 24px rgba(255,165,0,0.55);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.5px;
  margin-top: 20px;
  display: block;
  animation: ascendPulse 2s ease-in-out infinite;
}
@keyframes ascendPulse {
  0%,100% { box-shadow: 0 6px 0 #1E1B2E, 0 0 20px rgba(255,165,0,0.4); }
  50%      { box-shadow: 0 6px 0 #1E1B2E, 0 0 36px rgba(255,165,0,0.85); }
}
.btn-ascend:hover { transform: scale(1.02); }
.btn-ascend:disabled { opacity: 0.45; cursor: not-allowed; transform: none; background: #ccc; }

/* Ascend modal */
.ascend-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s;
}
.ascend-modal {
  background: var(--card);
  border: var(--outline);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 340px;
  width: 92%;
  text-align: center;
  box-shadow: 8px 8px 0 var(--ink);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}
.ascend-modal::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,225,53,0.08), rgba(255,165,0,0.08));
  pointer-events: none;
}
.ascend-modal-title { font-family: 'Boogaloo', cursive; font-size: 2rem; color: var(--ink); margin-bottom: 8px; }
.ascend-modal-scene { font-size: 4rem; margin: 12px 0; animation: floatScene 2s ease-in-out infinite; }
.ascend-modal-sub { font-size: 0.85rem; font-weight: 700; color: #555; margin-bottom: 16px; }
.ascend-keep-lose {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
.akl-box { border-radius: 12px; padding: 10px; font-size: 0.75rem; font-weight: 700; text-align: left; border: 2px solid var(--ink); }
.akl-keep { background: #d4edda; }
.akl-lose { background: #f8d7da; }
.akl-title { font-size: 0.8rem; font-family: 'Fredoka One', cursive; margin-bottom: 6px; }
.ascend-confirm-btns { display: flex; gap: 10px; }
.btn-cancel-ascend {
  flex: 1;
  background: #ddd; color: var(--ink);
  border: var(--outline); border-radius: 12px;
  padding: 12px; font-family: 'Fredoka One', cursive;
  font-size: 0.95rem; cursor: pointer;
}
.btn-confirm-ascend {
  flex: 2;
  background: linear-gradient(135deg, #FFE135, #FFA500);
  color: var(--ink);
  border: var(--outline); border-radius: 12px;
  padding: 12px; font-family: 'Fredoka One', cursive;
  font-size: 1rem; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}
.btn-confirm-ascend:hover { transform: scale(1.03); }

/* Ascend celebration */
.ascend-celebration {
  position: fixed; inset: 0;
  z-index: 10000;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.ascend-cel-text {
  font-family: 'Boogaloo', cursive;
  font-size: 3rem;
  color: white;
  text-shadow: 3px 3px 0 var(--ink);
  animation: celBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
}
.ascend-cel-sub {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: var(--sun);
  text-shadow: 2px 2px 0 var(--ink);
  margin-top: 8px;
  animation: celBounce 0.6s 0.2s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
}
@keyframes celBounce { from{opacity:0;transform:scale(0.5)} to{opacity:1;transform:scale(1)} }

/* Confetti particle override */
.confetti-ascend {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9998;
  animation: confettiFall 2s ease-in forwards;
}
@keyframes confettiFall {
  from { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ═══ EVENT BANNER ═══ */
.event-banner {
  background: linear-gradient(135deg, #FF4757, #FF6B81);
  border: var(--outline);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.event-banner.hidden { display: none; }
.ev-icon { font-size: 2rem; animation: eventPulse 1.5s ease-in-out infinite; }
@keyframes eventPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }
.ev-text h3 { font-family: 'Fredoka One', cursive; font-size: 1rem; color: white; }
.ev-text p { font-size: 0.7rem; color: rgba(255,255,255,0.85); font-weight: 700; }
.ev-timer { margin-left: auto; background: white; color: var(--red); font-weight: 900; font-size: 0.75rem; padding: 6px 12px; border-radius: 99px; border: 2px solid var(--ink); white-space: nowrap; }

/* ═══ NOTIFICATIONS ═══ */
.notif-box {
  position: fixed;
  top: 74px;
  right: 12px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.notif-item {
  background: var(--dark);
  color: white;
  border: 2px solid var(--sun);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 900;
  font-size: 0.8rem;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: notifSlide 0.3s cubic-bezier(0.34,1.56,0.64,1), notifFade 0.3s ease 2.7s forwards;
  max-width: 240px;
}
@keyframes notifSlide { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes notifFade { to{opacity:0;transform:translateX(120%)} }

/* ═══ FLOATING COINS ═══ */
.float-money {
  position: fixed;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: var(--dark);
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 4px 12px;
  pointer-events: none;
  z-index: 998;
  animation: floatMoney 1.2s ease forwards;
}
@keyframes floatMoney {
  0%{opacity:1;transform:translateY(0) scale(1)}
  100%{opacity:0;transform:translateY(-90px) scale(0.7)}
}

/* ═══ ANIMATIONS ═══ */
@keyframes popIn {
  from{opacity:0;transform:translateZ(0) translateY(12px) scale(0.96)}
  to{opacity:1;transform:translateZ(0) translateY(0) scale(1)}
}
@keyframes floatUp {
  0%{opacity:1;transform:translateY(0)}
  100%{opacity:0;transform:translateY(-50px)}
}

/* ═══ NIGHT MODE ═══ */
body.night-mode { --sky: #1a1a2e; background: #1a1a2e; }
body.night-mode header { background: #0d0d1a; border-color: #9B5DE5; }
body.night-mode .level-card,
body.night-mode .biz-card { filter: brightness(0.92); }
body.night-mode .clouds { opacity: 0.08; }
.night-stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, white 1px, transparent 1px), radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 80px 80px, 50px 50px;
  background-position: 0 0, 25px 25px;
  opacity: 0; transition: opacity 1.5s;
}
body.night-mode .night-stars { opacity: 0.35; }

/* ═══ PARTICLES ═══ */
.particle {
  position: fixed; pointer-events: none; z-index: 997;
  font-size: 1rem; font-weight: 900; font-family: 'Fredoka One', cursive;
  animation: particleRise 1.4s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes particleRise {
  0%   { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  60%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-80px) scale(0.5) rotate(15deg); }
}
.coin-particle {
  width: 16px; height: 16px;
  background: radial-gradient(circle at 35% 35%, #FFE980, #FFB800);
  border-radius: 50%; border: 2px solid #B8860B;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ═══ ACHIEVEMENTS ═══ */
.ach-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.ach-card {
  background: white; border: var(--outline); border-radius: 16px; padding: 12px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 10px;
  transition: transform 0.15s;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
.ach-card.earned { background: linear-gradient(135deg, #FFF9E0, #FFF3A0); border-color: #FFD700; }
.ach-card.locked { opacity: 0.4; filter: grayscale(0.7); }
.ach-icon { font-size: 1.8rem; flex-shrink: 0; }
.ach-name { font-family: 'Fredoka One', cursive; font-size: 0.75rem; color: var(--ink); line-height: 1.1; }
.ach-desc { font-size: 0.58rem; font-weight: 700; color: #888; margin-top: 2px; }
.ach-reward { font-size: 0.6rem; font-weight: 900; color: #2DC653; }

.ach-toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%) scale(0) translateY(-10px);
  z-index: 999;
  background: linear-gradient(135deg, #1E1B2E, #3a2050);
  border: 3px solid #FFD700; border-radius: 20px; padding: 14px 22px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px rgba(255,215,0,0.3);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); pointer-events: none;
}
.ach-toast.show { transform: translateX(-50%) scale(1) translateY(0); }
.ach-toast-icon { font-size: 2rem; }
.ach-toast-text h4 { font-family: 'Fredoka One', cursive; color: #FFD700; font-size: 0.85rem; }
.ach-toast-text p { font-size: 0.7rem; color: rgba(255,255,255,0.8); font-weight: 700; }

/* ═══ BIZ ANIMATION OVERLAY ═══ */
/* ══ BIZ ANIMATION OVERLAY — mobile-first ══ */
#bizAnimOverlay {
  display: none;
  position: fixed; inset: 0; z-index: 700;
  background: #000;
  -webkit-overflow-scrolling: touch;
}
#bizAnimOverlay.open { display: block; }

/* iframe fills the entire screen always */
#bizAnimFrame {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  background: #000;
}

/* Close button — always visible top-right */
.biz-anim-close {
  position: absolute; top: 12px; right: 12px;
  background: #FF4757; color: white;
  border: 3px solid white; border-radius: 99px;
  font-family: 'Fredoka One',cursive; font-size: 1rem;
  padding: 8px 20px; cursor: pointer;
  z-index: 720;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
  -webkit-tap-highlight-color: transparent;
}
.biz-anim-info { display: none; }

/* Rotate prompt — Android portrait only */
#rotatePrompt {
  display: none;
  position: fixed; inset: 0; z-index: 730;
  background: #0d1b36;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
#rotatePrompt .rot-icon { font-size: 4rem; animation: rotSpin 1.5s ease-in-out infinite; }
@keyframes rotSpin { 0%{transform:rotate(0deg)} 40%{transform:rotate(90deg)} 60%{transform:rotate(90deg)} 100%{transform:rotate(0deg)} }
#rotatePrompt p { font-family: 'Fredoka One',cursive; color: white; font-size: 1.2rem; text-align: center; }

/* Portrait mobile — rotation applied via JS inline styles */

/* ═══ FLOATING INCOME COUNTER ═══ */
.biz-earned-float { font-family: 'Fredoka One',cursive; font-size: 0.75rem; color: #2DC653; font-weight: 900; text-align: right; min-width: 80px; }

/* ═══ GEMS ═══ */
.gem-display { background: linear-gradient(135deg,#00C9A7,#0080C0); border: var(--outline); border-radius: 99px; padding: 4px 12px; box-shadow: var(--shadow-sm); text-align: center; cursor: pointer; }
.gem-label { font-size: 0.55rem; color: rgba(255,255,255,0.8); font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.gem-amount { font-family: 'Fredoka One',cursive; font-size: 1.1rem; color: white; line-height: 1; }
#gemShopOverlay { display:none; position:fixed; inset:0; z-index:600; background:rgba(0,0,0,0.88); backdrop-filter:blur(6px); align-items:flex-end; justify-content:center; }
#gemShopOverlay.open { display:flex; }
.gem-shop-card { background: linear-gradient(180deg,#1E1B2E,#0d2e2a); border: 3px solid #00C9A7; border-bottom:none; border-radius: 24px 24px 0 0; padding: 20px 20px 32px; max-width: 480px; width:100%; max-height:88vh; display:flex; flex-direction:column; color: white; text-align: center; }
.gem-shop-title { font-family:'Boogaloo',cursive; font-size:1.5rem; color:#00C9A7; margin-bottom: 4px; }
#gemShopItems { overflow-y:auto; flex:1; padding-right:2px; }
.gem-item { background: rgba(255,255,255,0.08); border: 2px solid rgba(0,201,167,0.3); border-radius: 14px; padding: 12px; margin-bottom: 10px; display:flex; align-items:center; gap: 12px; text-align: left; }
.gem-item-icon { font-size: 1.8rem; }
.gem-item-name { font-family:'Fredoka One',cursive; font-size: 0.9rem; }
.gem-item-desc { font-size: 0.65rem; color: rgba(255,255,255,0.7); font-weight:700; }
.gem-item-cost { font-family:'Fredoka One',cursive; font-size: 0.85rem; color:#00C9A7; margin-left:auto; white-space:nowrap; }
.gem-item-btn { background:#00C9A7; color:#1E1B2E; border: 2px solid #1E1B2E; border-radius: 99px; font-family:'Fredoka One',cursive; font-size: 0.75rem; padding: 5px 12px; cursor:pointer; white-space:nowrap; }
.gem-item-btn:disabled { opacity:0.4; cursor:not-allowed; }

/* ═══ DAILY OBJECTIVES ═══ */
.obj-card { background: linear-gradient(135deg,#1a1a2e,#16213e); border: 3px solid #FFE135; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.obj-title { font-family:'Fredoka One',cursive; font-size: 1rem; color:#FFE135; margin-bottom: 4px; }
.obj-desc { font-size: 0.7rem; color: rgba(255,255,255,0.75); font-weight:700; margin-bottom: 8px; }
.obj-prog-bar { background: rgba(255,255,255,0.1); border-radius: 99px; height: 8px; overflow:hidden; margin-bottom: 6px; }
.obj-prog-fill { height: 100%; background: linear-gradient(90deg,#00C9A7,#FFE135); border-radius: 99px; transition: width 0.3s; }
.obj-footer { display:flex; justify-content:space-between; align-items:center; }
.obj-reward { font-family:'Fredoka One',cursive; font-size: 0.75rem; color:#00C9A7; }
.obj-claim-btn { background:#00C9A7; color:#1E1B2E; border: 2px solid #1E1B2E; border-radius: 99px; font-family:'Fredoka One',cursive; font-size: 0.7rem; padding: 4px 12px; cursor:pointer; }
.obj-claim-btn:disabled { opacity:0.4; cursor:not-allowed; }
.obj-done-badge { font-size:0.7rem; color:#2DC653; font-weight:900; }

/* ═══ SESSION TIMER ═══ */
.session-timer { font-size: 0.55rem; color: rgba(255,255,255,0.5); font-weight:900; text-align:center; font-family:'Fredoka One',cursive; }

/* ═══ STORY BANNER ═══ */
#storyBanner { display:none; position:fixed; bottom:90px; left:50%; transform:translateX(-50%); z-index:500; background: linear-gradient(135deg,#7B2FBE,#3a1a6e); border: 3px solid #FFE135; border-radius: 14px; padding: 12px 18px; max-width: 320px; text-align:center; color:white; font-size:0.78rem; font-weight:700; box-shadow: 0 8px 24px rgba(0,0,0,0.5); animation: popIn 0.4s; }
#storyBanner.show { display:block; }
#storyBanner .story-close { display:block; margin-top:8px; font-family:'Fredoka One',cursive; font-size:0.7rem; color:#FFE135; cursor:pointer; }

/* ═══ THEME SELECTOR ═══ */
.theme-picker { display:flex; gap:8px; justify-content:center; margin-top:8px; }
.theme-dot { width:26px; height:26px; border-radius:99px; border: 3px solid #1E1B2E; cursor:pointer; box-shadow: 2px 2px 0 #1E1B2E; transition: transform 0.1s; }
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { box-shadow: 0 0 0 3px white, 2px 2px 0 #1E1B2E; }

/* ═══ BIZ STATS PANEL ═══ */
.biz-stats-row { display:flex; gap:8px; margin-top:6px; flex-wrap:wrap; }
.biz-stat-chip { background: rgba(0,0,0,0.06); border-radius: 8px; padding: 3px 8px; font-size: 0.6rem; font-weight:900; color: var(--ink); }
.biz-stat-chip span { color: #7B2FBE; }

/* ═══ DAILY REWARD ═══ */
#dailyPopup {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.82); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
#dailyPopup.open { display: flex; }
.daily-card {
  background: linear-gradient(135deg, #1E1B2E, #2d1a4a);
  border: 4px solid #FFD700; border-radius: 24px; padding: 28px 24px;
  max-width: 340px; width: 90%; text-align: center;
  box-shadow: 0 12px 50px rgba(0,0,0,0.6), 0 0 40px rgba(255,215,0,0.2);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.daily-title { font-family: 'Boogaloo', cursive; font-size: 2rem; color: #FFD700; text-shadow: 2px 2px 0 rgba(0,0,0,0.4); }
.daily-emoji { font-size: 3.5rem; margin: 12px 0; display: block; animation: sceneWobble 2s ease-in-out infinite; }
.daily-streak { font-family: 'Fredoka One', cursive; font-size: 1rem; color: white; margin-bottom: 8px; }
.daily-reward-txt { font-family: 'Fredoka One', cursive; font-size: 1.5rem; color: #2DC653; margin-bottom: 18px; }
.daily-days { display: flex; justify-content: center; gap: 5px; margin-bottom: 18px; flex-wrap: wrap; }
.dd { width: 36px; height: 36px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 900; color: #666; }
.dd.done { background: #FFD700; border-color: #B8860B; color: #1E1B2E; font-size: 1rem; }
.dd.today { background: #2DC653; border-color: #1a8a3a; color: white; animation: dotPulse 1s infinite; font-size: 1rem; }
.btn-daily { width: 100%; background: linear-gradient(135deg, #FFD700, #FFA500); color: #1E1B2E; font-family: 'Fredoka One', cursive; font-size: 1.2rem; padding: 14px; border: 3px solid #1E1B2E; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 #1E1B2E; transition: transform 0.1s; }
.btn-daily:hover { transform: translateY(-2px); }

/* ═══ NEGOTIATE ═══ */
.btn-negotiate { background: linear-gradient(135deg, #00C9A7, #009a80); color: white; font-family: 'Fredoka One', cursive; font-size: 0.7rem; padding: 5px 10px; border: 2px solid #1E1B2E; border-radius: 99px; cursor: pointer; box-shadow: 2px 2px 0 #1E1B2E; transition: transform 0.1s; white-space: nowrap; }
.btn-negotiate:hover { transform: scale(1.05); }
.btn-negotiate:disabled { background: #aaa; cursor: not-allowed; transform: none; box-shadow: none; }

#negotiateOverlay { display: none; position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,0.88); align-items: center; justify-content: center; }
#negotiateOverlay.open { display: flex; }
.neg-card { background: linear-gradient(135deg, #0d1f0d, #1a3a1a); border: 4px solid #00C9A7; border-radius: 24px; padding: 28px 24px; max-width: 300px; width: 90%; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(0,201,167,0.2); animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.neg-title { font-family: 'Boogaloo', cursive; font-size: 1.8rem; color: #00C9A7; }
.neg-sub { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.65); margin: 6px 0 14px; }
.neg-timer { font-family: 'Fredoka One', cursive; font-size: 3rem; color: #FFE135; line-height: 1; margin-bottom: 6px; }
.neg-clicks { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: white; margin-bottom: 14px; }
.neg-btn { width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #00e5c0, #00C9A7); border: 5px solid #1E1B2E; box-shadow: 0 6px 0 #1E1B2E, 0 0 25px rgba(0,201,167,0.4); font-size: 2.8rem; cursor: pointer; transition: transform 0.06s, box-shadow 0.06s; user-select: none; -webkit-user-select: none; }
.neg-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #1E1B2E; }
.neg-prog-wrap { margin-top: 14px; height: 10px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.neg-prog-fill { height: 100%; background: linear-gradient(90deg, #00C9A7, #FFD700); border-radius: 99px; transition: width 0.08s; }

/* ═══ GEMS ═══ */
.gem-display { display: flex; align-items: center; gap: 4px; background: rgba(155,93,229,0.2); border: 2px solid #9B5DE5; border-radius: 99px; padding: 3px 10px; font-family: 'Fredoka One', cursive; font-size: 0.8rem; color: #D4A8FF; }

/* ═══ XP CIRCLE ═══ */
.xp-circle-wrap { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.xp-circle-wrap svg { transform: rotate(-90deg); }
.xp-circle-bg { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 4; }
.xp-circle-fill { fill: none; stroke: #B24BF3; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.xp-circle-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 0.6rem; color: white; }

/* ═══ TAB TRANSITIONS ═══ */
.tab-panel { display: none; opacity: 0; transform: translateY(8px); transition: opacity 0.22s ease, transform 0.22s ease; pointer-events: none; }
.tab-panel.active { display: block; opacity: 1; transform: translateY(0); pointer-events: all; }

/* ═══ GEM SOURCES PANEL ═══ */
#gemSourcesOverlay { display:none; position:fixed; inset:0; z-index:650; background:rgba(0,0,0,0.88); backdrop-filter:blur(8px); align-items:flex-end; justify-content:center; }
#gemSourcesOverlay.open { display:flex; }
.gem-sources-sheet {
  background: linear-gradient(180deg,#1a1035,#0d0820);
  border: 3px solid #9B5DE5;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
}
.gs-title { font-family:'Boogaloo',cursive; font-size:1.5rem; color:#D4A8FF; text-align:center; margin-bottom:4px; }
.gs-sub { font-size:0.7rem; color:rgba(255,255,255,0.4); text-align:center; font-weight:900; margin-bottom:18px; }
.gs-section-label { font-size:0.6rem; font-weight:900; color:rgba(255,255,255,0.35); text-transform:uppercase; letter-spacing:1.5px; margin:14px 0 6px; }
.gs-row {
  display:flex; align-items:center; gap:12px;
  background:rgba(255,255,255,0.05);
  border:2px solid rgba(155,93,229,0.2);
  border-radius:14px; padding:12px 14px;
  margin-bottom:8px; cursor:pointer;
  transition:border-color 0.15s, background 0.15s;
}
.gs-row:hover { border-color:rgba(155,93,229,0.5); background:rgba(155,93,229,0.1); }
.gs-row.claimed { opacity:0.45; cursor:not-allowed; }
.gs-row.claimed:hover { border-color:rgba(155,93,229,0.2); background:rgba(255,255,255,0.05); }
.gs-icon { font-size:2rem; flex-shrink:0; width:40px; text-align:center; }
.gs-info { flex:1; }
.gs-name { font-family:'Fredoka One',cursive; font-size:0.9rem; color:white; }
.gs-desc { font-size:0.62rem; color:rgba(255,255,255,0.5); font-weight:900; margin-top:2px; }
.gs-reward { display:flex; flex-direction:column; align-items:flex-end; gap:3px; flex-shrink:0; }
.gs-gems { font-family:'Fredoka One',cursive; font-size:1rem; color:#D4A8FF; white-space:nowrap; }
.gs-badge { font-size:0.58rem; font-weight:900; padding:2px 7px; border-radius:99px; white-space:nowrap; }
.gs-badge.available { background:rgba(45,198,83,0.2); color:#2DC653; border:1px solid #2DC653; }
.gs-badge.claimed   { background:rgba(255,255,255,0.08); color:#666; border:1px solid #444; }
.gs-badge.cooldown  { background:rgba(255,165,0,0.15); color:#FFA500; border:1px solid #FFA500; }
.gs-badge.locked    { background:rgba(255,71,87,0.1); color:#FF4757; border:1px solid rgba(255,71,87,0.4); }
.gs-close-btn { width:100%; background:rgba(255,255,255,0.06); color:rgba(255,255,255,0.5); border:2px solid rgba(255,255,255,0.1); border-radius:12px; font-family:'Fredoka One',cursive; font-size:0.9rem; padding:10px; cursor:pointer; margin-top:10px; }

/* ═══ TRIVIA MODAL ═══ */
#triviaOverlay { display:none; position:fixed; inset:0; z-index:800; background:rgba(0,0,0,0.9); backdrop-filter:blur(8px); align-items:center; justify-content:center; }
#triviaOverlay.open { display:flex; }
.trivia-card { background:linear-gradient(135deg,#0d1f3a,#1a0d3a); border:4px solid #00C9A7; border-radius:24px; padding:28px 22px; max-width:350px; width:92%; text-align:center; animation:popIn 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.trivia-title { font-family:'Boogaloo',cursive; font-size:1.5rem; color:#00C9A7; margin-bottom:4px; }
.trivia-q { font-family:'Fredoka One',cursive; font-size:1rem; color:white; margin:16px 0; line-height:1.4; }
.trivia-opts { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }
.trivia-opt { background:rgba(255,255,255,0.07); border:2px solid rgba(0,201,167,0.3); border-radius:12px; padding:10px 8px; font-family:'Fredoka One',cursive; font-size:0.82rem; color:white; cursor:pointer; transition:all 0.15s; }
.trivia-opt:hover { background:rgba(0,201,167,0.15); border-color:#00C9A7; }
.trivia-opt.correct { background:rgba(45,198,83,0.25); border-color:#2DC653; color:#2DC653; }
.trivia-opt.wrong { background:rgba(255,71,87,0.15); border-color:#FF4757; color:#FF4757; }
.trivia-timer-bar { height:5px; background:rgba(255,255,255,0.1); border-radius:99px; overflow:hidden; margin-bottom:14px; }
.trivia-timer-fill { height:100%; background:linear-gradient(90deg,#00C9A7,#FFE135); border-radius:99px; transition:width 0.1s linear; }

/* ═══ REFERRAL PANEL ═══ */
.ref-code-box { background:rgba(155,93,229,0.12); border:2px dashed rgba(155,93,229,0.5); border-radius:14px; padding:14px; text-align:center; margin:10px 0; }
.ref-code { font-family:'Fredoka One',cursive; font-size:1.6rem; color:#D4A8FF; letter-spacing:4px; }
.ref-copy-btn { background:rgba(155,93,229,0.3); border:2px solid #9B5DE5; border-radius:99px; color:#D4A8FF; font-family:'Fredoka One',cursive; font-size:0.8rem; padding:5px 14px; cursor:pointer; margin-top:8px; }

/* ═══ GEM EARN BUTTON in header ═══ */
.hdr-earn-btn { background:linear-gradient(135deg,rgba(155,93,229,0.3),rgba(100,50,200,0.2)); border:1.5px solid rgba(155,93,229,0.6); border-radius:99px; color:#D4A8FF; font-family:'Fredoka One',cursive; font-size:0.7rem; padding:3px 9px; cursor:pointer; white-space:nowrap; transition:all 0.15s; }
.hdr-earn-btn:hover { background:rgba(155,93,229,0.4); }


.sound-btn { background: transparent; border: 2px solid rgba(255,255,255,0.3); border-radius: 99px; color: rgba(255,255,255,0.7); font-size: 1rem; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.sound-btn:hover { background: rgba(255,255,255,0.1); color: white; }

/* ═══ LEVEL UP FLASH ═══ */
.levelup-flash {
  position: fixed; inset: 0; z-index: 998; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(178,75,243,0.4) 0%, transparent 70%);
  opacity: 0; animation: none;
}
.levelup-flash.pop { animation: lvlFlash 0.8s ease forwards; }
@keyframes lvlFlash { 0%{opacity:0.9} 100%{opacity:0} }



/* ── SPLASH SCREEN ─────────────────────────────────────── */
#splashScreen {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: #1a1a2e;
  transition: opacity 0.6s ease;
}
#splashScreen.fade-out { opacity: 0; pointer-events: none; }
#splashScreen img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.splash-loader {
  position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.splash-bar-bg {
  width: 200px; height: 8px; background: rgba(255,255,255,.2);
  border-radius: 99px; overflow: hidden;
}
.splash-bar-fill {
  height: 100%; width: 0%; background: #FFD700;
  border-radius: 99px; transition: width .1s ease;
}
.splash-lbl {
  font-family: 'Fredoka One', cursive; font-size: .9rem; color: rgba(255,255,255,.7);
}

/* ── ONBOARDING ─────────────────────────────────────────── */
#onboardingScreen {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0;
}
.ob-slides {
  width: 100%; max-width: 480px; overflow: hidden; position: relative;
}
.ob-track {
  display: flex; transition: transform 0.4s cubic-bezier(.4,0,.2,1);
}
.ob-slide {
  min-width: 100%; padding: 0 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.ob-slide img {
  width: 100%; max-height: 55vh; object-fit: contain; border-radius: 16px;
  border: 2px solid rgba(255,215,0,.25);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.ob-title {
  font-family: 'Fredoka One', cursive; font-size: 1.4rem;
  color: #FFD700; text-align: center; line-height: 1.2;
}
.ob-desc {
  font-size: .9rem; color: rgba(255,255,255,.75);
  text-align: center; font-weight: 700; line-height: 1.4; max-width: 360px;
}
.ob-dots {
  display: flex; gap: 8px; margin-top: 4px;
}
.ob-dot {
  width: 8px; height: 8px; border-radius: 99px;
  background: rgba(255,255,255,.25); transition: all .3s;
}
.ob-dot.active {
  background: #FFD700; width: 24px;
}
.ob-nav {
  display: flex; gap: 12px; margin-top: 8px; padding-bottom: 8px;
}
.ob-btn-skip {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.5);
  font-family: 'Fredoka One', cursive; font-size: .9rem;
  padding: 10px 22px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 99px; cursor: pointer;
}
.ob-btn-next {
  background: linear-gradient(135deg,#FFD700,#c9a020); color: #1a1a2e;
  font-family: 'Fredoka One', cursive; font-size: 1rem; font-weight: 900;
  padding: 11px 30px; border: none; border-radius: 99px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,215,0,.3);
}

/* ── OFFLINE MODAL ──────────────────────────────────────── */
#offlineModal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.88); padding: 16px;
}
#offlineModal .om-card {
  position: relative; width: 100%; max-width: 420px;
  border-radius: 20px; overflow: hidden;
  border: 2px solid rgba(255,215,0,.35);
  box-shadow: 0 0 60px rgba(255,215,0,.15);
}
#offlineModal .om-bg {
  width: 100%; display: block;
  filter: brightness(0.45) saturate(0.8);
}
#offlineModal .om-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 20px;
}
.om-title {
  font-family: 'Fredoka One', cursive; font-size: 1.3rem;
  color: rgba(255,255,255,.7); text-align: center;
}
.om-amount {
  font-family: 'Fredoka One', cursive; font-size: 2.8rem;
  color: #FFD700; text-align: center; line-height: 1;
  text-shadow: 0 0 30px rgba(255,215,0,.6);
  animation: omPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes omPop{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}
.om-sub {
  font-size: .8rem; color: rgba(255,255,255,.55);
  font-weight: 700; text-align: center;
}
.om-btn {
  margin-top: 10px;
  background: linear-gradient(135deg,#FFD700,#c9a020); color: #1a1a2e;
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  padding: 13px 36px; border: none; border-radius: 99px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(255,215,0,.4);
  animation: omPop .5s .2s cubic-bezier(.34,1.56,.64,1) both;
}
    .intro-story { max-width: 360px; margin: 0 auto; text-align: center; padding: 0 16px; }
    .intro-phrase {
      font-family: 'Nunito', sans-serif;
      font-size: 1.05rem;
      font-weight: 700;
      color: #C8C4E0;
      line-height: 1.6;
      margin-bottom: 10px;
      opacity: 0;
      transform: translateY(16px);
      transition: opacity 0.6s ease, transform 0.6s ease;
    }
    .intro-phrase.visible { opacity: 1; transform: translateY(0); }
    .intro-phrase.highlight {
      font-family: 'Fredoka One', cursive;
      font-size: 1.25rem;
      color: #FFE135;
      text-shadow: 0 0 24px rgba(255,225,53,0.3);
    }
    .intro-phrase.big {
      font-family: 'Fredoka One', cursive;
      font-size: 1.5rem;
      color: #FF6B35;
    }
    .intro-divider {
      width: 40px; height: 2px;
      background: rgba(255,225,53,0.3);
      margin: 14px auto;
      opacity: 0;
      transition: opacity 0.6s ease;
    }
    .intro-divider.visible { opacity: 1; }
    .btn-start-wrap { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; margin-top: 24px; }
    .btn-start-wrap.visible { opacity: 1; transform: translateY(0); }

    /* ═══════════════════════════════════════════════════════════════════
   MEJORA 1 — ROI VISIBLE EN MEJORAS
   ═══════════════════════════════════════════════════════════════════ */

.upg-roi {
  font-size: 0.55rem;
  color: #2DC653;
  font-weight: 900;
  margin-top: 1px;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════
   MEJORA 2 — PANTALLA DE CELEBRACIÓN EN MILESTONES
   ═══════════════════════════════════════════════════════════════════ */

#milestoneModal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  padding: 16px;
  animation: fadeInMs 0.3s ease;
}

@keyframes fadeInMs {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.ms-modal-card {
  background: linear-gradient(145deg, var(--dark), #16213e);
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.ms-icon {
  display: inline-block;
  font-size: 4rem;
  animation: pulseMs 0.8s ease infinite;
}

@keyframes pulseMs {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

.ms-title {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  margin: 12px 0 4px;
}

.ms-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.ms-gems-row {
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ms-gems-icon { font-size: 1.4rem; }

.ms-gems-txt {
  font-family: 'Fredoka One', cursive;
  color: var(--sun);
  font-size: 1.2rem;
}

.ms-btn-row { display: flex; gap: 10px; }

.ms-btn-share {
  flex: 1;
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ms-btn-share:hover { opacity: 0.88; }

.ms-btn-close {
  flex: 1;
  background: rgba(255,255,255,0.1);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: 99px;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.15s;
}
.ms-btn-close:hover { background: rgba(255,255,255,0.18); }

/* Confetti para milestones — reutiliza @keyframes confettiFall */
.confetti-ms {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border-radius: 2px;
  animation: confettiFall var(--cf-dur, 2s) ease-in forwards;
  animation-delay: var(--cf-del, 0s);
}

/* ═══════════════════════════════════════════════════════════════════
   MEJORA 3 — LOGROS OCULTOS
   ═══════════════════════════════════════════════════════════════════ */

.hidden-ach-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 8000;
  background: linear-gradient(135deg, var(--dark), #2d1b69);
  border: 2px solid var(--purple);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(123,47,190,0.4);
  min-width: 260px;
  max-width: 320px;
  animation: slideUpHidden 0.4s ease forwards;
}

@keyframes slideUpHidden {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hat-icon { font-size: 2rem; flex-shrink: 0; }

.hat-label {
  color: var(--purple);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hat-name {
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
}

.hat-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
}

.hat-gems {
  color: var(--sun);
  font-size: 0.75rem;
  font-weight: 900;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   MEJORA 4 — TUTORIAL NARRATIVO
   ═══════════════════════════════════════════════════════════════════ */

#tutUrgentBadge {
  font-size: 0.7rem;
  color: var(--orange);
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  animation: pulseMs 0.8s ease infinite;
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MEJORA 5 — RACHA DE LOGIN ESCALABLE
   ═══════════════════════════════════════════════════════════════════ */

#dailyDays {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

#dailyBonusLine {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--orange);
  margin-top: 4px;
  display: none;
}
/* ═══════════════════════════════════════════════════════════
   HEADER COMPACTO — solo móvil (max 480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hm-amount {
    font-size: 1.1rem;
  }
  .hm-ips {
    font-size: 0.52rem;
  }
  .hdr-chips {
    gap: 4px;
  }
  .hdr-chip {
    padding: 2px 6px;
    font-size: 0.68rem;
    gap: 2px;
  }
  .hdr-earn-btn {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
  }
  .hdr-settings-btn {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }
  #cloudBtn {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
  }
}