/* Easter eggs du portail (clé mystère, modale, salle secrète, matrix, toasts, secousse).
   Extrait de l'ancien portal-style.css ; s'appuie sur les alias de variables définis dans portal.css. */
/* ==========================================================================
   EASTER EGG : LA CLÉ MYSTIQUE CACHÉE
   ========================================================================== */
.hidden-mystery-key {
    display: inline-block;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.35;
    filter: drop-shadow(0 0 2px gold);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: keyFloating 3s ease-in-out infinite;
    user-select: none;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.hidden-mystery-key:hover {
    opacity: 1;
    transform: scale(1.6) rotate(15deg);
    filter: drop-shadow(0 0 14px #ffd700);
}

@keyframes keyFloating {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(-8deg); }
}

/* ==========================================================================
   MODAL INTERACTIVE / EASTER EGG POPUP
   ========================================================================== */
.portal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.portal-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.portal-modal-box {
    background: #0b0f19;
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    max-width: 580px;
    width: 100%;
    padding: 2.5rem;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.35);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.portal-modal-overlay.active .portal-modal-box {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(236, 72, 153, 0.4);
    color: #fff;
}

.modal-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-box-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.modal-box-content {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.8rem;
}

.modal-secret-code {
    background: rgba(0, 240, 255, 0.08);
    border: 2px dashed var(--accent-cyan);
    border-radius: 12px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    margin: 1.2rem 0;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-secret-code:hover {
    background: rgba(0, 240, 255, 0.2);
    transform: scale(1.03);
}

/* BOUTON D'ACCÈS SALLE SECRÈTE */
.btn-secret-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 1.1rem 1.8rem;
    margin: 1.2rem 0;
    background: linear-gradient(135deg, #10b981, #059669, #0284c7);
    color: #03131c;
    border: none;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.4);
    animation: secretPulse 2s infinite alternate ease-in-out;
    transition: all 0.25s ease;
}

.btn-secret-launch:hover {
    transform: scale(1.03);
    filter: brightness(1.2);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.8);
}

@keyframes secretPulse {
    0% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    100% { box-shadow: 0 0 35px rgba(16, 185, 129, 0.85), 0 0 10px rgba(0, 240, 255, 0.5); }
}

/* TERMINAL INTERACTIF DE LA SALLE SECRÈTE #00 */
.secret-terminal {
    background: #030712;
    border: 1px solid #10b981;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: left;
    font-family: var(--font-mono);
    margin: 1rem 0;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.15);
}

.secret-timer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #10b981;
}

.secret-puzzle-step {
    margin-bottom: 1.2rem;
}

.secret-puzzle-question {
    font-size: 0.95rem;
    color: #f8fafc;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.secret-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin: 1rem 0;
}

.secret-keypad-btn {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.secret-keypad-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.secret-input-row {
    display: flex;
    gap: 0.6rem;
    margin: 1rem 0;
}

.secret-input-field {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: #10b981;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.secret-input-btn {
    padding: 0.8rem 1.4rem;
    background: #10b981;
    color: #030712;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.secret-input-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.04);
}

.secret-sequence-display {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 1rem 0;
}

.sequence-light {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.sequence-light.active {
    box-shadow: 0 0 15px currentColor;
    border-color: currentColor;
}

.secret-hint-btn {
    background: none;
    border: none;
    color: #fbbf24;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-mono);
    margin-top: 0.6rem;
    display: inline-block;
    transition: opacity 0.2s;
}

.secret-hint-btn:hover {
    opacity: 0.85;
}

.secret-hint-box {
    margin-top: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px dashed #fbbf24;
    border-radius: 8px;
    color: #fde68a;
    font-size: 0.82rem;
    display: none;
    line-height: 1.4;
}

/* ==========================================================================
   ENRICHISSEMENT ÉTAPE 2 : 6 SLOTS NEUTRES & CRISTAUX
   ========================================================================== */
.secret-slot-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: #64748b;
    transition: all 0.25s ease;
}

.secret-slot-circle.filled {
    border-style: solid;
    box-shadow: 0 0 16px currentColor;
    font-size: 1.2rem;
}

.secret-slot-circle.error {
    animation: slotShake 0.4s ease;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.2) !important;
}

@keyframes slotShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.secret-keypad-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 1rem 0;
}

/* ==========================================================================
   ENRICHISSEMENT ÉTAPE 3 : SLOTS MOTS (2, 6, 9 LETTRES) & TUILES
   ========================================================================== */
.secret-anagram-pool {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 10px;
    margin: 0.8rem 0;
}

.anagram-tile {
    width: 30px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.secret-word-slots-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin: 1.2rem 0;
}

.word-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.word-letters-row {
    display: flex;
    gap: 4px;
}

.letter-slot {
    width: 22px;
    height: 28px;
    border-bottom: 2px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.95rem;
    color: #f8fafc;
}

.word-tag-label {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: #94a3b8;
}

/* ==========================================================================
   MATRIX RAIN CANVAS OVERLAY (Konami Code Easter Egg)
   ========================================================================== */
#matrix-canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#matrix-canvas-overlay.active {
    opacity: 0.85;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.portal-toast {
    position: fixed;
    top: 5.5rem;
    right: 2rem;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 0.9rem 1.4rem;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    font-size: 0.9rem;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.portal-toast.show {
    transform: translateX(0);
}

.portal-toast.success { border-left-color: #10b981; }
.portal-toast.gold { border-left-color: #fbbf24; }

/* ==========================================================================
   SCREEN SHAKE ANIMATION (Logo Easter Egg)
   ========================================================================== */
@keyframes shakeOverdrive {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

body.screen-shaking {
    animation: shakeOverdrive 0.6s infinite;
}

