/* ===== グローバルスタイル ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #0a0e14;
    color: #00ff50;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* スキャンライン効果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 80, 0.03) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 255, 80, 0.03) 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* グロー効果 */
.glow {
    text-shadow: 0 0 10px #00ff50, 0 0 20px #00ff50;
}

.glow-strong {
    text-shadow: 0 0 15px #00ff50, 0 0 30px #00ff50, 0 0 45px #00ff50;
}

/* 点滅カーソル */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.cursor {
    animation: blink 1s infinite;
}

/* ===== ログイン画面専用 ===== */
#login-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#terminal-output {
    width: 100%;
    max-width: 800px;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 40px;
    min-height: 300px;
}

.terminal-line {
    margin-bottom: 8px;
}

.error-text {
    color: #ff3333;
    text-shadow: 0 0 10px #ff3333;
}

#password-container {
    display: none;
    font-size: 18px;
}

#password-input {
    background: transparent;
    border: none;
    color: #00ff50;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    outline: none;
    width: 300px;
    margin-left: 10px;
    text-shadow: 0 0 5px #00ff50;
}

/* ===== 司令室画面専用 ===== */
#command-center {
    width: 100%;
    height: 100%;
    position: relative;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* モーダル（BLUEPRINT表示用） */
#blueprint-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

#blueprint-modal.active {
    display: flex;
}

#blueprint-content {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid #00ff50;
    box-shadow: 0 0 30px #00ff50;
}

#blueprint-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #00ff50;
    cursor: pointer;
    text-shadow: 0 0 20px #00ff50;
}

#blueprint-close:hover {
    color: #ff3333;
    text-shadow: 0 0 20px #ff3333;
}

/* レスポンシブ */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    #terminal-output {
        font-size: 11px;
        line-height: 1.5;
        min-height: 200px;
        overflow-x: hidden;
        word-break: break-all;
    }

    .terminal-line {
        margin-bottom: 6px;
        font-size: 10px;
    }

    #password-container {
        font-size: 14px;
        flex-wrap: wrap;
        justify-content: center;
    }

    #password-input {
        font-size: 14px;
        width: 80%;
        max-width: 200px;
        margin-left: 0;
        margin-top: 10px;
    }

    /* 司令室：モバイル用調整 */
    #canvas {
        touch-action: none;
    }

    #blueprint-modal {
        padding: 10px;
    }

    #blueprint-content {
        max-width: 95%;
        max-height: 85%;
    }

    #blueprint-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    #terminal-output {
        font-size: 9px;
        line-height: 1.4;
        padding: 10px;
    }

    .terminal-line {
        font-size: 9px;
        margin-bottom: 4px;
    }

    #password-container {
        font-size: 12px;
    }

    #password-input {
        font-size: 12px;
        width: 90%;
    }
}

/* タッチデバイス用 */
@media (hover: none) and (pointer: coarse) {
    #canvas {
        cursor: default;
    }

    #blueprint-close {
        padding: 10px;
        font-size: 36px;
    }
}
