@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #07140f;
  --bg2: #0c1f17;
  --card: #10281e;
  --card2: #143226;
  --line: #1f4434;
  --text: #eaf3ee;
  --muted: #8fb2a1;
  --gold: #f0c95e;
  --gold2: #c99a2e;
  --green: #2fa36b;
  --red: #e0605a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Space Grotesk', system-ui, sans-serif; }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -200px, #12392a 0%, var(--bg) 70%); }
a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: rgba(7, 20, 15, .7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { font-family: 'Anton', sans-serif; letter-spacing: .06em; font-size: 20px; color: var(--gold); text-decoration: none; }
.brand span { color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .logo { height: 34px; width: auto; }
.top .sp { flex: 1; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.link:hover { color: var(--text); background: var(--card); }

/* elementos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.btn { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #2f6a51; }
.btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #1d1503; border-color: transparent; }
.btn.red { background: transparent; border-color: #6b2c29; color: #ff9a94; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], select {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; outline: none;
}
input:focus, select:focus { border-color: var(--gold2); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 18px; }
.sec-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.sec-title p { margin: 0; color: var(--muted); font-size: 14px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: #183d2d; color: #8ff0bd; font-weight: 600; }
.pill.off { background: #3a1e1d; color: #ffaaa4; }
.pill.wait { background: #3b3216; color: var(--gold); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1a3a2c; border: 1px solid #2f6a51; padding: 10px 16px; border-radius: 12px; z-index: 50; box-shadow: 0 10px 30px #0008; }
.toast.err { background: #3a1e1d; border-color: #6b2c29; }

/* login */
.login { max-width: 360px; margin: 12vh auto; }
.login .brand { font-size: 34px; display: flex; flex-direction: column; text-align: center; margin-bottom: 18px; }
.login .brand .logo { height: 110px; margin-bottom: 6px; }

/* lista de torneios */
.tlist { display: grid; gap: 10px; }
.titem { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.titem:hover { border-color: #2f6a51; }
.titem .nm { font-weight: 700; }

/* cabeçalho do torneio */
.thead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.thead .nm { font-size: 22px; font-weight: 700; }
.kpis { display: flex; gap: 22px; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-size: 20px; font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 11px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.tab .badge { background: var(--gold); color: #1d1503; border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* cronômetro (admin e TV usam a mesma base) */
.clock { text-align: center; padding: 22px 16px; }
.clock .lvl { font-size: 15px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.clock .time { font-family: 'Anton', sans-serif; font-size: clamp(80px, 16vw, 190px); line-height: 1; color: var(--text); letter-spacing: .02em; margin: 6px 0 4px; }
.clock .time.warn { color: var(--gold); }
.clock .time.paused { opacity: .55; }
.clock .blinds { font-family: 'Anton', sans-serif; font-size: clamp(40px, 7vw, 84px); color: var(--gold); line-height: 1.05; }
.clock .ante { font-size: 18px; color: var(--muted); margin-top: 4px; }
.clock .nextb { margin-top: 12px; color: var(--muted); font-size: 16px; }
.clock .nextb b { color: var(--text); }
.bar { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 16px auto 0; max-width: 640px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); width: 0; }
.ctrls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.ctrls .btn { min-width: 52px; }
.ctrls .play { min-width: 130px; font-size: 17px; }
.cgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 700; }
.nlist { display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.nitem { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--bg2); cursor: pointer; border: 1px solid transparent; }
.nitem:hover { border-color: var(--line); }
.nitem.cur { border-color: var(--gold2); background: #1d2a14; }
.nitem.done { opacity: .4; }
.nitem .b { font-weight: 700; flex: 1; }
.nitem .n { font-size: 12px; color: var(--muted); }
.nitem .e { font-size: 13px; color: var(--muted); }
.nitem.brk .b { color: #8ff0bd; }

/* jogadores */
.addp { display: flex; gap: 8px; margin-bottom: 14px; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pcard { padding: 12px; }
.pcard.out { opacity: .55; }
.phead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #1f4434; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--gold); flex: none; }
.phead .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.cnt .st { display: flex; align-items: center; gap: 6px; }
.cnt .st button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; }
.cnt .st b { min-width: 18px; text-align: center; }
.paid { font-size: 12px; color: var(--muted); margin-top: 8px; }
.paid b { color: #8ff0bd; }
.pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pfoot .tot { font-weight: 700; }

/* config */
.cfg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.lvtable { width: 100%; border-collapse: collapse; }
.lvtable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 6px; }
.lvtable td { padding: 4px 6px; }
.lvtable td.i { color: var(--muted); width: 54px; font-size: 13px; }
.lvtable tr.brk td { background: #0f2a1f; }
.lvtable tr.brk td:first-child { border-radius: 8px 0 0 8px; }
.lvtable tr.brk td:last-child { border-radius: 0 8px 8px 0; }
.lvtable input { padding: 6px 8px; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 2px 6px; }
.x:hover { color: var(--red); }

/* premiação */
.prz { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prow .pos { width: 34px; font-weight: 700; color: var(--gold); }
.prow input { width: 90px; }
.prow .val { flex: 1; text-align: right; font-weight: 600; }
.sumline { margin-top: 10px; font-weight: 600; }
.sumline.bad { color: var(--red); }

/* pix (admin) */
.pxtable { width: 100%; border-collapse: collapse; }
.pxtable td, .pxtable th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.pxtable th { font-size: 12px; color: var(--muted); font-weight: 500; }

@media (max-width: 860px) {
  .cgrid, .prz { grid-template-columns: 1fr; }
  .cfg { grid-template-columns: 1fr 1fr; }
  .stats4 { grid-template-columns: 1fr 1fr; }
  .kpis { gap: 14px; }
}
