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

/* Hardcore 2 Dark Overlay */
.hardcore2-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: multiply;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    color: #e0e0e0;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}


/* Page Transition Effects */
body.page-loaded {
    opacity: 1;
}

body.page-exit {
    opacity: 0;
}

.game-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 14px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateX(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.game-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
    pointer-events: none;
}

.ui-left,
.ui-center,
.ui-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.ui-center {
    align-items: center;
}

#score,
#highScore,
#level,
#lives {
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

#highScore {
    color: #ffc107;
    font-size: 16px;
}

#level {
    font-size: 20px;
    color: #4a9eff;
}

#lives {
    font-size: 18px;
    color: #ff4d4d;
}

.combo-display {
    color: #ffc107;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px #ffc107;
    animation: pulse 0.3s ease-out;
}

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

.power-up-display {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
}

#powerUpText {
    display: block;
    color: #ffc107;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.power-up-timer {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.power-up-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #ff9800);
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #ffc107;
}

.ui-button {
    padding: 10px 20px;
    background: rgba(74, 158, 255, 0.2);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 8px;
    color: #4a9eff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.ui-button:hover {
    background: rgba(74, 158, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.game-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 24px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-instructions p {
    margin: 0;
}

#gameCanvas {
    display: block;
    background: #000;
    width: 100vw;
    height: 100vh;
}

.game-over-screen,
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.game-over-content,
.pause-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease-out;
}

.game-over-content h2,
.pause-content h2 {
    font-size: 48px;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.pause-content h2 {
    font-size: 36px;
    color: #4a9eff;
}

.final-score {
    font-size: 24px;
    color: #4a9eff;
    margin: 15px 0;
}

.final-score span {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
}

.high-score-text {
    font-size: 18px;
    color: #ffc107;
    margin: 10px 0;
}

.high-score-text span {
    font-size: 24px;
    font-weight: bold;
}

.level-reached {
    font-size: 18px;
    color: #4a9eff;
    margin: 10px 0;
}

.level-reached span {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.restart-button {
    margin-top: 30px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.restart-button:hover {
    background: linear-gradient(135deg, #5ba8ff 0%, #3574f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.6);
}

.restart-button:active {
    transform: translateY(0);
}

.boss-warning {
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 77, 77, 0.3);
    border: 2px solid rgba(255, 77, 77, 0.6);
    border-radius: 12px;
    text-align: center;
    animation: warningPulse 0.5s ease-in-out infinite;
}

.boss-warning-text {
    color: #ff4d4d;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px #ff4d4d;
    animation: shake 0.1s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 77, 77, 0.8);
    }
}

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

.level-complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.level-complete-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease-out;
}

.level-complete-content h2 {
    font-size: 48px;
    color: #4a9eff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.level-complete-content p {
    font-size: 24px;
    color: #ffc107;
    margin: 10px 0;
}

.level-complete-content span {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
}

.asteroids-destroyed {
    font-size: 18px;
    color: #51cf66;
    margin: 10px 0;
}

.asteroids-destroyed span {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.sound-btn {
    margin-top: 10px;
}

.kill-streak {
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(255, 77, 77, 0.3);
    border: 2px solid rgba(255, 77, 77, 0.6);
    border-radius: 12px;
    text-align: center;
    animation: pulse 0.5s ease-out;
}

#killStreakText {
    color: #ff4d4d;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px #ff4d4d;
    display: block;
}

.pause-content p {
    color: #b0b0b0;
    font-size: 18px;
    margin-top: 10px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 50%, #e0e7ff 100%);
    }

    .back-button {
        background: rgba(0, 0, 0, 0.1);
        color: #2d3748;
        border: 1px solid rgba(0, 0, 0, 0.2);
    }

    .back-button:hover {
        background: rgba(0, 0, 0, 0.15);
        color: #1a202c;
    }

    .ui-left,
    .ui-center,
    .ui-right,
    .game-instructions {
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid rgba(0, 0, 0, 0.2);
    }

    #score,
    #highScore,
    #level,
    #lives {
        color: #1a202c;
    }

    .game-over-content,
    .pause-content {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(0, 0, 0, 0.2);
    }

    .game-over-content h2 {
        color: #1a202c;
    }
}

@media (max-width: 900px) {
    .game-ui {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 0 10px;
    }

    .ui-left,
    .ui-center,
    .ui-right {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 15px;
    }

    #score,
    #highScore,
    #level,
    #lives {
        font-size: 14px;
    }

    .game-instructions {
        font-size: 12px;
        padding: 10px 15px;
        bottom: 10px;
    }

    .game-over-content,
    .pause-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .game-over-content h2 {
        font-size: 36px;
    }
}

/* Mode Selection Screen */
.mode-selection-screen {
    position: fixed;
    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;
    backdrop-filter: blur(10px);
}

.mode-selection-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 50px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 900px;
    width: 90%;
}

.mode-selection-content h1 {
    font-size: 48px;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mode-selection-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #b0b0b0;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.mode-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-align: center;
}

.mode-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.mode-name {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.4;
}

/* Leaderboard Screen */
.leaderboard-screen {
    position: fixed;
    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;
    backdrop-filter: blur(10px);
}

.leaderboard-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: rgba(74, 158, 255, 0.3);
    border-color: rgba(74, 158, 255, 0.5);
    color: #fff;
}

.leaderboard-list {
    margin-bottom: 20px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: bold;
    color: #4a9eff;
    min-width: 50px;
    text-align: center;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-score {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.leaderboard-details {
    font-size: 12px;
    color: #b0b0b0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.leaderboard-mode {
    color: #4a9eff;
    font-weight: bold;
}

.leaderboard-date {
    font-size: 12px;
    color: #888;
}

/* Achievements Screen */
.achievements-screen {
    position: fixed;
    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;
    backdrop-filter: blur(10px);
}

.achievements-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.achievements-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.achievements-list {
    margin-bottom: 20px;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
}

.achievement-item.locked {
    opacity: 0.6;
}

.achievement-icon {
    font-size: 32px;
    min-width: 40px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 14px;
    color: #b0b0b0;
}

.achievement-badge {
    color: #51cf66;
    font-size: 24px;
}

/* New Achievements Display */
.new-achievements {
    margin: 20px 0;
    padding: 20px;
    background: rgba(74, 158, 255, 0.2);
    border-radius: 12px;
    border: 2px solid rgba(74, 158, 255, 0.4);
}

.new-achievements h3 {
    color: #4a9eff;
    margin-bottom: 10px;
    font-size: 20px;
}

.new-achievement-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}
