body {
    background-color: #000500;
    color: #00ff00;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    image-rendering: pixelated;
    text-shadow: 0 0 5px #00ff00;
}

/* CRT Scanline Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    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));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

button {
    background-color: #003300;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 10px 15px;
    margin: 5px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 5px #003300;
    transition: all 0.2s;
}

button:hover {
    background-color: #00ff00;
    color: #000000;
    box-shadow: 0 0 10px #00ff00;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #333;
    color: #555;
    border-color: #555;
}

#game-container {
    display: flex;
    flex-direction: column;
    width: 800px;
    max-width: 100%;
}

/* Screens */
#title-screen,
#result-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ff00;
}

#map-container {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    border: 1px solid #00ff00;
    padding: 10px;
    background: #001100;
}

.map-tile {
    width: 18%;
    height: 100px;
    border: 1px dashed #004400;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    font-size: 2em;
}

.collapsed {
    background-color: #110000;
    border-color: #ff0000;
}

.tile-load {
    font-size: 0.5em;
    margin-top: 5px;
    color: #00aa00;
}

.load-danger {
    color: #ff0000;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

#log-window {
    height: 200px;
    border: 1px solid #00ff00;
    overflow-y: scroll;
    padding: 10px;
    background: #000;
    font-size: 0.9em;
    margin-bottom: 20px;
}

#log-window div {
    margin-bottom: 5px;
    border-bottom: 1px solid #002200;
}

.status-row {
    display: flex;
    justify-content: space-between;
    border: 1px solid #00ff00;
    padding: 10px;
    margin-bottom: 10px;
    background: #001100;
}

/* Log Colors (Hacker Style) */
.log-info {
    color: #00ff00;
}

.log-warning {
    color: #ffff00;
}

.log-danger {
    color: #ff0000;
    font-weight: bold;
}

.log-get {
    color: #00ffff;
}

.log-truth {
    color: #00aaff;
}

/* Cyan for truth */
.log-lie {
    color: #ff00ff;
}

/* Magenta for lie */

/* Target Marker */
/* ターゲットマーカーのスタイル上書き */
.target-marker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    z-index: 5;
    /* キャラクター(z-index指定なし)より手前に表示 */
    animation: pulse-target 1s infinite alternate;
    pointer-events: none;
    /* クリックを邪魔しない */
}

@keyframes pulse-target {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.1);
        opacity: 1.0;
    }
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.3);
    }
}

/* Error Rate UI */
#error-container {
    width: 300px;
    margin: 10px auto;
    text-align: center;
    background: #000;
    border: 1px solid #f00;
    padding: 5px;
    box-shadow: 0 0 5px #f00;
}

#error-label {
    color: #f00;
    font-weight: bold;
    text-shadow: 0 0 2px #f00;
}

#error-bar-bg {
    width: 100%;
    height: 20px;
    background: #300;
    margin-top: 5px;
    border: 1px solid #500;
}

#error-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff5555);
    width: 0%;
    transition: width 0.3s;
}

/* Glitch Effects (Lightweight) */
@keyframes glitch-color-low {
    0% {
        text-shadow: 0 0 5px #00ff00;
    }

    50% {
        text-shadow: 0 0 5px #ffff00;
    }

    100% {
        text-shadow: 0 0 5px #00ff00;
    }
}

@keyframes glitch-color-med {
    0% {
        color: #00ff00;
        text-shadow: 0 0 5px #00ff00;
    }

    50% {
        color: #ff00ff;
        text-shadow: 2px 0 5px #ff00ff;
    }

    100% {
        color: #00ff00;
        text-shadow: 0 0 5px #00ff00;
    }
}

@keyframes glitch-color-high {
    0% {
        opacity: 1;
        filter: invert(0);
    }

    10% {
        opacity: 0.8;
        filter: invert(1);
    }

    20% {
        opacity: 1;
        filter: invert(0);
    }

    100% {
        opacity: 1;
        filter: invert(0);
    }
}

.glitch-low {
    animation: glitch-color-low 2s infinite;
}

.glitch-med {
    animation: glitch-color-med 0.5s infinite;
}

.glitch-high {
    animation: glitch-color-high 0.1s infinite;
    color: red !important;
}

.system-crash {
    background: #0000aa !important;
    color: #ffffff !important;
    font-family: 'Courier New', Courier, monospace;
}

/* Help Modal */
#help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 0, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
}

#help-content {
    width: 80%;
    max-width: 600px;
    background: #001100;
    border: 1px solid #00ff00;
    padding: 20px;
    box-shadow: 0 0 20px #005500;
    color: #00ff00;
    overflow-y: auto;
    max-height: 90vh;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

#help-content ul {
    list-style-type: none;
    padding-left: 10px;
}

#help-content li {
    margin-bottom: 10px;
    border-left: 2px solid #004400;
    padding-left: 10px;
}

#help-content strong {
    color: #aaffaa;
}

#help-content em {
    color: #88cc88;
    font-style: italic;
    font-size: 0.9em;
}

/* Dev Log (Meta Comment) */
.log-dev {
    color: #88ff88;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-style: italic;
    border-left: 3px solid #00ff00;
    padding-left: 8px;
    margin-left: 5px;
    background: rgba(0, 40, 0, 0.3);
}

/* =========================================
   ▼ 追加分: 宣伝・連携ボタン用スタイル
   (既存のソースを消さずに末尾に追加してください)
   ========================================= */

/* 宣伝ボタン共通設定 */
button.promo-btn {
    display: block;
    width: 80%;
    max-width: 300px;
    margin: 10px auto;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, filter 0.2s;
    cursor: pointer;
    text-decoration: none;
    /* リンク用 */
}

button.promo-btn:active {
    transform: scale(0.98);
}

/* ID-FORGE (会員証) ボタン - 金色グラデーション */
button.promo-btn.forge {
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 50%, #b8860b 100%);
    color: #000;
    border: 2px solid #ffd700;
    animation: pulse-gold 2s infinite;
}

button.promo-btn.forge:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ffffff 50%, #ffd700 100%);
    filter: brightness(1.1);
}

/* Coffee (支援) ボタン - 黄色 */
button.promo-btn.coffee {
    background-color: #FFDD00;
    color: #000;
    border: 2px solid #000;
    font-family: 'Verdana', sans-serif;
    /* 少しポップに */
}

button.promo-btn.coffee:hover {
    background-color: #fff;
}

/* 金色の脈動アニメーション */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* --- 追加分: 新しい特典ボタン用スタイル --- */

/* ダウンロードボタン（特別感のある虹色/ホログラム風） */
button.promo-btn.download {
    background: linear-gradient(45deg, #00ff00, #00ffff, #00ff00);
    background-size: 200% 200%;
    color: #000;
    border: 2px solid #fff;
    animation: holograph 3s ease infinite;
    font-weight: 900;
    margin-bottom: 15px;
    /* 少し間隔を空ける */
}

button.promo-btn.download:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

@keyframes holograph {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* BOOTHボタン（落ち着いたグレー/オレンジなど、BOOTHのイメージまたは汎用） */
button.promo-btn.booth {
    background: #fc4d50;
    /* BOOTHっぽい赤/ピンク色 */
    color: #fff;
    border: 2px solid #ffaaaa;
}

button.promo-btn.booth:hover {
    background: #ff6b6e;
}

/* マップアイコン（ドット絵）用スタイル */
.map-icon {
    width: 48px;
    /* タイルサイズに合わせて調整 */
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
    /* ドットをくっきり表示 */
    filter: drop-shadow(0 0 4px #00ff00);
    /* 蛍光グリーンの発光 */
    vertical-align: middle;
}

/* 敵によって発光色を変える（オプション） */
/* グリッチやゴーストは少し透過させたり色相をずらす */
.glitch-med .map-icon {
    animation: icon-glitch 0.2s infinite;
}

@keyframes icon-glitch {
    0% {
        transform: translate(0);
        filter: drop-shadow(0 0 4px #00ff00) hue-rotate(0deg);
    }

    50% {
        transform: translate(-2px, 1px);
        filter: drop-shadow(0 0 4px #ff00ff) hue-rotate(90deg);
    }

    100% {
        transform: translate(2px, -1px);
        filter: drop-shadow(0 0 4px #00ff00) hue-rotate(0deg);
    }
}

/* 1. タイトル画面などを「枠の中」にピッタリ収める設定 */
#title-screen,
#result-screen,
#help-modal {
    position: absolute !important;
    /* fixedを上書き */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
    /* フレックスボックスの設定は維持 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 2. ヘルプ画面を最前面にする */
#help-modal {
    z-index: 2000 !important;
}

/* --- 左右の広告カラム用CSS --- */
.ad-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    /* 画面の上下中央に配置 */
    width: 160px;
    /* 一般的な縦長バナーの幅 */
    height: 600px;
    z-index: 10;
}

.ad-left {
    left: 10px;
}

.ad-right {
    right: 10px;
}

/* 画面幅が1200px以下の端末（スマホ・タブレット・狭いPC）ではサイド広告を隠す */
@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }
}