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

body {
    font-family: 'Noto Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
    user-select: none;
}

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

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Main Menu */
#main-menu {
    justify-content: center;
    align-items: center;
}

.menu-bg {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
}

.character-showcase {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-character {
    max-width: 400px;
    max-height: 80vh;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
    animation: float 3s ease-in-out infinite;
}

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

.menu-content {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.game-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4d9de0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.menu-btn.primary {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border-color: transparent;
    color: #333;
}

.menu-btn.primary:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Song Selection */
.screen-header {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: background 0.3s ease;
}

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

.screen-header h2 {
    margin-left: 2rem;
    font-size: 1.8rem;
}

.song-list {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.song-item {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.song-item.selected {
    border-color: #ffd93d;
    background: rgba(255, 217, 61, 0.1);
}

.song-cover {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff6b6b, #4d9de0);
    border-radius: 10px;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.song-info {
    flex: 1;
}

.song-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.song-info p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.difficulty-select {
    display: flex;
    gap: 0.5rem;
}

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

.diff-btn.active {
    background: #ffd93d;
    color: #333;
    border-color: #ffd93d;
}

.play-selected-btn {
    margin: 2rem;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border: none;
    color: #333;
    padding: 1rem 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-selected-btn:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Game Screen */
#game-screen {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.game-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

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

#score {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd93d;
}

#combo {
    font-size: 1.2rem;
    opacity: 0.8;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 2rem;
    overflow: hidden;
    transition: box-shadow 0.1s ease;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffd93d);
    width: 0%;
    transition: width 0.1s ease;
}

.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: background 0.1s ease;
}

.note-lanes {
    display: flex;
    height: 100%;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 100px;
}

.lane {
    width: 120px;
    height: 100%;
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    margin: 0 2px;
}

.lane:last-child {
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.lane-target {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.3), rgba(255, 217, 61, 0.3));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
}

.note {
    position: absolute;
    width: 100px;
    height: 20px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border-radius: 10px;
    margin: 0 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
    animation: noteGlow 0.5s ease-in-out infinite alternate;
}

@keyframes noteGlow {
    0% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 217, 61, 0.6);
    }
}

.note.hit {
    transform: scale(1.2);
    opacity: 0;
    animation: noteHit 0.3s ease-out;
}

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

.game-controls {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
}

.control-btn {
    width: 120px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.3), rgba(255, 217, 61, 0.3));
    opacity: 0;
    transition: opacity 0.15s ease;
    border-radius: 8px;
}

.control-btn.rhythm-pulse::before {
    opacity: 1;
    animation: rhythmPulse 0.3s ease-out;
}

@keyframes rhythmPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.control-btn.rhythm-glow {
    box-shadow: 0 0 20px rgba(255, 217, 61, 0.6);
    border-color: rgba(255, 217, 61, 0.8);
}

.control-btn.rhythm-sync {
    animation: rhythmSync 0.6s ease-in-out;
    border-color: rgba(255, 217, 61, 0.9);
    box-shadow: 0 0 25px rgba(255, 217, 61, 0.8);
}

@keyframes rhythmSync {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
    25% {
        transform: scale(1.05);
        background: rgba(255, 217, 61, 0.2);
    }
    50% {
        transform: scale(1.1);
        background: rgba(255, 217, 61, 0.3);
    }
    75% {
        transform: scale(1.05);
        background: rgba(255, 217, 61, 0.2);
    }
    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
}

.control-btn.beat-emphasis {
    animation: beatEmphasis 0.4s ease-out;
    border-color: rgba(255, 107, 107, 0.8);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.7);
}

@keyframes beatEmphasis {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.15);
        background: rgba(255, 107, 107, 0.4);
    }
    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
}

.control-btn:active,
.control-btn.pressed {
    background: rgba(255, 217, 61, 0.8);
    border-color: #ffd93d;
    color: #333;
    transform: scale(0.95);
}

.judgment-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.judgment-text {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.judgment-text.show {
    opacity: 1;
    transform: scale(1);
}

.judgment-text.perfect { color: #ffd93d; }
.judgment-text.great { color: #6bcf7f; }
.judgment-text.good { color: #4d9de0; }
.judgment-text.miss { color: #ff6b6b; }

/* Results Screen */
#results-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.results-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.results-content h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd93d;
}

.results-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-bg {
        flex-direction: column;
        padding: 2rem;
    }
    
    .main-character {
        max-width: 250px;
        margin-bottom: 2rem;
    }
    
    .lane {
        width: 60px;
    }
    
    .control-btn {
        width: 60px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .results-buttons {
        flex-direction: column;
    }
}