/* Estilos do módulo de torneios. Usa as variáveis de cor de app.css (--bg, --surface, --brand...). */

/* Lista */
.tt-sec { font-size: 18px; margin: 26px 0 12px; display: flex; align-items: baseline; gap: 8px; }
.tt-list { align-items: stretch; }
.tt-card { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none !important; transition: transform .12s, box-shadow .12s; }
.tt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tt-card h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.tt-card .pill.ok:last-child { align-self: flex-start; }
.tt-fmt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tt-fmt .ico, .tt-meta .ico { width: 15px; height: 15px; }
.tt-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); margin-top: auto; }
.tt-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tt-invites { margin-bottom: 16px; border-left: 4px solid var(--brand); }
.tt-inv-row { padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }
.tt-inv-row:first-of-type { border-top: 0; }
.tt-code summary { cursor: pointer; }
.tt-code { margin-bottom: 4px; }

/* Formulário */
.tt-form .card { padding: 20px; }
.tt-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.tt-opt { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.tt-opt span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tt-opt.on { border-color: var(--brand-2); background: var(--warn-bg); }
.tt-opt:disabled { cursor: default; opacity: .55; }
.tt-opt.on:disabled { opacity: 1; }
.tt-tbs { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-width: 460px; }
.tt-tb { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.tt-tb:not(.on) { opacity: .7; }
.tt-tb .btn.sm { padding: 2px 9px; }
.tt-access, .tt-classes { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tt-classes { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }

/* Torneio */
.tt-page .page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.tt-page .page-head h1 .pill { font-size: 12px; }
.tt-page .page-head .row { flex-wrap: wrap; }
.tt-desc { margin-bottom: 16px; line-height: 1.5; }
.tt-clock { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tt-clock b { font-family: var(--font-display); font-size: 40px; font-variant-numeric: tabular-nums; line-height: 1; }
.tt-queue { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.tt-spin { width: 16px !important; height: 16px !important; border-width: 2px !important; flex: none; }
.tt-admin { margin-bottom: 18px; border-left: 4px solid var(--accent); }
.tt-admin .row { flex-wrap: wrap; }
.tt-enroll { margin-top: 12px; }
.tt-invite { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.tt-codebox { font-size: 24px; padding: 4px 14px; letter-spacing: .12em; }
.tt-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px; }
.tt-rounds { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tt-pairs td.c, .tt-pairs th.c, .tt-stand td.c, .tt-stand th.c { text-align: center; }
.tt-pairs td.r, .tt-page td.r { text-align: right; white-space: nowrap; }
.tt-pairs td:first-child { width: 48px; font-weight: 700; color: var(--muted); }
.tt-result { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-res { width: auto; min-width: 150px; padding: 6px 8px; font-size: 13px; }
.tt-res.empty { border-color: var(--brand-2); }
.tt-name.me { font-weight: 800; }
tr.tt-mine td { background: var(--warn-bg); }
tr.tt-out td { opacity: .6; }
.tt-stand td:nth-child(2) { font-weight: 600; }
.tt-fire { font-size: 15px; }
.tt-sheet { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tt-sheet span { display: inline-block; min-width: 18px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 3px; border-radius: 5px; margin-right: 2px; }
.tt-sheet .w { color: var(--ok); }
.tt-sheet .d { color: var(--text-2); }
.tt-sheet .l { color: var(--bad); }
.tt-sheet .f { background: var(--warn-bg); color: var(--warn); }

@media (max-width: 980px) { .tt-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .tt-opts { grid-template-columns: minmax(0, 1fr); }
  .tt-clock b { font-size: 32px; }
  .tt-res { min-width: 120px; }
}

/* Página de impressão */
.tt-print { max-width: 960px; margin: 0 auto; padding: 24px 16px 40px; background: var(--bg); color: var(--text); min-height: 100vh; }
.tt-print-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.tt-print header h1 { margin: 0 0 4px; font-size: 26px; }
.tt-print header p { margin: 0 0 18px; color: var(--text-2); }
.tt-print h2 { font-size: 17px; margin: 22px 0 8px; }
.tt-print .tbl { width: 100%; border-collapse: collapse; }
.tt-print .tbl th, .tt-print .tbl td { padding: 6px 8px; border: 1px solid var(--line); }
.tt-print .c { text-align: center; }
.tt-print .tt-blank { min-width: 90px; }
.tt-print footer { margin-top: 24px; }
.tt-print .tbl-wrap { margin: 0; padding: 0; overflow: visible; }

@media print {
  .no-print, .side, .topbar, .toasts { display: none !important; }
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-2: #222; --muted: #444; --line: #999; }
  body, .tt-print { background: #fff !important; color: #000 !important; }
  .tt-print { padding: 0; max-width: none; min-height: 0; }
  .tt-print .tbl th { color: #000; font-size: 11px; }
  .tt-print .tbl td { font-size: 12px; }
  .tt-print-pairs { break-after: page; }
  .tt-print tr { break-inside: avoid; }
  tr.tt-mine td { background: none; }
}
