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

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 50%, #0f0f23 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

.loading-title {
    font-size: 2.5rem;
    color: #39d353;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(57, 211, 83, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top: 4px solid #39d353;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.2rem;
    color: #58a6ff;
    margin-bottom: 0.5rem;
}

.loading-ip {
    font-size: 0.9rem;
    color: #fbbf24;
}

html, body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a0f;
}

body {
    color: #e0e0e0;
    font-family: 'Silkscreen', cursive;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
}

.game-title {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 12px));
    left: 50%;
    transform: translateX(-50%);
    color: #ff6b9d;
    font-size: 11px;
    text-align: center;
    font-weight: 700;
    z-index: 10;
    text-shadow: 2px 2px 0 #1a0a1a;
    letter-spacing: 1px;
    padding: 3px 8px;
    background: linear-gradient(180deg, #2a1a3a 0%, #1a0a2a 100%);
    border: 2px solid #4a2a5a;
    box-shadow: 
        inset 1px 1px 0 #5a3a6a,
        2px 2px 0 #0a0510;
}

.game-stats {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 12px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 10;
    right: auto;
}

.stats-row {
    display: flex;
    gap: 4px;
}

.stat-box {
    background: linear-gradient(180deg, #2a1a3a 0%, #1a0a2a 100%);
    border: 2px solid #4a2a5a;
    padding: 2px 6px;
    font-size: 7px;
    white-space: nowrap;
    box-shadow: 
        inset 1px 1px 0 #5a3a6a,
        inset -1px -1px 0 #1a0a1a,
        2px 2px 0 #0a0510;
}

.stat-box span {
    color: #ff9f43;
}

.stat-box.upgrade-points {
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border-color: #5a4a2a;
    box-shadow: 
        inset 1px 1px 0 #6a5a3a,
        inset -1px -1px 0 #1a0a00,
        2px 2px 0 #100a00;
}

.stat-box.upgrade-points span {
    color: #ffd93d;
}

.stat-box.kills {
    background: linear-gradient(180deg, #2a1a3a 0%, #1a0a2a 100%);
    border-color: #5a2a5a;
    box-shadow: 
        inset 1px 1px 0 #6a3a6a,
        inset -1px -1px 0 #1a001a,
        2px 2px 0 #100010;
}

.stat-box.kills span {
    color: #ff6b6b;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-color: #0a0a0f;
    touch-action: none;
    cursor: pointer;
    border: none;
    z-index: 1;
}

.exp-progress-bar {
    position: absolute;
    top: max(42px, calc(env(safe-area-inset-top, 12px) + 30px));
    left: 50%;
    transform: translateX(-50%);
    width: 85px;
    height: 6px;
    background: #1a0a2a;
    border: 2px solid #3a2a4a;
    z-index: 10;
    box-shadow: 
        inset 1px 1px 0 #2a1a3a,
        2px 2px 0 #0a0510;
}

.exp-progress-fill {
    height: 100%;
    background: linear-gradient(180deg, #6bff6b 0%, #4a9f4a 100%);
    width: 0%;
    transition: width 0.2s ease;
    box-shadow: inset 1px 1px 0 #8aff8a;
}

.skill-bar {
    position: absolute;
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 15;
    padding: 0 4px;
}

.skill-button {
    background: linear-gradient(180deg, #3a4a5a 0%, #1a2a3a 100%);
    border: 1px solid #5a8aca;
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
    text-align: center;
    min-width: 40px;
    box-shadow: 
        0 2px 0 #0a1520,
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 1px 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.skill-button:hover {
    background: linear-gradient(180deg, #4a5a6a 0%, #2a3a4a 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 3px 0 #0a1520,
        0 3px 6px rgba(0, 0, 0, 0.5),
        inset 1px 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #8acaff;
}

.skill-button:active {
    transform: translateY(1px);
    box-shadow: 
        0 1px 0 #0a1520,
        0 1px 2px rgba(0, 0, 0, 0.3),
        inset 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.skill-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.skill-button.disabled:hover {
    transform: none;
    background: linear-gradient(180deg, #2a3a4a 0%, #1a2a3a 100%);
}

.skill-icon {
    font-size: 10px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

.skill-name {
    color: #7fdbff;
    font-size: 5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.skill-value {
    color: #ff9f43;
    font-size: 6px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.skill-cost {
    color: #ffd93d;
    font-size: 4px;
    background: rgba(0,0,0,0.4);
    padding: 0px 2px;
    border-radius: 2px;
    font-weight: 600;
}

.upgrade-container {
    position: absolute;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    display: flex;
    gap: 4px;
    justify-content: center;
    width: 100%;
    padding: 0 8px;
    flex-wrap: wrap;
    max-height: 18%;
    overflow-y: auto;
}

.upgrade-box {
    background: linear-gradient(180deg, #3a2a5a 0%, #2a1a4a 100%);
    border: 2px solid #5a3a7a;
    color: #e0d0ff;
    padding: 4px 6px;
    cursor: pointer;
    text-align: center;
    min-width: 40px;
    font-size: 7px;
    box-shadow: 
        inset 1px 1px 0 #6a4a8a,
        inset -1px -1px 0 #1a0a2a,
        2px 2px 0 #100a20;
    transition: transform 0.1s ease;
}

.upgrade-box:hover {
    background: linear-gradient(180deg, #4a3a6a 0%, #3a2a5a 100%);
    transform: translateY(-1px);
}

.upgrade-box:active {
    transform: translateY(1px);
    box-shadow: 
        inset 1px 1px 0 #2a1a3a,
        1px 1px 0 #100a20;
}

.upgrade-box div:first-child {
    color: #ff9f43;
    margin-bottom: 2px;
}

.upgrade-box div:last-child {
    color: #9f9f9f;
    font-size: 7px;
}

.retry-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #ff4444 0%, #cc2222 100%);
    color: #fff;
    border: 3px solid #ff8888;
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Silkscreen', cursive;
    font-size: 14px;
    font-weight: 700;
    z-index: 200;
    box-shadow: 
        inset 1px 1px 0 #ff6666,
        inset -1px -10px 0 #aa0000,
        3px 3px 0 #440000;
    text-shadow: 1px 1px 0 #440000;
}

.retry-button:hover {
    background: linear-gradient(180deg, #ff5555 0%, #dd3333 100%);
}

.retry-button:active {
    transform: translate(-50%, -50%) translateY(2px);
    box-shadow: 
        inset 1px 1px 0 #ff6666,
        1px 1px 0 #440000;
}

@supports (padding: max(0px)) {
    .game-title {
        top: max(12px, env(safe-area-inset-top, 12px));
    }
    
    .game-stats {
        top: max(12px, env(safe-area-inset-top, 12px));
    }
    
    .exp-progress-bar {
        top: max(42px, calc(env(safe-area-inset-top, 12px) + 30px));
    }
    
    .upgrade-container {
        bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }
}

@media (min-width: 769px) {
    .skill-bar {
        gap: 12px;
        bottom: 15px;
    }
    
    .skill-button {
        min-width: 80px;
        padding: 8px 12px;
    }
    
    .skill-icon {
        font-size: 18px;
    }
    
    .skill-name {
        font-size: 9px;
    }
    
    .skill-value {
        font-size: 11px;
    }
    
    .skill-cost {
        font-size: 8px;
    }
    
    .game-title {
        font-size: 20px;
        top: 12px;
        padding: 6px 16px;
    }
    
    .game-stats {
        top: 12px;
    }
    
    .stat-box {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .upgrade-points {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .exp-progress-bar {
        top: 42px;
    }
    
    .upgrade-container {
        bottom: 20px;
        gap: 8px;
    }
    
    .upgrade-box {
        padding: 10px 14px;
        min-width: 80px;
        font-size: 10px;
    }
    
    .upgrade-box div:last-child {
        font-size: 9px;
    }
    
    .retry-button {
        padding: 16px 32px;
        font-size: 18px;
    }
}

/* Skill Selection Popup - Small at bottom */
.skill-selection-overlay {
    position: absolute;
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: 70%;
    max-width: 320px;
    background: linear-gradient(180deg, #1e1e3a 0%, #12122a 100%);
    border: 2px solid #6a6aaa;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    padding: 8px 6px;
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 40px rgba(100, 100, 255, 0.3),
        inset 0 0 20px rgba(100, 100, 255, 0.1);
    pointer-events: none;
}

.skill-selection-overlay.active {
    display: flex;
    animation: slideUpPopup 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(100%);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

.skill-selection-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffd93d;
    text-shadow: 0 0 15px #ffd93d, 0 0 30px #ff9900;
    margin-bottom: 4px;
    animation: pulse 0.8s ease-in-out infinite, glow 1.5s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

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

@keyframes glow {
    from { text-shadow: 0 0 10px #ffd93d, 0 0 20px #ff9900; }
    to { text-shadow: 0 0 20px #ffd93d, 0 0 40px #ff9900, 0 0 60px #ff6600; }
}

.skill-selection-subtitle {
    font-size: 8px;
    color: #aaa;
    margin-bottom: 8px;
    font-weight: 500;
}

.skill-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.skill-card {
    background: linear-gradient(145deg, #3a4a6a 0%, #1a2a4a 50%, #0a1a3a 100%);
    border: 2px solid #5a8aca;
    border-radius: 8px;
    padding: 6px 8px;
    min-width: 65px;
    cursor: pointer;
    text-align: center;
    box-shadow: 
        0 5px 0 #0a1020,
        0 6px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.skill-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);
    transition: left 0.4s ease;
}

.skill-card:hover::before {
    left: 100%;
}

.skill-card:nth-child(1) { animation-delay: 0.05s; }
.skill-card:nth-child(2) { animation-delay: 0.1s; }
.skill-card:nth-child(3) { animation-delay: 0.15s; }

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

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

.skill-card:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: #8acaff;
    box-shadow: 
        0 8px 0 #0a1020,
        0 12px 25px rgba(90, 138, 202, 0.5),
        0 0 15px rgba(138, 202, 255, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.skill-card:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
        0 2px 0 #0a1020,
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(0, 0, 0, 0.3);
}

.skill-card.picked {
    animation: pickCard 0.4s ease forwards;
    pointer-events: none;
}

@keyframes pickCard {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        border-color: #00ff88;
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.8);
    }
    100% { 
        transform: scale(0.8) translateY(-15px);
        opacity: 0;
    }
}

.skill-card-icon {
    font-size: 16px;
    margin-bottom: 2px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: transform 0.2s ease;
}

.skill-card:hover .skill-card-icon {
    transform: scale(1.15);
}

.skill-card-name {
    font-size: 7px;
    font-weight: 700;
    color: #7fdbff;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-card-desc {
    font-size: 6px;
    color: #ffb347;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.skill-card-level {
    font-size: 5px;
    color: #666;
    margin-top: 3px;
    background: rgba(0,0,0,0.4);
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

@media (min-width: 769px) {
    /* PC View: Smaller skill selection on right side */
    .skill-selection-overlay {
        position: absolute;
        bottom: 20px;
        right: 20px;
        left: auto;
        transform: none;
        width: 280px;
        max-width: 280px;
        padding: 12px;
        border-width: 2px;
        animation: slideInRight 0.3s ease-out forwards;
    }
    
    .skill-selection-title {
        font-size: 16px;
    }
    
    .skill-selection-subtitle {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .skill-cards {
        gap: 8px;
    }
    
    .skill-card {
        padding: 8px 10px;
        min-width: 80px;
    }
    
    .skill-card-icon {
        font-size: 24px;
    }
    
    .skill-card-name {
        font-size: 10px;
    }
    
    .skill-card-desc {
        font-size: 8px;
    }
    
    .skill-card-level {
        font-size: 8px;
    }
    
    .skill-card-level {
        font-size: 8px;
    }
}

/* Special Skill Overlay - Gold Theme for Level 50 */
.special-skill-overlay {
    position: absolute;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: 85%;
    max-width: 380px;
    background: linear-gradient(180deg, #3a2a10 0%, #1a1000 100%);
    border: 3px solid #ffd700;
    border-radius: 14px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    padding: 10px 8px;
    box-shadow: 
        0 -4px 30px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    pointer-events: none;
}

.special-skill-overlay.active {
    display: flex;
    animation: specialSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.special-skill-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700, 0 0 30px #ff9900, 0 2px 4px #000;
    margin-bottom: 4px;
    animation: specialPulse 0.8s ease-in-out infinite, specialGlow 1.5s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

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

@keyframes specialGlow {
    from { text-shadow: 0 0 10px #ffd700, 0 0 20px #ff9900; }
    to { text-shadow: 0 0 20px #ffd700, 0 0 40px #ff9900, 0 0 60px #ff6600; }
}

.special-skill-subtitle {
    font-size: 9px;
    color: #ccc;
    margin-bottom: 8px;
    font-weight: 500;
}

.special-skill-overlay .skill-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.special-skill-overlay .skill-card {
    background: linear-gradient(145deg, #4a3a1a 0%, #2a1a0a 50%, #1a0a00 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 80px;
    cursor: pointer;
    text-align: center;
    box-shadow: 
        0 5px 0 #0a0800,
        0 6px 15px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    pointer-events: auto;
}

.special-skill-overlay .skill-card:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: #ffec8b;
    box-shadow: 
        0 8px 0 #0a0800,
        0 12px 25px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.special-skill-overlay .skill-card:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
        0 2px 0 #0a0800,
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(0, 0, 0, 0.3);
}

.special-skill-overlay .skill-card:nth-child(1) { animation-delay: 0.05s; }
.special-skill-overlay .skill-card:nth-child(2) { animation-delay: 0.1s; }
.special-skill-overlay .skill-card:nth-child(3) { animation-delay: 0.15s; }

.special-skill-overlay .skill-card-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.special-skill-overlay .skill-card-name {
    font-size: 9px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.special-skill-overlay .skill-card-desc {
    font-size: 7px;
    color: #ffb347;
    font-weight: 600;
}

.special-skill-overlay .skill-card-level {
    font-size: 6px;
    color: #888;
    margin-top: 3px;
}

/* Event Alert System */
.event-alerts {
    position: absolute;
    top: max(400px, calc(env(safe-area-inset-top, 12px) + 390px));
    left: 8px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 180px;
}

.event-alert {
    background: rgba(0, 0, 0, 0.7);
    border-left: 3px solid #4CAF50;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
    font-size: 9px;
    color: #fff;
    animation: eventSlideIn 0.3s ease-out forwards;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-icon {
    margin-right: 4px;
    font-size: 10px;
}

.event-alert.like {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.3);
}

.event-alert.comment {
    border-left-color: #2196F3;
    background: rgba(33, 150, 243, 0.3);
}

.event-alert.gift {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.3);
}

.event-alert.follow {
    border-left-color: #9C27B0;
    background: rgba(156, 39, 176, 0.3);
}

.event-alert.share {
    border-left-color: #FF9800;
    background: rgba(255, 152, 0, 0.3);
}

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

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

.event-alert.fade-out {
    animation: eventSlideOut 0.3s ease-out forwards;
}

/* User Like Counters */
.user-counters {
    position: absolute;
    bottom: 20px;
    left: 8px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 4px;
    max-width: 200px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 8px;
    font-size: 9px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-counter-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #FFD700;
    text-align: center;
}

.user-counter-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

.user-counter-name {
    width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px;
}

.user-counter-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.user-counter-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.user-counter-count {
    width: 40px;
    text-align: right;
    font-size: 7px;
    color: #aaa;
}

/* Damage Leaderboard - Top Right, below speed button */
.damage-leaderboard {
    position: absolute;
    top: max(40px, calc(env(safe-area-inset-top, 12px) + 28px));
    right: 8px;
    z-index: 50;
    background: linear-gradient(180deg, rgba(20, 10, 30, 0.6) 0%, rgba(0, 0, 0, 0.5) 100%);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    min-width: 100px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.leaderboard-title {
    font-size: 8px;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 3px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 1px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    font-size: 7px;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-rank {
    color: #FFD700;
    font-weight: bold;
    width: 24px;
    font-size: 9px;
}

.leaderboard-avatar-img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    object-fit: cover;
}

.leaderboard-name {
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75px;
    margin: 0 4px;
    font-size: 9px;
}

.leaderboard-damage {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 9px;
}

.leaderboard-title {
    font-size: 9px;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 4px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    letter-spacing: 1px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    font-size: 8px;
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-rank {
    color: #FFD700;
    font-weight: bold;
    width: 22px;
    font-size: 8px;
}

.leaderboard-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    object-fit: cover;
}

.leaderboard-avatar-placeholder {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #4a2a5a, #2a1a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    color: #FFD700;
}

.leaderboard-avatar-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-right: 5px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    object-fit: cover;
}

.leaderboard-avatar-generated {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.leaderboard-name {
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
    margin: 0 4px;
    font-size: 8px;
}

.leaderboard-damage {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 8px;
}

/* Gift Info Sign - Below Corruption Bar */
.gift-info-sign {
    position: fixed;
    top: 200px;
    right: 8px;
    z-index: 50;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(20, 10, 30, 0.5) 100%);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    min-width: 130px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.gift-info-title {
    font-size: 9px;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.gift-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gift-icon {
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    min-width: 55px;
    text-align: center;
}

.gift-desc {
    font-size: 8px;
    color: #ccc;
    text-align: right;
}

/* Gift tier colors */
.gift-small {
    background: rgba(100, 100, 100, 0.4);
    color: #aaa;
}

.gift-normal {
    background: rgba(76, 175, 80, 0.4);
    color: #4CAF50;
}

.gift-big {
    background: rgba(33, 150, 243, 0.4);
    color: #2196F3;
}

.gift-mega {
    background: rgba(156, 39, 176, 0.4);
    color: #9C27B0;
}

.gift-legendary {
    background: rgba(255, 215, 0, 0.5);
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    animation: legendaryPulse 1s ease-in-out infinite;
}

.gift-info-row .gift-legendary + .gift-desc {
    color: #FFD700;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

@keyframes legendaryPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.gift-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    margin: 4px 0;
}

/* Gift Alert Popup */
.gift-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #000;
    text-align: center;
    z-index: 1000;
    animation: giftPulse 0.5s ease-out;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

@keyframes giftPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    html, body {
        background-color: #0a0a0f;
    }
    
    .game-container {
        width: calc(100vw - 10px);
        height: calc(100dvh - 10px);
        margin: 5px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .event-alerts {
        top: max(90px, calc(env(safe-area-inset-top, 12px) + 75px));
        max-width: 100px;
        font-size: 6px;
    }
    
    .event-alert {
        font-size: 6px;
        padding: 2px 4px;
    }
    
    .user-counters {
        max-width: 80px;
        bottom: 8px;
        font-size: 5px;
    }
    
    .damage-leaderboard {
        min-width: 80px;
        padding: 4px 5px;
    }
    
    .leaderboard-title {
        font-size: 6px;
        margin-bottom: 3px;
    }
    
    .leaderboard-row {
        font-size: 5px;
        padding: 1px 2px;
    }
    
    .leaderboard-name {
        max-width: 40px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    }
    
    .gift-info-sign {
        min-width: 60px;
        padding: 2px 3px;
        top: 260px;
    }
    
    .gift-info-title {
        font-size: 5px;
    }
    
    .gift-icon {
        font-size: 5px;
        min-width: 30px;
        padding: 1px 2px;
    }
    
    .gift-desc {
        font-size: 5px;
    }
    
    .gift-info-row {
        padding: 1px 0;
    }
}

/* ========== CORRUPTION METER ========== */
.corruption-meter {
    /* Inline styles handle positioning */
}

@keyframes corruptionMeterPulse {
    0%, 100% { box-shadow: 0 0 20px var(--corruption-glow, rgba(50, 205, 50, 0.4)), 0 0 40px var(--corruption-glow, rgba(50, 205, 50, 0.15)); }
    50% { box-shadow: 0 0 35px var(--corruption-glow, rgba(50, 205, 50, 0.6)), 0 0 60px var(--corruption-glow, rgba(50, 205, 50, 0.25)); }
}

.corruption-header {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
}

.corruption-icon {
    font-size: 9px;
    animation: iconSpin 3s linear infinite;
}

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

.corruption-label {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px currentColor;
    letter-spacing: 2px;
}

.corruption-stage-name {
    font-size: 13px;
    font-weight: 800;
    color: #7CFC00;
    text-shadow: 0 0 15px #7CFC00, 0 0 25px #7CFC00;
    letter-spacing: 1.5px;
    animation: stageNameGlow 1.5s ease-in-out infinite alternate;
}

@keyframes stageNameGlow {
    from { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
    to { text-shadow: 0 0 20px currentColor, 0 0 35px currentColor, 0 0 50px currentColor; }
}

.corruption-bar-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.corruption-bar {
    position: relative;
    width: 100%;
    height: 18px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.corruption-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7CFC00 0%, #FFD700 25%, #FF6347 50%, #DC143C 75%, #9932CC 100%);
    background-size: 400% 100%;
    border-radius: 8px;
    transition: width 0.3s ease-out;
    position: relative;
    animation: corruptionGradientMove 2.5s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor;
}

@keyframes corruptionGradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.corruption-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.corruption-markers {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 7px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 2px;
}

.corruption-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.corruption-percent {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 8px #fff, 0 0 15px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.corruption-next {
    font-size: 8px;
    color: #ccc;
    font-weight: 700;
    transition: color 0.3s;
    letter-spacing: 0.5px;
}

/* ========== CORRUPTION RETRY BUTTON ========== */
.corruption-retry-btn {
    background: linear-gradient(180deg, #4a4a6a 0%, #2a2a4a 100%);
    border: 2px solid #7CFC00;
    border-radius: 8px;
    color: #7CFC00;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.3);
    width: 100%;
    max-width: 80px;
    align-self: center;
}

.corruption-retry-btn:hover {
    background: linear-gradient(180deg, #5a5a7a 0%, #3a3a5a 100%);
    box-shadow: 0 0 15px rgba(50, 205, 50, 0.5);
    transform: scale(1.05);
}

.corruption-retry-btn:active {
    transform: scale(0.95);
}

/* ========== SESSION SUMMARY OVERLAY ========== */
.session-summary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 5, 20, 0.97) 0%, rgba(20, 10, 30, 0.97) 50%, rgba(10, 5, 20, 0.97) 100%);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 15px;
    padding-bottom: 40px;
    animation: sessionFadeIn 0.5s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.session-summary-content {
    background: linear-gradient(180deg, rgba(30, 20, 40, 0.98) 0%, rgba(15, 10, 25, 0.98) 100%);
    border: 3px solid #9932CC;
    border-radius: 20px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(153, 50, 204, 0.6), 0 0 100px rgba(153, 50, 204, 0.3), inset 0 0 40px rgba(153, 50, 204, 0.15);
    animation: sessionSlideIn 0.5s ease;
}

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

.session-header {
    text-align: center;
    margin-bottom: 20px;
}

.session-title {
    font-size: 28px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3); }
    to { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5); }
}

.session-countdown {
    font-size: 72px;
    font-weight: 900;
    color: #9932CC;
    text-align: center;
    text-shadow: 0 0 20px #9932CC, 0 0 40px #9932CC, 0 0 60px rgba(153, 50, 204, 0.5);
    animation: countdownPulse 1s ease-in-out infinite;
    line-height: 1;
}

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

.session-label {
    font-size: 14px;
    font-weight: 700;
    color: #ccc;
    text-align: center;
    letter-spacing: 3px;
    margin-top: 5px;
}

.session-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    margin: 20px 0;
}

.session-game-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.session-stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 10px;
    border-radius: 12px;
    border: 1px solid rgba(153, 50, 204, 0.4);
}

.session-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    letter-spacing: 2px;
}

.session-stat-value {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

.score-color { color: #FFD700; text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
.kills-color { color: #ff4444; text-shadow: 0 0 15px rgba(255, 68, 68, 0.6); }
.level-color { color: #7CFC00; text-shadow: 0 0 15px rgba(50, 205, 50, 0.6); }
.time-color { color: #00BFFF; text-shadow: 0 0 15px rgba(0, 191, 255, 0.6); }

.session-leaderboard {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.session-leaderboard-title {
    font-size: 16px;
    font-weight: 900;
    color: #FFD700;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.session-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-leaderboard-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.2s ease;
}

.session-leaderboard-item:hover {
    transform: scale(1.02);
    border-color: rgba(255, 215, 0, 0.4);
}

.session-leaderboard-item.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.25) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 215, 0, 0.1);
    animation: top1Glow 1.5s ease-in-out infinite alternate;
}

@keyframes top1Glow {
    from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255, 215, 0, 0.05); }
    to { box-shadow: 0 0 35px rgba(255, 215, 0, 0.5), inset 0 0 25px rgba(255, 215, 0, 0.15); }
}

.no-destroyers {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

.session-rank {
    font-size: 22px;
    font-weight: 900;
    width: 35px;
    text-align: center;
}

.session-rank.top-1 {
    color: #FFD700;
    text-shadow: 0 0 15px #FFD700;
}

.session-rank.top-2 {
    color: #C0C0C0;
    text-shadow: 0 0 10px #C0C0C0;
}

.session-rank.top-3 {
    color: #CD7F32;
    text-shadow: 0 0 10px #CD7F32;
}

.session-name {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-left: 12px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.session-kills {
    font-size: 18px;
    font-weight: 800;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
    min-width: 50px;
    text-align: right;
}

.session-retry-btn {
    width: 100%;
    margin-top: 25px;
    background: linear-gradient(180deg, #7CFC00 0%, #32CD32 100%);
    border: 3px solid #90EE90;
    border-radius: 12px;
    color: #fff;
    font-family: 'Silkscreen', cursive;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 25px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(50, 205, 50, 0.6), 0 5px 0 #228B22;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 0 #228B22;
}

.session-retry-btn:hover {
    background: linear-gradient(180deg, #8CFC00 0%, #42DD42 100%);
    box-shadow: 0 0 30px rgba(50, 205, 50, 0.7), 0 4px 0 #228B22;
    transform: translateY(-2px);
}

.session-retry-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 15px rgba(50, 205, 50, 0.5), 0 2px 0 #228B22;
}

/* ========== SESSION END BUTTON - LOWER LEFT ========== */
.session-end-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 100;
    background: linear-gradient(180deg, #3a3a5a 0%, #1a1a3a 100%);
    border: 2px solid #9932CC;
    border-radius: 8px;
    color: #fff;
    font-family: 'Silkscreen', cursive;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(153, 50, 204, 0.4), 0 2px 0 #4B0082;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 0 #4B0082;
}

.session-end-btn:hover {
    background: linear-gradient(180deg, #4a4a6a 0%, #2a2a4a 100%);
    box-shadow: 0 0 25px rgba(153, 50, 204, 0.6), 0 3px 0 #4B0082;
    transform: translateY(-2px);
}

.session-end-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 10px rgba(153, 50, 204, 0.3), 0 1px 0 #4B0082;
}

/* ========== FULLSCREEN BUTTON - LOWER RIGHT ========== */
.fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 100;
    background: linear-gradient(180deg, #2a4a2a 0%, #1a3a1a 100%);
    border: 2px solid #7CFC00;
    border-radius: 8px;
    color: #7CFC00;
    font-size: 16px;
    font-weight: 700;
    padding: 5px 10px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.4), 0 2px 0 #228B22;
    transition: all 0.2s ease;
}

.fullscreen-btn:hover {
    background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%);
    box-shadow: 0 0 15px rgba(50, 205, 50, 0.6), 0 2px 0 #228B22;
    transform: scale(1.05);
}

.fullscreen-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 8px rgba(50, 205, 50, 0.3), 0 1px 0 #228B22;
}

/* ========== COUNTDOWN DISPLAY AT TOP MIDDLE ========== */
.session-countdown-display {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    animation: countdownFadeIn 0.3s ease;
}

@keyframes countdownFadeIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.8); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.countdown-number {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 15px #9932CC;
    line-height: 1;
    animation: countdownPulse 1s ease-in-out infinite;
    background: linear-gradient(180deg, rgba(60, 20, 80, 0.95) 0%, rgba(30, 10, 50, 0.95) 100%);
    padding: 8px 30px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    box-shadow: 0 0 20px rgba(153, 50, 204, 0.6), inset 0 0 20px rgba(0,0,0,0.3);
}

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

.countdown-label {
    font-size: 12px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 2px;
    margin-top: 6px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8), 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 5px;
}

/* Mobile styles */
@media (max-width: 480px) {
    .session-summary-content {
        padding: 15px 12px;
        border-radius: 15px;
        max-height: 85vh;
    }
    
    .session-title {
        font-size: 20px;
    }
    
    .session-game-info {
        gap: 8px;
    }
    
    .session-stat-row {
        padding: 10px 6px;
    }
    
    .session-stat-label {
        font-size: 9px;
    }
    
    .session-stat-value {
        font-size: 18px;
    }
    
    .session-name {
        font-size: 11px;
    }
    
    .session-end-btn {
        font-size: 9px;
        padding: 6px 10px;
    }
    
    .countdown-number {
        font-size: 36px;
        padding: 6px 20px;
    }
    
    .countdown-label {
        font-size: 10px;
    }
    
    .session-retry-btn {
        font-size: 14px;
        padding: 12px 16px;
        margin-top: 15px;
    }
    
    .session-leaderboard {
        padding: 10px;
    }
    
    .session-leaderboard-title {
        font-size: 13px;
    }
    
    .session-leaderboard-item {
        padding: 8px 10px;
    }
    
    .session-rank {
        font-size: 16px;
        width: 25px;
    }
    
    .session-kills {
        font-size: 14px;
        min-width: 35px;
    }
}

@media (min-width: 769px) {
    .session-end-btn {
        font-size: 11px;
        padding: 6px 14px;
    }
}

/* ========== TOP DESTROYER ========== */
.top-destroyer {
    position: absolute;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: linear-gradient(180deg, rgba(30, 25, 10, 0.85) 0%, rgba(20, 15, 5, 0.85) 100%);
    border: 2px solid #FFD700;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 8px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 8px #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    letter-spacing: 1px;
}

.top-destroyer span {
    color: #fff;
}

/* ========== BOSS DEFEATED POPUP ========== */
.boss-defeated-popup {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 16;
    pointer-events: none;
    text-align: center;
    width: 300px;
}

.boss-defeated-text {
    font-family: 'Silkscreen', cursive;
    font-size: 10px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FF4500, 2px 2px 0 #000;
    padding: 4px 10px;
    background: linear-gradient(180deg, rgba(255, 69, 0, 0.8) 0%, rgba(139, 0, 0, 0.9) 100%);
    border-radius: 8px;
    border: 1px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: bossDefeatPopup 2s ease-out forwards;
    white-space: nowrap;
}

@keyframes bossDefeatPopup {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateY(0) scale(1.1);
    }
    25% {
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Mobile adjustments for corruption and destroyer */
@media (max-width: 768px) {
    .corruption-meter {
        top: 70px !important;
        left: 8px !important;
        min-width: 110px !important;
        padding: 6px 8px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .corruption-header {
        gap: 2px;
    }
    
    .corruption-icon {
        font-size: 6px;
    }
    
    .corruption-label {
        font-size: 8px !important;
    }
    
    .corruption-stage-name {
        font-size: 9px !important;
    }
    
    .corruption-bar-container {
        width: 100%;
    }
    
    .corruption-bar {
        width: 100% !important;
        height: 10px !important;
    }
    
    .corruption-markers {
        font-size: 4px;
    }
    
    .corruption-percent {
        font-size: 8px !important;
    }
    
    .corruption-next {
        font-size: 6px !important;
    }
    
    .top-destroyer {
        top: 130px;
        font-size: 6px;
        padding: 2px 6px;
    }
}
