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

body {
    font-family: Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#game-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 15px 30px;
}

#score {
    font-size: 28px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 5px;
}

#stage {
    font-size: 20px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

#lives {
    font-size: 48px;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-top: 5px;
    letter-spacing: 4px;
}

#timer {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    #game-info {
        top: 40px;
        padding: 10px 20px;
    }
    
    #score {
        font-size: 24px;
    }
    
    #stage {
        font-size: 18px;
    }
    
    #lives {
        font-size: 40px;
        letter-spacing: 2px;
    }
    
    #timer {
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

#cost-display-container {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 200;
    width: 80%;
    max-width: 600px;
}

.cost-item {
    color: white;
    padding: 8px 0;
    margin: 3px 0;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    opacity: 0;
    transform: translateY(15px);
    animation: costItemAnimation 2s ease-out forwards;
}

@keyframes costItemAnimation {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* 字幕表示コンテナ */
#subtitle-container {
    /* subtitleManager.js で動的にスタイルを設定 */
}

/* 動的フォントサイズクラス */
.responsive-font {
    font-size: var(--dynamic-font-size) !important;
}

@media (max-width: 768px) {
    #cost-display-container {
        top: 140px;
        width: 90%;
    }
    
    .cost-item {
        font-size: 18px;
        padding: 6px 0;
    }
    
    /* スマートフォン用字幕スタイル調整 */
    #subtitle-container {
        font-size: 25.2px !important; /* 70%縮小 */
        bottom: 40px !important;
        width: 95% !important;
        padding: 12px 20px !important;
    }
}