/* ========================================
   Idol Rhythm Game - スタイルシート
   ======================================== */

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
    color: white;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ========================================
   画面共通スタイル
   ======================================== */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.screen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.screen-header h2 {
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ========================================
   ボタン共通スタイル
   ======================================== */
.menu-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    padding: 15px 50px;
    margin: 10px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
    text-transform: uppercase;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.6);
}

.menu-btn:active {
    transform: translateY(0);
}

.back-btn {
    font-size: 1rem;
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* ========================================
   タイトル画面
   ======================================== */
#title-screen {
    background: 
        radial-gradient(ellipse at center, rgba(255, 107, 157, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.title-container {
    text-align: center;
    z-index: 2;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    background: linear-gradient(135deg, #ff6b9d, #ffd93d, #6bcbff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: titleGlow 2s ease-in-out infinite alternate;
    margin-bottom: 10px;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.5));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.8));
    }
}

.title-star {
    display: inline-block;
    animation: starSpin 3s linear infinite;
}

@keyframes starSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.idol-silhouettes {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
}

.idol-silhouette {
    width: 80px;
    height: 120px;
    background: linear-gradient(to top, rgba(255, 107, 157, 0.3), transparent);
    border-radius: 40px 40px 20px 20px;
    animation: idolBounce 1s ease-in-out infinite;
}

.idol-silhouette:nth-child(2) {
    animation-delay: 0.2s;
}

.idol-silhouette:nth-child(3) {
    animation-delay: 0.4s;
}

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

.floating-notes {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.float-note {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 107, 157, 0.5);
    animation: floatUp 4s ease-in-out infinite;
}

.float-note:nth-child(1) { left: 10%; animation-delay: 0s; }
.float-note:nth-child(2) { left: 30%; animation-delay: 1s; }
.float-note:nth-child(3) { left: 60%; animation-delay: 2s; }
.float-note:nth-child(4) { left: 85%; animation-delay: 3s; }

@keyframes floatUp {
    0% {
        bottom: -50px;
        opacity: 0;
        transform: rotate(0deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: rotate(360deg);
    }
}

/* ========================================
   楽曲選択画面
   ======================================== */
.song-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 80px 20px 20px;
    max-height: 100vh;
    overflow-y: auto;
    width: 100%;
    max-width: 600px;
}

.song-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.song-card:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(255, 107, 157, 0.1));
    border-color: #ff6b9d;
    transform: translateX(10px);
}

.song-jacket {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.song-info {
    flex: 1;
}

.song-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.song-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.song-bpm {
    font-size: 0.8rem;
    color: rgba(255, 217, 61, 0.8);
    margin-top: 5px;
}

/* ========================================
   難易度選択画面
   ======================================== */
.selected-song-info {
    margin-bottom: 30px;
    text-align: center;
}

.selected-song-info h3 {
    font-size: 1.5rem;
    color: #ffd93d;
}

.difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border: 2px solid;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn.easy {
    border-color: #4ade80;
}

.difficulty-btn.easy:hover {
    background: rgba(74, 222, 128, 0.2);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.difficulty-btn.normal {
    border-color: #60a5fa;
}

.difficulty-btn.normal:hover {
    background: rgba(96, 165, 250, 0.2);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

.difficulty-btn.hard {
    border-color: #fbbf24;
}

.difficulty-btn.hard:hover {
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.difficulty-btn.expert {
    border-color: #f472b6;
}

.difficulty-btn.expert:hover {
    background: rgba(244, 114, 182, 0.2);
    box-shadow: 0 0 20px rgba(244, 114, 182, 0.4);
}

.diff-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
}

.diff-stars {
    color: #ffd93d;
}

.diff-level {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ========================================
   ゲーム画面
   ======================================== */
#game-screen {
    background: #0a0a15;
}

.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
}

.score-display, .life-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.score-display .label, .life-display .label, .combo-display .label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-display .value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #ffd93d;
}

.combo-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.combo-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #ff6b9d;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.8);
    transition: transform 0.1s ease;
}

.combo-value.pulse {
    transform: scale(1.2);
}

.life-bar {
    width: 150px;
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.life-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.life-fill.warning {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.life-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ゲームエリア */
.game-area {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stage-bg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(255, 107, 157, 0.1), transparent);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 50px;
    padding-bottom: 20px;
}

.stage-idol {
    width: 60px;
    height: 100px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border-radius: 30px 30px 15px 15px;
    animation: idolDance 0.5s ease-in-out infinite alternate;
}

.stage-idol:nth-child(2) {
    animation-delay: 0.1s;
    height: 110px;
}

.stage-idol:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes idolDance {
    from { transform: translateY(0) rotate(-2deg); }
    to { transform: translateY(-5px) rotate(2deg); }
}

/* ノートフィールド（円形配置） */
.note-field {
    position: relative;
    width: min(90vw, 90vh, 500px);
    height: min(90vw, 90vh, 500px);
    max-width: 600px;
    max-height: 600px;
}

/* 判定サークル（9個を半円形に配置） */
.judge-circle {
    position: absolute;
    width: clamp(45px, 8vw, 70px);
    height: clamp(45px, 8vw, 70px);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.judge-circle.active {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.3);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
}

/* 9つの判定サークルの位置（半円形配置） */
.judge-circle[data-lane="0"] { left: 0%; top: 70%; }
.judge-circle[data-lane="1"] { left: 5%; top: 45%; }
.judge-circle[data-lane="2"] { left: 15%; top: 22%; }
.judge-circle[data-lane="3"] { left: 32%; top: 5%; }
.judge-circle[data-lane="4"] { left: 50%; top: 0%; transform: translateX(-50%); }
.judge-circle[data-lane="5"] { right: 32%; top: 5%; }
.judge-circle[data-lane="6"] { right: 15%; top: 22%; }
.judge-circle[data-lane="7"] { right: 5%; top: 45%; }
.judge-circle[data-lane="8"] { right: 0%; top: 70%; }

/* ノーツ */
.note {
    position: absolute;
    width: clamp(35px, 7vw, 55px);
    height: clamp(35px, 7vw, 55px);
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2vw, 1.5rem);
    transition: transform 0.05s linear;
    z-index: 5;
    pointer-events: none;
}

.note.long {
    background: linear-gradient(135deg, #ffd93d, #f59e0b);
    box-shadow: 0 0 15px rgba(255, 217, 61, 0.6);
}

.note.flick {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.6);
}

.note.hit {
    animation: noteHit 0.2s ease-out forwards;
}

@keyframes noteHit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* 判定表示 */
.judge-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    z-index: 20;
}

.judge-text {
    animation: judgeAppear 0.5s ease-out forwards;
}

.judge-text.perfect {
    color: #ffd93d;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.8);
}

.judge-text.great {
    color: #ff6b9d;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.8);
}

.judge-text.good {
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
}

.judge-text.bad {
    color: #60a5fa;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.8);
}

.judge-text.miss {
    color: #9ca3af;
    text-shadow: 0 0 20px rgba(156, 163, 175, 0.8);
}

@keyframes judgeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    30% {
        opacity: 1;
        transform: scale(1.2) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(1) translateY(-30px);
    }
}

/* 進行バー */
.progress-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #ffd93d);
    border-radius: 5px;
    transition: width 0.1s linear;
}

/* 一時停止ボタン */
.pause-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   一時停止画面
   ======================================== */
.pause-menu {
    text-align: center;
}

.pause-menu h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #ff6b9d;
}

/* ========================================
   リザルト画面
   ======================================== */
.result-container {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 90%;
}

.result-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #ffd93d;
    margin-bottom: 20px;
}

.result-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 6rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd93d, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rankPulse 1s ease-in-out infinite alternate;
}

@keyframes rankPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.result-score {
    margin: 20px 0;
}

.result-score .label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.result-score .value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #ffd93d;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
}

.stat-value.perfect { color: #ffd93d; }
.stat-value.great { color: #ff6b9d; }
.stat-value.good { color: #4ade80; }
.stat-value.bad { color: #60a5fa; }
.stat-value.miss { color: #9ca3af; }

.result-combo {
    margin: 20px 0;
}

.result-combo .label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.result-combo .value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #ff6b9d;
}

.result-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ========================================
   レスポンシブ対応 - 全画面サイズ対応
   ======================================== */

/* 大画面 (デスクトップ) */
@media (min-width: 1200px) {
    .game-title {
        font-size: 4rem;
    }
    
    .note-field {
        width: min(80vh, 600px);
        height: min(80vh, 600px);
    }
    
    .judge-circle {
        width: 70px;
        height: 70px;
        border-width: 4px;
    }
    
    .note {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .combo-value {
        font-size: 3.5rem;
    }
    
    .score-display .value {
        font-size: 2.2rem;
    }
    
    .judge-text {
        font-size: 2.5rem;
    }
}

/* 中画面 (タブレット横向き) */
@media (max-width: 1199px) and (min-width: 769px) {
    .game-title {
        font-size: 3rem;
    }
    
    .note-field {
        width: min(70vh, 450px);
        height: min(70vh, 450px);
    }
    
    .judge-circle {
        width: 55px;
        height: 55px;
    }
    
    .note {
        width: 45px;
        height: 45px;
    }
}

/* タブレット (縦向き) */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .note-field {
        width: min(85vw, 75vh, 400px);
        height: min(85vw, 75vh, 400px);
    }
    
    .menu-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .difficulty-list {
        padding: 0 15px;
        width: 100%;
    }
    
    .difficulty-btn {
        padding: 15px 20px;
    }
    
    .game-header {
        padding: 10px 20px;
    }
    
    .score-display .value {
        font-size: 1.5rem;
    }
    
    .combo-value {
        font-size: 2.2rem;
    }
    
    .life-bar {
        width: 120px;
    }
    
    .stage-bg {
        display: none; /* 小さい画面ではアイドル非表示 */
    }
}

/* スマートフォン (横向き) */
@media (max-height: 500px) and (orientation: landscape) {
    .game-header {
        padding: 5px 15px;
    }
    
    .note-field {
        width: min(80vh, 350px);
        height: min(80vh, 350px);
    }
    
    .score-display .value {
        font-size: 1.2rem;
    }
    
    .combo-value {
        font-size: 1.8rem;
    }
    
    .life-bar {
        width: 80px;
        height: 10px;
    }
    
    .progress-bar {
        bottom: 10px;
        height: 4px;
    }
    
    .pause-btn {
        width: 35px;
        height: 35px;
        top: 5px;
        right: 10px;
    }
    
    .stage-bg {
        display: none;
    }
    
    .countdown {
        font-size: 5rem;
    }
}

/* スマートフォン (縦向き) */
@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .title-star {
        font-size: 0.8em;
    }
    
    .idol-silhouettes {
        gap: 20px;
        margin: 25px 0;
    }
    
    .idol-silhouette {
        width: 50px;
        height: 80px;
    }
    
    .note-field {
        width: min(90vw, 65vh, 320px);
        height: min(90vw, 65vh, 320px);
    }
    
    .menu-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
    
    .game-header {
        padding: 8px 12px;
        flex-wrap: nowrap;
    }
    
    .score-display .label,
    .life-display .label,
    .combo-display .label {
        font-size: 0.6rem;
    }
    
    .score-display .value {
        font-size: 1.2rem;
    }
    
    .combo-value {
        font-size: 1.8rem;
    }
    
    .life-bar {
        width: 80px;
        height: 12px;
    }
    
    .judge-text {
        font-size: 1.5rem;
    }
    
    .progress-bar {
        width: 90%;
        bottom: 15px;
    }
    
    .pause-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .countdown {
        font-size: 6rem;
    }
    
    .song-card {
        padding: 15px;
        gap: 15px;
    }
    
    .song-jacket {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .song-title {
        font-size: 1.1rem;
    }
    
    .result-container {
        padding: 25px 20px;
        width: 95%;
    }
    
    .result-rank {
        font-size: 4.5rem;
    }
    
    .result-score .value {
        font-size: 2rem;
    }
    
    .result-stats {
        gap: 12px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* 非常に小さい画面 */
@media (max-width: 360px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .note-field {
        width: min(92vw, 60vh, 280px);
        height: min(92vw, 60vh, 280px);
    }
    
    .menu-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .difficulty-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* ========================================
   タッチデバイス用スタイル
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    .judge-circle {
        -webkit-tap-highlight-color: transparent;
        /* タッチエリアを広げる */
        padding: 5px;
        margin: -5px;
    }
    
    .judge-circle:active,
    .judge-circle.active {
        border-color: #ff6b9d;
        background: rgba(255, 107, 157, 0.4);
        box-shadow: 0 0 30px rgba(255, 107, 157, 0.8);
        transform: scale(1.1);
    }
    
    .menu-btn:active {
        transform: scale(0.95);
    }
    
    .song-card:active {
        background: linear-gradient(135deg, rgba(255, 107, 157, 0.4), rgba(255, 107, 157, 0.2));
        transform: scale(0.98);
    }
    
    .difficulty-btn:active {
        transform: scale(0.97);
    }
}

/* ホバーが使えるデバイス */
@media (hover: hover) {
    .judge-circle:hover {
        border-color: rgba(255, 255, 255, 0.8);
        background: rgba(255, 255, 255, 0.2);
    }
}

/* セーフエリア対応 (ノッチ付きデバイス) */
@supports (padding: max(0px)) {
    .game-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .progress-bar {
        bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .screen-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
}

/* ========================================
   カウントダウン
   ======================================== */
.countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 8rem;
    color: #ff6b9d;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.8);
    z-index: 50;
    animation: countdownPulse 1s ease-out forwards;
}

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

/* ローディング */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 107, 157, 0.3);
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}
