/* ===== BODY ===== */
body {
    background: #111 url("/new-img/sl-bg-2.jpg") center/cover no-repeat;
    color: white;
    margin: 0;
    font-family: 'Bungee', cursive;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
    height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar-custom {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    padding: 10px 20px;
}
.navbar-brand {
    font-size: 26px;
    font-weight: 700;
    color: #fff !important;
}
.btn-success1 {
    background-color: #1b1b1b;
    border: 1px solid #00ff99;
    border-radius: 15px;
    font-weight: 500;
    color: #00ff99 !important;
    transition: 0.3s ease;
}
.btn-success1:hover {
    background-color: #00ff99;
    color: #111 !important;
}

/* ===== GAME CONTAINER ===== */
.game-container {
    width: 100%;
    max-width: 950px;
    height: 500px;
    background: #1b1b1b;
    border-radius: 15px;
    margin: 40px auto 20px;
    position: relative;
    overflow: hidden;
    border: 2px solid #333;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== GAME BUTTONS ===== */
.game-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.game-buttons button {
    width: 160px;
    margin: 10px;
    font-weight: bold;
    border-radius: 10px;
    border: none;
    background: #2a2a2a;
    color: #fff;
    transition: all 0.2s ease;
}
.game-buttons button:hover {
    transform: scale(1.05);
    background: #00ff99;
    color: #111;
}

/* ===== MUSIC BUTTON ===== */
.music-btn {
    position: absolute;
    top: 15px;
    left: 55%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    pointer-events: auto;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.music-btn:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    transform: translateX(-50%) scale(1.1);
}

.music-btn i {
    color: #00ff99;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}


@media (max-width:768px){
    .music-btn {
    position: absolute;
    top: 7px;
    left: 62%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    pointer-events: auto;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.music-btn:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    transform: translateX(-50%) scale(1.1);
}

.music-btn i {
    color: #00ff99;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

}

/* ===== PAUSE BUTTON ===== */
.pause-btn {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    pointer-events: auto;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.pause-btn:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    transform: translateX(-50%) scale(1.1);
}

.pause-btn i {
    color: #00ff99;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* ===== HUD ===== */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    font-family: 'Sora', sans-serif;
}

/* ===== TOP LEFT SECTION ===== */
.hud-top-left {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== TOP RIGHT SECTION ===== */
.hud-top-right {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== HUD ITEM CONTAINER ===== */
.hud-item-container {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

/* ===== ICON BOX (Left side with icons) ===== */
.hud-icon-box {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
}

.hud-icon-box::before {
    content: '';
    position: absolute;
    inset: -6px;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border-radius: 10px;
    z-index: -1;
}

.hud-icon-box i {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.hud-icon-box img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Icon specific colors */
.health-icon i {
    color: #ff1e5a;
}

.score-icon i {
    color: #ffd700;
}

.coin-icon {
    background: linear-gradient(135deg, #3a2a1a 0%, #2a1a0a 100%);
}

.powerup-icon {
    background: linear-gradient(135deg, #3a1a5a 0%, #2a0a4a 100%);
}

/* ===== BAR CONTAINER (Right side with bars/content) ===== */
.hud-bar-container {
    min-width: 220px;
    height: 50px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-left: none;
    border-radius: 0 8px 8px 0;
    position: relative;
    margin-left: -3px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
}

.hud-bar-container1 {
    min-width: 110px;
    height: 50px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-left: none;
    border-radius: 0 8px 8px 0;
    position: relative;
    margin-left: -3px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
}

/* ===== HAZARD STRIPES (Yellow/Black stripes at bottom) ===== */
.hazard-stripes {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
 background: repeating-linear-gradient(
    45deg,
    #c62828 0px,
    #c62828 10px,
    #ffffff 10px,
    #ffffff 20px
);
    border-radius: 0 0 5px 0;
}

/* ===== HEALTH BARS ===== */
.health-bars {
    display: flex;
    gap: 8px;
    width: 100%;
}

.health-bar {
    flex: 1;
    height: 18px;
    background: linear-gradient(180deg, #ff1e5a 0%, #d91848 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5);
    border: 2px solid #5a0a20;
}

.health-bar::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    border-radius: 2px;
}

.health-bar.lost {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #1a1a1a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ===== SCORE CONTENT ===== */
.score-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
}

.score-content span {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        2px 2px 0 #000,
        0 0 8px rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
}

/* ===== COINS CONTENT ===== */
.coins-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
}

.coins-content span {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        2px 2px 0 #000,
        0 0 8px rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
}

/* ===== POWERUP TIMER ===== */
.powerup-timer-display {
    display: none;
}

.powerup-timer-display.active {
    display: flex;
}

.powerup-timer-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
}

#powerupTimer {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        2px 2px 0 #000,
        0 0 8px rgba(156, 39, 176, 0.8);
    letter-spacing: 1px;
}

.powerup-icon img {
    animation: powerupPulse 1.5s ease-in-out infinite;
}

@keyframes powerupPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== HUD POPUPS ===== */
.hud-popup {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
    padding: 12px 30px;
    border-radius: 8px;
    color: white;
    font-size: 22px;
    font-weight: bold;
    pointer-events: none;
    transition: 0.3s ease;
    text-shadow: 2px 2px 0 #000;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.hud-popup::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        45deg,
        #000 0px,
        #000 6px,
        #ffd700 6px,
        #ffd700 12px
    );
}

.hud-popup.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.hud-popup.boost {
    border-color: #9c27b0;
}

.hud-popup.boost::after {
    background: repeating-linear-gradient(
        45deg,
        #000 0px,
        #000 6px,
        #9c27b0 6px,
        #9c27b0 12px
    );
}

.hud-popup.slow {
    border-color: #00d4ff;
}

.hud-popup.slow::after {
    background: repeating-linear-gradient(
        45deg,
        #000 0px,
        #000 6px,
        #00d4ff 6px,
        #00d4ff 12px
    );
}

/* Remove old HUD styles */
.hud-box,
#livesHUD,
.life-heart,
#speedHUD {
    display: none !important;
}

/* ===== MOBILE CONTROL BUTTONS ===== */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 9998;
}

.mobile-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.left-controls {
    align-items: flex-start;
}

.right-controls {
    align-items: flex-end;
}

.mobile-control-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #3d3d3d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.mobile-control-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    box-shadow: 
        inset 0 2px 6px rgba(0, 0, 0, 0.7),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.mobile-control-btn i {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

/* Backward Button (Left - Top) */
.backward-control-btn {
    border-color: #ffaa00;
}

.backward-control-btn i {
    color: #ffaa00;
}

.backward-control-btn:active {
    border-color: #ff9900;
}

/* Slide Button (Left - Bottom) */
.slide-control-btn {
    border-color: #ff6b6b;
}

.slide-control-btn i {
    color: #ff6b6b;
}

.slide-control-btn:active {
    border-color: #ee5a6f;
}

/* Forward Button (Right - Top) */
.forward-control-btn {
    border-color: #00ccff;
}

.forward-control-btn i {
    color: #00ccff;
}

.forward-control-btn:active {
    border-color: #00aadd;
}

/* Jump Button (Right - Bottom) */
.jump-control-btn {
    border-color: #00ff99;
}

.jump-control-btn i {
    color: #00ff99;
}

.jump-control-btn:active {
    border-color: #00cc78;
}

/* Show mobile controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}

/* ===== START SCREEN ===== */
.start-screen {
    position: absolute;
    inset: 0;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    pointer-events: none;
    z-index: 99;
}

.start-screen button {
    pointer-events: auto;
}

.start-screen h1 {
    font-size: 60px;
    color: #c62828; /* candy cane red */
    font-weight: 700;
}

.start-screen p {
    margin-top: 10px;
    font-size: 16px;
    color: #aaa;
    max-width: 500px;
}

.start-btn {
    margin-top: 25px;
    padding: 18px 50px;
    font-size: 26px;
   background: linear-gradient(45deg, #b71c1c, #f5f5f5, #b71c1c);

    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #111;
    font-weight: 700;
    transition: 0.2s ease;
}

.start-btn:hover {
    background: linear-gradient(
        45deg,
        #b71c1c,
        #ffffff,
        #b71c1c
    );
    transform: scale(1.05);
}


/* ===== END GAME MODAL ===== */
.game-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.game-modal.show {
    display: flex;
}

.modal-content {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    color: white;
    border: 2px solid #444;
    box-sizing: border-box;
    position: relative;
    z-index: 1000000;
}

.modal-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #00ff99;
}

.modal-content button,
.restart-btn {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: #00ff99;
    color: #111;
    cursor: pointer;
    transition: 0.2s ease;
}
.modal-content button:hover,
.restart-btn:hover {
    background: #004E38;
}

/* Leaderboard Modal Styles */
.leaderboard-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-list {
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin: 10px 0;
    background: linear-gradient(135deg, rgba(42, 39, 218, 0.1), rgba(0, 204, 255, 0.1));
    border: 2px solid rgba(0, 204, 255, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    border-color: rgba(0, 204, 255, 0.6);
    box-shadow: 0 5px 15px rgba(0, 204, 255, 0.3);
}

.leaderboard-item .rank {
    font-size: 24px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.leaderboard-item .player-name {
    flex: 1;
    font-size: 18px;
    margin: 0 15px;
    color: #fff;
    font-weight: 500;
}

.leaderboard-item .player-score,
.leaderboard-item .player-coins {
    font-size: 16px;
    font-weight: bold;
    margin-left: 15px;
    color: #00ccff;
}

.leaderboard-item .player-coins {
    color: gold;
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 20px;
    }
    
    .navbar-custom img {
        height: 50px !important;
    }
    
    .btn-success1 {
        padding: 8px 16px !important;
        font-size: 14px;
    }
    
    .game-container {
        width: 95vw;
        height: 60vh;
        max-height: 450px;
        margin: 20px auto;
        border-radius: 10px;
    }
    
    #gameCanvas {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Smaller HUD elements */
    .hud-icon-box {
        width: 40px;
        height: 40px;
    }
    
    .hud-icon-box img {
        width: 24px;
        height: 24px;
    }
    
    .hud-icon-box i {
        font-size: 20px;
    }
    
    .hud-bar-container {
        min-width: 150px;
        height: 40px;
        padding: 6px 8px;
    }
    
    .hud-bar-container1 {
        min-width: 80px;
        height: 40px;
        padding: 6px 8px;
    }
    
    .health-bar {
        height: 14px;
    }
    
    .score-content span {
        font-size: 20px;
    }
    
    .coins-content span {
        font-size: 18px;
    }
    
    #powerupTimer {
        font-size: 16px;
    }
    
    .hud-top-left,
    .hud-top-right {
        top: 10px;
        gap: 8px;
    }
    
    .hud-top-left {
        left: 10px;
    }
    
    .hud-top-right {
        right: 10px;
    }
    
    .pause-btn {
        width: 40px;
        height: 40px;
        top: 10px;
    }
    
    .pause-btn i {
        font-size: 18px;
    }
    
    .hud-popup {
        font-size: 16px;
        padding: 8px 20px;
        top: 70px;
    }
    
    .mobile-controls {
        bottom: 15px;
        padding: 0 15px;
        display: flex;
    }
    
    .mobile-control-btn {
        width: 65px;
        height: 65px;
    }
    
    .mobile-control-btn i {
        font-size: 24px;
    }
    
    .mobile-control-group {
        gap: 10px;
    }
    
    .start-screen h1 {
        font-size: 36px;
    }
    
    .start-screen p {
        font-size: 14px;
        padding: 0 20px;
    }
    
    .start-btn {
        padding: 14px 35px;
        font-size: 20px;
    }
    
    .game-buttons button {
        width: 130px;
        margin: 5px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 90vw;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    .modal-content h3 {
        font-size: 18px;
    }
    
    .modal-content p,
    .modal-content li {
        font-size: 14px;
    }
    
    .leaderboard-item {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .leaderboard-item .rank {
        font-size: 18px;
        min-width: 40px;
    }
    
    .leaderboard-item .player-name {
        font-size: 14px;
        margin: 0 10px;
    }
    
    .leaderboard-item .player-score,
    .leaderboard-item .player-coins {
        font-size: 13px;
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 18px;
    }
    
    .game-container {
        height: 55vh;
        max-height: 400px;
    }
    
    .hud-icon-box {
        width: 35px;
        height: 35px;
    }
    
    .hud-icon-box img {
        width: 20px;
        height: 20px;
    }
    
    .hud-icon-box i {
        font-size: 18px;
    }
    
    .hud-bar-container {
        min-width: 120px;
        height: 35px;
    }
    
    .hud-bar-container1 {
        min-width: 65px;
        height: 35px;
    }
    
    .score-content span {
        font-size: 18px;
    }
    
    .coins-content span {
        font-size: 16px;
    }
    
    .hud-popup {
        font-size: 14px;
        padding: 6px 15px;
    }
    
    .mobile-controls {
        bottom: 12px;
        padding: 0 12px;
    }
    
    .mobile-control-btn {
        width: 60px;
        height: 60px;
    }
    
    .mobile-control-btn i {
        font-size: 22px;
    }
    
    .mobile-control-group {
        gap: 8px;
    }
    
    .start-screen h1 {
        font-size: 28px;
    }
    
    .start-screen p {
        font-size: 12px;
    }
    
    .start-btn {
        padding: 12px 30px;
        font-size: 18px;
    }
    
    .game-buttons button {
        width: 110px;
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Landscape mode for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        height: 85vh;
        margin: 10px auto;
    }
    
    .hud-top-left,
    .hud-top-right {
        top: 5px;
        gap: 5px;
    }
    
    .pause-btn {
        top: 5px;
    }
    
    .mobile-controls {
        bottom: 8px;
    }
    
    .mobile-control-btn {
        width: 55px;
        height: 55px;
    }
    
    .mobile-control-btn i {
        font-size: 20px;
    }
    
    .mobile-control-group {
        gap: 6px;
    }
}


