/* The head table's Tournaments screen (#/admin/tournaments): each one's mode (Local / Hybrid / Online), its status
   with a registration switch, a switch for the hub's home page and its last sync, its online address, and the
   actions that apply. On a phone each row becomes a card. */
.tn-table td { vertical-align: top; }
@media (min-width: 1001px) {
  .tn-table { table-layout: fixed; }
  .tn-c-mode { width: 150px; } .tn-c-status { width: 172px; } .tn-c-hub { width: 176px; } .tn-c-act { width: 330px; }
}
.tn-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tn-name b { font-size: 14.5px; overflow-wrap: anywhere; }
.tn-mode { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.tn-mode svg.ic { width: 16px; height: 16px; flex: none; }
.tn-m-local svg.ic { color: var(--muted); }
.tn-m-online svg.ic { color: #0369a1; }
.tn-m-hybrid svg.ic { color: #15803d; }
.pill.tn-up { background: #e0ebff; color: var(--brand); }
.pill.tn-live { background: #ffe0e6; color: var(--live, #c01048); }
.pill.tn-done { background: #eef1f5; color: #475467; }
.tn-regnote { color: #a14a08; font-weight: 600; font-size: 12px; }
.tn-regnote.muted { color: var(--muted); font-weight: 500; }
/* the row's switches (registration, listed on the hub's home page): a little smaller than on the settings pages */
.tn-kv-sw { align-items: center; margin-top: 6px; }
.tn-kv-sw + .tn-kv { margin-top: 2px; }
.switch.tn-sw { width: 40px; height: 22px; }
.switch.tn-sw span::before { width: 16px; height: 16px; }
.switch.tn-sw input:checked + span::before { transform: translateX(18px); }
.switch.tn-sw input:focus-visible + span { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.switch.tn-sw input:disabled, .switch.tn-sw input:disabled + span { cursor: not-allowed; }
.switch.tn-sw input:disabled + span { opacity: .45; }
.tn-confirm input { text-transform: uppercase; letter-spacing: .08em; }
.tn-confirm input::placeholder { letter-spacing: .08em; }
.tn-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.tn-kv > span { color: var(--muted); }
.tn-kv b { font-weight: 600; text-align: right; white-space: nowrap; }
.tn-kv b.tn-no { color: var(--muted); font-weight: 500; }
.tn-kv b.tn-on { color: #15803d; }
.tn-link { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; min-width: 0; }
.tn-link a { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; font-size: 12.5px; color: var(--brand); }
.tn-link a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-link a svg.ic { width: 14px; height: 14px; flex: none; }
.tn-link .btn-sm { padding: 2px 8px; font-size: 11.5px; }
.tn-link .btn-sm svg.ic { width: 13px; height: 13px; }
.tn-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tn-table td.actions .btn + .btn { margin-left: 0; }
.tn-warn { margin: 10px 0; }

/* tablets: the actions stay in view on the right (as in the other tables), and may use two lines */
@media (max-width: 1000px) and (min-width: 721px) {
  .tn-table { min-width: 880px; }
  .tn-table td.actions { white-space: normal; width: 250px; }
  .card.flush .table.tn-table tr.tl-open td.actions { background: #f5f9ff; }
}

/* phones: each tournament is a card — name and address on top, then where / status / hub, then its buttons */
@media (max-width: 720px) {
  .tn-table, .tn-table tbody, .tn-table tr, .tn-table td { display: block; width: auto; }
  .tn-table colgroup, .tn-table thead { display: none; }
  .tn-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tn-table tr:last-child { border-bottom: 0; }
  .card .tn-table td, .card .tn-table td:first-child, .card .tn-table td:last-child { padding: 0; border: 0; background: none; }
  .card.flush .table.tn-table td.actions { position: static; box-shadow: none; white-space: normal; text-align: left; background: none; }
  .tn-table td + td { margin-top: 8px; }
  .tn-table td[data-label]:not(.tn-main):not([data-label=""]) { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: start; }
  .tn-table td[data-label]:not(.tn-main):not([data-label=""])::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
  .tn-table td.tn-nohub { display: none !important; }
  .tn-kv { justify-content: flex-start; }
  .tn-kv > span { min-width: 92px; }
  /* (bigger switches to tap) */
  .switch.tn-sw { width: 46px; height: 26px; }
  .switch.tn-sw span::before { width: 20px; height: 20px; }
  .switch.tn-sw input:checked + span::before { transform: translateX(20px); }
  .switch.tn-sw input { inset: -7px -5px; width: calc(100% + 10px); height: calc(100% + 14px); } /* (a 40px tap target) */
  .tn-kv-sw { min-height: 40px; margin-top: 0; }
  .tn-acts { justify-content: flex-start; margin-top: 4px; }
  .tn-acts .btn-sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .tn-link .btn-sm { min-height: 36px; padding: 6px 10px; }
  tr.tl-open { background: #f5f9ff; }
}
.tn-intro { margin-bottom: 4px; }
.tn-legend { margin-top: 0; }

/* 0.39: the Events page has a Kind column (Tournament / Dual meet / Dual tournament); the rare actions are in a ⋯ */
@media (min-width: 1001px) {
  .tn-c-kind { width: 160px; }
  .tn-table .tn-c-act { width: 190px; }
}
.tn-table td[data-label="Kind"] b { font-weight: 600; }
.tn-acts { align-items: center; }

/* ---- 0.40: "No event open" (N7), the hub's event box (N5), Backup on your hub (N18) */
.tn-empty { display: flex; gap: 18px; align-items: flex-start; padding: 26px 28px; }
.tn-empty-ic { flex: none; width: 48px; height: 48px; border-radius: 12px; background: #eef3ff; color: #1d4ed8; display: grid; place-items: center; }
.tn-empty-ic svg.ic { width: 24px; height: 24px; }
.tn-empty h2 { margin: 2px 0 6px; }
.tn-empty p { margin: 0 0 8px; max-width: 720px; }
.tn-empty-btns { gap: 8px; margin-top: 14px; }
.tn-empty-btns .btn svg.ic { width: 16px; height: 16px; }
@media (max-width: 640px) { .tn-empty { flex-direction: column; padding: 18px 16px; gap: 10px; } .tn-empty-btns > .btn { flex: 1 1 100%; justify-content: center; } }
.tmenu-onhub .tmenu-act b { font-weight: 700; }
.tmenu-onhub .tmenu-act { color: var(--brand); }
.tmenu-onhub .tmenu-act svg.ic { color: currentColor; }
.hb-toast a { color: inherit; font-weight: 700; text-decoration: underline; }
/* the mat table and the screens for the day, with no event open */
.ne-mat .ne-note { color: #cbd5e1; font-size: 16px; line-height: 1.45; margin: 4px 0 22px; max-width: 560px; }
.ne-card b { display: block; font-size: 20px; color: #fff; }
.ne-card p { margin: 8px 0 0; }
.ne-tv .pv-top { position: static; padding: 8vh 6vw 3vh; text-align: center; }
.ne-tv .pv-top > .pv-brand { display: flex; justify-content: center; }
.ne-tv .pv-top h1 { font-size: clamp(28px, 5vw, 72px); }
.ne-tv .pv-top p { font-size: clamp(14px, 1.8vw, 26px); }
.ne-tv .pv-main { max-width: 900px; margin: 0 auto; }
.ne-tv .ne-card b { font-size: clamp(18px, 2.2vw, 32px); }
.ne-tv .ne-card p { font-size: clamp(13px, 1.4vw, 20px); }
/* Data & Backups: Backup on your hub next to Backups on this laptop */
.dt-row { align-items: stretch; }
.dt-row > .card { margin-bottom: 0; }
.dt-row + .off-card, .dt-row + .card { margin-top: 16px; }
.dt-hub .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dt-hubsw { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.dt-hubsw > span { display: flex; flex-direction: column; }
.dt-hubsw small { font-size: 12px; }
.dt-hubline { margin: 6px 0; }
.dt-latest { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.dt-latest p { margin: 0; }
.ol-backup { margin-top: 6px; }
/* "This event is running online" (N5 review): in the layout, not over it */
#online-bar { position: static; left: auto; right: auto; z-index: auto; }
body.admin-body #online-bar ~ .main { padding-top: 0; }
@media (min-width: 901px) {
  .admin:has(> #online-bar) { grid-template-rows: auto minmax(0, 1fr); }
  .admin:has(> #online-bar) > .side { grid-row: 1 / span 2; }
  .admin > #online-bar { grid-column: 2; grid-row: 1; }
  .admin:has(> #online-bar) > .main { grid-column: 2; grid-row: 2; }
}
