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

body {
    background-color: #0a0e27;
    color: #ff9c00;
    font-family: 'Courier New', monospace;
    background-image: 
        radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
}

/* ヘッダー */
.header {
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #ff9c00;
    background-color: rgba(10, 14, 39, 0.8);
}

.header-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ff6d00;
    animation: glow 2s infinite alternate;
}

.header-subtitle {
    font-size: 1.2rem;
    color: #ff9c00;
}

/* ランディングCTA */
.header-cta {
    display: inline-flex;
    gap: 10px;
    margin-top: 12px;
}
.btn{
    display: inline-block;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #ff9c00;
    color: #ff9c00;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn-primary{
    background: linear-gradient(90deg,#ff6d00,#ff9c00);
    color: #1b0e00;
    border-color: transparent;
}
.btn-ghost{
    background: transparent;
}

/* Lang switch */
.lang-switch{display:inline-flex;gap:8px;align-items:center;margin-top:8px}
.lang-switch select{background:rgba(0,0,0,.3);color:#ff9c00;border:1px solid #ff9c00;border-radius:6px;padding:6px 10px}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

/* メインコンテンツ */
.main-content {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-section {
    margin-bottom: 30px;
}

.game-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.game-title {
    text-align: center;
    margin-bottom: 15px;
}

.game-title h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #ff6d00;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #ff9c00, 0 0 20px #ff9c00; }
    to { text-shadow: 0 0 20px #ff9c00, 0 0 30px #ff9c00; }
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ff6d00;
}

.viewport {
    position: relative;
    width: 100%;
    height: 450px;
    border: 3px solid #ff9c00;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 0 20px rgba(255, 156, 0, 0.5);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #0a0e27;
}

.game-overlay {
    position: absolute;
    inset: 0; /* ビューポート全体を覆う */
    pointer-events: none; /* 下のキャンバス操作を阻害しない */
}

.sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ff9c00;
    border: 1px solid #ff9c00;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: auto; /* クリック可能に */
}

.sound-toggle:hover {
    background-color: rgba(255, 156, 0, 0.2);
}

.instructions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ff9c00;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.5);
}

.controls {
    flex: 1;
}

.controls p {
    margin: 5px 0;
}

.minimap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px;
}

.minimap-container p {
    margin-bottom: 5px;
    font-size: 14px;
}

.minimap {
    width: 120px;
    height: 120px;
    border: 2px solid #ff9c00;
    background-color: rgba(10, 14, 39, 0.8);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

/* ミニマップ強調表示 */
.minimap .minimap-witch {
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px #ff69b4, 0 0 2px #ffffff inset;
    border-radius: 50%;
}

.minimap .minimap-label {
    position: absolute;
    font-size: 12px;
    color: #ffeb3b;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    transform: translate(-50%, -120%);
    pointer-events: none;
}

.minimap-ping {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    border: 2px solid rgba(255, 105, 180, 0.9);
    animation: minimap-ping 1.2s cubic-bezier(0, 0, 0.2, 1) infinite;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
}

@keyframes minimap-ping {
    0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.8; }
    80% { opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

.minimap-guide {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,105,180,0.95), rgba(255,235,59,0.9));
    transform-origin: 0 0;
    opacity: 0.9;
    pointer-events: none;
}

/* 逃走フェーズの敵マーカーを強調 */
.minimap-enemy {
    box-shadow: 0 0 6px #ff0000;
    animation: enemy-glow 1s ease-in-out infinite alternate;
}

@keyframes enemy-glow {
    from { box-shadow: 0 0 4px #ff0000; }
    to   { box-shadow: 0 0 10px #ff5555; }
}



/* ランタンの光のアニメーション */
.lantern-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.4) 0%, rgba(255, 204, 0, 0) 70%);
    animation: flicker 3s infinite alternate;
    pointer-events: none;
}

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

/* おばけのアニメーション */
.ghost {
    position: absolute;
    color: #ffffff;
    font-size: 2rem;
    animation: float 3s infinite ease-in-out;
    z-index: 10;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* かぼちゃのアニメーション */
.pumpkin {
    position: absolute;
    color: #ff6d00;
    font-size: 1.5rem;
    animation: pulse 2s infinite alternate;
    z-index: 5;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* 墓石のスタイル */
.gravestone {
    position: absolute;
    color: #5a5a5a;
    font-size: 1.2rem;
    z-index: 3;
}

/* 看板のスタイル */
.sign {
    position: absolute;
    color: #8b4513;
    font-size: 1rem;
    z-index: 4;
}

/* 情報セクション */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #ff9c00;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 156, 0, 0.3);
}

.info-card h3 {
    color: #ff6d00;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card p, .info-card ul {
    margin-bottom: 0;
    line-height: 1.6;
}

.info-card ul {
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 8px;
}

/* フッター */
.footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ff9c00;
    background-color: rgba(10, 14, 39, 0.8);
    margin-top: 40px;
}

.footer a {
    color: #ff9c00;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .header {
        padding: 15px;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-title h2 {
        font-size: 1.8rem;
    }
    
    .viewport {
        height: 350px;
    }
    
    .instructions {
        flex-direction: column;
        gap: 10px;
    }
    
    .minimap-container {
        margin-left: 0;
    }
    
    .minimap {
        width: 100px;
        height: 100px;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
}

/* ゲームUI（収集ゲーム） */
.game-ui {
    position: absolute;
    top: 60px;
    right: 10px;
    pointer-events: auto; /* UI操作可能に */
}

.ui-panel {
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff9c00;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.ui-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}

.ui-item:last-child {
    margin-bottom: 0;
}

.ui-label {
    color: #ff9c00;
    font-size: 16px;
    font-weight: bold;
}

.ui-value {
    color: #ffeb3b;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

/* ゲーム完了メッセージ */
.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.95);
    border: 3px solid #ffeb3b;
    border-radius: 15px;
    padding: 30px 50px;
    font-size: 24px;
    color: #ffeb3b;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 235, 59, 0.8);
    animation: messageAppear 0.5s ease-out;
    z-index: 1000;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 会話プロンプト */
.talk-prompt {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(138, 43, 226, 0.9);
    border: 2px solid #ffeb3b;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 18px;
    color: #ffeb3b;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.6);
    animation: bounce 1s ease-in-out infinite;
    will-change: transform;
    z-index: 500;
}

/* Respect reduced motion: disable heavy animations */
@media (prefers-reduced-motion: reduce) {
  .header-title,
  .game-title h2,
  .lantern-glow,
  .minimap-ping,
  .talk-prompt,
  .game-message { animation: none !important; }
}

/* 画面左上の軽量ヒント */
.game-hint {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #ffeb3b;
    color: #ffeb3b;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 600; /* ゲームUIより下げつつ前面 */
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* 勝利演出の虹色アニメーション */
@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
