:root {
    --bg-color: #020a05;
    --main-color: #77ffcc;
    --main-dim: #77ffcc;
    --glow: 0 0 5px rgba(85, 255, 119, 0.5), 0 0 10px rgba(85, 255, 119, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000;
    color: var(--main-color);
    font-family: 'DotGothic16', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    letter-spacing: 2px;
}

.boot-animation {
    animation: crt-turn-on 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    transform: scale(1, 0.001); 
    opacity: 0;
}

/* 走査線と微細なフリッカー */
.crt-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none; 
    z-index: 100;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

@keyframes crt-turn-on {
    0% {
        transform: scale(1, 0.002);
        opacity: 0;
        filter: brightness(30);
    }
    40% {
        transform: scale(1, 0.002);
        opacity: 1;
        filter: brightness(30);
    }
    70% {
        transform: scale(1, 1);
        filter: brightness(2);
    }
    100% {
        transform: scale(1, 1);
        opacity: 1;
        filter: brightness(1);
    }
}

.terminal-container {
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* MGS風の二重フレーム */
.frame-outer {
    border: 2px solid var(--main-dim);
    border-radius: 8px;
    padding: 4px;
    height: 100%;
    box-shadow: 0 0 15px rgba(34, 136, 51, 0.3) inset;
}

.frame-inner {
    border: 2px solid var(--main-color);
    border-radius: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px;
    text-shadow: var(--glow);
    position: relative;
}

.terminal-header {
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 8px;
    font-size: 1.2rem;
    margin-bottom: 24px;
}

.terminal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pixel-logo {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: 96px;
    height: 70px;
    position: absolute; 
    right: 24px;
    bottom: 60px;
    opacity: 0.9;
    pointer-events: none;
}

.interactive-area {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 40px;
    align-items: flex-start;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 左側：メニューリストの幅を調整 */
.menu-list {
    list-style: none;
    width: 40%;
}

/* 解説エリア */
.description-area {
    width: 60%;
    min-height: 160px;
    padding-left: 24px;   
    border-left: 1px dashed var(--main-dim); 
    font-size: 1.2rem;
    line-height: 1.6; 
    letter-spacing: 1px;
    color: var(--main-color);
    text-shadow: var(--glow);
    
    transition: opacity 0.2s ease;
}

.cursor {
    display: inline-block;
    width: 22px; 
    color: transparent;
}

.menu-item {
    font-size: 1.2rem; 
    margin-bottom: 3px;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    letter-spacing: 4px; 
}

/* 選択状態のスタイル */
.menu-item.active {
    color: #ffa;
    text-shadow: 0 0 8px #ffa, var(--glow);
}

.menu-item.active .cursor {
    color: #ffa;
    animation: blink 1s step-end infinite;
}

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

.terminal-footer {
    border-top: 2px solid var(--main-color);
    padding-top: 8px;
    font-size: 0.9rem;
    margin-top: auto;
}

.controls-guide {
    text-align: right;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--main-dim);
}

.terminal-window-viewport {
    width: 100%;
    height: 550px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.terminal-slider {
    display: flex;
    width: 200%; 
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen-view {
    width: 50%; 
    height: 100%;
    flex-shrink: 0;
    box-shrink: border-box;
}

.screen-view .interactive-area {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 40px;
    align-items: flex-start;
}

.screen-view .menu-list {
    list-style: none;
    width: 40%;
    max-height: 100%;
    overflow-y: auto;
}

/* 右側：解説・本文エリア */
.screen-view .description-area {
    width: 60%;
    height: 100%;
    padding-left: 24px;
    border-left: 1px dashed var(--main-dim);
    font-size: 1.1rem;
    line-height: 1.6;
    letter-spacing: 1px;
    color: var(--main-color);
    text-shadow: var(--glow);
}

.terminal-slider.slide-active {
    transform: translateX(-50%); 
}

/* 5. 詳細画面のレイアウト */
.detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.detail-title {
    font-size: 1.2rem;
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-shadow: var(--glow);
}

/* 6. チャッターズ本文 */
#chatter-file-content {
    overflow-y: auto;
    height: 450px;
    white-space: pre-wrap;
}

/* 戻るボタンの配置を固定 */
.back-button-zone {
    position: absolute;   
    width: 45%;
}

#btn-back:hover {
    color: #ffa;
    text-shadow: 0 0 8px #ffa, var(--glow);
}


#screen-detail .menu-list {
    width: 35%;
}

#screen-detail .menu-list .menu-item {
    font-size: 0.95rem; 
}

#screen-detail .description-area {
    width: 65%;
    padding-left: 30px; 
    font-size: 0.95rem; 
}