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

:root {
    --green: #00FF41;
    --green-dim: #00cc33;
    --green-dark: #003b00;
    --red: #ff3333;
    --amber: #ffb800;
    --bg: #0a0a0a;
    --font: 'Courier New', 'Lucida Console', monospace;
}

html, body {
    height: 100%;
    background: #000;
    overflow: hidden;
    font-family: var(--font);
}

body {
    position: relative;
}

/* ========== LOBBY ========== */
#lobby {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 20px;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    overflow: hidden;
}

#matrix-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
}

#lobby::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0,255,65,0.14) 0%, transparent 55%),
        linear-gradient(180deg, #000 0%, #010801 100%);
    pointer-events: none;
}

#lobby.hidden {
    opacity: 0;
    visibility: hidden;
}

#lobby-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    border: 1px solid rgba(0, 255, 65, 0.45);
    border-radius: 4px;
    background: rgba(0, 4, 0, 0.93);
    box-shadow:
        0 0 0 1px rgba(0,255,65,0.07),
        0 0 40px rgba(0, 255, 65, 0.14),
        0 0 90px rgba(0, 255, 65, 0.05),
        inset 0 0 28px rgba(0, 255, 65, 0.04);
    color: var(--green);
    overflow: hidden;
}

/* ---- Classification banner ---- */
#lobby-classification {
    background: rgba(220, 30, 30, 0.12);
    border-bottom: 1px solid rgba(255, 55, 55, 0.35);
    color: #ff5050;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.26em;
    padding: 9px 20px;
    text-align: center;
    animation: pulse-red 2.2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* ---- Title area ---- */
#lobby-title-area {
    padding: 26px 28px 22px;
    text-align: center;
}

.lobby-kicker {
    color: var(--amber);
    font-size: 11px;
    letter-spacing: 0.34em;
    margin-bottom: 16px;
}

.glitch-title {
    position: relative;
    font-size: clamp(24px, 5vw, 44px);
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-shadow: 0 0 22px rgba(0,255,65,0.45);
    animation: glitch-main 6s infinite;
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0; right: 0; top: 0;
    overflow: hidden;
}

.glitch-title::before {
    color: #ff3333;
    animation: glitch-before 6s infinite;
    clip-path: polygon(0 25%, 100% 25%, 100% 44%, 0 44%);
}

.glitch-title::after {
    color: #00ffff;
    animation: glitch-after 6s infinite;
    clip-path: polygon(0 60%, 100% 60%, 100% 78%, 0 78%);
}

@keyframes glitch-main {
    0%, 91%, 100% { transform: none; }
    92%  { transform: skewX(-3deg) translateX(3px); }
    93%  { transform: skewX(2deg) translateX(-2px); }
    94%  { transform: none; }
}

@keyframes glitch-before {
    0%, 90%, 100% { transform: none; opacity: 0; }
    91%  { transform: translateX(-4px); opacity: 0.75; }
    93%  { transform: translateX(4px);  opacity: 0.75; }
    94%  { opacity: 0; }
}

@keyframes glitch-after {
    0%, 90%, 100% { transform: none; opacity: 0; }
    92%   { transform: translateX(3px);  opacity: 0.6; }
    93.5% { transform: translateX(-2px); opacity: 0.6; }
    95%   { opacity: 0; }
}

/* ---- Separator ---- */
.lobby-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,65,0.28), transparent);
    margin: 0 28px;
}

/* ---- Briefing table ---- */
#lobby-briefing {
    padding: 18px 28px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.briefing-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
}

.briefing-label {
    min-width: 128px;
    color: rgba(0,255,65,0.42);
    font-size: 11px;
    letter-spacing: 0.16em;
    flex-shrink: 0;
}

.briefing-label::after { content: ' ·'; }

.briefing-value {
    color: var(--green);
    letter-spacing: 0.06em;
}

.bv-amber { color: var(--amber); }
.bv-red   { color: #ff5555; }

.bv-blink {
    animation: blink-status 1.4s step-end infinite;
}

@keyframes blink-status {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ---- Syscheck ---- */
#lobby-syscheck {
    padding: 14px 28px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid rgba(0,255,65,0.1);
    border-bottom: 1px solid rgba(0,255,65,0.1);
}

.syscheck-item {
    font-size: 12px;
    color: rgba(0,255,65,0.38);
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.syscheck-item.checking {
    color: var(--amber);
    animation: check-pulse 0.5s ease-in-out infinite alternate;
}

.syscheck-item.checked {
    color: var(--green);
}

@keyframes check-pulse {
    from { opacity: 0.55; }
    to   { opacity: 1; }
}

/* ---- Launch button ---- */
#start-button {
    display: block;
    width: calc(100% - 56px);
    margin: 20px 28px;
    padding: 15px 24px;
    border: 1px solid var(--green);
    border-radius: 3px;
    background: rgba(0,255,65,0.05);
    color: var(--green);
    font-family: var(--font);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.24em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

#start-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; right: 100%; bottom: 0;
    background: rgba(0,255,65,0.07);
    transition: left 0.35s ease, right 0.35s ease;
}

#start-button:hover::before,
#start-button:focus-visible::before {
    left: 0; right: 0;
}

#start-button:hover,
#start-button:focus-visible {
    outline: none;
    background: rgba(0,255,65,0.10);
    box-shadow: 0 0 22px rgba(0,255,65,0.22), inset 0 0 10px rgba(0,255,65,0.07);
    transform: translateY(-1px);
}

#start-button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

#cv-button {
    display: block;
    width: calc(100% - 56px);
    margin: -10px 28px 16px;
    padding: 10px 24px;
    border: 1px solid rgba(0,255,65,0.35);
    border-radius: 3px;
    background: transparent;
    color: rgba(0,255,65,0.6);
    font-family: var(--font);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.18em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#cv-button:hover {
    background: rgba(0,255,65,0.07);
    color: var(--green);
    border-color: var(--green);
}

/* ---- Footer ---- */
#lobby-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 28px;
    border-top: 1px solid rgba(0,255,65,0.1);
    font-size: 11px;
    color: rgba(0,255,65,0.32);
    letter-spacing: 0.12em;
}

body.lobby-active #crt {
    opacity: 0.08;
    transform: scale(1.01);
    pointer-events: none;
}

/* ========== CRT MONITOR EFFECT ========== */
#crt {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    animation: flicker 0.15s infinite alternate;
}

/* Scanlines overlay */
#scanlines {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

#scanlines::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 101;
    pointer-events: none;
}

/* Subtle flicker */
@keyframes flicker {
    0%   { opacity: 0.97; }
    50%  { opacity: 1; }
    100% { opacity: 0.98; }
}

/* ========== TERMINAL ========== */
#terminal {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    padding-bottom: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--green);
    font-size: 15px;
    line-height: 1.5;
    font-family: var(--font);
    z-index: 10;
    scroll-behavior: smooth;
}

#terminal::-webkit-scrollbar {
    width: 6px;
}

#terminal::-webkit-scrollbar-track {
    background: var(--bg);
}

#terminal::-webkit-scrollbar-thumb {
    background: var(--green-dark);
    border-radius: 3px;
}

/* ========== OUTPUT LINES ========== */
#output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

#output .line {
    min-height: 1.5em;
}

#output .line.error {
    color: var(--red);
}

#output .line.warning {
    color: var(--amber);
}

#output .line.success {
    color: var(--green);
    text-shadow: 0 0 10px var(--green), 0 0 20px var(--green);
    font-weight: bold;
}

#output .line.system {
    color: #888;
    font-style: italic;
}

#output .line.ascii-art {
    color: var(--green);
    text-shadow: 0 0 15px var(--green), 0 0 30px var(--green);
    font-weight: bold;
    line-height: 1.15;
}

#output .line.highlight {
    color: var(--green);
    text-shadow: 0 0 8px var(--green), 0 0 16px var(--green);
}

#output .line.cmd-echo {
    color: var(--green-dim);
    opacity: 0.7;
}

#output .progress-bar {
    display: inline-block;
    color: var(--green);
}

/* ========== INPUT LINE ========== */
#input-line {
    display: flex;
    align-items: center;
    margin-top: 5px;
    min-height: 1.5em;
}

#prompt {
    color: var(--green);
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 0 0 5px var(--green-dark);
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--green);
    font-family: var(--font);
    font-size: 15px;
    caret-color: var(--green);
    padding: 0;
    margin: 0;
}

/* cursor span removed — native caret used instead */

/* ========== GLITCH EFFECT ========== */
@keyframes glitch {
    0%   { transform: translate(0); filter: hue-rotate(0deg); }
    10%  { transform: translate(-5px, 3px); filter: hue-rotate(90deg); }
    20%  { transform: translate(3px, -2px); filter: hue-rotate(180deg); }
    30%  { transform: translate(-3px, 5px); filter: hue-rotate(270deg); }
    40%  { transform: translate(5px, -3px); filter: hue-rotate(45deg); }
    50%  { transform: translate(-2px, 2px); filter: hue-rotate(135deg); }
    60%  { transform: translate(4px, -4px); filter: hue-rotate(225deg); }
    70%  { transform: translate(-4px, 3px); filter: hue-rotate(315deg); }
    80%  { transform: translate(2px, -5px); filter: hue-rotate(60deg); }
    90%  { transform: translate(-3px, 4px); filter: hue-rotate(150deg); }
    100% { transform: translate(0); filter: hue-rotate(0deg); }
}

#crt.glitch {
    animation: glitch 0.3s linear;
}

#crt.glitch #scanlines {
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 0, 0, 0.1) 0px,
        rgba(0, 255, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* ========== BRUTE FORCE DECRYPT ANIMATION ========== */
.bruteforce-chars {
    color: var(--green);
    font-size: 15px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--green);
}

/* ========== FINAL REVEAL ========== */
.final-reveal {
    color: var(--green);
    text-shadow: 0 0 20px var(--green), 0 0 40px var(--green), 0 0 60px var(--green);
    font-size: 18px;
    font-weight: bold;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px var(--green), 0 0 40px var(--green); }
    50%      { text-shadow: 0 0 30px var(--green), 0 0 60px var(--green), 0 0 80px var(--green); }
}

.map-panel {
    margin: 12px 0 18px;
}

.map-image {
    display: block;
    width: min(100%, 720px);
    border: 2px solid var(--green);
    border-radius: 8px;
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.45), 0 0 36px rgba(0, 255, 65, 0.2);
    filter: saturate(0.95) contrast(1.02);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    #lobby {
        padding: 16px;
    }

    #lobby-panel {
        padding: 24px 18px;
        border-radius: 14px;
    }

    #start-button {
        width: 100%;
    }

    #terminal {
        font-size: 12px;
        padding: 10px;
        padding-bottom: 50px;
    }

    #command-input {
        font-size: 12px;
    }

    .final-reveal {
        font-size: 14px;
    }

    .map-image {
        border-radius: 6px;
    }

    #output .line.ascii-art {
        font-size: 7px;
        line-height: 1.05;
    }
}

@media (max-width: 400px) {
    #output .line.ascii-art {
        font-size: 5.5px;
    }
}

/* ========== VAULT MODAL — Mini-jeu ========== */
#vault-modal {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#vault-modal.vault-hidden {
    pointer-events: none;
}

#vault-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.35s ease;
}

#vault-modal.vault-visible #vault-overlay {
    opacity: 1;
}

#vault-panel {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    background: #060400;
    border: 2px solid var(--amber);
    border-radius: 18px;
    box-shadow:
        0 0 40px rgba(255, 184, 0, 0.45),
        0 0 80px rgba(255, 184, 0, 0.18),
        inset 0 0 30px rgba(255, 184, 0, 0.04);
    overflow: hidden;
    transform: scale(0.82) translateY(24px);
    opacity: 0;
    transition: transform 0.44s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

#vault-modal.vault-visible #vault-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* —— Title bar —— */
#vault-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(255, 184, 0, 0.08);
    border-bottom: 1px solid rgba(255, 184, 0, 0.25);
    font-family: var(--font);
    font-size: 10px;
    color: var(--amber);
    letter-spacing: 0.22em;
}

.vault-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber), 0 0 12px rgba(255, 184, 0, 0.4);
    animation: vault-led-blink 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes vault-led-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* —— Lock rings —— */
#vault-lock-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 0 10px;
}

#vault-lock-rings {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vring {
    position: absolute;
    border-radius: 50%;
    border-style: dashed;
}

.vring-1 {
    width: 106px;
    height: 106px;
    border: 2px dashed rgba(255, 184, 0, 0.45);
    animation: vring-cw 14s linear infinite;
}

.vring-2 {
    width: 76px;
    height: 76px;
    border: 2px dashed rgba(255, 184, 0, 0.6);
    animation: vring-ccw 8s linear infinite;
}

.vring-3 {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 184, 0, 0.85);
    animation: vring-cw 4.5s linear infinite;
}

@keyframes vring-cw  { to { transform: rotate(360deg);  } }
@keyframes vring-ccw { to { transform: rotate(-360deg); } }

.vring.vring-stopped {
    animation-play-state: paused;
    transition: border-color 0.6s ease;
}

#vault-panel.vault-unlocked .vring {
    border-color: rgba(0, 255, 65, 0.7);
}

#vault-lock-icon {
    position: relative;
    z-index: 2;
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.7));
    transition: filter 0.5s ease;
}

#vault-panel.vault-unlocked #vault-lock-icon {
    filter: drop-shadow(0 0 14px rgba(0, 255, 65, 0.9));
}

#vault-lock-label {
    margin-top: 8px;
    font-family: var(--font);
    font-size: 9px;
    letter-spacing: 0.35em;
    color: var(--amber);
    opacity: 0.55;
    transition: color 0.5s ease, opacity 0.5s ease;
}

#vault-panel.vault-unlocked #vault-lock-label {
    color: var(--green);
    opacity: 1;
}

/* —— Enigma —— */
#vault-enigma-section {
    margin: 0 18px 12px;
    padding: 12px 15px;
    border: 1px solid rgba(255, 184, 0, 0.18);
    border-radius: 10px;
    background: rgba(255, 184, 0, 0.025);
}

.vault-section-header {
    font-family: var(--font);
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--amber);
    margin-bottom: 8px;
    opacity: 0.75;
}

#vault-enigma-text {
    font-family: var(--font);
    font-size: 13px;
    color: #ffd98a;
    line-height: 1.65;
    font-style: italic;
}

#vault-enigma-text strong {
    color: var(--amber);
    font-style: normal;
    font-size: 14px;
}

/* —— Digital display —— */
#vault-input-section {
    margin: 0 18px 10px;
}

#vault-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    background: #000;
    border: 2px solid rgba(0, 255, 65, 0.35);
    border-radius: 10px;
    box-shadow:
        inset 0 0 20px rgba(0, 255, 65, 0.07),
        0 0 12px rgba(0, 255, 65, 0.12);
    margin-bottom: 6px;
    min-height: 60px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#vault-display.display-error {
    border-color: rgba(255, 51, 51, 0.7);
    box-shadow: inset 0 0 20px rgba(255, 51, 51, 0.1), 0 0 12px rgba(255, 51, 51, 0.3);
}

#vault-display.display-success {
    border-color: rgba(0, 255, 65, 0.9);
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.15), 0 0 20px rgba(0, 255, 65, 0.4);
}

#vault-digits-display {
    font-family: var(--font);
    font-size: 34px;
    font-weight: bold;
    color: var(--green);
    letter-spacing: 14px;
    text-shadow: 0 0 12px var(--green), 0 0 24px rgba(0, 255, 65, 0.5);
    min-width: 50px;
    text-align: center;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#vault-digits-display.digits-error {
    color: var(--red);
    text-shadow: 0 0 12px var(--red);
}

#vault-digits-display.digits-success {
    color: var(--green);
    text-shadow: 0 0 20px var(--green), 0 0 40px rgba(0, 255, 65, 0.6);
}

#vault-cursor-blink {
    font-size: 28px;
    color: var(--green);
    opacity: 0.7;
    animation: vault-cur-blink 0.85s step-end infinite;
}

@keyframes vault-cur-blink {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 0;   }
}

#vault-status-msg {
    text-align: center;
    font-family: var(--font);
    font-size: 11px;
    letter-spacing: 0.12em;
    min-height: 17px;
    transition: color 0.3s ease;
}

.vault-status-error   { color: var(--red)  !important; text-shadow: 0 0 6px rgba(255,51,51,0.5); }
.vault-status-success { color: var(--green) !important; text-shadow: 0 0 6px rgba(0,255,65,0.5); }

/* —— Keypad —— */
#vault-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 18px 20px;
}

.vkey {
    padding: 16px 10px;
    background: #0e0900;
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 12px;
    color: #ffd98a;
    font-family: var(--font);
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s, box-shadow 0.1s, transform 0.07s;
    box-shadow: 0 5px 0 rgba(255, 184, 0, 0.2), inset 0 0 10px rgba(255, 184, 0, 0.03);
}

.vkey:hover {
    background: rgba(255, 184, 0, 0.1);
    border-color: var(--amber);
    box-shadow: 0 5px 0 rgba(255, 184, 0, 0.35), 0 0 14px rgba(255, 184, 0, 0.18);
}

.vkey:active,
.vkey.vkey-pressed {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(255, 184, 0, 0.2);
    background: rgba(255, 184, 0, 0.18);
}

.vkey-clear {
    color: var(--red);
    border-color: rgba(255, 51, 51, 0.3);
    font-size: 20px;
}

.vkey-clear:hover {
    background: rgba(255, 51, 51, 0.1);
    border-color: var(--red);
    box-shadow: 0 5px 0 rgba(255, 51, 51, 0.3), 0 0 14px rgba(255, 51, 51, 0.18);
}

.vkey-confirm {
    color: var(--green);
    border-color: rgba(0, 255, 65, 0.3);
    font-size: 15px;
    letter-spacing: 0.05em;
}

.vkey-confirm:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--green);
    box-shadow: 0 5px 0 rgba(0, 255, 65, 0.3), 0 0 14px rgba(0, 255, 65, 0.18);
}

/* —— Shake (mauvais code) —— */
@keyframes vault-shake {
    0%, 100% { transform: scale(1) translateX(0);       }
    10%       { transform: scale(1) translateX(-10px);   }
    20%       { transform: scale(1) translateX(10px);    }
    30%       { transform: scale(1) translateX(-8px);    }
    40%       { transform: scale(1) translateX(8px);     }
    50%       { transform: scale(1) translateX(-5px);    }
    60%       { transform: scale(1) translateX(5px);     }
    70%       { transform: scale(1) translateX(-3px);    }
    80%       { transform: scale(1) translateX(3px);     }
    90%       { transform: scale(1) translateX(-1px);    }
}

#vault-panel.vault-shake {
    animation: vault-shake 0.55s ease;
}

/* —— Unlock glow —— */
#vault-panel.vault-unlocked {
    border-color: var(--green);
    box-shadow:
        0 0 50px rgba(0, 255, 65, 0.55),
        0 0 100px rgba(0, 255, 65, 0.25),
        inset 0 0 30px rgba(0, 255, 65, 0.06);
}

/* —— Responsive —— */
@media (max-width: 520px) {
    #vault-panel { border-radius: 12px; }
    #vault-lock-rings { width: 88px; height: 88px; }
    .vring-1 { width: 84px;  height: 84px;  }
    .vring-2 { width: 60px;  height: 60px;  }
    .vring-3 { width: 38px;  height: 38px;  }
    .vkey    { padding: 13px 8px; font-size: 19px; }
    #vault-digits-display { font-size: 28px; }
    #vault-enigma-text { font-size: 12px; }
}

/* ========== MINOU AGENT — BULLE BD =========== */
#minou-agent {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

#minou-bubble {
    position: relative;
    background: rgba(8, 3, 0, 0.96);
    border: 2.5px solid var(--amber);
    border-radius: 20px;
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: 0 0 28px rgba(255, 184, 0, 0.35), inset 0 0 18px rgba(255, 184, 0, 0.08);
    font-family: var(--font);
    font-size: 15px;
    color: #ffe4a0;
    line-height: 1.6;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

#minou-bubble.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Queue de la bulle (triangle pointant vers Minou en bas à droite) */
#minou-bubble::after {
    content: '';
    position: absolute;
    bottom: -17px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 0;
    border-top: 17px solid var(--amber);
}

#minou-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 27px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 0;
    border-top: 12px solid rgba(8, 3, 0, 0.96);
    z-index: 1;
}

.minou-header {
    color: var(--amber);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.22em;
    margin-bottom: 10px;
    opacity: 0.85;
}

.minou-step {
    color: var(--amber);
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.5);
}

.minou-detail {
    color: #ffd98a;
    font-size: 14px;
    margin-bottom: 12px;
}

.minou-cmd-label {
    color: #888;
    font-size: 12px;
    font-style: italic;
    margin-bottom: 4px;
}

.minou-cmd {
    background: rgba(0, 255, 65, 0.07);
    border: 1px solid rgba(0, 255, 65, 0.28);
    border-radius: 7px;
    padding: 7px 11px;
    color: var(--green);
    font-size: 13px;
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
    word-break: break-all;
}

.minou-extra {
    color: var(--amber);
    font-size: 13px;
    margin-top: 8px;
    font-style: italic;
}

.minou-blague {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 184, 0, 0.22);
    color: #ffcc55;
    font-size: 13px;
    font-style: italic;
    opacity: 0.88;
}

#minou-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid var(--amber);
    object-fit: cover;
    object-position: 50% 18%;
    box-shadow: 0 0 28px rgba(255, 184, 0, 0.55), 0 0 56px rgba(255, 184, 0, 0.28);
    display: block;
    align-self: flex-end;
    animation: minou-pulse 3s ease-in-out infinite;
}

@keyframes minou-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 184, 0, 0.4), 0 0 32px rgba(255, 184, 0, 0.18); }
    50%       { box-shadow: 0 0 24px rgba(255, 184, 0, 0.65), 0 0 48px rgba(255, 184, 0, 0.3); }
}

@media (max-width: 600px) {
    #minou-agent {
        bottom: 58px;
        right: 8px;
        max-width: min(280px, calc(100vw - 20px));
    }

    #minou-bubble {
        font-size: 13px;
        padding: 14px 16px;
    }

    #minou-photo {
        width: 110px;
        height: 110px;
    }
}
