/* ============================================
   ENARGEIA — The Clearing (inner-index.html)
   ============================================ */

/* --- No scroll --- */
html:has(.clearing-page) {
    overflow: hidden;
}

.clearing-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #000000;
    cursor: none;
    animation: clearing-fadein 1.5s ease-out;
}

@keyframes clearing-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Three.js Canvas --- */
#clearing-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    cursor: none;
}

/* Show pointer only when hovering a door (set by JS) */
#clearing-canvas.door-hover {
    cursor: pointer;
}

/* --- HTML Overlay --- */
.clearing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* --- Title --- */
.clearing-title {
    margin-top: 4vh;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.clearing-title h1 {
    font-family: 'Maximage-ZhiLong';
    font-size: clamp(2rem, 6vw, 4rem);
    letter-spacing: 0.3em;
    filter: drop-shadow(0 0 25px rgba(196, 181, 253, 0.25));
    animation: clearing-title-breathe 6s ease-in-out infinite;
}

@keyframes clearing-title-breathe {
    0%, 100% {
        filter: drop-shadow(0 0 25px rgba(196, 181, 253, 0.25));
        opacity: 0.85;
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(196, 181, 253, 0.4));
        opacity: 1;
    }
}

.clearing-subtitle {
    font-family: 'imweird';
    font-size: clamp(1rem, 1.5vw, 0.85rem);
    color: #8a8098;
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
    opacity: 0.5;
}

/* --- Door Label --- */
.door-label {
    position: fixed;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(5px);
    text-align: center;
}

.door-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.door-label-text {
    font-family: 'zaibtsu';
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    letter-spacing: 0.2em;
    color: #f0e6ff;
    text-shadow:
        0 0 10px rgba(196, 181, 253, 0.5),
        0 0 20px rgba(196, 181, 253, 0.2);
    white-space: nowrap;
    padding: 0.4em 1em;
    background: rgba(5, 2, 8, 0.7);
    border: 1px solid rgba(196, 181, 253, 0.2);
    border-radius: 2px;
    backdrop-filter: blur(4px);
}

/* --- Whisper --- */
.clearing-whisper {
    position: fixed;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    font-family: 'imweird';
    font-size: 0.7rem;
    color: #8a8098;
    letter-spacing: 0.15em;
    opacity: 0;
    animation: whisper-in 2s ease-out 1.5s forwards;
    text-align: center;
    white-space: nowrap;
}

@keyframes whisper-in {
    to { opacity: 0.35; }
}

/* --- Transition Overlay --- */
.clearing-transition {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    background: #000000;
}

.clearing-transition.active {
    pointer-events: all;
    animation: door-passage 1.2s ease-in forwards;
}

@keyframes door-passage {
    0% { opacity: 0; }
    40% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 500px) {
    .clearing-title { margin-top: 2vh; }
}

@font-face {
  font-family: 'Maximage-ZhiLong';
  src: url(enargeia.neocities.org/assets/fonts/Maximage-ZhiLong.woff2);
}

/* ============================================
   YUME NIKKI–STYLE MODAL
   ============================================ */

.yn-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    /* block clicks on everything behind */
    cursor: default;
    animation: yn-overlay-in 0.6s ease-out;
}

@keyframes yn-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.yn-modal-overlay.dismissed {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.yn-modal {
    /* RPG Maker 2003 windowskin vibe:
       dark blue-purple, semi-transparent,
       pixel-art double border */
    background: rgba(10, 5, 28, 0.92);
    border: 3px solid #5a4a8a;
    outline: 2px solid #2a1f4e;
    outline-offset: 2px;
    box-shadow:
        inset 0 0 0 1px rgba(196, 181, 253, 0.12),
        0 0 40px rgba(100, 60, 180, 0.25);
    padding: 2em 3em 1.5em;
    min-width: 260px;
    max-width: 90vw;
    text-align: center;
    /* Pixel-crisp feel */
    image-rendering: pixelated;
    animation: yn-box-in 0.5s ease-out 0.3s both;
}

@keyframes yn-box-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.yn-modal-text {
    font-family: 'zaibtsu', 'MedievalSharp', monospace;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: #e0d6f5;
    letter-spacing: 0.18em;
    margin: 0 0 1.4em;
    text-shadow:
        0 0 6px rgba(196, 181, 253, 0.35),
        1px 1px 0 #1a0f2e;
    /* RPG Maker–style typewriter spacing */
    line-height: 1.6;
}

.yn-modal-btn {
    font-family: 'Cavalhatriz', 'MedievalSharp', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    letter-spacing: 0.2em;
    color: #e0d6f5;
    background: rgba(42, 31, 78, 0.7);
    border: 2px solid #5a4a8a;
    padding: 0.45em 2.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(196, 181, 253, 0.3);
    position: relative;
}

/* Highlight caret — mimics the RPG Maker selector arrow */
.yn-modal-btn::before {
    content: '▶';
    position: absolute;
    left: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: #c4b5fd;
    animation: yn-caret-blink 0.8s steps(2, start) infinite;
}

@keyframes yn-caret-blink {
    50% { opacity: 0; }
}

.yn-modal-btn:hover,
.yn-modal-btn:focus-visible {
    background: rgba(90, 74, 138, 0.5);
    border-color: #c4b5fd;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(196, 181, 253, 0.3);
    outline: none;
}

.yn-modal-btn:active {
    transform: scale(0.96);
}

