/* MIRROR404: Base & Fonts */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --red: #ff0000; --red-glow: rgba(255, 0, 0, 0.4); --red-dark: #450000;
    --weird: #b14bff; --line: #333; --panel: #0a0a0a;
    --font-gothic: "UnifrakturMaguntia", cursive; --font-sans: "Inter", system-ui, sans-serif;
}
html, body { height: 100%; }
body {
    background: #000; color: #ccc; font-family: var(--font-sans);
    font-size: 16px; line-height: 1.7; scroll-behavior: smooth;
    cursor: none; overflow-x: hidden;
}
a, button { cursor: none; }
h2 {
    font-family: var(--font-gothic); font-size: clamp(32px, 5vw, 40px);
    color: var(--red); margin-bottom: 1rem; text-shadow: 0 0 10px var(--red-glow);
}

/* MIRROR404: Overlays & Decorative Elements */
.vhs-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 150; opacity: 0.15; background: repeating-linear-gradient(0deg, rgba(255, 0, 0, 0.03) 0 1px, transparent 1px 2px), repeating-linear-gradient(90deg, rgba(0, 255, 255, 0.02) 0 1px, transparent 1px 2px), repeating-linear-gradient(180deg, rgba(0, 0, 255, 0.03) 0 1px, transparent 1px 2px); animation: vhs-jitter 0.15s infinite steps(1), vhs-drift 15s infinite linear; }
@keyframes vhs-drift { 0% { background-position: 0 0, 0 0, 0 0; } 100% { background-position: 0 100px, 100px 0, 50px 50px; } }
.vhs-glitch-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 151; mix-blend-mode: screen; }
.vhs-glitch-overlay::before,.vhs-glitch-overlay::after { content: ''; position: absolute; inset: 0; background: #000; animation: crt-scanline 8s infinite linear; opacity: 0.05; }
.vhs-glitch-overlay::after { animation-duration: 6s; }
@keyframes vhs-jitter { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1px); } }
@keyframes crt-scanline { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.cursor { position: fixed; top: 0; left: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); pointer-events: none; transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s; z-index: 200; }
.cursor-inner { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--red); transform: translate(-50%, -50%); }
.cursor.hover { width: 60px; height: 60px; background: var(--red-glow); border-color: var(--red); }

.frame-glow { position: fixed; inset: 18px; border: 1px solid var(--red-dark); box-shadow: 0 0 28px 4px var(--red-glow), inset 0 0 60px rgba(255, 0, 0, 0.05); pointer-events: none; z-index: 10; animation: frame-flicker 15s infinite alternate; }
.frame-deco-bones { position: fixed; inset: -20px; background: url('assets/bones-frame.png') center/contain no-repeat; pointer-events: none; z-index: 11; opacity: 0.5; }
.deco-skull { position: absolute; top: -30px; right: -25px; width: 100px; height: 100px; background: url('assets/skull.png') center/contain no-repeat; opacity: 0.6; z-index: 5; }
.deco-barb-wire { position: absolute; top: 50%; left: 0; right: 0; height: 50px; transform: translateY(-50%); background: url('assets/barbed-wire.png') center/contain repeat-x; opacity: 0.3; }

/* MIRROR404: Preloader, Intro, Age Gate */
.preloader { position: fixed; inset: 0; display: grid; place-content: center; z-index: 100; background: #000; transition: opacity 0.5s, visibility 0.5s; }
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro { position: fixed; inset: 0; background: #000; z-index: 90; display: grid; place-items: center; opacity: 0; transition: opacity 0.5s; }
.intro.visible { opacity: 1; }
.intro[hidden] { display: none; }
.intro-video { width: 100%; height: 100%; object-fit: cover; }
.intro-skip { position: absolute; right: 1rem; bottom: 1rem; z-index: 2; border: 1px solid var(--line); background: rgba(12, 12, 12, 0.8); color: #eee; padding: 0.5rem 0.75rem; border-radius: 8px; font-family: var(--font-sans); }
.intro-skip:hover { color: #000; background: var(--red); border-color: var(--red); }

.age-gate {
    border: none;
    background: transparent;
    padding: 0;
    z-index: 80;
    max-width: 100vw;
    position: fixed; /* More reliable centering method */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.age-gate::backdrop { background: rgba(0, 0, 0, 0.95); }
.age-gate.fade-out { animation: fadeOut 0.4s ease-out forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.95); } }
.gate-frame { position: relative; width: min(600px, 90vw); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 0 20px var(--red-glow), inset 0 0 80px rgba(0,0,0,0.8); padding: 1.5rem; }
.gate-title { font-family: var(--font-gothic); color: var(--red); letter-spacing: 0.2em; text-align: center; margin: 0 0 0.25rem; }
.gate-sub { text-align: center; color: #bdbdbd; font-size: 12px; margin: 0 0 1rem; }
.gate-card { border-top: 1px solid var(--line); padding-top: 1rem; }
.gate-text { color: #dcdcdc; margin-bottom: 1rem; }
.gate-check { display: flex; align-items: center; gap: 8px; margin: 1rem 0; }
.gate-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 10px 14px; border: 1px solid var(--line); background: #111; color: #eee; border-radius: 8px; font-family: var(--font-sans); transition: 0.2s; }
.btn-small { padding: 6px 10px; font-size: 0.9em; }
.btn-danger { border-color: var(--red); color: var(--red); text-shadow: 0 0 5px var(--red-glow); }
.btn-danger[disabled] { opacity: 0.5; pointer-events: none; }
.btn-danger:not([disabled]):hover { background: var(--red); color: #000; }
.btn-weird { border-color: var(--weird); color: var(--weird); }
.btn-weird:hover { background: var(--weird); color: #000; }
.btn-ghost:hover { border-color: #777; color: #fff; }

/* MIRROR404: Layout & Hero */
.site-wrapper { position: relative; max-width: 960px; margin: 3rem auto; border: 1px solid var(--line); box-shadow: 0 0 50px rgba(0,0,0,0.5); background: #060606; }
.hero { position: relative; min-height: 100svh; display: grid; place-content: center; text-align: center; gap: 1.5rem; padding: 4rem 1rem; overflow: hidden; }
.brand.tagline { display: block; color: #ccc; opacity: 0.8; margin-top: 0.5rem; }
.logo,.glitch { font-family: var(--font-gothic); font-size: clamp(48px, 11vw, 120px); color: var(--red); letter-spacing: 0.06em; position: relative; text-transform: uppercase; line-height: 0.9; filter: drop-shadow(0 0 12px #000); text-shadow: 0 0 10px var(--red-glow); }
.glitch::before,.glitch::after { content: attr(data-text); position: absolute; inset: 0; mix-blend-mode: screen; animation: text-glitch 0.1s infinite alternate-reverse; }
.glitch::before { color: #0ff; transform: translateX(2px); }
.glitch::after { color: #ff0; transform: translateX(-2px); }
@keyframes text-glitch { 0% { clip-path: inset(23% 0 45% 0); } 100% { clip-path: inset(55% 0 23% 0); } }
.logo-swap { display: inline-grid; place-items: center; user-select: none; }
.logo-swap.t { grid-area: 1 / 1; transition: opacity 0.2s, transform 0.2s; }
.logo-swap.t-alt { opacity: 0; }
.logo-swap.is-alt.t-normal { opacity: 0; }
.logo-swap.is-alt.t-alt { opacity: 1; }
.mirror-4 { display: inline-block; transform: scaleX(-1); }
.enter-btn { padding: 12px 18px; border: 1px solid var(--red); color: var(--red); border-radius: 10px; font-family: var(--font-gothic); text-decoration: none; }
.enter-btn:hover { background: var(--red); color: #000; }

/* MIRROR404: Navigation & Content Sections */
.nav { padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.burger { display: none; border: 1px solid var(--line); background: #0c0c0c; color: #e6e6e6; padding: 0.45rem 0.6rem; border-radius: 8px; font-size: 1.2rem; }
.nav-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.navlink { padding: 6px 10px; border: 1px solid transparent; font-family: var(--font-gothic); color: #ccc; border-radius: 8px; text-decoration: none; }
.navlink:hover { border-color: var(--red); color: var(--red); }
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; white-space: nowrap; padding: 0.5rem 0; }
.marquee p { color: var(--red); animation: marquee-scroll 20s linear infinite; text-transform: uppercase; display: inline-block; padding-left: 100%;}
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.main-content { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 6rem; position: relative; z-index: 2; }
.section { position: relative; padding: 1.5rem; border: 1px solid var(--line); background: #000; margin-bottom: 2rem; box-shadow: inset 0 0 15px rgba(0,0,0,0.5); }
.rules { list-style: none; padding-left: 1rem; border-left: 3px solid var(--red); }
.rules li { margin: 0.5rem 0; }
.rules.disclaimer { color: #888; border-color: #444; font-size: 0.9em; }
.sigil { width: 150px; height: 150px; margin: 1rem auto 0; border: 2px solid var(--red); position: relative; border-radius: 50%; animation: sigil-pulse 10s infinite alternate; }
.sigil::before,.sigil::after { content: ""; position: absolute; inset: 12%; border: 1px solid var(--red); transform: rotate(45deg); border-radius: 50%; }
.sigil::after { transform: rotate(-45deg); }
@keyframes sigil-pulse { from { box-shadow: 0 0 10px var(--red-glow); } to { box-shadow: 0 0 30px var(--red-glow); } }
.text-redacted { background-color: #ccc; color: #ccc; user-select: none; transition: 0.3s; }
.text-redacted:hover { background-color: transparent; color: var(--red); }
.test-form label { display: block; margin: 0.5rem 0; }
.test-actions { display: flex; gap: 8px; margin-top: 1rem; flex-wrap: wrap; }
.test-result { margin-top: 1rem; min-height: 1.4rem; color: #eee; font-weight: 600; }
.footer { border-top: 1px solid var(--line); color: #7a7a7a; text-align: center; padding: 1.5rem 1rem; font-size: 0.9em; }

/* MIRROR404: WATCH CAM, DOCS, DIARY, COUNTER, EASTER EGGS styles */
.watch-cam { position: relative; background: #000; border: 1px solid var(--line); margin-bottom: 1.5rem; }
.video-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 3px solid var(--red); border-top-color: transparent; border-radius: 50%; animation: video-spin 1s linear infinite; }
@keyframes video-spin { to { transform: rotate(360deg); } }
.watch-video { width: 100%; height: auto; display: block; }
.watch-overlay { position: absolute; top: 0; left: 0; right: 0; padding: 0.5rem; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent); }
.watch-label { font-family: var(--font-gothic); color: var(--red); }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.doc-link { display: block; text-decoration: none; border: 1px solid var(--line); background: var(--panel); padding: 1rem; position: relative; overflow: hidden; transition: transform 0.3s, border-color 0.3s; }
.doc-link::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.1), transparent); transition: left 0.6s; }
.doc-link:hover::before { left: 100%; }
.doc-link:hover { transform: translateY(-5px) scale(1.02); border-color: var(--red); }
.doc-icon { font-family: var(--font-gothic); font-size: 1.5rem; color: var(--red); margin-bottom: 0.5rem; }
.doc-title { font-weight: 600; color: #eee; }
.doc-desc { font-size: 0.9em; color: #888; }
.diary-list { display: flex; flex-direction: column; gap: 1.5rem; }
.diary-loading { color: #888; }
.diary-item { border-left: 2px solid var(--line); padding-left: 1rem; transition: border-color 0.3s; }
.diary-item:hover { border-color: var(--red); }
.diary-date { font-size: 0.9em; color: #888; }
.diary-title { font-family: var(--font-gothic); font-size: 1.2rem; color: #eee; margin: 0.25rem 0; }
.admit-counter { margin-top: 1.5rem; font-size: 0.9em; color: #888; text-align: center; }
.admit-counter span { color: #eee; font-weight: 600; }
.easter-section { border-bottom: none; }
.easter-form { text-align: center; }
.easter-label { display: block; margin-bottom: 0.5rem; color: #888; }
.easter-controls { display: flex; justify-content: center; gap: 8px; }
.easter-input { background: #111; border: 1px solid var(--line); color: #eee; padding: 10px; width: 200px; text-align: center; }
.easter-input.error { animation: shake 0.5s; }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.easter-result { margin-top: 1rem; min-height: 1.4rem; color: #888; transition: color 0.3s; }
.easter-result.success { color: var(--red); text-shadow: 0 0 5px var(--red-glow); }
.easter-result.error { color: #ff4d4d; }
.room-secret { display: none; }
.room-secret.open { display: block; animation: fadeIn 0.5s; }
.secret-audio { margin-top: 1rem; width: 100%; }
.soul-sell-effect { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, rgba(177, 75, 255, 0.3) 0%, transparent 70%); pointer-events: none; z-index: 300; animation: soul-sell 3s forwards; }
@keyframes soul-sell { 0% { opacity: 0; transform: scale(0.5); } 50% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* MIRROR404: Mobile */
@media (max-width: 860px) {
    body, a, button { cursor: auto; }
   .cursor, [data-parallax-container],.magnetic,.frame-deco-bones,.deco-skull,.deco-barb-wire { display: none!important; }
   .site-wrapper { margin: 0; border: none; }
   .frame-glow { inset: 10px; position: absolute; }
   .hero { padding-top: 5rem; }
   .burger { display: inline-block; }
   .nav { position: relative; }
   .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(0,0,0,0.95); flex-direction: column; gap: 0.5rem; padding: 1rem; border-bottom: 1px solid var(--line); z-index: 50; }
   .nav-links.open { display: flex; }
   .main-content { padding: 1.5rem 1rem 4rem; }
}
@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; }
   .vhs-overlay,.vhs-glitch-overlay { display: none!important; }
}

/* FIX: Restore cursor on age gate modal */
.age-gate,
.age-gate button,
.age-gate label,
.age-gate input {
    cursor: auto;
}
