:root {
    --font-ui: 'Fredoka', 'Outfit', system-ui, sans-serif;
    --navy: #0b132b;
    --slate: #1e293b;
    --sky: #38bdf8;
    --blue: #0284c7;
    --emerald: #10b981;
    --amber: #f59e0b;
    --gold: #facc15;
    --pink: #ec4899;
    --purple: #8b5cf6;
    --red: #ef4444;
    --glass: rgba(15, 23, 42, 0.76);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-ui);
    background: var(--navy);
    color: #f8fafc;
}

body {
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   BARRA SUPERIOR PREMIUM
   ========================================================================= */
.top-bar {
    min-height: 62px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.88) 100%);
    backdrop-filter: blur(14px);
    border-bottom: 2px solid rgba(56, 189, 248, 0.35);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 40;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
    flex-shrink: 0;
}

.top-left, .top-right {
    display: flex;
    align-items: center;
    gap: 7px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 7px 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}
.btn-back:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--sky);
    color: #ffffff;
    transform: translateY(-1px);
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.38), rgba(139, 92, 246, 0.35));
    border: 1.5px solid rgba(125, 211, 252, 0.4);
    border-radius: 14px;
    padding: 4px 12px 4px 8px;
}
.brand-icon { font-size: 1.4rem; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 0.88rem; letter-spacing: 0.3px; color: #ffffff; }
.brand-text small { font-size: 0.68rem; color: #bae6fd; font-weight: 600; }

/* SELECTOR DE 4 MUNDOS CON CANDADO */
.level-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lvl-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.18s ease;
}
.lvl-pill span {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
}
.lvl-pill.locked {
    opacity: 0.56;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
}
.lvl-pill:not(.locked):hover {
    background: rgba(56, 189, 248, 0.22);
    color: #ffffff;
}
.lvl-pill.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #6ee7b7;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.42);
    opacity: 1;
}
.lvl-pill.active span { background: rgba(255, 255, 255, 0.28); }
.lvl-pill.boss-pill.active {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    border-color: #fde047;
    box-shadow: 0 3px 14px rgba(236, 72, 153, 0.45);
}

.hud-chip {
    padding: 5px 11px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1.5px solid transparent;
}
.lives-chip {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(251, 113, 133, 0.5);
    color: #fecdd3;
    letter-spacing: 1px;
}
.books-chip {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(125, 211, 252, 0.55);
    color: #e0f2fe;
}
.squishy-chip {
    background: rgba(236, 72, 153, 0.24);
    border-color: rgba(244, 114, 182, 0.58);
    color: #fbcfe8;
}
.score-chip {
    background: rgba(250, 204, 21, 0.2);
    border-color: rgba(253, 224, 71, 0.5);
    color: #fef08a;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.icon-btn:hover { background: rgba(56, 189, 248, 0.28); border-color: var(--sky); transform: translateY(-1px); }
.icon-btn.active { background: rgba(16, 185, 129, 0.28); border-color: #34d399; color: #a7f3d0; }

/* =========================================================================
   ESCENARIO 3D Y HUD FLOTANTE
   ========================================================================= */
.game-viewport {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    background: #0f172a;
}

#threeRoot { position: absolute; inset: 0; width: 100%; height: 100%; }
#fxOverlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 12; }

.floating-hud-top {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
    z-index: 20;
}

/* TARJETA DE OBJETIVOS DINÁMICOS */
.mission-card {
    background: var(--glass);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(125, 211, 252, 0.45);
    border-radius: 18px;
    padding: 10px 15px;
    min-width: 285px;
    max-width: 370px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.mission-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mission-lvl-tag {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 99px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.mission-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.backpack-bar-wrap {
    width: 100%;
    height: 11px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 7px;
}
.backpack-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #10b981, #facc15);
    border-radius: 99px;
    transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.objectives-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.obj-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}
.obj-row.done {
    background: rgba(16, 185, 129, 0.24);
    color: #a7f3d0;
}
.obj-row.unlocked {
    background: rgba(250, 204, 21, 0.24);
    color: #fef08a;
    font-weight: 700;
}
.obj-icon { font-size: 0.9rem; }

/* BOSS HUD */
.boss-hud {
    background: rgba(69, 10, 10, 0.84);
    backdrop-filter: blur(12px);
    border: 2px solid #fb7185;
    border-radius: 18px;
    padding: 9px 18px;
    min-width: 310px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(190, 18, 60, 0.35);
}
.boss-hud-title { font-size: 0.84rem; font-weight: 800; color: #fde047; letter-spacing: 0.5px; margin-bottom: 5px; }
.boss-hp-track { width: 100%; height: 14px; background: rgba(0, 0, 0, 0.45); border-radius: 99px; overflow: hidden; border: 1.5px solid #fda4af; }
.boss-hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ef4444, #f97316, #facc15); transition: width 0.3s ease; }
.boss-hud-hint { font-size: 0.74rem; color: #fecdd3; margin-top: 4px; font-weight: 600; }

/* INDICADOR DE MOVIMIENTO Y PODERES */
.powers-stack {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
}
.motion-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 99px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(148, 163, 184, 0.4);
    font-size: 0.84rem;
    color: #f8fafc;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
    transition: all 0.2s ease;
}
.motion-pill.running {
    border-color: #facc15;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.78), rgba(234, 88, 12, 0.78));
}
.motion-pill.jumping {
    border-color: #38bdf8;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.82), rgba(14, 165, 233, 0.82));
}

.power-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    min-width: 215px;
    animation: popBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.super-jump-pill { border: 2px solid #f472b6; background: linear-gradient(135deg, rgba(192, 38, 211, 0.82), rgba(245, 158, 11, 0.82)); }
.joy-pill { border: 2px solid #f472b6; background: linear-gradient(135deg, rgba(236, 72, 153, 0.82), rgba(168, 85, 247, 0.82)); }
.shield-pill { border: 2px solid #38bdf8; background: linear-gradient(135deg, rgba(2, 132, 199, 0.82), rgba(16, 185, 129, 0.78)); }
.power-icon { font-size: 1.5rem; line-height: 1; }
.power-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.power-info strong { font-size: 0.8rem; color: #ffffff; letter-spacing: 0.4px; }
.power-info small { font-size: 0.71rem; color: #fce7f3; }
.power-timer-track { width: 100%; height: 8px; background: rgba(0, 0, 0, 0.35); border-radius: 99px; overflow: hidden; }
.power-timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #fde047, #ffffff); border-radius: 99px; }

/* BOTÓN FLOTANTE DE SALUDAR Y ACARICIAR SQUISHY */
.squishy-interact-btn {
    position: absolute;
    bottom: 148px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #ffffff;
    border: 3px solid #fef08a;
    border-radius: 22px;
    padding: 10px 22px 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: var(--font-ui);
    box-shadow: 0 7px 0 #9d174d, 0 14px 30px rgba(236, 72, 153, 0.48);
    z-index: 28;
    animation: squishyPulse 1.1s infinite ease-in-out;
}
.squishy-interact-btn:hover { filter: brightness(1.08); }
.squishy-interact-btn:active { transform: translateX(-50%) scale(0.95); }
.sq-btn-emoji {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}
.sq-btn-text { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.sq-btn-text strong { font-size: 1.02rem; }
.sq-btn-text small { font-size: 0.78rem; color: #fef9c3; font-weight: 600; }
.sq-btn-text kbd {
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid #ffffff;
    border-radius: 5px;
    padding: 1px 6px;
    font-family: var(--font-ui);
    font-weight: 800;
}

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

/* GLOBO DEL PROFE NICO / SQUISHY */
.nico-speech-banner {
    position: absolute;
    bottom: 68px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border: 3px solid #0284c7;
    border-radius: 22px;
    padding: 10px 20px 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 560px;
    width: calc(100% - 32px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
    z-index: 25;
    animation: slideUpPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nico-speech-banner.squishy-theme { border-color: #ec4899; }
.nico-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #bae6fd);
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}
.nico-speech-banner.squishy-theme .nico-avatar {
    background: linear-gradient(135deg, #fce7f3, #f5d0fe);
    border-color: #f472b6;
}
.nico-speaker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 9px;
    border-radius: 99px;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}
.nico-speech-banner.squishy-theme .nico-speaker { color: #be185d; background: #fce7f3; }
.nico-speech-content p { font-size: 0.94rem; font-weight: 700; color: #1e293b; line-height: 1.25; }

/* TOAST FLOTANTE */
.event-toast {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.92);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    border: 2.5px solid #38bdf8;
    color: #ffffff;
    border-radius: 99px;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 24;
    white-space: nowrap;
}
.event-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* HUD INFERIOR */
.floating-hud-bottom {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
    z-index: 20;
}
.controls-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 7px 13px;
}
.ctrl-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; color: #e2e8f0; font-weight: 600; }
.ctrl-item kbd {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom-width: 3px;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: var(--font-ui);
    font-size: 0.71rem;
    font-weight: 700;
    color: #ffffff;
}

.quick-status-pills { display: flex; gap: 8px; pointer-events: auto; }
.mini-cam-btn {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    border-radius: 12px;
    padding: 7px 12px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.mini-cam-btn:hover { background: rgba(56, 189, 248, 0.32); border-color: var(--sky); }

/* CONTROLES TÁCTILES */
.touch-controls {
    position: absolute;
    bottom: 62px;
    left: 18px;
    right: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 26;
}
.touch-dpad { position: relative; width: 148px; height: 148px; pointer-events: auto; }
.t-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.t-btn:active { background: rgba(56, 189, 248, 0.75); }
.t-up { top: 0; left: 50px; }
.t-down { bottom: 0; left: 50px; }
.t-left { top: 50px; left: 0; }
.t-right { top: 50px; right: 0; }

.touch-actions { display: flex; gap: 10px; pointer-events: auto; }
.t-action-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.75);
    color: #ffffff;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.t-action-btn span { font-size: 0.62rem; }
.t-pet { background: linear-gradient(135deg, #ec4899, #a855f7); }
.t-spin { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.t-jump { background: linear-gradient(135deg, #10b981, #0284c7); }

/* =========================================================================
   MODALES AA
   ========================================================================= */
.hidden { display: none !important; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.56) 0%, rgba(7, 11, 26, 0.86) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 60;
    overflow-y: auto;
}

.modal-card {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: #0f172a;
    border: 4px solid #38bdf8;
    border-radius: 28px;
    max-width: 780px;
    width: 100%;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 28px 65px rgba(0, 0, 0, 0.5);
    animation: popBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ribbon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0284c7, #6366f1);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 6px 16px;
    border-radius: 99px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.32);
}
.win-ribbon { background: linear-gradient(135deg, #10b981, #059669); }
.finale-ribbon { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.danger-ribbon { background: linear-gradient(135deg, #ef4444, #be123c); }

.hero-title {
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    font-weight: 800;
    background: linear-gradient(135deg, #0284c7 0%, #7c3aed 55%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.15;
}
.modal-heading { font-size: clamp(1.45rem, 2.8vw, 2rem); font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.hero-lead, .modal-desc { font-size: 0.95rem; color: #334155; line-height: 1.45; margin-bottom: 16px; font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.feature-tile {
    border-radius: 18px;
    padding: 12px 10px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.feature-tile .ft-icon { font-size: 1.7rem; }
.feature-tile strong { font-size: 0.84rem; color: #0f172a; }
.feature-tile span { font-size: 0.73rem; color: #475569; line-height: 1.28; font-weight: 600; }
.tile-books { border-color: #60a5fa; background: #eff6ff; }
.tile-squishy { border-color: #f472b6; background: #fdf2f8; }
.tile-pill { border-color: #fbbf24; background: #fffbeb; }
.tile-nico { border-color: #34d399; background: #ecfdf5; }

.start-lock-note {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.btn-primary-xl {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    padding: 14px 32px;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 0 #047857, 0 12px 24px rgba(16, 185, 129, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}
.btn-primary-xl:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-primary-xl:active { transform: translateY(3px); box-shadow: 0 3px 0 #047857; }
.gold-btn { background: linear-gradient(135deg, #f59e0b, #ea580c); box-shadow: 0 6px 0 #b45309, 0 12px 24px rgba(245, 158, 11, 0.35); }

.btn-secondary-lg {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    padding: 14px 24px;
    font-family: var(--font-ui);
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 0 #1d4ed8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}
.btn-secondary-lg:hover { transform: translateY(-2px); }

.win-big-emoji, .finale-trophy { font-size: 3rem; margin: 4px 0 8px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-box { background: #f8fafc; border: 2px solid #cbd5e1; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.stat-lbl { font-size: 0.74rem; color: #64748b; font-weight: 700; }
.stat-box strong { font-size: 1.25rem; color: #0284c7; }
.nico-quote-box { background: #ecfdf5; border: 2px solid #6ee7b7; border-radius: 16px; padding: 10px 16px; color: #065f46; font-weight: 700; font-size: 0.92rem; margin-bottom: 16px; }
.modal-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* DIPLOMA */
.finale-card { border-color: #f59e0b; max-width: 720px; }
.diploma-preview { background: linear-gradient(135deg, #fef9c3, #fde68a, #fef3c7); border: 4px double #b45309; border-radius: 20px; padding: 12px; margin-bottom: 16px; box-shadow: inset 0 0 24px rgba(245, 158, 11, 0.28); }
.diploma-inner { border: 2px dashed #d97706; border-radius: 14px; padding: 14px 18px; background: rgba(255, 255, 255, 0.75); }
.dip-top { font-size: 0.85rem; font-weight: 800; color: #92400e; letter-spacing: 0.8px; margin-bottom: 4px; }
.dip-sub { font-size: 0.8rem; color: #475569; font-weight: 600; }
.dip-name-input { width: 100%; max-width: 380px; margin: 7px auto 8px; display: block; text-align: center; font-family: var(--font-ui); font-size: 1.35rem; font-weight: 800; color: #0f172a; background: #ffffff; border: 2.5px solid #f59e0b; border-radius: 12px; padding: 6px 14px; outline: none; user-select: text; -webkit-user-select: text; }
.dip-name-input:focus { border-color: #0284c7; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25); }
.dip-body { font-size: 0.86rem; color: #334155; line-height: 1.38; margin-bottom: 10px; }
.dip-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #78350f; border-top: 1px solid #fcd34d; padding-top: 8px; }
.gameover-card { border-color: #ef4444; }

@keyframes popBounce { 0% { transform: scale(0.86); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideUpPop { 0% { transform: translateX(-50%) translateY(20px) scale(0.92); opacity: 0; } 100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; } }

@media (max-width: 960px) {
    .brand-text small, .lvl-pill small, .controls-legend { display: none; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .mission-card { min-width: 220px; }
}
@media (max-width: 640px) {
    .top-bar { padding: 6px 8px; }
    .brand-badge { display: none; }
    .hud-chip { padding: 4px 8px; font-size: 0.76rem; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .modal-card { padding: 18px 16px; }
}
