/* CSS Variables */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #4CAF50;
    --text-color: #ffffff;
    --header-height: 80px;
    --header-offset: 80px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: var(--secondary-color);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

/* Header wrapper: contains header + collapse button (button only visible on mobile, below header) */
.header-wrapper {
    position: relative;
}

/* Reserve document flow space for fixed header on desktop (wrapper height is 0 otherwise) */
@media (min-width: 769px) {
    .header-wrapper::before {
        content: '';
        display: block;
        height: var(--header-offset, var(--header-height));
    }
}

#header-container .unified-buttons-row {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    #header-container .unified-buttons-row {
        margin-top: calc(var(--header-offset, var(--header-height)) + 8px);
    }
}

/* Collapse button: hidden on desktop, on mobile shown below header – shorter and wider */
.header-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    margin: 0 auto;
    transition: background 0.2s, border-color 0.2s;
}
.header-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
}
.header-collapse-btn i {
    font-size: 16px;
}

.logo-section {
    flex: 0 0 auto;
    text-align: left;
    padding: 12px 0;
}

.logo {
    display: block;
    text-align: left;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.logo a:hover h1 {
    color: #45a049;
}

.logo h1 {
    margin: 0;
    font-size: 32px;
    color: var(--accent-color);
    line-height: 1.2;
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
    display: block;
    line-height: 1.2;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.social-icon {
    color: #fff;
    font-size: 24px;
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: var(--accent-color);
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: calc(var(--header-height) + 20px) auto 0;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Page sections sit below fixed header (offset synced from .header-wrapper in JS) */
#event-section-container,
#land-areas-container,
#about-container {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

#event-section-container {
    padding-top: 12px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin: calc(var(--header-height) + 20px) 0 20px;
    padding-top: 20px;
}

.section-title h2 {
    color: var(--accent-color);
    font-size: 28px;
    margin: 0;
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.section-title h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 10px auto 0;
}

/* Event Description */
.event-description {
    text-align: center;
    margin: 20px auto;
    max-width: 800px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Side-by-side event sections */
@media (max-width: 1024px) {
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

.event-description p {
    margin: 10px 0;
    line-height: 1.5;
    color: #fff;
}

.event-description ol {
    text-align: left;
    width: fit-content;
    margin: 10px auto;
    padding-left: 30px;
    color: #fff;
}

.event-description li {
    margin: 5px 0;
    line-height: 1.5;
}

.event-description ul {
    text-align: left;
    width: fit-content;
    margin: 10px auto;
    padding-left: 30px;
    color: #fff;
    list-style-position: inside;
}

.event-description ul li {
    list-style-position: inside;
}

/* Announcement Styles */
.announcement-section {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    position: relative;
    max-width: 1000px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none; /* Hide by default */
}

.announcement-section.collapsed {
    padding: 10px 20px;
}

.announcement-section.collapsed .announcement-message {
    display: none;
}

.announcement-title {
    color: #4CAF50;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.announcement-section.collapsed .announcement-title {
    margin-bottom: 0;
}

.announcement-message {
    padding: 15px;
    margin: 0;
    color: #fff;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: break-word;
}

.announcement-toggle {
    background: none !important;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 24px;
    padding: 0 5px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.announcement-toggle:hover {
    background: none !important;
    color: #45a049;
}

.announcement-section.collapsed .announcement-toggle {
    transform: rotate(180deg);
}

/* Manual Addition Styles */
.manual-addition {
    color: #4CAF50;
    font-weight: bold;
    margin-left: 10px;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.manual-addition.fade {
    opacity: 0;
}

.manual-addition:empty {
    display: none !important;
}

/* Theme Switcher Styles */
#theme-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-options {
    padding: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-option.active {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--accent-color);
}

.theme-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-preview-default {
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d, #4CAF50);
}

.theme-preview-modern-dark {
    background: linear-gradient(45deg, #0a0a0a, #1a1a1a, #00d4ff);
}

.theme-preview-clean-light {
    background: linear-gradient(45deg, #f1f5f9, #e2e8f0, #1e40af);
}

.theme-preview-gaming {
    background: linear-gradient(45deg, #0d1117, #161b22, #ff6b35);
}


/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    /* When a theme is active: solid header and .header-content (same as default), no transparency */
    body.theme-modern-dark header,
    body.theme-gaming header {
        background-color: var(--secondary-color) !important;
        background: var(--secondary-color) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    body.theme-clean-light header {
        background-color: #ffffff !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Same .header-content layout for ALL themes (default values) – overrides theme-specific rules */
    .header-content,
    body.theme-modern-dark .header-content,
    body.theme-clean-light .header-content,
    body.theme-gaming .header-content {
        flex-direction: column !important;
        padding: 15px 20px !important;
        height: auto !important;
        gap: 15px !important;
        max-width: 1400px !important;
        margin: 0 auto !important;
        align-items: stretch !important;
    }
    /* Solid background on .header-content for themes so the block is never transparent */
    body.theme-modern-dark .header-content,
    body.theme-gaming .header-content {
        background-color: var(--secondary-color) !important;
        background: var(--secondary-color) !important;
    }
    body.theme-clean-light .header-content {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }

    /* On mobile, header-wrapper is the fixed bar (header + collapse button below); header must flow inside it */
    .header-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: var(--secondary-color);
        box-shadow: 0 2px 8px rgba(255,255,255,0.1);
    }
    header {
        position: static !important;
        height: auto !important;
        box-shadow: none !important;
    }
    /* Themes set header { position: fixed } – override so header stays in flow and button is visible below */
    body.theme-modern-dark header,
    body.theme-clean-light header,
    body.theme-gaming header {
        position: static !important;
        height: auto !important;
        box-shadow: none !important;
    }
    body.theme-modern-dark .header-wrapper,
    body.theme-gaming .header-wrapper {
        background-color: var(--secondary-color) !important;
        background: var(--secondary-color) !important;
    }
    body.theme-clean-light .header-wrapper {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }

    /* Center Theme button on mobile */
    #theme-switcher {
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
    }

    /* Collapse button: below header, shorter and wider – visible on all themes (default + theme-*) */
    .header-wrapper .header-collapse-btn,
    body.theme-modern-dark .header-wrapper .header-collapse-btn,
    body.theme-clean-light .header-wrapper .header-collapse-btn,
    body.theme-gaming .header-wrapper .header-collapse-btn {
        display: flex !important;
        width: 140px;
        height: 28px;
        border-radius: 0 0 8px 8px;
        flex-shrink: 0;
    }
    body.theme-clean-light .header-collapse-btn {
        border-color: rgba(0, 0, 0, 0.2);
        background: rgba(0, 0, 0, 0.06);
        color: var(--text-color);
    }
    body.theme-clean-light .header-collapse-btn:hover {
        background: rgba(0, 0, 0, 0.12);
        border-color: var(--accent-color);
    }

    /* Collapsed state: hide nav and theme switcher, compact header */
    header.header-collapsed .nav-links,
    header.header-collapsed #theme-switcher {
        display: none !important;
    }
    header.header-collapsed .header-content {
        padding: 10px 20px !important;
        gap: 0 !important;
    }

    .logo-section {
        margin-bottom: 0;
        text-align: center;
        width: 100%;
    }

    .logo {
        text-align: center;
    }

    .logo h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .main-container {
        margin-top: 320px;
        padding: 15px;
    }
}

/* Enhanced Responsive Design for All Themes */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 24px 0;
        padding: 28px;
    }
    
    .daily-number {
        margin: 20px;
        padding: 24px;
    }
    
    .treasury-amount {
        font-size: 36px;
    }
    
    .daily-number .number {
        font-size: 28px;
    }
    
    .land-areas-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 20px 0;
        padding: 24px;
    }
    
    .daily-number {
        margin: 16px;
        padding: 20px;
    }
    
    .land-areas-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 18px 0;
        padding: 22px;
    }
    
    .daily-number {
        margin: 14px;
        padding: 18px;
    }
    
    .land-areas-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Tablet Portrait (769px - 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 16px 0;
        padding: 20px;
    }
    
    .daily-number {
        margin: 12px;
        padding: 16px;
    }
    
    .land-areas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .daily-numbers {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile Landscape (481px - 768px) - Enhanced */
@media (max-width: 768px) {
    .land-areas-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .land-area-card {
        padding: 15px;
        margin: 12px 0;
    }

    .land-area-card h3 {
        font-size: 18px;
    }

    .land-area-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-box h4 {
        font-size: 12px;
    }

    .stat-box span {
        font-size: 20px;
    }

    .daily-numbers {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .daily-number {
        padding: 15px;
        margin: 8px;
    }

    .event-pool-content .daily-number {
        padding: 10px 12px !important;
        margin: 0 !important;
        min-width: 88px !important;
    }

    .daily-number .number {
        font-size: 24px;
    }

    .treasury-amount {
        font-size: 28px;
    }

    .event-section {
        padding: 20px;
        margin: 12px 0;
    }

    .registration-form {
        padding: 20px;
        margin: 12px 0;
    }

    .participants-list {
        padding: 20px;
        margin: 12px 0;
    }

    .prize-table {
        font-size: 12px;
    }

    .prize-table th,
    .prize-table td {
        padding: 8px;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        padding: 20px;
    }

    .area-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .area-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .monthly-history-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .admin-panel {
        padding: 20px;
    }

    .admin-section {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 14px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }

    .admin-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .about-section {
        padding: 20px;
    }

    .game-links {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-link {
        padding: 15px;
    }

    .game-link h3 {
        font-size: 18px;
    }

    .game-link p {
        font-size: 14px;
    }

    .social-links {
        flex-direction: column;
        gap: 10px;
    }

    .social-links a {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }
    
    .treasury-amount {
        font-size: 22px;
    }
    
    .daily-number .number {
        font-size: 18px;
    }
    
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 8px 0;
        padding: 12px;
    }
    
    .daily-number {
        margin: 6px;
        padding: 10px;
    }

    .event-pool-content .daily-number {
        margin: 0 !important;
        padding: 8px 10px !important;
    }
    
    .prize-table th,
    .prize-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .stat-box span {
        font-size: 18px;
    }
    
    button, .register-button, .history-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .form-group input[type="text"] {
        padding: 10px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 98%;
        max-width: 98%;
        margin: 2% auto;
        padding: 15px;
    }
    
    .area-details-grid {
        gap: 15px;
    }
    
    .area-stats {
        gap: 10px;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .logo h1 {
        font-size: 18px;
    }
    
    .treasury-amount {
        font-size: 20px;
    }
    
    .daily-number .number {
        font-size: 16px;
    }
    
    .land-area-card, .event-section, .registration-form, .participants-list {
        margin: 6px 0;
        padding: 10px;
    }
    
    .daily-number {
        margin: 4px;
        padding: 8px;
    }
    
    .prize-table th,
    .prize-table td {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .stat-box span {
        font-size: 16px;
    }
    
    button, .register-button, .history-button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 11px;
    }
}

/* Default theme — event header daily numbers (pre-compact sizing, Treasury yellow) */
body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .daily-number {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.15)) !important;
    border: 2px solid rgba(255, 215, 0, 0.55) !important;
    border-radius: 8px !important;
    padding: 16px 18px !important;
    min-width: 110px !important;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .daily-number .number {
    font-size: 1.75rem !important;
    font-weight: bold !important;
    color: #FFD700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.45) !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-treasury .draw-time,
body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .wild-draw-time {
    font-size: 0.75rem !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-treasury .draw-time {
    color: #FFD700 !important;
    opacity: 0.85 !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .daily-number-payout-container {
    padding: 6px 10px !important;
    margin-bottom: 6px !important;
}

/* WILD numbers — red (override default-theme yellow on shared .daily-number rules) */
body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .daily-number {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(0, 0, 0, 0.2)) !important;
    border: 2px solid rgba(220, 53, 69, 0.55) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.25) !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .daily-number .number {
    color: #ff5252 !important;
    text-shadow: 0 0 5px rgba(255, 82, 82, 0.35) !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .daily-number-payout-container {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.12), rgba(0, 0, 0, 0.15)) !important;
    border: 2px solid rgba(220, 53, 69, 0.4) !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .daily-number-payout {
    color: #ff5252 !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .event-pool-content .numbers-wild .wild-draw-time {
    color: #ff5252 !important;
    opacity: 0.85 !important;
}

body:not(.theme-clean-light):not(.theme-modern-dark):not(.theme-gaming) .next-draw-countdown {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1)) !important;
    border: 1px solid rgba(255, 215, 0, 0.45) !important;
    border-radius: 5px !important;
    padding: 8px 12px !important;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2) !important;
    color: #FFD700 !important;
}

/* Leaderboard Widget Styles */
.leaderboard-widget {
    background: var(--secondary-color);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1400px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
    border-color: #45a049;
}

.leaderboard-widget.leaderboard-below:hover {
    border-color: #FFD700 !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 215, 0, 0.4) !important;
}

.leaderboard-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
}

.leaderboard-header .leaderboard-subtitle {
    margin-bottom: 20px;
    width: 100%;
    font-size: 22px !important;
    color: #FFD700 !important;
    font-weight: bold;
}

.leaderboard-header .leaderboard-title {
    margin-bottom: 10px;
}

.leaderboard-header .leaderboard-total-globals {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
    font-size: 14px;
}

.leaderboard-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-title i {
    color: #FFD700;
}

.leaderboard-period {
    color: #888;
    font-size: 16px;
    text-align: center;
    width: 100%;
}

.leaderboard-pool-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    margin: 10px 0;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.leaderboard-pool-size .pool-size-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
}

.leaderboard-pool-size .pool-size-value {
    display: none; /* Hide pool size value completely */
}

.leaderboard-pool-size .payout-value {
    color: #FFD700; /* Gold color */
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    margin-left: 0.5rem;
    font-size: 1.1em;
    color: var(--accent-color);
}

.leaderboard-pool-size .pool-size-note {
    color: #888;
    font-size: 0.85em;
    font-style: italic;
}

.leaderboard-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(5px);
}

.leaderboard-item .rank {
    font-size: 28px;
    min-width: 50px;
    text-align: center;
}

.leaderboard-item .name {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    margin-left: 15px;
}

.leaderboard-item .score {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.leaderboard-item .score-label {
    font-size: 14px;
    color: #888;
    font-weight: normal;
}

.leaderboard-cta {
    text-align: center;
    color: var(--accent-color);
    font-size: 14px;
    margin-top: 10px;
    font-style: italic;
}

.leaderboard-empty {
    text-align: center;
    color: #888;
    padding: 30px;
    font-style: italic;
}

/* Smaller variant when placed below land areas */
.leaderboard-widget.leaderboard-below {
    max-width: 100%;
    width: 100%;
    padding: 14px;
    margin: 0;
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3) !important;
    animation: gold-glow 2s ease-in-out infinite alternate;
    height: 900px;
    display: flex;
    flex-direction: column;
}
.leaderboard-widget.leaderboard-below .leaderboard-title {
    font-size: 18px;
}
.leaderboard-widget.leaderboard-below .leaderboard-period {
    font-size: 16px;
    text-align: center;
    width: 100%;
}
.leaderboard-widget.leaderboard-below .leaderboard-header .leaderboard-subtitle {
    font-size: 22px !important;
    margin-bottom: 20px;
    padding: 4px 8px;
    color: #FFD700 !important;
}
.leaderboard-widget.leaderboard-below .leaderboard-item {
    padding: 8px 10px;
}
.leaderboard-widget.leaderboard-below .leaderboard-item .name {
    font-size: 14px;
}
.leaderboard-widget.leaderboard-below .leaderboard-item .score {
    font-size: 14px;
}
.leaderboard-widget.leaderboard-below .leaderboard-cta {
    font-size: 12px;
}

/* Widget Pool Tabs */
.leaderboard-widget-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    flex-wrap: wrap;
}

.widget-tabs-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.widget-pool-tab {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.widget-pool-tab:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.6);
    color: #fff;
}

.widget-pool-tab.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    color: #FFD700;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Leaderboard Modal Styles */
#leaderboardModal .modal-content {
    max-width: 900px;
}

.leaderboard-content {
    padding: 10px 0;
}

.leaderboard-controls {
    margin-bottom: 20px;
    text-align: center;
    color: var(--accent-color);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.leaderboard-pool-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.pool-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.pool-tab:hover {
    color: var(--accent-color);
}

.pool-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.pool-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.leaderboard-pool-selector {
    min-width: 200px;
    cursor: pointer;
    padding: 8px;
    background: var(--primary-color);
    color: var(--text-color);
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 14px;
}

.leaderboard-pool-selector:hover {
    border-color: var(--accent-color);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.leaderboard-row:hover {
    background: rgba(0, 0, 0, 0.5);
    border-left-color: var(--accent-color);
}

.leaderboard-row .rank {
    min-width: 50px;
    text-align: center;
    font-weight: bold;
    color: var(--accent-color);
    font-size: 18px;
}

.leaderboard-row .type {
    min-width: 80px;
    text-align: center;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    padding: 4px 8px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 4px;
}

.leaderboard-row .name {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    margin-left: 15px;
}

.leaderboard-row .score {
    min-width: 100px;
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-color);
}

.leaderboard-row .winnings,
.leaderboard-row .earnings,
.leaderboard-item .winnings {
    min-width: 120px;
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    margin-left: 10px;
}

.leaderboard-item .winnings {
    font-size: 14px;
}

.leaderboard-header-row {
    background: rgba(0, 0, 0, 0.5) !important;
    border-bottom: 2px solid var(--accent-color);
    font-weight: bold;
    opacity: 0.8;
}

.leaderboard-header-row:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-left-color: transparent !important;
}

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.leaderboard-tab:hover {
    color: var(--accent-color);
}

.leaderboard-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.leaderboard-tab-content {
    display: none;
}

.leaderboard-tab-content.active {
    display: block;
}

/* History Period */
.history-period {
    margin-bottom: 30px;
}

.history-period-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Land Areas Grid - Base styles for 3 columns (2 rows) */
.land-areas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Special container for active leaderboard areas - centered below the grid */
.land-area-card-special {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    width: 100%;
}

.land-area-card-special .land-area-card {
    max-width: 400px;
    margin: 0 auto;
}

/* Container for multiple active leaderboard areas */
#activeLeaderboardAreas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px auto;
    padding: 0 40px;
    max-width: 1400px;
}

/* Active pool cards should display inline, not stacked */
#activeLeaderboardAreas .land-area-card {
    flex: 0 0 auto;
    width: calc((100% - 40px) / 3);
    min-width: 280px;
    max-width: 320px;
    margin: 0;
}

@media (max-width: 1024px) {
    #activeLeaderboardAreas .land-area-card {
        width: calc((100% - 20px) / 2);
    }
}

@media (max-width: 640px) {
    #activeLeaderboardAreas .land-area-card {
        width: 100%;
        max-width: 100%;
    }
}

/* Highlight active leaderboard area card with gold glow */
.land-area-card.active-leaderboard-area {
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3) !important;
    animation: gold-glow 2s ease-in-out infinite alternate;
}

@keyframes gold-glow {
    from {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 215, 0, 0.4);
    }
}

.land-area-card .area-actions {
    padding: 10px;
    display: flex;
    justify-content: flex-end;
}

.area-leaderboard-button {
    background: linear-gradient(135deg, #FFD700, #FFC107);
    color: #000;
    font-weight: bold;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.area-leaderboard-button:hover {
    filter: brightness(0.95);
}

/* Leaderboard subtitle */
.leaderboard-subtitle {
    text-align: center;
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 15px 0;
    padding: 8px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
}

/* Claim Winnings Section */
.claim-winnings-section {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
}

.claim-winnings-box {
    background: var(--secondary-color);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.claim-winnings-box h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.claim-description {
    color: #ccc;
    margin-bottom: 20px;
    font-size: 14px;
}

.claim-form-group {
    margin-bottom: 15px;
}

.claim-form-group label {
    display: block;
    color: var(--text-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.claim-form-group input,
.claim-form-group select {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    border: 1px solid #555;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
}

.claim-form-group input:focus,
.claim-form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.claim-form-group input[readonly] {
    background: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
}

.claim-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-color), #45a049);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.claim-button:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.claim-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.claim-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-weight: 600;
}

.claim-message-success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.claim-message-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #dc3545;
}

.claim-message-info {
    background: rgba(0, 123, 255, 0.2);
    border: 1px solid #007bff;
    color: #007bff;
}

@media (max-width: 768px) {
    .leaderboard-widget {
        padding: 15px;
        margin: 15px;
    }

    .leaderboard-title {
        font-size: 20px;
    }

    .leaderboard-item .name {
        font-size: 16px;
    }

    .leaderboard-item .score {
        font-size: 18px;
    }

    .leaderboard-row {
        flex-wrap: wrap;
        gap: 5px;
    }

    .leaderboard-row .rank,
    .leaderboard-row .type,
    .leaderboard-row .name,
    .leaderboard-row .score {
        font-size: 14px;
    }
}

/* Winners Log Styles */
.winners-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.winner-item {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border-left: 4px solid var(--accent-color);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.winner-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

.winner-item .winner-primary {
    font-weight: bold;
    color: var(--accent-color);
}

.winner-item .winner-secondary {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}

.winners-log .empty-state,
.winners-log .error-state {
    text-align: center;
    color: #aaa;
    padding: 12px 0;
    font-style: italic;
}
