/* ===================== DESIGN TOKENS ===================== */
:root {
    /* Colors - Harmonized Light Mode */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-hover: rgba(241, 245, 249, 0.9);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.15);
    --accent-orange: #f97316;
    --accent-amber: #d97706;
    --accent-green: #059669;
    --accent-green-glow: rgba(5, 150, 105, 0.15);
    --accent-blue: #2563eb;
    --accent-blue-glow: rgba(37, 99, 235, 0.15);
    --accent-purple: #7c3aed;
    --accent-cyan: #0369a1;
    --accent-teal: #0d9488;

    --gradient-primary: linear-gradient(135deg, #ef4444, #f97316);
    --gradient-secondary: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-success: linear-gradient(135deg, #059669, #0d9488);
    --gradient-warning: linear-gradient(135deg, #d97706, #ef4444);
    --gradient-dark: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);

    --border-subtle: #e2e8f0;
    --border-light: #cbd5e1;
    --border-accent: rgba(37, 99, 235, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-red: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-glow-blue: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-glow-green: 0 8px 24px rgba(0, 0, 0, 0.25);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===================== ANIMATED BACKGROUND ===================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.08);
    animation: pulse-expand 8s ease-out infinite;
    will-change: transform;
}

.pulse-ring-1 {
    top: 20%;
    left: 30%;
    width: 200px;
    height: 200px;
    animation-delay: 0s;
}

.pulse-ring-2 {
    top: 60%;
    right: 20%;
    width: 300px;
    height: 300px;
    animation-delay: 2.5s;
}

.pulse-ring-3 {
    bottom: 10%;
    left: 50%;
    width: 150px;
    height: 150px;
    animation-delay: 5s;
}

@keyframes pulse-expand {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===================== SCREENS ===================== */
.screen {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.5s ease-out;
}

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

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

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

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-red);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 40px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255,255,255,0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================== INPUTS ===================== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

/* ===================== WELCOME SCREEN ===================== */
#screen-welcome {
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.welcome-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(var(--shadow-glow-red));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-text {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
}

.logo-text .accent {
    color: var(--accent-blue);
}

.logo-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255,255,255,0.15);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--space-md);
    position: relative;
    z-index: 10;
    transition: transform var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-light);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.feature-card h3 {
    font-size: 1.1rem;    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Stat card custom themes */
.results-countdown-banner {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 20px auto;
    background: linear-gradient(135deg, rgba(37,99,235,0.25), rgba(16,185,129,0.25));
    border: 1px solid rgba(59,130,246,0.4);
    border-radius: 14px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.stat-card-score {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.1);
}
.stat-card-time {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.stat-card-actions {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.stat-card-critical {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

#stat-score-circle {
    transform: scale(1.1);
    margin-bottom: 20px;
}
#stat-score-number {
    font-size: 1.5rem;
    text-shadow: none;
}
.stat-label-score {
    color: #047857;
    font-weight: bold;
    letter-spacing: 1px;
}
#stat-time {
    color: #1d4ed8;
    font-size: 2.2rem;
}
#stat-actions {
    color: #b45309;
    font-size: 2.2rem;
}
#stat-critical {
    color: #dc2626;
    font-size: 2.2rem;
}
.stat-label-critical {
    color: #b91c1c;
}

/* Breakdowns & Feedback */

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.player-setup {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.protocol-reminder {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 auto;
}

.protocol-badge {
    background: var(--accent-green);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===================== SCENARIOS SCREEN ===================== */
#screen-scenarios {
    flex-direction: column;
    padding: var(--space-2xl);
    align-items: center;
}

.scenarios-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    max-width: 800px;
    width: 100%;
}

.scenarios-header h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.scenarios-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}

/* ===================== DROPDOWN SELECTORS FOR MODE LIBRE ===================== */
.dropdown-control-panel {
    width: 100%;
    max-width: 960px;
    margin-bottom: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dropdown-group-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dropdown-group-card:hover {
    border-color: rgba(37, 99, 235, 0.45);
}

.dropdown-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.dropdown-card-icon {
    font-size: 1.8rem;
    background: #eff6ff;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}

.dropdown-card-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.dropdown-card-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.dropdown-action-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.modern-select {
    flex: 1;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modern-select:focus, .modern-select:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    background: #ffffff;
}

.modern-select option {
    background: #ffffff;
    color: #0f172a;
    padding: 12px;
}

.btn-launch-dropdown {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.btn-launch-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

.btn-minigame-launch {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-minigame-launch:hover {
    background: linear-gradient(135deg, #065f46, #022c22);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.tab {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all var(--transition-normal);
}

.tab:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    box-shadow: var(--shadow-glow-red);
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
    width: 100%;
    max-width: 1200px;
}

.scenario-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border-subtle);
    transition: background var(--transition-normal);
}

.scenario-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.scenario-card:hover::before {
    background: var(--gradient-primary);
}

.scenario-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.scenario-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenario-icon.trauma { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.scenario-icon.medical { color: var(--accent-blue); background: rgba(59, 130, 246, 0.1); }
.scenario-icon.environmental { color: var(--accent-green); background: rgba(34, 197, 94, 0.1); }

.scenario-difficulty {
    display: flex;
    gap: 4px;
}

.diff-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
}

.diff-dot.filled {
    background: var(--accent-orange);
}

.scenario-card h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.scenario-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.scenario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.scenario-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-trauma { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.tag-medical { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag-environmental { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tag-critical { background: #fef2f2; border: 1px solid #dc2626; color: #b91c1c; }
.tag-conscious { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.tag-unconscious { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.vitality-bar-fill.danger { background: #ef4444; }



/* ===================== CINEMATIC INTRO ===================== */
.cinematic-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease-out;
}

.cinematic-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.cinematic-content {
    text-align: center;
    max-width: 600px;
    padding: var(--space-xl);
}

.radio-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-icon {
    font-size: 4rem;
    z-index: 2;
}

.radio-waves {
    position: absolute;
    inset: -20px;
}

.radio-wave {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-red);
    border-radius: 50%;
    opacity: 0;
    animation: radio-pulse 2s infinite ease-out;
    will-change: transform, opacity;
}
.radio-wave:nth-child(2) { animation-delay: 0.6s; border-color: var(--accent-orange); }
.radio-wave:nth-child(3) { animation-delay: 1.2s; border-color: var(--accent-amber); }

@keyframes radio-pulse {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.dispatch-label {
    color: var(--accent-red);
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: var(--space-sm);
}

.dispatch-text {
    font-size: 1.5rem;
    color: #fff;
    font-family: var(--font-mono);
    min-height: 4.5rem;
    margin-bottom: var(--space-xl);
}

.dispatch-static span {
    display: inline-block;
    width: 4px;
    height: 15px;
    background: #fff;
    margin: 0 2px;
    animation: static-bar 0.2s infinite alternate;
}
.dispatch-static span:nth-child(even) { animation-delay: 0.1s; }
.dispatch-static span:nth-child(3) { animation-delay: 0.15s; }

@keyframes static-bar {
    0% { height: 5px; opacity: 0.5; }
    100% { height: 25px; opacity: 1; }
}

.cinematic-skip {
    opacity: 0;
    animation: fadeInSkip 1s forwards;
    animation-delay: 3s;
}

@keyframes fadeInSkip {
    to { opacity: 1; }
}

/* ===================== GAME LAYOUT ===================== */
.game-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Game Topbar */
.game-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 10;
}

/* Step Indicator — Compact */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.step.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    box-shadow: var(--shadow-glow-red);
    transform: scale(1.15);
}

.step.completed {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.step-line {
    width: 16px;
    height: 2px;
    background: var(--border-light);
    border-radius: 1px;
    transition: background var(--transition-normal);
}

.step-line.completed {
    background: var(--accent-green);
}

/* Timer — Compact Light Clinical Pill */
.timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.35rem 0.78rem;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Game Scene - Mode Clair Lumineux */
.game-scene {
    flex: 1;
    position: relative;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
}



.scene-bg {
    position: absolute;
    inset: -20px; /* slight overflow for screen shake */
    background-size: cover;
    background-position: center;
    filter: brightness(1.0) contrast(1.02);
    z-index: 0;
    transition: filter 1s ease;
}

.scene-bg.scene-bg-pov {
    background-size: cover;
    background-position: center bottom;
    filter: brightness(1.0) contrast(1.03);
}

.scene-bg.shake {
    animation: screenShake 0.4s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-10px, 5px); }
    40% { transform: translate(10px, -5px); }
    60% { transform: translate(-5px, 10px); }
    80% { transform: translate(5px, -10px); }
}

.scene-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(circle, transparent 40%, rgba(255, 255, 255, 0.4) 150%);
}

/* Characters */
.char-wrapper {
    position: absolute;
    bottom: -20px;
    height: 75%;
    width: 40%;
    z-index: 2;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.char-img {
    mix-blend-mode: multiply;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

/* Breathing animation */
.char-img {
    mix-blend-mode: multiply;
    animation: breathe 4s infinite ease-in-out;
    transform-origin: bottom center;
}

@keyframes breathe {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.02) translateY(-5px); }
}

.char-wrapper.shake .char-img {
    mix-blend-mode: multiply;
    animation: charShake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes charShake {
    10%, 90% { transform: translateX(-5px); }
    20%, 80% { transform: translateX(5px); }
    30%, 50%, 70% { transform: translateX(-10px); }
    40%, 60% { transform: translateX(10px); }
}

.char-wrapper.damage .char-img {
    mix-blend-mode: multiply;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8)) brightness(1.2);
    animation: damageFlash 0.5s ease-out;
}

@keyframes damageFlash {
    0% { filter: drop-shadow(0 0 40px rgba(239, 68, 68, 1)) brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(3); }
    100% { filter: drop-shadow(0 0 20px rgba(0,0,0,0.5)); }
}

.victim-side {
    right: 15%;
}

.witness-side {
    left: 10%;
    height: 70%; /* slightly smaller/further back */
    filter: none;
}

.char-name-tag {
    position: absolute;
    bottom: 30px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid #cbd5e1;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Floating Speech Bubbles */
.bubble-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none; /* Let clicks pass through */
}

.speech-bubble { pointer-events: auto;
    position: absolute;
    max-width: 340px;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: bouncyBubble 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards, slightFloat 3s ease-in-out infinite alternate;
    transform-origin: bottom center;
    opacity: 0;
    z-index: 50;
}

@keyframes bouncyBubble {
    0% { opacity: 0; transform: scale(0.3) translateY(20px); }
    50% { opacity: 1; transform: scale(1.05) translateY(-5px); }
    70% { opacity: 1; transform: scale(0.95) translateY(2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slightFloat {
    from { margin-bottom: 0; }
    to { margin-bottom: 5px; }
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    border-width: 8px 8px 0;
    border-style: solid;
    display: block;
    width: 0;
}

/* Bubble variants - Mode Clair Lumineux */
.bubble-victim {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border: 2px solid #ef4444;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.16);
}
.bubble-victim::after { border-color: #ef4444 transparent transparent transparent; }

.bubble-witness {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border: 2px solid #0284c7;
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.16);
}
.bubble-witness::after { border-color: #0284c7 transparent transparent transparent; }

.bubble-player {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border: 2px solid #10b981;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.16);
}
.bubble-player::after { border-color: #10b981 transparent transparent transparent; }


@keyframes bubbleIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.speech-bubble.fade-out {
    animation: bubbleOut 0.3s ease-in forwards;
}

@keyframes bubbleOut {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.8) translateY(-10px); }
}

.typewriter-cursor {
    display: inline-block;
    width: 6px;
    height: 1.2em;
    background-color: currentColor;
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Clues / Hotspots */
.clues-layer {
    position: absolute;
    inset: 0;
    z-index: 45;
    pointer-events: none;
}

.clue-hotspot {
    position: absolute;
    pointer-events: auto;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #0284c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all var(--transition-fast);
    animation: hotspotPulse 2s infinite;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.clue-hotspot:hover {
    background: #ffffff;
    border-color: #0369a1;
    transform: translate(-50%, -50%) scale(1.2);
}

.clue-hotspot.discovered {
    background: #ecfdf5;
    border-color: var(--accent-green);
    animation: none;
    opacity: 0.6;
}

@keyframes hotspotPulse {
    0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7); border-color: rgba(2, 132, 199, 0.9); }
    70% { box-shadow: 0 0 0 20px rgba(2, 132, 199, 0); border-color: rgba(2, 132, 199, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); border-color: rgba(2, 132, 199, 0.6); }
}

/* Vitals Panel — Left side, compact (Mode Clair) */
.vitals-panel {
    position: absolute;
    top: 80px;
    left: 16px;
    right: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    width: 230px;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: opacity var(--transition-normal);
    animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    color: #0f172a;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.vitals-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding-bottom: var(--space-xs);
}

.vital-row {
    display: flex;
    align-items: center;
    padding: 3px 0;
    font-size: 0.85rem;
}

.vital-row.hidden {
    display: none;
}

.vital-row.revealed {
    display: flex;
    animation: slideInRight 0.3s ease-out;
}

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

.vital-icon {
    width: 22px;
    font-size: 1rem;
    margin-right: var(--space-xs);
}

.vital-label {
    flex: 1;
    color: var(--text-secondary);
}

.vital-value {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.vital-row.danger .vital-value { color: var(--accent-red); text-shadow: 0 0 8px var(--accent-red-glow); animation: heartbeat 1s infinite; }
.vital-row.warning .vital-value { color: var(--accent-amber); }
.vital-row.ok .vital-value { color: var(--accent-green); }

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

/* Phase Badge — Hidden per user request */
.phase-badge {
    display: none;
}

.phase-badge-num {
    background: var(--gradient-primary);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.phase-badge-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}


/* Action Panel Header — Compact */
.action-panel {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    z-index: 20;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



.action-panel-header {
    height: auto;
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    pointer-events: auto;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.action-panel-phase {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.phase-number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.phase-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 1px;
    color: #0f172a;
}

.phase-info p {
    font-size: 0.75rem;
    color: #64748b;
}

/* ===================== DIALOGUE CHOICES ===================== */
.actions-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

/* Dialogue action bubble — Compact, dynamic, interactive */
.dialogue-choices-bubble {
    position: absolute;
    bottom: 5%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 88%;
    max-width: 400px;
    z-index: 200;
    pointer-events: auto;
    animation: bubbleSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bubbleSlideUp {
    0% { opacity: 0; transform: translate(-50%, 30px) scale(0.92); }
    60% { opacity: 1; transform: translate(-50%, -6px) scale(1.02); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

.bubble-action {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0,0,0,0.04);
    border-radius: var(--radius-lg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bubble-action:hover {
    border-color: #0284c7;
    box-shadow: 0 16px 45px rgba(2, 132, 199, 0.15);
}

/* On cache la petite pointe pour un style plus "panneau central" si c'est au milieu */
.bubble-action.dialogue-choices-bubble::after {
    display: none;
}


.dialogue-prompt {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: var(--space-sm);
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: var(--space-sm);
}

.dialogue-choices {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.choice-label {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    animation: slideInRight 0.3s ease forwards;
    animation-delay: var(--stagger, 0s);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.choice-label:hover:not(.locked) {
    background: #f0f9ff;
    border-color: var(--accent-blue);
    transform: translateX(5px);
}

.choice-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: var(--space-md);
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.choice-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.choice-icon {
    font-size: 1.2rem;
}

.choice-text {
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 600;
    line-height: 1.4;
}

.choice-label.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.choice-label.selected {
    background: #ecfdf5;
    border-color: var(--accent-green);
    color: #065f46;
}

.choice-label.selected input[type="checkbox"] {
    accent-color: var(--accent-green);
}

.choice-label.wrong {
    background: #fef2f2;
    border-color: var(--accent-red);
    color: #991b1b;
}

.choice-label.wrong input[type="checkbox"] {
    accent-color: var(--accent-red);
}

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

/* Phase transition */
.actions-layer.phase-transition-out {
    animation: fadeOutLayer 0.3s ease-in forwards;
}

.actions-layer.phase-transition-in {
    animation: fadeInLayer 0.4s ease-out forwards;
}

@keyframes fadeOutLayer {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeInLayer {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Phase action counter badge */
.phase-action-counter {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
    transition: all 0.3s ease;
}

.phase-action-counter.complete {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Character interaction pulse */
.char-wrapper.interact-pulse .char-img {
    mix-blend-mode: multiply;
    animation: interactPulse 0.6s ease-out;
}

@keyframes interactPulse {
    0% { filter: drop-shadow(0 0 0 rgba(59, 130, 246, 0)); }
    50% { filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6)) brightness(1.15); }
    100% { filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); }
}

.char-wrapper:hover .char-img {
    mix-blend-mode: multiply;
    filter: drop-shadow(0 10px 30px rgba(59, 130, 246, 0.7)) brightness(1.15);
    transition: filter 0.3s ease;
}

.char-wrapper:hover .char-name-tag {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.phase-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* Bottom Navigation — Buttons only, no container styling */
.bottom-navigation {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 20;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
}

.phase-navigation button {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    pointer-events: auto;
}

/* ===================== SEQUENTIAL ACTIONS UI — Compact & Interactive ===================== */
.sequential-action-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: var(--space-sm) var(--space-md);
    margin: 0;
    animation: cardFadeIn 0.35s ease forwards;
    transition: all 0.3s ease;
}

@keyframes cardFadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.dialogue-choices-bubble .sequential-action-card {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
}

.sequential-action-title {
    font-size: 0.75rem;
    color: #0284c7;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
    font-weight: 800;
    opacity: 1;
}

.sequential-action-text {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.sequential-action-detail {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: var(--space-sm);
    font-style: italic;
    line-height: 1.3;
}

.sequential-decision-buttons {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.btn-decision {
    flex: 1;
    padding: 10px var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-decision-yes {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.btn-decision-yes:hover:not(:disabled) {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-decision-no {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.btn-decision-no:hover:not(:disabled) {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-decision:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sequential-action-card.selected {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.08);
    animation: selectPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes selectPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.sequential-action-card.wrong {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ===================== FLOATING FAB ACTION DOCK ===================== */
.floating-fab-dock {
    position: fixed;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    z-index: 250;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.fab-btn .fab-icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

/* Color Themes & Gradients matching user screenshot */
.fab-btn.fab-notebook {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.5);
}

.fab-btn.fab-inventory {
    background: linear-gradient(135deg, #ff5e3a 0%, #ff2a6d 100%);
    box-shadow: 0 8px 24px rgba(255, 94, 58, 0.5);
}

.fab-btn.fab-phone {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

/* Hover & Active Press Effects */
.fab-btn:hover {
    transform: scale(1.16) translateY(-2px);
}

.fab-btn:hover .fab-icon {
    transform: scale(1.1) rotate(6deg);
}

.fab-btn:active {
    transform: scale(0.92);
}

/* Active Open Panel State */
.fab-btn.active-open {
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4), 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Floating Tooltip Label on Hover - Mode Clair */
.fab-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    background: #ffffff;
    color: #0f172a;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    letter-spacing: 0.01em;
}

.fab-btn:hover::after {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Dynamic Badges */
.fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.fab-badge.fab-badge-success {
    background: #10b981;
}

.fab-badge.fab-badge-alert {
    background: #ef4444;
    animation: fabBadgePulse 1.4s ease-in-out infinite;
}

@keyframes fabBadgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes fabBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.35) rotate(-10deg); }
    100% { transform: scale(1); }
}

.fab-bump {
    animation: fabBump 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.notebook-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 92vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid #cbd5e1;
    box-shadow: -8px 0 32px 0 rgba(15, 23, 42, 0.16);
    z-index: 320;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-slow);
    color: #0f172a;
}

.notebook-panel.hidden {
    transform: translateX(100%);
}

.notebook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.notebook-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.notebook-section {
    margin-bottom: var(--space-xl);
}

.notebook-section h4 {
    font-size: 0.95rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    letter-spacing: 0.5px;
}

.sample-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem;
}
.sample-row strong { color: var(--accent-amber); font-family: var(--font-mono); width: 22px; font-size: 1rem; }
.sample-row span { color: var(--text-secondary); }

#clues-log, #actions-log {
    list-style: none;
}

#clues-log li, #actions-log li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

#clues-log li::before { content: '🔍 '; }
#actions-log li::before { content: '✓ '; color: var(--accent-green); }

/* ===================== RESULTS SCREEN ===================== */
#screen-results {
    flex-direction: column;
    align-items: center;
    padding: var(--space-2xl);
    overflow-y: auto;
}

.results-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.results-header {
    text-align: center;
    animation: resultsAppear 0.6s ease-out;
}

.diagnosis-reveal {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-red);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    display: inline-block;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
    to { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
}

.diagnosis-label {
    font-size: 0.8rem;
    color: var(--accent-red);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.diagnosis-name {
    font-size: 1.7rem;
    color: white;
    font-weight: 800;
}

.result-grade {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--space-md);
    text-shadow: var(--shadow-lg);
}
.grade-a { color: var(--accent-green); }
.grade-b { color: var(--accent-teal); }
.grade-c { color: var(--accent-blue); }
.grade-d { color: var(--accent-amber); }
.grade-f { color: var(--accent-red); }

@keyframes resultsAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Stats — Bigger, more readable */
.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-sm);
}

.stat-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stat-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 8;
}

.stat-fill {
    fill: none;
    stroke: url(#score-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s ease-out;
}

.stat-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Breakdowns & Feedback */
.results-breakdown, .results-feedback {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.results-breakdown h3, .results-feedback h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.phase-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.phase-result-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.phase-result-number.perfect { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }
.phase-result-number.good { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.phase-result-number.partial { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.phase-result-number.missed { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }

.phase-result-info {
    flex: 1;
}

.phase-result-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.phase-result-info p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }

.phase-result-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.phase-result-bar-fill {
    height: 100%;
    border-radius: 2px;
}
.bar-green { background: var(--accent-green); }
.bar-blue { background: var(--accent-blue); }
.bar-amber { background: var(--accent-amber); }
.bar-red { background: var(--accent-red); }

.phase-result-score {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
}

.feedback-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-subtle);
}
.feedback-icon { font-size: 1.6rem; }
.feedback-content h4 { font-size: 1.05rem; margin-bottom: var(--space-xs); }
.feedback-content p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }

.results-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===================== BANDEAU DE NOTIFICATION NON-INTRUSIF (HAUT) ===================== */
.toast-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 20px), 440px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.toast {
    position: relative;
    width: 100%;
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(11, 27, 51, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.38;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.toast.success,
.toast.toast-success {
    border-color: rgba(52, 211, 153, 0.65);
    background: rgba(6, 78, 59, 0.95);
    color: #ecfdf5;
}

.toast.error,
.toast.toast-error {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(127, 29, 29, 0.96);
    color: #fef2f2;
}

.toast.warning,
.toast.toast-warning {
    border-color: rgba(251, 191, 36, 0.7);
    background: rgba(120, 53, 15, 0.95);
    color: #fffbeb;
}

.toast.info,
.toast.toast-info {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(11, 27, 51, 0.94);
    color: #f0f9ff;
}

/* Floating Points */
.points-float {
    position: absolute;
    font-weight: 900;
    font-size: 1.2rem;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 100;
    animation: floatUpFade 1s ease-out forwards;
}

@keyframes floatUpFade {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) scale(1.5); }
}

/* ===================== DIAGNOSIS CHALLENGE ===================== */
.diagnosis-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out;
}

.diagnosis-overlay.hidden {
    display: none;
}

.diagnosis-modal {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.98), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-2xl);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #f8fafc;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.diagnosis-modal-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.diagnosis-icon-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagnosis-modal-icon {
    font-size: 3rem;
    z-index: 2;
    position: relative;
}

.diagnosis-pulse-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: radio-pulse 2s infinite ease-out;
}

.diagnosis-modal-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: var(--space-sm);
}

.diagnosis-subtitle {
    color: #cbd5e1;
    font-size: 1rem;
}

.diagnosis-clues-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.diagnosis-clues-summary h4 {
    color: #93c5fd;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

/* ===================== VITALITY BAR ===================== */
.vitality-container-inline {
    width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.vitality-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0f172a;
}
.vitality-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
}
.vitality-bar-fill {
    width: 100%;
    height: 100%;
    background: #10b981; /* Green */
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* ===================== INVENTORY (TROUSSE) ===================== */

.inventory-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 92vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid #cbd5e1;
    box-shadow: -8px 0 32px 0 rgba(15, 23, 42, 0.16);
    z-index: 320;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-slow);
    color: #0f172a;
}

.inventory-panel.hidden {
    transform: translateX(100%);
}

.inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.inventory-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.inventory-instructions {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #475569;
}

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

.inv-item {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

.inv-item:hover {
    background: #f0f9ff;
    border-color: #0284c7;
}

.inv-item.equipped {
    background: #ecfdf5;
    border-color: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.inv-item-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.inv-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}


.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.evidence-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
    color: #e2e8f0;
    padding: 6px 0;
    line-height: 1.4;
}

.evidence-item .ev-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.diagnosis-choices {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.diagnosis-choice {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.4;
}

.diagnosis-choice:hover:not(.locked) {
    background: rgba(59, 130, 246, 0.15);
    border-color: #38bdf8;
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.diagnosis-choice-letter {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #93c5fd;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.diagnosis-choice:hover:not(.locked) .diagnosis-choice-letter {
    background: var(--accent-blue);
    color: white;
}

.diagnosis-choice.correct {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
    cursor: default;
}

.diagnosis-choice.correct .diagnosis-choice-letter {
    background: var(--accent-green);
    color: white;
}

.diagnosis-choice.wrong {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    cursor: default;
}

.diagnosis-choice.wrong .diagnosis-choice-letter {
    background: var(--accent-red);
    color: white;
}

.diagnosis-choice.locked {
    pointer-events: none;
    opacity: 0.5;
}

.diagnosis-choice.locked.correct {
    opacity: 1;
}

.diagnosis-result {
    text-align: center;
    padding: var(--space-xl) 0 0;
    border-top: 1px solid var(--border-subtle);
    animation: fadeIn 0.5s ease-out;
}

.diagnosis-result.hidden {
    display: none;
}

.diagnosis-result-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.diagnosis-result h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.diagnosis-result p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* ===================== RESPONSIVE BREAKPOINTS ===================== */

/* Tablet landscape / small desktops */
@media (max-width: 1024px) {
    .action-panel-header {
        padding: var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    .topbar-center {
        order: 3;
        width: 100%;
        justify-content: center !important;
        padding: var(--space-sm) 0 0 !important;
    }
    .vitals-panel {
        width: 240px;
        padding: var(--space-md);
    }
    .dialogue-choices-bubble {
        max-width: 480px;
    }
    .welcome-container {
        max-width: 700px;
    }
    .scenarios-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablet portrait / large phones */
@media (max-width: 768px) {
    .char-wrapper { width: 45%; }
    .victim-side { right: 5%; }
    .witness-side { left: 2%; height: 60%; }
    
    .action-panel {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    .action-panel-header {
        padding: var(--space-sm) var(--space-md);
    }
    .phase-info h3 { font-size: 1rem; }
    .phase-info p { font-size: 0.8rem; }
    .phase-number {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    
    .step {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .step-line {
        width: 16px;
    }
    
    .vitals-panel {
        width: 220px;
        top: 80px;
        right: 8px;
        padding: var(--space-md);
        font-size: 0.9rem;
    }
    .vitals-title { font-size: 0.85rem; }
    .vital-row { font-size: 0.9rem; }
    
    .dialogue-choices-bubble {
        max-width: 420px;
        width: 95%;
        bottom: 12%;
    }
    .sequential-action-text { font-size: 1rem; }
    
    .bottom-navigation {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: var(--space-md);
    }
    .phase-navigation button {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
    
    .phase-badge {
        top: 70px;
        left: var(--space-md);
    }
    .phase-badge-text { font-size: 0.85rem; }
    .phase-badge-num { width: 28px; height: 28px; font-size: 0.8rem; }
    
    .notebook-panel {
        width: 300px;
    }
    .notebook-toggle {
        padding: 0.8rem 1.1rem;
        font-size: 0.9rem;
    }
    
    .speech-bubble { pointer-events: auto;
        max-width: 280px;
        font-size: 0.95rem;
    }
    
    .diagnosis-modal { padding: var(--space-lg); }
    .evidence-grid { grid-template-columns: 1fr; }
    .diagnosis-choice {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    .scenarios-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: var(--space-md);
    }
    .scenario-card h3 { font-size: 1.15rem; }
    .scenario-card p { font-size: 0.9rem; }
    
    .results-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-value { font-size: 1.5rem; }
    .result-grade { font-size: 4rem; }
    
    .logo-text { font-size: 3rem; }
    .logo-subtitle { font-size: 1rem; }
}

/* Mobile phones */
@media (max-width: 480px) {
    .char-wrapper { width: 40%; }
    .victim-side { right: -5%; }
    .witness-side { left: -5%; height: 50%; }
    
    .action-panel-header {
        padding: var(--space-sm);
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }
    .topbar-center, #phase-description {
        display: none !important;
    }
    .action-panel-phase {
        gap: 5px;
    }
    .phase-info h3 {
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 110px;
        line-height: 1.1;
        margin: 0;
    }
    .phase-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    /* Shrink the right side of the header */
    .vitality-label { display: none !important; }
    .vitality-container-inline { display: none !important; }
    .timer { font-size: 0.9rem; margin-right: 5px; }
    .btn-ghost { padding: 4px 8px; font-size: 0.75rem; }
    
    .vitals-panel {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: flex-start !important;
        width: 100% !important;
        top: 80px !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        padding: 5px 0 !important;
        border-radius: 0 !important;
        border-left: none; border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        background: rgba(10, 14, 26, 0.95);
        z-index: 100 !important;
    }
    .vitals-panel.hidden {
        display: none !important;
    }
    .vitals-title, .vital-label { display: none !important; }
    .vital-row {
        flex-direction: column !important;
        gap: 2px !important;
        padding: 0 2px !important;
        font-size: 0.75rem !important;
        text-align: center;
    }
    .vital-row.hidden { display: none !important; }
    .vital-icon { width: auto; font-size: 1.2rem; margin: 0; }
    
    .dialogue-choices-bubble {
        max-width: 94%;
        width: 94%;
        bottom: 70px;
        background: rgba(15, 23, 42, 0.95);
        padding: 10px 12px;
    }
    .sequential-action-text { font-size: 0.88rem; }
    .sequential-action-title { font-size: 0.7rem; }
    
    .bottom-navigation {
        bottom: 4px;
        left: 4px;
        right: 4px;
        padding: var(--space-sm) var(--space-md);
    }
    .phase-navigation button {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .phase-badge {
        top: 62px;
        left: var(--space-sm);
        padding: 3px 12px 3px 3px;
    }
    .phase-badge-text { font-size: 0.75rem; }
    .phase-badge-num { width: 24px; height: 24px; font-size: 0.7rem; }
    
    .notebook-panel {
        width: 100%;
    }
    .notebook-toggle {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    .speech-bubble { pointer-events: auto;
        max-width: 220px;
        font-size: 0.9rem;
        padding: var(--space-sm) var(--space-md);
    }
    
    .diagnosis-modal {
        padding: var(--space-md);
        width: 95%;
    }
    .diagnosis-modal-header h2 { font-size: 1.4rem; }
    .diagnosis-choice {
        padding: var(--space-md);
        font-size: 0.95rem;
        gap: var(--space-md);
    }
    .diagnosis-choice-letter {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .welcome-container { padding: 0 var(--space-md); }
    .logo-text { font-size: 2.5rem; }
    .logo-subtitle { font-size: 0.9rem; }
    .logo-icon { width: 60px; height: 60px; }
    .feature-card { padding: var(--space-md); }
    
    .scenarios-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    .scenario-card h3 { font-size: 1.1rem; }
    
    .results-container { gap: var(--space-md); }
    .results-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    .stat-value { font-size: 1.3rem; }
    .stat-label { font-size: 0.75rem; }
    .result-grade { font-size: 3.5rem; }
    .results-breakdown, .results-feedback {
        padding: var(--space-md);
    }
    
    /* Active Alerts Overlay for Mobile */
    .active-alerts-overlay {
        top: 65px;
        right: 8px;
    }
    .alert-badge {
        padding: 6px 10px;
        gap: 8px;
    }
    .alert-badge .alert-subtext {
        display: none;
    }
    .alert-badge .alert-icon {
        font-size: 1.2rem;
    }
    .alert-badge .alert-title {
        font-size: 0.72rem;
    }
    
    .clue-hotspot {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .timer {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Minigames Mobile Fixes */
    .minigame-container {
        max-height: 85vh;
        overflow-y: auto;
        padding: 15px;
    }
    
    .naloxone-nose-area, .naloxone-head-tilt-area {
        width: 220px !important;
        height: 220px !important;
        margin-bottom: 10px !important;
    }
    
    .naloxone-spray-container {
        height: 80px !important;
        margin-bottom: 10px !important;
    }
    
    .naloxone-spray-draggable {
        height: 80px !important;
    }
}

/* ===================== ANIMATIONS & PARTICLES ===================== */
@keyframes breathe-normal {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes breathe-fast {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.03) translateY(4px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes danger-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.anim-breathe-normal {
    animation: breathe-normal 4s ease-in-out infinite;
}

.anim-breathe-fast {
    animation: breathe-fast 1.5s ease-in-out infinite;
}

.anim-danger-shake {
    animation: danger-shake 0.5s ease-in-out infinite;
}

.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 100;
    opacity: 1;
    transition: opacity 1s ease-out, transform 1s ease-out;
    will-change: transform, opacity;
}

/* ===================== VIRTUAL PHONE (MODE CLAIR) ===================== */
.phone-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 92vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-panel.hidden {
    transform: translateX(100%);
    display: flex;
}

.virtual-phone {
    width: 250px;
    height: 480px;
    background: #1e293b;
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    border: 3px solid #64748b;
    position: relative;
    margin: 0 auto;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f8fafc;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    font-size: 0.7rem;
    color: #0f172a;
    font-weight: 700;
}

.phone-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: #0f172a;
}

.phone-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
}

.phone-key {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.phone-key:active {
    background: #e2e8f0;
}

.phone-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
    gap: 10px;
}

.phone-call-btn {
    background: #10b981;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}
.phone-call-btn:hover {
    transform: scale(1.05);
}

.phone-cancel-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 18px;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.phone-cancel-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* ===================== NEW AESTHETICS ===================== */
/* Vignette Overlay - Mode Clair Léger & Réaliste */
.vignette-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    box-shadow: inset 0 0 100px rgba(15, 23, 42, 0.08);
}

/* Vitality Pulse Animations */
@keyframes heartbeat-pulse {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.vitality-warning #vitality-icon {
    animation: heartbeat-pulse 1s infinite;
}
.vitality-critical #vitality-icon {
    animation: heartbeat-pulse 0.5s infinite;
    color: #ef4444;
}

/* Critical Danger Screen Flash */
@keyframes critical-flash {
    0% { box-shadow: inset 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: inset 0 0 0 rgba(239, 68, 68, 0); }
}
.critical-danger-screen {
    animation: critical-flash 1s infinite;
}

/* Button Micro-animations & Base Styles */
.btn-action-no, .btn-action-yes {
    flex: 1;
    padding: 11px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
}
.btn-action-no {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.btn-action-no:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}
.btn-action-yes {
    font-weight: 800;
    background: linear-gradient(135deg, #c2410c, #b91c1c);
    color: #ffffff;
    border: 1px solid #9a3412;
}
.btn-action-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.28);
}

/* Phase Transitions */
.text-slide-up {
    animation: slideUpFade 0.5s ease forwards;
}
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}





/* ===================== MINIGAME OVERLAY (MODE CLAIR) ===================== */
.minigame-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}
.minigame-container {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    width: 600px;
    max-width: 90vw;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    color: #0f172a;
}
.minigame-header h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #0284c7;
    font-weight: 800;
}
.minigame-instructions {
    color: #475569;
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.minigame-area {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

/* CPR Game Styles */
.minigame-cpr {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.cpr-target-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    cursor: pointer;
    user-select: none;
}
.cpr-target {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
    z-index: 2;
}
.cpr-rhythm-ring {
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    border: 4px solid #1dd1a1;
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
}
.cpr-feedback {
    font-size: 1.35rem;
    font-weight: bold;
    margin-bottom: 14px;
    min-height: 30px;
    height: auto;
    line-height: 1.25;
}
.cpr-progress-bar {
    width: 80%;
    height: 15px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.cpr-progress-fill {
    height: 100%;
    width: 0%;
    background: #059669;
    transition: width 0.2s, background-color 0.2s;
}
.cpr-counter {
    font-size: 1.2rem;
    color: #475569;
    font-weight: 700;
}

/* AED Game Styles */
.minigame-aed {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.aed-torso {
    width: 300px;
    height: 350px;
    background-image: url('assets/closeup_aed_torso_v2.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    margin-bottom: 20px;
}
.aed-dropzone {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px dashed rgba(255,255,255,0.5);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
}
.aed-dropzone.filled {
    border-color: #1dd1a1;
    background: transparent;
}
.aed-pads-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 76px;
}
.aed-pad-draggable {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    border: 2px solid rgba(56, 189, 248, 0.7);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: grab;
    user-select: none;
}
.aed-pad-draggable:active {
    cursor: grabbing;
}
.aed-status {
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}
.aed-status.analyzing {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
    animation: pulse 1s infinite;
}
.aed-status.charging {
    color: #dc2626;
    background: #fee2e2;
    border-color: #fecaca;
    animation: shake 0.5s infinite;
}
.aed-status.shock {
    color: #047857;
    background: #d1fae5;
    border-color: #a7f3d0;
    font-weight: bold;
    transform: scale(1.1);
}

.minigame-overlay.hidden, .minigame-cpr.hidden, .minigame-aed.hidden { display: none !important; }


/* Naloxone Game Styles */
.minigame-naloxone {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.naloxone-phase-1, .naloxone-phase-2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.naloxone-head-container {
    width: 250px;
    height: 250px;
    margin-bottom: 20px;
}
.naloxone-head-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.head-tilt-btn {
    margin-top: 10px;
}

.naloxone-nose-area {
    position: relative;
    width: 250px;
    height: 250px;
    margin-bottom: 20px;
}
.naloxone-nose-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.naloxone-dropzone {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px dashed rgba(255,255,255,0.5);
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    bottom: 30px;
}
.left-nostril { left: 60px; }
.right-nostril { right: 60px; }
.naloxone-dropzone.filled {
    border-color: #1dd1a1;
    background: transparent;
}
.naloxone-spray-container {
    height: 120px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
.naloxone-spray-draggable {
    height: 120px;
    cursor: grab;
    transition: transform 0.1s;
}
.naloxone-spray-draggable:active {
    cursor: grabbing;
}
.naloxone-spray-draggable.clicked {
    transform: translateY(-20px) scale(0.95);
}
.naloxone-status {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-top: 15px;
    text-align: center;
}

/* Modern Ventilation Game Styles */
.minigame-ventilation {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.ventilation-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 22px 18px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.lungs-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 260px;
    height: 210px;
    margin-bottom: 12px;
}

.lungs-svg-bg {
    position: absolute;
    width: 230px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3));
    transition: transform 0.15s ease-out;
}

.minigame-ventilation.is-blowing .lungs-svg-bg {
    transform: translate(-50%, -50%) scale(1.08);
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

.lung-path {
    transition: fill 0.2s ease, transform 0.2s ease;
}

.minigame-ventilation.is-blowing .lung-path {
    fill: rgba(59, 130, 246, 0.45);
}

.lungs-container {
    width: 68px;
    height: 195px;
    padding: 4px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 34px;
    position: relative;
    background: rgba(10, 15, 30, 0.85);
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.8);
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lungs-container.success-pulse {
    animation: ventPulseSuccess 0.45s ease-out;
}

.lungs-container.error-shake {
    animation: ventShakeError 0.35s ease-in-out;
}

@keyframes ventPulseSuccess {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(29, 209, 161, 0.8); }
    50% { transform: scale(1.08); box-shadow: 0 4px 35px rgba(0, 0, 0, 0.3); border-color: #1dd1a1; }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(29, 209, 161, 0); }
}

@keyframes ventShakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); border-color: #ff6b6b; }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.lungs-gauge-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.lungs-gauge-ticks {
    position: absolute;
    left: -70px;
    height: 195px;
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 3;
}

.tick {
    text-align: right;
    padding-right: 6px;
    position: absolute;
}
.tick-100 { top: 4px; right: 0; color: #ff6b6b; }
.tick-green-top { top: 35%; right: 0; color: #1dd1a1; }
.tick-green-bottom { bottom: 42%; right: 0; color: #1dd1a1; }
.tick-0 { bottom: 4px; right: 0; color: #94a3b8; }

.lungs-gauge-greenzone {
    position: absolute;
    bottom: 45%;
    height: 20%;
    width: 100%;
    background: rgba(29, 209, 161, 0.25);
    border-top: 2px dashed #1dd1a1;
    border-bottom: 2px dashed #1dd1a1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lungs-gauge-greenzone .zone-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #1dd1a1;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.lungs-gauge-redzone {
    position: absolute;
    bottom: 65%;
    height: 35%;
    width: 100%;
    background: rgba(255, 107, 107, 0.2);
    border-top: 2px dashed #ff6b6b;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.lungs-gauge-redzone .zone-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ff6b6b;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.lungs-gauge-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 0%;
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* NO height transition here to allow smooth 60fps JS animation */
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.lungs-gauge-fill.status-green {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lungs-gauge-fill.status-red {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ventilation-metrics {
    margin-bottom: 10px;
}

.ventilation-volume-badge {
    font-family: 'JetBrains Mono', monospace, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px 18px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow: none;
    min-width: 120px;
    text-align: center;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ventilation-volume-badge.green {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.5);
    text-shadow: none;
}

.ventilation-volume-badge.red {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.5);
    text-shadow: none;
}

.ventilation-feedback {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #f1f5f9;
    transition: color 0.2s ease;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.ventilation-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 14px;
    width: 100%;
}

.ventilation-btn {
    padding: 14px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    touch-action: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
    width: 85%;
    max-width: 300px;
}

.ventilation-btn:active, .ventilation-btn.blowing {
    transform: scale(0.96);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.6), inset 0 0 10px rgba(0,0,0,0.3);
}

.ventilation-btn .btn-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.ventilation-btn .btn-subtext {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.85;
}

.keyboard-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.keyboard-hint kbd {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.72rem;
    color: #f1f5f9;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.ventilation-dots-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.vent-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vent-dot.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

.ventilation-counter-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

.minigame-naloxone.hidden, .minigame-ventilation.hidden { display: none !important; }


/* EPIPEN MINIGAME */
.minigame-epipen { display: flex; flex-direction: column; align-items: center; width: 100%; }
.epipen-thigh-bg { width: 100%; height: 160px; background: #e1b12c; border-radius: 10px; position: relative; margin-bottom: 20px; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.1); }
.epipen-thigh-dropzone { width: 70px; height: 70px; border: 3px dashed #f5f6fa; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; justify-content: center; align-items: center; }
.epipen-target-marker { width: 15px; height: 15px; background-color: rgba(255, 255, 255, 0.7); border-radius: 50%; }
.epipen-container { height: 150px; display: flex; justify-content: center; align-items: center; margin-bottom: 10px; }
.epipen-device { width: 34px; height: 100px; background: #f5f6fa; border: 2px solid #7f8fa6; border-radius: 3px; position: relative; cursor: grab; display: flex; flex-direction: column; align-items: center; z-index: 10; touch-action: none; cursor: pointer; user-select: none; }
.epipen-device:active { cursor: grabbing; }
.epipen-cap { width: 38px; height: 25px; background: #00a8ff; border-radius: 4px 4px 0 0; position: absolute; top: -25px; cursor: pointer; border: 2px solid #0097e6; }
.epipen-cap:hover { background: #0097e6; }
.epipen-label { width: 100%; height: 50px; margin-top: 15px; display: flex; justify-content: center; align-items: center; font-weight: bold; color: #2f3640; font-size: 0.8rem; }
.epipen-tip { width: 22px; height: 12px; background: #e15f41; position: absolute; bottom: -12px; border-radius: 0 0 4px 4px; border: 2px solid #c44536; }
.epipen-status { font-size: 1.2rem; margin-bottom: 15px; height: 30px; font-weight: bold; text-align: center; }
.epipen-timer-bar-bg { width: 80%; height: 25px; background: rgba(0,0,0,0.3); border-radius: 12px; overflow: hidden; border: 2px solid #fff; }
.epipen-timer-fill { width: 0%; height: 100%; background: #1dd1a1; transition: width 0.1s linear; }
.minigame-epipen.hidden { display: none !important; }


/* ===================== RICH SCENARIO CARDS ===================== */
.scenario-card-rich {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card); /* Fallback */
}
.scenario-card-rich:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}
.scenario-card-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
    z-index: 1;
}
.scenario-card-rich:hover .scenario-card-bg {
    transform: scale(1.1);
}
.scenario-card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.8) 50%, rgba(15, 23, 42, 0.2) 100%);
    z-index: 2;
}
.scenario-card-content {
    position: relative;
    z-index: 3;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}
.scenario-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.scenario-card-bottom h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: -0.5px;
}
.scenario-card-rich:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}
.scenario-reveal {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.35s ease;
}
.scenario-card-rich:hover .scenario-reveal,
.scenario-card-rich:focus-within .scenario-reveal {
    max-height: 200px;
    opacity: 1;
    margin-top: 12px;
}
.scenario-reveal p {
    font-size: 0.92rem;
    color: #cbd5e1;
    margin-bottom: 14px;
    line-height: 1.5;
}
.scenario-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}
.scenario-card-rich:hover .scenario-play-btn {
    background: var(--primary);
    border-color: var(--primary);
}

.bubble-center {
    font-size: 1.5rem !important;
    padding: 20px 30px !important;
    max-width: 80% !important;
    text-align: center;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 2px solid var(--accent-blue) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8) !important;
    color: #fff !important;
}


/* --- CPR IMPROVEMENTS --- */
.cpr-torso-bg {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto 20px auto;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cpr-torso-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.cpr-target-wrap {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cpr-fatigue-bar {
    width: 80%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    margin: 10px auto;
    overflow: hidden;
}

.cpr-fatigue-fill {
    height: 100%;
    background: #00a8ff;
    width: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

/* --- AED IMPROVEMENTS --- */
.aed-torso-realistic {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto 20px auto;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.aed-torso-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.aed-dropzone.top-right {
    position: absolute;
    top: 20%;
    right: 20%;
    width: 72px;
    height: 72px;
    border: 2px dashed #00a8ff;
    border-radius: 10px;
    background: rgba(0, 168, 255, 0.1);
}

.aed-dropzone.bottom-left {
    position: absolute;
    top: 60%;
    left: 20%;
    width: 72px;
    height: 72px;
    border: 2px dashed #00a8ff;
    border-radius: 10px;
    background: rgba(0, 168, 255, 0.1);
}

.aed-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.aed-btn-clear, .aed-btn-shock {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.aed-btn-clear {
    background: #f1c40f;
    color: #000;
}

.aed-btn-clear:hover {
    background: #f39c12;
    transform: scale(1.05);
}

.aed-btn-shock {
    background: #e84118;
    color: #fff;
    animation: flashRed 1s infinite;
}

.aed-btn-shock:active {
    transform: scale(0.95);
}

@keyframes flashRed {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); background: #c23616; }
    50% { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3); background: #e84118; }
}

/* --- NALOXONE IMPROVEMENTS --- */
.naloxone-head-tilt-area {
    width: 300px;
    height: 300px;
    margin: 0 auto 20px auto;
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    touch-action: none; /* For dragging */
}

.head-tilt-arrow {
    font-size: 1.2rem;
    color: #00a8ff;
    text-align: center;
    pointer-events: none;
}

.naloxone-nose-area {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.naloxone-nose {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.naloxone-dropzone[data-nostril="left"] {
    position: absolute;
    top: 60%;
    left: 35%;
    width: 40px;
    height: 40px;
    border: 2px dashed #00a8ff;
    border-radius: 50%;
}

.naloxone-dropzone[data-nostril="right"] {
    position: absolute;
    top: 60%;
    right: 35%;
    width: 40px;
    height: 40px;
    border: 2px dashed #00a8ff;
    border-radius: 50%;
}


.naloxone-head-tilt-area.hidden,
.naloxone-nose-area.hidden,
.naloxone-spray-container.hidden,
.aed-controls.hidden,
.aed-btn-shock.hidden {
    display: none !important;
}

/* Global utility */
.hidden { display: none !important; }

/* ===================== MULTIPLAYER UI ===================== */
.join-screen-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.join-header { margin-bottom: 2rem; }

.logo-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-group { text-align: left; }

.glass-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.input-glass {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.input-glass:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
    background: rgba(0,0,0,0.4);
}

.code-input {
    font-size: 1.8rem;
    letter-spacing: 15px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.btn-glass {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-glass:active { transform: translateY(0); }

.success-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pulse-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-green);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.success-icon {
    font-size: 3rem;
    color: var(--accent-green);
    text-shadow: var(--shadow-glow-green);
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    margin: 0 4px;
    animation: none; opacity: 0.85;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===================== NEW PARTICIPANT LOGIN ===================== */
.join-active {
    background: #f8fafc;
    overflow: hidden;
}

.join-bg-shapes {
    position: absolute;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.join-shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.12;
    border-radius: 50%;
    animation: floatShape 20s infinite ease-in-out alternate;
    will-change: transform;
}

.join-shape-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    top: -100px;
    left: -150px;
}

.join-shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    bottom: -50px;
    right: -100px;
    animation-delay: -5s;
}

.join-shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-teal);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes floatShape {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 50px) rotate(45deg); }
}

.join-glass-panel {
    background: #ffffff;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.join-brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.accent-blue {
    color: var(--accent-blue);
}

.brand-badge {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.join-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.modern-input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modern-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.25rem;
}

.modern-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition-normal);
    outline: none;
    width: 100%;
}

.modern-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.modern-input::placeholder {
    color: #64748b;
}

.code-input {
    letter-spacing: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-modern-primary {
    background: #090d16;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-normal);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.35);
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-modern-primary:active {
    transform: translateY(0);
}

.join-error-msg {
    color: var(--accent-red);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
}

/* ===================== MOBILE ADJUSTMENTS (COMPREHENSIVE FIX) ===================== */
@media (max-width: 768px) {
    /* 1. FAB Dock - Compact on mobile */
    .floating-fab-dock {
        top: auto !important;
        bottom: 110px !important; /* Mettre au-dessus de la navigation et vitals */
        right: 10px !important;
        transform: none !important;
        gap: 12px !important;
    }

    .fab-btn {
        width: 48px !important;
        height: 48px !important;
    }

    .fab-btn .fab-icon {
        font-size: 1.35rem !important;
    }

    /* Tooltip is hidden on mobile (no hover) */
    .fab-btn::after {
        display: none !important;
    }

    .action-panel {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 2. Top Action Panel - Compact and wrap */
    .action-panel-header {
        padding: 4px 10px !important;
        flex-wrap: nowrap !important;
        border-bottom: none !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .phase-info h3 {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    #phase-description {
        display: none !important; /* Hide description on mobile to save space */
    }

    /* 3. Clue Notifications - Center of screen */
    .speech-bubble.bubble-center {
        top: 50% !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 400px;
        font-size: 0.85rem !important;
        padding: 10px 15px !important;
        border-radius: var(--radius-md) !important;
        box-shadow: var(--shadow-lg) !important;
        position: fixed !important;
        z-index: 10000 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid #0284c7 !important;
        color: #0f172a !important;
    }
    
    .bubble-action {
        top: auto !important;
        bottom: 70px !important; /* Move action panel even lower */
        left: 50% !important;
        transform: translateX(-50%) !important;
        position: fixed !important;
        z-index: 10000 !important;
        padding: var(--space-sm) !important; /* Réduit l'espace inutile */
        width: 90% !important; /* Optimise la largeur */
    }

    .bubble-action .dialogue-prompt {
        margin-bottom: 4px !important;
        padding-bottom: 4px !important;
        font-size: 0.95rem !important;
    }

    .bubble-action .dialogue-choices {
        gap: 4px !important;
    }

    .bubble-action .choice-label {
        padding: 6px 10px !important;
    }

    /* 4. Sequential Action Card - Reduce size */
    .sequential-action-card {
        padding: 15px !important;
        width: 95% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }
    
    .btn-action-yes, .btn-action-no {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    /* 5. Bottom Navigation - Fixed at bottom */
    .phase-navigation {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 10px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 50 !important;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.06) !important;
        border-top: 1px solid #e2e8f0 !important;
        margin: 0 !important;
    }
    
    .btn-secondary, .btn-primary {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    /* 6. Vitals Panel - Unified with Action Panel */
    .vitals-panel {
        position: static !important; /* Laisse le navigateur gérer le placement sous le header */
        bottom: auto !important;
        top: auto !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        z-index: 15 !important;
        padding: 4px 10px 8px 10px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important; /* Modifié pour le défilement */
        gap: 6px !important;
        align-items: center !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(16px) !important;
        border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
        border: 1px solid #cbd5e1 !important;
        border-top: none !important;
        margin-top: 0 !important;
        overflow: hidden !important; /* Masque ce qui dépasse */
    }
    
    .vitals-panel .vitals-title, .vitals-panel .vital-label { 
        display: none !important; 
    }
    
    .vitals-panel .vital-row {
        flex-direction: row !important;
        gap: 4px !important;
        padding: 2px 8px !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 20px !important;
        font-size: 0.75rem !important;
        color: #0f172a !important;
        text-align: center;
        white-space: nowrap !important;
        margin: 0 !important;
        animation: marqueeScroll 12s linear infinite !important; /* Animation de défilement */
    }

    /* Pause au toucher pour pouvoir lire */
    .vitals-panel:active .vital-row {
        animation-play-state: paused !important;
    }

    @keyframes marqueeScroll {
        0% { transform: translateX(100vw); }
        100% { transform: translateX(-200vw); }
    }

    /* 7. Feedback Bubbles - Ensure they don't overlap */
    .cpr-feedback, .aed-status, .naloxone-status, .epipen-status, #diagnosis-result {
        bottom: 120px !important;
        z-index: 60 !important;
    }

    /* 8. Characters - Force them higher and blend */
    .char-wrapper {
        bottom: auto !important;
        top: 50% !important; 
        transform: translateY(-50%) !important;
        opacity: 0.9 !important;
        mix-blend-mode: normal !important;
        height: 150% !important; /* Agrandissement maximal */
        width: 85% !important; /* Ajout obligatoire pour ne pas contraindre l'image */
        z-index: 2 !important; /* Z-index abaissé pour être sous les bulles */
    }

    .bubble-layer {
        z-index: 20 !important; /* Assure que les bulles sont au-dessus des personnages */
    }

    .char-wrapper .char-img {
        background-position: center center !important; /* Aligner l'image avec le milieu (bulles) */
    }

    .witness-side {
        left: -20% !important;
    }

    .victim-side {
        right: -20% !important;
    }

    /* ===================== TROUSSE MOBILE OPTIMIZATION ===================== */
    .inventory-panel {
        width: 100% !important;
        max-width: 380px !important;
        height: auto !important;
        max-height: 75vh !important;
        top: auto !important;
        bottom: 0 !important;
        right: 50% !important;
        transform: translate(50%, 0) !important;
        border-radius: 20px 20px 0 0 !important;
        border-left: 1px solid #cbd5e1 !important;
        border-top: 1px solid #cbd5e1 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12) !important;
        z-index: 10000 !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(24px) !important;
        color: #0f172a !important;
    }

    .inventory-panel.hidden {
        transform: translate(50%, 110%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .inventory-header {
        padding: 10px 16px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .inventory-header h3 {
        font-size: 1rem !important;
        font-weight: 700 !important;
    }

    .inventory-content {
        padding: 10px 12px 16px 12px !important;
        overflow-y: auto !important;
    }

    .inventory-instructions {
        font-size: 0.78rem !important;
        margin-bottom: 8px !important;
        text-align: center !important;
        color: #94a3b8 !important;
    }

    .inventory-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .inv-item {
        padding: 8px 4px !important;
        border-radius: 12px !important;
        min-height: 66px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        transition: all 0.2s ease !important;
    }

    .inv-item-icon {
        font-size: 1.45rem !important;
        margin-bottom: 4px !important;
        line-height: 1 !important;
    }

    .inv-item-name {
        font-size: 0.75rem !important;
        line-height: 1.1 !important;
        font-weight: 600 !important;
        text-align: center !important;
        word-break: break-word !important;
        color: #e2e8f0 !important;
    }

    .inv-item.equipped {
        background: rgba(16, 185, 129, 0.25) !important;
        border-color: #10b981 !important;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
    }
}


/* Mobile Hybrid Enhancements */
@media (max-width: 768px) {
    button, .btn, .tab, .action-btn, .inventory-item, .aed-pad-draggable {
        min-height: 48px !important;
        min-width: 48px !important;
    }
    /* Ensure AED buttons are easily reachable at the bottom without taking too much height */
    #aed-controls {
        flex-direction: row;
        gap: 8px;
        margin-top: 10px;
    }
    #aed-btn-shock, #aed-btn-clear {
        width: 50%;
        min-height: 45px !important;
        font-size: 0.95rem;
        padding: 10px !important;
    }

    /* Resize torso images even more so they don't force vertical scrolling */
    .cpr-torso-bg, .aed-torso-realistic {
        width: 180px !important;
        height: 240px !important;
        margin: 0 auto 10px auto !important;
    }

    /* CPR Target reasonably sized for mobile */
    .cpr-target-wrap {
        width: 90px !important;
        height: 90px !important;
    }
    #cpr-target {
        width: 100% !important;
        height: 100% !important;
        max-width: none;
        max-height: none;
    }
    
    /* Optimize Minigame Container & Area to save vertical space */
    .minigame-container {
        padding: 10px !important;
        max-height: 98vh !important;
        border-radius: 12px !important;
    }
    .minigame-area {
        padding: 5px !important;
        min-height: 0 !important;
        margin-bottom: 5px !important;
    }
    .minigame-header h3 {
        font-size: 1.1rem !important;
        margin-bottom: 2px !important;
    }
    .minigame-header p {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }
}

/* ===================== TIMELINE REPLAY ===================== */
.results-timeline {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
}

.results-timeline h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--accent-blue);
    font-size: 1.2rem;
    text-align: center;
}

.timeline-container {
    position: relative;
    padding-left: 20px;
    margin-bottom: 20px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 25px;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
}

.timeline-time {
    width: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 2px;
    flex-shrink: 0;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    margin-top: 4px;
    margin-right: 15px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.timeline-correct .timeline-marker { background: var(--accent-green); }
.timeline-wrong .timeline-marker { background: var(--accent-red); box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4); }

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    flex-grow: 1;
    font-size: 0.95rem;
}

.timeline-correct .timeline-content { border: 1px solid rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.05); }
.timeline-wrong .timeline-content { border: 1px solid rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.05); }

/* ===================== TRIAGE DYNAMICS ===================== */
.flashlight-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.85); /* Dark scene */
    /* This will be overwritten by JS inline styles */
    -webkit-mask-image: radial-gradient(circle 150px at 50% 50%, transparent 20%, black 100%);
    mask-image: radial-gradient(circle 150px at 50% 50%, transparent 20%, black 100%);
}

.flashlight-overlay.hidden {
    display: none;
}

.immersive-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 15;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.immersive-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}
.immersive-backdrop.active {
    opacity: 1;
    pointer-events: auto; /* Bloque les clics sur les éléments en dessous (sauf z-index > 15) */
}

.dynamic-victim {
    position: absolute !important;
    transform: translate(-50%, -50%) !important; /* Center on its exact x/y */
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    height: auto !important;
    width: auto !important;
    z-index: 20 !important;
    pointer-events: auto !important;
    transition: all 0.3s ease;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.dynamic-victim .char-img {
    width: 150px !important;
    height: 220px !important;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    mix-blend-mode: normal !important;
}

@media (min-width: 768px) {
    .dynamic-victim .char-img {
        width: 200px !important;
        height: 300px !important;
    }
}

.dynamic-victim:hover {
    transform: translate(-50%, -50%) scale(1.05) !important;
    z-index: 30 !important;
}

.dynamic-victim.focused {
    filter: drop-shadow(0 0 20px var(--accent-blue));
    z-index: 100 !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

/* Triage Tags UI */
.triage-tags-container {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 200;
    background: rgba(15, 23, 42, 0.8);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.triage-tags-container.hidden {
    display: none !important;
}

.triage-tag-draggable {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    border: 3px solid #fff;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    user-select: none;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

@media (max-width: 768px) {
    .triage-tag-draggable {
        width: 50px;
        height: 70px;
        font-size: 0.7rem;
    }
}

.triage-tag-draggable:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.triage-tag-draggable.rouge { background: #e74c3c; }
.triage-tag-draggable.jaune { background: #f1c40f; color: #000; }
.triage-tag-draggable.vert { background: #2ecc71; }
.triage-tag-draggable.noir { background: #34495e; }

.triage-tag-badge {
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 40px;
    height: 60px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    transform: rotate(15deg);
    z-index: 105;
}

.triage-tag-rouge { background: #e74c3c; }
.triage-tag-jaune { background: #f1c40f; }
.triage-tag-vert { background: #2ecc71; }
.triage-tag-noir { background: #34495e; }

/* ===================== MOBILE RESPONSIVENESS FIXES ===================== */
@media (max-width: 768px) {
    /* Ensure the game area fits on screen */
    .game-container, .minigame-container {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }
    
    /* Make triage tags more accessible */
    .triage-tags-container {
        left: 5px;
        padding: 5px;
        gap: 10px;
    }
    
    .triage-tag-draggable {
        width: 45px;
        height: 65px;
        font-size: 0.7rem;
    }
    
    /* Ensure victims are not overflowing */
    .dynamic-victim .char-img {
        width: 120px !important;
        height: 180px !important;
    }
    
    /* Ensure modal overlays scale correctly */
    .minigame-overlay {
        padding: 10px;
    }
    
    /* Minigame elements */
    .aed-panel, .naloxone-container, .epipen-container {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

@media (max-width: 480px) {
    .aed-panel, .naloxone-container, .epipen-container {
        transform: scale(0.7);
    }
    
    .triage-tags-container {
        flex-direction: row;
        top: auto;
        bottom: 70px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        justify-content: space-around;
        z-index: 1000;
    }
    
    .triage-tag-draggable {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        width: auto;
        padding: 10px 15px;
        height: auto;
        font-size: 0.9rem;
    }
}


/* ===================== TUTORIEL INTERACTIF ===================== */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: all;
}

.tutorial-overlay.hidden {
    display: none;
}

/* SVG mask that punches a lit hole over the targeted element */
.tutorial-mask-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Animated glow ring drawn as SVG rect — purely decorative, no z-index issues */
.tutorial-spotlight-ring {
    fill: none;
    stroke: rgba(99, 179, 255, 0.95);
    stroke-width: 3;
    rx: 18;
    ry: 18;
    animation: svgRingPulse 2.2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(59,130,246,0.8)) drop-shadow(0 0 24px rgba(59,130,246,0.4));
}

@keyframes svgRingPulse {
    0%, 100% { stroke-opacity: 1; stroke-width: 3; }
    50%       { stroke-opacity: 1; stroke-width: 5; filter: drop-shadow(0 0 16px rgba(99,179,255,1)) drop-shadow(0 0 40px rgba(59,130,246,0.7)); }
}

/* ==== TUTORIAL CARD ==== */
/* Desktop : floating card, positioned by JS */
.tutorial-card {
    position: absolute;
    width: 320px;
    background: rgba(12, 17, 36, 0.98);
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 20px;
    padding: 22px;
    box-shadow:
        0 0 0 1px rgba(59,130,246,0.12),
        0 20px 60px rgba(0,0,0,0.65);
    z-index: 100000;
    animation: tutorialCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    pointer-events: all;
}

/* Mobile : bottom sheet, full width, fixed position */
@media (max-width: 680px) {
    .tutorial-card {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0;
        padding: 20px 18px env(safe-area-inset-bottom, 12px);
        max-height: 55vh;
        overflow-y: auto;
    }
}

@keyframes tutorialCardIn {
    from { opacity: 0; transform: scale(0.9) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tutorial-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}

.tutorial-step-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius-full);
    padding: 3px 11px;
    white-space: nowrap;
}

.tutorial-skip-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-sans);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 150ms ease, background 150ms ease;
    white-space: nowrap;
}
.tutorial-skip-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.tutorial-card-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: block;
    text-align: center;
    filter: drop-shadow(0 0 10px rgba(59,130,246,0.5));
}

@media (max-width: 680px) {
    .tutorial-card-icon { font-size: 1.8rem; margin-bottom: 6px; }
}

.tutorial-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
    line-height: 1.3;
}

.tutorial-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 48px;
}

@media (max-width: 680px) {
    .tutorial-card-desc { min-height: unset; }
}

.tutorial-progress-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 16px;
}

.tutorial-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.25s ease;
}
.tutorial-dot.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.3);
}
.tutorial-dot.done {
    background: rgba(59,130,246,0.4);
    border-color: rgba(59,130,246,0.5);
}

.tutorial-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tutorial-card-actions .btn-primary {
    flex: 1;
}


/*
 * TRUE CUTOUT SPOTLIGHT:
 * The massive box-shadow (9999px spread) darkens the entire viewport.
 * The div itself is the transparent "hole" — elements beneath it stay visible.
 * Layered outer glows create the electric-blue halo effect.
 */
.tutorial-spotlight {
    position: fixed;
    border-radius: 18px;
    background: transparent;
    /* Layer 1 : cutout darkness  */
    /* Layer 2 : tight blue ring  */
    /* Layer 3 : medium glow      */
    /* Layer 4 : wide ambient glow */
    box-shadow:
        0 0 0 9999px rgba(4, 7, 18, 0.88),
        0 0 0 3px  rgba(99, 179, 255, 1),
        0 0 0 7px  rgba(59, 130, 246, 0.45),
        0 0 40px 14px rgba(59, 130, 246, 0.35);
    transition:
        left   0.42s cubic-bezier(0.4, 0, 0.2, 1),
        top    0.42s cubic-bezier(0.4, 0, 0.2, 1),
        width  0.42s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10001;
    animation: tutorialPulse 2.2s ease-in-out infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow:
            0 0 0 9999px rgba(4, 7, 18, 0.88),
            0 0 0 3px  rgba(99, 179, 255, 1),
            0 0 0 7px  rgba(59, 130, 246, 0.4),
            0 0 40px 14px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 9999px rgba(4, 7, 18, 0.92),
            0 0 0 4px  rgba(147, 210, 255, 1),
            0 0 0 12px rgba(59, 130, 246, 0.25),
            0 0 70px 24px rgba(59, 130, 246, 0.55);
    }
}

/* Targeted element is raised above the overlay so it stays crisp and lit */
.tutorial-highlighted {
    position: relative !important;
    z-index: 10003 !important;
    border-radius: 14px;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.tutorial-card {
    position: absolute;
    width: 340px;
    background: rgba(15, 20, 40, 0.97);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 20px;
    padding: 24px;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 10002;
    animation: tutorialCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes tutorialCardIn {
    from { opacity: 0; transform: scale(0.85) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tutorial-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tutorial-step-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    padding: 4px 12px;
}

.tutorial-skip-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-sans);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 150ms ease, background 150ms ease;
}
.tutorial-skip-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.tutorial-card-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
    display: block;
    text-align: center;
    filter: drop-shadow(0 0 12px rgba(59,130,246,0.5));
}

.tutorial-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
}

.tutorial-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 60px;
}

.tutorial-progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.25s ease;
}
.tutorial-dot.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.25);
}
.tutorial-dot.done {
    background: rgba(59,130,246,0.4);
    border-color: rgba(59,130,246,0.5);
}

.tutorial-card-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}
.tutorial-card-actions .btn-primary {
    flex: 1;
}

/* ===================== INSIGHT MODAL ===================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content.insight-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.hidden .insight-content {
    transform: translateY(30px) scale(0.95);
}

.insight-content h2 {
    color: var(--accent-yellow);
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.insight-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: var(--space-xl);
}

/* CPR Metronome */
.cpr-metronome-bar {
    width: 80%;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
}

.cpr-metronome-sweetspot {
    position: absolute;
    left: 45%;
    width: 10%;
    height: 100%;
    background: rgba(46, 204, 113, 0.4);
    border-left: 2px solid #2ecc71;
    border-right: 2px solid #2ecc71;
}

.cpr-metronome-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: white;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.code-input { text-transform: uppercase; letter-spacing: 2px; }

/* --- PREMIUM DESIGN & GLASSMORPHISM ENHANCEMENTS --- */
.screen, .modal-content, .results-container, .stat-card {
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

.btn {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.action-btn {
    transition: all 0.3s ease !important;
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

/* --- BADGES STYLES --- */
.results-badges {
    margin-bottom: 30px;
    text-align: center;
}

.results-badges h3 {
    color: #92400e;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 800;
}

.badges-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.badge-card {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 16px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 16px rgba(161, 98, 7, 0.1);
    animation: slide-up-fade 0.6s ease forwards;
    opacity: 0;
}

.badge-card:nth-child(2) { animation-delay: 0.2s; }
.badge-card:nth-child(3) { animation-delay: 0.4s; }

.badge-icon {
    font-size: 2.5rem;
}

.badge-title {
    color: #854d0e;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.badge-desc {
    color: #713f12;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1); }
    100% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.25); }
}


@keyframes slide-up-fade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Loading Overlay Animation ===== */
@keyframes loadingPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(59,130,246,0.5)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 24px rgba(34,197,94,0.8)); }
}

@keyframes loadingTextFade {
    0% { opacity: 0; transform: translateY(8px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-8px); }
}


/* ===================== TRIAGE MOBILE LAYOUT OVERLAP FIX ===================== */
@media (max-width: 768px) {
    /* 1. Victims shifted to upper scene zone */
    .dynamic-victim {
        top: 32% !important;
    }
    .dynamic-victim .char-img {
        width: 95px !important;
        height: 135px !important;
    }
    .dynamic-victim .char-name-tag {
        font-size: 0.7rem !important;
        padding: 2px 6px !important;
        white-space: nowrap !important;
    }

    /* 2. Action Card centered in middle zone */
    .dialogue-choices-bubble, #sequential-action-bubble {
        position: fixed !important;
        bottom: 125px !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 92% !important;
        max-width: 360px !important;
        z-index: 80 !important;
        margin: 0 !important;
    }

    .sequential-action-card {
        padding: 10px 14px !important;
        margin: 0 auto !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.6) !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(12px) !important;
        border: 1px solid rgba(59, 130, 246, 0.3) !important;
    }

    /* Optimize Minigame Container & Area to save vertical space */
    .minigame-container {
        padding: 10px !important;
        max-height: 98vh !important;
        border-radius: 12px !important;
    }
    .minigame-area {
        padding: 5px !important;
        min-height: 0 !important;
        margin-bottom: 5px !important;
    }
    .minigame-header h3 {
        font-size: 1.1rem !important;
        margin-bottom: 2px !important;
    }
    .minigame-header p {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }

    /* Mobile Lung & Chest Graphics Adjustments */
    .lungs-stage {
        width: 220px;
        height: 175px;
        margin-bottom: 8px;
    }
    .lungs-svg-bg {
        width: 190px;
        height: 165px;
    }
    .lungs-container {
        width: 58px;
        height: 165px;
    }
    .lungs-gauge-ticks {
        left: -48px;
        height: 165px;
        width: 44px;
        font-size: 0.75rem;
    }

    .sequential-action-title {
        font-size: 0.75rem !important;
        margin-bottom: 4px !important;
    }

    .sequential-action-text {
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
    }

    /* 3. Triage Color Tag Buttons Bar cleanly above bottom nav */
    .triage-tags-container {
        position: fixed !important;
        bottom: 62px !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 94% !important;
    }
    .vitals-panel {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        top: auto !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        padding: 6px 12px !important;
        border-radius: 0 !important;
        border-left: none !important; border-right: none !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-top: 1px solid #e2e8f0 !important;
        background: rgba(255, 255, 255, 0.96) !important;
        color: #0f172a !important;
        z-index: 100 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .vitals-panel::-webkit-scrollbar {
        display: none !important;
    }
    .vitals-panel.hidden {
        display: none !important;
    }
    .triage-tags-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 6px !important;
        z-index: 95 !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(12px) !important;
        padding: 6px 8px !important;
        border-radius: 12px !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    }

    .triage-tag-draggable {
        flex: 1 !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        width: auto !important;
        height: auto !important;
        padding: 8px 4px !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
        border-radius: 8px !important;
        text-align: center !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
        margin: 0 !important;
    }

    /* 4. Bottom Phase Navigation Bar */
    .phase-navigation {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 54px !important;
        padding: 6px 12px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        border-top: 1px solid #e2e8f0 !important;
        backdrop-filter: blur(10px) !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
    }
}

/* ===================== HUB INTERACTIF SECOURSIM ===================== */
@keyframes ecgPulse {
    0% { stroke-dashoffset: 600; }
    100% { stroke-dashoffset: 0; }
}

.hub-tab.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

/* ===================== ONBOARDING TUTORIAL ===================== */
.onboarding-glass-panel {
    background: #ffffff;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    color: #0f172a;
    animation: onboardingPanelIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

@keyframes floatBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#screen-onboarding-tutorial .btn-tutorial-interactive {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    color: #fff;
    padding: 14px 35px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.25s ease;
}

#screen-onboarding-tutorial .btn-tutorial-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

@media (max-width: 480px) {
    .onboarding-glass-panel {
        padding: 20px 16px;
        border-radius: 18px;
    }
}

/* V.I.T.E. Waveform Animation */
@keyframes wavePulse {
    0% { height: 6px; opacity: 0.5; }
    100% { height: 32px; opacity: 1; }
}

/* ===================== MOBILE RESPONSIVE SOLO MODE ===================== */
@media (max-width: 768px) {
    /* Catalog & Scenario Selection Grid on Mobile */
    #screen-scenarios, .screen-scenarios {
        padding: 12px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .scenarios-header {
        margin-bottom: 16px !important;
        padding: 0 4px !important;
    }

    .scenarios-header h2 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }

    .scenarios-subtitle {
        font-size: 0.82rem !important;
        line-height: 1.4 !important;
        margin-bottom: 14px !important;
    }

    /* Dropdown Control Panel (Mode Libre / Solo) on Mobile */
    .dropdown-control-panel {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin-bottom: 16px !important;
        gap: 12px !important;
        box-sizing: border-box !important;
    }

    .dropdown-group-card {
        padding: 14px 12px !important;
        border-radius: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 0 !important;
    }

    .dropdown-card-header {
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    .dropdown-card-icon {
        font-size: 1.3rem !important;
        padding: 6px 10px !important;
        border-radius: 10px !important;
    }

    .dropdown-card-header h3 {
        font-size: 0.98rem !important;
        line-height: 1.3 !important;
        margin-bottom: 2px !important;
    }

    .dropdown-card-header p {
        font-size: 0.78rem !important;
        line-height: 1.3 !important;
    }

    .dropdown-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .modern-select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.82rem !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        border-radius: 10px !important;
    }

    .btn-launch-dropdown {
        width: 100% !important;
        padding: 11px 14px !important;
        font-size: 0.85rem !important;
        text-align: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        border-radius: 10px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .scenarios-grid, #scenarios-grid, .scenario-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .scenario-card, .card-scenario {
        width: 100% !important;
        border-radius: 14px !important;
        padding: 14px !important;
        box-sizing: border-box !important;
    }

    .category-tabs, .filter-container {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: center !important;
        margin-bottom: 14px !important;
        width: 100% !important;
    }

    .category-tabs .tab, .tab, .filter-btn, .category-tab {
        padding: 7px 12px !important;
        font-size: 0.78rem !important;
        border-radius: 20px !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Game Screen & HUD on Mobile */
    .game-layout, .game-container {
        flex-direction: column !important;
        padding: 8px !important;
        gap: 10px !important;
    }

    .actions-grid, .actions-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .action-item, .btn-action {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
        box-sizing: border-box !important;
    }

    /* Diagnosis Overlay on Mobile */
    #diagnosis-overlay .diagnosis-card, .diagnosis-modal {
        width: 95vw !important;
        max-width: 440px !important;
        padding: 16px !important;
        border-radius: 18px !important;
    }

    #diagnosis-overlay .btn-choice {
        font-size: 0.88rem !important;
        padding: 12px !important;
    }

    /* Minigame Overlay on Mobile */
    #minigame-overlay {
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    /* Results screen responsive mobile scaling */
    #screen-results {
        padding: 14px 10px !important;
        overflow-y: auto !important;
    }

    .results-container {
        gap: 12px !important;
        max-width: 100% !important;
    }

    .results-countdown-banner {
        margin: 0 auto 8px auto !important;
        padding: 8px 12px !important;
        border-radius: 10px !important;
    }

    .diagnosis-reveal {
        padding: 8px 14px !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    .diagnosis-label {
        font-size: 0.7rem !important;
        letter-spacing: 1.5px !important;
        margin-bottom: 2px !important;
    }

    .diagnosis-name {
        font-size: 1.25rem !important;
    }

    .result-grade {
        font-size: 2.8rem !important;
        margin-bottom: 4px !important;
    }

    #result-title {
        font-size: 1.2rem !important;
        margin-bottom: 2px !important;
    }

    #result-subtitle {
        font-size: 0.8rem !important;
        margin-bottom: 12px !important;
    }

    .results-stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    .stat-card {
        padding: 10px 6px !important;
        border-radius: 12px !important;
        min-height: 72px !important;
    }

    #stat-score-circle {
        transform: scale(0.85) !important;
        margin-bottom: 0px !important;
        width: 60px !important;
        height: 60px !important;
    }

    #stat-score-number {
        font-size: 1.1rem !important;
    }

    #stat-time, #stat-actions, #stat-critical {
        font-size: 1.35rem !important;
        margin-bottom: 2px !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
        letter-spacing: 0.5px !important;
    }

    .results-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .results-actions .btn {
        width: 100% !important;
        padding: 10px 14px !important;
        font-size: 0.88rem !important;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    #screen-results {
        padding: 8px 6px !important;
    }
    .diagnosis-name {
        font-size: 1.1rem !important;
    }
    .result-grade {
        font-size: 2.4rem !important;
    }
    #result-title {
        font-size: 1.05rem !important;
    }
    .results-stats {
        gap: 8px !important;
        margin-bottom: 10px !important;
    }
    .stat-card {
        padding: 8px 4px !important;
        min-height: 64px !important;
    }
    #stat-score-circle {
        transform: scale(0.75) !important;
        width: 52px !important;
        height: 52px !important;
    }
    #stat-score-number {
        font-size: 0.95rem !important;
    }
    #stat-time, #stat-actions, #stat-critical {
        font-size: 1.2rem !important;
    }
    .stat-label {
        font-size: 0.75rem !important;
    }
}

/* ======================== ACCESSIBILITY: Reduced Motion ======================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .blob, .pulse-ring, .bg-glow, .bg-glows > div,
    .radio-wave, .particles-container {
        animation: none !important;
        opacity: 0.3;
    }
}

/* ======================== GAMEPLAY: Indicateur d'interaction personnages ======================== */
.interact-hint {
    animation: hintPulse 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes hintPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.9)); }
}

/* Bouton Intervenir désactivé pendant le typewriter */
.cinematic-skip.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

/* ==========================================================================
   INTERACTIVE SCENE ENHANCEMENTS: CHARACTER ANIMATIONS, ALERTS & DISCOVERY
   ========================================================================== */

/* 1. Character Animations */
.char-wrapper {
    animation: idleBreathing 3.5s ease-in-out infinite;
    transition: filter 0.3s ease, transform 0.3s ease;
}

@keyframes idleBreathing {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.01); }
}

.victim-side {
    animation: idleBreathing 3.5s ease-in-out infinite, painTremble 2.8s ease-in-out infinite;
}

@keyframes painTremble {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
}

.talk-bounce-anim, .talk-pop-anim {
    animation: talkPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes talkPop {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

.discovery-glow-anim {
    animation: discoveryGlowPulse 1.8s ease-in-out infinite !important;
    cursor: pointer !important;
}

@keyframes discoveryGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6)) brightness(1); }
    50% { filter: drop-shadow(0 0 25px rgba(245, 158, 11, 1)) brightness(1.15); }
}

/* 2. Scene Discovery Status Bar - Mode Clair */
.discovery-status-bar {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(245, 158, 11, 0.8);
    border-radius: 30px;
    padding: 8px 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    color: #0f172a;
}

.discovery-status-bar.unlocked {
    border-color: #10b981;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

.discovery-icon {
    font-size: 1.3rem;
    animation: discoveryIconSpin 3s linear infinite;
}

@keyframes discoveryIconSpin {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.discovery-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #b45309;
    text-transform: uppercase;
    white-space: nowrap;
}

.discovery-status-bar.unlocked .discovery-title {
    color: #059669;
}

.discovery-counter {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 3px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .discovery-status-bar {
        top: auto;
        bottom: 68px;
        padding: 6px 14px;
        gap: 8px;
        max-width: calc(100vw - 24px);
    }
    .discovery-title {
        font-size: 0.75rem;
        letter-spacing: 0.04em;
    }
    .discovery-counter {
        font-size: 0.78rem;
        padding: 2px 9px;
    }
}

@media (max-width: 640px) {
    .discovery-status-bar {
        display: none !important;
    }
}

/* 3. Active Safety Alerts Overlay */
.active-alerts-overlay {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 130;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.alert-badge {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateX(0);
}

.alert-badge.hidden {
    opacity: 0;
    transform: translateX(50px);
    pointer-events: none;
}

.alert-epi-active {
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
    animation: alertPulseOrange 1.8s ease-in-out infinite;
}

.alert-911-active {
    border: 2px solid #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
    animation: alertPulseRed 1.6s ease-in-out infinite;
}

@keyframes alertPulseOrange {
    0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); transform: scale(1); }
    50% { box-shadow: 0 4px 24px rgba(245, 158, 11, 0.35); transform: scale(1.03); }
}

@keyframes alertPulseRed {
    0%, 100% { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); transform: scale(1); }
    50% { box-shadow: 0 4px 24px rgba(239, 68, 68, 0.35); transform: scale(1.03); }
}

.alert-badge .alert-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.alert-badge .alert-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.alert-badge .alert-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.02em;
}

.alert-badge .alert-subtext {
    font-size: 0.74rem;
    color: #475569;
}

/* ===== Recurring Safety Reminder Toasts ===== */
.safety-reminder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding-top: 18vh;
}

.safety-reminder-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-radius: 18px;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: reminderSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 520px;
    width: 90%;
    transform: translateY(-40px);
    opacity: 0;
}

.safety-reminder-toast.reminder-epi {
    border: 2px solid #f59e0b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.safety-reminder-toast.reminder-911 {
    border: 2px solid #ef4444;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.safety-reminder-toast .reminder-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.safety-reminder-toast .reminder-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.safety-reminder-toast .reminder-title {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.safety-reminder-toast.reminder-epi .reminder-title {
    color: #fbbf24;
}

.safety-reminder-toast.reminder-911 .reminder-title {
    color: #f87171;
}

.safety-reminder-toast .reminder-msg {
    font-size: 0.88rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.safety-reminder-toast .reminder-timer {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
    font-style: italic;
}

@keyframes reminderSlideIn {
    0% { transform: translateY(-40px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes reminderFadeOut {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0.95); opacity: 0; }
}

/* ==========================================================================
   MOBILE UX 2.0 : COCKPIT ERGONOMIQUE "SPLIT-VIEW + BOTTOM SHEET + DOCK UNIFIÉ"
   ========================================================================== */
.clinical-choice-btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: left !important;
    justify-content: flex-start !important;
    line-height: 1.35 !important;
    height: auto !important;
}

.btn-dismiss-trap {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    transition: all 0.2s ease;
}

.btn-dismiss-trap:hover, .btn-dismiss-trap:active {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

/* ==========================================================================
   MICRO-BULLES SPATIALISÉES & ANTI-SURCHARGE (DESKTOP + MOBILE)
   ========================================================================== */
.micro-bubble {
    cursor: pointer !important;
    max-width: 340px !important;
    min-width: 210px !important;
    padding: 10px 14px !important;
    border-radius: 15px !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
    z-index: 1100 !important;
    user-select: none;
    background: rgba(255, 255, 255, 0.98) !important;
    color: #0f172a !important;
}

.micro-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
    opacity: 1;
}

.micro-bubble-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1;
    transition: transform 0.15s ease, background 0.15s ease;
}

.micro-bubble:hover .micro-bubble-close {
    transform: scale(1.12);
    background: rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

.micro-bubble-body {
    font-size: 0.92rem;
    line-height: 1.38;
    font-weight: 600;
    color: #0f172a;
}

/* ==========================================================================
   BANDEAU HORIZONTAL DÉFILANT ULTRA-FIN DES SIGNES VITAUX (PC & MOBILE)
   ========================================================================== */
@keyframes vitalsTickerScroll {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

@keyframes vitalsLiveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.25); }
}

.vitals-panel:not(.hidden) {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: rgba(9, 14, 26, 0.95) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 88 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

.vitals-panel .vitals-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 100% !important;
    padding: 0 10px !important;
    margin: 0 !important;
    background: rgba(2, 6, 23, 0.96) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-bottom: none !important;
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
    color: #38bdf8 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
}

.vitals-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: inline-block;
    animation: none;
}

.vitals-ticker-viewport {
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
}

.vitals-ticker-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: max-content !important;
    animation: none !important;
}

.vitals-panel:hover .vitals-ticker-track,
.vitals-panel:active .vitals-ticker-track {
    animation-play-state: paused !important;
}

.vitals-ticker-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
    padding-right: 12px !important;
}

.vitals-panel .vital-row {
    animation: none !important;
    transform: none !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    font-size: 0.74rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.vitals-panel .vital-row.hidden {
    display: none !important;
}

.vitals-panel .vital-row.danger {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(248, 113, 113, 0.45) !important;
}

.vitals-panel .vital-row.warning {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
}

.vitals-panel .vital-row.ok {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.38) !important;
}

.vitals-panel .vital-icon {
    width: auto !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
}

.vitals-panel .vital-label {
    display: inline !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #cbd5e1 !important;
}

.vitals-panel .vital-value {
    font-size: 0.74rem !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   MODE ORDINATEUR (DESKTOP >= 769px) — COCKPIT CLINIQUE SANS CHEVAUCHEMENT
   ========================================================================== */
.panic-dialogue-bar {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 8px 12px;
}
.panic-dialogue-label {
    font-size: 0.82rem;
    color: #1e3a8a;
    font-weight: 700;
}
.btn-panic-dialogue {
    background: #1d4ed8;
    color: #ffffff;
    border: 1px solid #1e40af;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
}
.btn-panic-dialogue:hover {
    background: #1e40af;
    transform: translateY(-1px);
}
.btn-mode-switch {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-mode-switch:hover {
    background: #e0f2fe;
    border-color: #38bdf8;
}
.priority-header-badge {
    white-space: nowrap;
    font-weight: 800;
    color: #0369a1;
}
.priority-instruction {
    font-size: 0.84rem;
    color: #334155;
    margin-bottom: 10px;
    text-align: left;
    line-height: 1.4;
}
.sequential-question-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    text-align: center;
}
.discovery-lock-card {
    text-align: center;
    padding: 14px 12px;
}
.discovery-lock-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: #b45309;
    margin-bottom: 6px;
}
.discovery-lock-desc {
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 12px;
    line-height: 1.45;
}
.discovery-lock-pill {
    font-weight: 800;
    font-size: 0.86rem;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 7px 16px;
    border-radius: 999px;
    display: inline-block;
}
.desktop-kbd-hint {
    display: none;
}

.category-tabs .category-tab {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.category-tabs .category-tab:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}
.category-tabs .category-tab.active {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff;
    font-weight: 700;
}

.desktop-clinical-rail {
    display: none;
}

.mobile-sheet-collapsed-bar,
.btn-sheet-minimize {
    display: none;
}

.triage-tag-draggable.triage-tag-selected {
    outline: 3px solid #ffffff !important;
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.75) !important;
    transform: translateY(-2px) scale(1.04) !important;
}

.dynamic-victim.triage-target-ready {
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.85)) !important;
    cursor: pointer !important;
}

@media (min-width: 820px) {
    #screen-game.active {
        height: 100vh;
        overflow: hidden;
    }

    #screen-game .game-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        overflow: hidden;
        background: radial-gradient(circle at 22% 45%, #1e293b 0%, #0b1120 100%);
    }

    /* Toujours afficher 100 % de la photo POV (zéro zoom / zéro rognage vertical) sur ordinateur */
    #screen-game .scene-bg,
    #screen-game .scene-bg.scene-bg-pov {
        inset: 0;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        background-color: #0b1120;
    }

    #screen-game .char-wrapper.pov-character-hitbox .char-name-tag,
    #screen-game .dynamic-victim.pov-character-hitbox .char-name-tag {
        bottom: 16px !important;
        font-size: 0.78rem;
        padding: 4px 12px;
    }

    #screen-game .clinical-closeup-frame img {
        object-fit: contain;
        background: #020617;
        max-height: calc(100% - 76px);
    }

    /* HUD en haut */
    #screen-game .action-panel {
        order: 1;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: 100%;
        flex-shrink: 0;
        pointer-events: auto;
        z-index: 40;
        padding: 8px 16px;
        background: rgba(248, 250, 252, 0.98);
        border-bottom: 1px solid #cbd5e1;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    }

    .action-panel-header {
        margin-bottom: 0 !important;
        padding: 7px 14px;
        gap: 10px;
        flex-wrap: wrap;
        border-radius: 10px !important;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        box-shadow: none;
    }

    .action-panel-header .topbar-center {
        flex: 1 1 auto;
        min-width: 190px;
        padding: 0 12px !important;
    }

    .action-panel-header .btn-ghost {
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        color: #0f172a;
        font-weight: 700;
    }
    .action-panel-header .btn-ghost:hover {
        background: #e2e8f0;
        border-color: #94a3b8;
        color: #0f172a;
    }

    .vitals-monitor-persistent {
        border: 1px solid #cbd5e1;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 8px 22px rgba(2, 6, 23, 0.14);
        padding: 8px 12px;
    }

    #screen-game .game-scene {
        order: 2;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        position: relative;
        overflow: hidden;
        background: #0b1120;
    }

    #screen-game .btn-toggle-closeup {
        top: 10px;
        right: 92px;
        z-index: 135;
    }

    .dialogue-choices-bubble .sequential-action-text {
        color: #0f172a !important;
        background: #f0f9ff !important;
        border: 1px solid #bae6fd !important;
        border-radius: 10px !important;
        padding: 10px 14px !important;
    }

    .clinical-choice-btn {
        background: #ffffff !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
        font-weight: 600 !important;
    }
    .clinical-choice-btn:hover {
        background: #eff6ff !important;
        border-color: #2563eb !important;
        color: #1e3a8a !important;
    }
    .btn-dismiss-trap {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        color: #475569 !important;
    }
    .btn-dismiss-trap:hover {
        background: #fee2e2 !important;
        border-color: #ef4444 !important;
        color: #b91c1c !important;
    }

    #btn-prev-phase {
        background: rgba(255, 255, 255, 0.96);
        color: #0f172a;
        border: 1px solid #cbd5e1;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    }
    #btn-prev-phase:hover:not(:disabled) {
        background: #f1f5f9;
        border-color: #94a3b8;
    }
    #btn-next-phase {
        background: #c2410c;
        color: #ffffff;
        border: 1px solid #9a3412;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
    }
    #btn-next-phase:hover:not(:disabled) {
        background: #9a3412;
    }

    .desktop-kbd-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #e2e8f0;
        font-size: 0.75rem;
        color: #475569;
        font-weight: 600;
    }
    .desktop-kbd-hint kbd {
        background: #f1f5f9;
        border: 1px solid #cbd5e1;
        border-radius: 5px;
        padding: 1px 6px;
        font-family: var(--font-mono);
        font-size: 0.72rem;
        font-weight: 700;
        color: #0f172a;
    }
}

@media (min-width: 820px) {
    #screen-game .game-layout {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-columns: minmax(310px, auto) minmax(380px, 1fr);
        grid-template-areas:
            "topbar topbar"
            "scene  sidebar";
    }

    #screen-game .action-panel {
        grid-area: topbar;
        order: initial;
    }

    #screen-game .game-scene {
        grid-area: scene;
        order: initial;
        align-self: center;
        justify-self: center;
        height: calc(100% - 24px);
        max-height: 100%;
        width: auto;
        aspect-ratio: var(--scene-aspect, 768 / 1376);
        min-width: 300px;
        max-width: 48vw;
        margin: 12px 0 12px 18px;
        border-radius: 18px;
        border: 1px solid rgba(148, 163, 184, 0.32);
        box-shadow: 0 22px 54px rgba(2, 6, 23, 0.65);
        flex: none;
    }

    /* Sur la scène au format exact de la photo, les zones cliquables collent aux personnages */
    #screen-game .char-wrapper {
        bottom: 0;
        height: 80%;
        max-height: none;
    }
    #screen-game .witness-side {
        left: 3%;
        width: 40%;
        height: 76%;
        bottom: 4%;
        max-width: none;
    }
    #screen-game .victim-side {
        right: 3%;
        width: 44%;
        height: 82%;
        bottom: 2%;
        max-width: none;
    }

    #screen-game .btn-toggle-closeup {
        top: 10px;
        right: 10px;
    }

    .micro-bubble {
        max-width: calc(100% - 20px) !important;
        min-width: 170px !important;
        z-index: 160 !important;
    }
    .micro-bubble-witness {
        top: 52px !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    .micro-bubble-witness::after {
        left: 28px !important;
        right: auto !important;
    }
    .micro-bubble-victim {
        top: 52px !important;
        right: 10px !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    .micro-bubble-victim::after {
        right: 28px !important;
        left: auto !important;
    }
    .micro-bubble-player {
        top: 52px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
    }

    .triage-tags-container {
        left: 10px;
        padding: 8px;
        gap: 8px;
    }
    .triage-tag-draggable {
        width: 44px;
        height: 64px;
        font-size: 0.72rem;
    }

    /* Poste clinique latéral droit : vitaux + exploration + décisions + navigation */
    .desktop-clinical-rail {
        grid-area: sidebar;
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-height: 0;
        min-width: 0;
        overflow-y: auto;
        padding: 12px 94px 14px 18px;
    }

    .desktop-rail-slot {
        flex-shrink: 0;
    }

    .desktop-rail-action {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #desktop-rail-status .discovery-status-bar {
        position: static !important;
        top: auto;
        left: auto;
        transform: none !important;
        width: 100%;
        justify-content: space-between;
        padding: 8px 14px;
        border-radius: 12px;
        gap: 10px;
        box-shadow: 0 6px 18px rgba(2, 6, 23, 0.14);
    }

    #desktop-rail-alerts .active-alerts-overlay {
        position: static !important;
        top: auto;
        right: auto;
        width: 100%;
        pointer-events: auto;
    }

    #desktop-rail-action .dialogue-choices-bubble,
    #desktop-rail-action #sequential-action-bubble {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 16px 20px !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.99) !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18) !important;
        color: #0f172a !important;
        overflow-y: auto;
        flex: 1 1 auto;
    }

    #desktop-rail-nav .bottom-navigation {
        position: static !important;
        inset: auto !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 2px 0 0 0;
        margin: 0;
        border-top: none;
    }
}

@media (min-width: 820px) and (max-width: 1120px) {
    .action-panel-header {
        gap: 8px;
    }
    .phase-info p {
        display: none;
    }
    .vitality-container-inline {
        width: 148px;
    }
    .vitals-monitor-grid {
        gap: 6px;
    }
    .vital-card {
        padding: 7px 10px;
        min-height: 58px;
    }
    .desktop-clinical-rail {
        padding: 10px 84px 12px 14px;
    }
}

@media (max-width: 768px) {
    /* 1. En-tête mobile sur 2 lignes propres : Ligne 1 = Titre Phase (100%), Ligne 2 = Vitalité + Chrono + Actions */
    .action-panel {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 90 !important;
    }

    .action-panel-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 6px 10px 4px 10px !important;
        gap: 4px !important;
        background: rgba(255, 255, 255, 0.97) !important;
        border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
        border-radius: 0 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    }

    .action-panel-phase {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        order: 1 !important;
    }

    .phase-number {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
        border-radius: 6px !important;
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
        color: #ffffff !important;
        font-weight: 800 !important;
    }

    .phase-info {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .phase-info h3, #phase-title {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: normal !important;
        max-width: 100% !important;
        margin: 0 !important;
        color: #0f172a !important;
    }

    #phase-description {
        display: none !important;
    }

    /* 2. Phases & Étapes visibles et bien contrastées sur mobile */
    .topbar-center {
        display: flex !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 3px 0 !important;
        margin: 1px 0 !important;
        order: 2 !important;
        border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    }

    .step-indicator {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        width: auto !important;
    }

    .step-indicator .step {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f1f5f9 !important;
        color: #475569 !important;
        border: 1px solid #cbd5e1 !important;
        transition: all 0.2s ease !important;
    }

    .step-indicator .step.active {
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
        color: #ffffff !important;
        border-color: #ffffff !important;
        box-shadow: 0 0 10px rgba(249, 115, 22, 0.45) !important;
        transform: scale(1.15) !important;
    }

    .step-indicator .step.completed {
        background: #10b981 !important;
        color: #ffffff !important;
        border-color: #059669 !important;
    }

    .step-indicator .step-line {
        width: 12px !important;
        height: 2px !important;
        background: #cbd5e1 !important;
    }

    .step-indicator .step-line.completed {
        background: #10b981 !important;
    }

    /* 3. Ligne 3 de l'en-tête : Vitalité + Chrono + Actions (Mode Clair) */
    .action-panel-header > div:last-child {
        flex: 1 1 100% !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 5px !important;
        padding-top: 2px !important;
        order: 3 !important;
    }

    .vitality-container-inline {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        min-width: 68px !important;
        max-width: 90px !important;
        flex: 1 1 auto !important;
    }

    .vitality-header {
        display: flex !important;
        justify-content: space-between !important;
        font-size: 0.72rem !important;
        color: #1e293b !important;
        font-weight: 700 !important;
    }

    .vitality-label {
        display: inline !important;
        font-size: 0.72rem !important;
        color: #dc2626 !important;
    }

    .vitality-bar-bg {
        height: 5px !important;
        width: 100% !important;
        background: #e2e8f0 !important;
        border-radius: 3px !important;
    }

    .timer#game-timer {
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        padding: 3px 7px !important;
        margin: 0 !important;
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        color: #0284c7 !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
    }

    .action-panel-header .btn-ghost {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        color: #1e293b !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }

    .action-panel-header .btn-ghost:hover {
        background: #f1f5f9 !important;
        border-color: #0284c7 !important;
        color: #0284c7 !important;
    }

    /* 4. Moniteur de Signes Vitaux sur Mobile : 1 ligne unique (38px), Mode Clair */
    .vitals-monitor-persistent {
        pointer-events: auto !important;
        position: static !important;
        width: 100% !important;
        padding: 3px 6px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-radius: 0 0 14px 14px !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
        box-sizing: border-box !important;
    }

    .vitals-monitor-header {
        display: none !important; /* Pas de gaspillage de hauteur sur smartphone */
    }

    .vitals-monitor-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .vital-card {
        padding: 8px 10px !important;
        min-height: 52px !important;
        height: auto !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    }

    .vital-card-top {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    .vital-card-icon {
        font-size: 0.72rem !important;
    }

    .vital-card-label {
        font-size: 0.75rem !important;
        color: #64748b !important;
        font-weight: 800 !important;
    }

    .vital-card-pill, .vital-spo2-track, .vital-card-ecg, .vital-card-wave, .vital-circ-sub {
        display: none !important;
    }

    .vital-card-center {
        display: flex !important;
        align-items: baseline !important;
        gap: 2px !important;
        line-height: 1 !important;
    }

    .vital-card-value {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    .vital-card-unit {
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
    }

    .vital-status-text {
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: center !important;
        max-width: 100% !important;
    }

    /* Bandeau des Signes Vitaux sur Mobile : 1 seule ligne fine (28px) Mode Clair */
    .vitals-panel:not(.hidden) {
        position: static !important;
        width: 100% !important;
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-radius: 0 0 12px 12px !important;
        overflow: hidden !important;
        z-index: 88 !important;
    }

    .vitals-panel .vital-row {
        animation: none !important;
        transform: none !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 2px 9px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        border-radius: 999px !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
    }

    /* 2. Zone Scène Visuelle : Personnages agrandis de +25% et placés plus bas dans la scène */
    .char-wrapper {
        top: 24vh !important;
        bottom: auto !important;
        transform: none !important;
        height: 45vh !important;
        width: 58% !important;
        opacity: 1 !important;
        z-index: 2 !important;
    }

    .witness-side {
        left: -3% !important;
    }

    .victim-side {
        right: -3% !important;
    }

    .char-name-tag {
        bottom: 8px !important;
        font-size: 0.76rem !important;
        padding: 3px 10px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
    }

    /* Micro-bulles spatialisées sur Mobile : Mode Clair */
    .speech-bubble:not(.bubble-action),
    .speech-bubble.bubble-center,
    .micro-bubble {
        top: 18.5vh !important;
        bottom: auto !important;
        width: auto !important;
        max-width: 72vw !important;
        min-width: 185px !important;
        padding: 8px 12px !important;
        font-size: 0.82rem !important;
        line-height: 1.34 !important;
        border-radius: 13px !important;
        z-index: 1100 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid rgba(203, 213, 225, 0.95) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        color: #0f172a !important;
    }

    .micro-bubble-body {
        font-size: 0.82rem !important;
        line-height: 1.34 !important;
        color: #0f172a !important;
    }

    .micro-bubble-witness {
        left: 10px !important;
        right: auto !important;
        transform: none !important;
    }
    .micro-bubble-witness::after {
        left: 26px !important;
        right: auto !important;
    }

    .micro-bubble-victim {
        right: 10px !important;
        left: auto !important;
        transform: none !important;
    }
    .micro-bubble-victim::after {
        right: 26px !important;
        left: auto !important;
    }

    .micro-bubble-player {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        max-width: 86vw !important;
    }

    /* 3. Feuille de Décision Clinique en Bas d'Écran (Bottom Sheet - Mode Clair) */
    .dialogue-choices-bubble, #sequential-action-bubble {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: 47vh !important;
        overflow-y: auto !important;
        padding: 12px !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid rgba(203, 213, 225, 0.95) !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1) !important;
        z-index: 80 !important;
        color: #0f172a !important;
    }

    .sequential-action-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 2px !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #0f172a !important;
    }

    .sequential-action-title span {
        color: #0284c7 !important;
        font-weight: 800 !important;
        font-size: 0.82rem !important;
    }

    .sequential-action-text {
        font-size: 0.98rem !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        color: #0369a1 !important;
        background: #f0f9ff !important;
        border: 1px solid #bae6fd !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        text-shadow: none !important;
        box-shadow: 0 2px 6px rgba(2, 132, 199, 0.05) !important;
    }

    .sequential-action-card div[style*="var(--text-secondary)"],
    .dialogue-choices-bubble div[style*="var(--text-secondary)"],
    .sequential-action-card div {
        color: #475569 !important;
    }

    .btn-action-no {
        background: #ffffff !important;
        border: 2px solid #cbd5e1 !important;
        color: #334155 !important;
        font-weight: 800 !important;
        font-size: 0.9rem !important;
        padding: 9px 16px !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    }

    .btn-action-no:hover, .btn-action-no:active {
        background: #f1f5f9 !important;
        border-color: #94a3b8 !important;
        color: #0f172a !important;
    }

    .btn-action-yes {
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
        border: 1px solid #ea580c !important;
        color: #ffffff !important;
        font-weight: 800 !important;
        font-size: 0.9rem !important;
        padding: 9px 16px !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35) !important;
    }

    /* 4. Barre de Dock Unifiée en Bas (Navigation + Carnet + EPI + 911 - Mode Clair) */
    .phase-navigation {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-height: 54px !important;
        height: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
        background: rgba(255, 255, 255, 0.97) !important;
        border-top: 1px solid #e2e8f0 !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05) !important;
        box-sizing: border-box !important;
    }

    #btn-prev-phase, #btn-next-phase {
        padding: 7px 10px !important;
        font-size: 0.74rem !important;
        border-radius: 10px !important;
        max-width: 98px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #btn-prev-phase {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        color: #475569 !important;
        font-weight: 700 !important;
    }

    #btn-next-phase {
        background: #c2410c !important;
        border: 1px solid #ea580c !important;
        color: #ffffff !important;
        font-weight: 800 !important;
    }

    .floating-fab-dock {
        position: fixed !important;
        bottom: 7px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        z-index: 105 !important;
        background: rgba(255, 255, 255, 0.96) !important;
        padding: 3px 10px !important;
        border-radius: 24px !important;
        border: 1px solid rgba(203, 213, 225, 0.9) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    }

    .fab-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .fab-btn .fab-icon {
        font-size: 1.05rem !important;
    }
}



/* Sélecteur bilingue universel FR / EN */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 3px;
    gap: 3px;
    backdrop-filter: blur(8px);
}
.lang-btn {
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    padding: 7px 12px;
    min-height: 34px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-btn:hover {
    color: #ffffff;
}
.lang-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ========================================================
   MONITEUR MULTIPARAMÉTRIQUE PERMANENT DES SIGNES VITAUX
   Affiché en tout temps dès le début du scénario
   ======================================================== */
.vitals-monitor-persistent {
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #cbd5e1;
    border-radius: 0 0 12px 12px;
    padding: 6px 14px 8px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    z-index: 85;
    flex-shrink: 0;
    transition: all 0.3s ease;
    user-select: none;
    box-sizing: border-box;
}

.vitals-monitor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.vitals-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: none;
}

@keyframes vitalsLiveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.3); }
}

.vitals-header-title {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: #0369a1;
    text-transform: uppercase;
}

.vitals-header-patient {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-left: auto;
}

.vitals-monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.vital-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 64px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.vital-card:hover {
    border-color: #38bdf8;
    background: #f8fafc;
}

.vital-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 2px;
}

.vital-card-icon {
    font-size: 0.9rem;
    display: inline-block;
}

.vital-card-icon.live-heartbeat {
    animation: heartPulseAnim var(--heartbeat-dur, 0.75s) infinite ease-in-out;
}

@keyframes heartPulseAnim {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.22); }
    30% { transform: scale(1.05); }
    45% { transform: scale(1.18); }
    60% { transform: scale(1); }
}

.vital-card-icon.live-breath {
    animation: breathAnim var(--breath-dur, 3s) infinite ease-in-out;
}

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

.vital-card-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #64748b;
    text-transform: uppercase;
}

.vital-card-pill {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f1f5f9;
    color: #475569;
}

.vital-card-pill.pill-ok {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.vital-card-pill.pill-warn {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.vital-card-pill.pill-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    animation: dangerPillFlash 1.2s infinite alternate;
}

.vital-card-pill.pill-critical {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
}

@keyframes dangerPillFlash {
    0% { opacity: 0.7; }
    100% { opacity: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
}

.vital-card-center {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.vital-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.vital-card-unit {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    margin-right: auto;
}

.vital-card-bpm .vital-card-value { color: #dc2626; }
.vital-card-spo2 .vital-card-value { color: #0284c7; }
.vital-card-resp .vital-card-value { color: #059669; }

.vital-card-ecg, .vital-card-wave {
    width: 52px;
    height: 15px;
    align-self: center;
}

.vital-ecg-path {
    stroke: #dc2626;
    stroke-width: 1.8;
    fill: none;
    stroke-dasharray: 100;
    animation: ecgFlow 1.8s linear infinite;
}

@keyframes ecgFlow {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

.vital-wave-path {
    stroke: #059669;
    stroke-width: 1.8;
    fill: none;
    stroke-dasharray: 60;
    animation: waveFlow 2.8s linear infinite;
}

@keyframes waveFlow {
    0% { stroke-dashoffset: 60; }
    100% { stroke-dashoffset: 0; }
}

.vital-spo2-track {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.vital-spo2-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 2px;
    transition: width 0.6s ease, background 0.4s ease;
}

.vital-status-text {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vital-circ-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsiveness Mobile - Ruban 4 Signes Vitaux 100% visible sur 1 ligne - Mode Clair */
@media (max-width: 768px) {
    .vitals-monitor-persistent {
        pointer-events: auto !important;
        padding: 3px 6px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-radius: 0 0 12px 12px !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
    }
    .vitals-monitor-header {
        display: none !important;
    }
    .vitals-monitor-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
        width: 100% !important;
    }
    .vital-card {
        padding: 8px 10px !important;
        min-height: 52px !important;
        height: auto !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    }
    .vital-card-top {
        margin: 0 !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
    }
    .vital-card-icon {
        font-size: 0.72rem !important;
    }
    .vital-card-label {
        font-size: 0.75rem !important;
        color: #64748b !important;
    }
    .vital-card-pill, .vital-spo2-track, .vital-card-ecg, .vital-card-wave, .vital-circ-sub {
        display: none !important;
    }
    .vital-card-center {
        display: flex !important;
        align-items: baseline !important;
        gap: 2px !important;
        line-height: 1 !important;
    }
    .vital-card-value {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
    }
    .vital-card-unit {
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
    }
    .vital-status-text {
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: center !important;
        max-width: 100% !important;
        color: #0f172a !important;
    }
}


/* ==========================================================================
   SECOURSIM POV IMMERSIVE MODE (Pure Photographic Backgrounds)
   ========================================================================== */
.char-wrapper.pov-character-hitbox,
.dynamic-victim.pov-character-hitbox {
    background: transparent !important;
}
.char-wrapper.pov-character-hitbox .char-img,
.dynamic-victim.pov-character-hitbox .char-img {
    background-image: none !important;
    animation: none !important;
    box-shadow: none !important;
    border: none !important;
    filter: none !important;
}
.char-wrapper.pov-character-hitbox:hover,
.dynamic-victim.pov-character-hitbox:hover {
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.45));
}
.char-wrapper.pov-character-hitbox .char-name-tag,
.dynamic-victim.pov-character-hitbox .char-name-tag {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    bottom: 58px !important;
}

/* ==========================================================================
   SECOURSIM CLINICAL CLOSE-UP OVERLAY (Option 3: 1 + 3 Hybrid Mode)
   ========================================================================== */
.btn-toggle-closeup {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 135;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(15, 23, 42, 0.84);
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-toggle-closeup:hover {
    transform: translateY(-1px);
    background: rgba(14, 116, 144, 0.92);
    box-shadow: 0 8px 24px rgba(14, 116, 144, 0.45);
}
.btn-toggle-closeup.active {
    display: none !important;
}
.btn-toggle-closeup.hidden {
    display: none !important;
}

.clinical-closeup-overlay {
    position: absolute;
    inset: 0;
    z-index: 130;
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    animation: closeupFadeIn 0.22s ease;
}
.clinical-closeup-overlay.hidden {
    display: none !important;
}
@keyframes closeupFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
.clinical-closeup-frame {
    position: relative;
    width: min(100%, 720px);
    max-height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
}
.clinical-closeup-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.clinical-closeup-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #38bdf8;
    text-transform: uppercase;
}
.clinical-closeup-close {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.clinical-closeup-close:hover {
    background: rgba(239, 68, 68, 0.85);
}
.clinical-closeup-frame img {
    width: 100%;
    max-height: calc(100% - 80px);
    object-fit: cover;
    display: block;
}
.clinical-closeup-caption {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}
/* ==========================================================================
   SECOURSIM MODE MOBILE UNIFIÉ (<= 819px) — VERRE FUMÉ SOMBRE TRANSLUCIDE
   Source unique de vérité : 0 collision, HUD allégé, Phase 1 libre, tactile >= 44px
   ========================================================================== */
@media (max-width: 819px) {
    /* 1. Scène POV plein écran */
    #screen-game.active,
    #screen-game .game-layout {
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100dvh !important;
        overflow: hidden !important;
        background: #0b1b33 !important;
    }

    #game-scene.game-scene {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        z-index: 1 !important;
    }

    /* 2. HUD Supérieur Ultra-Compact (~104px total) — Verre Fumé Sombre */
    .action-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: env(safe-area-inset-top, 0px) 0 0 0 !important;
        background: transparent !important;
        pointer-events: none !important;
        z-index: 90 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .action-panel-header,
    .vitals-monitor-persistent {
        pointer-events: auto !important;
    }

    .action-panel-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 6px 10px 5px 10px !important;
        gap: 4px !important;
        background: rgba(11, 27, 51, 0.76) !important;
        backdrop-filter: blur(16px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        color: #f8fafc !important;
    }

    /* Ligne 1 : Numéro de phase + Titre */
    .action-panel-phase {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
        order: 1 !important;
    }

    .phase-number {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.78rem !important;
        flex-shrink: 0 !important;
        border-radius: 6px !important;
        background: #c2410c !important;
        color: #ffffff !important;
        font-weight: 800 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .phase-info {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .phase-info h3,
    #phase-title {
        font-size: 0.86rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    }

    #phase-description {
        display: none !important;
    }

    /* Barre de progression 5 segments ultra-fine (4px au lieu de 30px de cercles) */
    .topbar-center {
        display: flex !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        padding: 2px 0 !important;
        margin: 0 !important;
        order: 2 !important;
        border: 0 !important;
    }

    .step-indicator {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .step-indicator .step {
        width: 100% !important;
        height: 4px !important;
        min-height: 4px !important;
        font-size: 0 !important;
        border: 0 !important;
        border-radius: 99px !important;
        background: rgba(255, 255, 255, 0.22) !important;
        transform: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .step-indicator .step.active {
        background: #f97316 !important;
    }

    .step-indicator .step.completed {
        background: #10b981 !important;
    }

    .step-indicator .step-line {
        display: none !important;
    }

    /* Ligne 2 : Vitalité + Chrono + Boutons (tous >= 12px et lisibles) */
    .action-panel-header > div:last-child {
        flex: 1 1 100% !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        padding-top: 2px !important;
        order: 3 !important;
    }

    .vitality-container-inline {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        min-width: 64px !important;
        max-width: 88px !important;
        flex: 1 1 auto !important;
    }

    .vitality-header {
        display: flex !important;
        justify-content: space-between !important;
        font-size: 0.75rem !important;
        line-height: 1.1 !important;
        color: #f8fafc !important;
        font-weight: 700 !important;
    }

    .vitality-label {
        display: inline !important;
        font-size: 0.75rem !important;
        color: #fca5a5 !important;
    }

    .vitality-percentage {
        font-size: 0.75rem !important;
        color: #ffffff !important;
    }

    .vitality-bar-bg {
        height: 4px !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.22) !important;
        border-radius: 99px !important;
    }

    .timer#game-timer {
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        font-variant-numeric: tabular-nums !important;
        padding: 4px 7px !important;
        margin: 0 !important;
        min-height: 30px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        background: rgba(15, 23, 42, 0.55) !important;
        border: 1px solid rgba(125, 211, 252, 0.35) !important;
        color: #7dd3fc !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }

    .action-panel-header .btn-ghost {
        min-height: 32px !important;
        height: 32px !important;
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        background: rgba(255, 255, 255, 0.14) !important;
        border: 1px solid rgba(255, 255, 255, 0.24) !important;
        color: #f8fafc !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 3. Ruban Vitaux Ultra-Compact 1 ligne (34px, >= 12px lisible) */
    .vitals-monitor-persistent {
        pointer-events: auto !important;
        position: static !important;
        width: 100% !important;
        padding: 4px 8px !important;
        background: rgba(11, 27, 51, 0.62) !important;
        backdrop-filter: blur(14px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 0 0 12px 12px !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22) !important;
        box-sizing: border-box !important;
    }

    .vitals-monitor-header {
        display: none !important;
    }

    .vitals-monitor-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px !important;
        width: 100% !important;
    }

    .vital-card {
        padding: 4px 5px !important;
        min-height: 30px !important;
        height: auto !important;
        background: rgba(15, 23, 42, 0.55) !important;
        border: 1px solid rgba(255, 255, 255, 0.16) !important;
        border-radius: 8px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

    .vital-card-top {
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }

    .vital-card-icon {
        font-size: 0.78rem !important;
    }

    .vital-card-label,
    .vital-card-pill,
    .vital-spo2-track,
    .vital-card-ecg,
    .vital-card-wave,
    .vital-circ-sub {
        display: none !important;
    }

    .vital-card-center {
        display: inline-flex !important;
        align-items: baseline !important;
        gap: 1px !important;
        line-height: 1 !important;
        min-width: 0 !important;
    }

    .vital-card-value {
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        font-variant-numeric: tabular-nums !important;
        line-height: 1 !important;
    }

    .vital-card-unit {
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        color: #cbd5e1 !important;
    }

    .vital-card-bpm .vital-card-value { color: #fca5a5 !important; }
    .vital-card-spo2 .vital-card-value { color: #7dd3fc !important; }
    .vital-card-resp .vital-card-value { color: #6ee7b7 !important; }

    .vital-status-text {
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        color: #f8fafc !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        line-height: 1.15 !important;
    }

    .vitals-panel:not(.hidden) {
        display: none !important;
    }

    /* 4. Voies d'empilement propres (0 collision HUD / Alertes / Gros plan / Bulles) */
    .discovery-status-bar {
        display: none !important;
    }

    .active-alerts-overlay {
        position: fixed !important;
        top: calc(var(--mob-hud-h, 112px) + 6px) !important;
        left: 8px !important;
        right: 8px !important;
        z-index: 88 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        pointer-events: none !important;
    }

    .active-alerts-overlay .alert-badge {
        padding: 5px 10px !important;
        gap: 6px !important;
        border-radius: 10px !important;
        background: rgba(127, 29, 29, 0.86) !important;
        border: 1px solid rgba(252, 165, 165, 0.55) !important;
        color: #ffffff !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    }

    .active-alerts-overlay .alert-badge .alert-title {
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        color: #ffffff !important;
    }

    .active-alerts-overlay .alert-badge .alert-subtext {
        display: none !important;
    }

    .btn-toggle-closeup {
        position: fixed !important;
        top: var(--mob-closeup-top, 120px) !important;
        right: 10px !important;
        bottom: auto !important;
        z-index: 87 !important;
        min-height: 36px !important;
        padding: 6px 12px !important;
        font-size: 0.78rem !important;
        background: rgba(11, 27, 51, 0.84) !important;
        border: 1px solid rgba(125, 211, 252, 0.55) !important;
        color: #f8fafc !important;
    }

    .clinical-closeup-overlay {
        padding: 8px !important;
        z-index: 140 !important;
    }

    .clinical-closeup-caption {
        font-size: 0.78rem !important;
        padding: 8px 12px !important;
    }

    /* Bandeau Sous-Titre Cinéma compact pour les paroles (0 chevauchement, 100 % lisible) */
    .speech-bubble:not(.bubble-action),
    .speech-bubble.bubble-center,
    .micro-bubble,
    .micro-bubble-witness,
    .micro-bubble-victim,
    .micro-bubble-player {
        position: fixed !important;
        top: var(--mob-top-safe, 158px) !important;
        left: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        padding: 8px 12px !important;
        font-size: 0.84rem !important;
        line-height: 1.38 !important;
        border-radius: 12px !important;
        z-index: 86 !important;
        background: rgba(11, 27, 51, 0.86) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border: 1px solid rgba(255, 255, 255, 0.24) !important;
        color: #f8fafc !important;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32) !important;
    }

    .micro-bubble::after,
    .speech-bubble:not(.bubble-action)::after {
        display: none !important;
    }

    .micro-bubble-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        color: #7dd3fc !important;
        margin-bottom: 2px !important;
    }

    .micro-bubble-body {
        font-size: 0.84rem !important;
        line-height: 1.38 !important;
        color: #f8fafc !important;
    }

    /* 5. Phase 1 Exploration : Pilule compacte en HAUT (libère 100 % des 23 indices bas !) */
    .dialogue-choices-bubble.is-discovery-compact,
    #sequential-action-bubble.is-discovery-compact {
        position: fixed !important;
        top: var(--mob-discovery-top, 118px) !important;
        bottom: auto !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
        padding: 8px 12px !important;
        border-radius: 12px !important;
        background: rgba(11, 27, 51, 0.82) !important;
        border: 1px solid rgba(251, 191, 36, 0.55) !important;
        z-index: 85 !important;
    }

    #sequential-action-bubble.is-discovery-compact .discovery-lock-card {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    #sequential-action-bubble.is-discovery-compact .discovery-lock-title {
        font-size: 0.8rem !important;
        font-weight: 800 !important;
        color: #fde68a !important;
        margin: 0 !important;
    }

    #sequential-action-bubble.is-discovery-compact .discovery-lock-desc {
        display: none !important;
    }

    #sequential-action-bubble.is-discovery-compact .discovery-lock-pill {
        font-size: 0.78rem !important;
        font-weight: 800 !important;
        padding: 3px 9px !important;
        border-radius: 99px !important;
        background: rgba(245, 158, 11, 0.24) !important;
        border: 1px solid rgba(251, 191, 36, 0.55) !important;
        color: #fef3c7 !important;
    }

    /* 6. Feuille de Décision Clinique en Bas (Verre Fumé Sombre + Repliable "👁️ Scène") */
    .dialogue-choices-bubble:not(.is-discovery-compact),
    #sequential-action-bubble:not(.is-discovery-compact) {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: 41dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 12px !important;
        border-radius: 16px !important;
        background: rgba(11, 27, 51, 0.76) !important;
        backdrop-filter: blur(16px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #f8fafc !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34) !important;
        z-index: 82 !important;
    }

    /* Mode Replié ("👁️ Scène") -> barre 1 ligne libérant ~72 % de l'écran */
    #sequential-action-bubble.is-sheet-collapsed {
        padding: 6px 10px !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #sequential-action-bubble.is-sheet-collapsed .mobile-sheet-body {
        display: none !important;
    }

    #sequential-action-bubble.is-sheet-collapsed .mobile-sheet-collapsed-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: 40px !important;
        background: transparent !important;
        border: 0 !important;
        color: #ffffff !important;
        font-size: 0.86rem !important;
        font-weight: 800 !important;
        cursor: pointer !important;
        padding: 2px 4px !important;
    }

    .mobile-sheet-open-pill {
        background: #1d4ed8 !important;
        color: #ffffff !important;
        padding: 5px 12px !important;
        border-radius: 99px !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
    }

    .btn-sheet-minimize {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        min-height: 30px !important;
        padding: 3px 9px !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.26) !important;
        background: rgba(255, 255, 255, 0.14) !important;
        color: #f8fafc !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
    }

    .sequential-action-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        color: #f8fafc !important;
    }

    #sequential-action-bubble .sequential-action-card div,
    .dialogue-choices-bubble div {
        color: #f1f5f9 !important;
    }

    .sequential-action-title span,
    .priority-header-badge {
        color: #7dd3fc !important;
        font-size: 0.8rem !important;
        font-weight: 800 !important;
    }

    .priority-instruction {
        font-size: 0.8rem !important;
        line-height: 1.35 !important;
        color: #e2e8f0 !important;
        margin-bottom: 8px !important;
    }

    .btn-mode-switch {
        min-height: 30px !important;
        padding: 3px 9px !important;
        border-radius: 8px !important;
        background: rgba(56, 189, 248, 0.22) !important;
        border: 1px solid rgba(125, 211, 252, 0.45) !important;
        color: #e0f2fe !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
    }

    .panic-dialogue-bar {
        background: rgba(37, 99, 235, 0.25) !important;
        border: 1px solid rgba(96, 165, 250, 0.48) !important;
        padding: 6px 10px !important;
        border-radius: 10px !important;
        margin-bottom: 8px !important;
    }

    .panic-dialogue-label {
        color: #e0f2fe !important;
        font-size: 0.8rem !important;
    }

    .sequential-action-text {
        color: #ffffff !important;
        background: rgba(56, 189, 248, 0.16) !important;
        border: 1px solid rgba(125, 211, 252, 0.42) !important;
        border-radius: 10px !important;
        padding: 9px 12px !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        box-shadow: none !important;
    }

    /* Masquer les raccourcis clavier PC sur écran tactile */
    .clinical-choice-btn kbd,
    .desktop-kbd-hint {
        display: none !important;
    }

    .clinical-choice-row {
        gap: 10px !important;
    }

    .clinical-choice-btn {
        min-height: 44px !important;
        font-size: 0.84rem !important;
        padding: 9px 12px !important;
    }

    .btn-dismiss-trap {
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        background: rgba(239, 68, 68, 0.22) !important;
        border: 1.5px solid rgba(248, 113, 113, 0.55) !important;
        color: #fecaca !important;
    }

    .btn-action-no,
    .btn-action-yes {
        flex: 1 1 0 !important;
        min-height: 46px !important;
        font-size: 0.92rem !important;
        font-weight: 800 !important;
        border-radius: 11px !important;
    }

    .btn-action-no {
        background: rgba(255, 255, 255, 0.14) !important;
        border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
        color: #f8fafc !important;
        box-shadow: none !important;
    }

    .btn-action-yes {
        background: #c2410c !important;
        border: 1px solid #ea580c !important;
        color: #ffffff !important;
    }

    /* 7. Mode Triage START sans collision (Tag bar en bas + Feuille au-dessus) */
    .triage-tags-container {
        position: fixed !important;
        top: auto !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        transform: none !important;
        z-index: 92 !important;
        background: rgba(11, 27, 51, 0.84) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border: 1px solid rgba(255, 255, 255, 0.22) !important;
        padding: 6px !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 6px !important;
    }

    .triage-tag-draggable {
        flex: 1 1 0 !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        width: auto !important;
        height: auto !important;
        min-height: 40px !important;
        margin: 0 !important;
        padding: 6px 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.78rem !important;
    }

    body.triage-active-mobile #sequential-action-bubble:not(.is-discovery-compact) {
        bottom: calc(126px + env(safe-area-inset-bottom, 0px)) !important;
        max-height: 30dvh !important;
    }

    /* 8. Barre Inférieure & Dock Tactile >= 42-44px (0 chevauchement même sur 360px) */
    .phase-navigation,
    .bottom-navigation {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-height: 58px !important;
        height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
        background: rgba(11, 27, 51, 0.82) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    #btn-prev-phase,
    #btn-next-phase {
        min-height: 44px !important;
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        border-radius: 10px !important;
        max-width: 94px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #btn-prev-phase {
        background: rgba(255, 255, 255, 0.14) !important;
        border: 1px solid rgba(255, 255, 255, 0.24) !important;
        color: #f8fafc !important;
    }

    #btn-next-phase {
        background: #c2410c !important;
        border: 1px solid #ea580c !important;
        color: #ffffff !important;
        font-weight: 800 !important;
    }

    .floating-fab-dock {
        position: fixed !important;
        bottom: calc(6px + env(safe-area-inset-bottom, 0px)) !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        z-index: 105 !important;
        background: rgba(15, 23, 42, 0.72) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        padding: 3px 8px !important;
        border-radius: 99px !important;
        border: 1px solid rgba(255, 255, 255, 0.22) !important;
    }

    .fab-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    .fab-btn .fab-icon {
        font-size: 1.15rem !important;
    }

    /* Personnages dans la scène : centrés dans la fenêtre visible agrandie */
    .char-wrapper {
        top: calc(var(--mob-hud-h, 112px) + 18px) !important;
        bottom: auto !important;
        height: 46vh !important;
        width: 56% !important;
    }

    .clue-hotspot {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

@media (max-width: 390px) {
    #btn-prev-phase,
    #btn-next-phase {
        max-width: 82px !important;
        padding: 8px 8px !important;
        font-size: 0.75rem !important;
    }
    .floating-fab-dock {
        gap: 6px !important;
        padding: 3px 6px !important;
    }
    .fab-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
}

/* =====================================================================
   TUTORIEL INTERACTIF PAS-À-PAS SECOURSIM (LIGHT CLINICAL SPOTLIGHT)
   ===================================================================== */

.scenarios-tutorial-banner {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 18px auto;
    padding: 16px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 60%, #ecfeff 100%);
    border: 1.5px solid #93c5fd;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.scenarios-tutorial-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 280px;
    min-width: 0;
    text-align: left;
}

.scenarios-tutorial-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    color: #ffffff;
    font-size: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.scenarios-tutorial-info h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.scenarios-tutorial-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
}

.btn-launch-tutorial {
    padding: 11px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    white-space: nowrap;
}

.btn-launch-tutorial:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.36);
    filter: brightness(1.04);
}

/* Waiting-room interactive topbar chips */
.tut-mini-chip {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.tut-mini-chip:hover {
    background: rgba(59, 130, 246, 0.28);
    border-color: #60a5fa;
}

.tut-mini-chip.active {
    background: #2563eb;
    border-color: #93c5fd;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Spotlight Overlay & Light High-Contrast Card */
#tutorial-overlay.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 100500;
    pointer-events: all;
}

#tutorial-overlay.tutorial-overlay.hidden {
    display: none !important;
}

#tutorial-overlay .tutorial-mask-svg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#tutorial-overlay .tutorial-spotlight-ring {
    fill: none;
    stroke: #60a5fa;
    stroke-width: 3;
    transition: none;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.9));
}

.tutorial-target-pulse {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.55));
}

#tutorial-overlay .tutorial-card {
    position: fixed;
    width: 390px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    color: #0f172a;
    border: 1.5px solid #93c5fd;
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.14),
        0 24px 60px rgba(2, 6, 23, 0.45);
    z-index: 100502;
    pointer-events: all;
    box-sizing: border-box;
    animation: none !important;
}

#tutorial-overlay .tutorial-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#tutorial-overlay .tutorial-step-badge {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 4px 11px;
    font-family: 'JetBrains Mono', monospace;
}

#tutorial-overlay .tutorial-skip-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#tutorial-overlay .tutorial-skip-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tutorial-card-progressbar {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.tutorial-card-progressbar-fill {
    height: 100%;
    width: 6%;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    border-radius: 999px;
    transition: width 0.28s ease;
}

.tutorial-title-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 12px;
    text-align: left;
}

.tutorial-card-icon-inline {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.tutorial-title-meta {
    min-width: 0;
    flex: 1;
}

.tutorial-element-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

#tutorial-overlay .tutorial-card-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
    text-align: left;
    line-height: 1.28;
}

.tutorial-info-block {
    border-radius: 10px;
    padding: 9px 11px;
    margin-bottom: 8px;
    text-align: left;
    border-left: 3.5px solid #2563eb;
    background: #f8fafc;
}

.tutorial-info-block.tutorial-info-meaning {
    background: #eff6ff;
    border-left-color: #2563eb;
}

.tutorial-info-block.tutorial-info-action {
    background: #f0fdf4;
    border-left-color: #059669;
}

.tutorial-info-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}

.tutorial-info-meaning .tutorial-info-label {
    color: #1d4ed8;
}

.tutorial-info-action .tutorial-info-label {
    color: #047857;
}

.tutorial-info-block p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.46;
    color: #1e293b;
}

.tutorial-info-block code {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.tutorial-info-tip {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.38;
    text-align: left;
    margin-bottom: 10px;
}

#tutorial-overlay .tutorial-progress-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 10px 0 10px;
}

#tutorial-overlay .tutorial-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: #cbd5e1;
    border: none !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

#tutorial-overlay .tutorial-dot.done {
    background: #60a5fa;
}

#tutorial-overlay .tutorial-dot.active {
    width: 20px !important;
    background: #2563eb;
    transform: none !important;
    box-shadow: none !important;
}

.tutorial-optout-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    user-select: none;
}

.tutorial-optout-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

#tutorial-overlay .tutorial-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

#tutorial-overlay .tutorial-card-footer .btn {
    padding: 9px 14px;
    font-size: 0.84rem;
    font-weight: 800;
    border-radius: 10px;
    min-height: 38px;
}

#tutorial-overlay .tutorial-card-footer .btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

#tutorial-overlay .tutorial-card-footer .btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
}

@media (max-width: 819px) {
    .action-panel-header > div:last-child {
        gap: 4px !important;
    }
    #btn-open-tutorial {
        padding: 4px 7px !important;
        min-width: 30px !important;
    }
}

@media (max-width: 680px) {
    .scenarios-tutorial-banner {
        padding: 14px;
    }
    .btn-launch-tutorial {
        width: 100%;
        text-align: center;
    }
    #tutorial-overlay .tutorial-card {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        max-height: 64dvh !important;
        overflow-y: auto !important;
    }
    #tutorial-overlay .tutorial-card.sheet-top {
        top: 0 !important;
        bottom: auto !important;
        border-radius: 0 0 20px 20px !important;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px !important;
    }
    #tutorial-overlay .tutorial-card.sheet-center {
        left: 12px !important;
        right: 12px !important;
        width: calc(100% - 24px) !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        border-radius: 18px !important;
        max-height: 82dvh !important;
    }
    #tutorial-overlay .tutorial-info-block {
        padding: 7px 10px !important;
        margin-bottom: 6px !important;
    }
    #tutorial-overlay .tutorial-info-block p {
        font-size: 0.8rem !important;
        line-height: 1.38 !important;
    }
    #tutorial-overlay .tutorial-skip-btn {
        min-height: 30px !important;
        min-width: 0 !important;
        padding: 4px 10px !important;
    }
}
