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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
}

#game-container {
    width: 800px;
    max-width: 95vw;
    background: #0f3460;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

@media (max-width: 768px) {
    #game-container {
        max-width: 100vw;
        border-radius: 0;
    }
}

#header {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
}

#stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

#hp-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

#hp-bar {
    flex: 1;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff0000, #ff6b6b);
    transition: width 0.3s ease;
}

#score {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#combo {
    font-size: 20px;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    min-width: 120px;
}

#game-screen {
    position: relative;
    background: #000;
    height: 400px;
}

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

#controls {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    gap: 15px;
}

@media (max-width: 768px) {
    #controls {
        padding: 15px 10px;
        gap: 10px;
    }
}

.attack-btn {
    flex: 1;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #e94560, #c72e49);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.attack-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(233, 69, 96, 0.6);
}

.attack-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(233, 69, 96, 0.4);
    background: linear-gradient(135deg, #c72e49, #e94560);
}

@media (max-width: 768px) {
    .attack-btn {
        padding: 15px 10px;
        font-size: 16px;
        min-height: 60px;
    }
}

#rhythm-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    gap: 20px;
}

.beat {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.1s ease;
}

.beat.active {
    background: #00ff88;
    box-shadow: 0 0 20px #00ff88;
    transform: scale(1.5);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    padding: 40px;
    background: rgba(15, 52, 96, 0.95);
    border-radius: 20px;
    border: 2px solid rgba(233, 69, 96, 0.5);
}

.menu-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.menu-content p {
    font-size: 20px;
    margin-bottom: 30px;
}

.menu-content button {
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #e94560, #c72e49);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.menu-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(233, 69, 96, 0.6);
}

.instructions {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    text-align: left;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #00ff88;
}

.instructions p {
    font-size: 16px;
    margin-bottom: 10px;
}

#judgment-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    font-weight: bold;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.judgment-perfect {
    color: #ffd700;
    animation: judgmentPop 0.5s ease;
}

.judgment-good {
    color: #00ff88;
    animation: judgmentPop 0.5s ease;
}

.judgment-miss {
    color: #ff4444;
    animation: judgmentPop 0.5s ease;
}

@keyframes judgmentPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* パワーバー */
#power-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.power-label {
    font-size: 14px;
    font-weight: bold;
    color: #00ccff;
}

#power-bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(0, 204, 255, 0.3);
}

#power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ccff, #00ffff);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

#power-fill.ready {
    animation: powerPulse 0.8s infinite;
}

@keyframes powerPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    }
}

#power-status {
    font-size: 12px;
    font-weight: bold;
    color: #00ffff;
    min-width: 60px;
}

/* スキルボタン */
.skill-btn {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #00ccff, #0088cc);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 5px 15px rgba(0, 204, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #555, #333);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.skill-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 204, 255, 0.6);
}

.skill-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 204, 255, 0.4);
}

.skill-btn.ready {
    animation: skillReady 0.6s infinite;
}

@keyframes skillReady {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 204, 255, 0.4);
    }
    50% {
        box-shadow: 0 5px 25px rgba(0, 255, 255, 0.8);
    }
}

/* ボタン内のヒントテキスト */
.key-hint {
    font-size: 12px;
    opacity: 0.7;
}

.action-text {
    font-size: 18px;
}

.attack-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* 難易度選択 */
.difficulty-selector {
    margin: 20px 0;
}

.difficulty-selector h3 {
    margin-bottom: 15px;
    color: #00ff88;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.difficulty-btn {
    padding: 15px 20px !important;
    font-size: 16px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #555, #333) !important;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.difficulty-btn.selected {
    opacity: 1;
    background: linear-gradient(135deg, #e94560, #c72e49) !important;
    transform: scale(1.05);
}

.difficulty-btn:hover {
    opacity: 1;
}

.diff-title {
    font-size: 18px;
    font-weight: bold;
}

.diff-desc {
    font-size: 12px;
    opacity: 0.8;
}

.subtitle {
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.main-btn {
    padding: 15px 50px !important;
    font-size: 24px !important;
}

/* リザルト表示 */
.results p {
    font-size: 18px;
    margin: 10px 0;
}

#achievements-display {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-height: 50px;
}

.achievement-item {
    padding: 8px;
    margin: 5px 0;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border-left: 3px solid #ffd700;
    border-radius: 5px;
    font-size: 14px;
}

/* アチーブメント通知 */
#achievement-notification {
    position: absolute;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
    border-radius: 10px;
    border: 2px solid #ffd700;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
    color: #000;
    font-weight: bold;
    font-size: 16px;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    pointer-events: none;
}

#achievement-notification.show {
    transform: translateX(0);
}
