html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background-color: #111;
    font-family: 'Saira', -apple-system, system-ui, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-overflow-scrolling: none;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    image-rendering: pixelated;
    /* GPU acceleration for smoother rendering on mobile */
    will-change: transform;
    transform: translateZ(0);
}

/* Desktop: center the PIXI canvas within the container */
#game-canvas.desktop-centered {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

canvas, #game-canvas {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    outline: none;
}

#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#weapons-display {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.weapon-tag {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    color: #ffcc00;
    padding: 5px 10px;
    border: 2px solid #ffcc00;
    border-radius: 4px;
    font-family: 'Rajdhani', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 2px 2px 0 #000;
    overflow: hidden;
}

.weapon-tag.cannot-fire {
    color: #ff0000;
    border-color: #ff0000;
}

.weapon-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(0, 255, 0, 0.3);
    transition: width 0.1s linear, background-color 0.1s linear;
    z-index: 0;
    pointer-events: none;
}

.weapon-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

#currency-display {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #00ff00;
    font-weight: 700;
    text-shadow: 3px 3px 0 #000;
    font-size: 1.5rem;
    font-family: 'Rajdhani', monospace;
}

#perf-stats {
    position: absolute;
    bottom: 15px;
    left: 15px;
    color: #00ff00;
    font-weight: 600;
    text-shadow: 2px 2px 0 #000;
    font-size: 0.8rem;
    font-family: 'Rajdhani', monospace;
    display: none; /* Hidden by default */
}

#tutorial-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    text-shadow: 3px 3px 0 #000;
    animation: pulse 1.5s infinite;
    pointer-events: none;
    white-space: nowrap;
    /* GPU acceleration for animation */
    will-change: transform, opacity;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.95) translateZ(0); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) translateZ(0); }
    100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.95) translateZ(0); }
}

/* Mobile Swipe Tutorial */
#mobile-swipe-tutorial {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden by default, shown via JS on mobile */
    flex-direction: row;
    align-items: center;
    gap: 20px;
    pointer-events: none;
    z-index: 100;
    animation: swipeTutorialFadeIn 0.5s ease-in-out;
}

#mobile-swipe-tutorial.hide {
    animation: swipeTutorialFadeOut 0.5s ease-in-out forwards;
}

.swipe-tutorial-text {
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #000, 0 0 10px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.swipe-tutorial-arrow {
    color: #00ff00;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 3px 3px 0 #000, 0 0 15px rgba(0, 255, 0, 0.8);
    animation: arrowBounce 1s ease-in-out infinite;
}

.swipe-arrow-left {
    animation-name: arrowBounceLeft;
}

.swipe-arrow-right {
    animation-name: arrowBounceRight;
}

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

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

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

@keyframes arrowBounceRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* Responsive sizing for smaller screens */
@media (max-width: 480px) {
    .swipe-tutorial-text {
        font-size: 1.4rem;
    }
    .swipe-tutorial-arrow {
        font-size: 2rem;
    }
    #mobile-swipe-tutorial {
        gap: 15px;
    }
}

#perk-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 20;
}

.perk-card {
    background: #333;
    width: 85%;
    max-width: 350px;
    padding: 15px;
    margin: 10px 0;
    border: 4px solid #fff;
    box-shadow: 5px 5px 0 #000;
    color: white;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.perk-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 #000;
}

.perk-card:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

/* Rarity-based styles */
.perk-rarity-common {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
    border-color: #CCCCCC;
}

.perk-rarity-uncommon {
    background: linear-gradient(135deg, #1a2f1a 0%, #2d4a2d 100%);
    border-color: #5FD35F;
    box-shadow: 5px 5px 0 #000, 0 0 10px rgba(95, 211, 95, 0.3);
}

.perk-rarity-uncommon:hover {
    box-shadow: 7px 7px 0 #000, 0 0 15px rgba(95, 211, 95, 0.5);
}

.perk-rarity-rare {
    background: linear-gradient(135deg, #1a2640 0%, #2d3d5a 100%);
    border-color: #4A9EFF;
    box-shadow: 5px 5px 0 #000, 0 0 10px rgba(74, 158, 255, 0.3);
}

.perk-rarity-rare:hover {
    box-shadow: 7px 7px 0 #000, 0 0 15px rgba(74, 158, 255, 0.5);
}

.perk-rarity-mythic {
    background: linear-gradient(135deg, #3d1f00 0%, #5a3000 100%);
    border-color: #FF6B00;
    box-shadow: 5px 5px 0 #000, 0 0 15px rgba(255, 107, 0, 0.4);
    animation: mythicPulse 2s infinite;
}

.perk-rarity-mythic:hover {
    box-shadow: 7px 7px 0 #000, 0 0 20px rgba(255, 107, 0, 0.6);
}

@keyframes mythicPulse {
    0%, 100% {
        box-shadow: 5px 5px 0 #000, 0 0 15px rgba(255, 107, 0, 0.4);
    }
    50% {
        box-shadow: 5px 5px 0 #000, 0 0 25px rgba(255, 107, 0, 0.6), 0 0 35px rgba(255, 107, 0, 0.3);
    }
}

.perk-type-weapon { border-color: #ffcc00; }
.perk-type-stat { border-color: #00ccff; }

.perk-title {
    font-size: 1.3rem;
    font-weight: 400;
    display: block;
    margin-bottom: 5px;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.perk-desc {
    font-size: 0.9rem;
    color: #ddd;
    font-family: 'Saira', sans-serif;
}

/* Reroll button */
.perk-reroll-button {
    background: linear-gradient(135deg, #6B46C1 0%, #553C9A 100%);
    color: white;
    border: 3px solid #9F7AEA;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Rajdhani', monospace;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 4px 4px 0 #000, 0 0 10px rgba(159, 122, 234, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.perk-reroll-button:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000, 0 0 15px rgba(159, 122, 234, 0.5);
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
}

.perk-reroll-button:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.perk-reroll-button:disabled {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
    border-color: #718096;
    color: #A0AEC0;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: 4px 4px 0 #000;
}

.btn-main {
    background: linear-gradient(135deg, #ff4444 0%, #ff0000 100%);
    color: white;
    border: 4px solid white;
    padding: 15px 40px;
    font-size: 1.8rem;
    font-weight: 400;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 5px 5px 0 #000, 0 0 20px rgba(255, 68, 68, 0.5);
    text-transform: uppercase;
    transition: all 0.3s ease;
    animation: buttonGlow 2s infinite;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-main::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 5px 5px 0 #000, 0 0 20px rgba(255, 68, 68, 0.5);
    }
    50% {
        box-shadow: 5px 5px 0 #000, 0 0 30px rgba(255, 68, 68, 0.8), 0 0 40px rgba(255, 0, 0, 0.4);
    }
}

@keyframes buttonShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50%, 100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.btn-main:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-secondary {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: 4px solid #ffcc00;
    padding: 12px 35px;
    font-size: 1.4rem;
    font-weight: 400;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px;
    margin-top: 15px;
    cursor: pointer;
    box-shadow: 5px 5px 0 #000, 0 0 15px rgba(255, 204, 0, 0.3);
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 204, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-secondary:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-secondary:disabled {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
    border-color: #718096;
    color: #A0AEC0;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: 4px 4px 0 #000;
}

.btn-secondary:disabled::before {
    display: none;
}

/* ========== SIMPLE TITLE SCREEN ========== */

#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto;
    z-index: 30;
    overflow: hidden;
    transition: opacity 0.5s ease-out;
    cursor: pointer;
}

#title-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

.title-logo-image {
    width: min(80vw, 400px);
    max-width: 400px;
    height: auto;
    image-rendering: pixelated;
    -webkit-animation: logoDropIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation: logoDropIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

@-webkit-keyframes logoDropIn {
    0% {
        -webkit-transform: translateY(-500px);
        transform: translateY(-500px);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    70% {
        -webkit-transform: translateY(-15px);
        transform: translateY(-15px);
    }
    85% {
        -webkit-transform: translateY(5px);
        transform: translateY(5px);
    }
    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes logoDropIn {
    0% {
        -webkit-transform: translateY(-500px);
        transform: translateY(-500px);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    70% {
        -webkit-transform: translateY(-15px);
        transform: translateY(-15px);
    }
    85% {
        -webkit-transform: translateY(5px);
        transform: translateY(5px);
    }
    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

.title-tap-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    opacity: 0;
    -webkit-animation: tapFadeIn 0.5s ease-out 0.9s forwards, tapPulse 1.5s infinite ease-in-out 1.4s;
    animation: tapFadeIn 0.5s ease-out 0.9s forwards, tapPulse 1.5s infinite ease-in-out 1.4s;
}

@-webkit-keyframes tapFadeIn {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes tapFadeIn {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@-webkit-keyframes tapPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes tapPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.title-armory-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #000000;
    border: 2px solid #44ff44;
    color: #44ff44;
    font-family: 'Rajdhani', monospace;
    font-weight: 600;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 100;
    pointer-events: auto;
    transition: all 0.2s ease;
}

.title-armory-btn:hover {
    background: #44ff44;
    color: #000000;
}

.title-armory-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* ========== WASTED SLAM ANIMATION ========== */

#wasted-slam {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 30;
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: 40px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#wasted-slam.show-stats {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    pointer-events: auto;
    touch-action: pan-y !important;
}

#wasted-slam.show-stats .wasted-slam-text {
    display: none;
}

#wasted-slam.show-stats .wasted-slam-impact {
    display: none;
}

#wasted-slam.active {
    display: flex;
    animation: wastedBackgroundFade 0.3s ease-out forwards;
}

@keyframes wastedBackgroundFade {
    0% {
        background: rgba(0, 0, 0, 0);
    }
    100% {
        background: rgba(139, 0, 0, 0.85); /* Dark red overlay */
    }
}

.wasted-slam-text {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 10rem;
    font-weight: 900;
    color: #ff0000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow:
        0 0 20px #ff0000,
        0 0 40px #ff0000,
        0 0 60px #ff0000,
        0 0 80px #ff0000,
        8px 8px 0 #000,
        -8px -8px 0 #000,
        8px -8px 0 #000,
        -8px 8px 0 #000;
    letter-spacing: 0.2em;
    text-align: center;
    width: auto;
    max-width: 100%;
    align-self: center;
    transform: scale(0);
    opacity: 0;
    z-index: 2;
}

#wasted-slam.active .wasted-slam-text {
    animation: wastedSlam 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wastedSlam {
    0% {
        transform: scale(0) rotate(-5deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.3) rotate(2deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.95) rotate(-1deg);
        opacity: 1;
    }
    60% {
        transform: scale(1.05) rotate(0.5deg);
        opacity: 1;
    }
    70% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Keep WASTED text centered */
@keyframes wastedMoveToTop {
    0% {
        transform: scale(1) translateY(0);
        font-size: 10rem;
    }
    100% {
        transform: scale(1) translateY(0);
        font-size: 10rem;
    }
}

#wasted-slam.move-to-top .wasted-slam-text {
    animation: wastedMoveToTop 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.wasted-slam-impact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.8) 0%, rgba(255, 0, 0, 0) 70%);
    opacity: 0;
    z-index: 1;
}

#wasted-slam.active .wasted-slam-impact {
    animation: wastedImpact 1s ease-out forwards;
}

@keyframes wastedImpact {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    30% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(25);
        opacity: 0;
    }
}

/* Screen shake during slam */
#wasted-slam.active {
    animation:
        wastedBackgroundFade 0.3s ease-out forwards,
        wastedScreenShake 0.6s ease-out;
}

@keyframes wastedScreenShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-10px, 5px);
    }
    20% {
        transform: translate(10px, -5px);
    }
    30% {
        transform: translate(-8px, 8px);
    }
    40% {
        transform: translate(8px, -8px);
    }
    50% {
        transform: translate(-5px, 3px);
    }
    60% {
        transform: translate(5px, -3px);
    }
    70% {
        transform: translate(-3px, 2px);
    }
    80% {
        transform: translate(3px, -2px);
    }
    90% {
        transform: translate(-1px, 1px);
    }
}

/* Stats container for wasted screen */
.wasted-stats-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: auto;
    max-width: 600px;
    width: 90%;
    padding: 20px;
    padding-bottom: 40px;
    margin-top: 20px;
    touch-action: pan-y;
}

#wasted-slam.show-stats .wasted-stats-content {
    display: block;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

/* Mobile adjustments for WASTED text */
@media (max-width: 768px) {
    .wasted-slam-text {
        font-size: 5rem;
        letter-spacing: 0.1em;
        padding: 0 10px;
        padding-left: calc(10px + 0.1em);
    }

    @keyframes wastedMoveToTop {
        0% {
            transform: scale(1) translateY(0);
            font-size: 5rem;
        }
        100% {
            transform: scale(1) translateY(-35vh);
            font-size: 3rem;
        }
    }
}

@media (max-width: 480px) {
    .wasted-slam-text {
        font-size: 3.5rem;
        letter-spacing: 0.05em;
        padding: 0 15px;
        padding-left: calc(15px + 0.05em);
    }

    @keyframes wastedMoveToTop {
        0% {
            transform: scale(1) translateY(0);
            font-size: 3.5rem;
        }
        100% {
            transform: scale(1) translateY(-35vh);
            font-size: 2.5rem;
        }
    }
}

/* ========== GAME OVER SCREEN ========== */

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0000 0%, #000000 70%);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: clamp(24px, 8vh, 96px);
    text-align: center;
    pointer-events: auto;
    z-index: 20;
    overflow: hidden;
    animation: screenShake 0.5s ease-out, scanlines 8s infinite;
}

@keyframes screenShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-5px, 2px);
    }
    20% {
        transform: translate(5px, -2px);
    }
    30% {
        transform: translate(-3px, 3px);
    }
    40% {
        transform: translate(3px, -3px);
    }
    50% {
        transform: translate(-2px, 1px);
    }
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

/* Animated background particles */
.gameover-bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.gameover-bg-particles .particle {
    animation: gameoverParticleFloat 6s infinite ease-in-out;
    box-shadow: 0 0 15px #ff4444, 0 0 30px #ff0000, 0 0 45px #ff4444;
}

@keyframes gameoverParticleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1) rotate(0deg) translateZ(0);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-50px) translateX(30px) scale(1.5) rotate(90deg) translateZ(0);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) translateX(-30px) scale(0.8) rotate(180deg) translateZ(0);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-60px) translateX(15px) scale(1.3) rotate(270deg) translateZ(0);
        opacity: 0.9;
    }
}

/* Vignette overlay */
.gameover-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

/* Scanline effect */
.gameover-vignette::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Main content container */
.gameover-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 100vh;
    box-sizing: border-box;
}

/* Header with title */
.gameover-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.gameover-glow-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 68, 68, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: gameoverGlowPulse 2s infinite;
    pointer-events: none;
}

@keyframes gameoverGlowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.gameover-title {
    position: relative;
    font-size: 4.5rem;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    color: #ff4444;
    text-transform: uppercase;
    letter-spacing: 8px;
    margin: 0;
    text-align: center;
    width: 100%;
    margin-left: 200px;
    text-shadow:
        6px 6px 0 #000,
        0 0 30px #ff0000,
        0 0 50px #ff4444,
        0 0 80px #ff0000;
    animation: gameoverTitleGlitch 3s infinite, chromaticAberration 0.3s infinite;
    z-index: 1;
}

@keyframes gameoverTitleGlitch {
    0%, 90%, 100% {
        transform: translate(0, 0) skew(0deg);
        text-shadow:
            6px 6px 0 #000,
            0 0 30px #ff0000,
            0 0 50px #ff4444,
            0 0 80px #ff0000;
    }
    92% {
        transform: translate(-3px, 2px) skew(-2deg);
        text-shadow:
            6px 6px 0 #000,
            -2px 0 0 #00ffff,
            2px 0 0 #ff0000,
            0 0 40px #ff4444;
    }
    94% {
        transform: translate(3px, -2px) skew(2deg);
        text-shadow:
            6px 6px 0 #000,
            2px 0 0 #00ffff,
            -2px 0 0 #ff0000,
            0 0 40px #ff4444;
    }
    96% {
        transform: translate(-2px, 1px) skew(-1deg);
        text-shadow:
            6px 6px 0 #000,
            -3px 0 0 #ff00ff,
            3px 0 0 #ffff00;
    }
}

@keyframes chromaticAberration {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.1) contrast(1.1);
    }
}

.gameover-underline {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
    margin-top: 15px;
    box-shadow: 0 0 20px #ff4444;
    animation: underlineGlow 2s infinite;
}

/* Stats Grid */
.gameover-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
}

.stat-card {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    border: 3px solid #555;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow:
        4px 4px 0 #000,
        0 0 20px rgba(0, 0, 0, 0.5);
    animation: statCardSlideIn 0.5s ease-out backwards, statCardPulse 3s infinite;
    transition: all 0.3s ease;
    overflow: hidden;
}

@keyframes statCardPulse {
    0%, 100% {
        box-shadow:
            4px 4px 0 #000,
            0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow:
            4px 4px 0 #000,
            0 0 30px rgba(255, 68, 68, 0.3),
            inset 0 0 20px rgba(255, 68, 68, 0.1);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: statCardShine 3s infinite;
}

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

@keyframes statCardShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.stat-card-kills {
    animation-delay: 0.1s;
    border-color: #ff4444;
}

.stat-card-distance {
    animation-delay: 0.2s;
    border-color: #ffaa00;
}

.stat-card-total {
    animation-delay: 0.3s;
    border-color: #00ddff;
}

.stat-card-currency {
    animation-delay: 0.4s;
    border-color: #00ff00;
}

.stat-icon {
    font-size: 2.5rem;
    filter: drop-shadow(2px 2px 0 #000);
    animation: statIconBounce 2s infinite;
}

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

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.stat-label {
    font-family: 'Rajdhani', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: #aaa;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'Rajdhani', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 3px 3px 0 #000;
}

.stat-card-kills .stat-value {
    color: #ff4444;
    text-shadow:
        3px 3px 0 #000,
        0 0 10px #ff0000;
}

.stat-card-distance .stat-value {
    color: #ffaa00;
    text-shadow:
        3px 3px 0 #000,
        0 0 10px #ff8800;
}

.stat-card-currency .stat-value {
    color: #00ff00;
    text-shadow:
        3px 3px 0 #000,
        0 0 10px #00cc00;
}

.stat-card-total .stat-value {
    color: #00ddff;
    text-shadow:
        3px 3px 0 #000,
        0 0 10px #00aacc;
}

/* Lifetime Stats Toggle Styles */
.stat-card-lifetime {
    background: linear-gradient(135deg, rgba(50, 30, 70, 0.9) 0%, rgba(70, 40, 90, 0.9) 100%) !important;
    border-width: 4px !important;
    border-style: double !important;
    transform: scale(1.02);
    box-shadow:
        4px 4px 0 #000,
        0 0 30px rgba(147, 51, 234, 0.5),
        inset 0 0 20px rgba(147, 51, 234, 0.2) !important;
}

.stat-card-lifetime::after {
    content: '★ LIFETIME ★';
    position: absolute;
    top: 5px;
    right: 5px;
    font-family: 'Rajdhani', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: #9333ea;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: 0 0 5px #9333ea;
    letter-spacing: 1px;
    animation: lifetimeBadgePulse 2s infinite;
}

@keyframes lifetimeBadgePulse {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 5px #9333ea;
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 10px #9333ea;
    }
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow:
        4px 4px 0 #000,
        0 0 30px rgba(255, 255, 255, 0.3);
}

.stat-card-lifetime:hover {
    transform: scale(1.07) !important;
    box-shadow:
        4px 4px 0 #000,
        0 0 40px rgba(147, 51, 234, 0.7),
        inset 0 0 30px rgba(147, 51, 234, 0.3) !important;
}

/* Weapons Section */
.gameover-weapons-section {
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

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

.weapons-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #ffaa00;
    text-shadow:
        3px 3px 0 #000,
        0 0 15px rgba(255, 170, 0, 0.6);
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 15px 0;
    letter-spacing: 2px;
}

.weapon-stats-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 170, 0, 0.3);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.weapon-stats-container::-webkit-scrollbar {
    width: 8px;
}

.weapon-stats-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.weapon-stats-container::-webkit-scrollbar-thumb {
    background: rgba(255, 170, 0, 0.5);
    border-radius: 4px;
}

.weapon-stats-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 170, 0, 0.7);
}

.weapon-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
    border: 2px solid rgba(255, 204, 0, 0.4);
    border-radius: 5px;
    box-shadow: 2px 2px 0 #000;
    transition: all 0.2s ease;
    animation: weaponStatSlideIn 0.4s ease-out backwards;
}

@keyframes weaponStatSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.weapon-stat-item:hover {
    transform: translateX(5px);
    border-color: rgba(255, 204, 0, 0.7);
}

.weapon-stat-name {
    font-family: 'Rajdhani', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
}

.weapon-stat-damage {
    font-family: 'Rajdhani', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

/* Action Buttons */
.gameover-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
    pointer-events: auto;
}

.gameover-actions .btn-main,
.gameover-actions .btn-secondary {
    margin-top: 0;
    flex: 1;
}

/* Share Section */
.gameover-share-section {
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffcc00;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    animation: fadeInUp 0.6s ease-out 0.45s backwards;
    pointer-events: auto;
    touch-action: auto;
}

.wasted-share-card {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 15px auto;
    padding: 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(15, 15, 20, 0.95) 100%);
    border: 2px solid rgba(255, 204, 0, 0.7);
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.25);
}

.share-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.share-card-logo {
    height: 54px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 204, 0, 0.4));
}

.share-card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 2px;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000, 0 0 10px #ffcc00;
}

.share-card-tagline {
    margin-left: auto;
    font-family: 'Rajdhani', monospace;
    font-size: 0.95rem;
    color: #c8ff8c;
    text-shadow: 1px 1px 0 #000;
}

.share-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: #ffcc00;
    text-align: center;
    margin: 0 0 15px 0;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000, 0 0 10px #ffcc00;
}

.share-message-box {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.share-message-text {
    font-family: 'Rajdhani', monospace;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #fff;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 1px 1px 0 #000;
    user-select: text;
    -webkit-user-select: text;
}

.share-message-preview {
    font-family: 'Rajdhani', monospace;
    font-size: 1rem;
    line-height: 1.6;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 1px 1px 0 #000;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.btn-share {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    padding: 16px 24px;
    border-radius: 10px;
    border: 3px solid;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0 #000;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-share-copy {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: white;
}

.btn-share-copy:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-copy:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-twitter {
    background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
    color: white;
    border-color: white;
}

.btn-share-twitter:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #0a74b8 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-twitter:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0c5ecf 100%);
    color: white;
    border-color: white;
}

.btn-share-facebook:hover {
    background: linear-gradient(135deg, #0c5ecf 0%, #0a4dad 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-facebook:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #1da851 100%);
    color: white;
    border-color: white;
}

.btn-share-whatsapp:hover {
    background: linear-gradient(135deg, #1da851 0%, #128C7E 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-whatsapp:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-reddit {
    background: linear-gradient(135deg, #FF4500 0%, #d93b00 100%);
    color: white;
    border-color: white;
}

.btn-share-reddit:hover {
    background: linear-gradient(135deg, #d93b00 0%, #b33200 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-reddit:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-native {
    background: linear-gradient(135deg, #667eea 0%, #4c5fd5 100%);
    color: white;
    border-color: white;
}

.btn-share-image {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #1b1b1b;
    border-color: #1b1b1b;
}

.btn-share-image:hover {
    background: linear-gradient(135deg, #ffb300 0%, #f57c00 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-image:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.btn-share-native:hover {
    background: linear-gradient(135deg, #4c5fd5 0%, #3847c1 100%);
    box-shadow: 6px 6px 0 #000;
    transform: translate(-2px, -2px);
}

.btn-share-native:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 #000;
}

.share-copied-feedback {
    font-family: 'Rajdhani', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #4CAF50;
    text-align: center;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    text-shadow: 0 0 10px #4CAF50, 2px 2px 0 #000;
}

.share-copied-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile responsiveness for share section */
@media (max-width: 480px) {
    .share-message-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .share-message-box {
        padding: 14px;
    }

    .btn-share {
        font-size: 1.1rem;
        padding: 14px 20px;
    }

    .share-buttons {
        gap: 10px;
    }
}

/* Corner decorations */
.gameover-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid #ff4444;
    box-shadow: 0 0 15px #ff4444;
    opacity: 0.5;
    animation: cornerPulse 2s infinite;
}

.gameover-corner-tl {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.gameover-corner-tr {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
}

.gameover-corner-bl {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.gameover-corner-br {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

/* Responsive adjustments for game over screen */
@media (max-width: 600px) {
    .gameover-content {
        gap: 12px;
        padding: 10px;
    }

    #wasted-slam {
        align-items: flex-start;
    }

    .wasted-stats-content {
        width: 100%;
        padding: 16px;
        margin-top: 10px;
        max-height: calc(100vh - 32px);
    }

    .gameover-header {
        margin-bottom: 0;
    }

    .gameover-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .gameover-underline {
        margin-top: 8px;
        height: 3px;
    }

    .gameover-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 5px 0;
    }

    .stat-card {
        padding: 10px;
        gap: 10px;
    }

    .stat-icon {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .gameover-weapons-section {
        max-width: 100%;
    }

    .weapons-title {
        font-size: 1.1rem;
        margin: 0 0 10px 0;
    }

    .weapon-stats-container {
        max-height: 120px;
        padding: 10px;
        gap: 6px;
    }

    .weapon-stat-item {
        padding: 8px 10px;
    }

    .weapon-stat-name {
        font-size: 0.9rem;
    }

    .weapon-stat-damage {
        font-size: 1rem;
    }

    .gameover-actions {
        gap: 10px;
        margin-bottom: 15px;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    .gameover-share-section {
        padding: 12px;
        margin-top: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .wasted-share-card {
        padding: 15px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .share-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .share-card-logo {
        height: 40px;
    }

    .share-card-title {
        font-size: 1.3rem;
    }

    .share-card-tagline {
        margin-left: 0;
        width: 100%;
        font-size: 0.85rem;
    }

    .share-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .share-message-preview {
        font-size: 0.85rem;
        padding: 10px;
        line-height: 1.4;
    }

    .share-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: 100%;
    }

    .btn-share {
        font-size: 1rem;
        padding: 10px 15px;
    }

    .btn-main {
        padding: 12px 20px;
        font-size: 1.2rem;
        margin-top: 0;
        flex: 1;
    }

    .btn-secondary {
        padding: 10px 15px;
        font-size: 1rem;
        margin-top: 0;
        flex: 1;
    }

    .gameover-corner {
        width: 30px;
        height: 30px;
    }

    .gameover-glow-circle {
        width: 180px;
        height: 180px;
    }
}

/* ========== ARMORY SCREEN - MOBILE GAME OPTIMIZED ========== */

#armory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, rgba(255, 204, 0, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    z-index: 25;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 10px 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    scroll-behavior: smooth;
}

/* Back button in top right corner */
.armory-back-btn-top {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    z-index: 100;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    min-height: auto !important;
    margin: 0 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #cc0000, #990000) !important;
    border: 2px solid #ff4444 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 10px rgba(255,0,0,0.3) !important;
}

#armory-screen.opening {
    animation: armorySlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes armorySlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#armory-screen.shake {
    animation: screenShake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 0); }
    20%, 40%, 60%, 80% { transform: translate(5px, 0); }
}

.purchase-particle {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 100;
    animation: particleFloat 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(360deg);
    }
}

.armory-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.armory-title {
    font-size: 2.5rem;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 3px;
    color: #ffcc00;
    text-shadow: 3px 3px 0 #000, 0 0 15px rgba(255, 204, 0, 0.5);
    margin: 0 0 2px;
    text-transform: uppercase;
    animation: armoryTitlePulse 3s infinite;
}

.armory-subtitle {
    margin: 0;
    font-family: 'Saira', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #d9d9d9;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 0.5px;
}

@keyframes armoryTitlePulse {
    0%, 100% {
        text-shadow: 5px 5px 0 #000, 0 0 20px rgba(255, 204, 0, 0.5);
    }
    50% {
        text-shadow: 5px 5px 0 #000, 0 0 30px rgba(255, 204, 0, 0.8), 0 0 40px rgba(255, 204, 0, 0.4);
    }
}

.armory-history-btn {
    white-space: nowrap;
    width: 100%;
    max-width: 650px;
    margin-bottom: 24px;
    margin-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    min-height: 50px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
}

.armory-balance {
    font-size: 1.5rem;
    font-family: 'Rajdhani', monospace;
    font-weight: 600;
    color: white;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
    text-align: right;
}

.armory-balance span {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(0, 255, 0, 0.6);
}

.armory-header {
    width: 100%;
    max-width: 650px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 40px;
}

.armory-reroll-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 650px;
    margin: 10px 0 12px;
}

.armory-offers {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.armory-purchase-panel {
    width: 100%;
    max-width: 650px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 2px solid rgba(255, 204, 0, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}

.armory-purchase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.armory-purchase-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #ffcc00;
    text-shadow: 3px 3px 0 #000;
    font-size: 1.4rem;
}

.armory-purchase-desc {
    font-family: 'Saira', sans-serif;
    font-weight: 400;
    color: #d9d9d9;
    text-shadow: 2px 2px 0 #000;
    font-size: 0.95rem;
}

.armory-purchase-icon {
    font-size: 2rem;
    filter: drop-shadow(2px 2px 0 #000);
}

.armory-purchase-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.armory-purchase-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 204, 0, 0.3);
    box-shadow: inset 0 0 10px rgba(255, 204, 0, 0.12);
}

.armory-purchase-item .upgrade-icon {
    font-size: 1.2rem;
    min-width: 36px;
    min-height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.35), rgba(255, 204, 0, 0.15));
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.armory-purchase-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.armory-purchase-name {
    font-family: 'Rajdhani', monospace;
    font-weight: 600;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 0.5px;
}

.armory-purchase-level {
    font-family: 'Rajdhani', monospace;
    font-weight: 500;
    color: #8fdd73;
    text-shadow: 2px 2px 0 #000;
    font-size: 0.9rem;
}

.armory-purchase-empty {
    font-family: 'Saira', sans-serif;
    font-weight: 400;
    color: #d9d9d9;
    text-shadow: 2px 2px 0 #000;
    text-align: center;
}

.armory-purchase-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.armory-purchase-item:hover {
    background: rgba(255, 204, 0, 0.15);
    border-color: rgba(255, 204, 0, 0.5);
    transform: scale(1.02);
}

.armory-purchase-item:active {
    transform: scale(0.98);
}

/* Category Headers - Mobile Game Style */
.upgrade-category-header {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #fff;
    text-shadow: 3px 3px 0 #000;
    text-transform: uppercase;
    padding: 12px 16px;
    margin-top: 16px;
    margin-bottom: 6px;
    background:
        linear-gradient(90deg, rgba(255, 204, 0, 0.2) 0%, rgba(255, 204, 0, 0.05) 100%);
    border-left: 5px solid #ffcc00;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-height: 56px;
}

.upgrade-category-header:active {
    background:
        linear-gradient(90deg, rgba(255, 204, 0, 0.35) 0%, rgba(255, 204, 0, 0.1) 100%);
    transform: scale(0.98);
}

.upgrade-category-header .category-arrow {
    margin-left: auto;
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(1px 1px 0 #000);
}

.upgrade-category-header.expanded .category-arrow {
    transform: rotate(90deg);
}

.category-icon {
    font-size: 1.6rem;
    filter: drop-shadow(2px 2px 0 #000);
    animation: iconBounce 2s infinite;
}

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

/* Upgrade Cards - Mobile Game Style */
.upgrade-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 10px;
    display: none;
    gap: 8px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.upgrade-card.visible {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    animation: cardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.upgrade-card.slide-out {
    animation: slideOutRight 0.5s cubic-bezier(0.6, 0.04, 0.98, 0.34) forwards;
}

.upgrade-card.slide-in {
    animation: slideInLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.upgrade-card.blank {
    background: linear-gradient(145deg, #3a3a3a 0%, #4a4a4a 100%);
    border: 2px solid #666;
    opacity: 0.5;
    min-height: 120px;
}

.upgrade-card.blank .upgrade-icon,
.upgrade-card.blank .upgrade-info,
.upgrade-card.blank .upgrade-buy {
    visibility: hidden;
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(150%) scale(0.8);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-150%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Category-specific colors */
.upgrade-card-offense {
    border-color: #ff4444;
    background: linear-gradient(145deg, #1a0a0a 0%, #2a1414 100%);
}

.upgrade-card-defense {
    border-color: #4444ff;
    background: linear-gradient(145deg, #0a0a1a 0%, #14142a 100%);
}

.upgrade-card-tactical {
    border-color: #ffaa00;
    background: linear-gradient(145deg, #1a1400 0%, #2a2210 100%);
}

.upgrade-card-utility {
    border-color: #00ff88;
    background: linear-gradient(145deg, #0a1a14 0%, #142a20 100%);
}

.upgrade-card-special {
    border-color: #ff00ff;
    background: linear-gradient(145deg, #1a0a1a 0%, #2a142a 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 0, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: specialGlow 2s infinite;
}

@keyframes specialGlow {
    0%, 100% {
        box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.6),
            0 0 20px rgba(255, 0, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.6),
            0 0 30px rgba(255, 0, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.special-badge {
    background: linear-gradient(135deg, #ff00ff, #aa00aa);
    color: white;
    animation: badgePulse 1.5s infinite;
}

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

/* Affordability states */
.upgrade-card.unaffordable {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.upgrade-card.maxed {
    border-color: #00ff00;
    opacity: 0.8;
    background: linear-gradient(145deg, #0a2a0a 0%, #1a3a1a 100%);
}

.upgrade-card.maxed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(0, 255, 0, 0.05));
    pointer-events: none;
}

/* Upgrade Icon */
.upgrade-icon {
    font-size: 2rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.6));
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Upgrade Info */
.upgrade-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Allow text truncation if needed */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.upgrade-name {
    font-family: 'Rajdhani', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
    flex: 1;
    min-width: 0;
}

.upgrade-level-badge {
    font-family: 'Rajdhani', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 204, 0, 0.5);
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
}

.upgrade-desc {
    font-family: 'Saira', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: #ccc;
}

.upgrade-effect {
    font-family: 'Rajdhani', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: #aaffaa;
    text-shadow: 1px 1px 0 #000;
}

/* Progress Bar - Mobile Game Style */
.upgrade-progress-container {
    position: relative;
    width: 100%;
    height: 18px;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(255, 255, 255, 0.02) 4px,
            rgba(255, 255, 255, 0.02) 8px
        );
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.upgrade-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background:
        linear-gradient(90deg, #00aa00 0%, #00ff00 50%, #00aa00 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(0, 255, 0, 0.4);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.upgrade-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Rajdhani', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow:
        1px 1px 2px #000,
        -1px -1px 2px #000,
        1px -1px 2px #000,
        -1px 1px 2px #000,
        0 0 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Buy Button - Mobile Game Style */
.upgrade-buy {
    background: linear-gradient(145deg, #00ff44 0%, #00cc00 100%);
    color: #000;
    border: 3px solid #fff;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Rajdhani', monospace;
    cursor: pointer;
    box-shadow:
        0 4px 0 #009900,
        0 6px 8px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    transition: all 0.15s ease;
    min-width: 110px;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.upgrade-buy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.upgrade-buy:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow:
        0 0 0 #009900,
        0 2px 4px rgba(0, 0, 0, 0.4);
}

.upgrade-buy:disabled {
    background: linear-gradient(145deg, #555 0%, #333 100%);
    color: #888;
    cursor: not-allowed;
    border-color: #666;
    box-shadow:
        0 4px 0 #222,
        0 6px 8px rgba(0, 0, 0, 0.4);
}

.upgrade-buy:disabled::before {
    display: none;
}

/* Hover effects only on non-touch devices */
@media (hover: hover) {
    .upgrade-buy:hover:not(:disabled)::before {
        left: 100%;
    }

    .upgrade-buy:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow:
            0 6px 0 #009900,
            0 10px 12px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile-specific armory optimizations */
@media (max-width: 600px) {
    #armory-screen {
        padding: 12px 8px;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }

    .armory-title-block {
        align-items: flex-start;
        width: 100%;
    }

    .armory-title {
        font-size: 2rem;
        margin: 8px 0 12px 0;
        text-shadow: 3px 3px 0 #000, 0 0 15px rgba(255, 204, 0, 0.5);
    }

    .armory-balance {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .armory-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .armory-history-btn {
        width: 100%;
        margin-bottom: 40px;
        margin-bottom: max(40px, calc(env(safe-area-inset-bottom, 20px) + 20px));
    }

    .armory-offers {
        max-width: 100%;
        gap: 10px;
        padding: 0;
        margin-bottom: 16px;
    }

    .armory-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .armory-reroll-block {
        width: 100%;
        align-items: flex-start;
    }

    .armory-purchase-panel {
        max-width: 100%;
    }

    /* Upgrade cards - mobile-first grid layout */
    .upgrade-card.visible {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
        padding: 14px;
    }

    .upgrade-icon {
        grid-row: 1 / 3;
        width: 56px;
        height: 56px;
        font-size: 2.5rem;
    }

    .upgrade-info {
        grid-column: 2;
        grid-row: 1;
        gap: 6px;
    }

    .upgrade-buy {
        grid-column: 1 / 3;
        grid-row: 2;
        width: 100%;
        padding: 16px 20px;
        font-size: 1.1rem;
        min-height: 52px;
        margin-top: 4px;
    }

    .upgrade-name {
        font-size: 1rem;
    }

    .upgrade-level-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .upgrade-desc {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .upgrade-effect {
        font-size: 0.75rem;
    }

    .upgrade-progress-container {
        height: 22px;
    }

    .upgrade-progress-text {
        font-size: 0.7rem;
    }

    /* Back button - optimized for mobile */
    #armory-back-btn {
        width: calc(100% - 16px);
        max-width: 400px;
        margin: 8px auto 16px auto;
        padding: 16px 40px;
        font-size: 1.3rem;
        min-height: 56px;
        border-radius: 12px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    #armory-screen {
        padding: 10px 6px;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    }

    .armory-title {
        font-size: 1.7rem;
        margin: 6px 0 10px 0;
    }

    .armory-balance {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .armory-offers {
        gap: 8px;
    }

    .upgrade-card.visible {
        padding: 12px;
        gap: 8px;
    }

    .upgrade-icon {
        width: 48px;
        height: 48px;
        font-size: 2.2rem;
    }

    .upgrade-name {
        font-size: 0.95rem;
    }

    .upgrade-level-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    .upgrade-desc {
        font-size: 0.75rem;
    }

    .upgrade-effect {
        font-size: 0.7rem;
    }

    .upgrade-progress-container {
        height: 20px;
    }

    .upgrade-buy {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
    }

    #armory-back-btn {
        padding: 14px 32px;
        font-size: 1.2rem;
        min-height: 52px;
    }
}

/* ========== PAUSE OVERLAY ========== */

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

#pause-overlay.visible {
    display: flex;
    pointer-events: auto;
}

.pause-content {
    text-align: center;
    padding: 40px;
    background: rgba(20, 20, 20, 0.95);
    border: 3px solid #ffcc00;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
    max-width: 90%;
    animation: pauseFadeIn 0.3s ease-out;
}

.pause-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.9;
    animation: pausePulse 2s ease-in-out infinite;
}

.pause-title {
    color: #ffcc00;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #000;
    margin: 0 0 15px 0;
}

.pause-message {
    color: #ccc;
    font-family: 'Saira', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
}

.resume-button {
    margin-top: 18px;
    padding: 12px 20px;
    background: #ffcc00;
    color: #000;
    border: none;
    border-radius: 8px;
    font-family: 'Rajdhani', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 0 #b58c00;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.resume-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b58c00;
}

@keyframes pauseFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Purchase Details Modal */
.purchase-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.purchase-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.purchase-details-content {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(30, 30, 30, 0.98));
    border: 3px solid #ffcc00;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(255, 204, 0, 0.1);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.purchase-details-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.7);
    border: 2px solid #ff0000;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 #000;
    text-shadow: 2px 2px 0 #000;
}

.purchase-details-close:hover {
    background: rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

.purchase-details-close:active {
    transform: scale(0.95);
}

.purchase-details-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 15px;
    filter: drop-shadow(3px 3px 0 #000);
}

.purchase-details-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #ffcc00;
    text-align: center;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 2px;
    margin: 0 0 10px 0;
}

.purchase-details-level {
    font-family: 'Rajdhani', monospace;
    font-size: 1.2rem;
    color: #8fdd73;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    font-weight: 600;
    margin-bottom: 20px;
}

.purchase-details-desc {
    font-family: 'Saira', sans-serif;
    font-size: 1rem;
    color: #d9d9d9;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
    line-height: 1.5;
}

.purchase-details-effect {
    font-family: 'Rajdhani', monospace;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    font-weight: 600;
    margin-bottom: 25px;
    padding: 12px;
    background: rgba(255, 204, 0, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.purchase-details-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.purchase-detail-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}

.purchase-detail-label {
    font-family: 'Saira', sans-serif;
    font-size: 0.95rem;
    color: #d9d9d9;
    text-shadow: 2px 2px 0 #000;
}

.purchase-detail-value {
    font-family: 'Rajdhani', monospace;
    font-size: 1.1rem;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
    font-weight: 600;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .pause-content {
        padding: 30px 20px;
    }

    .pause-icon {
        font-size: 3rem;
        margin-bottom: 15px;
    }

    .pause-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .pause-message {
        font-size: 0.9rem;
    }

    .purchase-details-content {
        padding: 20px;
        width: 95%;
    }

    .purchase-details-name {
        font-size: 1.5rem;
    }

    .purchase-details-icon {
        font-size: 3rem;
    }
}
