/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0e170e;
    --bg-card: #1a2e1a;
    --bg-card-hover: #243a24;
    --accent: #4caf50;
    --accent-hover: #66bb6a;
    --sell-color: #ff9800;
    --sell-hover: #ffb74d;
    --dealer-color: #5c6bc0;
    --dealer-hover: #7986cb;
    --text-primary: #e8e8e8;
    --text-secondary: #a0b0a0;
    --text-muted: #607060;
    --cash-color: #66ff88;
    --border-color: #2a3e2a;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Drug colors */
    --color-weed: #4caf50;
    --color-cocaine: #e0e0e0;
    --color-meth: #42a5f5;
    --color-xtc: #e040fb;

    /* Dealer tier colors */
    --color-dealer-street: #5c6bc0;
    --color-dealer-supplier: #7e57c2;
    --color-dealer-city: #ab47bc;
    --color-dealer-national: #ef5350;
    --color-dealer-international: #ff6f00;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Game Container ===== */
#game-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 12px;
}

/* ===== Header ===== */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: linear-gradient(135deg, #1a2e1a 0%, #0d1a0d 50%, #1a2e1a 100%);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-bottom: 2px solid var(--accent);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.1);
}

#header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #88ffaa, #4caf50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.3));
}

#cash-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cash-color);
    text-shadow: 0 0 10px rgba(102, 255, 136, 0.3);
    font-variant-numeric: tabular-nums;
}

/* ===== Main Layout ===== */
#main-layout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

/* ===== Left & Right Panel Containers ===== */
#left-panels,
#right-panels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    gap: 3px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    flex-shrink: 0;
}

.tab-bar .tab {
    flex: 1;
    padding: 7px 6px;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.2s;
    color: var(--text-muted);
    background: transparent;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-bar .tab:hover:not(.locked) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-bar .tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.15);
}

.tab-bar .tab.locked {
    opacity: 0.35;
    cursor: default;
    font-size: 0.6rem;
}

.tab-bar .tab.locked.affordable {
    opacity: 0.7;
    cursor: pointer;
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

.tab-bar .tab.locked.affordable:hover {
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.06);
}

/* ===== Panel Sections ===== */
#production-panel,
#stock-panel,
#sell-panel,
#stats-panel,
#dealer-panel,
#shed-upgrades-panel {
    background: linear-gradient(180deg, #1e3420 0%, #1a2e1a 100%);
    border: 1px solid rgba(76, 175, 80, 0.12);
    border-radius: 12px;
    padding: 14px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(76, 175, 80, 0.06);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#production-panel {
    flex: 0 0 auto;
}

#stock-panel {
    flex: 0 0 auto;
}

#sell-panel {
    flex: 1;
    overflow-y: auto;
}

#stats-panel {
    flex: 0 0 auto;
}

#dealer-panel {
    flex: 1;
}

#shed-upgrades-panel {
    flex: 1;
    overflow-y: auto;
}

#shed-upgrades-panel h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c9a96e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid #c9a96e;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
}

#shed-upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shed-upgrade {
    border-color: rgba(201, 169, 110, 0.15) !important;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.08) 0%, rgba(201, 169, 110, 0.02) 100%) !important;
}

.shed-upgrade:hover:not(.upgrade-locked):not(.shed-purchased) {
    border-color: #c9a96e !important;
    box-shadow: 0 0 12px rgba(201, 169, 110, 0.12) !important;
}

.shed-purchased {
    opacity: 0.6;
    border-color: rgba(76, 175, 80, 0.2) !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.06) 0%, transparent 100%) !important;
}

.shed-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(76, 175, 80, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.btn-shed {
    background: linear-gradient(180deg, #d4a855 0%, #a8842a 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    width: 100%;
    margin-top: 4px;
}

.btn-shed:hover:not(:disabled) {
    background: linear-gradient(180deg, #e0b860 0%, #b89435 100%);
}

/* ===== Panel Headings ===== */
#production-panel h2,
#stock-panel h2,
#sell-panel h2,
#stats-panel h2,
#dealer-panel h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    border-bottom: 1px solid rgba(76, 175, 80, 0.12);
}

.mt {
    margin-top: 16px;
}

/* ===== Producer Info ===== */
#producer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

#producer-info .info-label {
    font-weight: 600;
    color: var(--text-primary);
}

#producer-info .info-cost {
    color: var(--cash-color);
    font-weight: 500;
}

#producer-info .info-rate {
    color: var(--accent);
    font-weight: 500;
}

/* ===== Dealer Info ===== */
#dealer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#dealer-stats {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== Stock List (multi-drug) ===== */
#stock-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.stock-row .stock-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stock-row .stock-amount {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex: 1;
}

.stock-row .stock-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Button Group (2x2 grid) ===== */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* ===== Buttons ===== */
.btn {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Buy buttons - green gradient */
.btn-buy {
    background: linear-gradient(180deg, #5cb860 0%, #3d8b40 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-buy:hover:not(:disabled) {
    background: linear-gradient(180deg, #6cc870 0%, #4c9b50 100%);
}

/* Sell buttons - orange gradient */
.btn-sell {
    background: linear-gradient(180deg, #ffab40 0%, #e68a00 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-sell:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffc060 0%, #ff9a10 100%);
}

/* Dealer buttons - uses tier color via inline style */
.btn-dealer {
    background: linear-gradient(180deg, #7986cb 0%, #4a5ab0 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-dealer:hover:not(:disabled) {
    background: linear-gradient(180deg, #8e99d8 0%, #5c6bc0 100%);
}

/* Upgrade buy button */
.btn-upgrade {
    background: linear-gradient(180deg, #5cb860 0%, #3d8b40 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    width: 100%;
    margin-top: 4px;
}

.btn-upgrade:hover:not(:disabled) {
    background: linear-gradient(180deg, #6cc870 0%, #4c9b50 100%);
}

/* Unlock button - gold */
.btn-unlock {
    background: linear-gradient(180deg, #ffd54f 0%, #f9a825 100%);
    color: #333;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    grid-column: 1 / -1;
}

.btn-unlock:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
}

/* ===== Sell Price ===== */
#sell-price {
    font-size: 0.85rem;
    color: var(--sell-color);
    font-weight: 500;
    margin-bottom: 10px;
    transition: text-shadow 0.3s;
}

#sell-price:hover {
    text-shadow: 0 0 8px var(--sell-color);
}

/* ===== Stats ===== */
#stats-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(42, 62, 42, 0.4);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--text-secondary);
}

.stat-row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===== Canvas Container ===== */
#game-canvas-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(76, 175, 80, 0.2);
    background: #2a5016;
    min-height: 0;
    box-shadow:
        0 0 20px rgba(76, 175, 80, 0.06),
        inset 0 0 30px rgba(0, 0, 0, 0.15);
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== Upgrades List ===== */
#upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(76, 175, 80, 0.02) 100%);
    border: 1px solid rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: fadeSlideIn 0.3s ease-out;
}

.upgrade-card:hover:not(.upgrade-locked) {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.18) 0%, rgba(76, 175, 80, 0.06) 100%);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.12);
    transform: translateX(-2px);
}

.upgrade-card .upgrade-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upgrade-card .upgrade-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.upgrade-card.upgrade-locked {
    opacity: 0.45;
    border-color: var(--border-color);
}

.upgrade-card.upgrade-locked:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(76, 175, 80, 0.02) 100%);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    #main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 300px auto;
    }

    #left-panels,
    #right-panels {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #left-panels > section,
    #right-panels > section {
        flex: 1 1 200px;
    }

    #game-canvas-container {
        min-height: 300px;
    }
}

@media (max-width: 600px) {
    #game-container {
        padding: 8px;
    }

    #header {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    #header h1 {
        font-size: 1.2rem;
    }

    #cash-display {
        font-size: 1.1rem;
    }

    .button-group {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Animations & Effects ===== */

/* Card hover glow */
#production-panel:hover,
#stock-panel:hover,
#sell-panel:hover,
#stats-panel:hover,
#dealer-panel:hover,
#shed-upgrades-panel:hover {
    border-color: rgba(76, 175, 80, 0.25);
    box-shadow:
        0 0 16px rgba(76, 175, 80, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(76, 175, 80, 0.06);
}

/* Tooltip system */
.tooltip {
    position: absolute;
    z-index: 1000;
    background: linear-gradient(180deg, #121f12 0%, #0d1a0d 100%);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 12px 16px;
    max-width: 250px;
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(76, 175, 80, 0.1);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.tooltip-desc {
    color: var(--text-secondary);
    line-height: 1.4;
}

.tooltip-stat {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    color: var(--cash-color);
    font-weight: 600;
}

/* Floating text animation */
.float-text {
    position: absolute;
    pointer-events: none;
    font-weight: 700;
    font-size: 1rem;
    animation: floatUp 1.2s ease-out forwards;
    z-index: 100;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-30px) scale(1.05); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.9); }
}

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

/* Notification toast */
.notification-toast {
    animation: slideIn 0.3s ease-out;
}

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

/* Bump / pulse helpers */
.cash-animate { transition: transform 0.15s ease-out; }
.cash-animate.bump { transform: scale(1.15); }

/* ===== Header Right ===== */
#header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Header Icon Buttons ===== */
.btn-header-icon {
    background: none;
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-header-icon:hover {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--accent);
}

#username-display {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.8;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal {
    background: linear-gradient(180deg, #1e3420 0%, #142414 100%);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    min-width: 340px;
    max-width: 440px;
    animation: modalIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.12);
}

.modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.setting-row.danger {
    padding-top: 4px;
}

.setting-divider {
    border: none;
    border-top: 1px solid rgba(76, 175, 80, 0.1);
    margin: 8px 0;
}

.btn-save-action {
    background: linear-gradient(180deg, #2a4a2c 0%, #1e3420 100%);
    border: 1px solid rgba(76, 175, 80, 0.15);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-action:hover {
    background: linear-gradient(180deg, #3a5a3c 0%, #2a4a2c 100%);
    border-color: var(--accent);
}

.btn-danger {
    background: linear-gradient(180deg, #4a1a1a 0%, #3a1010 100%);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff6666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #5a2020 0%, #4a1515 100%);
    border-color: #ff4444;
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.15);
}

/* ===== Username Modal ===== */
.modal-small {
    max-width: 360px;
    min-width: 300px;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.input-username {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

.input-username:focus {
    border-color: var(--accent);
}

.input-username::placeholder {
    color: var(--text-muted);
}

.error-text {
    color: #ff6666;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.btn-accent {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-accent:hover {
    background: linear-gradient(180deg, #388e3c 0%, #2e7d32 100%);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(76, 175, 80, 0.2);
}

.btn-accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Leaderboard Modal ===== */
.modal-leaderboard {
    min-width: 380px;
    max-width: 480px;
}

.loading-text {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(76, 175, 80, 0.15);
}

.leaderboard-table th:last-child {
    text-align: right;
}

.leaderboard-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leaderboard-table td:first-child {
    font-weight: 700;
    color: var(--text-muted);
    width: 40px;
}

.leaderboard-table td:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
    color: var(--cash-color);
}

.leaderboard-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr.lb-self {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid var(--accent);
}

.leaderboard-table tr.lb-self td {
    color: var(--text-primary);
    font-weight: 600;
}

.lb-rank-1 td:first-child { color: #ffd700; }
.lb-rank-2 td:first-child { color: #c0c0c0; }
.lb-rank-3 td:first-child { color: #cd7f32; }

.leaderboard-empty {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Footer ===== */
#game-footer {
    text-align: center;
    padding: 12px 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
}

/* ===== Disco Mode ===== */
@keyframes disco-bg {
    0%   { background-color: #ff0055; }
    16%  { background-color: #ff8800; }
    33%  { background-color: #ffff00; }
    50%  { background-color: #00ff66; }
    66%  { background-color: #0088ff; }
    83%  { background-color: #aa00ff; }
    100% { background-color: #ff0055; }
}

@keyframes disco-text {
    0%   { color: #ff0055; }
    16%  { color: #ff8800; }
    33%  { color: #ffff00; }
    50%  { color: #00ff66; }
    66%  { color: #0088ff; }
    83%  { color: #aa00ff; }
    100% { color: #ff0055; }
}

@keyframes disco-border {
    0%   { border-color: #ff0055; }
    16%  { border-color: #ff8800; }
    33%  { border-color: #ffff00; }
    50%  { border-color: #00ff66; }
    66%  { border-color: #0088ff; }
    83%  { border-color: #aa00ff; }
    100% { border-color: #ff0055; }
}

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

body.disco #game-container {
    animation: disco-pulse 0.5s ease infinite;
}

body.disco #header {
    animation: disco-bg 2s linear infinite;
}

body.disco #header h1,
body.disco #cash-display,
body.disco #username-display {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

body.disco section {
    animation: disco-border 2s linear infinite;
    border-width: 2px;
}

body.disco h2 {
    animation: disco-text 2s linear infinite;
}

body.disco .tab.active {
    animation: disco-bg 2s linear infinite;
    color: #fff;
}

body.disco .btn {
    animation: disco-border 2s linear infinite;
}

body.disco .btn:hover {
    animation: disco-bg 1s linear infinite;
    color: #fff;
}

body.disco #game-footer {
    animation: disco-text 2s linear infinite;
    opacity: 1;
    font-size: 0.8rem;
}

body.disco #btn-disco {
    animation: disco-bg 0.5s linear infinite;
    border-radius: 50%;
    color: #fff;
}
