/* Tournament pages: same wasteland look as the store */
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --bg: #0a0d09; --panel: #131910; --panel-2: #1a2216; --line: #2a3524;
  --fg: #ecefe6; --muted: #8e9a86; --brand: #8ee31f; --brand-hi: #a8f53c; --rust: #f08a24;
  --gold: #ffc83d; --bad: #e5484d;
  --display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 500px at 85% -10%, rgba(142,227,31,.10), transparent 60%), var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.6; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }

header { position: sticky; top: 0; z-index: 20; background: rgba(10,13,9,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; gap: 14px; padding-block: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--brand); color: #0a0d09; box-shadow: 0 0 18px rgba(142,227,31,.45); font-family: var(--display); font-weight: 700; font-size: 18px; clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%); }
.logo b { font-family: var(--display); font-size: 20px; letter-spacing: .06em; }
header .back { text-decoration: none; color: var(--muted); font-size: 14px; }
header .back:hover { color: var(--fg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 4px; padding: 9px 15px; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #0a0d09; }
.btn.primary:hover { background: var(--brand-hi); }
.btn.warn { border-color: var(--rust); color: var(--rust); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

main { display: grid; gap: 48px; padding-block: 32px 72px; }
h1, h2 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 48px); text-transform: uppercase; line-height: 1.15; }
h1 span { color: var(--brand); text-shadow: 0 0 24px rgba(142,227,31,.45); }
h2 { font-size: clamp(22px, 3.2vw, 30px); margin-bottom: 16px; }
.eyebrow { font-family: var(--display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--rust); margin: 0 0 8px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--brand); color: var(--brand); }
.pill.closed, .pill.finished { border-color: var(--muted); color: var(--muted); }
.pill.running { border-color: var(--rust); color: var(--rust); }

.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 18px 0; }
.stats div { font-size: 13px; color: var(--muted); }
.stats b { display: block; font-family: var(--display); font-size: 24px; color: var(--fg); font-variant-numeric: tabular-nums; }
.stats .pool b { color: var(--gold); }
.rules { padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--panel); max-width: 70ch; margin: 0; }

/* Bracket: one column per round, scrolls sideways inside its own box */
.bracket-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 16px; }
.bracket { display: flex; gap: 22px; min-width: max-content; }
.col { display: flex; flex-direction: column; width: 230px; }
.col h4 { margin: 0 0 10px; font-family: var(--display); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.col-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.col.champ { width: 210px; }
.col.champ h4 { color: var(--gold); }
.match { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.match.final { border-color: var(--gold); box-shadow: 0 0 22px -8px var(--gold); }
.side { display: flex; align-items: center; gap: 8px; padding: 7px 9px; min-height: 40px; font-size: 14px; }
.side + .side { border-top: 1px solid var(--line); }
.side img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; background: var(--panel-2); flex: none; }
.side .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side small { color: var(--muted); }
.side.tbd { color: var(--muted); font-style: italic; }
.side.won { background: rgba(142,227,31,.10); }
.side.won .nm { color: var(--brand); font-weight: 600; }
.side.lost { opacity: .45; text-decoration: line-through; }
.mt { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--brand); color: #0a0d09; flex: none; }
.mt.tc { background: var(--rust); }
.moved { font-size: 12px; color: var(--gold); padding: 3px 9px 6px; font-variant-numeric: tabular-nums; }

/* Clan cards */
.clans { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.clan { display: grid; grid-template-columns: 56px 1fr; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.clan img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--panel-2); }
.clan h3 { margin: 0; font-size: 16px; font-family: var(--display); overflow-wrap: anywhere; }
.clan .coins { color: var(--gold); font-size: 13px; font-variant-numeric: tabular-nums; }
.clan .who { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.clan.out { opacity: .5; }

/* Forms */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label.f { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input:not([type]) { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; color: var(--fg); font-size: 15px; }
input:focus { border-color: var(--brand); outline: none; }
.logo-pick { display: flex; align-items: center; gap: 14px; }
.logo-pick img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--bg); border: 1px dashed var(--line); }
.member { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 10px; align-items: center; }
.member span { font-size: 12px; color: var(--muted); }
.msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 4px; font-size: 14px; }
.msg.err { background: rgba(229,72,77,.12); border: 1px solid var(--bad); }
.msg.ok { background: rgba(142,227,31,.10); border: 1px solid var(--brand); }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr 1fr; }
  .member span { grid-column: 1 / -1; }
}
