/* Musvisto · Events screens: import, leagues, tournaments, venue, sponsors and the TV screen (S17, S20–S24).
   Colours only through the variables of app.css; one component per kind of thing, same size everywhere. */

.ev-soft { color: var(--ink-soft); font-size: 15px; margin: 0 0 12px; }
.ev-gap { margin-top: var(--gap); }
.ev-stack { display: grid; gap: 8px; }
.ev-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.ev-actions .button { width: 100%; }
.ev-filename { margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.ev-filename b { color: var(--ink); }
.ev-links { margin: 24px 0 0; text-align: center; font-size: 15px; }
.ev-links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.ev-form h3 { margin-bottom: 12px; }
.ev-form .field:last-of-type { margin-bottom: 12px; }
.ev-tabs { margin: 0 0 8px; }
.ev-tabs .pill { flex: 1 1 0; justify-content: center; min-width: 0; padding: 0 6px; text-decoration: none; font-weight: 600; font-size: clamp(14px, 3.9vw, 15px); }
.ev-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--gap); align-items: end; }
.ev-inline .field { margin: 0; }
.ev-inline .button { min-height: 48px; }

/* Round marks (initial of a league or tournament) */
.ev-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--stone); color: #5b4b1f; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 19px; }

/* Segmented radio (single / double round) */
.ev-seg { border: 0; padding: 0; min-width: 0; }
.ev-segs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 980px; background: var(--line); }
.ev-segs label { position: relative; display: block; cursor: pointer; }
.ev-segs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ev-segs span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 980px; font-size: 15px; text-align: center; }
.ev-segs input:checked + span { background: var(--surface); font-weight: 600; }
.ev-segs input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Mirrored match row: pair A · score · pair B. Same height for every row. */
.ev-vs {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: 8px;
  width: 100%; height: 76px; padding: 10px 14px; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left;
}
button.ev-vs { cursor: pointer; transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1); }
button.ev-vs:hover { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
button.ev-vs:active { background: color-mix(in srgb, var(--surface) 86%, var(--accent)); }
.ev-side { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-side.b { text-align: right; }
.ev-side b, .ev-side small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ev-side b { font-weight: 500; font-size: clamp(15px, 4.2vw, 17px); line-height: 1.25; }
.ev-side small { font-size: 14px; line-height: 1.3; color: var(--ink-soft); }
.ev-side.win b { font-weight: 700; }
.ev-side.a.win b { color: var(--accent); }
.ev-side.b.win b { color: var(--pair-b); }
.ev-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; text-align: center; }
.ev-score { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.ev-dash { color: var(--ink-soft); }
.ev-mid small { font-size: 12px; line-height: 1.25; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Score steppers in result sheets, mirrored like the row above */
.ev-result { margin-top: 16px; }
.ev-result-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 16px; }
.ev-result-mid { text-align: center; color: var(--ink-soft); font-size: 14px; }
.ev-step { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
.ev-step input { width: 100%; min-width: 0; min-height: 56px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: center; font: 600 26px/1 "Bricolage Grotesque", system-ui, sans-serif; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ev-step input::-webkit-inner-spin-button, .ev-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ev-step-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font: 600 22px/1 system-ui, sans-serif; cursor: pointer; }
.ev-move { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Pairs */
.ev-pair { grid-template-columns: 72px minmax(0, 1fr) auto; height: 68px; min-height: 0; }
.ev-avs { display: flex; }
.ev-avs .avatar { width: 40px; height: 40px; border: 2px solid var(--surface); }
.ev-avs .avatar + .avatar { margin-left: -12px; }

/* League table: fixed columns so numbers stay centred under their header */
.ev-league .c-pos { width: 32px; }
.ev-league .c-n { width: 40px; }
@media (min-width: 600px) { .ev-league .c-n { width: 56px; } }

/* Tournament */
.ev-round > h3 .ev-soft { margin: 0; font-size: 14px; font-weight: 400; }
.ev-champion { display: grid; gap: 4px; justify-items: center; margin: 0 0 16px; text-align: center; }
.ev-champion small { color: var(--ink-soft); font-size: 14px; }
.ev-champion b { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: clamp(22px, 6vw, 28px); font-weight: 600; line-height: 1.15; color: var(--accent); text-wrap: balance; }
.ev-champion .ev-soft { margin: 0; }
.ev-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 720px) { .ev-tables { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-table-card { display: grid; grid-template-rows: 28px 76px; gap: 4px; }
.ev-table-no { margin: 0; padding: 0 4px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ev-table-card.busy .ev-table-no { color: var(--accent); }
.ev-free { margin: 0; height: 76px; display: grid; place-items: center; border-radius: var(--radius); border: 1px dashed var(--line); color: var(--ink-soft); font-size: 15px; }

/* Import */
.ev-colmap { display: grid; gap: 8px; }
.ev-colrow { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 12px; min-height: 48px; }
.ev-colrow span { font-size: 15px; font-weight: 600; }
.ev-colrow select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.ev-req { font-style: normal; font-weight: 400; font-size: 13px; color: var(--ink-soft); }
.ev-counts .tile { height: 88px; }
.ev-error { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 12px 16px; font-size: 15px; }
.ev-error b { font-weight: 600; }
.ev-error q { overflow-wrap: anywhere; }
.ev-name-head { margin: 0 0 10px; overflow-wrap: anywhere; }
.ev-name-head small { display: block; color: var(--ink-soft); font-size: 14px; }
.ev-name .pill { gap: 8px; padding: 0 14px 0 6px; }
.ev-name .pill .avatar { width: 32px; height: 32px; }
.ev-name-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.ev-name-actions .field { margin: 0; }
.ev-done { margin-top: 16px; }

/* Sponsors */
.ev-sponsors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; margin: 0 0 16px; }
.ev-sponsor { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; height: 72px; padding: 12px; border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.ev-sp-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; display: grid; place-items: center; }
.ev-sp-logo.lg { width: 72px; height: 72px; border-radius: 16px; }
.ev-sp-initial { background: var(--stone); color: #5b4b1f; font: 700 20px/1 "Bricolage Grotesque", system-ui, sans-serif; }
.ev-sp-text { min-width: 0; display: flex; flex-direction: column; }
.ev-sp-text b, .ev-sp-text small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ev-sp-text small { color: var(--ink-soft); font-size: 13px; line-height: 1.3; }
.ev-sp-prize { color: var(--accent) !important; }
.ev-sprow { grid-template-columns: minmax(0, 1fr) auto; }
.ev-sprow .ev-sponsor { padding: 0; height: 56px; background: none; }
.ev-scope { padding-left: 60px; }
.ev-logo-pick { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; }
.ev-logo-pick .button { width: 100%; }

/* Venue */
.ev-venue-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; }
.ev-venue-head b { display: block; font-size: 19px; line-height: 1.25; }
.ev-venue-head small { display: block; color: var(--ink-soft); font-size: 15px; }
.ev-public-head { text-align: center; display: grid; justify-items: center; gap: 4px; margin: 16px 0 24px !important; }
.ev-public-head h1 { margin: 8px 0 0; font-size: clamp(30px, 8vw, 44px); }
.ev-top { margin: 0; padding: 0; list-style: none; counter-reset: top; }
.ev-top li { counter-increment: top; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px; border-top: 1px solid var(--line); }
.ev-top li::before { content: counter(top); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ev-top li span { min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- TV screen (/tv/:gid)
   Big type and high contrast for a bar TV seen from across the room; always dark. */
.tv-mode body { background: #0b1110; }
.tv-mode .shell { padding: 0; }
.tv {
  --tv-bg: #0b1110; --tv-panel: #151d1c; --tv-ink: #f6f6f1; --tv-soft: #b9c3c0; --tv-line: #2b3533; --tv-a: #6fdcd2; --tv-b: #ff9f8a;
  position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2vh;
  padding: 3vh 4vw; background: var(--tv-bg); color: var(--tv-ink); overflow: hidden; cursor: none;
  font-size: min(3vh, 2.2vw);
}
.tv-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2vw; }
.tv-crest { width: 9vh; height: 9vh; border-radius: 2vh; font-size: 4.5vh; }
.tv-host b { display: block; font: 600 min(4.6vh, 3.4vw)/1.1 "Bricolage Grotesque", system-ui, sans-serif; }
.tv-host small { display: block; color: var(--tv-soft); font-size: min(2.6vh, 2vw); }
.tv-clock { font: 600 min(4.6vh, 3.4vw)/1 "Bricolage Grotesque", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.tv-slide { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 2vh; }
.tv-title { margin: 0; font-size: min(6vh, 4.4vw); color: var(--tv-ink); text-wrap: balance; }
.tv-body { min-height: 0; overflow: hidden; }
.tv-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.tv-table th { padding: 0 0.6em 1vh; color: var(--tv-soft); font-size: 0.8em; font-weight: 600; text-align: center; width: 12%; }
.tv-table th:first-child { width: 8%; }
.tv-table th.name { width: auto; text-align: left; }
.tv-table td { height: 5.4vh; padding: 0 0.6em; border-top: 1px solid var(--tv-line); text-align: center; font-size: 1.15em; }
.tv-table td.name { text-align: left; }
.tv-table td.name b { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tv-table tbody tr:first-child td { color: var(--tv-a); }
.tv-who { display: grid; grid-template-columns: 4.6vh minmax(0, 1fr); align-items: center; gap: 1vw; }
.tv-who .avatar { width: 4.6vh; height: 4.6vh; }
.tv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6vh 2vw; align-content: start; }
.tv-vs { display: grid; grid-template-columns: minmax(0, 1fr) 9em minmax(0, 1fr); align-items: center; gap: 1vw; height: 13vh; padding: 0 1.4vw; border-radius: 2vh; background: var(--tv-panel); }
.tv-side { min-width: 0; display: flex; flex-direction: column; }
.tv-side.b { text-align: right; }
.tv-side b, .tv-side small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tv-side b { font-weight: 500; font-size: 1.05em; }
.tv-side small { color: var(--tv-soft); font-size: 0.85em; }
.tv-side.a.win b { color: var(--tv-a); font-weight: 700; }
.tv-side.b.win b { color: var(--tv-b); font-weight: 700; }
.tv-mid { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tv-mid b { font: 600 1.6em/1.1 "Bricolage Grotesque", system-ui, sans-serif; white-space: nowrap; }
.tv-mid small { color: var(--tv-soft); font-size: 0.75em; }
.tv-dash { color: var(--tv-soft); }
.tv-champ { margin: 0 0 2vh; color: var(--tv-a); font: 600 1.4em/1.2 "Bricolage Grotesque", system-ui, sans-serif; }
.tv-empty { margin: auto; max-width: 30em; color: var(--tv-soft); text-align: center; font-size: 1.2em; }
.tv-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2vw; }
.tv-foot .ev-sponsor { height: 10vh; max-width: 40vw; padding: 1.2vh 1.4vw; grid-template-columns: 7.6vh minmax(0, 1fr); background: var(--tv-panel); color: var(--tv-ink); }
.tv-foot .ev-sp-logo { width: 7.6vh; height: 7.6vh; border-radius: 1.4vh; }
.tv-foot .ev-sp-text b { font-size: 1em; }
.tv-foot .ev-sp-text small { color: var(--tv-soft); font-size: 0.7em; }
.tv-dots { display: flex; gap: 1vh; }
.tv-dots i { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--tv-line); }
.tv-dots i.on { background: var(--tv-a); }
.tv-brand { justify-self: end; color: var(--tv-soft); font-size: 0.8em; }

/* A phone or a portrait screen showing the TV page: one column, readable sizes. */
@media (max-width: 760px), (orientation: portrait) {
  .tv { font-size: 16px; padding: 16px; gap: 12px; }
  .tv-crest { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
  .tv-host b, .tv-clock { font-size: 20px; }
  .tv-host small { font-size: 14px; }
  .tv-title { font-size: 26px; }
  .tv-table td { height: 48px; font-size: 16px; }
  .tv-table tbody tr:nth-child(n+9) { display: none; }
  .tv-who { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .tv-who .avatar { width: 32px; height: 32px; }
  .tv-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tv-vs { height: 72px; grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr); padding: 0 12px; border-radius: 14px; }
  .tv-foot { grid-template-columns: minmax(0, 1fr) auto; }
  .tv-foot .ev-sponsor { height: 56px; max-width: none; padding: 8px; grid-template-columns: 40px minmax(0, 1fr); }
  .tv-foot .ev-sp-logo { width: 40px; height: 40px; }
  .tv-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) { button.ev-vs { transition: none; } }
