/* --- Tetris Integration --- */
.discord-float-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #5865F2;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.discord-float-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 0 30px #5865F2;
    color: #fff;
    background: #4752C4;
    border: 2px solid #5865F2;
}

.tetris-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
}

.tetris-float-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 30px var(--primary-color);
    color: #fff;
    background: #000;
    border: 2px solid var(--primary-color);
}

.tetris-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.tetris-modal.active {
    opacity: 1;
    pointer-events: all;
}

.tetris-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tetris-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: transparent;
    border: none;
    color: var(--danger-color, #ff3333);
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.2s;
}

.close-modal-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: #fff;
}

/* --- Strategic Partners Section --- */
.partners-section {
    text-align: center;
    background: radial-gradient(circle at center, rgba(0, 50, 20, 0.1), transparent 70%);
    /* Subtle green hint for growth/money */
}

.partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem;
}

.partner-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.98));
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    text-decoration: none;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.partner-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #4dff4d;
    /* Bright Green */
    box-shadow: 0 0 30px rgba(77, 255, 77, 0.2);
}

.partner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(77, 255, 77, 0.05), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.partner-card:hover::before {
    transform: translateX(100%);
}

.partner-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4dff4d;
    color: #000;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(77, 255, 77, 0.4);
}

.partner-icon {
    font-size: 3rem;
    color: #4dff4d;
    margin-right: 2rem;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: rgba(77, 255, 77, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(77, 255, 77, 0.2);
}

.partner-content {
    text-align: left;
    flex: 1;
}

.partner-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
}

.partner-desc {
    color: #bbb;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.partner-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.partner-benefits span {
    font-size: 0.9rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.partner-benefits span.highlight {
    color: #4dff4d;
    font-weight: bold;
}

.cta-mini {
    display: inline-block;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    transition: margin-left 0.2s;
}

.partner-card:hover .cta-mini {
    margin-left: 5px;
    color: #fff;
}

/* Responsiveness for Partner Card */
@media (max-width: 600px) {
    .partner-card {
        flex-direction: column;
        text-align: center;
    }

    .partner-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .partner-content {
        text-align: center;
    }

    .partner-benefits {
        justify-content: center;
    }

    .partner-badge {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }
}

/* --- Duel Tree Section --- */
.tree-stats {
    display: block;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 30px;
    border-radius: 8px;
    border: 1px solid var(--accent-light);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
    margin: 0 auto 1rem auto;
    max-width: 320px;
}

.tree-stats h3 {
    margin: 0 0 5px 0;
    color: var(--accent-color);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tree-stats .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 10px var(--accent-color);
}

.tree-stats .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 70vh;
    position: relative;
    background: radial-gradient(circle at center, rgba(0, 168, 255, 0.08), rgba(10, 15, 25, 0.9) 70%);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.1);
    overflow: hidden;
    border: 1px solid rgba(0, 168, 255, 0.2);
}

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

/* --- Stats Tables (for stats.php) --- */
.stat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.stat-table th, .stat-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-table th {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-table td {
    color: var(--text-color);
}

.stat-table .rank-col {
    width: 40px;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.stat-table .value-col {
    text-align: right;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.stat-table .player-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.stat-table .player-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-glow);
}

/* Dashboard Grid Layout (Leaderboard + Live Telemetry) */
.dashboard-grid-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: stretch;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Leaderboard Table Alignment */
.leaderboard-table th,
.leaderboard-table td {
    text-align: center !important;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    text-align: left !important;
    padding-left: 2rem !important;
}

@media (max-width: 1024px) {
    .dashboard-grid-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.live-comms-widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    height: 100%;
}

.live-comms-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.live-comms-widget h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot-glowing {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.6; box-shadow: 0 0 4px #10b981; }
    50% { opacity: 1; box-shadow: 0 0 10px #10b981; }
}

.live-comms-widget .log-msg {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.3;
}

/* Galactic Communities Section */
.communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 2rem auto 0 auto;
}

.community-card {
    background: rgba(10, 15, 26, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.community-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color, var(--primary-color));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow, rgba(0, 242, 255, 0.15));
}

.community-badge {
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-color, #fff);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.community-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.community-title i {
    color: var(--accent-color, var(--primary-color));
    font-size: 1.1rem;
}

.community-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.community-join-btn {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color, var(--primary-color)) !important;
    background: transparent;
    border: 1px solid var(--accent-color, var(--primary-color));
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    text-decoration: none;
}

.community-card:hover .community-join-btn {
    color: #000 !important;
    background: var(--accent-color, var(--primary-color));
    box-shadow: 0 0 10px var(--accent-glow, var(--primary-glow));
}

/* --- Dropdown Communities Styling --- */
.nav-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 1rem;
}

.nav-dropdown-header {
    display: block;
    padding: 0.4rem 1.2rem;
    font-size: 0.72rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-dropdown .community-link {
    font-size: 0.82rem !important;
    padding: 0.5rem 1.2rem !important;
    color: #a5f3fc !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-dropdown .community-link i {
    color: #5865F2;
    font-size: 0.9rem;
    width: 14px;
    text-align: center;
}

.nav-dropdown .community-link:hover {
    color: #fff !important;
    background: rgba(88, 101, 242, 0.15) !important;
    text-shadow: 0 0 5px rgba(88, 101, 242, 0.5);
}

@media (max-width: 768px) {
    .nav-dropdown-header {
        padding-left: 2.5rem;
    }
    .nav-dropdown .community-link {
        padding-left: 3rem !important;
        font-size: 0.88rem !important;
    }
}

/* Hide floating action buttons on mobile/tablet screens */
@media (max-width: 1024px) {
    .discord-float-btn,
    .tetris-float-btn {
        display: none !important;
    }
}

