/**
 * 護郷会シューティングゲーム - スタイル
 */

/* ゲームトリガー（「会」の文字） */
.game-trigger {
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.game-trigger:hover {
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff;
    animation: triggerPulse 0.5s ease-in-out infinite;
}

.game-trigger::after {
    content: '▶ PLAY';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    font-size: 0.3em;
    color: #00ffff;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
}

.game-trigger:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

@keyframes triggerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ゲームコンテナ */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: #0a0a0a;
    animation: gameOpen 0.5s ease-out;
}

#game-container.closing {
    animation: gameClose 0.5s ease-in forwards;
}

@keyframes gameOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gameClose {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}


/* キャンバス */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 閉じるボタン */
#game-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

#game-close-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff0000;
    transform: rotate(90deg);
}

/* UI */
#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    font-family: 'Noto Sans JP', sans-serif;
}

#game-score {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#game-score span {
    color: #00ffff;
    font-size: 32px;
}

#game-combo {
    position: absolute;
    top: 80px;
    left: 30px;
    font-size: 28px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    opacity: 0;
    transition: all 0.2s ease;
}

#game-lives {
    display: flex;
    gap: 10px;
}

.life-icon {
    font-size: 24px;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

#game-level {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: #888;
    transition: all 0.3s ease;
}

#game-level.level-up {
    color: #ffff00;
    font-size: 32px;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}


/* スタート画面 */
#game-start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(0, 50, 100, 0.3) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 50;
}

.game-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 80px #00ffff;
    margin-bottom: 10px;
    letter-spacing: 20px;
}

.game-subtitle {
    font-size: 48px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 30px;
    margin-bottom: 60px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.game-instruction {
    font-size: 24px;
    color: #fff;
    animation: blink 1s ease-in-out infinite;
    margin-bottom: 40px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.game-controls {
    font-size: 14px;
    color: #888;
    text-align: center;
    line-height: 2;
}

.game-controls p {
    margin: 0;
}

.game-highscore {
    position: absolute;
    bottom: 40px;
    font-size: 18px;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

@keyframes titlePulse {
    0%, 100% { 
        text-shadow: 
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 80px #00ffff;
    }
    50% { 
        text-shadow: 
            0 0 30px #00ffff,
            0 0 60px #00ffff,
            0 0 120px #00ffff,
            0 0 160px #0088ff;
    }
}


/* ゲームオーバー画面 */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(100, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.95) 100%);
    z-index: 50;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 80px;
    font-weight: 900;
    color: #ff0000;
    text-shadow: 
        0 0 20px #ff0000,
        0 0 40px #ff0000;
    margin-bottom: 40px;
    letter-spacing: 10px;
}

.game-final-score {
    font-size: 36px;
    color: #fff;
    margin-bottom: 20px;
}

.game-final-score span {
    color: #00ffff;
    font-size: 48px;
    font-weight: bold;
}

.game-max-combo {
    font-size: 24px;
    color: #ffff00;
    margin-bottom: 30px;
}

.game-new-record {
    font-size: 32px;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    animation: recordPulse 0.5s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes recordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-restart {
    font-size: 20px;
    color: #fff;
    animation: blink 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.game-exit {
    font-size: 14px;
    color: #888;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .game-title {
        font-size: 60px;
        letter-spacing: 10px;
    }
    
    .game-subtitle {
        font-size: 24px;
        letter-spacing: 15px;
    }
    
    .game-instruction {
        font-size: 18px;
    }
    
    .game-over-title {
        font-size: 48px;
    }
    
    .game-final-score {
        font-size: 24px;
    }
    
    .game-final-score span {
        font-size: 32px;
    }
    
    #game-score {
        font-size: 18px;
    }
    
    #game-score span {
        font-size: 24px;
    }
    
    .game-trigger::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 40px;
    }
    
    .game-subtitle {
        font-size: 18px;
        letter-spacing: 10px;
    }
    
    .game-controls {
        font-size: 12px;
    }
}


/* PC/モバイル操作説明の切り替え */
.game-controls-mobile {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .game-controls-pc {
        display: none;
    }
    .game-controls-mobile {
        display: block;
    }
}

/* タッチデバイス用の調整 */
@media (hover: none) {
    .game-trigger::after {
        content: '▶ TAP';
    }
    
    #game-close-btn {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
}


/* ボスHPバー */
#game-boss-hp {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 500px;
}

.boss-name {
    text-align: center;
    font-size: 16px;
    color: #ff0066;
    margin-bottom: 5px;
    text-shadow: 0 0 10px #ff0066;
    letter-spacing: 3px;
}

.boss-hp-bar {
    width: 100%;
    height: 12px;
    background: #333;
    border: 2px solid #ff0066;
    overflow: hidden;
}

.boss-hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0066, #ff6600);
    transition: width 0.2s ease;
}

/* 能力選択UI */
#ability-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.ability-title {
    font-size: 36px;
    color: #ffff00;
    margin-bottom: 40px;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
    letter-spacing: 5px;
}

.ability-options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
}

.ability-option {
    width: 180px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ffff;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.ability-option:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #ffff00;
    box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
}

.ability-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ability-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.ability-desc {
    font-size: 13px;
    color: #aaa;
}

@media (max-width: 600px) {
    .ability-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .ability-option {
        width: 80%;
        max-width: 250px;
        padding: 20px 15px;
    }
    
    .ability-icon {
        font-size: 36px;
    }
    
    .ability-title {
        font-size: 28px;
    }
}
