/* ==========================================================================
   AKASHIC RECORDS: STARRY LIBRARY GAME STYLESHEET
   ========================================================================== */

:root {
    --bg-space: #050714;
    --card-bg: rgba(12, 15, 36, 0.65);
    --border-glow: rgba(0, 242, 254, 0.15);
    
    /* Anime Cyber Gradients */
    --neon-blue: #00f2fe;
    --neon-purple: #7c3aed;
    --neon-pink: #ff007f;
    --neon-gold: #ffd700;
    
    --text-light: #f3f4f6;
    --text-dim: #9ca3af;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
}

body {
    background-color: var(--bg-space);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   AMBIENT COSMIC BACKGROUND
   ========================================================================== */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background: radial-gradient(circle at center, #0f1129 0%, #040510 100%);
    overflow: hidden;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.18;
    mix-blend-mode: screen;
    animation: driftNebula 35s infinite alternate ease-in-out;
}

.nebula-pink {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 0, 127, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
    top: -15vw;
    right: -10vw;
    animation-delay: -5s;
}

.nebula-blue {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.65) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -10vw;
    left: -10vw;
    animation-duration: 28s;
}

@keyframes driftNebula {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(5%, 8%) scale(1.1) rotate(90deg); }
    100% { transform: translate(-3%, -5%) scale(0.9) rotate(180deg); }
}

.starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Stars rendered dynamically via JS */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    animation: twinkle var(--twinkle-dur) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Floating Back Button */
.back-btn {
    position: fixed;
    top: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: scale(1.1);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   GAME TERMINAL FRAME
   ========================================================================== */
.game-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 95%;
    margin: 40px auto 20px auto;
    background: rgba(8, 10, 26, 0.55);
    border: 1px solid var(--border-glow);
    border-radius: 28px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

/* Top Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(3, 4, 15, 0.4);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
    animation: alertPulse 1.8s infinite ease-in-out;
}

@keyframes alertPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.logo-text {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--text-light);
    font-family: 'Share Tech Mono', monospace;
}

.btn-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-control:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-control svg {
    width: 18px;
    height: 18px;
}

.hidden {
    display: none !important;
}

/* Screen Transitions */
.screen {
    display: none;
    flex: 1;
    padding: 30px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeInScreen 0.5s ease forwards;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   SCREEN 1: WELCOME SCREEN
   ========================================================================== */
#screen-intro {
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

.intro-glass-panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 680px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    backdrop-filter: blur(15px);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neon-blue);
    letter-spacing: 0.1em;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff 40%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.main-title span {
    color: var(--neon-purple);
    -webkit-text-fill-color: initial;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-description {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 35px;
}

/* Glowing Button */
.glow-button {
    position: relative;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    border: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
    transition: all 0.3s ease;
}

.glow-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: all 0.6s ease;
}

.glow-button:hover::before {
    left: 100%;
}

.glow-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.6), 0 0 10px rgba(124, 58, 237, 0.4);
}

/* ==========================================================================
   SCREEN 2: NARRATIVE & EXPLORATION BOARD
   ========================================================================== */
.adventure-layout {
    display: grid;
    grid-template-columns: 4.5fr 7.5fr;
    gap: 30px;
    height: 100%;
}

/* Left Column: Visual Novel Stage */
.stage-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Elysia Character Display */
.character-viewport {
    flex: 1;
    background: rgba(3, 5, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.hologram-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
    background-size: 15px 15px;
    pointer-events: none;
}

/* Character Breath & Hover Animation */
.elysia-avatar {
    width: 90%;
    height: 95%;
    max-height: 380px;
    transform-origin: bottom center;
    animation: characterBreath 4.5s infinite ease-in-out;
}

@keyframes characterBreath {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.02); }
}

/* Eye and Mouth Expression Toggles */
.eye-state, .mouth-state {
    display: none;
}
.eye-state.active, .mouth-state.active {
    display: block;
}

.elysia-blush {
    transition: opacity 0.5s;
}

.avatar-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 600;
    color: var(--neon-blue);
    border: 1px solid rgba(0, 242, 254, 0.4);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    letter-spacing: 0.05em;
}

/* VN Dialogue Box */
.narrative-box {
    background: rgba(6, 7, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.narrative-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 30px;
    background: var(--neon-blue);
    border-radius: 3px 0 0 3px;
}

.narrative-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--neon-blue);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-label {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(0, 242, 254, 0.1);
    color: var(--neon-blue);
    border-radius: 4px;
    font-weight: 500;
}

.narrative-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
    min-height: 60px;
    margin-bottom: 15px;
}

.narrative-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.choice-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.4);
    padding-left: 18px;
}

.choice-btn::after {
    content: '✦';
    font-size: 0.75rem;
    color: var(--neon-purple);
    opacity: 0;
    transition: opacity 0.25s;
}

.choice-btn:hover::after {
    opacity: 1;
}

/* Right Column: Exploration / Sector View */
.stage-right {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 450px;
}

.card-glass {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* Sectors Grid View */
.sectors-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.sector-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.sector-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.3s;
}

.sector-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.sector-card[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}
.sector-card[disabled]:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Icons */
.sector-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sector-icon svg {
    width: 24px;
    height: 24px;
}

.sec-blue {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--neon-blue);
}
.sec-pink {
    background: rgba(255, 0, 127, 0.08);
    border: 1px solid rgba(255, 0, 127, 0.2);
    color: var(--neon-pink);
}
.sec-gold {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--neon-gold);
}

.sector-card:hover .sec-blue { box-shadow: 0 0 10px rgba(0, 242, 254, 0.3); }
.sector-card:hover .sec-pink { box-shadow: 0 0 10px rgba(255, 0, 127, 0.3); }
.sector-card:hover .sec-gold { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }

.sector-card:hover::before {
    background: currentColor;
}

.sector-meta {
    flex: 1;
}

.sector-meta h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: #fff;
}

.sector-meta p {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.sector-status {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sector-status.restored {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.sector-status.locked {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

/* Main progress bar */
.progress-container-main {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-lbl {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-percentage {
    text-align: right;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-blue);
    margin-top: 4px;
}

/* ==========================================================================
   PUZZLES GENERAL STYLING
   ========================================================================== */
.puzzle-card {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    flex-direction: column;
}

.puzzle-card.active {
    display: flex;
    animation: slideUpPanel 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPanel {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.puzzle-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-back-map {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back-map:hover {
    background: rgba(255, 255, 255, 0.12);
}

.puzzle-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.puzzle-tip {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 15px;
}

.puzzle-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Reusable buttons styles */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-light);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: var(--neon-purple);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
    background: #6d28d9;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* PUZZLE 1: CONSTELLATION */
.star-canvas-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.constellation-view {
    width: 100%;
    height: 100%;
    max-height: 280px;
}

.const-node {
    cursor: pointer;
    transition: transform 0.2s;
}

.const-node:hover {
    transform: scale(1.3);
}

.const-node circle {
    fill: #27272a;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1.5;
    transition: all 0.3s;
}

.const-node:hover circle {
    stroke: var(--neon-blue);
    fill: rgba(0, 242, 254, 0.2);
}

.const-node.active circle {
    fill: var(--neon-blue);
    stroke: #fff;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px var(--neon-blue));
}

.const-node text {
    font-size: 10px;
    fill: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    pointer-events: none;
    transition: fill 0.3s;
}

.const-node.active text {
    fill: #fff;
    font-weight: 700;
}

.puzzle-target-indicator {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-top: 12px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.constellation-sequence {
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-blue);
    font-size: 0.85rem;
}

/* PUZZLE 2: TIMELINE SHARDS */
.timeline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

.timeline-shards-pool, .timeline-slots-target {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.timeline-indicator-arrow {
    text-align: center;
    font-size: 0.75rem;
    color: var(--neon-pink);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.chrono-shard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
}

.chrono-shard:hover {
    background: rgba(255, 0, 127, 0.08);
    border-color: rgba(255, 0, 127, 0.3);
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(255, 0, 127, 0.15);
}

.chrono-shard.selected {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.shard-epoch {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--neon-pink);
    margin-bottom: 4px;
}

.shard-event {
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.3;
}

/* Target slots */
.target-slot {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.target-slot.filled {
    border-style: solid;
    border-color: rgba(255, 0, 127, 0.4);
    background: rgba(255, 0, 127, 0.04);
}

.target-slot-idx {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.6rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-dim);
}

/* PUZZLE 3: QUANTUM RESONANCE */
.resonance-display {
    background: #02030d;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#wave-canvas {
    width: 100%;
    max-height: 160px;
    display: block;
}

.tuners-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tuner-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tuner-row label {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}

.tuner-row label span {
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-gold);
}

/* Beautiful Custom Ranges */
.tuner-row input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
}

.tuner-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--neon-gold);
    box-shadow: 0 0 8px var(--neon-gold);
    cursor: pointer;
    transition: transform 0.1s;
}

.tuner-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.resonance-match-badge {
    margin-top: 15px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-gold);
    transition: all 0.3s;
}

.resonance-match-badge.synced {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
    animation: pulseSync 1.5s infinite alternate;
}

@keyframes pulseSync {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

/* ==========================================================================
   SCREEN 3: UNLOCKED CAPSULE SCREEN
   ========================================================================== */
#screen-unlocked {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.unlocked-panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    max-width: 850px;
    width: 100%;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.congrats-stars {
    font-size: 2rem;
    margin-bottom: 15px;
    animation: floatIcon 3s infinite ease-in-out;
}

.glow-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.congrats-text {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 25px;
    line-height: 1.6;
}

.capsule-display {
    background: rgba(3, 5, 20, 0.5);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 15px rgba(0, 242, 254, 0.1);
    position: relative;
    overflow: hidden;
}

.capsule-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
}

.capsule-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: rotateCapsule 6s infinite linear;
}

@keyframes rotateCapsule {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#capsule-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

#capsule-content {
    font-size: 0.9rem;
    color: var(--neon-blue);
    font-style: italic;
    line-height: 1.7;
}

.panel-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Reusable animations */
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
.game-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(3, 4, 15, 0.6);
    margin-top: auto;
}

.game-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   RESPONSIVE DESIGN OVERRIDES
   ========================================================================== */
@media (max-width: 900px) {
    .adventure-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .character-viewport {
        min-height: 220px;
    }
    
    .elysia-avatar {
        max-height: 260px;
    }
    
    .stage-right {
        min-height: auto;
    }
    
    .puzzle-card {
        position: static;
        margin-top: 15px;
        min-height: 380px;
    }
}

@media (max-width: 500px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .intro-glass-panel {
        padding: 30px 20px;
    }
    
    .timeline-shards-pool, .timeline-slots-target {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chrono-shard, .target-slot {
        min-height: 70px;
    }
    
    .panel-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-wrapper {
        margin: 15px auto;
        border-radius: 16px;
    }
    
    .back-btn {
        top: 12px;
        left: 12px;
        width: 38px;
        height: 38px;
    }
}

/* ==========================================================================
   FUTURE CINEMA FULLSCREEN OVERLAY STYLES
   ========================================================================== */
.cinema-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: none;
    opacity: 0;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

.cinema-overlay.active {
    display: flex;
    opacity: 1;
}

.cinema-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #030408;
}

#cinema-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* CRT Scanlines Overlay */
.cinema-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.3) 50%
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
}

/* Cinematic Vignette Overlay */
.cinema-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
    background: radial-gradient(circle, transparent 55%, rgba(0,0,0,0.75) 100%);
    z-index: 11;
    pointer-events: none;
}

/* Futuristic HUD Overlay */
.cinema-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    box-sizing: border-box;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--neon-blue);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
    padding-bottom: 12px;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.hud-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-act {
    color: var(--neon-pink);
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.5);
    font-weight: 600;
}

.hud-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 15px;
}

.cinema-caption-box {
    background: rgba(4, 5, 15, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 18px 24px;
    min-height: 70px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(8px);
}

#cinema-subtitle-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
    width: 100%;
    text-align: center;
    letter-spacing: 0.05em;
    font-family: 'Noto Sans SC', sans-serif;
}

.cinema-progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.cinema-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--neon-blue);
}

/* Neon Skip Button */
.btn-skip {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 18px;
    border-radius: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-skip:hover {
    border-color: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .cinema-hud {
        padding: 15px;
    }
    .hud-top {
        font-size: 0.75rem;
    }
    .btn-skip {
        top: auto;
        bottom: 120px;
        right: 15px;
    }
    #cinema-subtitle-text {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   COSMIC MEMORY CONSOLE TERMINAL STYLES
   ========================================================================== */
.archive-terminal {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    background: rgba(3, 5, 20, 0.45);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 12px;
    padding: 15px;
    margin: 25px 0 30px 0;
    box-shadow: inset 0 0 15px rgba(0, 242, 254, 0.05);
    text-align: left;
    height: 380px;
}

.archive-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 15px;
    height: 100%;
    overflow-y: auto;
}

.archive-sidebar-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Share Tech Mono', 'Noto Sans SC', sans-serif;
}

.archive-sidebar-item:hover {
    background: rgba(0, 242, 254, 0.08);
    border-color: var(--neon-blue);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.archive-sidebar-item.active {
    background: rgba(255, 0, 127, 0.08);
    border-color: var(--neon-pink);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.25);
}

.archive-sidebar-item-icon {
    font-size: 1.1rem;
}

.archive-viewport {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.archive-viewport-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.archive-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    transition: all 0.3s;
}

.archive-status-dot.decryption {
    background: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink);
    animation: blinkDecryption 0.3s infinite alternate;
}

@keyframes blinkDecryption {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

#archive-tag-badge {
    color: var(--neon-blue);
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 242, 254, 0.3);
}

.archive-viewport-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-family: 'Noto Sans SC', sans-serif;
}

#archive-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    border-left: 3px solid var(--neon-blue);
    padding-left: 10px;
    font-family: 'Share Tech Mono', 'Noto Sans SC', sans-serif;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.archive-body-text {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-light);
    white-space: pre-wrap;
}

.archive-sidebar::-webkit-scrollbar,
.archive-viewport-body::-webkit-scrollbar {
    width: 6px;
}

.archive-sidebar::-webkit-scrollbar-track,
.archive-viewport-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.archive-sidebar::-webkit-scrollbar-thumb,
.archive-viewport-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.archive-sidebar::-webkit-scrollbar-thumb:hover,
.archive-viewport-body::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

@media (max-width: 700px) {
    .archive-terminal {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 480px;
    }
    
    .archive-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-right: 0;
        padding-bottom: 15px;
        height: 150px;
    }
    
    .archive-viewport {
        height: 300px;
    }
}

