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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* =======================
   Multiplayer Leaderboard
   ======================= */
.multiplayer-leaderboard {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: 600px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 900;
    overflow: hidden;
}

.mp-leaderboard-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.mp-player-count {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 8px;
}

.mp-leaderboard-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mp-leaderboard-list {
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.mp-leaderboard-list::-webkit-scrollbar {
    width: 6px;
}

.mp-leaderboard-list::-webkit-scrollbar-track {
    background: transparent;
}

.mp-leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.mp-leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.mp-leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.mp-leaderboard-first {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.mp-leaderboard-you {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(52, 152, 219, 0.15) 100%);
    border: 2px solid #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.mp-rank {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    min-width: 30px;
    text-align: center;
}

.mp-player-info {
    flex: 1;
    margin: 0 10px;
    overflow: hidden;
}

.mp-player-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-player-stats {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.mp-level {
    color: #4CAF50;
}

.mp-kills {
    color: #e74c3c;
}

.mp-score {
    font-size: 14px;
    font-weight: bold;
    color: #FFD700;
    white-space: nowrap;
}

.mp-leaderboard-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.mp-your-rank {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 13px;
    color: #3498db;
    font-weight: bold;
}

/* Canvas */
#gameCanvas {
    display: block;
    cursor: none;
    background-color: #2c3e50;
}

/* Screen States */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    z-index: 1000;
}

.screen.active {
    display: flex;
}

/* Modal Styling */
.modal {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 60px;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

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

.game-title {
    font-size: 48px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

#playerNameInput {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #3498db;
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}

#playerNameInput:focus {
    border-color: #2980b9;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

button:active {
    transform: translateY(0);
}

.name-validation-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* Authentication Modal */
.auth-modal {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
}

.auth-tab:hover {
    color: #3498db;
    background: none;
    transform: none;
    box-shadow: none;
}

.auth-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #3498db;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.form-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

.form-success {
    color: #27ae60;
    font-size: 14px;
    margin-top: 10px;
}

.auth-submit-btn {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
}

.guest-play-btn {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: #95a5a6;
}

.guest-play-btn:hover {
    background: #7f8c8d;
}

/* Logout button in name entry */
.logout-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: #e74c3c;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c0392b;
}

.logout-btn.hidden {
    display: none;
}

/* Logged in user info */
.logged-in-info {
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #2e7d32;
    font-size: 14px;
}

.logged-in-info.hidden {
    display: none;
}

.logged-in-info strong {
    color: #1b5e20;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
}

.auth-link:hover {
    text-decoration: underline;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
}

/* Multiplayer Toggle */
.multiplayer-toggle {
    margin: 20px 0;
    text-align: left;
}

.multiplayer-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    cursor: pointer;
    justify-content: center;
}

.multiplayer-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.multiplayer-status {
    margin-top: 8px;
    font-size: 14px;
    min-height: 20px;
    text-align: center;
}

.multiplayer-status.connected {
    color: #4CAF50;
}

.multiplayer-status.connecting {
    color: #FFA500;
}

.multiplayer-status.error {
    color: #e74c3c;
}

/* Multiplayer Leaderboard */
.multiplayer-leaderboard {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    min-width: 200px;
    max-width: 250px;
    font-family: Arial, sans-serif;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.multiplayer-leaderboard h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    color: #FFD700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.mp-leaderboard-content {
    font-size: 13px;
}

.mp-player-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mp-player-entry.you {
    background: rgba(76, 175, 80, 0.2);
    border-radius: 4px;
    padding: 5px;
    font-weight: bold;
}

.mp-player-entry.top-1 {
    color: #FFD700;
}

.mp-player-entry.top-2 {
    color: #C0C0C0;
}

.mp-player-entry.top-3 {
    color: #CD7F32;
}

.mp-rank {
    min-width: 25px;
    font-weight: bold;
}

.mp-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 5px;
}

.mp-score {
    font-weight: bold;
    color: #4CAF50;
}

.mp-your-rank {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    font-size: 12px;
    color: #FFD700;
}

/* Additional Multiplayer Leaderboard Styles */
.mp-leaderboard-header {
    margin-bottom: 10px;
}

.mp-player-count {
    font-size: 12px;
    color: #4CAF50;
    text-align: center;
    margin-bottom: 5px;
}

.mp-leaderboard-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    color: #FFD700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.mp-leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.mp-leaderboard-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

.mp-leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.mp-leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mp-leaderboard-you {
    background: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4CAF50;
    font-weight: bold;
}

.mp-leaderboard-first {
    color: #FFD700;
}

.mp-player-info {
    flex: 1;
    margin: 0 10px;
}

.mp-player-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-player-stats {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.mp-level {
    color: #FFD700;
    margin-right: 8px;
}

.mp-kills {
    color: #e74c3c;
}

/* Leaderboard Modal */
.leaderboard-modal {
    background: white;
    padding: 0;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 28px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: none;
}

.leaderboard-tabs {
    display: flex;
    border-bottom: 2px solid #ecf0f1;
    background: #f8f9fa;
}

.lb-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
}

.lb-tab:hover {
    color: #667eea;
    background: #fff;
    transform: none;
    box-shadow: none;
}

.lb-tab.active {
    color: #667eea;
    background: white;
    border-bottom-color: #667eea;
}

.leaderboard-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.player-rank-display {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.player-rank-display.hidden {
    display: none;
}

.player-rank-display h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.rank-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.rank-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
    text-align: center;
}

.rank-info {
    flex: 1;
    font-size: 16px;
    color: #2c3e50;
}

.rank-percentile {
    font-size: 14px;
    color: #27ae60;
    font-weight: bold;
}

.leaderboard-table {
    background: white;
    border-radius: 10px;
}

.leaderboard-table.hidden {
    display: none;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    color: #7f8c8d;
    font-size: 14px;
}

.table-entries {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s;
}

.leaderboard-entry:hover {
    background: #f8f9fa;
}

.leaderboard-entry.current-player {
    background: #667eea20;
    font-weight: bold;
}

.entry-rank {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.entry-rank.gold {
    color: #f39c12;
}

.entry-rank.silver {
    color: #95a5a6;
}

.entry-rank.bronze {
    color: #cd7f32;
}

.entry-player {
    font-size: 16px;
    color: #2c3e50;
}

.entry-value {
    font-size: 16px;
    color: #667eea;
    font-weight: bold;
    text-align: right;
}

.leaderboard-footer {
    text-align: center;
    padding: 15px;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
}

.col-rank, .col-player, .col-value {
    text-align: left;
}

.col-value {
    text-align: right;
}

/* Game HUD */
#gameHUD {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    color: white;
    font-family: Arial, sans-serif;
}

#gameHUD.hidden {
    display: none;
}

.hud-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 20px;
    border-radius: 10px;
    min-width: 250px;
}

.player-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #3498db;
}

.level-display {
    font-size: 16px;
    margin-bottom: 8px;
}

.exp-bar-container {
    position: relative;
    width: 100%;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 5px;
}

.exp-bar {
    height: 100%;
    background: linear-gradient(90deg, #f39c12 0%, #f1c40f 100%);
    transition: width 0.3s;
    border-radius: 12px;
    width: 0%;
}

.exp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 20px;
    border-radius: 10px;
    min-width: 250px;
}

.health-bar-container {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    transition: width 0.3s;
    border-radius: 15px;
    width: 100%;
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-points-display {
    font-size: 16px;
    color: #f1c40f;
    animation: pulse 1s infinite;
}

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

/* Player Stats Display */
/* Player Stats Display */
.stat-points-notification {
    margin-top: 15px;
    margin-bottom: 10px;
    background: rgba(241, 196, 60, 0.9);
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
    animation: blink 1.5s ease-in-out infinite;
}

.stat-points-notification.active {
    display: block;
}

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

.points-available {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 3px;
}

.upgrade-hint {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
}

.player-stats-display {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    position: relative;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-upgrade-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-upgrade-btn:hover {
    background: #229954;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.stat-upgrade-btn:active {
    transform: scale(1.05);
}

.stat-upgrade-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.5;
}

.stat-upgrade-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.stat-label {
    font-size: 11px;
    font-weight: bold;
    color: #ecf0f1;
    width: 40px;
    text-align: left;
}

.stat-level {
    font-size: 11px;
    font-weight: bold;
    color: #3498db;
    width: 25px;
    text-align: center;
}

.stat-bars {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.stat-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.hud-bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 20px;
    border-radius: 10px;
}

.kill-counter {
    font-size: 18px;
    font-weight: bold;
}

.autofire-indicator {
    margin-top: 10px;
    padding: 8px 15px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-align: center;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Stat Upgrade Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.hidden {
    display: none;
}

.stat-modal {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.stat-modal h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

.stat-points-remaining {
    color: #f39c12;
    font-size: 18px;
    margin-bottom: 25px;
    font-weight: bold;
}

.stat-rows {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ecf0f1;
    padding: 15px 20px;
    border-radius: 10px;
    transition: all 0.3s;
}

.stat-row:hover {
    background: #d5dbdb;
    transform: translateX(5px);
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.stat-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    min-width: 160px;
}

.stat-value {
    font-size: 18px;
    color: #3498db;
    font-weight: bold;
    min-width: 60px;
}

.stat-btn {
    padding: 8px 20px;
    font-size: 20px;
    font-weight: bold;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s;
}

.stat-btn:hover {
    background: #229954;
    transform: scale(1.1);
}

.stat-description {
    font-size: 14px;
    color: #7f8c8d;
    min-width: 100px;
    text-align: right;
}

/* Death Screen */
.death-modal {
    background: rgba(44, 62, 80, 0.95);
    color: white;
    min-width: 400px;
}

.death-title {
    color: #e74c3c;
    font-size: 48px;
    margin-bottom: 30px;
}

.death-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.death-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 18px;
}

.death-stat.score-stat {
    background: rgba(241, 196, 60, 0.2);
    border: 2px solid #f39c12;
    padding: 15px 25px;
    margin-bottom: 10px;
}

.death-stat.score-stat .stat-label {
    font-size: 22px;
    color: #f1c40f;
    font-weight: bold;
}

.death-stat.score-stat .stat-value {
    font-size: 28px;
    color: #f39c12;
}

.stat-label {
    font-weight: normal;
    color: #bdc3c7;
}

.stat-value {
    font-weight: bold;
    color: #3498db;
}

#playAgainBtn {
    background: #e74c3c;
}

#playAgainBtn:hover {
    background: #c0392b;
}

/* Pause Screen */
.pause-modal {
    background: rgba(44, 62, 80, 0.98);
    color: white;
    min-width: 400px;
    text-align: center;
}

.pause-title {
    color: #f39c12;
    font-size: 56px;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.pause-hint {
    font-size: 16px;
    color: #bdc3c7;
    margin-bottom: 30px;
}

.pause-btn {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s;
}

.pause-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.pause-btn.quit-btn {
    background: #e74c3c;
}

.pause-btn.quit-btn:hover {
    background: #c0392b;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* Crosshair (rendered on canvas but styled here for reference) */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hud-top-left,
    .hud-top-right {
        min-width: 200px;
        padding: 10px 15px;
        font-size: 14px;
    }

    .game-title {
        font-size: 36px;
    }

    .stat-modal {
        padding: 20px;
    }
}
