/* =========================
   Poker Ocean - Dark UI
   ========================= */

/* Reset e Variáveis */
:root {
    --bg: #050b1c;
    --bg-2: #07112b;
    --panel: rgba(10, 22, 55, 0.72);
    --panel-2: rgba(10, 22, 55, 0.55);
    --border: rgba(255, 255, 255, 0.08);

    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.62);

    --primary: #2f6bff;
    --primary-dark: #1f4fe0;

    --gold: #fbbf24;
    --silver: #9ca3af;
    --bronze: #cd7f32;

    --success: #10b981;
    --danger: #ef4444;

    --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.28);

    --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(1200px 600px at 20% 15%, rgba(47, 107, 255, 0.18), transparent 55%),
        radial-gradient(900px 500px at 85% 20%, rgba(16, 185, 129, 0.08), transparent 60%),
        radial-gradient(1000px 600px at 55% 90%, rgba(251, 191, 36, 0.06), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, #030717 100%);
    color: var(--text);
    line-height: 1.35;
}

/* Container */
.app-container { display: flex; min-height: 100vh; }

/* Sidebar (admin) */
.sidebar {
    width: 260px;
    background: rgba(255,255,255,0.96);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.2rem 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 { font-size: 1.15rem; color: #1e40af; font-weight: 800; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.2rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.nav-item:hover { background: #f9fafb; color: #1e40af; }

.nav-item.active {
    background: #1e40af;
    color: #fff;
    border-left: 4px solid #fbbf24;
}

.sidebar-footer { padding: 1rem 1.2rem; border-top: 1px solid #e5e7eb; }

.temporada-ativa {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.temporada-ativa svg { color: #1e40af; }

.temporada-ativa small { display: block; font-size: 0.75rem; color: #6b7280; }
.temporada-ativa strong { display: block; font-size: 0.9rem; color: #111827; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    justify-content: center;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Main */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.content-wrapper {
    padding: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Alertas */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.25s ease-out;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10, 22, 55, 0.5);
}

.alert-success { border-left: 4px solid var(--success); }
.alert-error { border-left: 4px solid var(--danger); }
.alert-warning { border-left: 4px solid #f59e0b; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: inherit;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 1.1rem;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.btn-secondary {
    background: rgba(255,255,255,0.10);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-block { width: 100%; justify-content: center; }

/* Public header (compacto) */
.public-header-dark {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.compact-header { margin: 1rem 0 0.75rem; }
.compact-header-content {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-header-content h1 {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.btn-login-public {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.95rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,0.10);
}

.btn-login-blue { background: rgba(47,107,255,0.18); color: #dfe8ff; }
.btn-login-blue:hover { background: rgba(47,107,255,0.28); }

/* Dashboard header */
.dashboard-header-dark {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin: 0.4rem 0 1.25rem;
}

.dashboard-header-dark h1 {
    font-size: 2rem;
    font-weight: 950;
    letter-spacing: -0.6px;
}

.muted-dark { color: var(--muted); margin-top: 0.35rem; font-size: 0.95rem; }

/* Empty */
.empty-state-dark {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(10, 22, 55, 0.55);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.empty-state-dark svg { opacity: 0.6; margin-bottom: 1rem; }
.empty-state-dark h2 { font-size: 1.35rem; margin-bottom: 0.35rem; }
.empty-state-dark p { color: var(--muted); margin-bottom: 1rem; }

/* =========================
   Layout split (Top3 + Ranking)
   ========================= */
.ranking-split-flex {
    display: flex;
    gap: 1.1rem;
    align-items: stretch;
}

.podium-panel-wide { width: 55%; }
.ranking-panel-narrow { width: 35%; }

.podium-panel,
.ranking-panel {
    background: rgba(10, 22, 55, 0.55);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 950;
    letter-spacing: -0.2px;
    padding: 1rem 1rem 0.85rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
}

.panel-subtitle {
    color: var(--muted);
    font-weight: 850;
    font-size: 0.82rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* desktop/mobile legend toggles */
.legend-mobile { display: none; }
.legend-desktop { display: inline; }

/* =========================
   TOP 3 (cores + destaque)
   ========================= */
.podium-visual {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    padding: 0 1rem 1rem;
    align-items: end;
}

.podium-block { display: flex; }

.podium-card-visual {
    width: 100%;
    border-radius: 16px;
    padding: 1.05rem 0.95rem;
    position: relative;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 14px 28px rgba(0,0,0,0.35);
}

/* ✅ Voltar cores fortes do pódio */
.podium-card-visual.gold {
    background: linear-gradient(180deg, rgba(251,191,36,0.30), rgba(251,191,36,0.14));
    border-color: rgba(251,191,36,0.34);
}
.podium-card-visual.silver {
    background: linear-gradient(180deg, rgba(156,163,175,0.28), rgba(156,163,175,0.12));
    border-color: rgba(156,163,175,0.30);
}
.podium-card-visual.bronze {
    background: linear-gradient(180deg, rgba(205,127,50,0.28), rgba(205,127,50,0.12));
    border-color: rgba(205,127,50,0.30);
}

/* ✅ Número de classificação com destaque */
.podium-badge {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 950;
    font-size: 1rem;
    box-shadow: 0 10px 18px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.18);
}

.podium-card-visual.gold .podium-badge { background: rgba(251,191,36,0.95); color: #111827; }
.podium-card-visual.silver .podium-badge { background: rgba(156,163,175,0.95); color: #0b1024; }
.podium-card-visual.bronze .podium-badge { background: rgba(205,127,50,0.95); color: #0b1024; }

/* ✅ Foto com destaque (borda + brilho por medalha) */
.podium-avatar-visual {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    margin: 0.25rem auto 0.7rem;
    display: grid;
    place-items: center;
    font-weight: 950;
    color: #fff;
    object-fit: cover;
    box-shadow: 0 14px 22px rgba(0,0,0,0.35);
}

.avatar-medal-gold { border: 4px solid rgba(251,191,36,0.90); box-shadow: 0 0 0 6px rgba(251,191,36,0.12), 0 14px 22px rgba(0,0,0,0.35); }
.avatar-medal-silver { border: 4px solid rgba(156,163,175,0.90); box-shadow: 0 0 0 6px rgba(156,163,175,0.10), 0 14px 22px rgba(0,0,0,0.35); }
.avatar-medal-bronze { border: 4px solid rgba(205,127,50,0.92); box-shadow: 0 0 0 6px rgba(205,127,50,0.10), 0 14px 22px rgba(0,0,0,0.35); }

.podium-name { font-weight: 950; font-size: 1rem; margin-bottom: 0.25rem; }
.podium-points-visual { font-weight: 950; color: #e9f0ff; margin-bottom: 0.55rem; }

.podium-mini-stats {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    color: rgba(255,255,255,0.72);
    font-weight: 900;
    font-size: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.podium-trophy { margin-top: 0.65rem; opacity: 0.7; }

/* =========================
   Ranking table (com nome e sem posição duplicada)
   ========================= */
.ranking-table-wrap { padding: 0 0.75rem 0.85rem; }

.ranking-table-compact {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* trava colunas */
}

.ranking-table-compact thead th {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.8rem 0.55rem;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.ranking-table-compact tbody td {
    padding: 0.85rem 0.55rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    vertical-align: middle;
    font-weight: 900;
}

.ranking-table-compact tbody tr:hover { background: rgba(255,255,255,0.03); }

/* larguras fixas */
.col-pos { width: 54px; }
.col-player { width: auto; }
.col-vit { width: 40px; }
.col-itm { width: 40px; }
.col-pts { width: 56px; }
.col-var { width: 58px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ✅ Jogador alinhado: avatar + nome */
.player-info {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0.65rem;
    align-items: center;
    min-width: 0;
}

.player-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 950;
    color: #fff;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 16px rgba(0,0,0,0.25);
}

.player-name-block { min-width: 0; }

.player-name.one-line {
    font-weight: 950;
    font-size: 0.92rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* variação */
.variacao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-weight: 950;
    font-size: 0.85rem;
    min-height: 18px;
}

.variacao.up { color: var(--success); }
.variacao.down { color: var(--danger); }

.ranking-empty-note {
    padding: 1rem;
    color: var(--muted);
    font-weight: 850;
    text-align: center;
}

/* =========================
   Login (mantido)
   ========================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #0b1a46 100%);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 92%;
    gap: 2rem;
    align-items: center;
}

.login-card {
    background: rgba(255,255,255,0.96);
    padding: 2.6rem;
    border-radius: 18px;
    box-shadow: var(--shadow);
    color: #0f172a;
}

.login-header { text-align: center; margin-bottom: 1.6rem; }
.login-header svg { color: #1e40af; margin-bottom: 0.8rem; }
.login-header h1 { font-size: 1.6rem; margin-bottom: 0.25rem; font-weight: 950; }
.login-header p { color: #6b7280; }

.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 800; color: #111827;
    margin-bottom: 0.4rem; font-size: 0.86rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #2f6bff;
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18);
}

.login-footer {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.btn-link { color: #1e40af; text-decoration: none; font-weight: 800; }
.btn-link:hover { text-decoration: underline; }

.login-info { color: #fff; }
.login-info h2 { font-size: 2rem; margin-bottom: 1rem; font-weight: 950; }
.login-info p { font-size: 1.05rem; margin-bottom: 1.8rem; opacity: 0.9; }
.login-info ul { list-style: none; }
.login-info li { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; font-size: 1.05rem; }

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut { to { opacity: 0; transform: translateX(16px); } }

/* =========================
   Responsive
   ========================= */
@media (max-width: 1024px) {
    .ranking-split-flex { flex-direction: column; }
    .podium-panel-wide, .ranking-panel-narrow { width: 100%; }
    .login-container { grid-template-columns: 1fr; }
    .login-info { display: none; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .content-wrapper { padding: 0.9rem; }

    .dashboard-header-dark h1 { font-size: 1.55rem; }
    .muted-dark { font-size: 0.92rem; }

    .podium-visual { grid-template-columns: 1fr; }
}

/* Mobile: manter tabela em linha, curta e clara */
@media (max-width: 640px) {
    .legend-desktop { display: none; }
    .legend-mobile { display: inline; }

    .ranking-table-compact thead th {
        font-size: 0.68rem;
        padding: 0.7rem 0.45rem;
    }

    .ranking-table-compact tbody td {
        padding: 0.78rem 0.45rem;
        font-size: 0.9rem;
    }

    .col-pos { width: 42px; }
    .col-vit { width: 34px; }
    .col-itm { width: 34px; }
    .col-pts { width: 46px; }
    .col-var { width: 44px; }

    .player-info {
        grid-template-columns: 32px 1fr;
        gap: 0.55rem;
    }

    .player-avatar-small { width: 32px; height: 32px; }
    .player-name.one-line { font-size: 0.9rem; }
}
