/* LGW Finals Week Widget CSS - v7.1.26 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
/* Force light theme by default — dense fixture data reads best on white.    */
/* Dark mode only activates on explicit manual toggle (data-lgw-theme=dark). */
.lgw-finals-wrap {
  font-family: 'Saira', Arial, sans-serif;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
  /* Light theme vars — always applied; dark overrides below for manual toggle */
  --lgw-bg:         #ffffff;
  --lgw-bg-alt:     #f0f2f8;
  --lgw-bg-hover:   #e6e9f5;
  --lgw-border:     #d0d5e8;
  --lgw-navy:       #1a2e5a;
  --lgw-navy-mid:   #243d78;
  --lgw-red:        #c0202a;
  --lgw-gold:       #e8b400;
  --lgw-text:       #1a1a1a;
  --lgw-text-muted: #666666;
  --lgw-win:        #2a7a2a;
  --lgw-shadow:     rgba(0,0,0,.10);
  --lgw-live-bg:    #fff8f0;
  --lgw-live-border:#e06000;
  color: var(--lgw-text);
  background: var(--lgw-bg);
}
.lgw-finals-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Heading ─────────────────────────────────────────────────────────────── */
.lgw-finals-heading {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--lgw-navy);
  padding: 10px 16px;
  border-radius: 6px 6px 0 0;
  letter-spacing: .03em;
}

/* ── Sort toggle ──────────────────────────────────────────────────────────── */
.lgw-finals-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--lgw-bg-soft, #f4f5f9);
  border: 1px solid var(--lgw-border);
  border-top: none;
}
.lgw-finals-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lgw-text-muted);
  margin-right: 2px;
}
.lgw-finals-sort-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--lgw-border);
  border-radius: 999px;
  background: #fff;
  color: var(--lgw-navy);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.lgw-finals-sort-btn.is-active {
  background: var(--lgw-navy);
  color: #fff;
  border-color: var(--lgw-navy);
}

/* ── "By date & rink" view ────────────────────────────────────────────────── */
.lgw-finals-view--date {
  border: 1px solid var(--lgw-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.lgw-finals-daterow {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--lgw-border-soft);
}
.lgw-finals-daterow:last-child { border-bottom: none; }
.lgw-finals-daterow-when {
  flex: 0 0 auto;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lgw-finals-daterow-dt { font-size: 12px; font-weight: 700; color: var(--lgw-navy); }
.lgw-finals-daterow-dt--tbc { color: var(--lgw-text-light); font-weight: 600; font-style: italic; }
.lgw-finals-daterow-rink { font-size: 11px; color: var(--lgw-text-muted); }
.lgw-finals-daterow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lgw-finals-daterow-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.lgw-finals-daterow-comp  { font-size: 12px; font-weight: 700; }
.lgw-finals-daterow-round { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--lgw-text-muted); }
.lgw-finals-daterow-teams { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.lgw-finals-daterow-team.is-win { font-weight: 700; }
.lgw-finals-daterow-score { font-weight: 700; color: var(--lgw-navy); }
.lgw-finals-daterow-vs { color: var(--lgw-text-light); font-size: 12px; }
@media (max-width: 480px) {
  .lgw-finals-daterow { flex-direction: column; gap: 4px; }
  .lgw-finals-daterow-when { flex-direction: row; gap: 10px; min-width: 0; }
}

/* ── Placeholder (source-label) slots in pending matches ──────────────────── */
.lgw-finals-tbd--named { color: var(--lgw-text-muted); font-style: italic; }

/* ── Championship block ──────────────────────────────────────────────────── */
.lgw-finals-champ {
  border: 1px solid var(--lgw-border);
  border-top: none;
  background: var(--lgw-bg);
}
.lgw-finals-champ:last-child { border-radius: 0 0 6px 6px; }

.lgw-finals-champ-header {
  background: var(--lgw-bg-alt);
  border-bottom: 1px solid var(--lgw-border);
  padding: 8px 14px;
}
.lgw-finals-champ-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--lgw-navy);
}

/* ── Round ───────────────────────────────────────────────────────────────── */
.lgw-finals-round-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--lgw-red);
  padding: 5px 14px;
}

/* ── Match card ──────────────────────────────────────────────────────────── */
.lgw-finals-match {
  border-bottom: 1px solid var(--lgw-border);
  padding: 12px 14px;
  background: var(--lgw-bg);
  transition: background .15s;
}
.lgw-finals-match:last-child { border-bottom: none; }
.lgw-finals-match:nth-child(even) { background: var(--lgw-bg-alt); }

.lgw-finals-match--live {
  border-left: 4px solid #e05060;
  background: #fff8f8 !important;
}
.lgw-finals-match--complete {
  border-left: 4px solid var(--lgw-win);
}
.lgw-finals-match--upcoming {
  border-left: 4px solid transparent;
}

/* ── Datetime ────────────────────────────────────────────────────────────── */
.lgw-finals-datetime {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.lgw-finals-datetime-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--lgw-text-muted);
}
.lgw-finals-rink-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--lgw-text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--lgw-surface, #f0f2f8);
}
.lgw-finals-datetime--unset .lgw-finals-edit-dt {
  font-size: 12px;
  color: var(--lgw-text-muted);
  background: none;
  border: 1px dashed var(--lgw-border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
}
.lgw-finals-edit-dt {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: .5;
  transition: opacity .15s;
}
.lgw-finals-edit-dt:hover { opacity: 1; }

/* ── Teams row ───────────────────────────────────────────────────────────── */
.lgw-finals-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.lgw-finals-teams--pending {
  color: var(--lgw-text-muted);
  font-style: italic;
  justify-items: center;
}

.lgw-finals-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--lgw-text);
}
.lgw-finals-team--away {
  flex-direction: row-reverse;
  text-align: right;
}
.lgw-finals-team-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.lgw-finals-team--away .lgw-finals-team-info {
  align-items: flex-end;
}
.lgw-finals-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
}
.lgw-finals-team-name {
  line-height: 1.3;
  white-space: normal;
}
.lgw-finals-team-club {
  font-size: 11px;
  font-weight: 400;
  color: var(--lgw-text-muted);
  line-height: 1.2;
}
.lgw-finals-tbd {
  font-size: 13px;
  color: var(--lgw-text-muted);
}
.lgw-finals-vs {
  font-size: 12px;
  color: var(--lgw-text-muted);
  font-weight: 400;
}

/* ── Score block ─────────────────────────────────────────────────────────── */
.lgw-finals-score-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 90px;
}
.lgw-finals-score {
  font-size: 22px;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  line-height: 1;
  color: var(--lgw-text-muted);
}
.lgw-finals-score--win { color: var(--lgw-navy); }
.lgw-finals-score--live { color: var(--lgw-red); }
.lgw-finals-score-sep {
  font-size: 18px;
  font-weight: 400;
  color: var(--lgw-text-muted);
  padding: 0 2px;
}
.lgw-finals-score-placeholder {
  font-size: 16px;
  color: var(--lgw-text-muted);
  font-weight: 400;
}
.lgw-finals-live-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: #e05060;
  color: #fff;
  border-radius: 3px;
  padding: 2px 5px;
  animation: lgw-finals-pulse 1.4s infinite;
}
@keyframes lgw-finals-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}
.lgw-finals-edit-score {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: .4;
  transition: opacity .15s;
  margin-left: 4px;
}
.lgw-finals-edit-score:hover { opacity: 1; }

/* ── Ends section ────────────────────────────────────────────────────────── */
.lgw-finals-ends {
  margin-top: 10px;
  border-top: 1px solid var(--lgw-border);
  padding-top: 8px;
}
.lgw-finals-ends-empty {
  padding: 4px 0;
}

/* ── Ends toggle header (collapsible) ────────────────────────────────────── */
.lgw-finals-ends-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0 6px;
  user-select: none;
}
.lgw-finals-ends-hdr-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lgw-text-muted);
}
.lgw-finals-ends-hdr-toggle {
  font-size: 11px;
  color: var(--lgw-text-muted);
  transition: transform .2s;
}
.lgw-finals-ends-hdr-toggle.collapsed { transform: rotate(-90deg); }

/* ── Ends body (scrollable) ──────────────────────────────────────────────── */
.lgw-finals-ends-body {
  max-height: 320px;
  overflow-y: auto;
  transition: max-height .25s ease, opacity .2s;
  opacity: 1;
}
.lgw-finals-ends-body.hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
.lgw-finals-ends-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: 'Saira', Arial, sans-serif;
}
.lgw-finals-ends-th {
  background: var(--lgw-navy);
  color: #fff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}
.lgw-finals-ends-th--end {
  text-align: center;
  width: 36px;
}
.lgw-finals-ends-th--end-score { text-align: right; width: 32px; }
.lgw-finals-ends-th--end-score.lgw-finals-ends-th--right { text-align: left; }
.lgw-finals-ends-th--running { text-align: right; width: 36px; color: rgba(255,255,255,.7); font-weight: 400; }
.lgw-finals-ends-th--running.lgw-finals-ends-th--right { text-align: left; }
.lgw-finals-ends-th--name { text-align: left; }
.lgw-finals-ends-th--right { text-align: right; }

.lgw-finals-ends-td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--lgw-border);
  color: var(--lgw-text);
}
.lgw-finals-ends-td--end { text-align: center; color: var(--lgw-text-muted); font-size: 11px; }
.lgw-finals-ends-td--end-score { text-align: right; font-weight: 700; padding: 4px 4px; }
.lgw-finals-ends-td--end-score.lgw-finals-ends-td--right { text-align: left; }
.lgw-finals-ends-td--running { text-align: right; font-size: 11px; color: var(--lgw-text-muted); padding: 4px 4px; }
.lgw-finals-ends-td--running.lgw-finals-ends-td--right { text-align: left; }
.lgw-finals-ends-td--score { text-align: left; font-weight: 700; }
.lgw-finals-ends-td--right { text-align: right; }
.lgw-finals-ends-td--total {
  font-weight: 800;
  font-size: 13px;
  background: var(--lgw-bg-alt);
  border-top: 2px solid var(--lgw-border);
  border-bottom: none;
}
.lgw-finals-ends-td.win { color: var(--lgw-win); }

.lgw-finals-ends-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.lgw-finals-add-end-btn,
.lgw-finals-del-end-btn,
.lgw-finals-quick-btn,
.lgw-finals-reset-btn {
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid var(--lgw-border);
  cursor: pointer;
  background: var(--lgw-bg);
  color: var(--lgw-navy);
  transition: background .15s;
}
.lgw-finals-add-end-btn:hover,
.lgw-finals-quick-btn:hover { background: var(--lgw-navy); color: #fff; border-color: var(--lgw-navy); }
.lgw-finals-del-end-btn { color: var(--lgw-red); border-color: var(--lgw-red); }
.lgw-finals-del-end-btn:hover { background: var(--lgw-red); color: #fff; }
.lgw-finals-reset-btn { color: var(--lgw-red); border-color: var(--lgw-red); }
.lgw-finals-reset-btn:hover { background: var(--lgw-red); color: #fff; }

/* Summary (quick-score) live panel */
.lgw-finals-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--lgw-live-bg, #fff6e6);
  border: 1px solid var(--lgw-live-border, #e0b050);
  border-radius: 5px;
}
.lgw-finals-summary-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--lgw-text-muted); }
.lgw-finals-summary-score { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lgw-finals-summary-sep { margin: 0 6px; color: var(--lgw-text-muted); }
.lgw-finals-summary-val.win { color: var(--lgw-win); }
.lgw-finals-pop-hint { font-size: 11px; color: var(--lgw-text-muted); margin: 2px 0 6px; }

/* Summary-baseline row inside the running-total table */
.lgw-finals-ends-tr--summary td {
  background: var(--lgw-live-bg, #fff6e6);
  font-style: italic;
}
.lgw-finals-ends-tr--summary .lgw-finals-ends-td--end { font-style: normal; font-weight: 700; }
.lgw-finals-complete-btn {
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 5px 14px;
  border-radius: 4px;
  border: 1px solid var(--lgw-win);
  cursor: pointer;
  background: var(--lgw-win);
  color: #fff;
  margin-left: auto;
  transition: opacity .15s;
}
.lgw-finals-complete-btn:hover { opacity: .85; }

/* ── Popover ─────────────────────────────────────────────────────────────── */
.lgw-finals-pop {
  position: absolute;
  z-index: 99999;
  background: var(--lgw-bg, #fff);
  color: var(--lgw-text, #1a1a1a);
  border: 1px solid var(--lgw-border, #d0d5e8);
  border-radius: 9px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  padding: 14px 16px 12px;
  min-width: 260px;
  font-family: 'Saira', Arial, sans-serif;
}
.lgw-finals-pop-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--lgw-navy, #1a2e5a);
  margin-bottom: 4px;
}
.lgw-finals-pop-subtitle {
  font-size: 12px;
  color: var(--lgw-text-muted, #666);
  margin-bottom: 10px;
}
.lgw-finals-pop-row {
  margin-bottom: 10px;
}
.lgw-finals-pop-row--rink {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lgw-finals-pop-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lgw-text-muted, #666);
  white-space: nowrap;
}
.lgw-finals-pop-input--rink {
  width: 80px;
}
.lgw-finals-pop-row--ends {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lgw-finals-pop-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--lgw-border, #d0d5e8);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  color: var(--lgw-text, #1a1a1a);
  background: var(--lgw-bg, #fff);
}
.lgw-finals-pop-input--end {
  width: 44px;
  padding: 6px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
/* Narrow quick/summary popover with wrapping help text */
.lgw-finals-pop--quick {
  min-width: 0;
  width: 210px;
}
.lgw-finals-pop--quick .lgw-finals-pop-hint {
  white-space: normal;
  line-height: 1.35;
}
.lgw-finals-pop--quick .lgw-finals-pop-input--rink { width: 64px; }
.lgw-finals-pop-input:focus { outline: none; border-color: var(--lgw-navy, #1a2e5a); }
.lgw-finals-pop-vs {
  font-size: 16px;
  color: var(--lgw-text-muted, #666);
  flex-shrink: 0;
}
.lgw-finals-pop-end-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--lgw-text-muted, #666);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgw-finals-pop-end-label--right { text-align: right; }
.lgw-finals-pop-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.lgw-finals-pop-save {
  flex: 1;
  padding: 8px;
  background: var(--lgw-navy, #1a2e5a);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.lgw-finals-pop-save:hover { opacity: .9; }
.lgw-finals-pop-cancel {
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--lgw-border, #d0d5e8);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--lgw-text-muted, #666);
}
.lgw-finals-pop-clear {
  padding: 8px 10px;
  background: none;
  border: 1px solid var(--lgw-red, #c0202a);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--lgw-red, #c0202a);
  margin-left: auto;
}
.lgw-finals-pop-clear:hover { background: var(--lgw-red, #c0202a); color: #fff; }
.lgw-finals-pop-msg {
  font-size: 11px;
  color: var(--lgw-red, #c0202a);
  margin-top: 6px;
  min-height: 14px;
}

/* ── Dark mode — only on explicit manual toggle, not OS preference ───────── */
:root[data-lgw-theme="dark"] .lgw-finals-wrap {
  --lgw-bg:         #1e1e2e;
  --lgw-bg-alt:     #2a2a3e;
  --lgw-bg-hover:   #32324a;
  --lgw-border:     #3a3a55;
  --lgw-navy:       #4a6fa5;
  --lgw-text:       #e8e8f0;
  --lgw-text-muted: #aaaacc;
  --lgw-win:        #4aaa4a;
  --lgw-red:        #e05060;
  --lgw-live-bg:    #2a1e10;
  --lgw-live-border:#e06000;
}
.lgw-finals-match--live {
  border-left-color: var(--lgw-live-border) !important;
  background: var(--lgw-live-bg) !important;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lgw-finals-team { font-size: 12px; gap: 5px; }
  .lgw-finals-badge { width: 22px; height: 22px; }
  .lgw-finals-score { font-size: 18px; }
  .lgw-finals-teams { grid-template-columns: 1fr auto 1fr; gap: 4px; }
  .lgw-finals-ends-th, .lgw-finals-ends-td { padding: 3px 5px; font-size: 11px; }
}

/* Admin draw-editing controls on pending slots (Group Championship). The
   gchamp stylesheet is not loaded on this page, so style them here too. */
.lgw-gchamp-finals-seed-btn,
.lgw-gchamp-finals-occ-btn {
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  opacity: .75;
}
.lgw-gchamp-finals-seed-btn:hover,
.lgw-gchamp-finals-occ-btn:hover { opacity: 1; }
.lgw-gchamp-finals-seed-form,
.lgw-gchamp-finals-occ-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  vertical-align: middle;
}
.lgw-gchamp-finals-seed-select,
.lgw-gchamp-finals-occ-select {
  max-width: 190px;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  color: #111;
}
.lgw-gchamp-finals-seed-save,
.lgw-gchamp-finals-seed-cancel,
.lgw-gchamp-finals-occ-save,
.lgw-gchamp-finals-occ-cancel {
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 4px;
  background: rgba(255, 255, 255, .15);
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ── Disc-colour chips (identify each side of a finals match) ─────────────── */
.lgw-finals-disc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--lgw-text-muted);
}
.lgw-finals-team--away .lgw-finals-disc { flex-direction: row-reverse; }
.lgw-finals-disc-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset;
  flex-shrink: 0;
}
.lgw-finals-disc-label { letter-spacing: .02em; }

/* Bulk disc-convention control in the championship header (admin only) */
.lgw-finals-disc-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  font-size: 12px;
}
.lgw-finals-disc-ctrl-label { font-weight: 600; }
.lgw-finals-disc-ctrl label { display: inline-flex; align-items: center; gap: 3px; }
.lgw-finals-disc-select { font-size: 12px; padding: 1px 3px; }
.lgw-finals-disc-save {
  padding: 1px 8px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lgw-finals-disc-save:disabled { opacity: .6; cursor: default; }
.lgw-finals-disc-status { font-size: 11px; opacity: .85; }

@media (max-width: 600px) {
  .lgw-finals-disc-ctrl { margin-left: 0; margin-top: 6px; flex-wrap: wrap; }
}

/* ── LED scoreboard view ────────────────────────────────────────────────── */
/* DSEG7 seven-segment webfont (SIL OFL) for the LED digits. Bundled under
   fonts/dseg/; url() resolves relative to this stylesheet (plugin root). */
@font-face {
  font-family: "DSEG7Classic";
  src: url("fonts/dseg/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DSEG7Classic";
  src: url("fonts/dseg/DSEG7Classic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.lgw-finals-view--board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  background: #0a0e14;
  padding: 16px;
  border-radius: 10px;
}
.lgw-finals-led {
  background: linear-gradient(#12161d, #0d1117);
  border: 1px solid #1e2733;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: inset 0 0 24px rgba(0,0,0,.6);
  font-family: "DSEG7", "Courier New", ui-monospace, monospace;
}
.lgw-finals-led-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 10px;
  font-family: system-ui, -apple-system, sans-serif;
}
.lgw-finals-led-comp { color: #8fd0ff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.lgw-finals-led-round { color: #5b6b7d; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.lgw-finals-led-rink { color: #5b6b7d; font-size: 11px; margin-left: auto; }
.lgw-finals-led-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.lgw-finals-led-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lgw-finals-led-team {
  color: #cdd8e3;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.lgw-finals-led-club {
  color: #6b7d90;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lgw-finals-led-num {
  position: relative;
  flex: none;
  font-family: "DSEG7Classic", "Courier New", ui-monospace, monospace;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #ff6b1a;
  text-shadow: 0 0 6px rgba(255,107,26,.75), 0 0 14px rgba(255,107,26,.45);
  min-width: 1.8em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Ghost "off" segments: a faint all-lit 88 behind the real digits, so an
   unlit display still reads as a powered 7-seg panel. Live/final only — the
   digits there are DSEG7 and always two chars. */
.lgw-finals-led--live .lgw-finals-led-num::before,
.lgw-finals-led--final .lgw-finals-led-num::before {
  content: "88";
  position: absolute;
  right: 0;
  top: 0;
  z-index: -1;
  text-shadow: none;
  pointer-events: none;
}
/* Amber ghost behind live digits, green ghost behind completed finals. Explicit
   rgba (not inherit+opacity) so the green ghost is actually visible on the dark
   panel rather than washing out. */
.lgw-finals-led--live .lgw-finals-led-num::before  { color: rgba(255,107,26,.16); }
.lgw-finals-led--final .lgw-finals-led-num::before { color: rgba(72,224,138,.2); }
.lgw-finals-led-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #1a222c;
  font-family: system-ui, -apple-system, sans-serif;
}
.lgw-finals-led-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #5b6b7d;
}
.lgw-finals-led-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 6px #ff3b3b;
  animation: lgw-finals-pulse 1.4s infinite;
}
/* State tints */
.lgw-finals-led--live { border-color: #7a2a1a; }
.lgw-finals-led--live .lgw-finals-led-status { color: #ff6b6b; }
.lgw-finals-led--final .lgw-finals-led-num { color: #48e08a; text-shadow: 0 0 6px rgba(72,224,138,.7), 0 0 14px rgba(72,224,138,.4); }
.lgw-finals-led--final .lgw-finals-led-status { color: #48e08a; }

/* ── Conditions of Play view ─────────────────────────────────────────────── */
.lgw-finals-cond-toolbar { margin-bottom: 12px; }
.lgw-finals-cond-edit {
  background: var(--lgw-navy, #16324f);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lgw-finals-cond-body {
  line-height: 1.55;
  color: #1f2a36;
  max-width: 820px;
}
.lgw-finals-cond-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--lgw-navy, #16324f);
  margin: 22px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid #e4e9ef;
}
.lgw-finals-cond-body h4 {
  font-size: 14px;
  font-weight: 700;
  color: #33475b;
  margin: 14px 0 4px;
}
.lgw-finals-cond-body ul,
.lgw-finals-cond-body ol { margin: 6px 0 12px; padding-left: 22px; }
.lgw-finals-cond-body li { margin: 4px 0; }
.lgw-finals-cond-body p { margin: 8px 0; }
.lgw-finals-cond-body > *:first-child { margin-top: 0; }
.lgw-finals-cond-hint { font-size: 12px; color: #64748b; margin: 0 0 8px; }
.lgw-finals-cond-hint code { background: #eef2f6; padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.lgw-finals-cond-text {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
  border: 1px solid #c7d0da;
  border-radius: 6px;
  resize: vertical;
}
.lgw-finals-cond-actions { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.lgw-finals-cond-save {
  background: #2f9e6b; color: #fff; border: none; border-radius: 5px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lgw-finals-cond-save:disabled { opacity: .6; cursor: default; }
.lgw-finals-cond-cancel {
  background: none; border: 1px solid #c7d0da; border-radius: 5px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; color: #33475b;
}
.lgw-finals-cond-status { font-size: 12px; color: #64748b; }
.lgw-finals-led--upcoming .lgw-finals-led-num { color: #46586a; text-shadow: none; }
