/* ============================================================================
   Mi Primer Negocio: San Quintín (MP San Quintín — v1.5)
   Estilos Mobile-First ultraligeros (Zero frameworks)
   ============================================================================ */

:root {
  --bg-desk: #231914;
  --bg-app: #FFF8F0;
  --bg-card: #FFFFFF;
  --bg-board: #F4E4D1;
  --bg-cell: #FBF3E8;
  --border-warm: #EBD6BD;
  --text-main: #2B1D14;
  --text-muted: #725B4A;
  --primary: #E85D04;
  --primary-dark: #C84B00;
  --accent: #D6336C;
  --gold: #F59F00;
  --green: #2B9348;
  --green-soft: #E9F9EE;
  --blue: #228BE6;
  --purple: #7048E8;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(61, 35, 16, 0.08);
  --shadow-md: 0 6px 18px rgba(61, 35, 16, 0.14);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-desk);
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* Contenedor tipo celular en PC; pantalla completa en móvil */
.device-frame {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 430px;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 480px) {
  .device-frame {
    height: min(96dvh, 850px);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 6px #3a2a20;
  }
}

/* ==================== PANTALLAS FULL-SCREEN (ONBOARDING / HISTORIAS / NOVELA) ==================== */
.full-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: linear-gradient(165deg, #FFF8F0 0%, #FFE8CC 100%);
  overflow-y: auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

@media (min-height: 740px) {
  .full-screen {
    justify-content: center;
  }
}

.onboarding-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-md);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  flex-shrink: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.brand-badge h1 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.onboarding-lead {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Selector de Foto y Presets */
.avatar-picker-block {
  background: #FFFBF6;
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-preview-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--primary);
  background: #FFE8CC;
  flex-shrink: 0;
}

.avatar-upload-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
}

.field-label-inline {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-upload-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2B1D14;
  color: #FFF8F0;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.presets-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.preset-btn {
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

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

.preset-btn.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.25);
  transform: scale(1.06);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

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

.field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-sm);
  background: #FFFDF9;
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.16);
}

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

/* Botones */
.btn-primary {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #FF7A2F 0%, var(--primary) 100%);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-dark);
}

.btn-lg {
  width: 100%;
  padding: 13px 18px;
  font-size: 15.5px;
}

.btn-ghost {
  margin-top: 10px;
  width: 100%;
  border: 1.5px solid var(--border-warm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Selector de Historia */
.story-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-select-header {
  text-align: center;
}

.code-chip {
  display: inline-block;
  background: #2B1D14;
  color: #FFD166;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.story-select-header h2 {
  margin: 0 0 6px;
  font-size: 21px;
}

.muted-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.story-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-card {
  background: var(--bg-card);
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

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

.story-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18);
}

.story-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-avatar-svg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #FFF3E4;
}

.story-card-title {
  margin: 0;
  font-size: 17px;
  color: var(--text-main);
}

.story-card-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.story-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

.story-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-warm);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.story-cta-pill {
  background: var(--primary);
  color: #FFF;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* ==================== MINI-NOVELA VISUAL INTRODUCTORIA ==================== */
.vn-screen {
  z-index: 45;
  background: linear-gradient(170deg, #1F1826 0%, #3A252E 50%, #523026 100%);
  justify-content: center;
  padding: 16px;
}

.vn-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-height: 100%;
}

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

.vn-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vn-progress-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.vn-seg {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.25s ease;
}

.vn-seg.done,
.vn-seg.active {
  background: #FFD166;
}

.vn-step-label {
  font-size: 11.5px;
  font-weight: 800;
  color: rgba(255, 248, 240, 0.85);
}

.btn-vn-skip {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #FFF8F0;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.vn-stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 220;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #FFF8F0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  background: #2B1D14;
}

.vn-scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: vnFade 0.28s ease-out;
}

@keyframes vnFade {
  0% { opacity: 0.35; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.vn-mood-chip {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(25, 16, 12, 0.78);
  color: #FFD166;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.vn-dialogue-box {
  background: #FFFDF9;
  border: 2.5px solid #2B1D14;
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.vn-speaker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vn-speaker-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.vn-speaker-row strong {
  display: block;
  font-size: 16px;
  color: var(--text-main);
}

.vn-speaker-row small {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
}

.vn-dialogue-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-main);
  min-height: 78px;
}

/* ==================== APP SHELL ==================== */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Encabezado Superior */
.top-header {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F2 100%);
  border-bottom: 1.5px solid var(--border-warm);
  padding: 7px 10px 7px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.header-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.story-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--border-warm);
  background: #FFF3E4;
  color: var(--text-main);
  font-weight: 800;
  font-size: 12.5px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 34px;
}

.hdr-char-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.story-pill .caret {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-story-mini {
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 30px;
  white-space: nowrap;
}

.resource-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  border: 1.5px solid transparent;
}

.res-coins {
  background: #FFF3BF;
  border-color: #FFD43B;
  color: #7C4D00;
}

.res-credits {
  background: #F3D9FA;
  border-color: #CC5DE8;
  color: #5F3DC4;
  cursor: pointer;
}

.res-energy {
  background: #E7F5FF;
  border-color: #74C0FC;
  color: #1864AB;
  cursor: pointer;
}

.energy-timer {
  font-size: 9.5px;
  font-weight: 800;
  background: #1C7ED6;
  color: #FFF;
  padding: 1px 4px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

.header-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  gap: 8px;
}

.player-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-warm);
  background: #FFF3E4;
  color: #5C3D28;
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.hdr-player-photo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
}

/* Barra de Evolución del Negocio */
.business-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 12px;
  padding: 5px 8px;
}

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

.biz-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.biz-level-badge {
  background: var(--primary);
  color: #FFF;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.biz-name {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-progress-track {
  height: 7px;
  background: #F3E5D5;
  border-radius: 999px;
  overflow: hidden;
}

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

.btn-upgrade {
  border: none;
  background: #EDE0D1;
  color: #7D6452;
  border-radius: 10px;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  min-width: 72px;
  flex-shrink: 0;
}

.btn-upgrade.ready {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #1E6B34;
  animation: pulseReady 1.4s infinite;
}

.btn-upgrade.maxed {
  background: #FFF3BF;
  color: #9C6B00;
  cursor: default;
}

/* ==================== ESCENARIO PRINCIPAL ==================== */
.main-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.tab-view {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.tab-play {
  display: flex;
  flex-direction: column;
  padding: 6px 10px 6px;
  gap: 6px;
  overflow: hidden;
}

.tab-scroll {
  overflow-y: auto;
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* ==================== 3 PEDIDOS ACTIVOS ==================== */
.orders-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.order-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: 12px;
  padding: 6px 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.order-card.ready {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(43, 147, 72, 0.22);
}

.order-customer {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  max-width: 100%;
}

.order-customer span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-item-ico {
  font-size: 23px;
  line-height: 1;
}

.order-lv-pill {
  font-size: 9.5px;
  font-weight: 800;
  background: #F4E4D1;
  color: #5C3D28;
  padding: 1px 5px;
  border-radius: 6px;
}

.order-rewards {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-main);
}

.order-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 4px 4px;
  font-size: 11px;
  font-weight: 800;
  margin-top: 1px;
}

.order-btn.pending {
  background: #F4EBE0;
  color: #8C7360;
}

.order-btn.deliver {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFF;
  cursor: pointer;
  box-shadow: 0 2px 0 #1E6B34;
  animation: pulseReady 1.3s infinite;
}

.order-btn.deliver:active {
  transform: translateY(1px);
}

/* ==================== TABLERO COMPACTO MERGE-2 (5x5) ==================== */
.board-container {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merge-board {
  width: 100%;
  height: 100%;
  max-height: min(100%, 410px);
  max-width: min(100%, 400px);
  aspect-ratio: 1 / 1;
  background: var(--bg-board);
  border: 2px solid #DFC5A7;
  border-radius: 18px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  touch-action: none;
  box-shadow: inset 0 2px 8px rgba(70, 40, 15, 0.1);
}

.board-cell {
  position: relative;
  background: var(--bg-cell);
  border: 1.5px solid #EAD7C0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Casilla bloqueada estilo caja de madera con candado */
.board-cell.is-locked {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(122, 74, 38, 0.13) 0px,
      rgba(122, 74, 38, 0.13) 6px,
      transparent 6px,
      transparent 12px
    ),
    linear-gradient(155deg, #D9B382 0%, #B88753 100%);
  border: 2px solid #8C5E32;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 2px 0 #704923;
}

.board-cell.is-locked:active {
  transform: scale(0.95);
}

.lock-ico {
  font-size: clamp(16px, 4.4vw, 21px);
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.lock-cost {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(43, 29, 20, 0.82);
  color: #FFD43B;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.25;
}

/* Generador en (0,0) */
.board-cell.is-generator {
  background: linear-gradient(155deg, #FF922B 0%, #E85D04 100%);
  border: 2px solid #B53E00;
  color: #FFF;
  cursor: pointer;
  box-shadow: 0 3px 0 #9E3600;
}

.board-cell.is-generator:active {
  transform: scale(0.93);
}

.gen-icon {
  font-size: clamp(24px, 6.2vw, 31px);
  line-height: 1;
}

.gen-tag {
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.28);
  color: #FFF;
  padding: 1px 6px;
  border-radius: 999px;
  margin-top: 2px;
}

/* Casilla con objeto */
.board-cell.has-item {
  cursor: grab;
  background: var(--item-bg, #FFF);
  border-color: var(--item-border, #E5C8A6);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.board-cell.is-selected {
  border-color: #E85D04;
  border-width: 2.5px;
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.28);
  transform: scale(1.04);
  z-index: 2;
}

.board-cell.is-merge-hint {
  border-color: #2B9348;
  border-width: 2.5px;
  animation: mergeHintPulse 0.9s ease-in-out infinite;
}

.board-cell.is-drag-source {
  opacity: 0.35;
}

.board-cell.is-drop-target {
  border-color: #E85D04;
  border-width: 2.5px;
  background: #FFF3BF;
  transform: scale(1.05);
}

.item-emoji {
  font-size: clamp(27px, 7.2vw, 36px);
  line-height: 1;
  pointer-events: none;
}

.item-lvl-badge {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(43, 29, 20, 0.78);
  color: #FFF;
  padding: 0 4px;
  border-radius: 5px;
  line-height: 1.35;
  pointer-events: none;
}

.item-order-star {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

/* Animaciones ligeras en GPU */
.anim-spawn {
  animation: popSpawn 0.24s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.anim-merge,
.anim-unlock {
  animation: mergeBounce 0.38s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.anim-merge::after,
.anim-unlock::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 3px solid #FFD43B;
  animation: mergeFlash 0.45s ease-out forwards;
  pointer-events: none;
}

.anim-gen-tap {
  animation: genPulse 0.2s ease-out;
}

@keyframes popSpawn {
  0% { transform: scale(0.35); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes mergeBounce {
  0% { transform: scale(0.75); }
  50% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes mergeFlash {
  0% { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes genPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

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

@keyframes mergeHintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 147, 72, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(43, 147, 72, 0.15); }
}

/* Fantasma de arrastre */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -42px;
  border-radius: 14px;
  border: 2.5px solid var(--primary);
  background: #FFFFFF;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  pointer-events: none;
  z-index: 90;
  will-change: transform;
}

/* Barrita inferior de selección */
.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 12px;
  padding: 6px 10px;
  flex-shrink: 0;
  min-height: 44px;
}

.sel-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #FFF3E4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.sel-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sel-text strong {
  font-size: 12.5px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-text small {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== PANELES SECUNDARIOS (LIGA, DELEGACIONES, RECARGAS) ==================== */
.panel-hero {
  border-radius: var(--radius-lg);
  padding: 16px;
  color: #FFF;
  box-shadow: var(--shadow-sm);
}

.league-hero {
  background: linear-gradient(135deg, #E85D04 0%, #9D0208 100%);
}

.delegations-hero {
  background: linear-gradient(135deg, #2A9D8F 0%, #1D3557 100%);
}

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

.hero-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
}

.panel-hero h2 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.hero-note {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  opacity: 0.94;
}

.cycle-timer-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: right;
  flex-shrink: 0;
}

.cycle-timer-box small {
  display: block;
  font-size: 10px;
  opacity: 0.85;
}

.cycle-timer-box strong {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.card-block {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.card-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13.5px;
}

.promo-legend {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.live-dot {
  font-size: 11px;
  font-weight: 800;
  color: #D6336C;
}

/* Ranking Top 10 con Fotos Circulares de 46px */
.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 13px;
  background: #FFFBF6;
  border: 1.5px solid #F0E0CE;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.rank-row:active {
  transform: scale(0.985);
}

.rank-row.promo-zone {
  background: var(--green-soft);
  border-color: #96E0AE;
}

.rank-row.is-player {
  border: 2px solid var(--primary);
  box-shadow: 0 2px 10px rgba(232, 93, 4, 0.18);
}

.rank-pos {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #EFE0CE;
  color: var(--text-main);
  font-weight: 900;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-row.promo-zone .rank-pos {
  background: var(--green);
  color: #FFF;
}

.rank-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  background: #FFE8CC;
  flex-shrink: 0;
}

.rank-row.is-player .rank-avatar {
  border-color: var(--primary);
}

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

.rank-name {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-del {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-right {
  text-align: right;
  flex-shrink: 0;
}

.rank-pts {
  display: block;
  font-weight: 900;
  font-size: 13.5px;
  color: var(--text-main);
  white-space: nowrap;
}

.rank-view-hint {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
}

/* Delegaciones */
.delegations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.del-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  background: #FFFBF6;
  border: 1.5px solid #EFE0CE;
}

.del-row.is-mine {
  border-color: var(--primary);
  background: #FFF4E6;
}

.del-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.del-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.mine-chip {
  font-size: 10px;
  background: var(--primary);
  color: #FFF;
  padding: 1px 6px;
  border-radius: 999px;
}

.del-bar-track {
  height: 9px;
  background: #EEDFCC;
  border-radius: 999px;
  overflow: hidden;
}

.del-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ==================== RECARGAS ==================== */
.player-id-card {
  background: #2B1D14;
  color: #FFF8F0;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.id-label {
  font-size: 11px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-code-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 3px 0;
}

.id-code-row strong {
  font-size: 22px;
  color: #FFD166;
  letter-spacing: 0.06em;
}

.vip-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: #F59F00;
  color: #2B1D14;
  padding: 2px 8px;
  border-radius: 999px;
}

.player-id-card small {
  font-size: 11px;
  opacity: 0.85;
  display: block;
}

.btn-copy {
  border: 1.5px solid #FFD166;
  background: transparent;
  color: #FFD166;
  font-weight: 800;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.test-pill {
  font-size: 10.5px;
  font-weight: 800;
  background: #FFF3BF;
  color: #9C6B00;
  padding: 2px 8px;
  border-radius: 999px;
}

.packages-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pkg-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

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

.pkg-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pkg-ico {
  font-size: 26px;
}

.pkg-title-wrap strong {
  display: block;
  font-size: 15px;
}

.pkg-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--primary);
}

.pkg-price {
  background: #FFF3E4;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 15px;
  padding: 5px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.pkg-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-sim-buy {
  width: 100%;
  border: none;
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFF;
  font-weight: 800;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #1E6B34;
}

.btn-sim-buy:active {
  transform: translateY(1px);
}

.payment-info-card h4 {
  margin: 0 0 10px;
  font-size: 13.5px;
}

.payment-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border-warm);
}

.payment-option:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pay-ico {
  font-size: 22px;
  flex-shrink: 0;
}

.payment-option strong {
  display: block;
  font-size: 13px;
}

.payment-option small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.transparency-card {
  background: linear-gradient(160deg, #FFF9DB 0%, #FFE8CC 100%);
  border: 1.5px solid #F59F00;
  border-radius: var(--radius-md);
  padding: 14px;
}

.transp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
}

.transparency-card p {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #4A331E;
}

.btn-transparency-link {
  display: inline-block;
  background: #2B1D14;
  color: #FFF;
  text-decoration: none;
  font-weight: 800;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 10px;
}

.tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: #FFFBF6;
  border-radius: 8px;
  border: 1px solid #EFE0CE;
}

.reset-zone {
  text-align: center;
  padding-top: 4px;
}

.btn-reset-demo {
  border: 1px dashed #C7A98B;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* ==================== NAVEGACIÓN INFERIOR ==================== */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #FFFFFF;
  border-top: 1.5px solid var(--border-warm);
  padding: 5px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}

.nav-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-height: 46px;
}

.nav-btn .nav-ico {
  font-size: 19px;
  line-height: 1;
}

.nav-btn.active {
  background: #FFF1E0;
  color: var(--primary);
  font-weight: 900;
}

/* ==================== MODALES (LEVEL-UP, DESBLOQUEO, PERFIL, VECINO) ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(25, 15, 8, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 356px;
  background: #FFF;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: popSpawn 0.24s ease-out;
  max-height: 92%;
  overflow-y: auto;
}

.modal-celebration {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 6px;
}

.levelup-art-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border-warm);
  margin-bottom: 12px;
  background: #FFF8F0;
}

.levelup-art-img {
  width: 100%;
  height: auto;
  display: block;
}

.levelup-bonus-pill {
  background: var(--green-soft);
  color: #1E6B34;
  border: 1px solid #96E0AE;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.modal-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary);
  background: #FFF1E0;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.modal-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.modal-card p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.modal-card .btn-primary {
  width: 100%;
}

/* Botones de desbloqueo de casilla */
.unlock-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-unlock-option {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}

.btn-unlock-coins {
  background: linear-gradient(180deg, #FFD43B 0%, #F59F00 100%);
  color: #3D2400;
  box-shadow: 0 3px 0 #C07A00;
}

.btn-unlock-credits {
  background: linear-gradient(180deg, #9775FA 0%, var(--purple) 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #4C2EB8;
}

.btn-unlock-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Ficha de Vecino */
.nb-photo-lg {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3.5px solid var(--primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  margin: 0 auto 8px;
  display: block;
}

.nb-del-line {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px !important;
}

.nb-stats-box {
  background: #FFFBF6;
  border: 1.5px solid var(--border-warm);
  border-radius: 14px;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.nb-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nb-story-mini-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nb-stat-item small,
.nb-mini-card small {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.nb-stat-item strong,
.nb-mini-card strong {
  font-size: 13px;
  color: var(--text-main);
}

.nb-stat-row-two {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
}

.nb-mini-card {
  background: #FFF;
  border: 1px solid #EFE0CE;
  border-radius: 10px;
  padding: 7px 8px;
}

.nb-rivalry-msg {
  font-size: 12.5px !important;
  font-weight: 700;
  color: var(--primary-dark) !important;
  background: #FFF3E4;
  padding: 8px 10px;
  border-radius: 10px;
}

/* Toast */
.toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: #2B1D14;
  color: #FFF8F0;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}


/* ============================================================================
   PASO 1.6 — Audio, Clientes Expresivos, Diario, Movimientos y Anuncios
   (Mantiene intacta la paleta cálida y las dimensiones generales actuales)
   ============================================================================ */

/* Botón compacto de sonido en encabezado */
.btn-sound-mini {
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-sound-mini.is-muted {
  background: #F4EBE0;
  opacity: 0.72;
}

/* Tarjetas de pedidos compactas con retrato protagonista + reacción feliz */
.order-card {
  padding: 5px 5px 5px;
  gap: 2px;
  overflow: visible;
}

.order-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.order-cust-portrait {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-warm);
  background: #FFF3E4;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.2, 1.5, 0.4, 1), border-color 0.2s ease;
}

.order-card.ready .order-cust-portrait {
  border-color: var(--green);
}

.order-speech-bubble {
  position: relative;
  background: #FFF8F0;
  border: 1.5px solid #EBD6BD;
  border-radius: 10px;
  padding: 2px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 38px;
}

.order-card.ready .order-speech-bubble {
  background: #FFFFFF;
  border-color: #96E0AE;
}

.order-bubble-ico {
  font-size: 20px;
  line-height: 1.05;
}

.order-cust-name {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.order-rewards {
  gap: 4px;
  font-size: 9.8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.rew-energy {
  background: #E7F5FF;
  color: #1864AB;
  border: 1px solid #A5D8FF;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 9.2px;
  font-weight: 900;
}

/* Reacción súper feliz de 850 ms al entregar */
.order-card.is-celebrating {
  border-color: var(--green);
  background: linear-gradient(180deg, #E6FCF5 0%, #D3F9D8 100%);
  box-shadow: 0 0 0 3px rgba(43, 147, 72, 0.35), 0 6px 14px rgba(43, 147, 72, 0.24);
  z-index: 4;
}

.order-card.is-celebrating .order-cust-portrait {
  border-color: var(--green);
  transform: scale(1.16);
  animation: happyBounce 0.45s ease-in-out infinite alternate;
}

.order-float-burst {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #2B9348;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(30, 107, 52, 0.35);
  pointer-events: none;
  z-index: 12;
  animation: floatRewardUp 0.85s ease-out forwards;
}

.order-card.is-entering {
  animation: orderSlideIn 0.28s cubic-bezier(0.2, 1.25, 0.4, 1);
}

@keyframes happyBounce {
  0% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1.2) rotate(3deg); }
}

@keyframes floatRewardUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1.05); }
  80% { opacity: 1; transform: translate(-50%, -22px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -32px) scale(0.95); }
}

@keyframes orderSlideIn {
  0% { opacity: 0; transform: translateX(18px) scale(0.95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* ==================== INDICADORES DE MOVIMIENTO EN RANKINGS ==================== */
.move-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.35;
  white-space: nowrap;
}

.move-up {
  background: #D3F9D8;
  color: #1E6B34;
  border: 1px solid #8CE99A;
}

.move-down {
  background: #FFE3E3;
  color: #C92A2A;
  border: 1px solid #FFA8A8;
}

.move-same {
  background: #FFF3BF;
  color: #B06D00;
  border: 1px solid #FFE066;
}

.rank-meta-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.del-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== DIARIO / ÁLBUM PROGRESIVO DE HISTORIA ==================== */
.modal-diary-card {
  max-width: 380px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 15px 14px;
}

.diary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.diary-char-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.diary-title-col {
  flex: 1;
  min-width: 0;
}

.diary-title-col h3 {
  margin: 0;
  font-size: 18px;
}

.btn-modal-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-warm);
  background: #FFF8F0;
  color: var(--text-main);
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

.diary-prologue-card {
  background: linear-gradient(135deg, #FFF3E4 0%, #FFE8CC 100%);
  border: 1.5px solid #F4A261;
  border-radius: 12px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.diary-prologue-card strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.diary-prologue-card small {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-diary-play {
  border: none;
  background: var(--primary);
  color: #FFF;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 0 var(--primary-dark);
}

.diary-chapters-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.diary-page {
  background: #FFFDF9;
  border: 1.5px solid var(--border-warm);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diary-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.diary-page-title {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text-main);
}

.diary-page-art {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #EFE0CE;
  display: block;
}

.diary-page-quote {
  margin: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  color: #4A331E !important;
  font-style: italic;
  background: #FFF8F0;
  padding: 8px 10px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
}

.diary-page.is-locked {
  background: #F7EFE5;
  border-style: dashed;
  border-color: #D7C2A8;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.diary-lock-thumb {
  width: 46px;
  height: 36px;
  border-radius: 8px;
  background: #E4D3BE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.diary-lock-info strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
}

.diary-lock-info small {
  font-size: 11px;
  color: #9A816B;
}

/* ==================== ANUNCIOS RECOMPENSADOS (RECARGAS / UNLOCK / SIMULADOR) ==================== */
.ad-reward-card {
  background: linear-gradient(135deg, #E7F5FF 0%, #D0EBFF 100%);
  border: 1.5px solid #74C0FC;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow-sm);
}

.ad-reward-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ad-reward-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-reward-ico {
  font-size: 26px;
  line-height: 1;
}

.ad-reward-title strong {
  display: block;
  font-size: 14px;
  color: #184E77;
}

.ad-reward-title small {
  font-size: 11.5px;
  color: #3B6E94;
}

.ad-quota-pill {
  background: #1C7ED6;
  color: #FFF;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-ad-watch {
  width: 100%;
  border: none;
  background: linear-gradient(180deg, #339AF0 0%, #1C7ED6 100%);
  color: #FFF;
  font-weight: 800;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #145999;
}

.btn-ad-watch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-unlock-ad {
  background: linear-gradient(180deg, #339AF0 0%, #1C7ED6 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #145999;
}

/* Modal Simulador de Anuncio (5s) */
.modal-ad-card {
  max-width: 348px;
}

.ad-sim-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  background: #2B1D14;
  color: #FFD166;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.ad-sim-stage {
  background: linear-gradient(160deg, #FFF9DB 0%, #FFE8CC 100%);
  border: 1.5px solid #F59F00;
  border-radius: 14px;
  padding: 16px 12px;
  margin-bottom: 12px;
}

.ad-sim-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 6px;
}

.ad-sim-tagline {
  font-size: 12.5px !important;
  font-weight: 800;
  color: var(--primary-dark) !important;
  margin-bottom: 6px !important;
}

.ad-sim-detail {
  font-size: 12px !important;
  margin-bottom: 0 !important;
  color: #4A331E !important;
}

.ad-progress-track {
  width: 100%;
  height: 10px;
  background: #EFE0CE;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ad-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #339AF0, #2B9348);
  border-radius: 999px;
  transition: width 0.2s linear;
}

.ad-countdown-text {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 10px;
}


/* ============================================================================
   PASO 1.7 — Clientes Protagonistas, Ventana Feliz, Rankings Claros,
   Tablero estilo Gossip Harbor (Telarañas, Monedas, Vender) y "Mi Negocio"
   ============================================================================ */

/* 1. Barra de Negocio -> Acceso directo a "Mi Negocio" + punto rojo de aviso */
.business-bar.is-clickable {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.1s ease;
}

.business-bar.is-clickable:active {
  transform: scale(0.99);
}

.business-bar.has-action-ready {
  border-color: #40C057;
  box-shadow: 0 0 0 2px rgba(43, 147, 72, 0.16);
}

.biz-tasks-chip {
  font-size: 9.5px;
  font-weight: 900;
  background: #FFF3E4;
  color: var(--primary-dark);
  border: 1px solid #F4C08A;
  padding: 0 5px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.4;
}

.btn-upgrade {
  position: relative;
  min-width: 82px;
  padding: 5px 8px;
}

.biz-notify-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #E03131;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px rgba(224, 49, 49, 0.28);
  animation: dotPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(224, 49, 49, 0.38); }
  50% { transform: scale(1.22); box-shadow: 0 0 0 4px rgba(224, 49, 49, 0.12); }
}

/* 2. Tarjetas de Pedido: Retrato Protagonista 58px + Insignia Superpuesta */
.orders-strip {
  gap: 5px;
}

.order-card {
  padding: 4px 4px 4px;
  gap: 2px;
  border-radius: 13px;
}

.order-avatar-stage {
  position: relative;
  width: 60px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1px;
}

.order-card .order-cust-portrait {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2.5px solid var(--border-warm);
  box-shadow: 0 2px 6px rgba(61, 35, 16, 0.14);
  background: #FFF3E4;
}

.order-card.ready .order-cust-portrait {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(43, 147, 72, 0.22);
}

.order-item-badge {
  position: absolute;
  bottom: -2px;
  right: -10px;
  background: #FFFDF9;
  border: 1.5px solid #E5B98A;
  border-radius: 10px;
  padding: 1px 4px 1px 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(43, 29, 20, 0.18);
  line-height: 1;
}

.order-card.ready .order-item-badge {
  background: #FFFFFF;
  border-color: var(--green);
}

.order-item-badge-ico {
  font-size: 16px;
  line-height: 1;
}

.order-item-badge-lv {
  font-size: 8.5px;
  font-weight: 900;
  background: #2B1D14;
  color: #FFD43B;
  padding: 1px 3.5px;
  border-radius: 5px;
  line-height: 1.2;
}

.order-card.ready .order-item-badge-lv {
  background: var(--green);
  color: #FFFFFF;
}

.order-cust-name {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.order-rewards {
  gap: 3px;
  font-size: 9.5px;
}

.order-btn {
  padding: 3.5px 4px;
  font-size: 10.5px;
  margin-top: 1px;
}

@media (max-height: 670px) {
  .order-avatar-stage {
    width: 54px;
    height: 52px;
  }
  .order-card .order-cust-portrait {
    width: 52px;
    height: 52px;
  }
}

/* 3. Ventana Flotante Celebratoria de Agradecimiento (No bloqueante, 1.4s / toque) */
.happy-client-banner {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 348px);
  z-index: 82;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 11px;
  background: linear-gradient(145deg, #FFFDF9 0%, #FFF3D6 100%);
  border: 2.5px solid #F59F00;
  border-radius: 20px;
  padding: 10px 13px;
  box-shadow: 0 14px 32px rgba(43, 29, 20, 0.28), 0 0 0 3px rgba(255, 212, 59, 0.35);
  animation: happyBannerIn 0.26s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.happy-client-banner.is-leaving {
  animation: happyBannerOut 0.2s ease-in forwards;
}

.hcb-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hcb-photo {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--green);
  background: #E9F9EE;
  box-shadow: 0 4px 12px rgba(43, 147, 72, 0.28);
  animation: happyPortraitPop 0.55s ease-in-out infinite alternate;
}

.hcb-sparkle {
  position: absolute;
  font-size: 16px;
  line-height: 1;
  animation: sparkleFloat 0.7s ease-in-out infinite alternate;
}

.hcb-sp1 {
  top: -4px;
  left: -2px;
}

.hcb-sp2 {
  bottom: 0;
  right: -4px;
  animation-delay: 0.2s;
}

.hcb-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hcb-name {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
}

.hcb-phrase {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.28;
  color: var(--text-main);
}

.hcb-rewards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.hcb-rew-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
}

.hcb-rew-coins {
  background: #FFF3BF;
  color: #7C4D00;
  border: 1px solid #FFD43B;
}

.hcb-rew-pts {
  background: #D3F9D8;
  color: #1E6B34;
  border: 1px solid #8CE99A;
}

.hcb-rew-energy {
  background: #E7F5FF;
  color: #1864AB;
  border: 1px solid #74C0FC;
}

.hcb-rew-bonus {
  background: #FFE8CC;
  color: #C84B00;
  border: 1px solid #FFA94D;
}

@keyframes happyBannerIn {
  0% { opacity: 0; transform: translate(-50%, -14px) scale(0.88); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes happyBannerOut {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(0.95); }
}

@keyframes happyPortraitPop {
  0% { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.06) rotate(2deg); }
}

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(0.9); opacity: 0.8; }
  100% { transform: translateY(-4px) scale(1.18); opacity: 1; }
}

/* 4. Rankings Claros: Columna Derecha Fija con ▲ Subió X / ▼ Bajó X / • Igual */
.rank-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  min-width: 82px;
  flex-shrink: 0;
}

.rank-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.rank-view-inline {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.move-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  min-width: 64px;
  text-align: center;
  letter-spacing: 0.01em;
}

.del-right-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.del-pts-val {
  min-width: 66px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 5. Tablero estilo Gossip Harbor: Telarañas, Monedas Fusionables y Botón Vender/Cobrar */
.board-cell.is-dusty {
  background: linear-gradient(145deg, #ECE2D5 0%, #DECDB8 100%);
  border: 2px dashed #B59C82;
  cursor: pointer;
}

.board-cell.is-dusty .item-emoji {
  opacity: 0.68;
  filter: saturate(0.55) contrast(0.92);
  transform: scale(0.92);
}

.board-cell.is-dusty .item-lvl-badge {
  background: rgba(74, 58, 45, 0.72);
  z-index: 3;
}

.dust-web-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.dust-tag {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  line-height: 1;
  z-index: 3;
  pointer-events: none;
  opacity: 0.85;
}

.board-cell.is-dusty.is-merge-hint {
  border-style: solid;
  border-color: #2B9348;
  border-width: 2.5px;
  background: linear-gradient(145deg, #F5FBEF 0%, #D8F5A2 100%);
  box-shadow: 0 0 0 3px rgba(43, 147, 72, 0.3);
}

.board-cell.is-dusty.is-drop-target {
  border-style: solid;
  border-color: #E85D04;
  background: #FFF3BF;
  transform: scale(1.06);
}

/* Monedas Fusionables en el tablero */
.board-cell.is-coin {
  background: radial-gradient(circle at 35% 30%, #FFFBE6 0%, var(--item-bg, #FFF3BF) 68%, #FFE066 100%);
  border: 2px solid var(--item-border, #F59F00);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 0 rgba(217, 119, 6, 0.25);
}

.coin-val-chip {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 8.5px;
  font-weight: 900;
  background: #FFF9DB;
  color: #8F4F00;
  border: 1px solid #F59F00;
  padding: 0 3px;
  border-radius: 5px;
  line-height: 1.3;
  pointer-events: none;
}

/* Animación dorada al limpiar telaraña */
.anim-dust-clear {
  animation: dustClearPop 0.48s cubic-bezier(0.2, 1.55, 0.4, 1);
}

.anim-dust-clear::after {
  content: '✨';
  position: absolute;
  inset: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border-radius: 14px;
  border: 3px solid #FFD43B;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.55) 0%, transparent 72%);
  animation: dustFlashRing 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes dustClearPop {
  0% { transform: scale(0.72); }
  48% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes dustFlashRing {
  0% { opacity: 1; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.38); }
}

/* Botón compacto Vender / Cobrar dentro de la barra de selección */
.selection-bar {
  padding: 5px 8px;
  gap: 8px;
}

.sel-text {
  flex: 1;
}

.btn-sel-action {
  border: none;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.btn-sel-action:active {
  transform: scale(0.95);
}

.btn-sel-action.is-sell {
  background: linear-gradient(180deg, #FFE066 0%, #F59F00 100%);
  color: #3D2400;
  box-shadow: 0 2px 0 #C07A00;
}

.btn-sel-action.is-collect {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 0 #1E6B34;
  animation: pulseReady 1.2s infinite;
}

.profile-test-zone {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-warm);
}

/* 6. Vista Interactiva "Mi Negocio" (SVG + 3 Micro-Tareas + 3 Estilos + Mini-Chat) */
.biz-screen {
  z-index: 42;
  background: linear-gradient(175deg, #FFF8F0 0%, #FFEEDB 100%);
  padding: 10px 12px 16px;
  justify-content: flex-start !important;
}

.biz-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 100%;
}

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

.btn-biz-back {
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 800;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.biz-topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  line-height: 1.15;
}

.biz-topbar-title strong {
  display: block;
  font-size: 15.5px;
  color: var(--text-main);
}

.biz-topbar-title small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-scene-card {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--border-warm);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.biz-scene-stage {
  width: 100%;
  aspect-ratio: 360 / 205;
  background: #FFF3E4;
  display: block;
  overflow: hidden;
}

.biz-scene-stage svg {
  width: 100%;
  height: 100%;
  display: block;
}

.biz-scene-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #FFFBF6;
  border-top: 1px solid #F0E0CE;
}

.mb-stage-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-mb-restyle {
  border: 1.5px solid #F4A261;
  background: #FFF3E4;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

/* Chispas de renovación sobre el SVG */
.biz-sparkle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.36) 0%, transparent 65%);
  animation: renovateGlow 0.9s ease-out forwards;
}

.sp-star {
  position: absolute;
  font-size: 24px;
  animation: starBurst 0.9s ease-out forwards;
}

.sp-1 { top: 18%; left: 16%; }
.sp-2 { top: 14%; right: 18%; animation-delay: 0.08s; }
.sp-3 { top: 44%; left: 48%; font-size: 30px; animation-delay: 0.04s; }
.sp-4 { bottom: 26%; left: 26%; animation-delay: 0.12s; }
.sp-5 { bottom: 24%; right: 22%; animation-delay: 0.1s; }

@keyframes renovateGlow {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes starBurst {
  0% { opacity: 0; transform: scale(0.3) translateY(10px); }
  35% { opacity: 1; transform: scale(1.25) translateY(-6px); }
  100% { opacity: 0; transform: scale(0.85) translateY(-24px); }
}

/* Selector Inline de 3 Estilos */
.biz-style-picker {
  background: #FFFFFF;
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 11px;
  box-shadow: 0 8px 20px rgba(232, 93, 4, 0.16);
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: popSpawn 0.2s ease-out;
}

.biz-picker-head strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.biz-picker-head small {
  font-size: 11.5px;
  color: var(--text-muted);
}

.biz-style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.style-opt-card {
  border: 2px solid var(--border-warm);
  background: #FFFBF6;
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.style-opt-card.selected {
  border-color: var(--primary);
  background: #FFF3E4;
  box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.2);
  transform: translateY(-2px);
}

.style-swatch-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.style-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(43, 29, 20, 0.22);
}

.style-opt-ico {
  font-size: 20px;
  line-height: 1;
}

.style-opt-name {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
}

.style-opt-desc {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

.biz-picker-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.6fr;
  gap: 8px;
}

.biz-btn-cancel {
  margin-top: 0 !important;
  padding: 9px 10px;
  font-size: 12.5px;
}

.biz-btn-confirm {
  padding: 10px 12px;
  font-size: 13px;
}

/* Lista de 3 Micro-Tareas */
.biz-tasks-panel {
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.biz-tasks-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.biz-tasks-head h3 {
  margin: 1px 0 0;
  font-size: 15.5px;
  color: var(--text-main);
}

.biz-tasks-progress-pill {
  background: #FFF3E4;
  border: 1px solid #F4C08A;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.biz-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.biz-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 13px;
  border: 1.5px solid #EFE0CE;
  background: #FFFBF6;
}

.biz-task-row.is-current {
  border-color: #F4A261;
  background: #FFF8EE;
}

.biz-task-row.is-affordable {
  border-color: var(--green);
  background: var(--green-soft);
}

.biz-task-row.is-done {
  background: #F4FBF6;
  border-color: #B2F2BB;
  opacity: 0.88;
}

.biz-task-row.is-locked {
  opacity: 0.65;
  background: #F7F1EA;
}

.biz-task-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

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

.biz-task-step {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.biz-style-chip {
  background: #FFE8CC;
  color: var(--primary-dark);
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
}

.biz-task-title {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-top: 1px;
}

.btn-task-do {
  border: none;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-task-do.ready {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 0 #1E6B34;
  animation: pulseReady 1.3s infinite;
}

.btn-task-do.need-coins {
  background: #EDE0D1;
  color: #6B5342;
}

.biz-task-status {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.biz-task-status.done {
  background: #D3F9D8;
  color: #1E6B34;
}

.biz-task-status.locked {
  background: #EAE0D5;
  color: #856D5B;
}

.biz-max-banner {
  background: linear-gradient(135deg, #FFF9DB 0%, #FFE8CC 100%);
  border: 1.5px solid #F59F00;
  border-radius: 13px;
  padding: 12px;
  text-align: center;
}

.biz-max-banner strong {
  display: block;
  font-size: 14px;
  color: #7C4D00;
  margin-bottom: 4px;
}

.biz-max-banner p {
  margin: 0;
  font-size: 12px;
  color: #5C3D28;
}

/* Diálogo Mini-Chat estilo novela/cómic (2 burbujas alternadas) */
.biz-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(25, 15, 8, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.biz-chat-sheet {
  width: 100%;
  max-width: 396px;
  background: #FFFDF9;
  border: 2.5px solid #2B1D14;
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 11px;
  animation: popSpawn 0.24s ease-out;
}

.biz-chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-row.chat-right {
  justify-content: flex-end;
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  background: #FFF3E4;
  flex-shrink: 0;
}

.chat-row.chat-right .chat-avatar {
  border-color: var(--green);
}

.chat-bubble {
  max-width: 78%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.38;
  box-shadow: var(--shadow-sm);
}

.chat-bubble strong {
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}

.chat-bubble p {
  margin: 0;
  color: var(--text-main);
}

.chat-bubble-hero {
  background: #FFF3E4;
  border: 1.5px solid #F4C08A;
  border-bottom-left-radius: 4px;
}

.chat-bubble-hero strong {
  color: var(--primary-dark);
}

.chat-bubble-partner {
  background: #E9F9EE;
  border: 1.5px solid #8CE99A;
  border-bottom-right-radius: 4px;
}

.chat-bubble-partner strong {
  color: #1E6B34;
}


/* ============================================================================
   BETA 1 ESTABLE — Pulido Final (Header 340px+, Contraste Unlock, Venta VIP,
   Micro-Guía 3 Pasos y Soporte de Imágenes Personalizadas WebP/PNG)
   ============================================================================ */

/* 1. Encabezado sin solapamientos desde 340px (sonido en 2.ª fila) */
.header-row-main {
  flex-wrap: nowrap;
  gap: 4px;
}

.header-row-sub {
  min-height: 28px;
  gap: 6px;
}

.delegation-tag {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-sub-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 68%;
}

.header-sub-right .btn-sound-mini {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.player-profile-pill {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.player-profile-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 395px) {
  .top-header {
    padding: 5px 7px 6px;
  }
  .header-left-group {
    gap: 4px;
  }
  .resource-group {
    gap: 3px;
  }
  .story-pill {
    font-size: 11px;
    padding: 2px 5px 2px 2px;
    gap: 3px;
    min-height: 28px;
  }
  .hdr-char-img {
    width: 22px;
    height: 22px;
  }
  .btn-story-mini {
    font-size: 10px;
    padding: 3px 5px;
    min-height: 27px;
  }
  .res-pill {
    font-size: 10.5px;
    padding: 2px 5px;
    gap: 2px;
    min-height: 27px;
  }
  .energy-timer {
    font-size: 8.5px;
    padding: 1px 3px;
  }
}

@media (max-width: 355px) {
  .btn-story-mini {
    font-size: 9.5px;
    padding: 2px 4px;
  }
  .res-pill {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* Contraste reforzado en Modal "Desbloquear este espacio" */
.btn-unlock-option {
  gap: 8px;
  text-align: left;
  line-height: 1.25;
  padding: 11px 12px;
}

.btn-unlock-option span {
  flex: 1;
  min-width: 0;
}

.btn-unlock-option strong {
  text-align: right;
  font-size: 12.5px;
  flex-shrink: 0;
}

.btn-unlock-coins {
  background: linear-gradient(180deg, #FFE066 0%, #F59F00 100%);
  color: #2B1A00;
  border: 1.5px solid #D98200;
  box-shadow: 0 3px 0 #B36B00;
}

.btn-unlock-credits {
  background: linear-gradient(180deg, #7950F2 0%, #5F3DC4 100%);
  color: #FFFFFF;
  border: 1.5px solid #4C2EB8;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.btn-unlock-ad {
  background: linear-gradient(180deg, #228BE6 0%, #1864AB 100%);
  color: #FFFFFF;
  border: 1.5px solid #14538F;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.btn-unlock-option:disabled {
  opacity: 1;
  background: #EDE3D7;
  color: #4A382B;
  border: 1.5px solid #CEBCA7;
  box-shadow: none;
  text-shadow: none;
  cursor: not-allowed;
}

.btn-unlock-option:disabled strong {
  color: #6B4F3A;
}

/* 2. Botón destacado "Venta VIP" para objetos Nivel 6 */
.btn-sel-action.is-vip-sell {
  background: linear-gradient(135deg, #FFD43B 0%, #F59F00 52%, #E85D04 100%);
  color: #2B1400;
  border: 1.5px solid #FFF3BF;
  box-shadow: 0 3px 0 #A63C00, 0 0 12px rgba(245, 159, 0, 0.42);
  font-size: 10.5px;
  padding: 6px 8px;
  animation: pulseReady 1.15s infinite;
}

/* 3. Micro-guía discreta de 3 pasos sobre el tablero (solo jugadores nuevos) */
.board-container {
  position: relative;
}

.tutorial-tip {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 368px);
  z-index: 16;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(43, 29, 20, 0.94);
  color: #FFF8F0;
  border: 2px solid #FFD43B;
  border-radius: 13px;
  padding: 7px 9px;
  box-shadow: 0 8px 20px rgba(25, 15, 8, 0.34);
  animation: popSpawn 0.22s ease-out;
}

.tutorial-step-badge {
  background: #FFD43B;
  color: #2B1D14;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.tutorial-tip-text {
  flex: 1;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #FFF8F0;
}

.btn-tutorial-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 248, 240, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #FFF8F0;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.board-cell.is-tut-highlight {
  box-shadow: 0 0 0 3px #FFD43B, 0 0 14px rgba(245, 159, 0, 0.72);
  animation: pulseReady 0.95s ease-in-out infinite;
  z-index: 3;
}

/* 4. Soporte opcional de imágenes personalizadas WebP/PNG (ítems y Mi Negocio) */
.custom-item-img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.board-cell.is-dusty .custom-item-img {
  opacity: 0.68;
  filter: saturate(0.55) contrast(0.92);
  transform: scale(0.92);
}

.order-item-badge-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.sel-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.drag-ghost-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.biz-scene-custom-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.biz-scene-custom-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}


/* ============================================================================
   SPRINT VISUAL 1 — Tablero Táctil 2.5D, Ítems 2.5D, Telarañas Atmosféricas,
   Cajas de Madera Enriquecidas, Pista Automática y Animaciones "Game Juice"
   ============================================================================ */

/* 1. Tablero 5x5 con estética acogedora tipo baldosa de cocina cálida */
.merge-board {
  background: linear-gradient(160deg, #EAD4B8 0%, #DFC19E 100%);
  border: 2.5px solid #CFA87E;
  box-shadow:
    inset 0 3px 8px rgba(84, 48, 20, 0.16),
    0 5px 14px rgba(61, 35, 16, 0.12);
}

.board-cell {
  background: #FDF6EC;
  border: 1.5px solid #E9D3B8;
  box-shadow: inset 0 2px 4px rgba(130, 86, 44, 0.1);
}

/* Alternancia sutil de baldosas cálidas (en 5x5, par/impar coincide exacto con tablero ajedrezado) */
.board-cell:nth-child(even) {
  background: #F5E8D7;
}

/* 2. Fichas táctiles 2.5D con relieve suave inferior y brillo superior */
.board-cell.has-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 48%), var(--item-bg, #FFF);
  border-width: 2px;
  border-color: var(--item-border, #E5C8A6);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 3px rgba(120, 72, 34, 0.1),
    0 3px 0 rgba(120, 72, 34, 0.24),
    0 4px 8px rgba(61, 35, 16, 0.12);
}

.board-cell.is-selected {
  transform: translateY(-2px) scale(1.05);
  border-color: #E85D04;
  border-width: 2.5px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.92),
    0 0 0 3px rgba(232, 93, 4, 0.28),
    0 6px 12px rgba(232, 93, 4, 0.24);
}

.board-cell.is-selected::before {
  content: '';
  position: absolute;
  top: -12%;
  left: -20%;
  width: 75%;
  height: 55%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Ilustraciones 2.5D nítidas dentro de tablero, pedidos, selección y arrastre */
.custom-item-img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 2px 2px rgba(61, 35, 16, 0.18));
  position: relative;
  z-index: 1;
}

.board-cell.is-generator {
  background: radial-gradient(circle at 35% 25%, #FFB35C 0%, #F77F00 52%, #D9480F 100%);
  border: 2px solid #9E3600;
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 210, 0.58),
    0 4px 0 #8A2E00,
    0 6px 10px rgba(84, 34, 6, 0.25);
}

.gen-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(50, 18, 4, 0.35));
}

.board-cell.is-generator .gen-tag {
  position: absolute;
  bottom: 2px;
  right: 3px;
  margin-top: 0;
  font-size: 8.8px;
  padding: 0 4px;
  background: rgba(43, 20, 8, 0.78);
  border: 1px solid rgba(255, 224, 102, 0.55);
}

.order-item-badge-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(43, 29, 20, 0.2));
}

.sel-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.drag-ghost {
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -46px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    0 14px 26px rgba(43, 29, 20, 0.32);
}

.drag-ghost-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 3px 3px rgba(43, 29, 20, 0.24));
}

/* 3. Casillas empolvadas / con telaraña atmosférica */
.board-cell.is-dusty {
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.62) 0%, transparent 45%),
    radial-gradient(circle at 78% 76%, rgba(255, 250, 240, 0.55) 0%, transparent 48%),
    linear-gradient(145deg, #EAE0D2 0%, #D9C7B0 100%);
  border: 2px dashed #AE9377;
  box-shadow: inset 0 2px 6px rgba(82, 58, 36, 0.16);
}

.board-cell.is-dusty .custom-item-img {
  opacity: 0.72;
  filter: saturate(0.52) brightness(0.98) contrast(0.92);
  transform: scale(0.9);
}

.dust-cloud-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 26% 78%, rgba(255, 252, 247, 0.65) 0%, rgba(255, 252, 247, 0) 46%),
    radial-gradient(circle at 76% 26%, rgba(255, 252, 247, 0.62) 0%, rgba(255, 252, 247, 0) 44%);
}

/* 4. Cajas bloqueadas de madera enriquecida con esquinas reforzadas y candado dorado */
.board-cell.is-locked {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(92, 52, 22, 0.12) 0px,
      rgba(92, 52, 22, 0.12) 2px,
      transparent 2px,
      transparent 11px
    ),
    linear-gradient(155deg, #D9AC74 0%, #B77E46 58%, #9A632E 100%);
  border: 2px solid #75461B;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 198, 0.42),
    inset 0 -3px 0 rgba(80, 42, 14, 0.32),
    0 3px 0 #663B15;
}

.crate-art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.board-cell.is-locked .lock-ico,
.board-cell.is-locked .lock-cost {
  position: relative;
  z-index: 2;
}

.lock-padlock-svg {
  width: 24px;
  height: 24px;
  display: block;
  filter: drop-shadow(0 2px 2px rgba(43, 20, 6, 0.45));
}

/* 5. Pista automática de fusión (latido/bailecito sincronizado tras 4.5s de inactividad) */
.board-cell.is-idle-hint {
  animation: idleHintDance 0.92s cubic-bezier(0.25, 1.35, 0.45, 1);
  border-color: #F59F00 !important;
  box-shadow:
    0 0 0 3px rgba(255, 212, 59, 0.62),
    0 6px 14px rgba(232, 93, 4, 0.28) !important;
  z-index: 4;
}

@keyframes idleHintDance {
  0%   { transform: scale(1) rotate(0deg); }
  20%  { transform: translateY(-4px) scale(1.09) rotate(-4deg); }
  45%  { transform: translateY(-5px) scale(1.11) rotate(4deg); }
  70%  { transform: translateY(-2px) scale(1.05) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 6. Animaciones "Game Juice" (Squash & Stretch, Arco, Partículas y Recompensas Voladoras) */
.anim-gen-squash {
  animation: genSquashStretch 0.34s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes genSquashStretch {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.14, 0.82); }
  58%  { transform: scale(0.92, 1.09); }
  82%  { transform: scale(1.03, 0.98); }
  100% { transform: scale(1, 1); }
}

.is-landing-wait > .custom-item-img,
.is-landing-wait > .item-emoji,
.is-landing-wait > .item-lvl-badge {
  opacity: 0 !important;
}

.anim-spawn-land {
  animation: spawnElasticLand 0.34s cubic-bezier(0.22, 1.55, 0.38, 1);
}

@keyframes spawnElasticLand {
  0%   { transform: scale(1.22, 0.78); }
  45%  { transform: scale(0.92, 1.12); }
  75%  { transform: scale(1.04, 0.97); }
  100% { transform: scale(1, 1); }
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.fx-arc-item {
  position: fixed;
  top: 0;
  left: 0;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  margin-top: -27px;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 10px rgba(43, 29, 20, 0.28));
}

.fx-arc-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fx-shockwave {
  position: fixed;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  border: 3.5px solid #FFD43B;
  background: radial-gradient(circle, rgba(255, 243, 191, 0.72) 0%, rgba(255, 212, 59, 0) 70%);
  animation: fxShockExpand 0.44s ease-out forwards;
  will-change: transform, opacity;
}

.fx-shockwave.is-high {
  border-color: #FF922B;
  border-width: 4.5px;
  box-shadow: 0 0 18px rgba(255, 183, 3, 0.75);
  animation-duration: 0.56s;
}

@keyframes fxShockExpand {
  0%   { opacity: 1; transform: translate3d(var(--fx-x), var(--fx-y), 0) scale(0.35); }
  100% { opacity: 0; transform: translate3d(var(--fx-x), var(--fx-y), 0) scale(2.2); }
}

.fx-particle {
  position: fixed;
  top: 0;
  left: 0;
  font-size: 14px;
  line-height: 1;
  margin-left: -7px;
  margin-top: -7px;
  will-change: transform, opacity;
  animation: fxParticleFly 0.52s cubic-bezier(0.16, 0.85, 0.35, 1) forwards;
}

.fx-particle.is-dust {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, #EFE2D1 100%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
}

@keyframes fxParticleFly {
  0% {
    opacity: 1;
    transform: translate3d(var(--fx-x), var(--fx-y), 0) scale(0.55) rotate(0deg);
  }
  70% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--fx-x) + var(--fx-dx)), calc(var(--fx-y) + var(--fx-dy)), 0) scale(1.15) rotate(120deg);
  }
}

.fx-flyer {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  filter: drop-shadow(0 4px 6px rgba(43, 29, 20, 0.28));
  will-change: transform, opacity;
}

.fx-flyer img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.anim-counter-bump {
  animation: counterBump 0.26s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes counterBump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}


/* ============================================================================
   SPRINT VISUAL 2 — Escenarios Vivos 2.5D (Mi Negocio, Diario, Level-Up),
   Vida Ambiental a 60 FPS, Revelación Diagonal y Micro-Guía sin tapar Generador
   ============================================================================ */

/* 1. Micro-guía reubicada en la parte inferior del tablero (nunca tapa el generador 0,0) */
.tutorial-tip {
  top: auto;
  bottom: 8px;
}

/* 2. Contenedores de Escenarios 2.5D sincronizados en Diario y Modal Subida de Nivel */
.diary-scene-wrap,
.levelup-scene-stage {
  width: 100%;
  aspect-ratio: 360 / 205;
  border-radius: 11px;
  overflow: hidden;
  background: #FFF3E4;
  border: 1.5px solid #EFE0CE;
  display: block;
}

.levelup-scene-stage {
  border: none;
  border-radius: 0;
}

.biz-live-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 3. Vida ambiental ultraligera (GPU CSS/SVG 60 FPS) */
.sc-steam {
  animation: scSteamRise 2.7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.sc-bulb-glow {
  animation: scBulbPulse 2.1s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.sc-twinkle {
  animation: scStarTwinkle 2.4s ease-in-out infinite alternate;
}

.sc-cloud-slow {
  animation: scCloudDrift 20s ease-in-out infinite alternate;
}

.sc-cloud-med {
  animation: scCloudDrift 15s ease-in-out infinite alternate-reverse;
}

.sc-d2 {
  animation-delay: 0.75s;
}

.sc-d3 {
  animation-delay: 1.4s;
}

@keyframes scSteamRise {
  0%   { opacity: 0; transform: translateY(4px) scale(0.9); }
  35%  { opacity: 0.78; }
  80%  { opacity: 0.42; }
  100% { opacity: 0; transform: translateY(-9px) scale(1.12); }
}

@keyframes scBulbPulse {
  0%   { opacity: 0.28; transform: scale(0.92); }
  100% { opacity: 0.62; transform: scale(1.14); }
}

@keyframes scStarTwinkle {
  0%   { opacity: 0.28; }
  100% { opacity: 0.98; }
}

@keyframes scCloudDrift {
  0%   { transform: translateX(-8px); }
  100% { transform: translateX(10px); }
}

/* 4. Efecto de revelación diagonal (brillo cruzando el escenario al renovar/estilizar) */
.biz-sparkle-layer {
  overflow: hidden;
}

.biz-reveal-sweep {
  position: absolute;
  top: -25%;
  left: -65%;
  width: 55%;
  height: 155%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 248, 220, 0.72) 48%,
    rgba(255, 212, 59, 0.55) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-24deg);
  animation: bizRevealSweep 0.78s cubic-bezier(0.22, 0.85, 0.36, 1) forwards;
  pointer-events: none;
}

@keyframes bizRevealSweep {
  0%   { transform: translateX(0) skewX(-24deg); opacity: 0.95; }
  100% { transform: translateX(360%) skewX(-24deg); opacity: 0; }
}


/* ============================================================================
   SPRINT VISUAL 3 — Tienda 3 Sub-Pestañas, Hora Pico x2, 6 Marcos de Perfil,
   8 Insignias de Logros y Zoom Ken Burns Cinematográfico en el Prólogo
   ============================================================================ */

/* 1. Zoom cinematográfico suave (Ken Burns) en escenas del Prólogo */
.vn-scene-img {
  animation: vnKenBurns 9s ease-out forwards;
  transform-origin: center center;
}

@keyframes vnKenBurns {
  0%   { opacity: 0.45; transform: scale(1.0); }
  12%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1.07); }
}

/* 2. Banner compacto y brillante de "Hora Pico x2 Liga" sobre el tablero */
.hora-pico-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #D9480F 0%, #F59F00 50%, #D9480F 100%);
  color: #FFFDF9;
  border: 1.5px solid #FFE066;
  box-shadow: 0 3px 10px rgba(232, 93, 4, 0.34), 0 0 10px rgba(255, 212, 59, 0.45);
  font-size: 11px;
  flex-shrink: 0;
  animation: hpGlow 1.6s ease-in-out infinite alternate;
}

.hp-fire {
  font-size: 14px;
  line-height: 1;
}

.hp-label {
  flex: 1;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-timer {
  background: rgba(43, 20, 8, 0.82);
  color: #FFE066;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  flex-shrink: 0;
}

@keyframes hpGlow {
  0%   { box-shadow: 0 2px 8px rgba(232, 93, 4, 0.28); }
  100% { box-shadow: 0 3px 14px rgba(255, 212, 59, 0.65); }
}

/* 3. Navegación inferior con punto rojo en Tienda cuando hay logros por reclamar */
.nav-btn {
  position: relative;
}

.nav-notify-dot,
.subtab-dot {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #E03131;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 0 0 2px rgba(224, 49, 49, 0.28);
  animation: dotPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

.subtab-dot {
  top: 3px;
  right: 5px;
}

/* 4. 3 Sub-pestañas compactas dentro de la Tienda */
.shop-subtabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: #F4E4D1;
  border: 1.5px solid var(--border-warm);
  border-radius: 13px;
  padding: 4px;
  flex-shrink: 0;
}

.shop-subtab {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.shop-subtab.active {
  background: #FFFFFF;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.shop-subpanel {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.shop-wallet-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #2B1D14;
  color: #FFF8F0;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.wallet-chip b {
  color: #FFD43B;
}

.btn-buy-article {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(180deg, #9775FA 0%, #6741D9 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 0 #4C2EB8;
}

.btn-buy-article.is-coins {
  background: linear-gradient(180deg, #FFE066 0%, #F59F00 100%);
  color: #2B1A00;
  box-shadow: 0 3px 0 #B86E00;
}

.btn-buy-article:disabled {
  background: #E6DBD0;
  color: #7D6452;
  box-shadow: none;
  cursor: not-allowed;
}

/* 5. 6 Marcos Visuales para Foto de Perfil (Header, Perfil, Liga Top 10 y Tienda) */
.avatar-frame-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 2.5px;
  flex-shrink: 0;
}

.avatar-frame-wrap > img {
  display: block;
  border-radius: 50%;
  border: none !important;
  margin: 0 !important;
}

.avatar-frame-wrap.is-mini {
  padding: 2px;
}

.nb-frame-center {
  margin: 0 auto 8px;
  padding: 4px;
}

.frame-clasico {
  background: linear-gradient(135deg, #F4A261, #E85D04);
}

.frame-fuego {
  background: linear-gradient(135deg, #FFD43B 0%, #FF6B00 48%, #C92A2A 100%);
  box-shadow: 0 0 0 1.5px rgba(255, 107, 0, 0.45), 0 0 10px rgba(232, 93, 4, 0.52);
}

.frame-fresa {
  background: linear-gradient(135deg, #FFA8C5 0%, #F06595 50%, #C2255C 100%);
  box-shadow: 0 0 0 1.5px rgba(240, 101, 149, 0.45), 0 0 9px rgba(214, 51, 108, 0.42);
}

.frame-esmeralda {
  background: linear-gradient(135deg, #96F2D7 0%, #20C997 50%, #1E6B34 100%);
  box-shadow: 0 0 0 1.5px rgba(43, 147, 72, 0.42), 0 0 9px rgba(32, 201, 151, 0.42);
}

.frame-dorado {
  background: conic-gradient(from 0deg, #B87300, #FFF3BF, #F59F00, #FFE066, #B87300);
  box-shadow: 0 0 0 2px rgba(255, 224, 102, 0.6), 0 0 12px rgba(245, 159, 0, 0.58);
}

.frame-solidario {
  background: linear-gradient(135deg, #FFE066 0%, #FF6B8B 50%, #E64980 100%);
  box-shadow: 0 0 0 1.5px rgba(230, 73, 128, 0.42), 0 0 10px rgba(255, 107, 139, 0.48);
}

.frame-solidario::after {
  content: '💖';
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

.avatar-frame-wrap.is-mini.frame-solidario::after {
  font-size: 8px;
  bottom: -2px;
  right: -2px;
}

.frame-dorado::after {
  content: '✨';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

.avatar-frame-wrap.is-mini.frame-dorado::after {
  font-size: 8px;
  top: -2px;
  right: -2px;
}

/* Vista previa cosmética y grilla de Marcos */
.cosmetic-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, #FFFFFF 0%, #FFF4E6 100%);
  border: 1.5px solid #F4A261;
  border-radius: 15px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.cosmetic-preview-img {
  width: 58px;
  height: 58px;
  object-fit: cover;
}

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

.cosmetic-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0;
}

.cosmetic-preview-info strong {
  font-size: 15px;
}

.cosmetic-preview-info small {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.frame-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.frame-card.is-equipped {
  border-color: var(--green);
  background: var(--green-soft);
}

.frame-thumb-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.frame-card strong {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.frame-card small {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.25;
  min-height: 26px;
}

.frame-buy-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: auto;
}

.btn-frame-act {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 6px 6px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.btn-frame-act.equip {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFF;
}

.btn-frame-act.equipped {
  background: #D3F9D8;
  color: #1E6B34;
  cursor: default;
}

.btn-frame-act.buy-cred {
  background: linear-gradient(180deg, #9775FA 0%, #6741D9 100%);
  color: #FFF;
}

.btn-frame-act.buy-coin {
  background: linear-gradient(180deg, #FFE066 0%, #F59F00 100%);
  color: #2B1A00;
}

/* 6. Insignias de Logros (8) y Etiqueta en Liga Top 10 */
.player-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9.5px;
  font-weight: 900;
  background: linear-gradient(135deg, #FFF3BF 0%, #FFE066 100%);
  color: #6B3D00;
  border: 1px solid #F59F00;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}

.rank-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}

.rank-name-line .rank-name {
  min-width: 0;
}

.prof-badge-row,
.nb-badge-wrap {
  margin-bottom: 4px;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.ach-card.is-claimable {
  border-color: var(--green);
  background: var(--green-soft);
}

.ach-card.is-equipped {
  border-color: #F59F00;
  background: #FFFDF2;
}

.ach-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #FFF3E4;
  border: 1.5px solid var(--border-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

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

.ach-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.ach-info small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.ach-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.ach-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #EFE0CE;
  overflow: hidden;
}

.ach-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F59F00, #2B9348);
}

.ach-bar-num {
  font-size: 10px;
  font-weight: 900;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-ach {
  border: none;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-ach.claim {
  background: linear-gradient(180deg, #40C057 0%, var(--green) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 0 #1E6B34;
  animation: pulseReady 1.2s infinite;
}

.btn-ach.equip {
  background: #FFF3E4;
  color: var(--primary-dark);
  border: 1.5px solid #F4A261;
}

.btn-ach.equipped {
  background: #FFD43B;
  color: #4A2800;
}

.btn-ach.locked {
  background: #EFE6DC;
  color: #8C7360;
  cursor: default;
}

/* ============================================================================
   BETA 2 PRO — Apodos Completos en Liga Top 10 & Banner Beta Abierta
   ============================================================================ */
.rank-row {
  gap: 8px;
  padding: 8px 9px;
}

.rank-avatar {
  width: 42px;
  height: 42px;
}

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rank-name-line {
  display: block;
  width: 100%;
  min-width: 0;
}

.rank-name-line .rank-name {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.rank-badge-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.rank-badge-line .player-badge-chip {
  font-size: 9px;
  padding: 0.5px 5.5px;
  line-height: 1.35;
}

.rank-meta-line {
  margin-top: 0;
  gap: 5px;
}

.rank-right {
  min-width: 74px;
}

.beta-public-banner {
  background: linear-gradient(135deg, #FFF5E6 0%, #FFE8CC 100%);
  border: 1.5px solid #F4A261;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}

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

.beta-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2B1D14;
  color: #FFE066;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
}

.beta-free-tag {
  font-size: 10.5px;
  font-weight: 900;
  color: #1E6B34;
  background: #D3F9D8;
  border: 1px solid #8CE99A;
  padding: 2px 8px;
  border-radius: 999px;
}

.beta-public-banner p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #4A331E;
}
