/* 必須: iframe内での正しい表示のため */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Noto Sans JP', sans-serif;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* UI表示 */
#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.time-display {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* リザルト画面 */
#result-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

#result-screen.hidden {
    display: none;
}

.result-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
}

#result-title {
    font-size: 36px;
    margin: 0 0 30px 0;
    color: #333;
}

/* 統計情報サマリー */
.stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 10px;
    color: white;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

/* ハイスコアバッジ */
#high-score-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

#high-score-badge.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ランク表示 */
#rank-display {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#rank-display.hidden {
    display: none;
}

.rank-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.rank-value {
    font-size: 48px;
    font-weight: bold;
    color: #f5576c;
}

/* ポイント表示 */
#points-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.points-label {
    font-size: 16px;
    color: white;
    opacity: 0.9;
    margin-bottom: 10px;
}

.points-value {
    font-size: 36px;
    font-weight: bold;
    color: white;
}

/* リスタートボタン */
#restart-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

#restart-btn:hover {
    transform: scale(1.05);
}

#restart-btn:active {
    transform: scale(0.95);
}

/* ヒットエフェクト */
.hit-effect {
    position: absolute;
    color: white;
    font-size: 28px;
    font-weight: bold;
    pointer-events: none;
    animation: hitAnimation 0.8s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes hitAnimation {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translateY(-40px);
        opacity: 0;
    }
}

/* 敵のスタイル（canvas内） */
.enemy {
    cursor: pointer;
}
