body {
    margin: 0; padding: 0; overflow: hidden;
    font-family: 'Noto Sans JP', sans-serif;
    transition: background 1s ease;
}
#game-canvas { display: block; position: absolute; top: 0; left: 0; z-index: 1; }

/* --- UI配置 --- */
#ui-container {
    position: absolute; top: 20px; left: 20px; right: 20px; z-index: 10;
    display: flex; justify-content: space-between; align-items: flex-start;
    pointer-events: none; /* コンテナ全体はクリック透過 */
}

.hud-left { display: flex; flex-direction: column; gap: 10px; pointer-events: auto; /* 左側要素はクリック可能に */ }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; }

/* タイトルへ戻るボタン */
#back-to-title-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    color: #aaa;
    border: 1px solid #555;
    padding: 5px 15px;
    border-radius: 5px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
}

#back-to-title-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* スコア */
.score-box {
    padding: 8px 15px; border-radius: 8px; font-size: 1.2em; font-weight: bold;
    background: rgba(0,0,0,0.6); color: white; border-left: 4px solid #888;
    width: fit-content;
}

/* お題表示 */
#target-container {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #fff;
    padding: 10px 30px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
    transition: transform 0.2s;
}
#target-container.pop { transform: scale(1.2); border-color: #ff0; }
.target-label { font-size: 0.9em; color: #ccc; letter-spacing: 2px; margin-bottom: 0; }
#target-number { font-size: 3.5em; font-weight: 900; color: #fff; line-height: 1; }

/* 世界名 */
#world-name-container {
    position: absolute; bottom: 20px; left: 0; right: 0;
    display: flex; justify-content: center; z-index: 5;
    pointer-events: none;
}
.world-name {
    padding: 5px 15px; background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.7);
    border-radius: 20px; font-size: 0.9em; letter-spacing: 2px;
}

/* オーバーレイ画面 */
#start-screen, #gameover-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center; z-index: 100;
    backdrop-filter: blur(5px); pointer-events: auto;
}
.content-wrapper {
    text-align: center; color: white; padding: 40px;
    border: 2px solid rgba(255,255,255,0.5); border-radius: 15px;
    background: rgba(255,255,255,0.05); box-shadow: 0 0 30px rgba(0,0,0,0.5);
    min-width: 300px;
}
.game-title { font-weight: 900; font-size: 4em; margin-bottom: 20px; line-height: 1; }
.description { font-size: 1.1em; margin-bottom: 30px; color: #ccc; line-height: 1.6; }

/* イントロへ戻るリンク */
.intro-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: color 0.3s;
    letter-spacing: 1px;
    display: inline-block;
}
.intro-link:hover {
    color: #00ffff;
    border-bottom-color: #00ffff;
}

/* ボタン */
.btn-group { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.diff-btn, .start-button {
    font-family: 'Noto Sans JP', sans-serif; padding: 10px 20px; cursor: pointer;
    background: transparent; border: 1px solid #888; color: #ddd; border-radius: 4px;
}
.diff-btn.active, .diff-btn:hover, .start-button:hover {
    background: white; color: black; border-color: white;
}
.start-button { padding: 15px 60px; font-size: 1.5em; background: #fff; color: #000; border: none; }

/* テーマ別スタイル */
body[data-theme="cyberpunk"] #target-number { color: #0ff; text-shadow: 0 0 20px #0ff; }
body[data-theme="jungle"] #target-number { color: #0f0; text-shadow: 0 0 20px #0f0; }
body[data-theme="celestial"] #target-number { color: gold; text-shadow: 0 0 20px gold; }
body[data-theme="rainbow"] #target-number {
    background: linear-gradient(to right, #ff00ff, #00ffff, #ffff00);
    -webkit-background-clip: text; color: transparent;
}

body[data-theme="cyberpunk"] .score-box { border-left-color: #0ff; color: #0ff; font-family: 'Orbitron'; }
body[data-theme="jungle"] .score-box { border-left-color: #0f0; color: #ff0; font-family: 'MedievalSharp'; }
body[data-theme="celestial"] .score-box { border-left-color: gold; color: #ffd700; font-family: 'Cinzel Decorative'; }
body[data-theme="rainbow"] .score-box { border-left-color: #f0f; color: #fff; font-family: 'Bangers'; font-size: 1.5em; }