/* Cinematic Intro */
.cinematic-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cinematic-nurse-video {
    position: absolute;
    inset: -10%; /* Extra margins to prevent white borders on zoom/pan */
    width: 120vw;
    height: 120vh;
    background: url('../assets/nurse_intro.png') center/cover no-repeat;
    z-index: 1;
    filter: brightness(0.55) contrast(1.1) saturate(0.85);
    animation: slowZoomPan 25s infinite alternate ease-in-out;
}

@keyframes slowZoomPan {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(-2%, 2%); }
}
.cinematic-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, #000 80%);
    z-index: 2;
}
.cinematic-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    text-align: center;
    padding: 2rem;
}
.alert-icon {
    font-size: 4rem;
    color: var(--color-danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    display: block;
    margin-bottom: 2rem;
}
.pulse-fast { animation: pulseFast 1s infinite; }
@keyframes pulseFast {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 40px rgba(239, 68, 68, 1); }
    100% { transform: scale(1); opacity: 0.8; }
}
.typewriter-container {
    min-height: 150px;
    margin-bottom: 3rem;
}
.briefing-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #ffd;
    text-shadow: 0 0 5px rgba(255, 255, 200, 0.5);
    text-align: left;
    white-space: pre-wrap;
}
.intro-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    opacity: 0;
    transition: opacity 1s;
    transform: translateY(20px);
}
.intro-actions.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── TOUCH ACTION: instant tap on all interactive elements ─── */
.data-card,
.timeline-card,
.stamp-card,
.drop-zone,
.timeline-dropzone,
.discharge-dropzone,
.prescription-opt,
.num-btn,
.dial-btn {
    touch-action: manipulation;
}

/* Escape Room HUD */
#escape-room-view { padding: 20px; max-width: 1400px; margin: 0 auto; height: 100vh; display: flex; flex-direction: column; gap: 20px; }
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 0 20px rgba(6, 182, 212, 0.1);
}
.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}
.danger-text { color: var(--color-danger); text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.danger-text i { animation: pulseFast 1s infinite; }
.lives-container i { color: var(--color-accent); font-size: 1.5rem; filter: drop-shadow(0 0 5px rgba(225, 29, 72, 0.5)); transition: all 0.3s; }
.lives-container i.lost { opacity: 0.2; transform: scale(0.8); filter: grayscale(1); }

/* Progression Nodes */
.progress-nodes { display: flex; align-items: center; gap: 4px; }
.p-node { width: 28px; height: 28px; border-radius: 50%; background: #1e293b; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; border: 2px solid #334155; color: #64748b; transition: all 0.3s; }
.p-node.active { background: var(--color-success); border-color: var(--color-success); color: #fff; box-shadow: 0 0 10px var(--color-success); }
.p-node.line { width: 15px; height: 2px; background: #334155; border: none; border-radius: 0; }
.p-node.line.active { background: var(--color-success); }

.clue-btn {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.clue-btn:hover { background: rgba(245, 158, 11, 0.2); transform: scale(1.05); }
.clue-btn.disabled { opacity: 0.5; cursor: not-allowed; border-color: #64748b; color: #64748b; }
.score-container { color: var(--color-primary); font-size: 1.5rem; letter-spacing: 2px; }

/* Room Layout */
.room-container {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.room-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.room-header h2 { font-size: 1.8rem; color: #fff; margin-bottom: 10px; letter-spacing: 1px; }
.room-header p { color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }
.room-timer { position: absolute; right: 0; top: 0; background: rgba(239, 68, 68, 0.15); color: var(--color-danger); border: 1px solid var(--color-danger); padding: 8px 16px; border-radius: 30px; font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 8px; box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }

/* Drag & Drop Area */
.drag-drop-layout {
    display: flex;
    gap: 40px;
    flex: 1;
}
.cards-column { flex: 0 0 35%; display: flex; flex-direction: column; }
.drop-column { flex: 1; display: flex; flex-direction: column; }
.cards-column h3, .drop-column h3 { font-size: 1.2rem; margin-bottom: 20px; color: var(--color-primary); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid rgba(6, 182, 212, 0.3); padding-bottom: 10px; }

.draggables-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}
.data-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    cursor: grab;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.data-card:active { cursor: grabbing; transform: scale(1.02); box-shadow: 0 8px 15px rgba(0,0,0,0.2); border-color: var(--color-primary); }
.data-card.dragging { opacity: 0.5; }

.drop-zones-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.drop-zone {
    background: rgba(15, 23, 42, 0.6);
    border: 2px dashed rgba(100, 116, 139, 0.5);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    transition: all 0.3s;
}
.drop-zone h4 { font-size: 0.9rem; color: #cbd5e1; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.drop-zone h4 i { color: var(--color-primary); }
.drop-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 50px;
}
.drop-zone.drag-over { border-color: var(--color-primary); background: rgba(6, 182, 212, 0.1); }
.drop-zone.correct { border-color: var(--color-success); border-style: solid; background: rgba(16, 185, 129, 0.1); }
.drop-zone.incorrect { border-color: var(--color-danger); background: rgba(239, 68, 68, 0.1); animation: shake 0.5s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* Modal overlays */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}
.modal-overlay.hidden {
    display: flex !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1;
}
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    max-width: 500px;
    padding: 40px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}
.success-icon {
    font-size: 5rem;
    color: var(--color-success);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
}
.modal-content h2 { font-size: 2rem; margin-bottom: 16px; }
.verification-code {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
}
.verification-code span {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    width: 60px;
    height: 70px;
    background: #1e293b;
    border: 2px solid var(--color-success);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.2), 0 5px 15px rgba(0,0,0,0.3);
}

/* Sala 2: Laboratorio */
.lab-layout { display: flex; gap: 40px; flex: 1;}
.lab-panel { flex: 0 0 45%; }
.lock-panel { flex: 1; display: flex; flex-direction: column;}
.lab-panel h3, .lock-panel h3 { font-size: 1.2rem; color: var(--color-primary); margin-bottom: 20px; text-transform: uppercase; border-bottom: 1px solid rgba(6,182,212,0.3); padding-bottom: 10px; }

.lab-results { display: flex; flex-direction: column; gap: 12px; }
.lab-item { background: rgba(15,23,42,0.8); border-left: 4px solid var(--color-primary); padding: 15px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.lab-item.abnormal { border-left-color: var(--color-danger); animation: pulse-border 2s infinite;}
.lab-name { font-weight: 600; color: #cbd5e1; font-size: 0.95rem; }
.lab-val { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: #fff; }
.lab-item.abnormal .lab-val { color: var(--color-danger); }

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 8px 0 rgba(239, 68, 68, 0.6); }
}

/* Candado MIDE */
.combination-lock { display: flex; justify-content: space-between; gap: 8px; background: #0f172a; border: 2px solid #334155; padding: 25px 15px; border-radius: var(--border-radius-lg); box-shadow: inset 0 0 30px #000; margin-top: 10px; }
.dial-column { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.dial-label { font-size: 0.75rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; min-height: 28px;}
.dial-btn { background: #1e293b; border: 1px solid #475569; color: #94a3b8; width: 44px; height: 32px; display: flex; justify-content: center; align-items: center; cursor: pointer; border-radius: 6px; transition: all 0.2s; font-size: 1.2rem; }
.dial-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: scale(1.05); }
.dial-btn:active { transform: scale(0.95); }
.dial-window { width: 100%; height: 60px; background: #000; border: 2px solid #334155; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: #f8fafc; text-align: center; line-height: 1.1; padding: 0 4px; box-shadow: inset 0 3px 10px rgba(255,255,255,0.1), inset 0 -3px 10px rgba(0,0,0,0.8); text-transform: uppercase; }

/* Sala 3: Consultorio */
.consult-layout { display: flex; gap: 40px; }
.patient-profile { flex: 0 0 30%; background: rgba(15,23,42,0.6); padding: 30px 20px; border-radius: var(--border-radius-md); border: 1px solid var(--glass-border); text-align: center; }
.profile-image { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--color-primary); margin: 0 auto 16px; background-size: cover; background-position: center; box-shadow: 0 0 20px rgba(6,182,212,0.3); }
.patient-summary { text-align: left; font-size: 0.95rem; color: #cbd5e1; margin-top: 24px; background: rgba(0,0,0,0.3); padding: 16px; border-radius: 8px; border-left: 3px solid var(--color-accent); line-height: 1.6;}

.prescription-panel { flex: 1; background: rgba(15,23,42,0.8); border-radius: var(--border-radius-lg); border: 1px solid rgba(6,182,212,0.3); display: flex; flex-direction: column; overflow: hidden; box-shadow: inset 0 0 30px rgba(0,0,0,0.5); }
.prescription-panel h3 { background: rgba(0,0,0,0.4); padding: 18px 24px; font-size: 1.2rem; border-bottom: 1px solid rgba(6,182,212,0.2); margin: 0; color: #fff; display: flex; align-items: center; gap: 10px; }
.chat-container { padding: 30px; flex: 1; display: flex; flex-direction: column; gap: 24px; }
.chat-bubble { background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3); padding: 20px; border-radius: 12px; border-top-left-radius: 2px; font-size: 1.1rem; color: #f8fafc; line-height: 1.5; box-shadow: 0 4px 10px rgba(0,0,0,0.2); align-items: flex-start; }
.options-container { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.prescription-opt { text-align: left; background: rgba(30,41,59,0.8); border: 1px solid #475569; padding: 16px 20px; border-radius: 8px; color: #e2e8f0; font-size: 1rem; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; gap: 12px; align-items: center; font-family: var(--font-body); }
.prescription-opt i { color: var(--color-primary); font-size: 1.4rem; transition: transform 0.2s;}
.prescription-opt:hover { background: rgba(6,182,212,0.2); border-color: var(--color-primary); color: #fff; transform: translateX(5px); box-shadow: 0 4px 12px rgba(6,182,212,0.2); }
.prescription-opt:hover i { transform: scale(1.2); }
.prescription-opt.correct { background: rgba(16,185,129,0.2); border-color: var(--color-success); color: #fff; }
.prescription-opt.correct i { color: var(--color-success); }
.prescription-opt.incorrect { background: rgba(239,68,68,0.2); border-color: var(--color-danger); color: #fff; animation: shake 0.5s; }
.prescription-opt.incorrect i { color: var(--color-danger); }

.flex { display: flex; }
.gap-2 { gap: 1rem; }

/* Sala 4: Emergencias */
.room-header.danger-mode h2 { color: var(--color-danger); text-shadow: 0 0 10px rgba(239, 68, 68, 0.8); animation: shake 4s infinite; }
.room-header.danger-mode .pulse-fast { animation: pulseFast 0.5s infinite; color: var(--color-danger); border-color: var(--color-danger);}
.timeline-layout { display: flex; gap: 40px; flex: 1; }
.actions-pool { flex: 0 0 40%; background: rgba(15,23,42,0.8); padding: 25px; border-radius: var(--border-radius-md); border: 2px dashed var(--color-danger); }
.actions-pool h3 { font-size: 1.2rem; color: var(--color-danger); margin-bottom: 20px; text-transform: uppercase; border-bottom: 1px solid rgba(239,68,68,0.3); padding-bottom: 10px;}
.timeline-slots { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 15px; border-left: 4px solid #334155; padding-left: 20px; position: relative; overflow-y: auto;}
.timeline-slots h3 { font-size: 1.2rem; margin-bottom: 10px; color: #cbd5e1; }
.timeline-dropzone { background: rgba(0,0,0,0.4); border: 2px dashed #475569; padding: 10px; border-radius: 6px; min-height: 80px; display: flex; align-items: stretch; gap: 16px; position: relative; transition: all 0.3s; }
.timeline-dropzone .drop-area.room4-drop { flex: 1; display: flex; align-items: stretch;}
.timeline-dropzone.drag-over { border-color: var(--color-primary); background: rgba(6,182,212,0.1); }
.timeline-dropzone.correct { border-color: var(--color-success); border-style: solid; background: rgba(16,185,129,0.1); }
.timeline-dropzone.incorrect { border-color: var(--color-danger); border-style: dotted; background: rgba(239, 68, 68, 0.1); animation: shake 0.5s;}
.step-num { font-family: var(--font-heading); font-size: 2rem; color: #475569; font-weight: 800; min-width: 40px; text-align: center; display: flex; align-items: center; justify-content: center;}
.timeline-dropzone.correct .step-num { color: var(--color-success); text-shadow: 0 0 10px rgba(16,185,129,0.5);}
.timeline-card { background: #1e293b; border-left: 4px solid var(--color-warning); padding: 15px; border-radius: 4px; cursor: grab; font-weight: 600; color: #f8fafc; font-size: 0.95rem; box-shadow: 0 4px 6px rgba(0,0,0,0.3); transition: all 0.2s; width: 100%; display: flex; align-items: center;}
.timeline-card:active { cursor: grabbing; transform: scale(1.02); border-left-color: var(--color-primary); }

/* Sala 5: Alta Hospitalaria */
.room-header.success-mode h2 { color: var(--color-success); text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.room-header.success-mode .room-timer { color: var(--color-success); border-color: var(--color-success); background: rgba(16,185,129,0.1); }
.discharge-layout { display: flex; gap: 40px; flex: 1; }
.clipboard-panel { flex: 1; background: #fdfdfd; border-radius: 8px; color: #1e293b; padding: 0; box-shadow: 0 10px 25px rgba(0,0,0,0.5); overflow: hidden; position: relative; display: flex; flex-direction: column;}
.clipboard-panel::before { content: ''; position: absolute; top:0; left: 30px; bottom:0; width: 2px; background: rgba(225,29,72,0.3); } 
.clipboard-header { background: #e2e8f0; padding: 20px 30px 20px 50px; border-bottom: 2px solid #cbd5e1; display: flex; justify-content: space-between; align-items: center; }
.clipboard-header h3 { color: #0f172a; margin:0; font-size:1.3rem; display: flex; align-items: center; gap: 8px;}
.patient-id { background: #3b82f6; color: white; padding: 6px 14px; border-radius: 4px; font-weight: 700; font-family: var(--font-heading);}
.clipboard-body { padding: 30px 30px 30px 50px; flex: 1; display: flex; flex-direction: column;}
.clipboard-body p { margin-bottom: 15px; font-size: 1.05rem; }
.discharge-slots { display: flex; flex-direction: column; gap: 15px; margin-bottom: 25px; flex: 1;}
.discharge-dropzone { border-bottom: 2px dashed #94a3b8; min-height: 50px; background: rgba(241, 245, 249, 0.5); display: flex; align-items: center; transition: all 0.3s; padding: 5px 10px;}
.discharge-dropzone.drag-over { background: rgba(59, 130, 246, 0.1); border-bottom-color: #3b82f6; }
.discharge-dropzone .drop-area.room5-drop { flex: 1; display: flex; width: 100%; min-height: 40px; align-items: center;}

.stamps-pool { flex: 0 0 40%; background: rgba(15,23,42,0.8); padding: 25px; border-radius: var(--border-radius-md); border: 2px solid var(--color-success); display: flex; flex-direction: column; }
.stamps-pool h3 { color: var(--color-success); margin-bottom: 5px; font-size: 1.2rem; text-transform: uppercase;}
.stamps-container { display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; padding-right: 10px;}
.stamp-card { background: #f1f5f9; border-left: 5px solid var(--color-primary); color: #0f172a; padding: 12px 15px; border-radius: 4px; cursor: grab; font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.2s; display: flex; align-items: center; width: 100%;}
.stamp-card:active { cursor: grabbing; transform: scale(1.02); }

.btn-success { background: var(--color-success) !important; color: white !important; border:none;}
.btn-success:hover:not(:disabled) { background: #059669 !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
.btn-success:disabled { background: #94a3b8 !important; color: #e2e8f0 !important; cursor: not-allowed; opacity: 0.7;}

/* Sala 6: Farmacia */
.room-header.crypto-mode h2 { color: #a855f7; text-shadow: 0 0 10px rgba(168, 85, 247, 0.4); }
.room-header.crypto-mode .room-timer { color: #a855f7; border-color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.pharmacy-layout { display: flex; gap: 40px; }
.prescription-order { flex: 1; background: #fffdf2; border-radius: 4px; padding: 30px; border: 1px solid #d4d4d8; box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-family: 'Courier New', Courier, monospace; color: #18181b; }
.prescription-order h3 { border-bottom: 2px dashed #a1a1aa; padding-bottom: 15px; margin-bottom: 20px; color: #3f3f46; font-family: var(--font-heading); text-transform: uppercase; font-size: 1.2rem; display: flex; align-items: center; gap: 8px;}
.prescription-text { font-size: 1.15rem; line-height: 1.8; color: #27272a;}
.dispensary-safe { flex: 0 0 340px; background: #334155; padding: 30px; border-radius: 12px; border: 4px solid #1e293b; box-shadow: 0 10px 25px rgba(0,0,0,0.8); }
.safe-display { background: #0f172a; color: #22c55e; font-family: 'Courier New', monospace; font-size: 3rem; text-align: center; padding: 20px; border-radius: 8px; margin-bottom: 25px; box-shadow: inset 0 0 15px rgba(34, 197, 94, 0.3); letter-spacing: 5px; min-height: 90px; border: 2px solid #000;}
.safe-display.error { color: #ef4444; box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.3); animation: shake 0.4s;}
.safe-display.success-pass { color: #10b981; box-shadow: inset 0 0 25px rgba(16, 185, 129, 0.6); }
.numpad { display: flex; flex-direction: column; gap: 15px; }
.num-row { display: flex; gap: 15px; justify-content: center; }
.num-btn { width: 75px; height: 75px; border-radius: 50%; border: none; background: #cbd5e1; font-size: 1.8rem; font-family: var(--font-heading); font-weight: 700; color: #0f172a; cursor: pointer; box-shadow: 0 6px 0 #94a3b8; transition: all 0.1s; display: flex; align-items: center; justify-content: center;}
.num-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #94a3b8; background: #e2e8f0; }
.btn-clear { background: #fca5a5; color: #991b1b; box-shadow: 0 6px 0 #f87171; font-size: 1.2rem;}
.btn-clear:active { box-shadow: 0 0 0 #f87171; }
.btn-enter { background: #86efac; color: #166534; box-shadow: 0 6px 0 #4ade80; }
.btn-enter:active { box-shadow: 0 0 0 #4ade80; }

/* Modal success */

/* Escape Room Mobile Responsive */
@media (max-width: 992px) {
    #escape-room-view { padding: 10px; height: auto; min-height: 100vh; overflow-y: auto; }
    
    .hud { flex-wrap: wrap; justify-content: center; padding: 10px; gap: 15px; }
    .progress-nodes { display: none; } /* Ocultar nodos de progreso para ahorrar espacio */
    .score-container, .lives-container { font-size: 1rem; }
    
    .room-header h2 { font-size: 1.4rem; }
    .room-timer { position: static; margin: 10px auto; width: fit-content; font-size: 1.2rem; margin-bottom: 20px;}
    
    .drag-drop-layout { flex-direction: column; gap: 20px; }
    .cards-column { height: 35vh; min-height: 250px;} 
    .drop-zones-container { grid-template-columns: 1fr; gap: 10px; padding-bottom: 30px;}
    
    .lab-layout { flex-direction: column; }
    .combination-lock { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .dial-column { flex: 0 0 45%; }
    
    .consult-layout { flex-direction: column; gap: 20px; }
    .patient-profile { flex: 1; padding: 20px; }
    .profile-image { width: 100px; height: 100px; }
    .chat-bubble { font-size: 1rem; }
    .prescription-opt { padding: 12px; font-size: 0.95rem; }
    
    .timeline-layout { flex-direction: column; gap: 20px;}
    .timeline-slots { border-left: none; padding-left: 0; border-top: 4px solid #334155; padding-top: 20px;}

    .discharge-layout { flex-direction: column-reverse; gap: 20px;}
    .clipboard-panel::before { display: none; }
    .clipboard-header { padding: 15px; flex-direction: column; gap: 10px; align-items: flex-start;}
    .clipboard-body { padding: 15px; }

    .pharmacy-layout { flex-direction: column; gap: 20px;}
    .dispensary-safe { flex: 1; padding: 20px;}
    .num-btn { width: 60px; height: 60px; font-size: 1.4rem; box-shadow: 0 4px 0 #94a3b8;}
    .num-btn:active { transform: translateY(4px); }

    .cinematic-content { padding: 1rem; }
    .briefing-text { font-size: 1.1rem; }
    .intro-actions { width: 100%; }
    .intro-actions button { width: 100%; }
}

@media (max-width: 480px) {
    .briefing-text { font-size: 0.95rem; }
    .hud-item { font-size: 1rem; }
    .room-header h2 { font-size: 1.2rem; }
    .room-header p { font-size: 0.85rem; }
    .data-card { padding: 14px 12px; font-size: 0.9rem; min-height: 52px; }
    .timeline-card { padding: 12px; font-size: 0.9rem; min-height: 52px; }
    .stamp-card { padding: 10px 12px; font-size: 0.85rem; min-height: 52px; }
    .drop-zone { min-height: 90px; }
    .prescription-opt { font-size: 0.9rem; padding: 12px; }
    .dial-btn { width: 40px; height: 30px; font-size: 1rem; }
    .dial-window { font-size: 0.82rem; height: 52px; }
    .dial-label { font-size: 0.68rem; }
    .num-btn { width: 52px; height: 52px; font-size: 1.2rem; }
}

/* ── Touch Selection State ── */
.data-card.touch-selected,
.timeline-card.touch-selected,
.stamp-card.touch-selected {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.4), 0 8px 20px rgba(0,0,0,0.3) !important;
    transform: scale(1.03) !important;
    animation: touch-pulse 1s ease-in-out infinite;
    position: relative;
    z-index: 10;
}

@keyframes touch-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.4), 0 8px 20px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.2), 0 12px 25px rgba(0,0,0,0.4); }
}

/* Zones pulse green when a card is selected — guides the user where to tap */
.drop-zone.zone-ready,
.timeline-dropzone.zone-ready,
.discharge-dropzone.zone-ready {
    border-color: rgba(6, 182, 212, 0.8) !important;
    border-style: solid !important;
    background: rgba(6, 182, 212, 0.08) !important;
    animation: zone-pulse 1s ease-in-out infinite;
    min-height: 70px;
    cursor: pointer;
}

@keyframes zone-pulse {
    0%, 100% { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 0 0 0 rgba(6,182,212,0); }
    50% { border-color: rgba(6, 182, 212, 1); box-shadow: 0 0 0 4px rgba(6,182,212,0.15); }
}

