.archives-retour-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9998;
    padding: 12px 18px;
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.92);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.archives-retour-btn:hover {
    background: #00ff00;
    color: black;
}

.cahier-download-btn {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9998;
    padding: 12px 18px;
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.92);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.cahier-download-btn:hover {
    background: #00ff00;
    color: black;
}

.matrix-menu-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    padding: 12px 18px;
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.92);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.matrix-menu-toggle:hover {
    background: #00ff00;
    color: black;
}

.matrix-menu-panel {
    position: fixed;
    top: 68px;
    right: 18px;
    z-index: 9999;
    display: none;
    min-width: 220px;
    padding: 12px;
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 0 14px rgba(0, 255, 0, 0.18);
}

.matrix-menu-panel.is-open {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matrix-menu-action {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #00ff00;
    background: black;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
    transition: 0.3s;
}

.matrix-menu-action:hover {
    background: #00ff00;
    color: black;
}

.matrix-volume-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 2px solid #00ff00;
    background: black;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.matrix-volume-label {
    font-size: 0.95rem;
    font-weight: bold;
}

.matrix-volume-value {
    font-size: 0.88rem;
    color: #d7ffd7;
}

.matrix-volume-slider {
    width: 100%;
    accent-color: #00ff00;
    cursor: pointer;
}

.matrix-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.78);
}

.matrix-rules-modal.is-open {
    display: flex;
}

.matrix-rules-dialog {
    width: min(760px, 100%);
    max-height: min(82vh, 900px);
    overflow-y: auto;
    padding: 24px;
    border: 2px solid #00ff00;
    background: rgba(0, 0, 0, 0.96);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 18px rgba(0, 255, 0, 0.2);
}

.matrix-rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.matrix-rules-title {
    margin: 0;
    font-size: 1.35rem;
}

.matrix-rules-close {
    padding: 8px 12px;
    border: 2px solid #00ff00;
    background: black;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.matrix-rules-close:hover {
    background: #00ff00;
    color: black;
}

.matrix-rules-content {
    line-height: 1.7;
    color: #d7ffd7;
}

.matrix-rules-content p,
.matrix-rules-content h3 {
    margin-top: 0;
}

.matrix-progress-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matrix-progress-item {
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 0, 0.45);
    background: rgba(0, 255, 0, 0.05);
    color: #d7ffd7;
    text-align: left;
}

.matrix-progress-item.is-locked {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #8d8d8d;
    letter-spacing: 0.08em;
}

.matrix-progress-item strong {
    color: #00ff00;
}

.matrix-legal-link {
    position: fixed;
    left: 50%;
    bottom: 10px;
    z-index: 9997;
    transform: translateX(-50%);
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.matrix-legal-link:hover {
    opacity: 1;
}

.matrix-legal-logo {
    display: block;
    width: min(180px, 100%);
    height: auto;
    margin: 0 auto 20px;
    border-radius: 6px;
}

.matrix-legal-section {
    margin-top: 22px;
}

.matrix-legal-section h3 {
    margin: 0 0 12px;
    color: #00ff00;
}

.matrix-credits-note {
    margin: 0;
    padding: 14px 16px;
    border: 1px dashed rgba(0, 255, 0, 0.45);
    background: rgba(0, 255, 0, 0.05);
    color: #d7ffd7;
}

@media (max-width: 700px) {
    .archives-retour-btn {
        right: 12px;
        bottom: 12px;
        text-align: center;
    }

    .cahier-download-btn {
        left: 12px;
        bottom: 12px;
        text-align: center;
    }

    .matrix-menu-toggle {
        top: 12px;
        right: 12px;
    }

    .matrix-menu-panel {
        top: 62px;
        right: 12px;
        left: 12px;
        min-width: 0;
    }

    .matrix-rules-modal {
        padding: 12px;
    }

    .matrix-rules-dialog {
        padding: 18px;
    }

    .matrix-legal-link {
        bottom: 64px;
        width: calc(100% - 24px);
        text-align: center;
        white-space: normal;
    }
}
