/* ─────────────────────────────────────────────────────────────
   Wild Poker Campeonatos — MOBILE FIRST
   Container fixo em ~480px. Sem media queries de desktop.
   ───────────────────────────────────────────────────────────── */

:root {
    --bg: #080c10;
    --surface: #0f1923;
    --surface2: #162030;
    --surface3: #1d2a3d;
    --border: rgba(255, 255, 255, .08);
    --green: #22c55e;
    --green-dim: #16a34a;
    --green-glow: rgba(34, 197, 94, .25);
    --gold: #f59e0b;
    --red: #ef4444;
    --blue: #3b82f6;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --radius: 14px;
    --font: 'Inter', system-ui, sans-serif;
    --font-brand: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at 50% 0%, rgba(34, 197, 94, .04), transparent 50%),
        var(--bg);
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Header ─────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 12, 16, .9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.app-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo img {
    height: 32px;
    width: auto;
    display: block;
}
.logo-sub {
    font-family: var(--font-brand);
    font-size: .72rem;
    font-weight: 600;
    color: var(--green);
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(34, 197, 94, .1);
    border: 1px solid rgba(34, 197, 94, .2);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.back-link {
    color: var(--muted);
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ─── Hero ─────────────────────────────────────── */
.hero {
    padding: 48px 0 56px;
    text-align: center;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(34, 197, 94, .12), transparent 70%);
}
.hero-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: var(--green);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    margin-bottom: 20px;
    border: 1px solid rgba(34, 197, 94, .2);
}
.hero h1 {
    font-family: var(--font-brand);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--green); }
.hero p {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 28px;
}
.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── Botões ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: transform .1s, box-shadow .15s, background .15s;
    width: 100%;
    text-align: center;
    color: var(--text);
    background: var(--surface);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary {
    background: var(--green);
    color: #052e16;
    box-shadow: 0 4px 16px var(--green-glow);
}
.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-danger {
    background: rgba(239, 68, 68, .1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, .2);
}
.btn-sm {
    min-height: 38px;
    font-size: .88rem;
    padding: 0 14px;
    width: auto;
}
.btn-row {
    display: flex;
    gap: 10px;
}
.btn-row .btn { flex: 1; }

/* ─── Seções ─────────────────────────────────────── */
section { padding: 36px 0; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}
.section-head h2 {
    font-family: var(--font-brand);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-head .link {
    color: var(--green);
    font-size: .88rem;
    font-weight: 500;
}

.live-pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--red);
    position: relative;
    flex-shrink: 0;
}
.live-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--red);
    opacity: .4;
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%   { transform: scale(.8); opacity: .6; }
    70%  { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(.8); opacity: 0; }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.stack-tight { gap: 8px; }

/* ─── Card de campeonato ─────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: block;
    transition: border-color .2s;
}
.card:active { border-color: rgba(34, 197, 94, .4); }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
}
.card-title {
    font-family: var(--font-brand);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.25;
}
.card-meta {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 4px;
}
.card-meta strong { color: var(--text); font-weight: 500; }

.badge {
    font-size: .68rem;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-live    { background: rgba(239, 68, 68, .12); color: var(--red); }
.badge-closed  { background: rgba(100, 116, 139, .15); color: var(--muted); }
.badge-waiting { background: rgba(59, 130, 246, .12); color: var(--blue); }
.badge-pending { background: rgba(245, 158, 11, .12); color: var(--gold); }
.badge-mine    { background: rgba(34, 197, 94, .12); color: var(--green); }

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.stat-label {
    font-size: .65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 3px;
}
.stat-value {
    font-family: var(--font-brand);
    font-size: .98rem;
    font-weight: 600;
}
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }

/* Faixa de prêmio total */
.prize-pool {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 10px;
    margin-bottom: 14px;
}
.prize-pool-label {
    font-size: .7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}
.prize-pool-value {
    font-family: var(--font-brand);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
}

/* Pódio */
.podium {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.podium li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface2);
    border-radius: 8px;
}
.podium-pos {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .88rem;
    min-width: 28px;
    text-align: center;
}
.pos-1 { color: var(--gold); }
.pos-2 { color: #cbd5e1; }
.pos-3 { color: #d4a373; }
.podium-name { font-size: .9rem; font-weight: 500; }
.podium-prize {
    font-family: var(--font-brand);
    font-size: .9rem;
    font-weight: 600;
    color: var(--green);
}

/* Estado vazio */
.empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
}
.empty strong { color: var(--text); display: block; margin-bottom: 6px; }

/* ─── Como funciona ─────────────────────────────────────── */
.how {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 22px;
    border: 1px solid var(--border);
}
.how h2 {
    font-family: var(--font-brand);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 22px;
}
.steps {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(34, 197, 94, .1);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(34, 197, 94, .2);
    flex-shrink: 0;
}
.step h3 {
    font-family: var(--font-brand);
    font-size: 1rem;
    margin-bottom: 4px;
    font-weight: 600;
}
.step p { font-size: .88rem; color: var(--muted); }

/* ─── Blog cards ─────────────────────────────────────── */
.blog-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0;
}
.blog-card-img {
    width: 92px;
    height: 92px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface2);
}
.blog-card-body {
    padding: 12px 14px 12px 0;
    flex: 1;
    min-width: 0;
}
.blog-card h3 {
    font-family: var(--font-brand);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card p {
    font-size: .78rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Footer ─────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    margin-top: 36px;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
}
footer a { color: var(--green); }

/* ─── FORMS ─────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.field label {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 500;
}
.field-help {
    font-size: .75rem;
    color: var(--muted);
    margin-top: -2px;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color .15s, background .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--green);
    background: var(--surface2);
}
.field textarea { min-height: 80px; resize: vertical; }
.field-prefix {
    position: relative;
}
.field-prefix span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: .92rem;
    pointer-events: none;
}
.field-prefix input { padding-left: 38px; }

.fieldset {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.fieldset h3 {
    font-family: var(--font-brand);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* radio cards (modelo de ajuste de blind) */
.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .radio-dot {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: border-color .15s;
}
.radio-card.selected {
    border-color: var(--green);
    background: var(--surface2);
}
.radio-card.selected .radio-dot {
    border-color: var(--green);
}
.radio-card.selected .radio-dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--green);
}
.radio-card-text {
    flex: 1;
}
.radio-card-text strong {
    display: block;
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.radio-card-text span {
    font-size: .78rem;
    color: var(--muted);
}

/* Lista editável (custos, premiação, jogadores) */
.list-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--surface2);
    border-radius: 10px;
    margin-bottom: 6px;
}
.list-row input {
    min-height: 38px;
    padding: 8px 10px;
    font-size: .9rem;
}
.list-row .list-remove {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--red);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.list-add {
    width: 100%;
    min-height: 42px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-size: .88rem;
    margin-top: 4px;
    transition: border-color .15s, color .15s;
}
.list-add:active { border-color: var(--green); color: var(--green); }

/* ─── Tabs ─────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    transition: all .15s;
}
.tab.active {
    background: var(--surface2);
    color: var(--text);
}

/* ─── Bottom sheet (modal de ações) ─────────────────────────────────────── */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 200;
    display: none;
    animation: fade .2s;
}
.sheet-backdrop.open { display: block; }
.sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    z-index: 201;
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
    display: none;
    animation: slideUp .25s;
}
.sheet.open { display: block; }
.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--surface3);
    border-radius: 2px;
    margin: -8px auto 14px;
}
.sheet h3 {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 600;
}
.sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sheet-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
}
.sheet-action.danger { color: var(--red); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

/* ─── Toast ─────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface3);
    color: var(--text);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: .9rem;
    z-index: 300;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    animation: toastIn .2s;
}
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ─── Página do campeonato (admin/público) ─────────────────────────────────────── */
.tournament-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.tournament-header h1 {
    font-family: var(--font-brand);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
}
.tournament-meta {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.tournament-meta div { margin-bottom: 2px; }

.live-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: var(--surface2);
    border-radius: 12px;
    margin-bottom: 14px;
}
.live-status .stat-label { color: var(--muted); }
.live-status .stat-value {
    font-size: 1.5rem;
    font-family: var(--font-brand);
    color: var(--green);
}
.live-status .stat-value.timer { color: var(--gold); }
.live-status .span-full {
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

/* Player rows */
.player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.player-row.eliminated {
    opacity: .55;
}
.player-row.eliminated .player-name { text-decoration: line-through; }
.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface3);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .92rem;
    flex-shrink: 0;
}
.player-info { flex: 1; min-width: 0; }
.player-name {
    font-size: .92rem;
    font-weight: 500;
}
.player-sub {
    font-size: .74rem;
    color: var(--muted);
    margin-top: 2px;
}
.player-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.player-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.player-pos {
    font-family: var(--font-brand);
    font-weight: 700;
    color: var(--muted);
    font-size: .9rem;
    min-width: 30px;
    text-align: center;
}

/* Tables */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}
.table-card.closed { opacity: .55; }
.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}
.table-title {
    font-family: var(--font-brand);
    font-size: 1rem;
    font-weight: 600;
}
.table-count {
    font-size: .78rem;
    color: var(--muted);
}
.table-players {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.table-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface2);
    border-radius: 8px;
    font-size: .88rem;
}
.table-player .table-player-name { flex: 1; }
.table-empty {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: .82rem;
    font-style: italic;
}

/* Termos checkbox */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}
.checkbox-row input { margin-top: 3px; flex-shrink: 0; transform: scale(1.2); accent-color: var(--green); }
.checkbox-row span { font-size: .85rem; color: var(--muted); line-height: 1.4; }

/* Página de inscrição */
.invite-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.invite-card h1 {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.invite-card .invite-meta {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: .9rem;
}
.invite-success {
    text-align: center;
    padding: 40px 20px;
}
.invite-success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Notice / alert */
.notice {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.notice-info { background: rgba(59, 130, 246, .08); border-color: rgba(59, 130, 246, .25); color: #93c5fd; }
.notice-warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .25); color: var(--gold); }
.notice-error { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .25); color: var(--red); }
