/* ==========================================
   TOURNAMENT DETAIL - EXACT REFERENCE MATCH
   ========================================== */

#tournamentDetails {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #1a1230;
}

/* ==========================================
   HERO BANNER - TWO COLUMN LAYOUT
   ========================================== */
.tournament-hero-banner {
    position: relative;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    padding: 3rem;
    min-height: 400px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
}

.hero-left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2;
}

.hero-right-content {
    display: flex;
    align-items: flex-start;
    z-index: 2;
}

.hero-column {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: flex-end;
}

.hero-cell-left {
    display: flex;
    align-items: flex-end;
}

.hero-cell-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    width: 100%;
}

.status-row {
    display: flex;
    align-items: center;
}

.game-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.tournament-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #10b981;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
}

.status-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Character Image */
.hero-character {
    position: absolute;
    right: 50px;
    bottom: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    z-index: 1;
}

.hero-character img {
    height: 120%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

/* Prize + Countdown Card */
.prize-countdown-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 350px;
}

.prize-section {
    text-align: center;
    margin-bottom: 2rem;
}

.prize-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.prize-value {
    font-size: 2.25rem;
    font-weight: 900;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.countdown-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.countdown-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.count-box {
    text-align: center;
}

.count-num {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    line-height: 1;
    transition: transform 0.3s ease-in-out;
}

/* Countdown animation */
@keyframes countdownUpdate {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
        color: #22d3ee;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.count-num:active {
    animation: countdownUpdate 0.3s ease-in-out;
}

.count-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* ==========================================
   TABS - FLAT DESIGN LIKE REFERENCE
   ========================================== */
.tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1838;
    padding: 0;
    border-bottom: 2px solid #312e81;
    gap: 1rem;
}

.tabs-left {
    display: flex;
    gap: 0;
    flex: 1;
}

.tab-item {
    padding: 0.875rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-item:hover {
    color: var(--text-light);
    background: rgba(168, 85, 247, 0.05);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
}

/* Results Subtabs */
.results-subtabs {
    display: flex;
    gap: 0;
    background: #16122a;
    border-bottom: 2px solid #2a2550;
    padding: 0;
}

.subtab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.subtab-btn:hover {
    color: var(--text-light);
    background: rgba(168, 85, 247, 0.05);
}

.subtab-btn.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    background: rgba(16, 185, 129, 0.1);
}

.subtab-content {
    display: none;
    padding: 2rem;
}

.subtab-content.active {
    display: block;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    color: var(--text-light);
}

.player-status {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-manage {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-manage:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.btn-manage:disabled,
.btn-manage[style*="cursor: default"] {
    opacity: 0.9;
    cursor: default !important;
}

.btn-manage:disabled:hover,
.btn-manage[style*="cursor: default"]:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==========================================
   CONTENT LAYOUT
   ========================================== */
.tab-content {
    display: none;
    background: #0f0a1e;
    min-height: 500px;
}

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

.main-content-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    padding: 2rem;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==========================================
   CARDS - SIMPLE LIKE REFERENCE
   ========================================== */
.card {
    background: #1e1838;
    border: 1px solid #312e81;
    border-radius: 12px;
    padding: 2rem;
}

/* Status Timeline */
.status-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.timeline-step.current,
.timeline-step.completed {
    opacity: 1;
}

.step-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-step.current .step-indicator {
    color: var(--primary-color);
    font-size: 1rem;
}

.timeline-step.completed .step-indicator {
    color: var(--secondary-color);
}

.step-info {
    display: flex;
    flex-direction: column;
}

.step-name {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.step-state {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.timeline-step.current .step-state {
    color: var(--primary-color);
}

.timeline-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 1rem;
}

/* About Section */
.about-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* Game Rules */
.rules-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.rules-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rules-list li {
    padding-right: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
}

.rules-list li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Links */
.links-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    word-break: break-all;
}

.external-link:hover {
    color: var(--primary-color);
}

/* Registration Card */
.registration-card {
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.05) 0%,
        rgba(16, 185, 129, 0.05) 100%
    );
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.registration-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.registration-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.registration-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-register {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 8px 24px var(--glow-primary);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-register:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px var(--glow-primary);
}

/* ==========================================
   SIDEBAR - RIGHT COLUMN
   ========================================== */
.content-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Players Card */
.players-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.players-avatars {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.player-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.players-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-row svg {
    opacity: 0.6;
}

.stat-row strong {
    margin-right: auto;
    color: var(--text-light);
    font-weight: 600;
}

/* Admin Card */
.admin-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.125rem;
}

.admin-name {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.admin-role {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Info Cards in Sidebar */
.info-grid-card {
    background: #1e1838;
    border: 1px solid #312e81;
    border-radius: 12px;
    padding: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(49, 46, 129, 0.5);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Timeline Card */
.timeline-card {
    background: #1e1838;
    border: 1px solid #312e81;
    border-radius: 12px;
    padding: 1.5rem;
}

.timeline-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-event {
    display: flex;
    gap: 1rem;
}

.event-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-details {
    flex: 1;
}

.event-title {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.event-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================
   RESULTS SECTION WITH TABS
   ========================================== */
.results-section {
    padding: 0;
    overflow: hidden;
}

.results-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #312e81;
    background: #1e1838;
}

.tab-button {
    flex: 1;
    padding: 1.25rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-button:hover {
    color: var(--text-light);
    background: rgba(168, 85, 247, 0.05);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
}

.tab-content {
    display: none;
    padding: 2rem;
}

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

/* ==========================================
   LEADERBOARD TABLE
   ========================================== */
.leaderboard-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

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

.leaderboard-table thead th {
    background: rgba(168, 85, 247, 0.1);
    color: var(--text-light);
    padding: 1rem;
    text-align: right;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-table thead th:first-child {
    border-top-right-radius: 8px;
    text-align: center;
}

.leaderboard-table thead th:last-child {
    border-top-left-radius: 8px;
}

.leaderboard-row {
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(168, 85, 247, 0.05);
}

.leaderboard-row.top-player {
    background: rgba(16, 185, 129, 0.05);
}

.leaderboard-row.top-player:hover {
    background: rgba(16, 185, 129, 0.1);
}

.leaderboard-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    text-align: right;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1230;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #1a1230;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e6a85c);
    color: #1a1230;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.rank-badge.rank-other {
    background: rgba(168, 85, 247, 0.2);
    color: var(--text-light);
}

.medal {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.player-cell {
    text-align: right !important;
}

.player-info-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.player-name {
    font-weight: 600;
    color: var(--text-light);
}

.clicks-cell strong,
.points-cell strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.wins-cell {
    color: var(--secondary-color);
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1200px) {
    .tournament-hero-banner {
        padding: 2rem;
        gap: 2rem;
    }
    
    .prize-countdown-card {
        max-width: 300px;
    }
    
    .hero-character {
        display: none;
    }
    
    .main-content-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 968px) {
    .tournament-hero-banner {
        flex-direction: column-reverse;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .hero-right-content {
        width: 100%;
    }
    
    .prize-countdown-card {
        max-width: 100%;
    }
    
    .main-content-layout {
        grid-template-columns: 1fr;
    }
    
    .tabs-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs-left {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .tournament-hero-banner {
        padding: 1.5rem;
    }
    
    .tournament-title {
        font-size: 2rem;
    }
    
    .main-content-layout {
        padding: 1rem;
    }
    
    .status-timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .timeline-line {
        height: 30px;
        width: 2px;
        margin: 0.5rem 0 0.5rem 0.5rem;
    }
    
    .tabs-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs-left {
        overflow-x: auto;
        width: 100%;
    }
    
    .btn-manage {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 1rem 1.5rem;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
