/* ============================================================
   style.css — Bolão Copa 2026
   Design system completo: tokens, layout, componentes
   Mobile-first · Dark theme · Brasil-premium
   ============================================================ */

/* ============================================================
   1. TOKENS / CSS VARIABLES
   ============================================================ */
:root {
    /* Paleta Brasil Premium */
    --green-950:  #011a0c;
    --green-900:  #0a3d1f;
    --green-800:  #0f5c2e;
    --green-700:  #167a3c;
    --green-600:  #1e9b4e;
    --green-500:  #28c060;
    --green-400:  #4dd87f;
    --green-300:  #7ee8a0;
    --green-100:  #d4f7e0;

    --yellow-600: #c99a00;
    --yellow-500: #f5c518;
    --yellow-400: #ffd740;
    --yellow-300: #ffe57a;
    --yellow-100: #fff8d6;

    --blue-800:   #0b2d5e;
    --blue-600:   #1a56b0;
    --blue-400:   #4a9eff;
    --blue-200:   #a8d4ff;

    /* Superfícies escuras */
    --surface-0:  #080f0a;
    --surface-1:  #0e1a10;
    --surface-2:  #142018;
    --surface-3:  #1c2e20;
    --surface-4:  #253528;

    /* Texto */
    --text-primary:   #f0faf3;
    --text-secondary: #9abfa4;
    --text-muted:     #5c7a62;
    --text-inverse:   #0a3d1f;

    /* Semânticos */
    --color-success: var(--green-500);
    --color-warning: var(--yellow-500);
    --color-error:   #ef4444;
    --color-info:    var(--blue-400);

    /* Bordas */
    --border-color:       rgba(40, 192, 96, 0.12);
    --border-color-hover: rgba(40, 192, 96, 0.3);
    --border-radius-sm:   6px;
    --border-radius-md:   12px;
    --border-radius-lg:   18px;
    --border-radius-xl:   24px;
    --border-radius-full: 9999px;

    /* Sombras */
    --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
    --shadow-md:  0 4px 16px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
    --shadow-glow-green:  0 0 24px rgba(40, 192, 96, 0.25);
    --shadow-glow-yellow: 0 0 24px rgba(245, 197, 24, 0.3);

    /* Espaçamento */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Tipografia */
    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    /* Emoji font stack — garante bandeiras em Windows, Linux e macOS desktop */
    --font-emoji:   'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;

    /* Transições */
    --transition-fast:   150ms cubic-bezier(.4,0,.2,1);
    --transition-normal: 250ms cubic-bezier(.4,0,.2,1);
    --transition-slow:   400ms cubic-bezier(.4,0,.2,1);

    /* Layout */
    --container-max: 1200px;
    --header-height: 64px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body), var(--font-emoji);
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--surface-0);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 0%, rgba(14, 92, 46, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 90% 80%, rgba(26, 86, 176, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--green-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--green-300); }
a:focus-visible {
    outline: 2px solid var(--yellow-500);
    outline-offset: 2px;
    border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

button {
    cursor: pointer;
    font-family: var(--font-body);
    border: none;
    background: none;
}

/* ============================================================
   3. TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ============================================================
   4. LAYOUT UTILITÁRIOS
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}
@media (min-width: 768px) {
    .container { padding: 0 var(--space-6); }
}

.page-wrapper {
    position: relative;
    z-index: 1;
    padding-top: var(--space-8);
    padding-bottom: var(--space-16);
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }

@media (min-width: 600px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ============================================================
   5. HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 15, 10, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow var(--transition-normal);
}
.site-header.header--scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,.6);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    height: var(--header-height);
}
@media (min-width: 768px) {
    .header-inner { padding: 0 var(--space-6); }
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -.01em;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity var(--transition-fast);
}
.site-logo:hover { opacity: .85; color: var(--text-primary); }
.logo-text strong { color: var(--yellow-400); }
.logo-icon { display: flex; }

/* Nav */
.main-nav {
    display: none;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;
}
@media (min-width: 768px) {
    .main-nav { display: flex; }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(40, 192, 96, 0.08);
}
.nav-link.active {
    color: var(--green-400);
    background: rgba(40, 192, 96, 0.12);
}
.nav-link--admin .nav-icon circle { fill: transparent; }
.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: none;
}
@media (min-width: 1024px) { .nav-icon { display: block; } }

/* Mobile nav overlay */
@media (max-width: 767px) {
    .main-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface-1);
        padding: calc(var(--header-height) + var(--space-4)) var(--space-4) var(--space-6);
        gap: var(--space-2);
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
        z-index: 999;  /* acima de tudo: header(100), dropdown(200), flash(500) */
        box-shadow: 4px 0 24px rgba(0,0,0,.5);
    }
    .main-nav.nav--open {
        transform: translateX(0);
    }
    /* Overlay escuro por trás do menu */
    .main-nav.nav--open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.55);
        z-index: -1;
        pointer-events: none;
    }
    .nav-link {
        font-size: 1rem;
        padding: var(--space-4);
    }
    .nav-icon { display: block; }
}

/* Hamburger */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: var(--space-2);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
    position: relative;
    z-index: 1000; /* sempre acima do menu */
}
.nav-toggle:hover { background: rgba(40, 192, 96, 0.1); }
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}
.nav-toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--open span:nth-child(2) { opacity: 0; }
.nav-toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 768px) { .nav-toggle { display: none; } }

/* Header user section */
.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}
@media (min-width: 768px) {
    .header-user { margin-left: 0; }
}

.header-stats {
    display: none;
    align-items: center;
    gap: var(--space-3);
}
@media (min-width: 900px) { .header-stats { display: flex; } }

.hstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
.hstat-val {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--yellow-400);
}
.hstat-lbl {
    font-size: .65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    color: #fff;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(40, 192, 96, 0.3);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    flex-shrink: 0;
}
.user-avatar:hover {
    border-color: var(--green-400);
    box-shadow: var(--shadow-glow-green);
}

/* Dropdown */
.user-menu { position: relative; }

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: 220px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-8px) scale(.97);
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: 200;
    overflow: hidden;
}
.user-dropdown.dropdown--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-header {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropdown-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    color: var(--text-primary);
}
.dropdown-role {
    font-size: .75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    font-size: .875rem;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.dropdown-item:hover {
    background: rgba(40, 192, 96, 0.08);
    color: var(--text-primary);
}
.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .7;
}
.dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.header-guest {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

/* ============================================================
   6. COUNTDOWN BAR
   ============================================================ */
.countdown-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: rgba(245, 197, 24, 0.08);
    border-top: 1px solid rgba(245, 197, 24, 0.15);
    font-size: .825rem;
}

.countdown-label { color: var(--text-secondary); }

.countdown-timer {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .95rem;
    color: var(--yellow-400);
    letter-spacing: .05em;
    min-width: 80px;
    text-align: center;
}

.countdown-bar--urgent {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}
.countdown-bar--urgent .countdown-timer { color: #f87171; }

.countdown-bar--closed {
    background: rgba(92, 122, 98, 0.1);
    color: var(--text-muted);
    gap: var(--space-2);
}
.countdown-bar--closed svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ============================================================
   7. FLASH MESSAGES
   ============================================================ */
.flash-wrap {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-4);
    z-index: 500;
    max-width: 420px;
    width: calc(100% - var(--space-8));
    animation: slideInRight var(--transition-normal) both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.flash {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-4);
    border-radius: var(--border-radius-md);
    border: 1px solid;
    box-shadow: var(--shadow-md);
    font-size: .875rem;
    font-weight: 500;
}

.flash svg:first-child {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash span { flex: 1; }

.flash--success {
    background: rgba(40, 192, 96, 0.12);
    border-color: rgba(40, 192, 96, 0.3);
    color: var(--green-300);
}
.flash--error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}
.flash--warning {
    background: rgba(245, 197, 24, 0.1);
    border-color: rgba(245, 197, 24, 0.3);
    color: var(--yellow-300);
}
.flash--info {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.25);
    color: var(--blue-200);
}

.flash-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    opacity: .6;
    transition: opacity var(--transition-fast), background var(--transition-fast);
    flex-shrink: 0;
}
.flash-close:hover { opacity: 1; background: rgba(255,255,255,.1); }
.flash-close svg { width: 14px; height: 14px; }

/* ============================================================
   8. BOTÕES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px var(--space-5);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-display);
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition:
        background var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast),
        border-color var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible {
    outline: 2px solid var(--yellow-500);
    outline-offset: 2px;
}
.btn:disabled, .btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--green-600);
    color: #fff;
    border-color: var(--green-500);
}
.btn-primary:hover {
    background: var(--green-500);
    box-shadow: var(--shadow-glow-green);
    color: #fff;
}

.btn-secondary {
    background: var(--surface-3);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: var(--surface-4);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-ghost:hover {
    background: rgba(40, 192, 96, 0.08);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-warning {
    background: rgba(245, 197, 24, 0.15);
    color: var(--yellow-300);
    border-color: rgba(245, 197, 24, 0.25);
}
.btn-warning:hover {
    background: rgba(245, 197, 24, 0.25);
    box-shadow: var(--shadow-glow-yellow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px var(--space-3);
    font-size: .8rem;
}
.btn-lg {
    padding: 14px var(--space-8);
    font-size: 1rem;
}
.btn-block { width: 100%; }

/* ============================================================
   9. CARDS
   ============================================================ */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    gap: var(--space-3);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stat card */
.stat-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green-600), var(--green-400));
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-card--green .stat-value { color: var(--green-400); }
.stat-card--yellow .stat-value { color: var(--yellow-400); }
.stat-card--blue   .stat-value { color: var(--blue-400); }

/* ============================================================
   10. BADGES / PILLS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px var(--space-2);
    border-radius: var(--border-radius-full);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-green {
    background: rgba(40, 192, 96, 0.15);
    color: var(--green-300);
    border: 1px solid rgba(40, 192, 96, 0.25);
}
.badge-yellow {
    background: rgba(245, 197, 24, 0.12);
    color: var(--yellow-300);
    border: 1px solid rgba(245, 197, 24, 0.2);
}
.badge-red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-blue {
    background: rgba(74, 158, 255, 0.1);
    color: var(--blue-200);
    border: 1px solid rgba(74, 158, 255, 0.2);
}
.badge-gray {
    background: rgba(255,255,255,.06);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,.1);
}

/* ============================================================
   11. FORMULÁRIOS
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px var(--space-4);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: .9rem;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
    outline: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(40, 192, 96, 0.15);
    background: var(--surface-3);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input.input-error { border-color: var(--color-error); }
.form-input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-error {
    font-size: .8rem;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239abfa4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    padding-right: var(--space-8);
    cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 100px; }

/* ============================================================
   12. TABELAS
   ============================================================ */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    padding: var(--space-3) var(--space-4);
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tbody td {
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

tbody tr {
    transition: background var(--transition-fast);
}
tbody tr:hover {
    background: rgba(40, 192, 96, 0.04);
}

/* Row destaque para usuário logado */
tbody tr.row--me {
    background: rgba(40, 192, 96, 0.06);
    border-left: 3px solid var(--green-500);
}

/* ============================================================
   13. RANKING ESPECÍFICO
   ============================================================ */

/* Pódio */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-4);
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    max-width: 180px;
    animation: podiumReveal .5s both;
}

.podium-item:nth-child(1) { animation-delay: .1s; }
.podium-item:nth-child(2) { animation-delay: 0s; }
.podium-item:nth-child(3) { animation-delay: .2s; }

@keyframes podiumReveal {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.podium-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-inverse);
    position: relative;
    flex-shrink: 0;
}

/* 1º lugar — maior */
.podium-item--1 .podium-avatar {
    width: 76px;
    height: 76px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #d4a017, #f5c518, #ffe57a);
    box-shadow: 0 4px 24px rgba(245, 197, 24, 0.45);
}
.podium-item--2 .podium-avatar {
    background: linear-gradient(135deg, #8a9ba8, #b0bec5, #cfd8dc);
    box-shadow: 0 4px 16px rgba(176, 190, 197, 0.3);
}
.podium-item--3 .podium-avatar {
    background: linear-gradient(135deg, #8b5e3c, #bf8060, #d4a47a);
    box-shadow: 0 4px 16px rgba(191, 128, 96, 0.3);
}

.podium-medal {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 800;
    border: 2px solid var(--surface-0);
}
.podium-item--1 .podium-medal { background: #f5c518; color: #7a5c00; }
.podium-item--2 .podium-medal { background: #b0bec5; color: #37474f; }
.podium-item--3 .podium-medal { background: #bf8060; color: #4e2c18; }

.podium-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-primary);
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-points {
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.podium-item--1 .podium-points { color: var(--yellow-400); font-size: .95rem; }

.podium-base {
    width: 100%;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
}
.podium-item--1 .podium-base {
    height: 70px;
    background: linear-gradient(to top, rgba(245,197,24,.15), rgba(245,197,24,.06));
    border: 1px solid rgba(245,197,24,.2);
    color: var(--yellow-400);
    font-size: 1.6rem;
}
.podium-item--2 .podium-base {
    height: 50px;
    background: linear-gradient(to top, rgba(176,190,197,.1), rgba(176,190,197,.04));
    border: 1px solid rgba(176,190,197,.15);
    color: #b0bec5;
    font-size: 1.3rem;
}
.podium-item--3 .podium-base {
    height: 36px;
    background: linear-gradient(to top, rgba(191,128,96,.1), rgba(191,128,96,.04));
    border: 1px solid rgba(191,128,96,.15);
    color: #bf8060;
}

/* Ranking list */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}
.ranking-row:hover { background: rgba(40, 192, 96, 0.05); }
.ranking-row--me {
    background: rgba(40, 192, 96, 0.08);
    border: 1px solid rgba(40, 192, 96, 0.2);
    border-radius: var(--border-radius-sm);
}

.ranking-pos {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-muted);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.ranking-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-full);
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ranking-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: .875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-name .badge-me {
    display: inline-flex;
    margin-left: var(--space-2);
    padding: 1px var(--space-2);
    background: rgba(40, 192, 96, 0.15);
    color: var(--green-400);
    border-radius: var(--border-radius-full);
    font-size: .65rem;
    font-weight: 700;
}

.ranking-pts {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 48px;
    text-align: right;
}

.ranking-acertos {
    font-size: .78rem;
    color: var(--text-muted);
    min-width: 56px;
    text-align: right;
    display: none;
}
@media (min-width: 480px) { .ranking-acertos { display: block; } }

/* ============================================================
   14. PARTIDA CARD
   ============================================================ */
.match-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}
.match-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.match-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--text-muted);
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

.match-team-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-team-flag {
    font-size: 1.4rem;
    line-height: 1;
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-emoji);
}

.match-vs {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
}

.match-score {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: .05em;
}

/* Palpite selector */
.prediction-options {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.prediction-btn {
    flex: 1;
    padding: var(--space-2) var(--space-1);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
    touch-action: manipulation;
}
.prediction-btn:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    background: var(--surface-3);
}
.prediction-btn.selected {
    background: rgba(40, 192, 96, 0.15);
    border-color: var(--green-500);
    color: var(--green-300);
    box-shadow: 0 0 10px rgba(40, 192, 96, 0.15);
}
.prediction-btn.correct {
    background: rgba(40, 192, 96, 0.2);
    border-color: var(--green-400);
    color: var(--green-300);
}
.prediction-btn.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ============================================================
   15. SEÇÃO PAGE HEADER
   ============================================================ */
.page-header {
    padding: var(--space-8) 0 var(--space-6);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-8);
}

.page-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.page-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-display);
    line-height: 1.1;
}

.page-subtitle {
    font-size: .9rem;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

/* ============================================================
   16. SECTION DIVIDER
   ============================================================ */
.section-title {
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ============================================================
   17. EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    opacity: .4;
}
.empty-state h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}
.empty-state p { font-size: .875rem; }

/* ============================================================
   18. PAYMENT STATUS BANNER
   ============================================================ */
.payment-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(245, 197, 24, 0.25);
    background: rgba(245, 197, 24, 0.07);
    margin-bottom: var(--space-6);
}
.payment-banner svg {
    width: 24px;
    height: 24px;
    color: var(--yellow-400);
    flex-shrink: 0;
}
.payment-banner-text strong {
    display: block;
    font-family: var(--font-display);
    font-size: .95rem;
    color: var(--yellow-300);
}
.payment-banner-text span {
    font-size: .8rem;
    color: var(--text-muted);
}

/* ============================================================
   19. FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    padding: var(--space-8) 0;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}
@media (min-width: 768px) {
    .footer-inner { padding: 0 var(--space-6); }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-secondary);
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.footer-nav a {
    font-size: .8rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}
.footer-nav a:hover { color: var(--text-secondary); }

.footer-copy {
    font-size: .75rem;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
}
@media (min-width: 768px) {
    .footer-copy { width: auto; text-align: right; }
}

/* ============================================================
   20. LOADING / SPINNER
   ============================================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(40, 192, 96, 0.2);
    border-top-color: var(--green-500);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   21. PROGRESS BAR
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface-3);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-700), var(--green-500));
    border-radius: var(--border-radius-full);
    transition: width var(--transition-slow);
}

/* ============================================================
   22. PIX CARD
   ============================================================ */
.pix-card {
    background: var(--surface-1);
    border: 1px solid rgba(40, 192, 96, 0.2);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
}
.pix-qr {
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: var(--border-radius-md);
    margin: 0 auto var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: #333;
    padding: var(--space-3);
}
.pix-copy {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--space-3) var(--space-4);
    font-family: monospace;
    font-size: .8rem;
    color: var(--text-secondary);
    word-break: break-all;
    text-align: left;
    margin-bottom: var(--space-4);
}

/* ============================================================
   23. UTILIDADES EXTRAS
   ============================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.mt-4          { margin-top: var(--space-4); }
.mt-6          { margin-top: var(--space-6); }
.mt-8          { margin-top: var(--space-8); }
.mb-4          { margin-bottom: var(--space-4); }
.mb-6          { margin-bottom: var(--space-6); }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.font-bold     { font-weight: 700; }
.font-display  { font-family: var(--font-display); }
.w-full        { width: 100%; }
.hidden        { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    border: 0;
}

/* ============================================================
   24. ANIMAÇÕES DE ENTRADA
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp var(--transition-normal) both;
}
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }

/* ============================================================
   25. RESPONSIVIDADE GERAL
   ============================================================ */
@media (max-width: 480px) {
    .page-header-inner { flex-direction: column; }
    .podium { gap: var(--space-2); }
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
    .footer-nav { justify-content: center; }
}

/* ============================================================
   26. EMOJI RENDERING UNIVERSAL
   Garante bandeiras em Windows, Linux e macOS desktop
   ============================================================ */
.flag-emoji,
.match-team-flag,
.nmc-flag,
.ko-flag,
.rc-team > span:first-child,
.nmc-team > span:first-child,
.gm-team > span:first-child,
.team-cell > span.flag,
.podium-item span[style*="font-size:1"],
span[style*="font-size:1.1rem"],
span[style*="font-size:1.3rem"],
span[style*="font-size:1.4rem"] {
    font-family: var(--font-emoji) !important;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   27. FOTO DE PERFIL
   ============================================================ */
.avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Card de foto no dashboard */
.photo-prompt-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    background: var(--surface-1);
    border: 1px dashed rgba(40,192,96,.35);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    transition: border-color var(--transition-fast), background var(--transition-fast);
    cursor: pointer;
    flex-wrap: wrap;
}
.photo-prompt-card:hover {
    border-color: rgba(40,192,96,.6);
    background: rgba(40,192,96,.04);
}

.photo-prompt-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    border: 2px dashed rgba(40,192,96,.5);
}
.photo-prompt-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.photo-prompt-avatar .photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: 50%;
}
.photo-prompt-card:hover .photo-overlay { opacity: 1; }
.photo-overlay svg { width: 22px; height: 22px; color: #fff; }

.photo-prompt-text { flex: 1; min-width: 160px; }
.photo-prompt-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.photo-prompt-sub { font-size: .8rem; color: var(--text-muted); }

/* Modal de upload */
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(0,0,0,.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.photo-modal.modal--open {
    opacity: 1;
    pointer-events: auto;
}
.photo-modal-box {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(.97);
    transition: transform var(--transition-normal);
    text-align: center;
}
.photo-modal.modal--open .photo-modal-box {
    transform: translateY(0) scale(1);
}
.photo-modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}
.photo-modal-sub {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}
.photo-preview-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--surface-3);
    margin: 0 auto var(--space-5);
    overflow: hidden;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-muted);
}
.photo-preview-wrap img {
    width: 100%; height: 100%; object-fit: cover;
}
.photo-file-input { display: none; }
.photo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    font-size: .875rem;
    color: var(--text-muted);
}
.photo-upload-area:hover {
    border-color: var(--green-500);
    background: rgba(40,192,96,.05);
    color: var(--green-400);
}
.photo-modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-4);
}

