/* --- 基本レイアウト --- */
body {
    margin: 0;
    background: #0a0a0a;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    color: white;
}

canvas {
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ヘッダー(50px)の下に配置 */
.hud {
    position: absolute;
    top: 60px;
    left: 20px;
    color: #ff6a00;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-left: 2px solid #ff6a00;
}

/* --- ヘッダー（コントロールバー） --- */
#top-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid #ff6a00;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 100;
    pointer-events: auto;
}

.header-section {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-section.left {
    justify-content: flex-start;
    font-weight: bold;
    letter-spacing: 2px;
    color: #ff6a00;
}

.header-section.center {
    justify-content: center;
}

.header-section.right {
    justify-content: flex-end;
    gap: 15px;
    font-size: 11px;
    color: #ff6a00;
}

/* スライダーの設定（重複を統合） */
#nav-scale-slider {
    width: 150px;
    cursor: pointer;
    vertical-align: middle;
}

/* --- ドネーションボタン --- */
.donation-btn {
    background: transparent;
    color: #ffcc00;
    border: 1px solid #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.donation-btn:hover {
    background: #ffcc00;
    color: #000;

    /* 高負荷時のINP悪化を防ぐため、hover時の発光を抑える */
    box-shadow: 0 0 5px rgba(255, 204, 0, 0.4);
}

/* --- モーダル（展示パネル） --- */
#modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 900px;
    background: #111;
    border: 1px solid #333;
    border-top: 5px solid #ff6a00;
    padding: 30px;
    display: none;
    pointer-events: auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
}

#modal.gold-theme {
    border-top-color: #ffcc00;
}

#modal.gold-theme #m-title {
    color: #ffcc00;
}

#modal.gold-theme .btn-link {
    background: #ffcc00;
}

.modal-grid {
    display: flex;
    gap: 30px;
}

.modal-left,
.modal-right {
    width: 50%;
}

video {
    width: 100%;
    background: #000;
    border: 1px solid #222;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #ff6a00;
}

.btn-link {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: #ff6a00;
    color: black;
    text-decoration: none;
    font-weight: bold;
}

/* --- ナビゲーションパネル（操作キー） --- */
:root {
    --nav-size: 100px;
}

#nav-panel {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    z-index: 20;
}

.nav-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.nav-btn {
    width: var(--nav-size);
    aspect-ratio: 1 / 1;
    background: rgba(255, 106, 0, 0.8);
    border: 3px solid #ff6a00;
    color: #000;
    font-size: calc(var(--nav-size) * 0.4);
    font-weight: bold;
    border-radius: 15px;

    /* box-shadow は削除または 0 2px 5px 程度に抑える */
    box-shadow: none;

    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.nav-btn:active {
    background: rgba(255, 255, 255, 0.9);
    color: #ff6a00;
    transform: scale(0.95);
}


/* 下記はINFO　DESK用 */
/* 文字のみモードの時は、グリッドを調整 */
#modal.info-mode .modal-grid {
    display: block;
    /* 横並びをやめて縦に */
}

#modal.info-mode .modal-right {
    width: 100%;
}

#modal.info-mode #m-desc {
    white-space: pre-wrap;
    line-height: 1.8;
    /* 改行を有効にする */
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 5px;
}