@import url('https://fonts.googleapis.com/css2?family=Changa+One&family=Merriweather:wght@300;400;700&family=Pacifico&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --background-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(15, 23, 42, 0.8);
    --input-bg: rgba(15, 23, 42, 0.6);
    --btn-secondary-bg: transparent;
    --detail-row-bg: rgba(0, 0, 0, 0.2);
    --detail-divider: rgba(255, 255, 255, 0.05);
    --success-bg-subtle: rgba(16, 185, 129, 0.05);
    --warning-bg-subtle: rgba(245, 158, 11, 0.05);
}

[data-theme="light"] {
    --background: #f8fafc;
    --background-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --surface: rgba(255, 255, 255, 1);
    --surface-border: rgba(0, 0, 0, 0.08);
    /* Um pouco mais sutil mas visível */
    --surface-hover: rgba(0, 0, 0, 0.04);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
    --btn-secondary-bg: #f1f5f9;
    --detail-row-bg: #f1f5f9;
    --detail-divider: rgba(0, 0, 0, 0.08);
    --success-bg-subtle: #ecfdf5;
    --warning-bg-subtle: #fffbeb;
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

.centered-box {
    max-width: 450px;
    margin: 5rem auto;
}

.title {
    font-family: 'Changa One', cursive;
    font-size: 2.5rem;
    font-weight: 400;
    /* Changa One só tem um peso */
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1,
h2,
h3,
h4,
.logo-text,
.hero-title,
.logo-container span {
    font-family: 'Changa One', cursive;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control[type="file"] {
    padding: 0.5rem;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    box-shadow: none;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Toast Notifications */
.toast-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    background: var(--surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--surface-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
    font-weight: 600;
}

.toast-alert.fade-out {
    animation: slideOutRight 0.5s ease forwards !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
    position: relative;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 480px) {
    .logo-img {
        height: 32px;
    }

    .logo-text {
        font-size: 1.25rem;
    }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface-hover);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

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

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 2rem;
}

.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.user-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: var(--background);
}

.user-table td {
    padding: 1rem;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--surface-border);
    vertical-align: middle;
}

.user-table tr td:first-child {
    border-radius: 12px 0 0 12px;
}

.user-table tr td:last-child {
    border-radius: 0 12px 12px 0;
}

.user-table .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-table .avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--surface-border);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-user {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Prediction Module Styles */
.game-card {
    background: var(--surface-hover);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.game-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.team-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.team-left {
    text-align: right;
}

.team-right {
    text-align: left;
}

.score-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--input-bg);
    border: 2px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.score-divider {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
}

.predictions-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prediction-pill {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pill-label {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.pill-score {
    font-weight: 700;
    color: var(--primary-color);
}

/* Tab System */
.tab-container {
    margin-bottom: 2rem;
}

.tab-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tab-content {
    display: none;
}

#tab-user:checked~.tab-nav label[for="tab-user"],
#tab-game:checked~.tab-nav label[for="tab-game"],
#tab-champion:checked~.tab-nav label[for="tab-champion"],
#main-admin-resultados:checked~.tab-nav label[for="main-admin-resultados"],
#main-admin-previsoes:checked~.tab-nav label[for="main-admin-previsoes"],
#main-admin-usuarios:checked~.tab-nav label[for="main-admin-usuarios"],
#main-admin-credenciais:checked~.tab-nav label[for="main-admin-credenciais"],
#main-admin-criar-jogo:checked~.tab-nav label[for="main-admin-criar-jogo"],
#main-admin-chat-hist:checked~.tab-nav label[for="main-admin-chat-hist"],
#main-admin-relatorios:checked~.tab-nav label[for="main-admin-relatorios"],
#main-admin-config:checked~.tab-nav label[for="main-admin-config"],
#main-admin-logs:checked~.tab-nav label[for="main-admin-logs"],
#main-admin-api-logs:checked~.tab-nav label[for="main-admin-api-logs"] {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#tab-user:checked~#content-user,
#tab-game:checked~#content-game,
#tab-champion:checked~#content-champion,
#main-admin-resultados:checked~#content-main-resultados,
#main-admin-previsoes:checked~#content-main-previsoes,
#main-admin-usuarios:checked~#content-main-usuarios,
#main-admin-credenciais:checked~#content-main-credenciais,
#main-admin-criar-jogo:checked~#content-main-criar-jogo,
#main-admin-chat-hist:checked~#content-main-chat-hist,
#main-admin-relatorios:checked~#content-main-relatorios,
#main-admin-config:checked~#content-main-configuracoes,
#main-admin-logs:checked~#content-main-logs,
#main-admin-api-logs:checked~#content-main-api-logs {
    display: block;
}

.tab-input {
    display: none;
}

.flag-icon {
    width: 24px;
    height: auto;
    border-radius: 4px;
    vertical-align: middle;
    margin: 0 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* New prediction rules styles */
.deadline-info {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.5rem;
    font-weight: 500;
}

.time-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 1rem;
}

.time-br {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.9rem;
}

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

.actions-row {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
}

.score-input:disabled {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.2);
    border-color: transparent;
    cursor: not-allowed;
}

.venue-info {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-top: 5px;
    font-style: italic;
}

/* Tabs System */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--detail-row-bg);
    padding: 0.4rem;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--surface-border);
}

.tab-link {
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Sub-Tabs System (Inside Data Tab) */
.sub-tabs-nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem;
    border-radius: 10px;
    width: fit-content;
    border: 1px solid var(--surface-border);
}

.sub-tab-link {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.sub-tab-link.active {
    background: var(--surface-hover);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Tabs Optimization */
@media (max-width: 600px) {

    .tabs-nav,
    .sub-tabs-nav {
        display: flex !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 8px !important;
        padding: 6px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs-nav::-webkit-scrollbar,
    .sub-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-link,
    .sub-tab-link {
        flex: 0 0 auto !important;
        padding: 0.6rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

.sub-tab-content-hidden {
    display: none;
}

.sub-tab-content-active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.tab-content-active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Group Sections */
.group-section {
    margin-bottom: 3rem;
    background: var(--detail-row-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
}

.group-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 4px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Compact Game Card */
.game-card.compact {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    transition: all 0.3s ease;
}

.game-card.compact:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.game-card.compact.has-prediction {
    background: var(--success-bg-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.game-card.compact.has-prediction:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.6);
}

.game-card.compact {
    position: relative;
    padding-top: 1.5rem;
    /* give space for badge */
}

.saved-badge {
    position: absolute;
    top: 5px;
    right: 15px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.game-info-mini {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-tag {
    color: var(--primary-color);
}

.time-tag {
    color: var(--text-muted);
}

.score-row-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-compact {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.team-compact.left {
    justify-content: flex-end;
    text-align: right;
}

.team-compact.right {
    justify-content: flex-start;
    text-align: left;
}

.flag-mini {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

.inputs-compact {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.score-input-mini {
    width: 36px;
    height: 36px;
    text-align: center;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
}

.score-input-mini:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.score-input-mini:disabled {
    opacity: 0.7;
    background: var(--detail-row-bg);
    border-color: var(--surface-border);
}

/* Hide spin buttons on number inputs */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinners[type=number] {
    -moz-appearance: textfield;
}

.card-footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--surface-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.venue-mini {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-mini {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-edit {
    background: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.locked-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* General Utility Extracted from Index */
.hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.hero-text-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.main-title {
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-handwrite {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    position: absolute;
    bottom: -0.5rem;
    right: -0.2rem;

    white-space: nowrap;
    letter-spacing: 1px;
    z-index: 10;
}

.hero-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.auth-buttons .btn {
    max-width: 200px;
}

/* User Stats Grid in Index Profile Card */
.user-stats-title {
    width: 100%;
    margin-top: 1.5rem;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.user-stats-details-link {
    display: block;
    width: 100%;
    margin: -0.75rem 0 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    margin: 0.75rem 0 1.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    padding: 0.75rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    color: inherit;
    text-decoration: none;
}

.stat-item:hover,
.stat-item:focus-visible {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    text-shadow: none;
}

.stat-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-top: 4px;
}

/* World Cup Status Message */
.cup-status-msg {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Responsive Design */
@media screen and (max-width: 768px) {

    /* Layout */
    .container {
        padding: 0.75rem;
    }

    .centered-box {
        margin: 2rem auto;
    }

    .glass-panel {
        padding: 1.25rem;
    }

    /* Header */
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Tabs & Navigation */
    .tab-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem !important;
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 12px;
    }

    .tab-btn {
        width: 100% !important;
        font-size: 0.8rem !important;
        padding: 0.6rem 0.4rem !important;
        text-align: center;
        margin: 0 !important;
    }

    /* Pages & Games Grid */
    .title {
        font-size: 1.8rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    /* Tablets/Mobile Table Pattern (The "Card" Transformation) */
    .user-table {
        border-spacing: 0;
        display: block;
    }

    .user-table thead {
        display: none;
        /* Hide header columns on mobile */
    }

    .user-table tbody {
        display: block;
        width: 100%;
    }

    /* Tablets/Mobile Table Pattern (The "Card" Transformation) */
    .user-table:not(.ranking-table) {
        border-spacing: 0;
        display: block;
    }

    .user-table:not(.ranking-table) thead {
        display: none;
        /* Hide header columns on mobile */
    }

    .user-table:not(.ranking-table) tbody {
        display: block;
        width: 100%;
    }

    .user-table:not(.ranking-table) tr {
        display: block;
        margin-bottom: 2rem;
        background: var(--surface-hover);
        border: 1px solid var(--surface-border);
        border-radius: 20px;
        padding: 0.5rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .user-table:not(.ranking-table) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--surface-border);
        padding: 0.8rem 1rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        min-height: 50px;
        width: 100% !important;
    }

    .user-table:not(.ranking-table) td:last-child {
        border-bottom: none;
        padding-top: 1rem !important;
        justify-content: center;
    }

    .user-table:not(.ranking-table) td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.65rem;
        letter-spacing: 0.05em;
        margin-right: 1rem;
    }

    .user-table:not(.ranking-table) .user-info {
        justify-content: flex-end;
        width: auto;
    }

    /* Ranking Table SPECIFIC (Traditional Table Layout on Mobile) */
    .ranking-table {
        display: table !important;
        width: 100%;
        border-spacing: 0;
        table-layout: fixed;
        /* Important to prevent overflow */
        border-collapse: separate;
        /* Obrigatório para o espaçamento funcionar */
        border-spacing: 0 8px;
        /* 0 horizontal, 10px vertical */
    }

    .ranking-table thead {
        display: table-header-group !important;
    }

    .ranking-table tbody {
        display: table-header-group !important;
    }

    .ranking-table tr:not([id^="details-"]) {
        display: table-row !important;
        border: none !important;
        background: transparent !important;
    }

    .ranking-table td,
    .ranking-table th {
        display: table-cell !important;
        padding: 0.6rem 0.4rem !important;
        font-size: 0.8rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: auto !important;
        box-sizing: border-box !important;
        vertical-align: middle;
    }

    .ranking-table td::before {
        display: none !important;
    }

    .date-group-header {
        width: 100%;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--primary-color);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding-bottom: 0.4rem;
        margin: 1.5rem 0 0.8rem 0;
        border-bottom: 1px solid rgba(99, 102, 241, 0.2);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .date-group-header:first-child {
        margin-top: 0.5rem;
    }

    .ranking-table .user-info {
        gap: 4px;
    }

    .ranking-table .avatar-small {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
    }

    .ranking-table .points-display {
        font-size: 0.9rem !important;
        text-align: center;
    }

    .ranking-table .exatos-display {
        font-size: 0.6rem !important;
        display: block;
        text-align: center;
    }

    /* Column specifically for Rank and Toggle */
    .ranking-table th:first-child,
    .ranking-table td:first-child {
        width: 40px !important;
        text-align: center;
    }

    .ranking-table th:last-child,
    .ranking-table td:last-child {
        width: 40px !important;
        text-align: center;
    }

    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3) {
        width: 80px !important;
        text-align: right;
    }

    /* Specific adjustments */
    .rank-position {
        margin-right: 0;
        width: 25px !important;
        height: 25px !important;
        font-size: 0.8rem !important;
    }

    .badge {
        font-size: 0.7rem;
    }

    .predictions-summary {
        justify-content: flex-end;
    }
}

/* Status Animations */
.badge-pulse {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: translateX(-50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: translateX(-50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Fix for small dot pulse in ranking details */
.detail-card .badge-pulse {
    transform: none;
    animation: pulse-dot 1.5s infinite;
    display: inline-block;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* User Presence Header Component */
.user-header-presence {
    display: flex;
    align-items: center;
    position: relative;
    cursor: default;
    margin-right: 0.5rem;
    gap: 12px;
}

.user-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

.user-header-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}


.user-info-desktop {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    gap: 2px;
}

.user-name-small {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.user-score-small {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Admin Specific Utilities */
.score-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.score-form input {
    width: 50px !important;
    height: 40px !important;
    text-align: center;
    padding: 0.5rem !important;
}

.responsive-form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.responsive-form-row .form-group.flex-1 {
    flex: 1;
    min-width: 200px;
}

@media screen and (max-width: 768px) {
    .responsive-form-row .form-group.flex-1 {
        flex: 1 1 100%;
    }
}

/* Finaliza 768px */

/* Mobile Optimizations - 480px */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .glass-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .group-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .game-card.compact {
        padding: 0.75rem;
        padding-top: 1.75rem;
    }

    .score-row-compact {
        gap: 0.25rem;
    }

    .team-compact {
        font-size: 0.75rem;
        gap: 0.25rem;
    }


    .score-input-mini {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .title {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 3rem;
        gap: 0.75rem;
    }

    .hero-handwrite {
        font-size: 0.9rem;
        bottom: -0.3rem;
        right: -0.4rem;
    }

    .hero-logo {
        height: 60px;
    }
}

/* Dashboard & Stats Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.performance-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    padding: 1.25rem 1rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-val {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

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

.chart-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--surface-border);
    margin-bottom: 3rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .performance-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .performance-summary-grid .stat-card {
        padding: 0.65rem 0.25rem;
        border-radius: 14px;
    }

    .performance-summary-grid .stat-icon {
        font-size: 1.35rem;
        margin-bottom: 0.35rem;
    }

    .performance-summary-grid .stat-val {
        font-size: 1.25rem;
    }

    .performance-summary-grid .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0.4px;
        line-height: 1.25;
    }

    .stat-card {
        padding: 0.75rem 0.5rem;
    }

    .stat-val {
        font-size: 1.5rem;
    }

    .chart-section {
        padding: 1rem;
    }

    .chart-container {
        height: 250px;
    }
}


/* Mobile Navigation Refactor (Combo Style) */
.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .header {
        padding: 0.75rem 1.25rem;
    }
}

.mobile-combo-btn {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.mobile-combo-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.mobile-combo-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    font-family: 'Merriweather', serif;
}

.user-header-avatar.mini {
    width: 40px;
    height: 40px;
    border-width: 1px;
}

.chevron {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.mobile-combo-btn.active .chevron {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 1.25rem;
    width: 240px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    z-index: 2000;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-dropdown-menu.active {
    display: flex;
    transform: translateY(0);
}

.mobile-user-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

.mobile-user-info strong {
    font-size: 1rem;
    color: var(--text-main);
}

.mobile-user-info span {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.dropdown-item {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item:hover {
    background: var(--surface-hover);
    padding-left: 1.25rem;
}

.mobile-dropdown-menu hr {
    border: 0;
    border-top: 1px solid var(--surface-border);
    margin: 0.5rem 0;
}

/* Performance History Cards */
.performance-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.perf-game-card {
    background: var(--detail-row-bg);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease;
}

.perf-game-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.perf-game-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1rem;
}

.perf-vs {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.perf-scores-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    border-radius: 12px;
}

.perf-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.perf-score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

@media (max-width: 600px) {
    .performance-games-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .perf-game-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .perf-game-teams {
        font-size: 0.9rem;
    }

    .perf-scores-container {
        padding: 0.5rem;
    }

    .perf-score-label {
        font-size: 0.6rem;
    }

    .perf-game-card .badge {
        font-size: 0.75rem !important;
    }
}
