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

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#game-container {
    position: relative;
    max-width: 800px;
    margin: 20px auto;
}

#gameCanvas {
    display: block;
    border: 4px solid #B57EDC;
    box-shadow: 0 0 30px rgba(181, 126, 220, 0.5);
    background: #1A1A2E;
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    display: none;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(26, 26, 46, 0.9);
    border-bottom: 2px solid #B57EDC;
}

#vibe-meter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#vibe-meter {
    width: 150px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #B57EDC;
    position: relative;
}

#vibe-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #B57EDC 0%, #00D9FF 100%);
    transition: width 0.3s ease;
}

#vibe-percent {
    font-size: 10px;
    color: #B57EDC;
}

.label {
    font-size: 8px;
    color: #888;
    margin-bottom: 2px;
}

#score-display, #level-display, #lives-display {
    text-align: center;
}

#score, #level {
    font-size: 18px;
    color: #00D9FF;
    text-shadow: 0 0 10px #00D9FF;
}

#lives {
    font-size: 16px;
}

#combo-display {
    position: absolute;
    top: 80px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(181, 126, 220, 0.9);
    border: 3px solid #fff;
    border-radius: 5px;
    font-size: 16px;
    animation: pulse 0.5s ease-in-out infinite;
}

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

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

/* Screen Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.screen.active {
    display: flex;
}

.screen-content {
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.title {
    font-size: 36px;
    margin-bottom: 20px;
    color: #B57EDC;
    text-shadow: 0 0 20px #B57EDC;
}

.title.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px #B57EDC, 0 0 40px #B57EDC; }
    50% { text-shadow: 0 0 30px #B57EDC, 0 0 60px #B57EDC, 0 0 80px #B57EDC; }
}

.subtitle {
    font-size: 12px;
    color: #00D9FF;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.menu-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 15px 30px;
    background: #B57EDC;
    color: #fff;
    border: 3px solid #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.menu-btn:hover {
    background: #00D9FF;
    transform: scale(1.05);
    box-shadow: 0 0 20px #00D9FF;
}

.tip {
    font-size: 8px;
    color: #888;
    margin-top: 20px;
}

/* How to Play */
.instructions {
    text-align: left;
    font-size: 10px;
    line-height: 1.8;
    margin: 20px 0;
}

.instructions p {
    margin: 10px 0;
}

.instructions strong {
    color: #00FF88;
}

/* High Scores */
#high-scores-list {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(181, 126, 220, 0.2);
    border: 1px solid #B57EDC;
}

.rank {
    color: #00D9FF;
    font-size: 12px;
    min-width: 30px;
}

.name {
    flex: 1;
    font-size: 10px;
}

.points {
    color: #00FF88;
    font-size: 12px;
}

.no-scores {
    font-size: 10px;
    color: #888;
    padding: 40px;
}

/* Game Over */
.game-over-text {
    color: #FF4444;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.final-stats {
    font-size: 10px;
    margin: 20px 0;
    line-height: 1.8;
}

.final-stats span {
    color: #00FF88;
}

.name-input-container {
    margin: 20px 0;
}

#player-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #B57EDC;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    width: 200px;
}

#player-name::placeholder {
    color: #666;
}

/* Loading Screen */
.loading-bar {
    width: 400px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #B57EDC;
    margin: 20px auto;
    position: relative;
}

#loading-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #B57EDC 0%, #00D9FF 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#loading-text {
    font-size: 10px;
    color: #888;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    text-align: center;
    font-size: 8px;
    color: #888;
    background: rgba(26, 26, 46, 0.8);
    border-top: 1px solid #B57EDC;
}

footer a {
    color: #B57EDC;
    text-decoration: none;
}

footer a:hover {
    color: #00D9FF;
}

.credits {
    margin-top: 5px;
    font-size: 7px;
}

/* Responsive Design */
@media (max-width: 850px) {
    #game-container {
        transform: scale(0.9);
    }
}

@media (max-width: 750px) {
    #game-container {
        transform: scale(0.8);
    }
    
    .title {
        font-size: 24px;
    }
    
    .menu-btn {
        font-size: 10px;
        padding: 10px 20px;
    }
}

@media (max-width: 650px) {
    #game-container {
        transform: scale(0.7);
    }
}