body {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* When game is active, prevent scrolling */
body.game-active {
    touch-action: none;
    overflow: hidden;
    overscroll-behavior: none;
    height: 100vh;
    width: 100vw;
}

#gameCanvas {
    background-color: var(--bs-dark);
    border: 2px solid var(--bs-info);
    border-radius: 8px;
    max-width: 100%;
    max-height: 100vh;
    height: auto;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.game-info-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 0.5rem;
}

.score-container,
.level-container {
    font-size: 24px;
    color: var(--bs-info);
}

.joystick-zone {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 140px;
    height: 140px;
    display: none;
    background-color: rgba(var(--bs-info-rgb), 0.15);
    border: 3px solid rgba(var(--bs-info-rgb), 0.4);
    border-radius: 50%;
    z-index: 100;
    transition: all 0.2s ease;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform, opacity;
}

.joystick-zone:active {
    background-color: rgba(var(--bs-info-rgb), 0.25);
    border-color: rgba(var(--bs-info-rgb), 0.6);
}

.shoot-joystick-zone {
    position: absolute;
    bottom: 20px;
    right: 180px;
    width: 140px;
    height: 140px;
    display: none;
    background-color: rgba(255, 100, 100, 0.15);
    border: 3px solid rgba(255, 100, 100, 0.4);
    border-radius: 50%;
    z-index: 100;
    transition: all 0.2s ease;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform, opacity;
}

.shoot-joystick-zone:active {
    background-color: rgba(255, 100, 100, 0.25);
    border-color: rgba(255, 100, 100, 0.6);
}

.shoot-button {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: none;
    border: none;
    padding: 0;
    display: none;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.6);
    transition: all 0.15s ease;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform, box-shadow;
}

.shoot-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 25px rgba(255, 100, 100, 0.9);
}

.shoot-button-bg {
    fill: rgba(var(--bs-info-rgb), 0.3);
    stroke: var(--bs-info);
    stroke-width: 2;
}

.shoot-button-cross {
    fill: none;
    stroke: var(--bs-info);
    stroke-width: 2;
}

.shoot-button:active .shoot-button-bg {
    fill: rgba(var(--bs-info-rgb), 0.6);
}

/* Mobile control panel */
.mobile-controls-overlay {
    display: none;
    position: fixed;
    z-index: 990;
    pointer-events: auto;
    background-color: rgba(var(--bs-dark-rgb), 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(var(--bs-info-rgb), 0.35);
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    color: var(--bs-light);
}

body.game-active.mobile-game-active .mobile-controls-overlay {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.game-active.mobile-game-active.mobile-portrait .mobile-controls-overlay {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px;
    border-radius: 0;
    border: none;
}

body.game-active.mobile-game-active.mobile-landscape .mobile-controls-overlay {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
    width: auto;
    padding: 10px 14px;
    align-items: flex-end;
}

.mobile-control-tips {
    font-size: 12px;
    color: rgba(var(--bs-info-rgb), 0.8);
    text-align: center;
}

body.game-active.mobile-game-active.mobile-landscape .mobile-control-tips {
    display: none;
}

.mobile-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.mobile-buttons button {
    padding: 10px 16px;
    font-size: 15px;
    min-width: 80px;
    background-color: rgba(var(--bs-info-rgb), 0.2);
    border: 1px solid rgba(var(--bs-info-rgb), 0.6);
    color: var(--bs-light);
    border-radius: 20px;
    touch-action: manipulation;
    transition: all 0.15s ease;
}

.mobile-buttons button:active {
    background-color: rgba(var(--bs-info-rgb), 0.45);
    transform: scale(0.95);
    border-color: rgba(var(--bs-info-rgb), 0.85);
}

body.game-active.mobile-game-active.mobile-landscape .mobile-buttons {
    justify-content: flex-end;
    gap: 6px;
}

body.game-active.mobile-game-active.mobile-landscape .mobile-buttons button {
    padding: 6px 12px;
    font-size: 13px;
}

.mobile-settings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.game-active.mobile-game-active.mobile-landscape .mobile-settings {
    align-items: flex-end;
}

.mobile-settings-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}

.mobile-settings-row label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

.mobile-settings-select {
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--bs-info-rgb), 0.5);
    color: var(--bs-light);
    border-radius: 14px;
    font-size: 13px;
    padding: 6px 10px;
    min-width: 120px;
}

.mobile-setting-button {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(var(--bs-info-rgb), 0.6);
    color: var(--bs-light);
    border-radius: 18px;
    font-size: 13px;
    padding: 8px 14px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.mobile-setting-button:active {
    transform: scale(0.96);
    background-color: rgba(var(--bs-info-rgb), 0.45);
}

body.game-active.mobile-game-active.mobile-landscape .mobile-setting-button {
    width: 100%;
    text-align: right;
}

/* Mobile score banner */
#mobileScoreBanner {
    display: none;
    position: fixed;
    z-index: 980;
    gap: 0.75rem;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    color: #f1f5fa;
    font-size: 0.95rem;
    align-items: center;
}

.mobile-score-item span {
    font-weight: 600;
    margin-left: 4px;
}

body.game-active.mobile-game-active.mobile-landscape #mobileScoreBanner {
    display: flex;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

body.game-active.mobile-game-active.mobile-portrait #mobileScoreBanner {
    display: none;
}

.d-none {
    display: none !important;
}

body.game-active.mobile-game-active .row.mt-4,
body.game-active.mobile-game-active .game-instructions {
    display: none;
}

/* Mobile layout classes */
body.game-active.mobile-game-active .joystick-zone,
body.game-active.mobile-game-active .shoot-joystick-zone {
    display: block;
}

body.game-active.mobile-game-active.mobile-portrait .joystick-zone,
body.game-active.mobile-game-active.mobile-portrait .shoot-joystick-zone {
    position: fixed;
    bottom: max(120px, calc(env(safe-area-inset-bottom) + 100px));
    width: 130px;
    height: 130px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    backdrop-filter: blur(8px);
}

body.game-active.mobile-game-active.mobile-portrait .joystick-zone {
    left: max(20px, env(safe-area-inset-left));
}

body.game-active.mobile-game-active.mobile-portrait .shoot-joystick-zone {
    right: max(20px, env(safe-area-inset-right));
}

body.game-active.mobile-game-active.mobile-portrait.mobile-controls-swapped .joystick-zone {
    left: auto;
    right: max(20px, env(safe-area-inset-right));
}

body.game-active.mobile-game-active.mobile-portrait.mobile-controls-swapped .shoot-joystick-zone {
    right: auto;
    left: max(20px, env(safe-area-inset-left));
}

body.game-active.mobile-game-active.mobile-landscape .joystick-zone,
body.game-active.mobile-game-active.mobile-landscape .shoot-joystick-zone {
    position: fixed;
    bottom: 50%;
    transform: translateY(50%);
    width: clamp(72px, 8vw, 120px);
    height: clamp(72px, 8vw, 120px);
    background: rgba(0, 0, 0, 0.25);
    border: none;
    backdrop-filter: blur(8px);
    z-index: 1000;
}

body.game-active.mobile-game-active.mobile-landscape .joystick-zone {
    left: max(4vw, env(safe-area-inset-left));
}

body.game-active.mobile-game-active.mobile-landscape .shoot-joystick-zone {
    right: max(4vw, env(safe-area-inset-right));
}

body.game-active.mobile-game-active.mobile-landscape.mobile-controls-swapped .joystick-zone {
    left: auto;
    right: max(4vw, env(safe-area-inset-right));
}

body.game-active.mobile-game-active.mobile-landscape.mobile-controls-swapped .shoot-joystick-zone {
    right: auto;
    left: max(4vw, env(safe-area-inset-left));
}

body.game-active.mobile-game-active .shoot-button {
    display: block;
}

body.game-active.mobile-game-active.mobile-landscape .shoot-button {
    display: none;
}

body.game-active.mobile-game-active.mobile-portrait .shoot-button {
    position: fixed;
    bottom: max(160px, calc(env(safe-area-inset-bottom) + 130px));
    right: max(60px, calc(env(safe-area-inset-right) + 45px));
    width: 80px;
    height: 80px;
    z-index: 1001;
}

body.game-active.mobile-game-active.mobile-portrait.mobile-controls-swapped .shoot-button {
    right: auto;
    left: max(60px, calc(env(safe-area-inset-left) + 45px));
}

body.game-active.mobile-game-active.mobile-portrait .mobile-control-tips {
    display: block;
}

body.game-active.mobile-game-active.mobile-landscape .mobile-control-tips {
    display: none;
}

body.game-active.mobile-game-active.mobile-landscape .row.mb-4 {
    display: none;
}

/* Game instructions */
.game-instructions {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(var(--bs-dark-rgb), 0.7);
    border: 1px solid var(--bs-info);
}

.game-instructions h5 {
    color: var(--bs-info);
    margin-bottom: 1rem;
}

/* Quality and FPS indicators */
.quality-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    letter-spacing: 0.02em;
}

.quality-high,
.quality-medium,
.quality-low {
    color: #34d399;
}

.fps-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    background: none;
    border: none;
    padding: 0;
    letter-spacing: 0.05em;
}

/* Submarine guide */
.submarine-guide,
.powerup-guide {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--bs-info-rgb), 0.3);
}

.submarine-type,
.powerup-type {
    text-align: center;
    margin: 0 10px;
}

.submarine-icon,
.powerup-icon {
    width: 60px;
    height: 30px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 8px;
}

.submarine-icon.standard {
    background-image: url('/static/assets/submarine.svg');
}

.submarine-icon.fast {
    background-image: url('/static/assets/fast-submarine.svg');
}

.submarine-icon.armored {
    background-image: url('/static/assets/armored-submarine.svg');
}

.submarine-icon.mine-layer {
    background-image: url('/static/assets/mine-layer-submarine.svg');
}

.submarine-icon.boss {
    background-image: url('/static/assets/boss-submarine.svg');
    width: 90px;
    height: 45px;
}

.submarine-icon.hunter-boss {
    background-image: url('/static/assets/hunter-boss-submarine.svg');
    width: 90px;
    height: 45px;
}

.powerup-icon {
    width: 25px;
    height: 25px;
}

.powerup-icon.speed {
    background-image: url('/static/assets/speed-powerup.svg');
}

.powerup-icon.rapid-fire {
    background-image: url('/static/assets/rapid-fire-powerup.svg');
}

.powerup-icon.shield {
    background-image: url('/static/assets/shield-powerup.svg');
}

.powerup-icon.magnet {
    background-image: url('/static/assets/magnet-powerup.svg');
}

.powerup-icon.multi-fish {
    background-image: url('/static/assets/multi-fish-powerup.svg');
}

.powerup-icon.time {
    background-image: url('/static/assets/time-powerup.svg');
}

/* Fun powerup styles */
.fun-powerup-guide {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--bs-info-rgb), 0.3);
    background-color: rgba(var(--bs-dark-rgb), 0.5);
    border-radius: 8px;
    padding: 1rem;
    border: 1px dashed var(--bs-info);
}

.fun-powerup-guide h6, 
.special-features h6 {
    color: var(--bs-info);
    margin-bottom: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Special features styling */
.special-features {
    background-color: rgba(var(--bs-info-rgb), 0.1);
    border-radius: 8px;
    padding: 0.8rem;
    border: 1px solid rgba(var(--bs-info-rgb), 0.3);
}

.feature-highlight {
    color: var(--bs-info);
    font-weight: bold;
}

.powerup-icon.seaweed-wig {
    background-image: url('/static/assets/seaweed-wig-powerup.svg');
}

.powerup-icon.karate-kid {
    background-image: url('/static/assets/karate-kid-powerup.svg');
}

.powerup-icon.disco-ball {
    background-image: url('/static/assets/disco-ball-powerup.svg');
}

.powerup-icon.bubble-blower {
    background-image: url('/static/assets/bubble-blower-powerup.svg');
}

.powerup-icon.giant-squid {
    background-image: url('/static/assets/giant-squid-powerup.svg');
}

/* Animation for fun powerup icons in the guide */
@keyframes funPowerupPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.fun-powerup-guide .powerup-icon {
    animation: funPowerupPulse 2s infinite;
}


/* Leaderboard styles - Nautical & Pirate Theme */

/* Pirate Treasure Map Background for Leaderboard Modal */
.underwater-bg {
    background-color: #1a3a52;
    background-image: 
        linear-gradient(135deg, rgba(42, 82, 122, 0.1) 25%, transparent 25%),
        linear-gradient(225deg, rgba(42, 82, 122, 0.1) 25%, transparent 25%),
        linear-gradient(315deg, rgba(42, 82, 122, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, rgba(42, 82, 122, 0.1) 25%, transparent 25%),
        linear-gradient(to bottom, #1a4c7c 0%, #0f2d4d 50%, #0a1f35 100%);
    background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px, 100% 100%;
    background-position: 0 0, 20px 0, 20px -20px, 0 20px, 0 0;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.15),
        inset 0 0 60px rgba(0, 50, 100, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.5);
    border: 3px solid;
    border-image: linear-gradient(135deg, #d4af37, #8b7355, #d4af37, #8b7355) 1;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Rope border decoration */
.underwater-bg::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

/* Nautical compass rose watermark */
.modal-content::before {
    content: '⚓';
    position: absolute;
    font-size: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    color: #d4af37;
}

.modal-header, .modal-footer {
    border-color: rgba(212, 175, 55, 0.3);
    background: linear-gradient(to bottom, rgba(26, 60, 82, 0.8), rgba(15, 45, 77, 0.6));
    position: relative;
    z-index: 1;
}

.modal-header {
    border-bottom: 3px double rgba(212, 175, 55, 0.5);
}

.modal-footer {
    border-top: 3px double rgba(212, 175, 55, 0.5);
}

#leaderboardModalLabel {
    color: #ffd700;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 215, 0, 0.3);
    font-weight: bold;
    letter-spacing: 1px;
    font-family: Georgia, serif;
}

/* Pirate Flag Themed Tabs */
#leaderboardTabs {
    border-bottom: 3px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(to bottom, rgba(20, 30, 48, 0.6), transparent);
    padding: 0.5rem 0 0 0;
    position: relative;
    z-index: 1;
}

#leaderboardTabs .nav-link {
    color: #c9a86a;
    background: linear-gradient(to bottom, rgba(30, 50, 70, 0.7), rgba(20, 40, 60, 0.5));
    border: 2px solid rgba(139, 115, 85, 0.5);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

#leaderboardTabs .nav-link:hover {
    color: #ffd700;
    background: linear-gradient(to bottom, rgba(42, 82, 122, 0.9), rgba(30, 60, 90, 0.7));
    border-color: rgba(212, 175, 55, 0.7);
    transform: translateY(-2px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 215, 0, 0.2),
        0 4px 12px rgba(255, 215, 0, 0.2);
}

#leaderboardTabs .nav-link.active {
    color: #ffd700;
    background: linear-gradient(to bottom, rgba(60, 100, 140, 1), rgba(40, 80, 120, 0.9));
    border-color: #d4af37;
    border-width: 3px;
    font-weight: 700;
    box-shadow: 
        inset 0 2px 4px rgba(255, 215, 0, 0.3),
        0 -2px 8px rgba(255, 215, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

/* Treasure Chest Themed Leaderboard Table */
.leaderboard-table {
    width: 100%;
    table-layout: fixed;
    background: linear-gradient(to bottom, rgba(15, 30, 50, 0.85), rgba(10, 20, 35, 0.9));
    border: 2px solid rgba(139, 115, 85, 0.5);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* Column width distribution */
.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
    width: 10%;
    min-width: 35px;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    width: 30%;
    min-width: 80px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3) {
    width: 20%;
    min-width: 60px;
}

.leaderboard-table th:nth-child(4),
.leaderboard-table td:nth-child(4) {
    width: 40%;
    min-width: 100px;
    font-size: 0.85em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.leaderboard-table thead {
    background: linear-gradient(to bottom, rgba(60, 100, 140, 0.6), rgba(40, 80, 120, 0.8));
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
}

.leaderboard-table th {
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.3);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 1rem 0.75rem;
}

.leaderboard-table td {
    color: #b8956f;
    border-color: rgba(139, 115, 85, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Treasure Rankings - Gold, Silver, Bronze with Pirate Flair */
.leaderboard-table tbody tr:nth-child(1) {
    background: 
        linear-gradient(90deg, 
            rgba(255, 215, 0, 0.25) 0%, 
            rgba(255, 223, 0, 0.35) 50%, 
            rgba(255, 215, 0, 0.25) 100%);
    border-left: 4px solid #ffd700;
    border-right: 4px solid #ffd700;
    box-shadow: 
        inset 0 0 20px rgba(255, 215, 0, 0.2),
        0 0 15px rgba(255, 215, 0, 0.3);
}

.leaderboard-table tbody tr:nth-child(1) td {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-table tbody tr:nth-child(1) th::before {
    content: '👑 ';
}

.leaderboard-table tbody tr:nth-child(2) {
    background: 
        linear-gradient(90deg, 
            rgba(192, 192, 192, 0.2) 0%, 
            rgba(220, 220, 220, 0.3) 50%, 
            rgba(192, 192, 192, 0.2) 100%);
    border-left: 3px solid #c0c0c0;
    border-right: 3px solid #c0c0c0;
    box-shadow: 
        inset 0 0 15px rgba(192, 192, 192, 0.15),
        0 0 10px rgba(192, 192, 192, 0.2);
}

.leaderboard-table tbody tr:nth-child(2) td {
    color: #e0e0e0;
    font-weight: 600;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.7),
        0 0 8px rgba(192, 192, 192, 0.4);
}

.leaderboard-table tbody tr:nth-child(2) th::before {
    content: '⚔️ ';
}

.leaderboard-table tbody tr:nth-child(3) {
    background: 
        linear-gradient(90deg, 
            rgba(205, 127, 50, 0.2) 0%, 
            rgba(218, 165, 32, 0.3) 50%, 
            rgba(205, 127, 50, 0.2) 100%);
    border-left: 2px solid #cd7f32;
    border-right: 2px solid #cd7f32;
    box-shadow: 
        inset 0 0 12px rgba(205, 127, 50, 0.15),
        0 0 8px rgba(205, 127, 50, 0.2);
}

.leaderboard-table tbody tr:nth-child(3) td {
    color: #daa520;
    font-weight: 600;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.7),
        0 0 8px rgba(218, 165, 32, 0.3);
}

.leaderboard-table tbody tr:nth-child(3) th::before {
    content: '🗡️ ';
}

/* Hover effects for all rows */
.leaderboard-table tbody tr {
    transition: all 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(60, 100, 140, 0.3);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* Responsive styles */

/* Level up animation */
@keyframes levelUp {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-animation {
    animation: levelUp 0.5s ease-in-out;
}

/* Particle effects */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Leaderboard entry animation */
@keyframes newScoreHighlight {
    0% { background-color: rgba(var(--bs-info-rgb), 0.5); }
    50% { background-color: rgba(var(--bs-info-rgb), 0.2); }
    100% { background-color: rgba(var(--bs-info-rgb), 0.5); }
}

.new-score-highlight {
    animation: newScoreHighlight 1.5s ease-in-out infinite;
}

/* Responsive Media Queries for All Screen Sizes */

/* Mobile screens (phones, portrait) */
@media (max-width: 576px) {
    /* Leaderboard modal adjustments */
    #leaderboardModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Smaller tab padding on mobile */
    #leaderboardTabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Compact leaderboard table */
    .leaderboard-table {
        font-size: 0.85rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Smaller modal title */
    #leaderboardModalLabel {
        font-size: 1.1rem;
    }
    
    /* Stack name entry modal content better */
    #nameEntryModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Tablets (portrait and small landscape) */
@media (min-width: 577px) and (max-width: 768px) {
    /* Comfortable modal sizing for tablets */
    #leaderboardModal .modal-dialog {
        max-width: 90%;
    }
    
    #leaderboardTabs .nav-link {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .leaderboard-table {
        font-size: 0.9rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.6rem 0.5rem;
    }
}

/* Large tablets and small desktops */
@media (min-width: 769px) and (max-width: 992px) {
    #leaderboardModal .modal-dialog {
        max-width: 700px;
    }
    
    .leaderboard-table {
        font-size: 0.95rem;
    }
}

/* Desktop and larger screens */
@media (min-width: 993px) {
    #leaderboardModal .modal-dialog {
        max-width: 800px;
    }
    
    .leaderboard-table {
        font-size: 1rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem;
    }
}

/* Very small mobile devices (landscape phones) */
@media (max-width: 400px) {
    #leaderboardTabs .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .leaderboard-table {
        font-size: 0.75rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.4rem 0.2rem;
    }
    
    #leaderboardModalLabel {
        font-size: 1rem;
    }
}

/* Ensure table is always scrollable on very small screens */
@media (max-width: 576px) {
    .modal-body {
        overflow-x: auto;
    }
    
    .leaderboard-table {
        min-width: 100%;
    }
}

/* High-resolution displays (Retina, 4K) */
@media (min-resolution: 2dppx) {
    .leaderboard-table {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
