* {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: transparent;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

@keyframes rewindBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes achievementSlide {
    0% { transform: translateY(-100%); opacity: 0; }
    10%, 90% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(0); opacity: 0; }
}

@keyframes achievementPushDown {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(100% + 10px)); }
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    100% { 
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

#rewind-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 32px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 2500;
    display: none;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(15, 20, 25, 0.8));
    padding: 25px 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

#rewind-dim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

#pause-dim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

#pause-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    z-index: 2500;
    display: none;
    pointer-events: all;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(15, 20, 25, 0.9));
    padding: 40px 50px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    min-width: 350px;
}

.pause-menu-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pause-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pause-menu-item {
    padding: 12px 20px;
    margin: 8px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.pause-menu-item:hover,
.pause-menu-item.selected {
    background: linear-gradient(135deg, rgba(64, 104, 176, 0.3), rgba(74, 114, 186, 0.3));
    border: 1px solid rgba(64, 104, 176, 0.5);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(64, 104, 176, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pause-menu-item:active {
    transform: translateX(5px) scale(0.96);
    transition: all 0.1s ease;
}

.pause-menu-item.danger {
    color: #ff6b6b;
}

.pause-menu-item.danger:hover,
.pause-menu-item.danger.selected {
    background: linear-gradient(135deg, rgba(205, 97, 97, 0.3), rgba(205, 69, 69, 0.3));
    border: 1px solid rgba(205, 97, 97, 0.5);
    box-shadow: 0 4px 15px rgba(205, 97, 97, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.confirmation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.confirmation-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #ff6b6b;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.confirmation-message {
    font-size: 16px;
    margin-bottom: 25px;
    text-align: center;
    color: #cccccc;
    line-height: 1.4;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
}

.confirmation-button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirmation-button.confirm {
    background: linear-gradient(135deg, #c55b5b, #b55252);
    color: white;
    border: 1px solid rgba(205, 97, 97, 0.5);
}

.confirmation-button.confirm:hover {
    background: linear-gradient(135deg, #b55252, #a44336);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(205, 97, 97, 0.3);
}

.confirmation-button.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirmation-button.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

#level-indicator {
    position: fixed;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(15, 20, 25, 0.75));
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

#level-indicator.hidden-during-idle {
    opacity: 0;
    transform: translateY(-10px);
}

#combined-hud.hidden-during-idle {
    opacity: 0;
    transform: translateY(10px);
}

#level-indicator .mission-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

#level-indicator .mission-progress {
    font-size: 13px;
    color: #ffc107;
    margin-bottom: 6px;
    font-weight: 500;
}

#level-indicator .mission-character {
    font-size: 14px;
    color: #64b5f6;
    margin-bottom: 4px;
    font-weight: 600;
}

#level-indicator .mission-backstory {
    font-size: 11px;
    color: #e0e0e0;
    line-height: 1.4;
    max-width: 200px;
    font-weight: 400;
}

#idle-fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

#achievement-notification-container {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 15000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-notification {
    background: linear-gradient(135deg, #6CAF70, #65a069);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 320px;
    height: 90px;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.achievement-notification .achievement-title {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.achievement-notification .achievement-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.3;
    max-width: 280px;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    pointer-events: none;
    backdrop-filter: blur(3px);
}

.loading-content {
    text-align: center;
    color: white;
}

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

@keyframes loadingSpinnerAnimation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.loading-subtitle {
    font-size: 16px;
    color: #e0e0e0;
    margin-top: 5px;
    display: none;
}

#combined-hud {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(15, 20, 25, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    color: white;
    z-index: 1000;
    pointer-events: none;
    min-width: 280px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    display: flex;
    gap: 20px;
    align-items: center;
}

#combined-hud.speed-glow-low {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                0 0 15px rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.3);
}

#combined-hud.speed-glow-medium {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                0 0 25px rgba(255, 235, 59, 0.5);
    border-color: rgba(255, 235, 59, 0.5);
}

#combined-hud.speed-glow-high {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                0 0 35px rgba(244, 67, 54, 0.7),
                0 0 50px rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.7);
}

#speedometer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

#speedometer .hud-label {
    font-size: 10px;
    color: #a0a0a0;
    margin-bottom: 6px;
    letter-spacing: 1.5px;
    font-weight: 500;
    text-transform: uppercase;
}

#speedometer .speed-value {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 2px;
    line-height: 1;
}

#speedometer .speed-unit {
    font-size: 8px;
    color: #888;
    letter-spacing: 1px;
    font-weight: 400;
    text-transform: uppercase;
}

#health-bar {
    display: flex;
    flex-direction: column;
    flex: 1.2;
}

#health-bar .hud-label {
    font-size: 10px;
    color: #a0a0a0;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
}

.health-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5a8b6a, #4a7f5a, #4a7357);
    border-radius: 11px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.health-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 40%, 
        rgba(255, 255, 255, 0.2) 60%, 
        transparent 100%);
    border-radius: 11px;
}

.health-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    z-index: 2;
    letter-spacing: 0.3px;
}

#combined-hud.hidden-during-idle {
    opacity: 0;
    transform: translateY(10px);
}

#combined-hud.hidden-during-rewind {
    opacity: 0;
    transform: translateY(10px);
}

#combined-hud.hidden-during-loading {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#level-indicator.hidden-during-rewind {
    opacity: 0;
    transform: translateY(-10px);
}

#level-indicator.hidden-during-loading {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#achievement-notification-container.hidden-during-loading {
    opacity: 0;
    pointer-events: none;
}

#combined-hud.hidden-during-pause {
    opacity: 0;
    transform: translateY(10px);
}

#level-indicator.hidden-during-pause {
    opacity: 0;
    transform: translateY(-10px);
}

#timer-overlay.hidden-during-pause {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

#music-ui.hidden-during-loading {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#combined-hud.hidden-during-initial-selection {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#level-indicator.hidden-during-initial-selection {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#achievement-notification-container.hidden-during-initial-selection {
    opacity: 0;
    pointer-events: none;
}

#music-ui.hidden-during-initial-selection {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#timer-overlay.hidden-during-initial-selection {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

#timer-overlay {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    z-index: 1000;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(15, 20, 25, 0.75));
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    text-align: center;
}

#timer-overlay.hidden-during-idle {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

#timer-overlay.hidden-during-loading {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

#timer-overlay.hidden-during-rewind {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.timer-display {
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease, transform 0.3s ease;
}

.timer-display.timer-normal {
    color: #ffffff;
}

.timer-display.timer-warning {
    color: #ff5722;
    animation: timerWarningPulse 1s ease-in-out infinite alternate;
}

.timer-display.timer-bonus {
    color: #4caf50;
    animation: timerBonusAnimation 0.8s ease-out;
}

.timer-display.timer-penalty {
    color: #f44336;
    animation: timerPenaltyAnimation 0.6s ease-out;
}

.timer-display.timer-grass {
    color: #ff9800;
    animation: timerGrassAnimation 0.5s ease-in-out;
}

@keyframes timerWarningPulse {
    0% { 
        opacity: 1;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    100% { 
        opacity: 0.7;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 87, 34, 0.4);
    }
}

@keyframes timerBonusAnimation {
    0% { 
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    25% { 
        transform: scale(1.2);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(76, 175, 80, 0.8);
    }
    50% { 
        transform: scale(1.1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(76, 175, 80, 1);
    }
    100% { 
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(76, 175, 80, 0.4);
    }
}

@keyframes timerPenaltyAnimation {
    0% { 
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    25% { 
        transform: scale(0.9) rotateX(10deg);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(244, 67, 54, 0.8);
    }
    50% { 
        transform: scale(0.95) rotateX(-5deg);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 67, 54, 1);
    }
    100% { 
        transform: scale(1) rotateX(0deg);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
}

@keyframes timerGrassAnimation {
    0% { 
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 152, 0, 0.6);
    }
    100% { 
        transform: scale(1);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
}

.timer-hint {
    font-size: 16px;
    color: #ffc107;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    max-width: 250px;
    line-height: 1.3;
}
