/* Tournaments. The setup and overlay rules mirror the games' own (see
   builder/style.css), repeated rather than shared, as games share
   shared.css and nothing else. */

.screen{
  max-width:520px;margin:0 auto;
  padding:10px 10px calc(10px + var(--pad));
  display:flex;flex-direction:column;gap:8px;min-height:100%;
}
html{scrollbar-gutter:stable}

.brand{text-align:center;padding:8px 0 2px}
.brand h1{font-size:30px}
.brand p{color:var(--dim);font-size:13px;margin-top:2px}
.brand.compact{padding:0}
.brand.compact.gamebar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px}
.brand.compact.gamebar .backlink{justify-self:start;padding:2px}
.brand.compact.gamebar h1{
  grid-column:2;font-size:19px;color:var(--txt);
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sub{text-align:center;color:var(--dim);font-size:13px}

.backlink{align-self:flex-start;color:var(--dim);font-size:13px;text-decoration:none;padding:6px 2px}
.backlink:active{color:var(--txt)}

.card{
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  padding:11px;display:flex;flex-direction:column;gap:9px;
}
.field{display:flex;align-items:center;gap:12px}
.field>span{width:80px;flex:none;color:var(--dim);font-size:14px}
.field-label{color:var(--dim);font-size:14px}
.hint{color:var(--dim);font-size:12px;line-height:1.35}
.hint:empty{display:none}

input,select{
  flex:1;min-width:0;background:var(--bg2);border:1px solid var(--line);
  border-radius:10px;color:var(--txt);padding:12px;font:inherit;font-size:17px;
  -webkit-user-select:text;user-select:text;
}
select{padding:11px 12px;font-size:16px}
input:focus,select:focus{outline:none;border-color:var(--green)}

.toggle{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:2px}
.tg-label{flex:1}
.tg-label b{font-size:16px;font-weight:600}
.tg-switch{
  flex:none;width:50px;height:30px;border-radius:15px;
  background:var(--bg2);border:1px solid var(--line);
  position:relative;transition:background .15s,border-color .15s;
}
.tg-switch::after{
  content:'';position:absolute;top:3px;left:3px;
  width:22px;height:22px;border-radius:50%;background:var(--dim);
  transition:transform .15s,background .15s;
}
.toggle.is-on .tg-switch{background:var(--green-d);border-color:var(--green)}
.toggle.is-on .tg-switch::after{transform:translateX(20px);background:#fff}

/* ---------- the steps ---------- */
.stages{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.stage{
  display:flex;align-items:center;justify-content:center;gap:6px;
  padding:10px 4px;border-radius:10px;font-size:15px;font-weight:600;color:var(--dim);
  background:var(--bg2);border:1px solid var(--line);
}
.stage i{
  font-style:normal;font-size:12px;width:20px;height:20px;line-height:18px;border-radius:50%;
  border:1px solid currentColor;text-align:center;flex:none;
}
.stage b{font-size:12px;font-weight:600;opacity:.8}
.stage b:empty{display:none}
.stage.is-on{color:var(--on-primary,#fff);background:var(--green-d);border-color:var(--green)}
.step{display:flex;flex-direction:column;gap:8px}

/* ---------- players: a numbered list — .roster, in /shared.css ---------- */

.primary:disabled{opacity:.45;cursor:default}

/* ---------- format ---------- */
.field-label small{font-size:12px}
.stepper .step-btn{flex:none;width:48px;font-size:20px;padding:6px 0}
.stepper b{min-width:2em;text-align:center;font-size:20px;font-variant-numeric:tabular-nums}
.seg:disabled{opacity:.4;cursor:default}
.count{font-size:13px;color:var(--txt)}
.resume-list{display:flex;flex-direction:column;gap:6px}

/* ---------- standings ---------- */
.standings{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.standings th{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--paper-dim,var(--dim));padding:0 4px 4px}
.standings td{padding:5px 4px;text-align:center;border-top:1px solid var(--paper-rule,var(--line))}
.standings .pl{text-align:left;width:100%;font-family:var(--f-hand,inherit);font-size:17px}
.standings th.pl{font-family:inherit;font-size:11px}
.standings .pos{color:var(--paper-dim,var(--dim));width:1.6em}
.standings .tb{color:var(--paper-dim,var(--dim));min-width:3em}
.standings tr.lead .pl{font-weight:700;color:var(--gold)}

/* ---------- the champion ---------- */
.champ{text-align:center;padding:6px 0 4px}
.champ .trophy{font-size:44px}
.champ h2{font-family:var(--f-title,inherit);font-weight:400;font-size:28px;color:var(--gold)}
.champ p{color:var(--dim);font-size:13px}

/* ---------- rounds and matches ---------- */
.rounds{display:flex;flex-direction:column;gap:10px;padding-top:4px}
.round h3{
  display:flex;justify-content:space-between;align-items:baseline;
  font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);
  padding:0 4px 4px;
}
.round h3 small{font-size:12px;font-weight:400;letter-spacing:0;text-transform:none}
.round.now h3{color:var(--gold)}
.round.done{opacity:.72}
.match{
  display:flex;align-items:baseline;gap:8px;
  width:100%;text-align:left;padding:11px 12px;margin-bottom:6px;
  background:var(--card);border:1px solid var(--line);border-radius:11px;font-size:16px;
}
.round.now .match{border-color:var(--green-d)}
.match:active{background:var(--select,var(--bg2))}
/* the two names side by side, the result at the far end */
.match span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.match i{font-style:normal;color:var(--dim);font-size:13px}
.match .won{font-weight:700}
.match .lost{color:var(--dim)}
.match .st{font-style:normal;font-size:13px;white-space:nowrap;margin-left:auto;padding-left:8px}
.st.play{color:var(--green);font-weight:700}
.st.live{color:var(--gold)}
.st.done{color:var(--dim)}

/* ---------- actions ---------- */
.actions{display:flex;flex-direction:column;gap:12px;padding-top:14px}
.mini-row{display:grid;gap:6px}
.mini-row.two{grid-template-columns:1fr 1fr}
.danger-ghost{color:var(--neg,#e2857a);border-color:var(--neg-line,#5a302a)}
.msg{text-align:center;font-size:13px;font-weight:600;color:var(--gold);min-height:16px}

/* ---------- overlays ---------- */
.overlay{
  position:fixed;inset:0;background:var(--veil,#0b0e12ee);
  display:flex;align-items:center;justify-content:center;padding:24px;z-index:10;
}
.win-card{
  background:var(--card);border:1px solid var(--line);border-radius:18px;
  padding:24px 20px;text-align:center;width:100%;max-width:360px;
  display:flex;flex-direction:column;gap:12px;
}
.win-card h2{font-size:24px;color:var(--gold)}
.win-card p{color:var(--dim);font-size:14px}
.overlay.confirm{z-index:20}
.overlay.confirm h2{color:var(--txt);font-size:22px}
.overlay.confirm p{font-size:15px;line-height:1.45}
