/* ============================================================
   EPIC REVEAL — Reusable cinematic overlay for epic moments
   Used by: bond decoder, future discoveries, achievements, etc.
   ============================================================ */

/* Lock body scroll when reveal is open */
body.er-active { overflow: hidden !important; }

/* Full-screen overlay */
.er-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    cursor: default;
    overflow: hidden;
}
.er-overlay.visible { opacity: 1; }

/* Stars behind everything */
.er-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 35% 55%, rgba(168,85,247,0.3) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 75% 35%, rgba(6,182,212,0.2) 0%, transparent 100%);
    animation: er-stars-drift 60s linear infinite;
    opacity: 0;
    transition: opacity 2s ease;
}
.er-stars.visible { opacity: 1; }

@keyframes er-stars-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-15px); }
}

/* Main content area */
.er-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 0;
}

/* Close button */
.er-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100001;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.er-close:hover {
    color: white;
    border-color: rgba(255,255,255,0.4);
}

/* ARIA orb */
.er-orb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, #c084fc 0%, #a855f7 40%, #7c3aed 70%, #5b21b6 100%);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow:
        0 0 30px rgba(168,85,247,0.7),
        0 0 60px rgba(168,85,247,0.4),
        0 0 100px rgba(168,85,247,0.2);
    animation: er-orb-breathe 3s ease-in-out infinite;
    margin-bottom: 24px;
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}
.er-orb::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.25) 0%, transparent 50%);
    border-radius: 50%;
}
.er-orb.visible {
    opacity: 1;
    transform: scale(1);
}
.er-orb.glitching {
    animation: er-glitch 0.15s steps(2) 3;
}

@keyframes er-orb-breathe {
    0%, 100% { box-shadow: 0 0 30px rgba(168,85,247,0.7), 0 0 60px rgba(168,85,247,0.4); }
    50% { box-shadow: 0 0 50px rgba(168,85,247,0.9), 0 0 90px rgba(168,85,247,0.5); }
}

@keyframes er-glitch {
    0% { transform: translate(-3px, 1px) scale(1.02); filter: hue-rotate(30deg); }
    50% { transform: translate(3px, -2px) scale(0.98); filter: hue-rotate(-30deg); }
    100% { transform: translate(-1px, 2px) scale(1.01); filter: hue-rotate(15deg); }
}

/* Typed text lines */
.er-text-area {
    margin-bottom: 20px;
    min-height: 40px;
}
.er-line {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-bottom: 4px;
}
.er-line.visible {
    opacity: 1;
    transform: translateY(0);
}
.er-line.emphasis {
    color: #a855f7;
    font-weight: 600;
}
.er-line.static-crackle {
    color: rgba(255,255,255,0.3);
    font-style: italic;
    font-size: 13px;
}
.er-line.cyan {
    color: #06b6d4;
    font-weight: 600;
}

/* Artifact image reveal */
.er-image {
    max-width: 240px;
    width: 100%;
    border-radius: 12px;
    border: 3px solid rgba(6, 182, 212, 0.5);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.3);
    margin: 16px 0;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.er-image.visible {
    opacity: 1;
    transform: scale(1);
}

/* Info section (names, landmark, etc) */
.er-info {
    padding: 16px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 10px;
    margin: 12px 0;
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.er-info.visible {
    opacity: 1;
    transform: translateY(0);
}

.er-info-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.er-info-names {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.er-info-names .name { color: var(--color-sepolia, #f59e0b); }
.er-info-names .plus { color: #06b6d4; margin: 0 8px; }

.er-info-detail {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

/* Revelation text box */
.er-revelation {
    padding: 16px;
    background: rgba(138, 112, 219, 0.08);
    border: 1px solid rgba(138, 112, 219, 0.25);
    border-radius: 10px;
    margin: 12px 0;
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.er-revelation.visible {
    opacity: 1;
    transform: translateY(0);
}
.er-revelation-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a855f7;
    margin-bottom: 8px;
}
.er-revelation-text {
    font-style: italic;
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
    font-size: 13px;
    white-space: pre-line;
}

/* Action buttons */
.er-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.er-actions.visible { opacity: 1; }

.er-btn {
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
    font-weight: 500;
}
.er-btn-primary {
    color: #06b6d4;
    background: rgba(6,182,212,0.1);
    border-color: rgba(6,182,212,0.3);
}
.er-btn-primary:hover {
    background: rgba(6,182,212,0.2);
    border-color: rgba(6,182,212,0.5);
}
.er-btn-secondary {
    color: #a855f7;
    background: rgba(168,85,247,0.1);
    border-color: rgba(168,85,247,0.3);
}
.er-btn-secondary:hover {
    background: rgba(168,85,247,0.2);
    border-color: rgba(168,85,247,0.5);
}

/* Permanent record link */
.er-record {
    padding: 12px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin: 12px 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.er-record.visible { opacity: 1; }
.er-record-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}
.er-record a {
    color: #06b6d4;
    word-break: break-all;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
}
.er-record-note {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    margin-top: 6px;
}

/* Sound hint */
.er-sound-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}
.er-sound-hint.visible { opacity: 1; }
