/*
 * Plant Clicker v21 · Estilo "Jardín nocturno"
 * Capa de diseño que se carga DESPUÉS de tailwind.css y style.css.
 * Respeta las variables de tema (--theme-color, --panel-bg, ...) para que los 8 temas sigan funcionando.
 */

:root {
    --font-ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
    --radius-card: 16px;
    --radius-pill: 999px;
    --surface-1: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-line: rgba(255, 255, 255, 0.07);
    --text-soft: #a3b1a9;
    --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- Tipografía ---------- */
body {
    font-family: var(--font-ui);
    letter-spacing: 0.005em;
}

h1, h2, h3, .tab-btn, #scoreDisplay, #levelBadge, .font-black {
    font-family: var(--font-display);
}

.font-mono {
    font-family: var(--font-display) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

/* Legibilidad: los textos diminutos suben un escalón */
.text-\[7px\] { font-size: 9px !important; }
.text-\[8px\] { font-size: 10px !important; }
.text-\[9px\] { font-size: 10.5px !important; }
.text-\[10px\] { font-size: 11px !important; }

/* ---------- Fondo ---------- */
body[data-theme].bg-gradient-animate,
body.bg-gradient-animate {
    background:
        radial-gradient(900px 640px at 18% 38%, var(--theme-color-glow-heavy) -60%, transparent 62%),
        radial-gradient(700px 520px at 88% 100%, rgba(99, 102, 241, 0.10), transparent 65%),
        linear-gradient(165deg, #07110d 0%, #060b10 55%, #08070f 100%);
    background-size: 100% 100%;
    animation: none;
}

/* ---------- Panel de la planta ---------- */
#plant-section {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.28) 100%) !important;
    border-color: var(--surface-line) !important;
}

#plant-section h1 {
    font-size: 15px;
    letter-spacing: 0.14em;
    font-weight: 700;
}

/* Halo tipo "luna" detrás de la planta + suelo con sombra suave */
.plant-halo {
    width: min(78%, 22rem) !important;
    height: auto !important;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 50% 50%, var(--theme-color-glow-heavy) 0%, var(--theme-color-glow) 42%, transparent 68%) !important;
    border-radius: 9999px;
}
.plant-halo::after {
    content: "";
    position: absolute;
    inset: 14%;
    border-radius: inherit;
    border: 1px dashed rgba(255, 255, 255, 0.07);
    animation: haloSpin 60s linear infinite;
}
@keyframes haloSpin { to { transform: rotate(360deg); } }

#plantBtn {
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45)) !important;
}

#levelBadge {
    border-radius: var(--radius-pill) !important;
    padding: 3px 10px !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--surface-line);
    color: #e5efe9 !important;
    font-size: 11px !important;
    font-weight: 600;
}

#prestigeBadge {
    border-radius: var(--radius-pill) !important;
    padding: 3px 10px !important;
}

/* ---------- Paneles de cristal ---------- */
.glass-panel {
    border-radius: 20px;
    border-color: var(--surface-line) !important;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 24px var(--theme-color-glow) !important;
}

#scoreDisplay {
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-shadow: 0 2px 18px var(--theme-color-glow-heavy);
}

#currency-label {
    font-family: var(--font-display);
    letter-spacing: 0.22em !important;
    font-weight: 600 !important;
}

.stat-chip {
    background: var(--surface-1);
    border-color: var(--surface-line);
    padding: 0.3rem 0.75rem;
    font-size: 12px;
}

.phase-track {
    height: 8px;
}

/* ---------- Zona de la tienda ---------- */
.tab-panel-container {
    border-left-color: var(--surface-line) !important;
}

.tab-nav {
    background: rgba(0, 0, 0, 0.22) !important;
    border-bottom-color: var(--surface-line) !important;
    gap: 6px !important;
    padding-inline: 12px !important;
}

.tab-btn {
    border-radius: var(--radius-pill) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    padding-inline: 14px !important;
    color: var(--text-soft) !important;
    border: 1px solid transparent !important;
}

.tab-btn:hover:not(.tab-active) {
    background: var(--surface-2) !important;
    color: #fff !important;
}

.tab-active {
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 6px 18px -6px var(--glow-color) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

/* Tarjetas de compra (edificios, tecnología, mejoras) */
.glass-button {
    border-radius: var(--radius-card) !important;
    background: var(--surface-1);
    border: 1px solid var(--surface-line);
}

.glass-button h3 {
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

.building-icon-container {
    border-radius: 14px !important;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.14), transparent 60%),
        var(--theme-color-glow) !important;
    border: 1px solid var(--surface-line) !important;
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25) !important;
}

.item-affordable {
    background: linear-gradient(100deg, var(--theme-color-glow) 0%, rgba(255, 255, 255, 0.035) 55%) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 22px -14px var(--glow-color) !important;
}

.item-affordable:hover {
    transform: translateY(-2px);
    border-color: var(--theme-color) !important;
}

.item-expensive {
    opacity: 0.62 !important;
    filter: saturate(0.6);
}

/* Precio como "pastilla" */
[id^="price-build-"],
[id^="price-tech-"],
[id^="price-upgrade-"] {
    font-family: var(--font-display) !important;
    font-size: 13px !important;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--surface-line);
    white-space: nowrap;
    filter: none !important;
}

/* Selector x1 / x10 / x100 / MAX como control segmentado */
[id^="buy-qty-"] {
    border-radius: var(--radius-pill) !important;
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    min-width: 46px;
}

.stat-box {
    border-radius: var(--radius-card) !important;
    background: var(--surface-1) !important;
    border-color: var(--surface-line) !important;
}

/* Modales */
#tutorialModal > .glass-panel,
#authModal > .glass-panel,
#cheaterModal > .glass-panel,
#sponsorModal > .glass-panel,
#offlineModal > .offline-content {
    border-radius: 24px !important;
}

/* Pantalla de carga */
#loading-overlay h1 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.18em;
}

/* Barra de desplazamiento */
::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
}

@media (prefers-reduced-motion: reduce) {
    .plant-halo::after { animation: none; }
}

@media (max-width: 767px) {
    .glass-button h3 { font-size: 14px !important; }
    .tab-btn { font-size: 12px !important; }
}

/* ---------- Nombre de la planta bajo el contador ---------- */
.phase-plant-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: #e5efe9;
    letter-spacing: 0.01em;
}

/* ---------- Evolución de la planta ---------- */
#plantBtn.stage-up .plant-art {
    animation: stageGrow 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes stageGrow {
    0% { transform: scale(0.82); filter: brightness(1.8); }
    60% { transform: scale(1.06); filter: brightness(1.2); }
    100% { transform: scale(1); filter: none; }
}
#plantBtn.stage-up::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 9999px;
    border: 3px solid var(--theme-color-hover);
    box-shadow: 0 0 30px var(--theme-color);
    animation: stageRing 1.2s ease-out forwards;
    pointer-events: none;
}
@keyframes stageRing {
    0% { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}

.stage-toast {
    position: fixed;
    left: 50%;
    top: max(16px, env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 12px;
    min-width: min(92vw, 300px);
    max-width: 92vw;
    pointer-events: none;
    background: rgba(8, 16, 12, 0.94) !important;
    animation: stageToastIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stage-toast.is-leaving {
    opacity: 0;
    transform: translate(-50%, -16px);
}
@keyframes stageToastIn {
    from { opacity: 0; transform: translate(-50%, -24px) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.stage-toast-art {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 14px;
    background: radial-gradient(circle, var(--theme-color-glow-heavy), transparent 70%);
}
.stage-toast-title {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-color-hover);
}
.stage-toast-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}
.stage-toast-phase,
.stage-toast-note {
    font-size: 12px;
    color: var(--text-soft);
}
.stage-toast-note {
    color: #fde68a;
}

/* ---------- Álbum de plantas ---------- */
.album-section-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}
.album-card {
    position: relative;
    border-radius: var(--radius-card);
    padding: 8px 8px 10px;
    background: var(--surface-1);
    border: 1px solid var(--surface-line);
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.album-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color);
}
.album-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 45%, var(--theme-color-glow-heavy), transparent 70%);
}
.album-card.is-locked img {
    filter: brightness(0) saturate(0);
    opacity: 0.35;
    background: rgba(0, 0, 0, 0.25);
}
.album-card.is-current {
    border-color: var(--theme-color);
    box-shadow: 0 0 18px -4px var(--glow-color);
}
.album-num {
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.album-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f2;
    line-height: 1.2;
}
.album-card.is-locked .album-name {
    color: #6b7c72;
}
.album-hint {
    margin-top: 2px;
    font-size: 10.5px;
    color: #8a978f;
}

@media (prefers-reduced-motion: reduce) {
    #plantBtn.stage-up .plant-art,
    #plantBtn.stage-up::after,
    .stage-toast { animation: none; }
}

/* ---------- v21.3 · Regalo diario y premio del álbum ---------- */
.daily-chip {
    position: relative;
    cursor: pointer;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.2s ease;
}
.daily-chip:hover { border-color: var(--theme-color); }
.daily-chip:active { transform: scale(0.94); }
.daily-chip-dot {
    display: none;
    position: absolute;
    top: -3px;
    right: -3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #facc15;
    border: 1px solid #000;
}
.daily-chip.is-ready { border-color: rgba(250, 204, 21, 0.6); box-shadow: 0 0 14px -4px rgba(250, 204, 21, 0.8); }
.daily-chip.is-ready .daily-chip-dot { display: block; animation: daily-pulse 1.6s ease-in-out infinite; }
@keyframes daily-pulse { 50% { transform: scale(1.35); opacity: 0.7; } }

#dailyModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20001;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}
.daily-panel {
    position: relative;
    width: 100%;
    max-width: 30rem;
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(250, 204, 21, 0.25);
    box-shadow: 0 0 50px -10px rgba(250, 204, 21, 0.35);
    animation: daily-in 0.35s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes daily-in { from { transform: scale(0.85); opacity: 0; } }
.daily-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-soft);
    background: var(--surface-1);
    /* Por encima del icono animado de cada ventana (🎁, la plaga…): su animación lo pintaba encima
       de la mitad de abajo de la X y había que tocar varias veces para cerrar. */
    z-index: 5;
}
.daily-close::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; } /* zona de toque más grande */
.daily-close:hover { color: #fff; background: var(--surface-2); }
.daily-gift { font-size: 3rem; line-height: 1; animation: bob-gift 2.4s ease-in-out infinite; }
@keyframes bob-gift { 50% { transform: translateY(-6px) rotate(-4deg); } }
.daily-title {
    margin-top: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}
.daily-sub { margin-top: 0.25rem; font-size: 0.82rem; color: var(--text-soft); }
.daily-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.9rem 0;
    font-size: 0.8rem;
    color: #e5e7eb;
}
.daily-stats span:last-child { color: var(--text-soft); }
.daily-track {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.daily-day {
    padding: 8px 2px;
    border-radius: 12px;
    background: var(--surface-1);
    border: 1px solid var(--surface-line);
    min-width: 0;
}
.daily-day-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); }
.daily-day-icon { font-size: 1.35rem; margin: 2px 0; }
.daily-day-value { font-size: 10px; color: #d1d5db; white-space: nowrap; }
.daily-day.is-done { opacity: 0.55; }
.daily-day.is-today {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    box-shadow: 0 0 16px -4px rgba(250, 204, 21, 0.7);
}
.daily-day:last-child .daily-day-icon { font-size: 1.6rem; }
.daily-message { margin: 1rem 0 0.9rem; font-size: 0.95rem; color: #e5e7eb; min-height: 1.4em; }
.daily-amount { color: #facc15; }
.daily-broken { margin-top: 0.35rem; font-size: 0.78rem; color: #fca5a5; }
.daily-claim {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #1a1300;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    box-shadow: 0 8px 22px -8px rgba(245, 158, 11, 0.8);
    transition: transform 0.15s ease, filter 0.2s ease;
}
.daily-claim:hover:not(:disabled) { filter: brightness(1.08); }
.daily-claim:active:not(:disabled) { transform: scale(0.97); }
.daily-claim:disabled { cursor: default; color: var(--text-soft); background: var(--surface-2); box-shadow: none; }
@media (max-width: 420px) {
    .daily-track { gap: 4px; }
    .daily-day-value { font-size: 9px; }
    .daily-day-icon { font-size: 1.1rem; }
}

.album-bonus {
    font-size: 12px;
    font-weight: 700;
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.25);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .daily-panel, .daily-gift, .daily-chip.is-ready .daily-chip-dot { animation: none; }
}

/* ---------- v21.4 · Tarjetas de edificios, pestañas y avisos ---------- */
.build-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px 14px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.build-card:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 2px; }
.build-icon {
    position: relative;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
}
.item-affordable .build-icon { animation: build-ready 2.6s ease-in-out infinite; }
@keyframes build-ready { 50% { box-shadow: inset 0 -6px 12px rgba(0,0,0,.25), 0 0 16px -4px var(--glow-color); } }
.build-count {
    position: absolute;
    right: -6px;
    bottom: -6px;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #0b1410;
    border: 1px solid var(--theme-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.build-count.is-zero { display: none; }
.build-body { flex: 1; min-width: 0; }
.build-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.build-name {
    margin: 0;
    color: #f3f7f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.build-desc {
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.build-meta { margin-top: 5px; justify-content: flex-start; }
.build-cps {
    font-size: 11px;
    font-weight: 700;
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    padding: 1px 8px;
    border-radius: var(--radius-pill);
}
.build-qty { font-size: 11px; font-weight: 700; color: #fde68a; }
.build-price {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--surface-line);
}
.build-price.is-ok { color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
.build-price.is-short { color: #fca5a5; }
.build-currency { font-size: 12px; }
.build-price [id^="price-"] {
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
}
.build-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
}
.build-progress > div {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.4s ease;
}
.item-affordable .build-progress > div { box-shadow: 0 0 8px var(--glow-color); }
.build-card.item-expensive { opacity: 0.72 !important; filter: saturate(0.7); }
.build-locked {
    cursor: default;
    opacity: 0.5;
    border-style: dashed !important;
    background: transparent !important;
}
.build-silhouette { filter: brightness(0); opacity: 0.55; }
@media (max-width: 480px) {
    .build-card { gap: 12px; padding: 10px 12px 12px; }
    .build-icon { width: 46px; height: 46px; font-size: 26px; }
    .build-price { font-size: 13px; padding: 2px 8px; }
}

/* Pestañas con icono */
.tab-icon { font-size: 14px; line-height: 1; }
.tab-btn:not(.tab-active) .tab-icon { filter: saturate(0.6); opacity: 0.85; }

/* El aviso de evolución no tapa las pestañas: en pantallas grandes sale sobre la planta */
@media (min-width: 768px) {
    .stage-toast { left: calc(100% * 5 / 24); top: 72px; }
}
@media (min-width: 1024px) {
    .stage-toast { left: calc(100% / 6); }
}

@media (prefers-reduced-motion: reduce) {
    .item-affordable .build-icon { animation: none; }
}
.item-affordable .build-progress { opacity: 0; }

/* Móvil: el anillo de cursores más pequeño para no tapar el contador de biomasa */
@media (max-width: 639px) {
    :root { --orbit-radius: 72px; }
    .orbiting-cursor { font-size: 14px; }
}

/* ---------- v21.5 · Tecnología, mejoras, logros y ranking ---------- */
.build-desc-wrap { white-space: normal; }
.build-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    color: #d1fae5;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--surface-line);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.build-tag.tag-click { color: #fde68a; background: rgba(250, 204, 21, 0.1); border-color: rgba(250, 204, 21, 0.2); }
.build-tag.tag-global { color: #a5f3fc; background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.2); }
.build-tag.tag-building { color: #86efac; background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.2); }
.build-count:not(.is-zero) { white-space: nowrap; }

/* Logros */
.ach-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-card);
    background: var(--surface-1);
    border: 1px solid var(--surface-line);
    transition: transform 0.18s ease, border-color 0.2s ease;
}
.ach-head { display: flex; align-items: flex-start; gap: 12px; }
.ach-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}
.ach-name { margin: 0; font-size: 14.5px; font-weight: 600; color: #f3f7f4; }
.ach-desc { margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: var(--text-soft); }
.ach-status {
    margin-top: auto;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
}
.ach-reward { color: #86efac; text-transform: none; letter-spacing: 0; }
.ach-reward.is-karma { color: #d8b4fe; }
.ach-card.is-claimable {
    border-color: rgba(250, 204, 21, 0.55);
    background: linear-gradient(160deg, rgba(250, 204, 21, 0.12), rgba(255, 255, 255, 0.03) 60%);
    box-shadow: 0 0 22px -10px rgba(250, 204, 21, 0.8);
}
.ach-card.is-claimable .ach-icon { background: rgba(250, 204, 21, 0.15); animation: bob-gift 2.4s ease-in-out infinite; }
.ach-card.is-claimable .ach-name { color: #fde047; }
.ach-claim {
    margin-top: auto;
    width: 100%;
    padding: 7px 10px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a1300;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    transition: filter 0.2s ease, transform 0.15s ease;
}
.ach-claim:hover { filter: brightness(1.08); }
.ach-claim:active { transform: scale(0.98); }
.ach-claim .ach-reward { color: #3b2500; }
.ach-card.is-claimed { border-color: rgba(34, 197, 94, 0.3); }
.ach-card.is-claimed .ach-status { color: #4ade80; background: rgba(34, 197, 94, 0.08); }
.ach-card.is-locked { opacity: 0.55; }
.ach-card.is-locked .ach-icon { filter: grayscale(1); opacity: 0.6; }
.ach-card.is-locked .ach-name { color: #8a978f; }
.ach-claim-all {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 700;
    color: #1a1300;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    box-shadow: 0 6px 16px -8px rgba(245, 158, 11, 0.9);
}

/* Ranking sin sesión / vacío */
.lb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
    border-radius: var(--radius-card);
    background: var(--surface-1);
    border: 1px dashed var(--surface-line);
}
.lb-empty-icon { font-size: 44px; animation: bob-gift 2.6s ease-in-out infinite; }
.lb-empty-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: #f3f7f4; }
.lb-empty-desc { max-width: 22rem; font-size: 12.5px; color: var(--text-soft); }
.lb-empty-btn {
    margin-top: 6px;
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 8px 20px -10px var(--glow-color);
    transition: filter 0.2s ease;
}
.lb-empty-btn:hover { filter: brightness(1.1); }

@media (prefers-reduced-motion: reduce) {
    .ach-card.is-claimable .ach-icon, .lb-empty-icon { animation: none; }
}

/* Bendiciones celestiales (tienda de karma) */
.cosmic-shop.item-affordable {
    background: linear-gradient(100deg, rgba(168, 85, 247, 0.16) 0%, rgba(255, 255, 255, 0.03) 55%) !important;
    border-color: rgba(168, 85, 247, 0.45) !important;
    box-shadow: 0 8px 22px -14px rgba(168, 85, 247, 0.9) !important;
}
.cosmic-shop.item-affordable:hover { border-color: #a855f7 !important; }
.cosmic-icon {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.14), transparent 60%), rgba(88, 28, 135, 0.45);
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}
.cosmic-shop .build-name { color: #e9d5ff; }
.cosmic-shop .build-price.is-ok { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.45); }
.cosmic-shop .build-progress > div { background: linear-gradient(90deg, #a855f7, #6366f1); }
.cosmic-shop.is-owned { opacity: 0.6; }
.is-owned-pill { color: #4ade80; font-size: 12px; border-color: rgba(74, 222, 128, 0.3); }

/* Sin jugadores que mostrar: se oculta la cabecera de la tabla */
.lb-header:has(+ #leaderboardList > .lb-empty) { display: none !important; }

/* ---------- v21.6 · Constelaciones, Viajar y Ajustes ---------- */
/* Fondo estrellado hecho con CSS (sin imágenes externas, funciona sin conexión) */
.cosmic-backdrop {
    background:
        radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
        radial-gradient(1px 1px at 68% 8%, rgba(255,255,255,.45), transparent 60%),
        radial-gradient(1.5px 1.5px at 84% 42%, rgba(216,180,254,.6), transparent 60%),
        radial-gradient(1px 1px at 32% 64%, rgba(255,255,255,.4), transparent 60%),
        radial-gradient(1px 1px at 52% 86%, rgba(255,255,255,.35), transparent 60%),
        radial-gradient(1.5px 1.5px at 6% 92%, rgba(165,180,252,.5), transparent 60%),
        radial-gradient(ellipse at 80% 0%, rgba(168, 85, 247, 0.14), transparent 55%),
        radial-gradient(ellipse at 0% 100%, rgba(99, 102, 241, 0.12), transparent 55%),
        rgba(0, 0, 0, 0.35);
    background-size: 220px 220px, 260px 260px, 300px 300px, 240px 240px, 280px 280px, 320px 320px, 100% 100%, 100% 100%, auto;
}
.cosmic-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}
.cosmic-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    background: linear-gradient(90deg, #e9d5ff, #f9a8d4, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.cosmic-chips { display: flex; gap: 6px; }
.cosmic-chip {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: #e9d5ff;
    background: rgba(88, 28, 135, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.cosmic-sub { margin: 0; font-size: 12.5px; color: var(--text-soft); max-width: 46rem; }

/* Tarjetas de constelación */
.const-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(170deg, rgba(76, 29, 149, 0.22), rgba(10, 10, 25, 0.5));
    border: 1px solid rgba(168, 85, 247, 0.18);
}
.const-card.is-complete {
    border-color: rgba(216, 180, 254, 0.55);
    box-shadow: 0 0 30px -10px rgba(168, 85, 247, 0.8);
}
.const-head { display: flex; align-items: center; gap: 12px; }
.const-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.16), transparent 60%), rgba(88, 28, 135, 0.5);
    border: 1px solid rgba(168, 85, 247, 0.4);
}
.const-name { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: #ede9fe; }
.const-desc { margin: 2px 0 0; font-size: 11.5px; color: var(--text-soft); }
.const-count {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    color: #e9d5ff;
    background: rgba(88, 28, 135, 0.45);
    border: 1px solid rgba(168, 85, 247, 0.35);
}
.cmap {
    width: 100%;
    height: 84px;
    border-radius: 14px;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.cmap-line { stroke: rgba(196, 181, 253, 0.25); stroke-width: 0.9; stroke-dasharray: 1.5 1.5; }
.cmap-line.is-lit { stroke: rgba(233, 213, 255, 0.85); stroke-dasharray: none; filter: drop-shadow(0 0 1.5px #c084fc); }
.cmap-halo { fill: rgba(168, 85, 247, 0.08); }
.cmap-core { fill: rgba(196, 181, 253, 0.45); }
.cmap-star.is-lit .cmap-halo { fill: rgba(250, 204, 21, 0.22); }
.cmap-star.is-lit .cmap-core { fill: #fde68a; filter: drop-shadow(0 0 2px #facc15); }
.cmap-star.is-next .cmap-halo { fill: rgba(168, 85, 247, 0.3); animation: cmap-pulse 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cmap-star.is-next .cmap-core { fill: #e9d5ff; }
@keyframes cmap-pulse { 50% { transform: scale(1.5); opacity: 0.4; } }

.const-stars { display: flex; flex-direction: column; gap: 6px; }
.cstar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.cstar-node {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #c4b5fd;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.cstar-body { flex: 1; min-width: 0; }
.cstar-name { margin: 0; font-size: 13px; font-weight: 700; color: #f5f3ff; }
.cstar-desc { margin: 1px 0 0; font-size: 11px; line-height: 1.3; color: var(--text-soft); }
.cstar-action { flex-shrink: 0; text-align: right; }
.cstar-done { font-size: 11.5px; font-weight: 700; color: #fde68a; }
.cstar-locked { font-size: 11px; color: #6b6585; }
.cstar-btn {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    box-shadow: 0 6px 16px -8px rgba(168, 85, 247, 0.9);
    white-space: nowrap;
    transition: filter 0.2s ease, transform 0.15s ease;
}
.cstar-btn:hover { filter: brightness(1.12); }
.cstar-btn:active { transform: scale(0.96); }
.cstar-cost { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; font-weight: 700; color: #fca5a5; }
.cstar-cost small { font-size: 10px; font-weight: 600; color: var(--text-soft); max-width: 9rem; }
.cstar-bar { width: 84px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cstar-bar > div { height: 100%; background: linear-gradient(90deg, #a855f7, #6366f1); }
.cstar.is-lit { background: rgba(250, 204, 21, 0.06); border-color: rgba(250, 204, 21, 0.2); }
.cstar.is-lit .cstar-node { border-color: rgba(250, 204, 21, 0.5); background: rgba(250, 204, 21, 0.12); }
.cstar.is-ready { border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.1); }
.cstar.is-next .cstar-node, .cstar.is-ready .cstar-node { color: #fff; border-color: #a855f7; }
.cstar.is-locked { opacity: 0.45; }
.const-bonus {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(168, 85, 247, 0.25);
}
.const-bonus-title { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #c4b5fd; }
.const-bonus-desc { margin-top: 3px; font-size: 11.5px; color: #8b86a3; }
.const-bonus.is-active { border-style: solid; border-color: rgba(74, 222, 128, 0.35); background: rgba(34, 197, 94, 0.08); }
.const-bonus.is-active .const-bonus-desc { color: #86efac; font-weight: 600; }

/* Viajar */
.travel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--surface-line);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.travel-card.is-earth { background: linear-gradient(170deg, rgba(22, 101, 52, 0.35), rgba(5, 15, 10, 0.6)); }
.travel-card.is-cosmos { background: linear-gradient(170deg, rgba(76, 29, 149, 0.35), rgba(8, 6, 20, 0.65)); }
.travel-card:hover:not(.is-locked) { transform: translateY(-3px); }
.travel-card:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 3px; }
.travel-card.is-earth.is-active { border-color: rgba(74, 222, 128, 0.55); box-shadow: 0 0 30px -12px rgba(34, 197, 94, 0.9); }
.travel-card.is-cosmos.is-active { border-color: rgba(192, 132, 252, 0.6); box-shadow: 0 0 30px -12px rgba(168, 85, 247, 0.9); }
.travel-card.is-locked { cursor: default; }
.travel-card.is-locked .travel-art img { filter: brightness(0) saturate(0); opacity: 0.35; }
.travel-art {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), transparent 65%);
}
.travel-art img { height: 100%; width: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); transition: transform 0.3s ease; }
.travel-card:hover:not(.is-locked) .travel-art img { transform: scale(1.05) rotate(-2deg); }
.travel-info { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.travel-name { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff; }
.travel-card.is-earth .travel-name { color: #86efac; }
.travel-card.is-cosmos .travel-name { color: #d8b4fe; }
.travel-desc { margin: 0; font-size: 12px; color: var(--text-soft); }
.travel-phase { font-size: 12px; font-weight: 600; color: #e5e7eb; }
.travel-stats { padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.travel-label { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.travel-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: #fff; }
.travel-rate { font-size: 12px; color: #86efac; }
.travel-card.is-cosmos .travel-rate { color: #d8b4fe; }
.travel-portal { color: #c4b5fd; }
.travel-portal-fill { background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899) !important; }
.travel-action {
    padding: 9px 12px;
    border-radius: 14px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.travel-action.is-current { color: #86efac; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35); }
.is-cosmos .travel-action.is-current { color: #d8b4fe; background: rgba(168, 85, 247, 0.14); border-color: rgba(168, 85, 247, 0.4); }
.travel-action.is-go { color: #fff; background: var(--accent-gradient); }
.is-cosmos .travel-action.is-go { background: linear-gradient(135deg, #a855f7, #6366f1); }
.travel-action.is-locked { color: #fca5a5; background: rgba(127, 29, 29, 0.2); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Ajustes */
.settings-nav {
    position: sticky;
    top: -16px;
    z-index: 20;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: -4px -4px 0;
    padding: 8px 4px;
    background: linear-gradient(180deg, rgba(5, 12, 9, 0.95) 70%, transparent);
    scrollbar-width: none;
}
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav button {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--surface-1);
    border: 1px solid var(--surface-line);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.settings-nav button:hover { color: #fff; border-color: var(--theme-color); }
.settings-section {
    scroll-margin-top: 56px;
    border-radius: 20px !important;
    padding: 18px !important;
    background: var(--surface-1) !important;
    border-color: var(--surface-line) !important;
}
.settings-section > div:first-child { border-bottom-color: var(--surface-line) !important; padding-bottom: 10px !important; }
.settings-section h3 {
    font-family: var(--font-display) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
}
.settings-section h3 > span:first-child {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--theme-color-glow);
    border: 1px solid var(--border-color);
    font-size: 15px;
}
.settings-section .bg-black\/30 {
    border-radius: 14px !important;
    background: rgba(0, 0, 0, 0.22) !important;
    border-color: var(--surface-line) !important;
}
.settings-section .text-\[9px\] { font-size: 11px !important; line-height: 1.3 !important; }
.settings-section .text-\[10px\] { font-size: 11.5px !important; }
#btn-sound-toggle, #btn-rain-toggle {
    min-width: 108px;
    border-radius: var(--radius-pill) !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
}
.settings-section input[type="range"] { accent-color: var(--theme-color); }
@media (min-width: 1280px) {
    #settingsPanel > .settings-section, #settingsPanel > .settings-nav { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .cmap-star.is-next .cmap-halo { animation: none; }
    .travel-card, .travel-art img { transition: none; }
}

/* ---------- v21.7 · Distribución en móvil y PC ---------- */

/* Contador de biomasa */
.score-card {
    background:
        linear-gradient(var(--panel-bg), var(--panel-bg)) padding-box,
        linear-gradient(140deg, var(--border-color), rgba(255, 255, 255, 0.04) 45%, var(--border-color)) border-box !important;
    border: 1px solid transparent !important;
    box-shadow: 0 18px 40px -24px var(--glow-color), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
#scoreDisplay { font-family: var(--font-display) !important; font-weight: 700 !important; letter-spacing: -0.01em; }
.brand-leaf { display: none; }
.tab-label-mobile { display: none; }

/* ===== PC y tablet horizontal ===== */
@media (min-width: 768px) {
    #plant-section {
        background:
            radial-gradient(ellipse at 50% 38%, var(--theme-color-glow), transparent 62%),
            linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35)) !important;
    }
    /* Sombra de "suelo" bajo la planta */
    #plantBtn::before {
        content: "";
        position: absolute;
        left: 18%;
        right: 18%;
        bottom: 4%;
        height: 9%;
        border-radius: 50%;
        background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
        z-index: -1;
        pointer-events: none;
    }
    .score-card { min-width: 300px !important; padding: 14px 32px 12px !important; }
    #scoreDisplay { font-size: 44px !important; line-height: 1.1 !important; }
    #currency-label { margin-top: 4px !important; }
    #phase-progress { max-width: 300px !important; }
}

/* Pantallas anchas: la tienda en dos columnas para aprovechar el espacio */
@media (min-width: 1280px) {
    #buildingsList {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        align-items: stretch;
    }
    #buildingsList > .build-card { margin-bottom: 0; }
    #buildingsList > :not(.build-card) { grid-column: 1 / -1; }
    #storeContainer, #achievementsPanel, #wikiPanel, #leaderboardPanel, #prestigePanel, #constellationsPanel, #travelPanel {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}
@media (min-width: 1600px) {
    #buildingsList { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== Móvil ===== */
@media (max-width: 767px) {
    /* Cabecera compacta: solo marca, fase y karma (versión y enlaces siguen en Ajustes y la Wiki) */
    .brand-meta { display: none !important; }
    .brand-leaf { display: inline; }
    .brand-title { font-size: 13px !important; letter-spacing: 0.12em !important; }
    #levelBadge, #prestigeBadge, #header-travel-btn { font-size: 11px !important; padding: 3px 9px !important; border-radius: 999px !important; }

    #plant-section {
        height: 46dvh !important;
        padding: 10px 12px 8px !important;
        background: radial-gradient(ellipse at 50% 42%, var(--theme-color-glow), transparent 65%), rgba(0, 0, 0, 0.2) !important;
    }
    #plantBtn { width: min(52vw, 27dvh) !important; height: min(52vw, 27dvh) !important; }
    .plant-halo { width: min(62vw, 30dvh) !important; }

    /* El contador pierde la caja: número grande y limpio */
    .score-card {
        min-width: 0 !important;
        padding: 0 12px !important;
        overflow: visible !important;
        background: none !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    .score-card > div:first-child { display: none; }
    #scoreDisplay { font-size: 30px !important; line-height: 1.05 !important; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
    #currency-label { font-size: 10px !important; margin-top: 1px !important; }
    .stat-chips { margin-top: 6px !important; }
    .stat-chip { padding: 4px 10px !important; font-size: 12px !important; }
    #phase-progress { max-width: 260px !important; margin-top: 8px !important; }
    #phase-progress .text-\[10px\] { font-size: 11.5px !important; }

    /* Los edificios decorativos del suelo tapaban la barra de fase */
    .ground-building { display: none !important; }

    /* Pestañas como barra inferior de app, al alcance del pulgar */
    #store-section {
        height: 54dvh !important;
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--surface-line);
    }
    .tab-nav {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        height: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 2px !important;
        align-items: stretch !important;
        background: rgba(5, 12, 9, 0.94) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--surface-line);
        border-bottom: 0 !important;
        box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.8);
    }
    .tab-nav .tab-btn {
        flex-direction: column !important;
        justify-content: center;
        gap: 2px !important;
        min-width: 66px;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 4px 8px !important;
        border-radius: 14px !important;
        font-size: 10.5px !important;
        line-height: 1.1;
        box-shadow: none !important;
    }
    .tab-nav .tab-icon { font-size: 21px; }
    .tab-nav .tab-btn.tab-active {
        background: var(--theme-color-glow) !important;
        border-color: var(--border-color) !important;
        color: #fff !important;
    }
    .tab-nav .tab-btn.tab-active .tab-icon { transform: translateY(-1px) scale(1.08); }
    .tab-nav .tab-btn:not(.tab-active) .tab-icon { filter: saturate(0.5); opacity: 0.8; }
    .tab-label-mobile { display: inline; }
    #quick-login-btn {
        flex-shrink: 0;
        align-self: center;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 4px !important;
    }
    #achBadge { top: 4px !important; right: 10px !important; }

    /* Avisos encima de la barra inferior */
    .stage-toast { top: max(10px, env(safe-area-inset-top, 0px)); }
    #achievements-container { top: auto !important; bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; right: 8px !important; left: 8px; width: auto !important; }

    /* Selector de cantidad más compacto */
    #bulkBuySelector { padding: 6px 8px !important; }
    [id^="buy-qty-"] { min-width: 52px !important; min-height: 38px !important; }
}

/* Teléfonos muy pequeños */
@media (max-width: 360px) {
    #scoreDisplay { font-size: 26px !important; }
    .tab-nav .tab-btn { min-width: 58px; font-size: 9.5px !important; }
}

/* Móvil en horizontal: poca altura, se reparte en dos columnas */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 500px) {
    body { flex-direction: row !important; }
    #plant-section { width: 42% !important; height: 100dvh !important; border-bottom: 0 !important; border-right: 1px solid var(--surface-line) !important; }
    #store-section { width: 58% !important; height: 100dvh !important; border-top: 0; }
    .tab-nav { left: 42% !important; }
    #plantBtn { width: 34dvh !important; height: 34dvh !important; }
}

/* Pantallas anchas pero bajas (móvil en horizontal, ventanas pequeñas): todo más compacto */
@media (min-width: 768px) and (max-height: 620px) {
    :root { --orbit-radius: 26dvh; }
    #plant-section { padding: 10px 16px !important; }
    .brand-meta { display: none !important; }
    #plantBtn { width: 40dvh !important; height: 40dvh !important; }
    .plant-halo { width: 52dvh !important; }
    .score-card { min-width: 0 !important; padding: 4px 18px !important; }
    #scoreDisplay { font-size: 26px !important; }
    #currency-label { margin-top: 0 !important; font-size: 9px !important; }
    .stat-chips { margin-top: 4px !important; }
    #phase-progress { margin-top: 6px !important; }
    .ground-building { display: none !important; }
}

/* Tablet vertical: columna de la planta estrecha */
@media (min-width: 768px) and (max-width: 1023px) {
    :root { --orbit-radius: 118px; }
    #plant-section { padding: 16px !important; }
    #plantBtn { width: 220px !important; height: 220px !important; }
    .score-card { min-width: 0 !important; width: 100%; padding: 10px 16px !important; }
    #scoreDisplay { font-size: 34px !important; }
}
#levelBadge, #prestigeBadge { white-space: nowrap; }

/* ---------- v21.8 · Menú "Más" para las pestañas que no caben ---------- */
.tab-nav .tab-overflow { display: none !important; }
.tab-nav { overflow-x: hidden !important; scrollbar-width: none; }
#tab-more .tab-icon { display: inline-block; min-width: 1.1em; text-align: center; }
#tab-more .tab-more-caret { font-size: 9px; opacity: 0.7; transition: transform 0.2s ease; }
#tab-more[aria-expanded="true"] .tab-more-caret { transform: rotate(180deg); }

.tab-more-menu {
    position: fixed;
    z-index: 90;
    min-width: 220px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    display: grid;
    gap: 2px;
    border-radius: 16px;
    background: rgba(8, 16, 12, 0.97);
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: tab-more-in 0.16s ease-out;
}
.tab-more-menu.hidden { display: none; }
@keyframes tab-more-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.tab-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    color: #d1d5db;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}
.tab-more-item:hover, .tab-more-item:focus-visible { background: rgba(255, 255, 255, 0.06); color: #fff; outline: none; }
.tab-more-item.is-active { background: var(--theme-color-glow); color: #fff; box-shadow: inset 0 0 0 1px var(--border-color); }
.tab-more-item.is-login { margin-top: 4px; color: #bbf7d0; background: rgba(34, 197, 94, 0.12); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.25); }
.tab-more-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 17px;
}

@media (max-width: 767px) {
    /* Barra inferior: 4 pestañas + "Más", repartidas a partes iguales */
    .tab-nav { justify-content: space-between; }
    .tab-nav .tab-btn { flex: 1 1 0 !important; min-width: 0 !important; padding: 4px 2px !important; }
    .tab-nav .tab-btn > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #tab-more .tab-more-caret { display: none; }

    /* El menú se abre como una hoja sobre la barra inferior */
    .tab-more-menu {
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
        min-width: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 10px;
        border-radius: 20px;
        animation-name: tab-more-up;
    }
    @keyframes tab-more-up {
        from { opacity: 0; transform: translateY(12px); }
        to { opacity: 1; transform: none; }
    }
    .tab-more-item {
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        min-height: 78px;
        padding: 10px 4px;
        font-size: 11.5px;
        text-align: center;
        background: rgba(255, 255, 255, 0.03);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    .tab-more-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tab-more-item.is-login { margin-top: 0; }
    .tab-more-icon { width: 36px; height: 36px; font-size: 20px; }
}
/* Constelaciones y Viajar llevan "flex" y "hidden" a la vez: que gane "hidden" */
.tab-nav > .hidden { display: none !important; }

/* PC pequeño (1024-1279): la columna de la planta es estrecha, el anillo de cursores se adapta */
@media (min-width: 1024px) and (max-width: 1279px) {
    :root { --orbit-radius: min(150px, calc(16.66vw - 36px)); }
    #plantBtn { width: min(240px, calc(33.33vw - 120px)) !important; height: min(240px, calc(33.33vw - 120px)) !important; }
}

/* ---------- v21.9 · Eventos, misiones, habilidades, jardín y edificios dorados ---------- */

/* Edificios dorados */
.build-gold { font-size: 11px; font-weight: 700; color: #a3a3a3; margin-left: auto; white-space: nowrap; }
.build-gold:empty { display: none; }
.build-gold.is-on { color: #facc15; text-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }
.build-card.is-golden {
    border-color: rgba(250, 204, 21, 0.45) !important;
    background:
        linear-gradient(120deg, rgba(250, 204, 21, 0.1), transparent 45%),
        var(--panel-bg, rgba(0, 0, 0, 0.3)) !important;
}
.build-card.is-golden .build-icon {
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 18px -6px rgba(250, 204, 21, 0.9);
}

/* Eventos del jardín */
.garden-event {
    position: absolute;
    z-index: 100;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 40px;
    line-height: 1;
    pointer-events: auto;
    cursor: pointer;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
    -webkit-tap-highlight-color: transparent;
    animation: garden-event-in 0.4s ease-out, garden-event-drift 3.2s ease-in-out 0.4s infinite;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.garden-event::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    animation: garden-event-ring 1.6s ease-out infinite;
}
.garden-event.ev-butterfly { animation: garden-event-in 0.4s ease-out, garden-event-flutter 2.4s ease-in-out 0.4s infinite; }
.garden-event.ev-aphids::after { border-color: rgba(248, 113, 113, 0.6); }
.garden-event.is-leaving { opacity: 0; transform: scale(0.4); pointer-events: none; }
.garden-event:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes garden-event-in { from { opacity: 0; transform: scale(0.3); } }
@keyframes garden-event-drift { 50% { transform: translate(6px, -10px) rotate(6deg); } }
@keyframes garden-event-flutter {
    25% { transform: translate(14px, -12px) rotate(-8deg) scaleX(0.85); }
    50% { transform: translate(-6px, -20px) rotate(6deg); }
    75% { transform: translate(-14px, -6px) rotate(-4deg) scaleX(0.9); }
}
@keyframes garden-event-ring { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }

/* Avisos de eventos y habilidades */
.feature-toast {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 0px));
    left: 50%;
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(92vw, 380px);
    padding: 10px 16px 10px 12px;
    border-radius: 16px;
    background: rgba(8, 16, 12, 0.94);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.9), 0 0 24px -12px var(--glow-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(-50%);
    pointer-events: none;
    animation: feature-toast-in 0.3s ease-out;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.feature-toast.is-leaving { opacity: 0; transform: translate(-50%, -10px); }
.feature-toast-icon { font-size: 26px; flex-shrink: 0; }
.feature-toast-title { font-size: 13px; font-weight: 800; color: #fff; }
.feature-toast-text { font-size: 12px; color: var(--text-soft, #a3a3a3); margin-top: 1px; }
@keyframes feature-toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }

/* Habilidades activas */
.skill-bar {
    position: absolute;
    left: 12px;
    top: 50%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(-50%);
}
.skill-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.1));
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.skill-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(rgba(0, 0, 0, 0.65) var(--cd, 0%), transparent 0);
    pointer-events: none;
}
.skill-icon { font-size: 24px; position: relative; z-index: 1; }
.skill-lock { display: none; position: absolute; right: 2px; bottom: 1px; font-size: 12px; z-index: 2; }
.skill-time {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    z-index: 2;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 3px #000;
}
.skill-btn.is-ready {
    border-color: var(--border-color);
    box-shadow: 0 0 0 1px var(--border-color), 0 0 18px -4px var(--glow-color);
    animation: skill-ready 2.4s ease-in-out infinite;
}
.skill-btn.is-ready:hover { transform: scale(1.07); }
.skill-btn:active { transform: scale(0.94); }
.skill-btn.is-cooling .skill-icon { opacity: 0.55; }
.skill-btn.is-locked { cursor: help; }
.skill-btn.is-locked .skill-icon { filter: grayscale(1); opacity: 0.35; }
.skill-btn.is-locked .skill-lock { display: block; }
.skill-btn:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 2px; }
@keyframes skill-ready { 50% { box-shadow: 0 0 0 1px var(--border-color), 0 0 26px -2px var(--glow-color); } }

/* Efectos activos */
.buff-bar {
    position: absolute;
    left: 50%;
    top: 46px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: max-content;
    max-width: calc(100% - 24px);
    transform: translateX(-50%);
    pointer-events: none;
}
.buff-bar.is-empty { display: none; }
.buff-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 6px;
    border-radius: 999px;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(250, 204, 21, 0.45);
    box-shadow: 0 0 16px -6px rgba(250, 204, 21, 0.9);
    overflow: hidden;
    animation: garden-event-in 0.3s ease-out;
}
.buff-chip::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #facc15 var(--left, 100%), rgba(255, 255, 255, 0.12) 0);
}
.buff-chip b { font-weight: 800; color: #fde68a; }
.buff-click { border-color: rgba(96, 165, 250, 0.5); box-shadow: 0 0 16px -6px rgba(96, 165, 250, 0.9); }
.buff-click b { color: #bfdbfe; }
.buff-auto { border-color: rgba(74, 222, 128, 0.5); }
.buff-auto b { color: #bbf7d0; }
.buff-time { font-size: 11px; color: #d1d5db; font-variant-numeric: tabular-nums; }

/* Planta del jardín en exhibición */
.garden-decor {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 15;
    width: 64px;
    height: 64px;
    cursor: pointer;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
    animation: garden-decor-bob 4s ease-in-out infinite;
}
.garden-decor[hidden] { display: none; }
@keyframes garden-decor-bob { 50% { transform: translateY(-4px) rotate(-2deg); } }

/* Chip y ventana de misiones */
.missions-chip { position: relative; gap: 4px !important; }
.missions-chip-count { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.missions-chip.is-ready { border-color: rgba(250, 204, 21, 0.6); box-shadow: 0 0 14px -4px rgba(250, 204, 21, 0.8); }
.missions-chip.is-ready .daily-chip-dot { display: block; animation: daily-pulse 1.6s ease-in-out infinite; }

#missionsModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20001;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}
.missions-panel { max-height: calc(100dvh - 32px); overflow-y: auto; border-color: var(--border-color) !important; box-shadow: 0 0 50px -10px var(--glow-color) !important; }
.missions-x2 { margin-top: 0.4rem; font-size: 0.75rem; font-weight: 700; color: #c4b5fd; }
.missions-list { display: grid; gap: 8px; margin-top: 1rem; text-align: left; }
.mission-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--surface-1, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.08));
}
.mission-row.is-ready { border-color: rgba(250, 204, 21, 0.55); background: rgba(250, 204, 21, 0.07); }
.mission-row.is-claimed { opacity: 0.6; }
.mission-icon { font-size: 24px; flex-shrink: 0; width: 36px; text-align: center; }
.mission-body { flex: 1; min-width: 0; }
.mission-text { font-size: 13px; font-weight: 700; color: #fff; }
.mission-bar { height: 6px; margin: 6px 0 4px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mission-bar > div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--theme-color), #facc15); transition: width 0.4s ease; }
.mission-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-soft, #a3a3a3); }
.mission-meta span:first-child { font-variant-numeric: tabular-nums; }
.mission-action { flex-shrink: 0; }
.mission-claim {
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #1a1300;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    transition: transform 0.15s ease, filter 0.2s ease;
}
.mission-claim:hover:not(:disabled) { filter: brightness(1.08); }
.mission-claim:active:not(:disabled) { transform: scale(0.95); }
.mission-claim:disabled { color: var(--text-soft, #a3a3a3); background: var(--surface-2, rgba(255, 255, 255, 0.08)); cursor: default; }
.mission-done { font-size: 12px; font-weight: 800; color: #4ade80; white-space: nowrap; }
.mission-bonus { margin-top: 12px; font-size: 0.85rem; color: #d1d5db; }
.mission-bonus.is-claimed { color: #4ade80; font-weight: 700; }
.missions-renew { margin-top: 10px; font-size: 0.75rem; color: var(--text-soft, #a3a3a3); }
@media (max-width: 420px) {
    .mission-row { gap: 10px; padding: 9px 10px; }
    .mission-meta { flex-direction: column; gap: 1px; }
}

/* Jardín de macetas (pestaña Ascenso) */
.garden-section {
    margin: 0 0 24px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(74, 222, 128, 0.22);
}
.garden-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.garden-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.garden-desc { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--text-soft, #a3a3a3); }
.garden-full { margin-top: 10px; }
.garden-next {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.1);
    border: 1px dashed rgba(74, 222, 128, 0.35);
}
.garden-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
@media (min-width: 1280px) { .garden-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 420px) { .garden-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.garden-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 8px 4px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.08));
    text-align: center;
    transition: transform 0.15s ease, border-color 0.2s ease;
}
button.garden-slot:hover { transform: translateY(-2px); border-color: rgba(74, 222, 128, 0.45); }
.garden-slot img { width: 54px; height: 54px; object-fit: contain; }
.garden-slot.is-cosmos { background: rgba(88, 28, 135, 0.25); }
.garden-slot.is-fav { border-color: #facc15; box-shadow: 0 0 16px -6px rgba(250, 204, 21, 0.9); }
.garden-fav { position: absolute; top: 4px; right: 6px; font-size: 12px; }
.garden-name { max-width: 100%; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.garden-meta { font-size: 10px; color: #86efac; white-space: nowrap; }
.garden-slot.is-empty { justify-content: center; min-height: 104px; border-style: dashed; color: var(--text-soft, #737373); font-size: 10px; }
.garden-pot { font-size: 26px; opacity: 0.35; filter: grayscale(1); }

@media (max-width: 767px) {
    .skill-bar { left: 8px; gap: 8px; }
    .skill-btn { width: 42px; height: 42px; border-radius: 14px; }
    .skill-icon { font-size: 20px; }
    .buff-bar { top: 40px; }
    .buff-chip { font-size: 11px; padding: 3px 8px 5px; }
    .garden-decor { width: 44px; height: 44px; right: 10px; bottom: auto; top: 50%; margin-top: -22px; }
    .garden-event { width: 56px; height: 56px; font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    .garden-event, .garden-event::after, .garden-decor, .skill-btn.is-ready { animation: none; }
}

/* ============================================================
   v22.0: ranking semanal, novedades, temporadas, logros secretos
   ============================================================ */
.extra-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20002;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}
.extra-panel { max-height: calc(100dvh - 32px); overflow-y: auto; border-color: var(--border-color) !important; box-shadow: 0 0 50px -10px var(--glow-color) !important; }
.news-list { margin: 1rem 0 1.1rem; text-align: left; display: grid; gap: 14px; }
.news-version { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--theme-color); margin-bottom: 6px; }
.news-block ul { display: grid; gap: 7px; padding: 0; list-style: none; }
.news-block li {
    font-size: 13px;
    line-height: 1.45;
    color: #e5e7eb;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--surface-1, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.08));
}
.news-block li b { color: #fff; }
.news-settings-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--surface-1, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.1));
}
.news-settings-btn:hover { background: var(--surface-2, rgba(255, 255, 255, 0.09)); }

/* Ranking: pestañas Total / Semanal */
.lb-mode-bar {
    display: inline-flex;
    align-self: flex-start;
    gap: 4px;
    padding: 4px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.08));
}
.lb-mode-btn { padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--text-soft, #a3a3a3); transition: background 0.2s ease, color 0.2s ease; }
.lb-mode-btn:hover { color: #fff; }
.lb-mode-btn.is-active { color: #04140a; background: var(--theme-color); }
.lb-header.lb-header-off { display: none !important; }
.lb-weekly-info {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-soft, #a3a3a3);
    background: var(--surface-1, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--surface-line, rgba(255, 255, 255, 0.08));
}
.lb-weekly-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; color: #fff; font-size: 13px; }
.lb-weekly-head span { color: var(--theme-color); font-weight: 700; font-size: 12px; }
.lb-weekly-mine { margin-top: 6px; color: #fff; font-weight: 700; }
.lb-week-row {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.lb-week-row.is-top1 { background: rgba(113, 63, 18, 0.25); border-color: rgba(234, 179, 8, 0.5); }
.lb-week-row.is-top2 { background: rgba(31, 41, 55, 0.4); border-color: rgba(156, 163, 175, 0.3); }
.lb-week-row.is-top3 { background: rgba(120, 53, 15, 0.2); border-color: rgba(180, 83, 9, 0.3); }
.lb-week-rank { font-family: ui-monospace, monospace; font-weight: 800; color: #d1d5db; white-space: nowrap; }
.lb-week-row.is-top1 .lb-week-rank { color: #facc15; }
.lb-week-name { font-weight: 700; color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-week-you { font-size: 8px; background: #16a34a; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.1em; vertical-align: middle; }
.lb-week-score { text-align: right; display: flex; flex-direction: column; }
.lb-week-score span { font-size: 9px; font-weight: 900; letter-spacing: 0.1em; color: var(--text-soft, #a3a3a3); }
.lb-week-score b { font-family: ui-monospace, monospace; color: var(--theme-color); font-size: 14px; }

/* Temporadas */
.season-chip { position: relative; gap: 4px !important; border-color: color-mix(in srgb, var(--season-color, #fb923c) 55%, transparent) !important; }
.season-chip[hidden] { display: none !important; }
.season-chip-count { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.season-panel { border-color: rgba(251, 146, 60, 0.35) !important; }
.season-desc { margin: 0.9rem 0 0.6rem; font-size: 0.9rem; line-height: 1.45; color: #e5e7eb; }
.season-bar { height: 10px; }
.season-bar[hidden] { display: none; }
.season-count { margin: 6px 0 12px; font-size: 13px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.season-trophies { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.season-trophy {
    font-size: 12px;
    font-weight: 700;
    color: #fde68a;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
}
.season-trophies-empty { font-size: 12px; color: var(--text-soft, #a3a3a3); }
.trophy-section { margin-bottom: 2rem; }
.trophy-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.trophy-title { font-size: 1.15rem; font-weight: 700; color: #fbbf24; display: flex; align-items: center; gap: 8px; }
.trophy-hint { margin: 6px 0 10px; font-size: 12px; color: var(--text-soft, #a3a3a3); }
.trophy-section .season-trophies { justify-content: flex-start; }
.garden-event.ev-seasonal { filter: drop-shadow(0 0 14px rgba(251, 146, 60, 0.9)); }

/* Logros secretos */
.ach-card.is-secret.is-locked { border-style: dashed; }
.ach-card.is-secret.is-locked .ach-desc { font-style: italic; }


/* ============================================================
   v22.0: Arrecife Abisal (tercer mundo)
   ============================================================ */
body[data-theme="abyss"] {
    --theme-color: #38bdf8;
    --theme-color-hover: #7dd3fc;
    --theme-color-glow: rgba(56, 189, 248, 0.12);
    --theme-color-glow-heavy: rgba(56, 189, 248, 0.35);
    --panel-bg: rgba(4, 16, 30, 0.68);
    --border-color: rgba(56, 189, 248, 0.22);
    --glow-color: rgba(56, 189, 248, 0.5);
    --accent-gradient: linear-gradient(135deg, #38bdf8, #2dd4bf);
}
body[data-theme="abyss"].bg-gradient-animate {
    background: linear-gradient(180deg, #03243b 0%, #021526 45%, #010a14 100%);
    background-size: 100% 300%;
    animation: abyssDrift 26s ease-in-out infinite;
}
@keyframes abyssDrift {
    0%, 100% { background-position: 50% 0%; }
    50% { background-position: 50% 100%; }
}
body[data-theme="abyss"] .particle { background: rgba(186, 230, 253, 0.55); border-radius: 50%; }

.travel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 640px) { .travel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .travel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.travel-card.is-abyss { background: linear-gradient(170deg, rgba(3, 105, 161, 0.35), rgba(2, 10, 20, 0.65)); }
.travel-card.is-abyss.is-active { border-color: rgba(125, 211, 252, 0.6); box-shadow: 0 0 30px -12px rgba(56, 189, 248, 0.9); }

/* v22.0: con regalo, misiones y temporada la fila de chips ya no cabe: pasa a dos líneas centradas */
.stat-chips { flex-wrap: wrap; justify-content: center; row-gap: 6px; max-width: 100%; }
.stat-chips .daily-chip, .stat-chips .missions-chip, .stat-chips .season-chip { padding-left: 9px !important; padding-right: 9px !important; }

/* v22.0: el botón de viaje no se parte en dos líneas ("Arrecife 🌊" es más largo que "Tierra 🌍") */
#header-travel-btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 480px) { #header-travel-btn > span:first-child { display: none; } }

/* v22.0 · Móvil: la planta se ajusta al hueco libre. Con karma la cabecera ocupa dos líneas y
   los chips del regalo, misiones y temporada otra más: con tamaño fijo la planta tapaba el contador. */
@media (max-width: 767px) {
    #plantBtn {
        height: min(52vw, 27dvh, 100%) !important;
        width: auto !important;
        aspect-ratio: 1 / 1;
    }
    .plant-halo { width: min(62vw, 30dvh, 115%) !important; }
    .stat-chips { row-gap: 4px; margin-top: 4px !important; }
    #phase-progress { margin-top: 6px !important; }
}

/* Columna derecha de chips en móvil (la crea extras.js) */
.side-chips { display: none; }
@media (max-width: 767px) {
    .side-chips:not([hidden]) {
        position: absolute;
        right: 8px;
        top: 50%;
        z-index: 30;
        display: flex;
        flex-direction: column;
        gap: 8px;
        transform: translateY(-50%);
    }
    .side-chips .stat-chip {
        width: 48px;
        height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px !important;
        padding: 0 !important;
        border-radius: 14px !important;
        font-size: 11px !important;
        line-height: 1.1;
        backdrop-filter: blur(6px);
        position: relative;
    }
    .side-chips .stat-chip > span:first-child { font-size: 18px; }
    .side-chips .daily-chip-dot { top: -3px; right: -3px; }
    /* La planta exhibida del Jardín pasa arriba a la derecha, sobre la columna */
    .garden-decor { top: 62px !important; bottom: auto !important; margin-top: 0 !important; right: 12px !important; width: 40px !important; height: 40px !important; }
    .garden-decor:not([hidden]) ~ .side-chips { transform: translateY(calc(-50% + 26px)); }
}

/* ============================================================
   v22.1: sol dorado rediseñado (rayos, núcleo, chispas, tiempo y destello)
   Colores por mundo: --sun-a (claro), --sun-b (medio), --sun-c (oscuro)
   ============================================================ */
.golden-sun {
    --sun-a: #fff7c2;
    --sun-b: #fbbf24;
    --sun-c: #ea580c;
    --sun-glow: rgba(251, 191, 36, 0.55);
    --sun-size: 104px;
    width: var(--sun-size) !important;
    height: var(--sun-size) !important;
    margin: calc(var(--sun-size) / -2) 0 0 calc(var(--sun-size) / -2);
    background: none !important;
    box-shadow: none !important;
    filter: none !important;
    border-radius: 50%;
    animation: none !important;
    transform: none;
}
body[data-theme="cosmic"] .golden-sun { --sun-a: #fdf4ff; --sun-b: #c084fc; --sun-c: #6d28d9; --sun-glow: rgba(192, 132, 252, 0.55); }
body[data-theme="abyss"] .golden-sun { --sun-a: #ffffff; --sun-b: #bae6fd; --sun-c: #0284c7; --sun-glow: rgba(125, 211, 252, 0.55); }

.golden-sun > * { position: absolute; pointer-events: none; }
.golden-sun.is-live { animation: sunEnter 0.7s cubic-bezier(.2, 1.4, .4, 1) both !important; }
.golden-sun:hover .sun-core { transform: scale(1.08); }
.golden-sun:active .sun-core { transform: scale(0.92); }

.sun-halo {
    inset: -30%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--sun-glow) 0%, transparent 62%);
    animation: sunHalo 2.2s ease-in-out infinite;
}
.sun-rays { inset: 0; width: 100%; height: 100%; overflow: visible; }
.sun-rays path { fill: var(--sun-b); }
.sun-rays-long { animation: sunSpin 14s linear infinite; filter: drop-shadow(0 0 6px var(--sun-glow)); }
.sun-rays-long path { fill: var(--sun-b); opacity: 0.95; }
.sun-rays-short { animation: sunSpin 9s linear infinite reverse; }
.sun-rays-short path { fill: var(--sun-a); opacity: 0.8; }

.sun-core {
    left: 25%;
    top: 25%;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--sun-a) 22%, var(--sun-b) 62%, var(--sun-c) 100%);
    box-shadow: 0 0 18px var(--sun-glow), inset 0 -4px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease;
    animation: sunBreath 1.8s ease-in-out infinite;
}
.sun-shine {
    position: absolute;
    left: 18%;
    top: 14%;
    width: 30%;
    height: 22%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    filter: blur(1px);
    transform: rotate(-30deg);
}
/* Carita: dos ojos y una sonrisa */
.sun-face { position: absolute; inset: 0; }
.sun-face i {
    position: absolute;
    top: 40%;
    width: 9%;
    height: 13%;
    border-radius: 50%;
    background: rgba(90, 40, 0, 0.75);
    animation: sunBlink 4s infinite;
}
.sun-face i:first-child { left: 32%; }
.sun-face i:nth-child(2) { right: 32%; }
.sun-face b {
    position: absolute;
    left: 36%;
    top: 58%;
    width: 28%;
    height: 14%;
    border: 2.5px solid rgba(90, 40, 0, 0.7);
    border-top: 0;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
body[data-theme="cosmic"] .sun-face i, body[data-theme="abyss"] .sun-face i { background: rgba(30, 20, 70, 0.7); }
body[data-theme="cosmic"] .sun-face b, body[data-theme="abyss"] .sun-face b { border-color: rgba(30, 20, 70, 0.65); }

/* Anillo con el tiempo que queda */
.sun-timer { inset: -6%; width: 112%; height: 112%; transform: rotate(-90deg); }
.sun-timer circle { fill: none; stroke-width: 3; }
.sun-timer-track { stroke: rgba(255, 255, 255, 0.12); }
.sun-timer-bar { stroke: var(--sun-a); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.golden-sun.is-live .sun-timer-bar { animation: sunTimer var(--sun-life, 15000ms) linear forwards; }

/* Chispas que orbitan */
.sun-spark {
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: var(--sun-a);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: sunOrbit 3.2s linear infinite;
}
.sun-spark.sp2 { animation-delay: -0.8s; width: 6px; height: 6px; }
.sun-spark.sp3 { animation-delay: -1.6s; }
.sun-spark.sp4 { animation-delay: -2.4s; width: 5px; height: 5px; }

@keyframes sunEnter {
    0% { opacity: 0; transform: scale(0.2) rotate(-90deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes sunSpin { to { transform: rotate(360deg); } }
@keyframes sunHalo { 50% { transform: scale(1.12); opacity: 0.75; } }
@keyframes sunBreath { 50% { box-shadow: 0 0 30px var(--sun-glow), inset 0 -4px 10px rgba(0, 0, 0, 0.18); } }
@keyframes sunBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes sunTimer { to { stroke-dashoffset: 100; opacity: 0.35; } }
@keyframes sunOrbit {
    0% { transform: rotate(0deg) translateX(62px) rotate(0deg) scale(0.6); opacity: 0.4; }
    50% { transform: rotate(180deg) translateX(62px) rotate(-180deg) scale(1.2); opacity: 1; }
    100% { transform: rotate(360deg) translateX(62px) rotate(-360deg) scale(0.6); opacity: 0.4; }
}

/* Destello al atraparlo */
.sun-burst { position: fixed; z-index: 20000; width: 0; height: 0; pointer-events: none; }
.sun-burst > span { position: absolute; left: 0; top: 0; }
.sun-burst-flash {
    width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(253, 224, 71, 0.6) 30%, transparent 65%);
    animation: sunFlash 0.5s ease-out forwards;
}
.sun-burst-ring {
    width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
    border: 3px solid #fde68a;
    animation: sunRing 0.7s ease-out forwards;
}
.sun-burst-ray {
    width: 6px; height: 22px; margin: -11px 0 0 -3px; border-radius: 3px;
    background: linear-gradient(#fff, #fbbf24);
    transform: rotate(var(--rot));
    animation: sunRay 0.75s cubic-bezier(.2, .8, .3, 1) forwards;
}
body[data-theme="cosmic"] .sun-burst-ring { border-color: #e9d5ff; }
body[data-theme="cosmic"] .sun-burst-ray { background: linear-gradient(#fff, #c084fc); }
body[data-theme="cosmic"] .sun-burst-flash { background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(192, 132, 252, 0.6) 30%, transparent 65%); }
body[data-theme="abyss"] .sun-burst-ring { border-color: #bae6fd; }
body[data-theme="abyss"] .sun-burst-ray { background: linear-gradient(#fff, #7dd3fc); }
body[data-theme="abyss"] .sun-burst-flash { background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(125, 211, 252, 0.6) 30%, transparent 65%); }
@keyframes sunFlash { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes sunRing { from { transform: scale(0.5); opacity: 1; } to { transform: scale(5); opacity: 0; } }
@keyframes sunRay {
    from { transform: translate(0, 0) rotate(var(--rot)) scaleY(1); opacity: 1; }
    to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scaleY(0.3); opacity: 0; }
}

@media (max-width: 767px) {
    .golden-sun { --sun-size: 88px; }
    @keyframes sunOrbit {
        0% { transform: rotate(0deg) translateX(52px) rotate(0deg) scale(0.6); opacity: 0.4; }
        50% { transform: rotate(180deg) translateX(52px) rotate(-180deg) scale(1.2); opacity: 1; }
        100% { transform: rotate(360deg) translateX(52px) rotate(-360deg) scale(0.6); opacity: 0.4; }
    }
}
@media (prefers-reduced-motion: reduce) {
    .golden-sun.is-live, .sun-rays-long, .sun-rays-short, .sun-halo, .sun-core, .sun-spark, .sun-face i { animation: none !important; }
    .sun-burst-ray, .sun-burst-ring { display: none; }
}

/* ============================================================
   v22.2: Reliquias del Abismo (pestaña Mejoras en el Arrecife)
   ============================================================ */
.relics-section {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.22), rgba(2, 10, 20, 0.45));
    border: 1px solid rgba(125, 211, 252, 0.28);
}
.relics-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.relics-title { font-size: 1.05rem; font-weight: 800; color: #e0f2fe; display: flex; align-items: center; gap: 8px; }
.relics-count { font-size: 12px; font-weight: 800; color: #7dd3fc; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, 0.35); padding: 3px 10px; border-radius: 999px; }
.relics-desc { margin: 6px 0 12px; font-size: 12px; color: var(--text-soft, #a3a3a3); }
.relics-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 640px) { .relics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.relic-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(125, 211, 252, 0.14);
}
.relic-card.is-owned { border-color: rgba(250, 204, 21, 0.45); background: rgba(250, 204, 21, 0.06); }
.relic-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 12px;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), rgba(56, 189, 248, 0.15));
}
.relic-card:not(.is-owned) .relic-icon { filter: saturate(0.5); }
.relic-body { min-width: 0; flex: 1; }
.relic-name { font-size: 13.5px; font-weight: 800; color: #fff; }
.relic-desc { margin-top: 2px; font-size: 12px; line-height: 1.4; color: #cbd5e1; }
.relic-buy {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: #04121f;
    background: linear-gradient(180deg, #7dd3fc, #38bdf8);
    transition: transform 0.15s ease, filter 0.2s ease;
}
.relic-buy:hover:not(:disabled) { filter: brightness(1.08); }
.relic-buy:active:not(:disabled) { transform: scale(0.96); }
.relic-buy:disabled { cursor: default; color: var(--text-soft, #a3a3a3); background: var(--surface-2, rgba(255, 255, 255, 0.08)); }
.relic-owned { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 800; color: #fde047; }
.garden-event.ev-comet, .garden-event.ev-wormhole { filter: drop-shadow(0 0 14px rgba(192, 132, 252, 0.9)); }
.garden-event.ev-fishschool, .garden-event.ev-chest, .garden-event.ev-oyster { filter: drop-shadow(0 0 14px rgba(125, 211, 252, 0.9)); }

/* ============================================================
   v22.3: lo que compras, ordenado alrededor de la planta (renderPlantScene)
   Solo se animan transform y opacity (las animan la tarjeta gráfica, no traban el juego).
   Capa de fuera (.scene-item): recorrido. Capa de dentro (.scene-inner): gesto.
   ============================================================ */
.plant-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.scene-item {
    position: absolute;
    font-size: var(--size, 22px);
    line-height: 1;
    margin-left: calc(var(--size, 22px) / -2);
}
.scene-inner { display: inline-block; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4)); }

/* Suelo: respiran aplastándose un poco sobre su base */
.scene-ground .scene-inner { transform-origin: 50% 100%; animation: sceneBreath 3.2s ease-in-out infinite; animation-delay: var(--delay); }
.scene-ground.depth-1 { opacity: 0.85; }
.scene-ground.depth-2 { opacity: 0.6; z-index: -1; }
@keyframes sceneBreath {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.05, 0.94); }
}

/* Cielo: flotan; según el icono además giran, brillan u orbitan */
.scene-sky { animation: sceneFloat var(--dur, 9s) ease-in-out infinite; animation-delay: var(--delay); }
@keyframes sceneFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(5px, -7px); }
    66% { transform: translate(-4px, -3px); }
}
.scene-sky.m-spin .scene-inner { animation: sceneSpin 12s linear infinite; animation-delay: var(--delay); }
.scene-sky.m-glow .scene-inner { animation: sceneGlow 2.6s ease-in-out infinite; animation-delay: var(--delay); }
.scene-sky.m-orbit { animation: sceneOrbit var(--dur, 10s) linear infinite; animation-delay: var(--delay); }
@keyframes sceneSpin { to { transform: rotate(360deg); } }
@keyframes sceneGlow {
    0%, 100% { transform: scale(0.92); opacity: 0.75; }
    50% { transform: scale(1.12); opacity: 1; }
}
@keyframes sceneOrbit {
    from { transform: rotate(0deg) translateX(12px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(12px) rotate(-360deg); }
}

/* Voladores: van y vuelven dándose la vuelta, con un vaivén suave; abejas y mariposas aletean */
.scene-fly { animation: sceneFly var(--dur, 12s) ease-in-out infinite; animation-delay: var(--delay); }
.scene-fly .scene-inner { animation: sceneBob 1.6s ease-in-out infinite; animation-delay: var(--delay); }
.scene-fly.m-flutter .scene-inner { animation: sceneFlutter 0.18s ease-in-out infinite alternate; }
@keyframes sceneFly {
    0% { transform: translate(0, 0) scaleX(1); }
    46% { transform: translate(var(--dx, 50px), -12px) scaleX(1); }
    50% { transform: translate(var(--dx, 50px), -10px) scaleX(-1); }
    96% { transform: translate(0, 2px) scaleX(-1); }
    100% { transform: translate(0, 0) scaleX(1); }
}
@keyframes sceneBob { 50% { transform: translateY(-5px) rotate(4deg); } }
@keyframes sceneFlutter { from { transform: scale(1, 1); } to { transform: scale(1.06, 0.9) translateY(-1px); } }

/* Gotas que caen y burbujas que suben */
.scene-rain { top: -4%; font-size: 12px; opacity: 0; animation: sceneRain var(--dur, 5s) linear infinite; animation-delay: var(--delay); }
.scene-bubble {
    bottom: 6%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(186, 230, 253, 0.7);
    background: rgba(224, 242, 254, 0.12);
    opacity: 0;
    animation: sceneBubble var(--dur, 5s) ease-in infinite;
    animation-delay: var(--delay);
}
.scene-bubble .scene-inner, .scene-rain .scene-inner { filter: none; }
@keyframes sceneRain { 0% { transform: translateY(0); opacity: 0; } 10%, 85% { opacity: 0.6; } 100% { transform: translateY(320px); opacity: 0; } }
@keyframes sceneBubble { 0% { transform: translate(0, 0) scale(0.6); opacity: 0; } 15% { opacity: 0.8; } 100% { transform: translate(8px, -260px) scale(1.2); opacity: 0; } }

/* Al comprar: lo nuevo aparece con un "pop" y lo que ya tenías da un saltito */
.scene-item.is-new .scene-inner { animation: scenePop 0.75s cubic-bezier(.2, 1.6, .4, 1) both !important; }
.scene-item.is-bump .scene-inner { animation: sceneBump 0.45s ease-out both !important; }
@keyframes scenePop {
    0% { transform: scale(0) rotate(-25deg); opacity: 0; }
    60% { transform: scale(1.35) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes sceneBump {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-9px) scale(1.18); }
    70% { transform: translateY(0) scale(0.95, 1.05); }
    100% { transform: translateY(0) scale(1); }
}

.plant-scene.is-static *, .plant-scene.is-static .scene-item { animation: none !important; }
.plant-scene.is-static .scene-rain, .plant-scene.is-static .scene-bubble { display: none; }
@media (prefers-reduced-motion: reduce) {
    .plant-scene * { animation: none !important; }
    .scene-rain, .scene-bubble { display: none; }
}
@media (max-width: 767px) {
    /* En móvil las columnas de habilidades y chips ocupan los lados: los objetos se recogen al centro */
    .plant-scene { left: 52px; right: 52px; }
    .scene-item { font-size: calc(var(--size, 22px) * 0.72); }
    .scene-ground.depth-2 { display: none; }
}

/* v22.5: presentación del juego en la pestaña Wiki */
.home-intro { padding: 16px 18px; border-radius: 16px; background: linear-gradient(180deg, rgba(34, 197, 94, 0.1), rgba(0, 0, 0, 0.2)); border: 1px solid rgba(74, 222, 128, 0.25); }
.home-intro-title { font-weight: 800; font-size: 1.05rem; color: #fff; margin-bottom: 6px; }
.home-intro p { color: #d1d5db; }
.home-intro-list { margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: #d1d5db; }
.home-intro-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.home-intro-links a { padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 800; color: #04140a; background: var(--theme-color, #22c55e); text-decoration: none; }
.home-intro-links a:hover { filter: brightness(1.1); }

/* ============================================================
   v22.6: templo de Ascensión
   ============================================================ */
.asc-wrap { padding: 20px; display: grid; gap: 18px; }
.asc-hero {
    position: relative;
    padding: 22px 18px 18px;
    border-radius: 22px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.28), transparent 70%), rgba(20, 8, 32, 0.75);
    border: 1px solid rgba(192, 132, 252, 0.3);
    box-shadow: 0 0 40px -18px rgba(168, 85, 247, 0.8);
}
.asc-hero.is-ready { border-color: rgba(250, 204, 21, 0.55); box-shadow: 0 0 46px -14px rgba(250, 204, 21, 0.55); }
.asc-gain-label { font-size: 12px; color: #c4b5fd; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.asc-gain { margin-top: 4px; display: flex; justify-content: center; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: #fff; line-height: 1.05; font-variant-numeric: tabular-nums; }
.asc-gain-icon { font-size: 2.2rem; }
.asc-extra { margin-top: 2px; font-size: 12px; color: #fde68a; }
.asc-compare { margin: 14px auto 0; max-width: 420px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.asc-compare-box { padding: 10px 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 2px; }
.asc-compare-box span { font-size: 10px; color: #a1a1aa; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.asc-compare-box b { font-size: 1.15rem; color: #e9d5ff; font-family: ui-monospace, monospace; }
.asc-compare-box.is-after { border-color: rgba(74, 222, 128, 0.4); background: rgba(34, 197, 94, 0.08); }
.asc-compare-box.is-after b { color: #86efac; }
.asc-arrow { color: #c4b5fd; font-size: 1.3rem; font-weight: 900; }
.asc-verdict { margin: 14px auto 0; max-width: 460px; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.asc-verdict.is-good { color: #fef9c3; background: rgba(250, 204, 21, 0.12); border: 1px solid rgba(250, 204, 21, 0.35); }
.asc-verdict.is-ok { color: #dcfce7; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); }
.asc-verdict.is-wait { color: #d4d4d8; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.asc-btn {
    margin-top: 14px;
    width: 100%;
    max-width: 460px;
    padding: 15px 16px;
    border-radius: 16px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.14em;
    color: #fff;
    background: linear-gradient(90deg, #7e22ce, #c026d3, #7e22ce);
    background-size: 200% auto;
    box-shadow: 0 10px 30px -10px rgba(192, 38, 211, 0.8);
    transition: background-position 0.6s ease, transform 0.15s ease, filter 0.2s ease;
}
.asc-btn:hover:not(:disabled) { background-position: right center; filter: brightness(1.08); }
.asc-btn:active:not(:disabled) { transform: scale(0.97); }
.asc-btn:disabled { cursor: not-allowed; color: #a1a1aa; background: rgba(255, 255, 255, 0.06); box-shadow: none; }
.asc-hero.is-ready .asc-btn:not(:disabled) { animation: ascPulse 2.2s ease-in-out infinite; }
@keyframes ascPulse { 50% { box-shadow: 0 10px 40px -6px rgba(250, 204, 21, 0.7); } }
.asc-next { margin: 16px auto 0; max-width: 460px; text-align: left; }
.asc-next-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #a1a1aa; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.asc-next-row span:last-child { color: #d8b4fe; text-transform: none; letter-spacing: 0; font-family: ui-monospace, monospace; }
.asc-bar { margin-top: 6px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.asc-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #a855f7, #f0abfc); transition: width 0.4s ease; }
.asc-next-pct { margin-top: 4px; text-align: right; font-size: 10px; color: #71717a; font-family: ui-monospace, monospace; }
.asc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.asc-stat { padding: 12px 10px; border-radius: 16px; text-align: center; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 2px; min-width: 0; }
.asc-stat span { font-size: 10px; color: #c4b5fd; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asc-stat b { font-size: 1.35rem; color: #fff; font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; }
.asc-stat small { font-size: 10px; color: #71717a; }
.asc-shop { padding-top: 6px; border-top: 1px solid rgba(168, 85, 247, 0.2); }
.asc-shop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.asc-shop-title { font-size: 1.15rem; font-weight: 800; color: #e9d5ff; display: flex; align-items: center; gap: 8px; }
.asc-shop-count { font-size: 12px; font-weight: 800; color: #c4b5fd; background: rgba(0, 0, 0, 0.35); padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.asc-shop-hint { margin: 6px 0 4px; font-size: 12px; color: #a1a1aa; }
.asc-shop-list { display: grid; gap: 8px; }
.asc-group-title { margin-top: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #a78bfa; }
.asc-missing { margin-top: 3px; font-size: 11px; color: #a1a1aa; }
.asc-owned { display: flex; flex-wrap: wrap; gap: 6px; }
.asc-owned-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #e9d5ff; background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(192, 132, 252, 0.25); cursor: help; }
.asc-locked-explain { margin-top: 18px; max-width: 360px; font-size: 13px; line-height: 1.5; color: #a1a1aa; }
.asc-guide-link { margin-top: 12px; font-size: 13px; font-weight: 700; color: #c4b5fd; text-decoration: underline; }

/* Ventana de confirmación */
.asc-modal-panel { border-color: rgba(192, 132, 252, 0.35) !important; box-shadow: 0 0 50px -10px rgba(168, 85, 247, 0.6) !important; }
.asc-modal-gain { margin-top: 6px; font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: #fde68a; }
.asc-modal-gain span { font-size: 1.8rem; }
.asc-modal-bonus { margin-top: 2px; font-size: 13px; color: #86efac; font-weight: 700; }
.asc-modal-cols { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.asc-modal-col { padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.08); }
.asc-modal-col h3 { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.asc-modal-col.is-lose h3 { color: #fca5a5; }
.asc-modal-col.is-keep h3 { color: #86efac; }
.asc-modal-col ul { display: grid; gap: 4px; font-size: 12px; color: #d4d4d8; list-style: none; padding: 0; }
.asc-modal-col.is-lose li::before { content: "✕ "; color: #f87171; }
.asc-modal-col.is-keep li::before { content: "✓ "; color: #4ade80; }
.asc-modal-notes { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; font-size: 12.5px; color: #e5e7eb; }
.asc-modal-notes li { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.asc-modal-notes li.is-muted { color: #a1a1aa; }
.asc-modal-notes:empty { display: none; }
.asc-modal-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.asc-cancel { padding: 12px; border-radius: 14px; font-weight: 800; color: #d4d4d8; background: rgba(255, 255, 255, 0.07); }
.asc-cancel:hover { background: rgba(255, 255, 255, 0.12); }
.asc-confirm { padding: 12px; border-radius: 14px; font-weight: 800; letter-spacing: 0.08em; color: #fff; background: linear-gradient(90deg, #7e22ce, #c026d3); box-shadow: 0 8px 24px -10px rgba(192, 38, 211, 0.9); }
.asc-confirm:hover { filter: brightness(1.1); }
@media (max-width: 480px) {
    .asc-wrap { padding: 14px; }
    .asc-gain { font-size: 2.4rem; }
    .asc-stat b { font-size: 1.1rem; }
    .asc-modal-cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .asc-hero.is-ready .asc-btn { animation: none; } }

/* v22.7: banner del templo de Ascensión, fijo arriba y de borde a borde */
.asc-panel {
    background: radial-gradient(ellipse at 50% 0%, rgba(88, 28, 135, 0.35), transparent 60%), #0a0510;
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.45) transparent;
}
.asc-panel::-webkit-scrollbar { width: 6px; }
.asc-panel::-webkit-scrollbar-track { background: transparent; }
.asc-panel::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.45); border-radius: 6px; }
.asc-banner {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(59, 7, 100, 0.96), rgba(88, 28, 135, 0.94) 50%, rgba(59, 7, 100, 0.96));
    border-bottom: 1px solid rgba(192, 132, 252, 0.35);
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}
.asc-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 22px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(233, 213, 255, 0.25);
}
.asc-banner-text { min-width: 0; flex: 1; }
.asc-banner-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #f5f3ff;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asc-banner-sub { margin-top: 2px; font-size: 11.5px; color: #d8b4fe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asc-banner-help {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
    color: #f5f3ff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}
.asc-banner-help:hover { background: rgba(255, 255, 255, 0.2); }
@media (max-width: 480px) {
    .asc-banner { padding: 10px 14px; gap: 10px; }
    .asc-banner-icon { width: 34px; height: 34px; font-size: 18px; }
    .asc-banner-title { font-size: 1rem; }
}

/* v22.8: producción de los otros mundos sin conexión */
.offline-idle-note { margin-top: 8px; font-size: 12px; color: #a7f3d0; }

/* ============================================================
   v22.8: aspectos de maceta (solo cambian el grupo .pot-base del dibujo)
   ============================================================ */
#plantBtn .pot-base { transition: filter 0.4s ease; }
#plantBtn[data-pot="jade"] .pot-base { filter: hue-rotate(125deg) saturate(1.1); }
#plantBtn[data-pot="sapphire"] .pot-base { filter: hue-rotate(195deg) saturate(1.2); }
#plantBtn[data-pot="amethyst"] .pot-base { filter: hue-rotate(250deg) saturate(1.15); }
#plantBtn[data-pot="coral"] .pot-base { filter: hue-rotate(330deg) saturate(1.4) brightness(1.1); }
#plantBtn[data-pot="gold"] .pot-base { filter: sepia(1) saturate(3.5) hue-rotate(5deg) brightness(1.15); }
#plantBtn[data-pot="obsidian"] .pot-base { filter: grayscale(1) brightness(0.45) contrast(1.4); }
#plantBtn[data-pot="crystal"] .pot-base { filter: saturate(0.25) brightness(1.7) drop-shadow(0 0 6px rgba(186, 230, 253, 0.9)); }
#plantBtn[data-pot="rainbow"] .pot-base { animation: potRainbow 6s linear infinite; }
#plantBtn[data-pot="champion"] .pot-base { filter: sepia(1) saturate(4) hue-rotate(10deg) brightness(1.2) drop-shadow(0 0 8px rgba(250, 204, 21, 0.9)); }
@keyframes potRainbow { from { filter: hue-rotate(0deg) saturate(1.4); } to { filter: hue-rotate(360deg) saturate(1.4); } }
@media (prefers-reduced-motion: reduce) { #plantBtn[data-pot="rainbow"] .pot-base { animation: none; filter: hue-rotate(200deg) saturate(1.4); } }
.pot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pot-card {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.pot-card:not(.is-locked):hover { border-color: rgba(250, 204, 21, 0.45); transform: translateY(-2px); }
.pot-card.is-active { border-color: rgba(74, 222, 128, 0.6); background: rgba(34, 197, 94, 0.08); }
.pot-card.is-locked { opacity: 0.55; cursor: default; }
.pot-swatch { width: 42px; height: 34px; border-radius: 6px 6px 14px 14px; display: grid; place-items: center; font-size: 14px; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.25); }
.pot-card.is-locked .pot-swatch { filter: grayscale(1) brightness(0.6); }
.pot-name { font-size: 12px; font-weight: 800; color: #fff; }
.pot-req { font-size: 10.5px; color: var(--text-soft, #a3a3a3); text-align: center; line-height: 1.25; }
.pot-card.is-active .pot-req { color: #4ade80; font-weight: 700; }
.lb-weekly-prize-hint { margin-top: 6px; font-size: 11.5px; color: #fde68a; }
.lb-weekly-prizes { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: #fff; font-weight: 700; }

/* ============================================================
   v22.9: desafío semanal (la Gran Plaga)
   ============================================================ */
.boss-chip { position: relative; gap: 4px !important; border-color: rgba(248, 113, 113, 0.45) !important; }
.boss-chip-count { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.boss-chip.is-ready { border-color: rgba(250, 204, 21, 0.6) !important; box-shadow: 0 0 14px -4px rgba(250, 204, 21, 0.8); }
.boss-chip.is-ready .daily-chip-dot { display: block; animation: daily-pulse 1.6s ease-in-out infinite; }
.boss-chip.is-hit { animation: bossHit 0.4s ease; }
@keyframes bossHit { 30% { transform: translateX(-3px) rotate(-4deg); } 60% { transform: translateX(3px) rotate(4deg); } }
.boss-panel { border-color: rgba(248, 113, 113, 0.4) !important; box-shadow: 0 0 50px -10px rgba(239, 68, 68, 0.5) !important; }
.boss-art { font-size: 4rem; line-height: 1; animation: bossIdle 2.4s ease-in-out infinite; }
.boss-art.is-defeated { filter: grayscale(1) opacity(0.5); transform: rotate(180deg); animation: none; }
@keyframes bossIdle { 50% { transform: translateY(-6px) scale(1.04); } }
.boss-hp { margin: 14px auto 0; max-width: 360px; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; border: 1px solid rgba(248, 113, 113, 0.3); }
.boss-hp > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #dc2626, #f97316); transition: width 0.5s ease; }
.boss-hp-text { margin-top: 6px; font-size: 13px; font-weight: 800; color: #fecaca; font-variant-numeric: tabular-nums; }
.boss-desc { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: #e5e7eb; }
.boss-sources-title { margin-top: 14px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #fca5a5; }
.boss-sources { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
.boss-sources li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 10px; font-size: 12px; color: #d4d4d8; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); }
.boss-sources b { color: #f87171; font-variant-numeric: tabular-nums; }
.boss-reward { margin: 14px 0 12px; font-size: 13px; font-weight: 700; color: #fde68a; }
.boss-claimed { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #86efac; }
.boss-close-btn { color: #d4d4d8 !important; background: rgba(255, 255, 255, 0.08) !important; box-shadow: none !important; }
.boss-total { margin-top: 10px; font-size: 11.5px; color: var(--text-soft, #a3a3a3); }
@media (max-width: 420px) { .boss-sources { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .boss-art, .boss-chip.is-hit { animation: none; } }

/* ============================================================
   v23.0: Trascendencia
   ============================================================ */
.tr-wrap { padding-top: 0; }
.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(251, 191, 36, 0.25); }
.tr-head .asc-shop-title { color: #fde68a; }
.tr-seeds-chip { font-size: 13px; font-weight: 800; color: #fde68a; background: rgba(120, 53, 15, 0.45); border: 1px solid rgba(251, 191, 36, 0.35); padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-locked { padding: 14px; border-radius: 14px; font-size: 13px; color: #a1a1aa; background: rgba(255, 255, 255, 0.04); border: 1px dashed rgba(255, 255, 255, 0.12); text-align: center; }
.tr-hero { padding: 18px 16px; border-radius: 20px; text-align: center; background: radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, 0.2), transparent 70%), rgba(28, 18, 6, 0.75); border: 1px solid rgba(251, 191, 36, 0.3); }
.tr-hero .asc-gain-label { color: #fcd34d; }
.tr-gain { margin-top: 4px; font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.tr-how { margin: 8px auto 0; max-width: 460px; font-size: 12.5px; line-height: 1.45; color: #d6d3d1; }
.tr-btn { background: linear-gradient(90deg, #92400e, #d97706, #92400e); background-size: 200% auto; box-shadow: 0 10px 30px -10px rgba(217, 119, 6, 0.8); }
.tr-stats { margin-top: 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: #a8a29e; }
.tr-stats b { color: #fde68a; font-variant-numeric: tabular-nums; }
.tr-tree-title { color: #fde68a; }
.tr-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; }
.tr-branch .asc-group-title { margin-top: 0; color: #fbbf24; }
.tr-chain { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.tr-node { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.tr-node + .tr-node::before { content: ""; position: absolute; left: 26px; top: -7px; width: 2px; height: 6px; background: rgba(251, 191, 36, 0.35); }
.tr-node-icon { grid-row: span 2; font-size: 1.5rem; width: 34px; text-align: center; }
.tr-node-body { min-width: 0; display: grid; gap: 1px; }
.tr-node-body b { font-size: 13px; color: #fff; }
.tr-node-body small { font-size: 11.5px; color: #a8a29e; line-height: 1.35; }
.tr-node-buy, .tr-node-tag { grid-column: 2; justify-self: start; margin-top: 4px; font-size: 11.5px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.tr-node-buy { color: #1c1917; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.tr-node-buy:hover:not(:disabled) { filter: brightness(1.08); }
.tr-node-buy:disabled { color: #a1a1aa; background: rgba(255, 255, 255, 0.07); cursor: not-allowed; }
.tr-node-tag { color: #a1a1aa; background: rgba(0, 0, 0, 0.3); }
.tr-node-tag.is-owned { color: #86efac; background: rgba(34, 197, 94, 0.12); }
.tr-node-tag.is-soon { color: #c4b5fd; background: rgba(139, 92, 246, 0.15); }
.tr-node.is-owned { border-color: rgba(74, 222, 128, 0.35); background: rgba(34, 197, 94, 0.07); }
.tr-node.is-buyable { border-color: rgba(251, 191, 36, 0.55); box-shadow: 0 0 18px -8px rgba(251, 191, 36, 0.7); }
.tr-node.is-locked, .tr-node.is-soon { opacity: 0.7; }
.tr-modal-panel { border-color: rgba(251, 191, 36, 0.4) !important; box-shadow: 0 0 50px -10px rgba(217, 119, 6, 0.6) !important; }
.tr-confirm { background: linear-gradient(90deg, #b45309, #d97706); box-shadow: 0 8px 24px -10px rgba(217, 119, 6, 0.9); }
@media (max-width: 480px) { .tr-tree { grid-template-columns: 1fr; } .tr-gain { font-size: 2rem; } }

/* ============================================================
   v23.1: Jardín Onírico (cuarto mundo)
   ============================================================ */
body[data-theme="dream"] {
    --theme-color: #f9a8d4;
    --theme-color-hover: #fbcfe8;
    --theme-color-glow: rgba(244, 114, 182, 0.12);
    --theme-color-glow-heavy: rgba(244, 114, 182, 0.35);
    --panel-bg: rgba(30, 16, 46, 0.66);
    --border-color: rgba(216, 180, 254, 0.24);
    --glow-color: rgba(244, 114, 182, 0.5);
    --accent-gradient: linear-gradient(135deg, #f9a8d4, #c4b5fd);
}
body[data-theme="dream"].bg-gradient-animate {
    background: linear-gradient(180deg, #2a1745 0%, #3b1f5c 40%, #1b1030 100%);
    background-size: 100% 300%;
    animation: dreamDrift 30s ease-in-out infinite;
}
@keyframes dreamDrift {
    0%, 100% { background-position: 50% 0%; }
    50% { background-position: 50% 100%; }
}
body[data-theme="dream"] .particle { background: rgba(251, 207, 232, 0.6); border-radius: 50%; box-shadow: 0 0 6px rgba(251, 207, 232, 0.6); }
body[data-theme="dream"] .golden-sun { --sun-a: #ffffff; --sun-b: #fbcfe8; --sun-c: #c084fc; --sun-glow: rgba(244, 114, 182, 0.55); }
body[data-theme="dream"] .sun-face i { background: rgba(60, 20, 70, 0.7); }
body[data-theme="dream"] .sun-face b { border-color: rgba(60, 20, 70, 0.65); }
body[data-theme="dream"] .sun-burst-ring { border-color: #fbcfe8; }
body[data-theme="dream"] .sun-burst-ray { background: linear-gradient(#fff, #f9a8d4); }
body[data-theme="dream"] .sun-burst-flash { background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(249, 168, 212, 0.6) 30%, transparent 65%); }
.travel-card.is-dream { background: linear-gradient(170deg, rgba(190, 24, 93, 0.25), rgba(76, 29, 149, 0.35) 55%, rgba(15, 8, 30, 0.7)); }
.travel-card.is-dream.is-active { border-color: rgba(249, 168, 212, 0.6); box-shadow: 0 0 30px -12px rgba(244, 114, 182, 0.9); }
@media (min-width: 1280px) { .travel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============================================================
   v23.4: comodidad (desglose, comprar todas, autocompra, pistas y conflicto de partidas)
   ============================================================ */
.stat-chip.is-clickable { cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.stat-chip.is-clickable:hover, .stat-chip.is-clickable:focus-visible { background: var(--surface-2); border-color: var(--border-color); outline: none; }

.buy-all-btn { display: block; width: 100%; margin-bottom: 8px; padding: 11px 14px; border-radius: 14px; font-size: 13px; font-weight: 800; color: #fff; background: var(--theme-color-glow-heavy); border: 1px solid var(--border-color); transition: filter 0.2s ease, transform 0.1s ease; }
.buy-all-btn:hover:not(:disabled) { filter: brightness(1.2); }
.buy-all-btn:active:not(:disabled) { transform: scale(0.98); }
.buy-all-btn:disabled { color: #a3a3a3; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); cursor: default; }

.auto-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.06); }
.auto-bar-label { margin-right: auto; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #a3a3a3; }
.auto-chip { padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #a3a3a3; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.auto-chip.is-on { color: #fff; background: var(--theme-color-glow-heavy); border-color: var(--border-color); }

.bd-panel { text-align: left; }
.bd-panel .daily-title, .bd-panel .daily-sub { text-align: center; }
.bd-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.bd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 10px; border-radius: 10px; font-size: 13px; color: #d4d4d8; background: rgba(255, 255, 255, 0.04); }
.bd-row b { flex-shrink: 0; font-variant-numeric: tabular-nums; color: #fff; }
.bd-row.is-mult b { color: var(--theme-color); }
.bd-row.is-extra { margin-top: 6px; background: none; padding: 2px 10px; font-size: 12px; color: #a3a3a3; }
.bd-row.is-extra b { color: #d4d4d8; font-weight: 700; }
.bd-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; padding: 10px; border-radius: 12px; font-weight: 800; color: #fff; background: var(--theme-color-glow-heavy); border: 1px solid var(--border-color); }
.bd-empty { margin-top: 14px; text-align: center; font-size: 13px; color: #a3a3a3; }

.cs-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; text-align: left; }
.cs-card { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.cs-card h3 { font-size: 13px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.cs-card dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #a3a3a3; margin-top: 6px; }
.cs-card dd { font-size: 13px; color: #e5e5e5; overflow-wrap: anywhere; }
.cs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
@media (max-width: 420px) { .cs-cards, .cs-actions { grid-template-columns: 1fr; } }

.coach-bubble { display: none; position: fixed; z-index: 900; max-width: min(280px, calc(100vw - 16px)); padding: 9px 13px; border-radius: 14px; font-size: 13px; font-weight: 700; line-height: 1.3; color: #052e16; background: #bbf7d0; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7); pointer-events: none; animation: coach-bob 1.6s ease-in-out infinite; }
.coach-bubble::after { content: ""; position: absolute; left: var(--coach-arrow, 50%); bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: inherit; transform: rotate(45deg); }
.coach-bubble.is-below::after { bottom: auto; top: -6px; }
.coach-target { outline: 2px solid #86efac; outline-offset: 3px; border-radius: 18px; }
#plantBtn.coach-target { outline: none; filter: drop-shadow(0 0 14px rgba(134, 239, 172, 0.8)); }
@keyframes coach-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .coach-bubble { animation: none; } }

/* ============================================================
   v23.5: arreglos en el móvil
   ============================================================ */
/* Ni doble toque ni desplazamiento lateral: con 5 botones, la fila "Comprar" se salía en pantallas de 360 px. */
html { touch-action: manipulation; }
#storeContainer { overflow-x: hidden; }
@media (max-width: 767px) {
    #bulkBuySelector { gap: 6px; }
    #bulkBuySelector > span { flex-shrink: 0; }
    #bulkBuySelector > div { flex: 1 1 auto; min-width: 0; justify-content: flex-end; padding-right: 0 !important; }
    #bulkBuySelector [id^="buy-qty-"] { flex: 1 1 0; min-width: 0 !important; max-width: 60px; padding-left: 4px !important; padding-right: 4px !important; }
}
.coach-bubble { touch-action: manipulation; }
.coach-bubble.is-tappable { pointer-events: auto; cursor: pointer; }

/* ============================================================
   v23.6: dibujado ligero en móviles y tabletas
   El desenfoque de fondo (backdrop-filter) y las sombras con filtro obligan a Safari de iPhone a
   redibujar medio juego en cada fotograma, porque debajo siempre hay algo animado (partículas, halo,
   la planta). Había 49 capas con desenfoque. En pantallas táctiles se sustituyen por fondos opacos.
   ============================================================ */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
    *, *::before, *::after {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    /* Sin desenfoque, los paneles necesitan un fondo algo más opaco para que el texto se lea igual. */
    .glass-panel { background: linear-gradient(rgba(6, 12, 9, 0.82), rgba(6, 12, 9, 0.82)), var(--panel-bg) !important; }
    .tab-panel-container { background-image: linear-gradient(rgba(4, 9, 6, 0.55), rgba(4, 9, 6, 0.55)) !important; }
    .tab-nav, .tab-more-menu, .feature-toast { background-color: rgba(8, 14, 11, 0.96) !important; }
    /* La sombra de la planta ya la hace el "suelo" (#plantBtn::before); el filtro se redibujaba con cada balanceo. */
    #plantBtn, #scoreDisplay { filter: none !important; }
    /* transition: all animaba también sombras y bordes de cada tarjeta al actualizarse la tienda. */
    .glass-button { transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease !important; }
}

/* ============================================================
   v23.9: la planta acepta varios dedos a la vez
   ============================================================ */
#plantBtn { touch-action: none !important; }

/* ============================================================
   v23.12: el contador no arrastra al resto de la pantalla
   El número cambia muchas veces por segundo. Con ancho estable y "contain", el navegador solo repinta
   la tarjeta del contador en vez de recolocar la planta y todo lo que hay alrededor.
   ============================================================ */
#scoreCard { contain: layout style; }
#scoreDisplay { font-variant-numeric: tabular-nums; min-width: 9ch; }
.stat-chip { contain: layout style; }
#cpsDisplay, #clickPowerDisplay { font-variant-numeric: tabular-nums; display: inline-block; min-width: 2ch; text-align: right; }

/* ============================================================
   v23.13: toda la zona de la planta se puede tocar en el móvil
   En pantallas táctiles cualquier punto del panel de la planta cuenta como toque, con varios dedos a
   la vez. Sin gestos del navegador (zoom, desplazamiento, menú de mantener pulsado) en esa zona.
   Los efectos de cada toque reutilizan elementos y se mueven con transform (ver production.js).
   ============================================================ */
@media (hover: none) and (pointer: coarse), (max-width: 767px) {
    #plant-section {
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
}
.tap-particle, .tap-float {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
    white-space: nowrap;
}
.tap-particle { font-size: 1.25rem; line-height: 1; }
.tap-float {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--theme-color-hover);
    text-shadow: 0 0 8px var(--theme-color-glow), 0 1px 2px rgba(0, 0, 0, 0.6);
}
