/* SEBT — identidade do logo: preto, branco e verde-limão, tema escuro. */
:root {
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --surface-2: #141414;
  --line: #2A2A2A;
  --line-soft: #222222;
  --text: #FFFFFF;
  --muted: #A3A3A3;
  --lime: #D4E157;
  --lime-soft: #262A10;
  --lime-text: #E6F08A;
  --danger: #E5484D;
  --danger-text: #FF8A8E;
  --radius: 18px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.4; }
a { color: var(--lime); }
a:hover { color: var(--lime-text); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* Cabeçalho */
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; padding-top: max(16px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.topbar__logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.topbar__text { display: flex; flex-direction: column; min-width: 0; }
.topbar__title { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 24px; line-height: 1; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__sub { font-size: 13px; color: var(--muted); }

/* Conteúdo */
.content { flex: 1; padding: 18px 20px 120px; display: flex; flex-direction: column; gap: 16px; }
.content--bare { padding-bottom: 32px; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.section-title { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 20px; text-transform: uppercase; margin-top: 4px; }
.display { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lime { color: var(--lime); }
.danger { color: var(--danger-text); }

/* Cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card--accent { border: 2px solid var(--lime); }
.card--link { text-decoration: none; color: var(--text); }
.card--link:hover { color: var(--text); border-color: #3a3a3a; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 20px; font-weight: 700; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 16px; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; min-height: 56px; }
.list__item:last-child { border-bottom: none; }
a.list__item:hover { color: var(--text); }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; overflow-wrap: anywhere; }

/* Selos */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge--lime { background: var(--lime); color: #0A0A0A; }
.badge--outline { border: 1px solid #3a3a3a; color: var(--muted); }
.badge--danger { border: 1px solid var(--danger); color: var(--danger-text); }
.badge--soft { background: var(--lime-soft); color: var(--lime-text); }

.avatar { width: 44px; height: 44px; border-radius: 99px; background: #262626; color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar--lg { width: 72px; height: 72px; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 30px; background: var(--lime); color: #0A0A0A; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-family: var(--body); font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%; }
.btn--primary { background: var(--lime); color: #0A0A0A; }
.btn--primary:hover { background: #DDE873; color: #0A0A0A; }
.btn--outline { background: none; border-color: var(--lime); color: var(--lime); }
.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); font-weight: 600; }
.btn--ghost:hover { color: var(--text); }
.btn--danger { background: none; border-color: var(--danger); color: var(--danger-text); }
.btn--small { min-height: 40px; font-size: 14px; padding: 0 14px; width: auto; border-radius: 10px; }
.btn--link { background: none; border: none; color: var(--muted); font-weight: 500; min-height: 44px; width: auto; padding: 0; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger-text); }
.input, select.input, textarea.input { height: 52px; border-radius: 14px; border: 1px solid #333333; background: var(--surface); color: var(--text); font-family: var(--body); font-size: 17px; padding: 0 16px; width: 100%; }
textarea.input { height: auto; min-height: 96px; padding: 12px 16px; }
.input--error { border-color: var(--danger); }
.input--code { height: 64px; font-size: 30px; letter-spacing: 10px; text-align: center; font-weight: 600; border-color: var(--lime); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--lime); flex-shrink: 0; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { min-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; cursor: pointer; }
.segmented input:checked + label { background: var(--lime); color: #0A0A0A; border-color: var(--lime); }
.segmented input:focus-visible + label { outline: 3px solid var(--lime); outline-offset: 2px; }
fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-size: 14px; color: var(--muted); font-weight: 500; padding: 0; margin-bottom: 6px; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
details.card > summary::after { content: '+'; color: var(--lime); font-size: 22px; }
details.card[open] > summary::after { content: '–'; }

/* Avisos */
.notice { border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.notice--ok { background: var(--lime-soft); color: var(--lime-text); }
.notice--error { background: #2A1213; color: var(--danger-text); border: 1px solid #5a1d20; }
.notice--info { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }

/* Login */
.login { display: flex; flex-direction: column; gap: 26px; }
.login__logo { display: flex; justify-content: center; }
.login__logo img { width: 190px; height: 180px; object-fit: cover; border-radius: 24px; }
.login__head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.login__title { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 34px; }

/* Barra de abas */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); background: #0F0F0F; padding: 6px 6px max(14px, env(safe-area-inset-bottom)); z-index: 10; }
.tab { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--lime); }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Filtros */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex-shrink: 0; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--lime); border-color: var(--lime); color: #0A0A0A; }

.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.hidden { display: none !important; }

@media (min-width: 600px) {
  .app { border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
}

/* Convite para instalar na tela inicial */
.install { display: grid; grid-template-columns: 44px 1fr; gap: 10px 12px; align-items: center; background: var(--surface); border: 1px solid var(--lime); border-radius: var(--radius); padding: 14px; }
.install img { border-radius: 10px; }
.install__text { display: flex; flex-direction: column; gap: 2px; }
.install__actions { grid-column: 1 / -1; display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.install__share { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: var(--lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Seletor de dias da semana */
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.weekdays label { min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; }
.weekdays input:checked + label { background: var(--lime); color: #0A0A0A; border-color: var(--lime); }
.weekdays input:focus-visible + label { outline: 3px solid var(--lime); outline-offset: 2px; }

/* Quadras */
.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.match__team--right { text-align: right; }
.score-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* Escolha da dupla vencedora */
.hidden-radio { position: absolute; opacity: 0; pointer-events: none; }
.pick { min-height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; font-weight: 700; cursor: pointer; text-align: center; padding: 8px 12px; }
.hidden-radio:checked + .pick { background: var(--lime); color: #0A0A0A; border-color: var(--lime); }
.hidden-radio:focus-visible + .pick { outline: 3px solid var(--lime); outline-offset: 2px; }

/* Campo invisível contra robôs no autocadastro */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Mensalidade */
.pix { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #0F0F0F; border: 1px dashed #333; border-radius: 14px; padding: 12px 14px; }
.pix__key { overflow-wrap: anywhere; }
.input--file { height: auto; padding: 12px 14px; font-size: 15px; }

/* Nomes de mês com só a primeira letra maiúscula ("Outubro de 2026") */
.cap { display: inline-block; }
.cap::first-letter { text-transform: uppercase; }
/* Navegação entre meses */
.monthnav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.monthnav > * { white-space: nowrap; }
.monthnav > strong { text-align: center; }
.kv > span:last-child { white-space: nowrap; }

/* Ranking */
.seglink { min-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; text-decoration: none; }
.seglink:hover { color: var(--text); }
.seglink.is-active { background: var(--lime); color: #0A0A0A; border-color: var(--lime); }
.rank { list-style: none; margin: 0; }
.rank .is-me .list__title { color: var(--lime-text); }
.rank__pos { flex-shrink: 0; width: 32px; height: 32px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; border: 1px solid var(--line); color: var(--muted); }
.rank__pos--top { background: var(--lime); border-color: var(--lime); color: #0A0A0A; }
.rank__rate { font-size: 18px; white-space: nowrap; }
.rankme { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rankme > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rankme .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rankme .stat__value { font-size: 18px; white-space: nowrap; }

/* Frequência */
.freq__n { flex-shrink: 0; width: 34px; text-align: center; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.freq__n--cur { color: var(--text); font-weight: 800; }
.freq__head { min-height: 0; padding: 8px 0; }
.freq__head .freq__n { font-weight: 600; font-size: 12px; }
.freq__badge { width: 52px; flex-shrink: 0; }
.freq__head::after { content: ""; width: 52px; flex-shrink: 0; }

/* Organizar a fila */
.qmove { display: flex; gap: 6px; flex-shrink: 0; }
.qmove .btn--small { min-width: 44px; padding: 0 10px; }

/* Lista do dia */
.signups { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.signups li { padding-left: 2px; }

/* Foto do jogador */
.avatar--photo { object-fit: cover; padding: 0; background: #262626; }
.avatar--lg.avatar--photo { width: 72px; height: 72px; }
.avatar--sm { width: 34px; height: 34px; font-size: 14px; }

/* Botão só com ícone (lixeira do caixa) */
.iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.iconbtn:hover, .iconbtn:focus-visible { color: var(--danger-text); border-color: var(--danger); }
