/* Redondo do Major — dense, dark, scoreboard look. One theme on purpose. */
:root {
  color-scheme: dark;
  --bg: #12161b; --panel: #1c232b; --panel2: #232c36; --band: #2a3542; --line: #33404e;
  --fg: #e4e9ef; --muted: #8b98a9;
  --blue: #5b9bd5; --gold: #e8a93c; --green: #55b877; --red: #e2594f;
  --f-d: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-b: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--f-b); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { font: 700 22px/1 var(--f-d); letter-spacing: .04em; text-transform: uppercase; color: var(--fg); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--gold); }
.event { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; border-left: 1px solid var(--line); padding-left: 14px; }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font-size: 12px; }
@media (max-width: 560px) { .event { display: none; } }

.page { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 14px; }

/* hero */
.hero { background: linear-gradient(120deg, #223043, #1a222b 70%); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; display: flex; gap: 18px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero h1 { font: 700 clamp(30px, 6vw, 46px)/1 var(--f-d); text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.hero h1 span { color: var(--gold); }
.hero p { margin: 6px 0 0; color: var(--muted); max-width: 56ch; }
.hero p b { color: var(--fg); font-weight: 600; }
.join { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.join input { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; width: 210px; max-width: 100%; font-size: 15px; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.btn:hover:not(:disabled) { border-color: var(--blue); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1408; padding: 10px 16px; font: 700 16px/1 var(--f-d); text-transform: uppercase; letter-spacing: .05em; }
.btn.on { background: #1f3a2a; border-color: var(--green); color: var(--green); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.danger { color: var(--red); }
.mycard { display: flex; gap: 18px; align-items: center; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.stat b { font: 700 30px/1 var(--f-d); color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* road: the championship path, replaces tabs */
.road { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stop { --notch: 16px; border: 0; text-align: left; background: var(--panel); padding: 12px 22px 12px 30px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; min-width: 0;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%, var(--notch) 50%); margin-left: -8px; }
.stop:first-child { clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%); padding-left: 16px; margin-left: 0; border-radius: 6px 0 0 6px; }
.stop:hover { background: var(--panel2); }
.stop.active { background: linear-gradient(180deg, #35506e, #2a4059); }
.stop-n { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--f-d); background: var(--bg); color: var(--muted); border: 2px solid var(--line); }
.stop.open .stop-n { border-color: var(--gold); color: var(--gold); }
.stop.live .stop-n { border-color: var(--blue); color: var(--blue); }
.stop.done .stop-n { border-color: var(--green); color: var(--green); }
.stop.soon { color: var(--muted); }
.stop-name { font: 700 19px/1.1 var(--f-d); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop.active .stop-meta { color: #c6d6e8; }
.stop-meta i { font-style: normal; font-weight: 600; }
.stop.open .stop-meta i { color: var(--gold); } .stop.live .stop-meta i { color: var(--blue); } .stop.done .stop-meta i { color: var(--green); }
@media (max-width: 760px) {
  .road { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stop, .stop:first-child { clip-path: none; margin: 0; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); }
  .stop.active { border-color: var(--blue); }
}

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.main, .side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.band { background: var(--band); padding: 9px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band h2, .band h3 { font: 700 18px/1.1 var(--f-d); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.band small { color: var(--muted); font-weight: 500; }
.band .right { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pill { font: 600 11px/1 var(--f-b); text-transform: uppercase; letter-spacing: .07em; padding: 4px 7px; border-radius: 3px; background: var(--bg); color: var(--muted); }
.pill.open { background: #3b2d12; color: var(--gold); }
.pill.live { background: #1b3048; color: var(--blue); }
.pill.done { background: #1b3526; color: var(--green); }
.note { color: var(--muted); font-size: 12.5px; margin: 0; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.sub { font: 600 12px/1 var(--f-b); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }

/* logos */
.logo { object-fit: contain; flex: none; }
.logo-fb { flex: none; display: grid; place-items: center; background: var(--band); border-radius: 4px; font: 700 12px/1 var(--f-d); color: var(--muted); }

/* pick'em board */
.board { display: grid; grid-template-columns: 1fr 3fr 1fr; gap: 10px; }
.bucket { --c: var(--blue); background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 5px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bucket.b30 { --c: var(--green); } .bucket.b03 { --c: var(--red); }
.bucket.pickable { cursor: pointer; }
.bucket.active { background: #161d25; box-shadow: 0 0 0 1px var(--c), 0 0 18px -6px var(--c); }
.bucket-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bucket-h b { font: 700 22px/1 var(--f-d); color: var(--c); letter-spacing: .03em; text-transform: uppercase; }
.bucket-h span { font-size: 11.5px; color: var(--muted); }
.bucket-h em { margin-left: auto; font: 600 12px/1 var(--f-b); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.slots { display: grid; gap: 6px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.bucket.badv .slots { --cols: 3; }
.slot { position: relative; min-height: 74px; border-radius: 4px; border: 1px dashed var(--line); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; color: var(--muted); font-size: 18px; min-width: 0; }
.slot.filled { border: 1px solid var(--line); background: var(--panel2); color: var(--fg); }
button.slot.filled:hover { border-color: var(--red); }
.slot .nm { font: 600 13px/1.1 var(--f-d); letter-spacing: .02em; text-align: center; overflow-wrap: anywhere; }
.slot.hit { border-color: var(--green); background: #1b3526; }
.slot.miss { border-color: var(--red); background: #3a1d1b; }
.mark { position: absolute; top: 3px; right: 5px; font-size: 12px; font-weight: 700; }
.hit .mark { color: var(--green); } .miss .mark { color: var(--red); }
@media (max-width: 760px) { .board { grid-template-columns: 1fr; } .bucket .slots { --cols: 2; } .bucket.badv .slots { --cols: 3; } }

.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.tile { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
button.tile:hover:not(:disabled) { border-color: var(--blue); background: #28333f; }
.tile .nm { font: 600 14px/1.1 var(--f-d); letter-spacing: .02em; overflow-wrap: anywhere; }
.tile.picked { background: var(--bg); }
.tile.picked .logo, .tile.picked .nm { opacity: .45; }
.tile.ghost { border-style: dashed; background: transparent; color: var(--muted); justify-content: center; min-height: 92px; font-size: 12px; }
.chip { font: 700 10px/1 var(--f-b); letter-spacing: .06em; text-transform: uppercase; padding: 3px 5px; border-radius: 3px; background: var(--band); color: var(--fg); }
.chip.c30, .chip.r30 { background: #1b3526; color: var(--green); }
.chip.cadv, .chip.radv { background: #1b3048; color: var(--blue); }
.chip.c03, .chip.r03 { background: #3a1d1b; color: var(--red); }
.chip.rout { background: var(--band); color: var(--muted); }
.tile .chip { position: absolute; top: 4px; right: 4px; }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font: 600 11px/1 var(--f-b); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: left; padding: 8px 10px; background: var(--panel2); white-space: nowrap; }
td { padding: 7px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
td.n, th.n { text-align: right; }
td.tot { font: 700 17px/1 var(--f-d); color: var(--gold); }
td.pos { color: var(--muted); width: 1%; }
tr.me td { background: #1f2b38; }
tr.pinga td { background: #33201e; }
.tag { font: 700 10px/1 var(--f-b); text-transform: uppercase; letter-spacing: .06em; margin-left: 6px; }
.tag.pg { color: var(--red); } .tag.ld { color: var(--green); } .tag.vc { color: var(--blue); }
.who { display: inline-flex; align-items: center; gap: 6px; max-width: 150px; }
.who span.t { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.dot.ok { background: var(--green); }
.minis { display: inline-flex; gap: 3px; flex-wrap: nowrap; }
.mini { width: 26px; height: 26px; border-radius: 3px; display: grid; place-items: center; background: var(--panel2); border: 1px solid transparent; }
.mini.hit { border-color: var(--green); background: #1b3526; }
.mini.miss { border-color: var(--red); background: #3a1d1b; opacity: .75; }
.rules { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.rules b { color: var(--fg); }

/* playoff bracket */
.bscroll { overflow-x: auto; padding-bottom: 4px; }
.bracket { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)) minmax(150px, .8fr); gap: 0 26px; min-width: 760px; }
.round { display: flex; flex-direction: column; gap: 8px; }
.round h4 { font: 700 13px/1 var(--f-d); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; padding: 6px 8px; background: var(--panel2); border-radius: 3px; display: flex; justify-content: space-between; }
.round h4 small { color: var(--gold); font-weight: 600; }
.rbody { flex: 1; display: flex; flex-direction: column; }
.pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 12px; position: relative; padding: 6px 0; }
.pair::after { content: ""; position: absolute; right: -14px; top: 25%; height: 50%; width: 13px; border: 2px solid var(--line); border-left: 0; border-radius: 0 4px 4px 0; }
.pair.single::after { display: none; }
.r-sf .bm::before, .r-f .bm::before { content: ""; position: absolute; left: -12px; top: 50%; width: 12px; border-top: 2px solid var(--line); }
.bm { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; }
.bt { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; min-width: 0; min-height: 40px; }
.bt:first-child { border-top: 0; }
.bt .nm { font: 600 15px/1.1 var(--f-d); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
button.bt:hover:not(:disabled) { background: var(--panel2); }
.bt.on { background: #3b2d12; box-shadow: inset 3px 0 0 var(--gold); }
.bt.on.hit { background: #1b3526; box-shadow: inset 3px 0 0 var(--green); }
.bt.on.miss { background: #3a1d1b; box-shadow: inset 3px 0 0 var(--red); }
.bt.on.miss .nm { text-decoration: line-through; }
.bt .res { font-size: 12px; font-weight: 700; }
.bt.won .res { color: var(--green); }
.bt.tbd { color: var(--muted); font-size: 12px; }
.champ { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(circle at 50% 35%, #3b2d12, var(--bg) 70%); border: 1px solid var(--line); border-radius: 4px; padding: 14px 8px; text-align: center; min-height: 150px; }
.champ .nm { font: 700 22px/1 var(--f-d); text-transform: uppercase; letter-spacing: .03em; }
.champ .cap { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.champ.tbd { background: var(--bg); color: var(--muted); }

/* admin */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px; }
.arow { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; min-width: 0; }
.arow .nm { flex: 1; font: 600 14px/1.1 var(--f-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; flex: none; }
.seg button { background: var(--panel2); border: 0; border-left: 1px solid var(--line); padding: 5px 7px; font: 700 11px/1 var(--f-b); color: var(--muted); }
.seg button:first-child { border-left: 0; }
.seg button.on { color: #10151a; }
.seg button.on.r30 { background: var(--green); } .seg button.on.radv { background: var(--blue); } .seg button.on.rout { background: var(--muted); } .seg button.on.r03 { background: var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type=text], .row input[type=password], .row select, .qf select { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; min-width: 0; }
.row input[type=text] { flex: 1 1 220px; }
.qf { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.qf .arow select { flex: 1 1 80px; min-width: 0; }

.foot { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--band); border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; max-width: calc(100vw - 32px); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--red); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ranking fits the side column without scrolling */
.side th, .side td { padding-left: 6px; padding-right: 6px; }
.side td:first-child, .side th:first-child { padding-left: 12px; }
.side td:last-child, .side th:last-child { padding-right: 12px; }
.side .who { max-width: 112px; }
.tile .chip { position: static; }
.cols { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.side th, .side td { padding-left: 5px; padding-right: 5px; }
.side .who { max-width: 100px; }
.side .tag { margin-left: 4px; }
@media (max-width: 760px) { .stop-meta { white-space: normal; } }

/* drag and drop */
[data-team] { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[data-team] img { pointer-events: none; -webkit-user-drag: none; }
.dragging { opacity: .25; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; margin: 0; pointer-events: none; opacity: .96; border-color: var(--gold) !important; background: var(--panel2) !important; box-shadow: 0 14px 30px -8px #000c; will-change: transform; transition: none; }
.drag-ghost .chip { display: none; }
.drag-ghost .logo, .drag-ghost .nm { opacity: 1 !important; }
body.dnd, body.dnd * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.bucket.drop { background: #18212b; box-shadow: 0 0 0 2px var(--c), 0 0 22px -4px var(--c); }
.bucket.drop .slot:not(.filled) { border-color: var(--c); color: var(--c); }
.pool.drop { outline: 2px dashed var(--muted); outline-offset: 6px; border-radius: 4px; }
.slot.drop-on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
