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

body {
    background: linear-gradient(180deg, #000428 0%, #004e92 100%);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

#gameWrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#gameContainer {
    position: relative;
    border: 3px solid #ff6b6b;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    background: #000;
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #4682B4 50%, #2F4F4F 100%);
    cursor: pointer;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#heightDisplay, #deathCounter, #bestHeightDisplay, #totalDeathsDisplay, #playTimeDisplay {
    position: absolute;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 100;
    background: rgba(0,0,0,0.3);
    padding: 5px 8px;
    border-radius: 4px;
}

#heightDisplay {
    top: 10px;
    left: 10px;
}

#deathCounter {
    top: 10px;
    right: 10px;
    color: #ff6b6b;
}

#bestHeightDisplay {
    top: 35px;
    left: 10px;
    color: #4ecdc4;
}

#totalDeathsDisplay {
    top: 35px;
    right: 10px;
    color: #ff9f43;
}

#playTimeDisplay {
    top: 60px;
    left: 10px;
    color: #a55eea;
}

#mockingText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff4444;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 200;
}

#mockingText.show {
    opacity: 1;
}

#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    background: rgba(0,0,0,0.8);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ff6b6b;
    pointer-events: auto;
}

#instructions h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 32px;
    text-shadow: 0 0 10px #ff6b6b;
}

#instructions p {
    margin: 10px 0;
    font-size: 16px;
}

#startBtn, #resetBtn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

#startBtn:hover, #resetBtn:hover {
    background: linear-gradient(45deg, #ee5a24, #ff6b6b);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

#startBtn:active, #resetBtn:active {
    transform: scale(0.95);
}

#resetBtn.danger-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    font-size: 14px;
    padding: 10px 20px;
}

#resetBtn.danger-btn:hover {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
}

#savedStats {
    margin: 15px 0;
    font-size: 14px;
    color: #bbb;
}

.hidden {
    display: none !important;
}

/* Rage effects */
.screen-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-2px, -1px) rotate(-1deg); }
    20% { transform: translate(-1px, 0px) rotate(1deg); }
    30% { transform: translate(1px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-1px, 1px) rotate(0deg); }
    70% { transform: translate(0px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
}

/* Death flash effect */
.death-flash {
    animation: flash 0.3s ease-in-out;
}

@keyframes flash {
    0% { background-color: transparent; }
    50% { background-color: rgba(255, 0, 0, 0.8); }
    100% { background-color: transparent; }
}

/* Golden message pulse effect */
@keyframes goldPulse {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        text-shadow: 0 0 20px #FFD700, 3px 3px 6px rgba(0,0,0,0.9);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1); 
        text-shadow: 0 0 30px #FFD700, 0 0 40px #FFA500, 3px 3px 6px rgba(0,0,0,0.9);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1); 
        text-shadow: 0 0 20px #FFD700, 3px 3px 6px rgba(0,0,0,0.9);
    }
}

/* Achievements Sidebar */
#achievementsSidebar {
    width: 300px;
    max-height: 600px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #ff6b6b;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.sidebar-header h3 {
    margin: 0;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.sidebar-content {
    padding: 15px;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.6);
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.8);
}

/* Achievement Items */
.achievement {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.achievement:hover {
    transform: translateX(3px);
    border-color: rgba(255, 107, 107, 0.6);
}

.achievement.unlocked {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.achievement.unlocked:hover {
    border-color: rgba(255, 215, 0, 0.8);
}

.achievement-icon {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.achievement-description {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.4;
}

.achievement.unlocked .achievement-name {
    color: #FFD700;
}

.achievement.unlocked .achievement-description {
    color: #FFF8DC;
}

/* Achievement notification animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
}

/* Troll image animation */
@keyframes trollPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}