:root {
    --bg: #050505;
    --glow: #bc13fe;
    --text-dim: #999;
    --text-bright: #fff;
    --accent-dim: #1a1a1a;
    --danger: #ff0055;
}

/* --- Base Reset --- */
body, html {
    margin: 0; padding: 0;
    width: 100%;
    min-height: 100dvh; /* dynamic viewport height fix for mobile */
    background-color: var(--bg);
    color: var(--text-dim);
    font-family: 'Courier New', Courier, monospace;
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    overflow-x: hidden;
    touch-action: manipulation;
}

/* --- Header & Navigation --- */
#main-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--accent-dim);
    box-sizing: border-box;
}

.logo-wrapper { display: flex; align-items: center; text-decoration: none; gap: 15px; }
.main-logo { height: 35px; width: auto; filter: drop-shadow(0 0 5px var(--glow)); }
.logo-text { font-size: 1.2rem; font-weight: bold; color: var(--text-bright); letter-spacing: 5px; text-shadow: 0 0 10px var(--glow); }

.nav-link { color: var(--text-dim); text-decoration: none; font-size: 0.8rem; letter-spacing: 2px; transition: 0.3s; }
.nav-link:hover { color: var(--glow); text-shadow: 0 0 8px var(--glow); }

/* --- Intro Overlay --- */
#intro-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100dvh;
    background: var(--bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    text-align: center;
    padding: 30px;
    box-sizing: border-box;
    transition: opacity 1.5s ease;
}

.terminal-text {
    color: var(--glow); font-size: 0.95rem; margin-bottom: 15px;
    width: 0; overflow: hidden; white-space: nowrap;
    border-right: 2px solid var(--glow);
    animation: typing 2s steps(40, end) forwards, blink 0.8s infinite;
}

/* --- The Gateway (Input Section) --- */
#gateway {
    opacity: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    width: 90%; max-width: 650px;
    padding: 100px 20px 40px;
    box-sizing: border-box;
    transition: opacity 1s ease;
}

h1 { font-size: 1.5rem; letter-spacing: 12px; color: var(--text-bright); text-shadow: 0 0 15px var(--glow); margin-bottom: 40px; }

textarea {
    width: 100%; background: transparent; border: none;
    border-bottom: 2px solid var(--accent-dim);
    color: var(--text-bright); font-size: 1.5rem;
    text-align: center; padding: 20px; outline: none;
    resize: none; transition: 0.5s;
    border-radius: 0; /* iOS fix */
}
textarea:focus { border-color: var(--glow); }

/* --- Meta Info Styling (Word Counter) --- */
#meta-info {
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-top: 15px;
    /* Changed from dark grey to a visible dim grey */
    color: #666; 
    text-transform: uppercase;
    transition: color 0.3s ease;
}

#word-count {
    font-weight: bold;
    /* Default color when under the limit */
    color: var(--glow); 
}

/* Optional: Add a slight glow when they hit the requirement */
#meta-info.requirement-met {
    color: var(--text-bright);
    text-shadow: 0 0 5px var(--success);
}
/* --- The Warp Phase (Loading) --- */
#warp-phase { display: none; text-align: center; width: 100%; }
.warp-loader {
    width: 45px; height: 45px;
    border: 2px solid rgba(188, 19, 254, 0.1);
    border-top: 2px solid var(--glow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
#warp-bar { width: 0%; height: 100%; background: var(--glow); box-shadow: 0 0 10px var(--glow); transition: width 8s linear; }

/* --- The Whisper Gallery (Display Section) --- */
#whisper-phase {
    display: none;
    text-align: center;
    width: 90%; max-width: 800px;
    padding-top: 100px;
}

.echo-text {
    color: var(--text-bright); font-size: 1.4rem; font-style: italic; line-height: 1.8;
    background: rgba(20, 20, 20, 0.4);
    padding: 40px; border-radius: 12px; border: 1px solid var(--accent-dim);
    text-align: left; position: relative;
    max-height: 55dvh; overflow-y: auto;
    transition: opacity 0.5s, filter 0.5s;
}

/* --- Buttons --- */
.btn-release {
    background: transparent; border: 1px solid var(--glow);
    color: var(--glow); padding: 15px 45px;
    cursor: pointer; text-transform: uppercase;
    letter-spacing: 4px; font-weight: bold; font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 40px;
}
.btn-release:hover { background: var(--glow); color: #000; box-shadow: 0 0 30px var(--glow); transform: translateY(-2px); }

/* --- Modals --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 2000;
    display: none; justify-content: center; align-items: center;
}
.modal-content { background: #0a0a0a; border: 1px solid var(--glow); padding: 40px; text-align: center; width: 80%; max-width: 400px; }
.modal-icon { font-size: 2rem; color: var(--glow); margin-bottom: 15px; }

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Laptops & Tablets */
@media screen and (max-width: 1024px) {
    #main-header { padding: 15px 25px; }
    textarea { font-size: 1.3rem; }
    .echo-text { font-size: 1.2rem; padding: 30px; }
}

/* Mobile Devices (iPhone/Android) */
@media screen and (max-width: 480px) {
    #main-header { padding: 10px 15px; }
    .logo-text { display: none; } /* Hide text on mobile as requested */
    .logo-wrapper { gap: 0; }
    
    #gateway { width: 95%; padding-top: 80px; justify-content: flex-start; }
    h1 { font-size: 1.2rem; letter-spacing: 8px; }
    textarea { font-size: 1.1rem; min-height: 150px; padding: 10px; }
    
    .terminal-text { font-size: 0.8rem; white-space: normal; width: 100% !important; border-right: none; animation: fadeIn 1s forwards; }
    
    .echo-text { font-size: 1rem; padding: 20px; line-height: 1.6; max-height: 45dvh; }
    
    .btn-release { width: 100%; padding: 18px 0; }
    
    .share-row { flex-direction: column; width: 100%; }
    .share-row button { width: 100%; margin-bottom: 5px; }
}

/* --- Animations --- */
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink { from { border-color: transparent } to { border-color: var(--glow) } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Utility */
.hp-field { position: absolute; left: -9999px; } /* Honeypot for bots */
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }

.dissolving { animation: dissolve 3s forwards ease-in-out !important; pointer-events: none; }
@keyframes dissolve { 0% { filter: blur(0px); opacity: 1; transform: scale(1); } 100% { filter: blur(25px); opacity: 0; transform: scale(1.1); } }

/* --- Social Sharing Buttons --- */
.btn-social {
    background: rgba(188, 19, 254, 0.05);
    border: 1px solid var(--accent-dim);
    color: var(--text-dim);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.btn-social:hover {
    color: var(--glow);
    border-color: var(--glow);
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.3);
    transform: translateY(-3px) scale(1.1);
    background: rgba(188, 19, 254, 0.1);
}

.btn-social svg {
    transition: transform 0.3s ease;
}

.btn-social:hover svg {
    transform: rotate(5deg);
}

/* --- Custom Scrollbar for Echo Gallery --- */

/* For Firefox */
.echo-text {
    scrollbar-width: thin;
    scrollbar-color: var(--glow) #0a0a0a;
}

/* For Chrome, Edge, and Safari */
.echo-text::-webkit-scrollbar {
    width: 6px; /* Ultra-thin width */
}

/* The background of the scrollbar (track) */
.echo-text::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 10px;
}

/* The part you grab (thumb) */
.echo-text::-webkit-scrollbar-thumb {
    background: #222; /* Dark base color */
    border: 1px solid var(--glow); /* Glowing outline */
    border-radius: 10px;
    box-shadow: 0 0 5px var(--glow); /* Subtle glow effect */
}

/* Change thumb color when hovering */
.echo-text::-webkit-scrollbar-thumb:hover {
    background: var(--glow);
    box-shadow: 0 0 10px var(--glow);
}