/* Event leagues (events.js): the tournament's card, the leaderboard, a bracket, the games, the team draft room, a golf team and
   the tournament leaderboard. Loads after pages.css. A pick's state is always written or marked, never shown by colour alone. */

/* hub cards: a long sport name ("Women's college hoops") shortens rather than pushing the card wider than a phone */
.panel.league .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* the tournament and the lock */
.ev-name { font: italic 700 34px/1 var(--disp); text-transform: uppercase; margin: 6px 0 2px; overflow-wrap: anywhere; }
.ev-heroline { margin: 14px 0 16px; } .ev-lock { display: flex; flex-direction: column; gap: 2px; } .ev-count { font-size: clamp(40px, 6vw, 56px); line-height: 1; }
.ev-rules { margin: 8px 0 12px; padding-left: 18px; } .ev-rules li { margin: 6px 0; }
.ev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .ev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ev-name { font-size: 28px; } .ev-grid { grid-template-columns: minmax(0, 1fr); } }
.ev-pick { position: relative; } .ev-pick .kind { color: var(--amber); }

/* the leaderboard: the name keeps its room on a phone, the extra columns go under it */
.ev-stable .c-best, .ev-stable .c-alive, .ev-stable .c-made { width: 96px; } .ev-stable .c-pick { width: 150px; }
.ev-tmt { display: flex; flex-direction: column; min-width: 0; } .ev-tmt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ev-sub { display: none; }
.ev-champ { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; } .ev-champ .chip { margin-left: 2px; }
@media (max-width: 720px) { .ev-stable .c-best, .ev-stable .c-alive, .ev-stable .c-made, .ev-stable .c-pick { display: none; } .ev-sub { display: block; white-space: normal; } }

/* a bracket's summary: progress, the fills, the tiebreaker */
.ev-sum { display: flex; flex-direction: column; gap: 12px; } .ev-sum .tiles { margin-top: 0; }
.ev-tb { max-width: 420px; } .ev-tb input { max-width: 160px; }
.ev-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .ev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-views { display: flex; flex-wrap: wrap; gap: 6px; }

/* the bracket: a region's rounds side by side on a wide screen, one round at a time on a phone */
.ev-rounds { display: none; } .ev-rounds.all { display: inline-flex; }
.evb { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.evb-col { display: flex; flex-direction: column; min-width: 0; } .evb-rh { margin: 0 0 8px; }
.evb-games { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: 1; }
@media (max-width: 900px) { .ev-rounds { display: inline-flex; } .evb { grid-template-columns: minmax(0, 1fr); } .evb-col { display: none; } .evb-col.on { display: flex; } .evb-games { justify-content: flex-start; } }
.evg { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.evt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: 600 14px var(--body); text-align: left; cursor: pointer; }
.evg > .evt:first-child { border-top: 0; } .evt:disabled { cursor: default; opacity: 1; }
.evt .face { flex-shrink: 0; } .evt-seed { width: 20px; flex-shrink: 0; text-align: right; font: 700 12px var(--body); color: var(--muted); }
.evt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .evt-score { font: 700 18px/1 var(--disp); }
.evt-mark { flex-shrink: 0; width: 18px; text-align: center; font-weight: 700; color: var(--accent-hi); } .evt-mark.ok { color: var(--good); } .evt-mark.bad { color: var(--bad); }
.evt.on { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); } .evt.on .evt-name { font-weight: 700; }
.evt.on.won { background: var(--good-tint); } .evt.on.lost, .evt.on.busted { background: var(--bad-tint); } .evt.on.alive { background: var(--panel-2); } .evt.on.alive .evt-mark { color: var(--soft); }
.evt.dead .evt-name { color: var(--muted); text-decoration: line-through; }
.evt.empty { cursor: default; } .evt.empty .evt-name { font-weight: 400; font-size: 13px; }
@media (hover: hover) { .evt:not(:disabled):not(.empty):hover { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); } .evt.on:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); } }
.evg-foot { padding: 6px 10px 8px; border-top: 1px solid var(--line); } .evg-foot .ok { color: var(--good); } .evg-foot .bad { color: var(--bad); }

/* the games, round by round */
.evgames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .evgames { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 560px) { .evgames { grid-template-columns: minmax(0, 1fr); } }
.evgame { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.evr { display: flex; align-items: center; gap: 8px; min-height: 36px; min-width: 0; } .evr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .evr-score { font-size: 20px; }
.evr.won .evr-name { font-weight: 700; } .evr.lost .evr-name, .evr.lost .evr-score { color: var(--muted); }
.evgame .evg-foot { border-top: 0; padding: 4px 0 0; }

/* the team draft room */
.evd-clock.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); } .evd-who { display: block; font: italic 700 28px/1.1 var(--disp); text-transform: uppercase; margin: 4px 0 2px; overflow-wrap: anywhere; }
.evd-avail .line { min-height: 52px; } .evd-avail .grow, .evd-mgr .grow { min-width: 0; }
.evd-mgr { padding: 10px 0; border-top: 1px solid var(--line); } .evd-mgr:first-of-type { border-top: 0; } .evd-mgr.now > .row b { color: var(--accent-hi); }
.evd-team { padding-left: 32px; } .evd-team.out b { color: var(--muted); }

/* a golf team: tiers to pick from, then the golfers' scores */
.evgolf { display: flex; flex-direction: column; margin-top: 8px; }
.evgp { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 6px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 0; }
@media (min-width: 900px) { .evgolf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; } .evgolf > .evgp:nth-child(2) { border-top: 0; } }
.evgp:first-child { border-top: 0; } .evgp.on { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border-radius: 8px; } .evgp:disabled { cursor: default; } .evgp:disabled b { color: var(--muted); text-decoration: line-through; }
.evgp-t { display: flex; flex-direction: column; min-width: 0; } .evgp-t b { overflow-wrap: anywhere; }
@media (hover: hover) { .evgp:not(:disabled):hover b { color: var(--accent-hi); } }
.evgl { gap: 10px; min-height: 56px; } .evgl .grow { min-width: 0; } .evgl-score { width: 46px; flex-shrink: 0; text-align: right; font-size: 24px; } .evgl.out b { color: var(--muted); }

/* the tournament leaderboard */
.evfield tr.evcut td { padding: 4px 10px; border-top: 2px dashed var(--accent); font: 700 11px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hi); text-align: left; }
.evfield .chip { margin: 2px 0; } .evfield td.gr-left { white-space: normal; }
@media (max-width: 560px) { .evfield .evf-today { display: none; } .evfield .gr-c1 { max-width: 150px; } .evfield .chip { font-size: 10px; padding: 2px 5px; } }
