/* ============================================
   DISCO ETERNO PARA LA ETERNA
   Estilo Soda Stereo — Oscuro, Neón, Onírico
   ============================================ */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-deep: #0a0a0f;
    --bg-mid: #12121e;
    --accent-violet: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --text-primary: #e2e8f0;
    --text-muted: #94a3b8;
    --glow-violet: 0 0 20px rgba(124, 58, 237, 0.4);
    --glow-blue: 0 0 20px rgba(59, 130, 246, 0.4);
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg-deep);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ============================================
   SISTEMA DE PANTALLAS
   ============================================ */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    overflow: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ============================================
   PANTALLA 1: EL DISCO ETERNO
   ============================================ */
#screen-intro {
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #12121e 0%, #0a0a0f 70%);
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 400px;
}

.subtitle {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 40px;
    opacity: 0.7;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.vinyl-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin-bottom: 30px;
    cursor: pointer;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.vinyl-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 240px;
    height: 240px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite;
    pointer-events: none;
}

.vinyl {
    width: 100%;
    height: 100%;
    animation: spin 4s linear infinite;
    filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.vinyl-container:active .vinyl {
    transform: scale(0.95);
}

.vinyl-container:hover .vinyl {
    filter: drop-shadow(0 0 25px rgba(124, 58, 237, 0.4));
}

.click-hint {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeInOut 3s ease-in-out infinite 2s;
    white-space: nowrap;
}

.title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: var(--glow-violet);
    animation: fadeInUp 1s ease-out 1.2s both;
}

.for-name {
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--accent-violet);
    opacity: 0.8;
    animation: fadeInUp 1s ease-out 1.5s both;
}

.joselyn {
    color: var(--accent-cyan);
    font-weight: 400;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: text-shadow 0.3s ease;
}

.joselyn:hover {
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.8);
}

/* ============================================
   PANTALLA 2: EL MAPA (placeholder)
   ============================================ */
#screen-map {
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
}

.map-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 160px 20px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 200px 60px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 250px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 280px 90px, rgba(255,255,255,0.2), transparent);
    background-size: 300px 100px;
    opacity: 0.5;
    animation: twinkle 5s ease-in-out infinite;
    pointer-events: none;
}

.map-title {
    font-size: 1rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
    z-index: 1;
}

.map-canvas {
    width: 100%;
    max-width: 350px;
    height: 350px;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    z-index: 1;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0.5;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 2;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--accent-violet);
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.3; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.6; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 380px) {
    .vinyl-container {
        width: 220px;
        height: 220px;
    }
    .title {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }
    .subtitle {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }
}

@media (min-width: 768px) {
    .vinyl-container {
        width: 320px;
        height: 320px;
    }
    .title {
        font-size: 2.5rem;
    }
}

/* ============================================
   PANTALLA 2: MAPA ESTELAR COMPLETO
   ============================================ */

#screen-map {
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
}

.map-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Canvas de estrellas de fondo */
.starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* UI del mapa */
.map-ui {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.map-header {
    text-align: center;
    margin-top: 10px;
}

.map-title {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-shadow: var(--glow-violet);
    margin-bottom: 6px;
}

.map-subtitle {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Toggle "Estamos juntos" */
.together-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 30px;
    padding: 8px 16px;
    margin: 5px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(124, 58, 237, 0.4);
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

.toggle-label {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.toggle-switch input:checked ~ .toggle-label {
    color: var(--accent-cyan);
}

/* Estado de confirmación */
.confirmation-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    animation: fadeInUp 0.4s ease-out;
    width: 100%;
}

.confirmation-text {
    font-size: 0.8rem;
    color: var(--accent-violet);
    letter-spacing: 1px;
    text-align: center;
}

.cancel-confirmation-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    padding: 5px 14px;
    color: #ef4444;
    font-size: 0.7rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.cancel-confirmation-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Panel de ubicaciones */
.locations-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.5s, transform 0.5s;
}

.locations-panel.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.location-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.location-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sebastian-dot {
    background: var(--accent-violet);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.6);
}

.joselyn-dot {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.location-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    width: 100%;
}

.location-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.location-input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.location-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.4;
    letter-spacing: 4px;
}

/* Tarjetas de ubicación (unificadas) */
.location-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 0.8rem;
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
    width: 100%;
}

.location-card-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.8;
}

.location-card-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.location-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 2px;
}

.edit-location-btn {
    background: transparent;
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
    padding: 5px 14px;
    color: var(--accent-violet);
    font-size: 0.7rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 4px;
}

.edit-location-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-violet);
}

/* Ubicación del otro usuario */
.other-location-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
}

.other-location-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.8;
}

.other-location-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.other-location-value {
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.other-location-value:empty::before {
    content: "Esperando ubicación...";
    color: var(--text-muted);
    opacity: 0.4;
    font-style: italic;
}

.save-locations-btn {
    background: transparent;
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
    padding: 8px 20px;
    color: var(--accent-violet);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    align-self: center;
    margin-top: 4px;
}

.save-locations-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

/* Mensaje "Estamos juntos" */
.together-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.together-heart {
    font-size: 3rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
    animation: pulseHeart 2s ease-in-out infinite;
}

.together-text {
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-shadow: var(--glow-violet);
}

.together-subtext {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    opacity: 0.8;
}

@keyframes pulseHeart {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Canvas del mapa visual */
.map-visual-container {
    width: 100%;
    max-width: 350px;
    height: 280px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-canvas-real {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Zona de pulsos */
.pulse-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pulse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 30px;
    padding: 12px 28px;
    color: var(--accent-violet);
    font-size: 0.9rem;
    letter-spacing: 2px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.pulse-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
    transform: scale(1.02);
}

.pulse-btn:active {
    transform: scale(0.98);
}

.pulse-icon {
    font-size: 1.2rem;
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.pulse-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    min-height: 18px;
    text-align: center;
}

/* Pulsos recibidos */
.pulses-received {
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 10px;
}

.pulse-received {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-primary);
    animation: fadeInUp 0.4s ease-out;
}

.pulse-received.from-sebastian {
    border-left: 3px solid var(--accent-violet);
}

.pulse-received.from-joselyn {
    border-left: 3px solid var(--accent-cyan);
}

.pulse-received-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* Estado de conexión */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-dot.disconnected {
    background: #ef4444;
}

/* Back button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 2;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--accent-violet);
}

/* Selector de identidad */
.identity-selector {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 12px;
    margin: 5px 0;
}

.identity-question {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-align: center;
}

.identity-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.identity-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    padding: 10px 18px;
    color: var(--text-primary);
    font-size: 0.85rem;
    letter-spacing: 1px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.identity-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-violet);
    transform: scale(1.05);
}

.identity-btn:active {
    transform: scale(0.98);
}

.identity-btn.sebastian-btn:hover {
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

.identity-btn.joselyn-btn:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.identity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.current-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 20px;
    font-size: 0.8rem;
}

.identity-label {
    color: var(--text-muted);
    letter-spacing: 1px;
}

.identity-name {
    color: var(--accent-cyan);
    font-weight: 500;
    letter-spacing: 1px;
}

.change-identity-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 4px;
    transition: color 0.3s;
}

.change-identity-btn:hover {
    color: var(--accent-violet);
}

/* Leyenda del mapa */
.map-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-name {
    color: var(--text-muted);
}

/* Modo "juntos" — cambios globales */
body.together-mode #screen-map {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #0a0a0f 100%);
}

body.together-mode .map-title {
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* ============================================
   CAPÍTULOS / PORTADAS DE DISCO (Paso 4)
   ============================================ */
.chapters-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.chapters-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.6;
}

.chapters-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px;
    width: 100%;
    justify-content: center;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.chapters-grid::-webkit-scrollbar {
    display: none;
}

.chapter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.chapter-card:hover {
    transform: translateY(-5px);
}

.chapter-card:active {
    transform: scale(0.95);
}

.chapter-disc {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bg-mid) 0%, var(--bg-deep) 100%);
    border: 2px solid rgba(124, 58, 237, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.1);
    transition: all 0.3s ease;
}

.chapter-card:hover .chapter-disc {
    border-color: var(--accent-violet);
    box-shadow: var(--glow-violet);
}

.chapter-disc-inner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 1px solid rgba(124, 58, 237, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-violet);
    font-weight: bold;
}

.chapter-title {
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: center;
    max-width: 70px;
    line-height: 1.3;
    opacity: 0.8;
    transition: color 0.3s;
}

.chapter-card:hover .chapter-title {
    color: var(--text-primary);
}

/* Modal de capítulo */
.chapter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chapter-modal.active {
    display: flex;
    opacity: 1;
}

.chapter-modal-content {
    background: var(--bg-mid);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    animation: fadeInUp 0.4s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.chapter-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.chapter-modal-close:hover {
    color: var(--accent-violet);
}

.chapter-modal-disc {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    border: 2px solid rgba(124, 58, 237, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-violet);
    font-weight: bold;
    animation: spin 8s linear infinite;
}

.chapter-modal-title {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-align: center;
    text-shadow: var(--glow-violet);
}

.chapter-modal-body {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

.chapter-modal-body p {
    margin-bottom: 12px;
}

.chapter-placeholder {
    padding: 20px;
    border: 1px dashed rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ============================================
   CONTADOR DEL 17 (Paso 7)
   ============================================ */
.counter-17 {
    position: absolute;
    top: 60px;
    right: 15px;
    z-index: 2;
    padding: 8px 14px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.counter-17:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}

.counter-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.counter-label {
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.7;
}

.counter-value {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

/* ============================================
   MENSAJE FINAL SECRETO (Paso 5)
   ============================================ */
.final-message {
    width: 100%;
    position: relative;
    padding: 20px;
    margin: 10px 0;
    animation: fadeInUp 0.8s ease-out;
}

.final-message-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: pulseGlow 3s ease-in-out infinite;
}

.final-message-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.final-message-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
    animation: pulseHeart 2s ease-in-out infinite;
}

.final-message-title {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--text-primary);
    text-shadow: var(--glow-violet);
}

.final-message-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-style: italic;
}

.final-message-subtext {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Responsive map */
@media (max-width: 380px) {
    .map-ui {
        gap: 15px;
    }
    .map-title {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }
    .map-visual-container {
        height: 220px;
    }
    .together-heart {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .map-visual-container {
        height: 340px;
        max-width: 400px;
    }
    .chapters-grid {
        gap: 16px;
    }
    .chapter-disc {
        width: 64px;
        height: 64px;
    }
    .counter-17 {
        top: 70px;
        right: 25px;
    }
}
