/* Fiep.io Styles - Game UI */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Ubuntu', sans-serif;
    overflow: hidden;
    background: #cdcdcd;
    cursor: crosshair;
}

/* Start Screen - Diep.io Style */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: brightness(0.5) saturate(0.8);
}

.start-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.game-title {
    font-size: 96px;
    font-weight: 700;
    color: #fff;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    margin-bottom: 30px;
    letter-spacing: -2px;
    position: relative;
}

/* Version tag - fixed bottom left */
#version-tag {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    z-index: 9999;
    pointer-events: none;
    font-family: 'Ubuntu', sans-serif;
}

.input-container {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

#player-name {
    width: 280px;
    padding: 14px 18px;
    font-size: 16px;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 4px 0 0 4px;
    background: rgba(255,255,255,0.95);
    color: #333;
    outline: none;
}

#player-name:focus {
    background: #fff;
}

#play-button {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 0 4px 4px 0;
    background: #75dd34;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: lowercase;
}

#play-button:hover {
    background: #68c72e;
}

.game-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 70px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.mode-name {
    font-size: 13px;
}

.mode-players {
    font-size: 10px;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
}

.mode-btn.active .mode-players {
    background: rgba(0, 0, 0, 0.3);
}

/* Region Selector */
.region-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
    max-width: 500px;
}

.region-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.region-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.region-btn.active {
    background: rgba(0, 178, 225, 0.4);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 178, 225, 0.3);
}

.region-flag {
    font-size: 14px;
}

.region-name {
    font-weight: 600;
}

.region-ping {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.region-btn.active .region-ping {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.region-ping.good { color: #4ade80; }
.region-ping.medium { color: #fbbf24; }
.region-ping.bad { color: #f87171; }

.server-info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.player-count {
    color: rgba(255, 255, 255, 0.6);
}

.spectator-count {
    color: rgba(255, 255, 255, 0.4);
    margin-left: 10px;
    font-size: 11px;
}

.server-status {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 3px;
}

.server-status.online {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.server-status.offline {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

.server-status.connecting {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

/* Spectator Leaderboard - matches gameplay leaderboard exactly */
.spectator-leaderboard {
    position: fixed;
    top: 10px;
    right: 10px;
    min-width: 200px;
    z-index: 5;
}

.spectator-leaderboard .leaderboard-title {
    color: #4f4f4f;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.spectator-leaderboard .leaderboard-title::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #4f4f4f;
    transform: rotate(45deg);
}

.spectator-leaderboard .leaderboard-entry {
    display: flex;
    align-items: center;
    margin: 2px 0;
    height: 22px;
    position: relative;
}

.spectator-leaderboard .leaderboard-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #43b54b;
    border-radius: 2px;
    z-index: -1;
    transition: width 0.3s ease;
}

.spectator-leaderboard .leaderboard-entry.player .leaderboard-bar {
    background: #00b2e1;
}

.spectator-leaderboard .leaderboard-tank {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #43b54b;
    border: 2px solid rgba(0,0,0,0.2);
    margin-right: 5px;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.spectator-leaderboard .leaderboard-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    padding: 2px 6px;
    z-index: 1;
    position: relative;
}

.spectator-leaderboard .leaderboard-name {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spectator-leaderboard .leaderboard-score {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    margin-left: 3px;
}

.spectator-leaderboard .leaderboard-score::before {
    content: ' - ';
}

/* Canvas */
#game-canvas {
    display: block;
    background: #cdcdcd;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Game UI */
#game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

#game-ui.active {
    display: block;
}

#game-ui > * {
    pointer-events: auto;
}

/* ============================================
   LEADERBOARD / SCOREBOARD - Right Side (diep.io style)
   ============================================ */
#leaderboard {
    position: fixed;
    top: 10px;
    right: 10px;
    min-width: 200px;
}

/* Debug mode: Big scoreboard for testing */
#leaderboard.debug-big {
    transform: scale(4);
    transform-origin: top right;
    background: rgba(255,255,255,0.98);
    padding: 25px;
    border: 4px solid #333;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

#leaderboard.debug-big .leaderboard-tank-icon-svg {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

#leaderboard.debug-big .leaderboard-tank-icon-svg svg {
    width: 36px;
    height: 36px;
}

.leaderboard-title {
    color: #4f4f4f;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.leaderboard-title::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #4f4f4f;
    transform: rotate(45deg);
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    margin: 2px 0;
    height: 22px;
    position: relative;
}

.leaderboard-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #43b54b;
    border-radius: 2px;
    z-index: -1;
    transition: width 0.3s ease;
}

.leaderboard-entry.player .leaderboard-bar {
    background: #00b2e1;
}

.leaderboard-entry.godmode .leaderboard-bar {
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.leaderboard-entry.godmode .leaderboard-tank-icon {
    background: #ffd700 !important;
    border-color: #b8860b !important;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.leaderboard-entry.godmode .leaderboard-name {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.leaderboard-tank {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #43b54b;
    border: 2px solid rgba(0,0,0,0.2);
    margin-right: 5px;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.leaderboard-entry.player .leaderboard-tank {
    background: #00b2e1;
}

.leaderboard-tank-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    margin-right: 6px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.leaderboard-tank-icon-svg {
    width: 32px;
    height: 20px;
    min-width: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    margin-right: 2px;
    margin-left: 0;
    vertical-align: middle;
    z-index: 100;
    position: relative;
}

.leaderboard-tank-icon-svg svg {
    width: 32px;
    height: 20px;
    display: block;
}

.leaderboard-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    padding: 2px 6px;
    z-index: 1;
    position: relative;
}

.leaderboard-name {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
    position: relative;
}

.leaderboard-rank {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    position: relative;
    margin-right: 3px;
}

.leaderboard-score {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    margin-left: 3px;
    z-index: 2;
    position: relative;
}

.leaderboard-score::before {
    content: ' - ';
}

/* ============================================
   STATS PANEL - Bottom Left (diep.io style)
   ============================================ */
#stats-panel {
    position: fixed;
    bottom: 10px;
    left: 10px;
    padding: 0;
    min-width: 200px;
    transition: opacity 0.15s ease;
}

#stats-panel.no-points {
    opacity: 0.6;
}

#stats-panel.no-points:hover {
    opacity: 1;
}

#stats-panel.has-points {
    opacity: 1;
}

.stat-row {
    display: flex;
    align-items: center;
    margin: 2px 0;
    cursor: pointer;
    height: 22px;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.stat-row:hover {
    filter: brightness(1.3);
    transform: scale(1.02);
}

.stat-row:hover .stat-plus {
    transform: scale(1.1);
}

.stat-row.maxed {
    opacity: 0.5;
    cursor: default;
}

.stat-row.maxed:hover .stat-plus {
    transform: none;
}

.stat-name {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    background: #6a6a6a;
    padding: 3px 8px;
    border-radius: 2px;
    min-width: 115px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.stat-bar-container {
    display: flex;
    gap: 2px;
    margin-left: 3px;
    background: #6a6a6a;
    padding: 3px 4px;
    border-radius: 2px;
}

.stat-segment {
    width: 8px;
    height: 14px;
    background: #555;
    border-radius: 1px;
}

.stat-segment.filled {
    background: currentColor;
}

/* Stat colors matching diep.io */
.stat-row[data-stat="0"] .stat-segment.filled { background: #f0a053; }
.stat-row[data-stat="1"] .stat-segment.filled { background: #e667af; }
.stat-row[data-stat="2"] .stat-segment.filled { background: #9a6dce; }
.stat-row[data-stat="3"] .stat-segment.filled { background: #e2d05e; }
.stat-row[data-stat="4"] .stat-segment.filled { background: #8adb6d; }
.stat-row[data-stat="5"] .stat-segment.filled { background: #6bb3e8; }
.stat-row[data-stat="6"] .stat-segment.filled { background: #c97dd4; }
.stat-row[data-stat="7"] .stat-segment.filled { background: #6dcec9; }

.stat-key {
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    background: #6a6a6a;
    padding: 3px 5px;
    border-radius: 2px;
    margin-left: 3px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.stat-plus {
    width: 22px;
    height: 22px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-left: 3px;
    cursor: default;
    transition: transform 0.15s, filter 0.15s;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
    opacity: 0.4;
}

/* Colored plus buttons when upgrade points available */
#stats-panel.has-points .stat-plus {
    opacity: 1;
    cursor: pointer;
}

#stats-panel.has-points .stat-row[data-stat="0"] .stat-plus { background: #f0a053; }
#stats-panel.has-points .stat-row[data-stat="1"] .stat-plus { background: #e667af; }
#stats-panel.has-points .stat-row[data-stat="2"] .stat-plus { background: #9a6dce; }
#stats-panel.has-points .stat-row[data-stat="3"] .stat-plus { background: #e2d05e; }
#stats-panel.has-points .stat-row[data-stat="4"] .stat-plus { background: #8adb6d; }
#stats-panel.has-points .stat-row[data-stat="5"] .stat-plus { background: #6bb3e8; }
#stats-panel.has-points .stat-row[data-stat="6"] .stat-plus { background: #c97dd4; }
#stats-panel.has-points .stat-row[data-stat="7"] .stat-plus { background: #6dcec9; }

#stats-panel.has-points .stat-plus:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.stat-row.maxed .stat-plus {
    opacity: 0.3 !important;
    cursor: default !important;
    background: #555 !important;
}

.stat-row.maxed .stat-plus:hover {
    transform: none !important;
    filter: none !important;
}

/* ============================================
   UPGRADE POINTS INDICATOR - Above stats panel
   ============================================ */
#upgrade-points {
    position: fixed;
    bottom: 210px;
    left: 10px;
    color: #78c746;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    font-style: italic;
    z-index: 10;
}

/* ============================================
   LEVEL DISPLAY - Bottom Center (diep.io style)
   ============================================ */
#level-display {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.score-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #43b54b;
    border: 2px solid rgba(0,0,0,0.15);
    margin-right: 6px;
}

.score-text {
    color: #4f4f4f;
    font-size: 13px;
    font-weight: 600;
}

#xp-bar {
    width: 300px;
    height: 20px;
    background: #8b8b8b;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(0,0,0,0.15);
}

#xp-fill {
    height: 100%;
    background: #43b54b;
    width: 0%;
    transition: width 0.3s ease;
}

#level-text {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================
   MINIMAP - Bottom Right (moved from left)
   ============================================ */
#minimap {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 130px;
    height: 130px;
    background: rgba(200, 200, 200, 0.5);
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 2px;
    overflow: hidden;
}

/* ============================================
   CLASS UPGRADE MENU
   ============================================ */
#class-upgrade {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    z-index: 100;
    max-height: 80vh;
    max-width: 90vw;
    overflow-y: auto;
    overflow-x: hidden;
}

#class-upgrade::-webkit-scrollbar {
    width: 8px;
}

#class-upgrade::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

#class-upgrade::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#class-upgrade::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.class-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
}

.class-close {
    position: absolute;
    right: -15px;
    top: -5px;
    cursor: pointer;
    font-size: 24px;
    color: #ff6b6b;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.class-close:hover {
    opacity: 1;
}

#class-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.class-option {
    width: 75px;
    min-height: 80px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-sizing: border-box;
}

.class-option:hover {
    background: rgba(255,255,255,0.2);
    border-color: #ffd700;
    transform: scale(1.08);
}

.class-option canvas {
    width: 40px;
    height: 40px;
}

.class-option-name {
    color: #fff;
    font-size: 9px;
    margin-top: 4px;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}

.class-option-level {
    color: #ffd700;
    font-size: 8px;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================
   DEATH SCREEN - Diep.io style
   ============================================ */
#death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.death-respawn-btn {
    background: #5a88c9;
    border: 3px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    cursor: pointer;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.death-respawn-btn:hover {
    background: #6a98d9;
}

.death-respawn-btn .icon {
    font-size: 16px;
}

.death-header {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.death-killer-name {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.death-tank-preview {
    background: #8fd6ee;
    border: 3px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 15px 30px;
    margin-bottom: 15px;
    display: inline-block;
}

.death-tank-preview .killer-label {
    color: #4f4f4f;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
}

.death-tank-preview .killer-score {
    color: #4f4f4f;
    font-size: 10px;
    margin-bottom: 8px;
}

.death-tank-preview canvas {
    width: 60px;
    height: 60px;
    display: block;
    margin: 0 auto 8px;
}

.death-tank-preview .tank-name {
    color: #4f4f4f;
    font-size: 12px;
    font-weight: 600;
}

.death-stats {
    margin-bottom: 20px;
}

.death-stat-row {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 3px 0;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.death-stat-row .label {
    color: rgba(255,255,255,0.7);
}

.death-stat-row .value {
    color: #fff;
}

.death-continue-btn {
    background: #78c746;
    border: 3px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 10px 35px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Ubuntu', sans-serif;
    cursor: pointer;
}

.death-continue-btn:hover {
    background: #8fd75a;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 180, 180, 0.9);
    color: #4f4f4f;
    padding: 6px 14px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    animation: fadeInOut 2.5s ease-in-out forwards;
    z-index: 50;
    border: 2px solid rgba(0,0,0,0.1);
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ============================================
   HELP MENU
   ============================================ */
#help-menu {
    position: fixed;
    bottom: 245px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 14px;
    border-radius: 4px;
    min-width: 170px;
    z-index: 50;
}

.help-title {
    color: #ffd700;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
    position: relative;
}

.help-close {
    position: absolute;
    right: 0;
    top: -2px;
    cursor: pointer;
    font-size: 16px;
    color: #ff6b6b;
    opacity: 0.7;
}

.help-close:hover {
    opacity: 1;
}

.help-content {
    color: #fff;
    font-size: 11px;
}

.help-content div {
    padding: 2px 0;
}

.help-content strong {
    color: #4fc3f7;
    display: inline-block;
    width: 75px;
}

/* ============================================
   CHAT SYSTEM
   ============================================ */
#chat-container {
    position: fixed;
    bottom: 230px;
    left: 220px;
    width: 350px;
    pointer-events: none;
    z-index: 9999;
}

#chat-messages {
    max-height: 200px;
    overflow-y: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.chat-message {
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    margin: 3px 0;
    border-radius: 4px;
    font-size: 12px;
    animation: chatSlideIn 0.3s ease;
}

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

.chat-name {
    color: #4fc3f7;
    font-weight: 700;
    margin-right: 6px;
}

.chat-text {
    color: #fff;
}

#chat-input {
    margin-top: 8px;
    pointer-events: auto;
}

#chat-input-field {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Ubuntu', sans-serif;
    border: 2px solid rgba(100, 150, 255, 0.5);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    outline: none;
}

#chat-input-field:focus {
    border-color: #4fc3f7;
}

/* ============================================
   ADMIN MENU
   ============================================ */
#admin-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 18px;
    border-radius: 5px;
    border: none;
    z-index: 300;
    min-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
    font-size: 10px;
}

.admin-stats .stat-item {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.8);
}

.admin-stats .stat-item span:last-child {
    color: #4fc3f7;
    font-weight: 600;
}

.admin-section-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px 0 5px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-section-label:first-of-type {
    margin-top: 0;
}

.admin-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
    position: relative;
}

.admin-close {
    position: absolute;
    right: 0;
    top: 0;
    cursor: pointer;
    font-size: 20px;
    color: #ff6b6b;
    opacity: 0.8;
}

.admin-close:hover {
    opacity: 1;
}

.admin-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.admin-content button {
    padding: 4px 6px;
    font-size: 9px;
    font-weight: 500;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}

.admin-content button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Announcement input */
.announce-section {
    display: flex;
    gap: 5px;
}

.announce-section input {
    flex: 1;
    padding: 4px 6px;
    font-size: 9px;
    border: none;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
}

.announce-section input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.announce-section button {
    padding: 4px 10px;
}

/* ============================================
   MOBILE CONTROLS
   ============================================ */
#mobile-controls {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
    pointer-events: none;
}

.mobile-hint {
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 15px;
}

/* ============================================
   CHAT SYSTEM (Override - ensure visibility)
   ============================================ */
#chat-container {
    position: fixed;
    bottom: 200px;
    left: 20px;
    width: 300px;
    z-index: 9999;
    pointer-events: none;
    display: block !important;
}

#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
    min-height: 20px;
}

.chat-message {
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
    word-wrap: break-word;
    max-width: 100%;
}

.chat-name {
    color: #ffd700;
    font-weight: 500;
    margin-right: 6px;
}

.chat-text {
    color: #fff;
}

#chat-input {
    pointer-events: auto;
}

#chat-input-field {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    font-family: 'Ubuntu', sans-serif;
    outline: none;
}

#chat-input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TEAM MODE
   ============================================ */
.team-indicator {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Ubuntu', sans-serif;
    border-radius: 8px;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.team-indicator.red {
    background: linear-gradient(135deg, #f04b5b 0%, #c13d4a 100%);
    color: white;
    border: 3px solid #a03040;
}

.team-indicator.blue {
    background: linear-gradient(135deg, #00b2e1 0%, #0090b3 100%);
    color: white;
    border: 3px solid #007090;
}

/* ============================================
   ZOMBIE MODE - Matching notification/banner style
   ============================================ */
#zombie-wave {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 180, 180, 0.9);
    color: #4f4f4f;
    padding: 8px 20px;
    border-radius: 2px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 100;
    font-family: 'Ubuntu', sans-serif;
}

.zombie-wave-text {
    color: #4f4f4f;
    font-size: 14px;
    font-weight: 700;
}

#zombie-wave-number {
    color: #2d5016;
    font-weight: 700;
}

.zombie-kills-text {
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

/* Zombie mode announcement banner (for wave changes) */
.zombie-announcement {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 180, 180, 0.9);
    color: #4f4f4f;
    padding: 6px 14px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    animation: fadeInOut 3s ease-in-out forwards;
    z-index: 55;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   DEBUG PANELS & ADMIN TOOLS
   ============================================ */

/* Debug Panel Base Style - Matches Debug Mode panel */
.debug-panel {
    position: fixed;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 0;
    z-index: 2000;
    font-family: 'Ubuntu', sans-serif;
    font-size: 11px;
    color: #fff;
    min-width: 180px;
}

/* Diep.io style panel variant */
.debug-panel.fiep-panel {
    background: rgba(0, 0, 0, 0.5);
}

.debug-panel-header {
    background: transparent;
    padding: 10px 12px 8px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.debug-close {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
    color: #fff;
}

.debug-close:hover {
    opacity: 1;
    color: #ff6b6b;
}

/* Network Graph Panel */
#network-graph-panel {
    top: 100px;
    right: 20px;
}

#network-graph-canvas {
    display: block;
    margin: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.network-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 8px 12px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
}

.network-stats > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font-size: 10px;
}

.network-stats span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.network-stats span:last-child {
    color: #4fc3f7;
    font-weight: 600;
}

/* Performance Profiler Panel */
#profiler-panel {
    top: 100px;
    left: 20px;
}

#profiler-canvas {
    display: block;
    margin: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.profiler-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 8px 12px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
}

.profiler-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.profiler-stats span:first-child {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
}

.profiler-stats span:last-child {
    color: #81c784;
    font-weight: 700;
    font-size: 12px;
}

/* Heat Map Panel */
#heatmap-panel {
    bottom: 20px;
    right: 20px;
}

#heatmap-canvas {
    display: block;
    margin: 10px 12px;
    border-radius: 3px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.heatmap-gradient {
    width: 80px;
    height: 10px;
    background: linear-gradient(to right, #3949ab, #00bcd4, #4caf50, #ffeb3b, #ff9800, #f44336);
    border-radius: 5px;
}

/* Kill Feed Panel */
#killfeed-panel {
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-height: 280px;
    width: 320px;
}

.killfeed-entries {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 12px;
}

.killfeed-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font-size: 10px;
    animation: slideIn 0.3s ease-out;
}

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

.killfeed-killer {
    color: #f44336;
    font-weight: 600;
}

.killfeed-arrow {
    color: rgba(255, 255, 255, 0.5);
}

.killfeed-victim {
    color: #4fc3f7;
    font-weight: 600;
}

.killfeed-weapon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    margin-left: auto;
}

.killfeed-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
}

/* Entity Inspector Panel - Middle right above minimap */
#entity-inspector-panel {
    bottom: 220px;
    right: 20px;
    width: 240px;
    max-height: 300px;
}

.entity-inspector-content {
    padding: 10px 12px;
    max-height: 300px;
    overflow-y: auto;
}

.inspector-hint {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 15px;
    font-style: italic;
    font-size: 10px;
}

.inspector-section {
    margin-bottom: 10px;
}

.inspector-section-title {
    color: #4fc3f7;
    font-weight: 700;
    font-size: 10px;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.inspector-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 10px;
}

.inspector-row span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.inspector-row span:last-child {
    color: #fff;
    font-weight: 500;
}

/* Admin Modal Styles */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.admin-modal-content {
    background: rgba(50, 50, 50, 0.98);
    border: 2px solid #666;
    border-radius: 10px;
    width: 400px;
    max-height: 500px;
    overflow: hidden;
}

.admin-modal-header {
    background: linear-gradient(135deg, #4a4a4a 0%, #333 100%);
    padding: 12px 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
    color: #ff6b6b;
}

.player-list-entries, .ban-list-entries {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.player-entry, .ban-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
}

.player-entry:hover, .ban-entry:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name {
    font-weight: 600;
    color: #4fc3f7;
}

.player-details {
    font-size: 11px;
    color: #888;
}

.player-actions {
    display: flex;
    gap: 5px;
}

.player-actions button {
    padding: 5px 10px;
    font-size: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-kick {
    background: #ff9800;
    color: #fff;
}

.btn-ban {
    background: #f44336;
    color: #fff;
}

.btn-swap {
    background: #2196f3;
    color: #fff;
}

.btn-unban {
    background: #4caf50;
    color: #fff;
}

.player-actions button:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Slider Rows in Admin Menu */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 5px;
}

.slider-row span:first-child {
    min-width: 80px;
    color: #ccc;
    font-size: 11px;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #444;
    border-radius: 3px;
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #81d4fa;
}

.slider-row span:last-child {
    min-width: 45px;
    text-align: right;
    color: #4fc3f7;
    font-weight: 600;
    font-size: 11px;
}

/* Weather Effects Visual Indicators - Diep.io Style */
.weather-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 180, 180, 0.9);
    padding: 4px 12px;
    border-radius: 2px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: #4f4f4f;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Obstacle Placer Mode Indicator - Diep.io Style */
.obstacle-placer-active {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 180, 180, 0.95);
    padding: 6px 16px;
    border-radius: 2px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: #4f4f4f;
    font-weight: 600;
    font-size: 11px;
    font-family: 'Ubuntu', sans-serif;
    z-index: 100;
    animation: pulse 1.5s infinite;
}

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

/* Hitbox Visualization Indicator - Diep.io Style */
.hitbox-mode-active {
    position: fixed;
    top: 50px;
    left: 10px;
    background: rgba(180, 180, 180, 0.95);
    padding: 4px 10px;
    border-radius: 2px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: #43b54b;
    font-size: 10px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    z-index: 100;
}

/* Admin Announcement - Diep.io Style */
.admin-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(180, 180, 180, 0.98);
    padding: 20px 40px;
    border-radius: 3px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    z-index: 3000;
    text-align: center;
    font-family: 'Ubuntu', sans-serif;
    animation: announceIn 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
}

@keyframes announceIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.admin-announcement.fade-out {
    animation: announceOut 0.5s ease-in forwards;
}

@keyframes announceOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.announcement-header {
    color: #c13d4a;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.announcement-message {
    color: #4f4f4f;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.announcement-from {
    color: #888;
    font-size: 11px;
    font-style: italic;
}

/* ============================================
   RESPONSIVE / MOBILE
   ============================================ */
@media (max-width: 768px) {
    .game-title {
        font-size: 48px;
    }
    
    #xp-bar {
        width: 200px;
    }
    
    #stats-panel {
        transform: scale(0.8);
        transform-origin: bottom left;
    }
    
    /* Hide spectator scoreboard on mobile - overflows into logo */
    /* In-game leaderboard (#leaderboard) stays visible */
    .spectator-leaderboard {
        display: none !important;
    }
    
    /* Scale down in-game leaderboard for mobile */
    #leaderboard {
        transform: scale(0.8);
        transform-origin: top right;
        right: 5px;
        top: 5px;
    }
    
    #help-menu {
        display: none;
    }
    
    .debug-panel {
        transform: scale(0.8);
    }
    
    /* Mobile upgrade menu - CENTERED like diep.io */
    #class-upgrade {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: auto !important;
        max-width: 95vw !important;
        max-height: 80vh !important;
        padding: 15px !important;
        border-radius: 12px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        flex-direction: column !important;
        align-items: center !important;
        border: 2px solid rgba(0, 178, 225, 0.5) !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.8) !important;
    }
    
    #class-upgrade .class-title {
        font-size: 14px;
        margin-bottom: 12px;
        padding: 0;
        color: #00b2e1;
    }
    
    #class-upgrade .class-close {
        position: absolute;
        right: 5px;
        top: 5px;
        font-size: 28px !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer;
        z-index: 10;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
    }
    
    #class-options {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        overflow-y: auto !important;
        gap: 10px !important;
        padding: 5px !important;
        max-width: 100% !important;
        justify-content: center !important;
    }
    
    #class-upgrade .class-option {
        width: 60px !important;
        min-width: 60px !important;
        min-height: 70px !important;
        flex-shrink: 0;
        padding: 6px !important;
        border-radius: 8px !important;
    }
    
    #class-upgrade .class-option canvas {
        width: 32px !important;
        height: 32px !important;
    }
    
    #class-upgrade .class-option-name {
        font-size: 8px !important;
        margin-top: 4px !important;
    }
    
    #class-upgrade .class-option-level {
        display: none !important;
    }
    
    /* Mobile stats panel - TOP CENTER like diep.io mobile */
    #stats-panel {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        position: fixed !important;
        top: 10px !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        transform-origin: top center !important;
        max-width: 95vw !important;
        gap: 4px !important;
        padding: 8px 12px !important;
        background: rgba(0,0,0,0.7) !important;
        border-radius: 10px !important;
        overflow-x: auto !important;
        z-index: 100 !important;
    }
    
    /* Hide stats panel when no points available on mobile */
    #stats-panel.no-points {
        display: none !important;
    }
    
    #stats-panel .stat-row {
        margin: 0 !important;
        height: auto !important;
        flex-direction: column !important;
        align-items: center !important;
        min-width: 42px !important;
        padding: 6px !important;
        background: rgba(255,255,255,0.1) !important;
        border-radius: 8px !important;
    }
    
    #stats-panel .stat-name {
        min-width: unset !important;
        font-size: 8px !important;
        padding: 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 40px !important;
        margin-bottom: 4px !important;
        font-weight: 500 !important;
    }
    
    /* Show progress bar on mobile - segments visible */
    #stats-panel .stat-bar-container {
        display: flex !important;
        width: 100% !important;
        height: 8px !important;
        margin: 4px 0 !important;
        gap: 2px !important;
        background: transparent !important;
    }
    
    #stats-panel .stat-segment {
        flex: 1 !important;
        height: 100% !important;
        background: rgba(255,255,255,0.15) !important;
        border-radius: 2px !important;
    }
    
    #stats-panel .stat-segment.filled {
        background: #00b2e1 !important;
    }
    
    #stats-panel .stat-key {
        display: none !important;
    }
    
    #stats-panel .stat-plus {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        border-radius: 6px !important;
        margin-top: 4px !important;
    }
    
    /* Make plus buttons more prominent on mobile */
    #stats-panel.has-points .stat-plus {
        box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
    }
    
    #stats-panel.has-points .stat-row:active .stat-plus {
        transform: scale(0.9) !important;
    }
    
    /* Hide upgrade points indicator on mobile - redundant */
    #upgrade-points {
        display: none !important;
    }
    
    /* Mobile minimap - smaller */
    #minimap {
        width: 80px;
        height: 80px;
        bottom: 5px;
        right: 5px;
    }
    
    /* Mobile chat - hide */
    #chat-container {
        display: none !important;
    }
}

/* Mobile joystick hint */
#mobile-joystick-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 500;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobile-joystick-hint.hidden {
    opacity: 0;
}

/* ============================================
   SEO FOOTER - REMOVED BY USER REQUEST
   ============================================ */
#seo-footer {
    display: none !important;
}

/* ============================================
   iPHONE SPECIFIC FIXES
   ============================================ */

/* iPhone landscape mode - ensure proper width and hide scoreboard */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Force full width in landscape */
    html, body {
        width: 100vw !important;
        min-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    #game-canvas {
        width: 100vw !important;
        height: 100vh !important;
    }
    
    /* Hide spectator scoreboard in landscape - keep in-game leaderboard */
    .spectator-leaderboard {
        display: none !important;
    }
    
    /* Scale down in-game leaderboard for landscape */
    #leaderboard {
        transform: scale(0.75);
        transform-origin: top right;
        right: 5px;
        top: 5px;
    }
    
    /* Class upgrade - centered in landscape */
    #class-upgrade {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: auto !important;
        max-width: 90vw !important;
        padding: 15px !important;
        border-radius: 12px !important;
    }
    
    /* Stats panel in landscape - compact single row */
    #stats-panel {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        position: fixed !important;
        top: 5px !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translateX(-50%) scale(0.85) !important;
        transform-origin: top center !important;
        max-width: 95vw !important;
        gap: 3px !important;
        padding: 4px 8px !important;
        background: rgba(0,0,0,0.7) !important;
        border-radius: 6px !important;
        z-index: 100 !important;
    }
    
    #stats-panel.no-points {
        display: none !important;
    }
    
    #stats-panel .stat-row {
        flex-direction: row !important;
        align-items: center !important;
        min-width: auto !important;
        padding: 3px 5px !important;
        background: rgba(255,255,255,0.1) !important;
        border-radius: 4px !important;
        gap: 4px !important;
    }
    
    #stats-panel .stat-name {
        font-size: 9px !important;
        margin-bottom: 0 !important;
        min-width: 20px !important;
        text-align: center !important;
    }
    
    /* Hide progress bars in landscape - too cramped */
    #stats-panel .stat-bar-container {
        display: none !important;
    }
    
    #stats-panel .stat-segment {
        display: none !important;
    }
    
    #stats-panel .stat-key {
        display: none !important;
    }
    
    #stats-panel .stat-plus {
        width: 22px !important;
        height: 22px !important;
        font-size: 14px !important;
        margin: 0 !important;
        border-radius: 4px !important;
    }
    
    /* Minimap in landscape - very small */
    #minimap {
        width: 55px !important;
        height: 55px !important;
        bottom: 5px !important;
        right: 5px !important;
    }
}