/* ==========================================================================
   UNIFIED GAMES HUB STYLE (SELECTOR SCREEN)
   Glassmorphism, cyber neon theme.
   ========================================================================== */

:root {
    --neon-blue: #6366F1;
    --neon-cyan: #06B6D4;
    --neon-pink: #EC4899;
}

body {
    background: #080A10 radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 80%);
    color: #F3F4F6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.selector-container {
    max-width: 680px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.logo-orbit {
    font-size: 3rem;
    animation: rotate 6s linear infinite;
    display: inline-block;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.portal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin: 10px 0 5px 0;
}

.portal-title .accent {
    color: var(--neon-blue);
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.portal-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

/* Glass card styling */
.glass-card {
    background: rgba(17, 22, 34, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.05);
    backdrop-filter: blur(12px);
}

/* Profile Indicator Badge */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #F3F4F6;
    margin-bottom: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
}

/* Games Selector Radio Grid */
.games-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.game-option-card {
    cursor: pointer;
    display: block;
    position: relative;
}

.game-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.game-card-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-icon {
    font-size: 2rem;
    transition: transform 0.3s;
}

.game-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.game-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Selected states */
.game-option-card input[type="radio"]:checked + .game-card-content {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2), inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.game-option-card input[type="radio"]:checked + .game-card-content .game-icon {
    transform: scale(1.15);
}

.game-option-card:hover .game-card-content {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Layout Utilities */
.mt-20 { margin-top: 20px; }
.mt-8 { margin-top: 8px; }
.text-center { text-align: center; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s;
    box-sizing: border-box;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

/* Actions buttons & code join */
.actions-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
    padding: 0 15px;
}

.join-input-wrap {
    display: flex;
    gap: 10px;
}

.code-input {
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

.btn {
    font-family: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--neon-blue);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: #4f46e5;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #F3F4F6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

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

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

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

/* Hide when active game is showing */
#screen-selector.hidden {
    display: none;
}

#screen-selector {
    display: flex;
    justify-content: center;
    align-items: center;
}
.screen {
    display: none;
}
.screen.active {
    display: block;
}
.hidden {
    display: none !important;
}

/* ==========================================================================
   TABS AND LEADERBOARD/RANKING STYLE
   ========================================================================== */

.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.tab-btn {
    background: rgba(17, 22, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #9CA3AF);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #FFF;
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: #FFF;
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.45);
}

.ranking-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #FFF 30%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.ranking-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .ranking-grid {
        grid-template-columns: 1fr;
    }
}

.ranking-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.game-ranking-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 5px;
}

.ranking-list::-webkit-scrollbar {
    width: 4px;
}
.ranking-list::-webkit-scrollbar-track {
    background: transparent;
}
.ranking-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: 'Orbitron', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #D1D5DB;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border-color: #FBBF24;
    color: #FFF;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #9CA3AF, #4B5563);
    border-color: #D1D5DB;
    color: #FFF;
    box-shadow: 0 0 8px rgba(156, 163, 175, 0.3);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #B45309, #78350F);
    border-color: #F59E0B;
    color: #FFF;
    box-shadow: 0 0 6px rgba(180, 83, 9, 0.3);
}

.ranking-user-info {
    flex-grow: 1;
    min-width: 0;
}

.ranking-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: #F3F4F6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-wins {
    font-size: 0.75rem;
    color: var(--text-muted, #9CA3AF);
}

.ranking-wins .highlight {
    color: var(--neon-cyan);
    font-weight: bold;
}

.ranking-loading {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted, #9CA3AF);
    padding: 20px 0;
    font-style: italic;
    animation: pulse 1.5s infinite ease-in-out;
}

.ranking-empty {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #9CA3AF);
    padding: 15px 0;
}

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