:root {
  color-scheme: dark;
  --bg: #0f0e0c;
  --ink: #f3efe7;
  --muted: #aaa29a;
  --line: #38342d;
  --panel: #191715;
  --panel-soft: #24211d;
  --field: #11100e;
  --teal: #32b89b;
  --teal-dark: #238a75;
  --amber: #d09a45;
  --red: #ff7468;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(50, 184, 155, 0.08), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

.data-server-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 116, 104, 0.55);
  background: #3a1815;
  color: #ffe8e4;
  text-align: center;
}

.data-server-notice strong {
  color: #fff;
  white-space: nowrap;
}

.data-server-notice code {
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
}

.data-server-notice.hidden {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  background: rgba(20, 18, 16, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11100e;
}

.nav-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--ink);
  background: #2a2621;
}

.nav-tab.active,
.nav-tab[aria-pressed="true"] {
  background: var(--teal);
  color: #07110f;
}

.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #08110f;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.brand p,
.table-head p,
.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions > .section-action {
  display: none;
}

body.section-funbridge .top-actions > .funbridge-action,
body.section-bbo .top-actions > .bbo-action,
body.section-hands .top-actions > .hands-action {
  display: inline-flex;
}

body.section-funbridge .top-actions > select.funbridge-action,
body.section-bbo .top-actions > select.bbo-action,
body.section-hands .top-actions > select.hands-action {
  display: block;
}

.folder-select {
  width: min(420px, 42vw);
  height: 36px;
}

.deal-select {
  width: min(360px, 36vw);
}

.button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
}

.button:hover,
.icon-button:hover {
  border-color: #6b6255;
  background: #2d2924;
}

.button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #07110f;
}

.button.primary:hover {
  background: var(--teal-dark);
}

.button.danger {
  color: var(--red);
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

main {
  display: grid;
  gap: 14px;
  padding: 16px 20px 28px;
}

.control-band,
.insight-band,
.bbo-results-band,
.deal-band,
.final-analysis-band,
.boards-band,
.table-band {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.control-band,
.bbo-results-band,
.deal-band,
.final-analysis-band,
.boards-band,
.table-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-band {
  padding: 12px;
}

.snapshot-row {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.curl-import {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141210;
}

.curl-field {
  display: grid;
  gap: 6px;
}

.curl-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.curl-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 9px 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.curl-field textarea:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(50, 184, 155, 0.25);
  outline-offset: 1px;
}

.curl-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 118px;
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field.wide {
  min-width: 320px;
  flex: 1;
}

.field.year {
  min-width: 130px;
  flex: 0 0 150px;
}

.field.search {
  min-width: 150px;
  flex: 0 1 180px;
}

.field.country {
  min-width: 190px;
  flex: 0 1 220px;
}

.field.narrow {
  min-width: 76px;
  flex: 0 0 82px;
}

input,
select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
}

input::placeholder {
  color: #756f68;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--teal);
  outline: 2px solid rgba(50, 184, 155, 0.25);
  outline-offset: 1px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 70px;
  background: #1f1c18;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.filters {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 940px;
}

.filters input,
.filters select {
  height: 30px;
  padding: 0 7px;
}

.filters .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.reset-filters {
  flex: 0 0 auto;
}

.insight-band {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 14px;
}

.bbo-results-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.bbo-result-wrap {
  max-height: 540px;
}

.bbo-result-wrap:first-child {
  border-right: 1px solid var(--line);
}

.panel-head.compact {
  min-height: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #191713;
}

.panel-head.compact h3 {
  margin: 0;
  font-size: 14px;
}

.insight-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 190px;
}

.panel-head,
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 12px;
}

.bars {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(40px, 72px) 1fr minmax(42px, auto);
  align-items: center;
  gap: 8px;
}

.bar-label,
.bar-value {
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.near-list {
  display: grid;
  gap: 6px;
}

.near-row {
  display: grid;
  grid-template-columns: 52px 1fr 72px 56px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid #2d2924;
  font-size: 13px;
}

.near-row.mine {
  color: var(--teal);
  font-weight: 700;
}

.table-band {
  overflow: hidden;
}

.deal-band {
  overflow: hidden;
}

body.section-funbridge .deal-band,
body.section-bbo .deal-band {
  display: none;
}

.final-analysis-band {
  overflow: hidden;
}

body:not(.final-analysis-mode) .final-analysis-band {
  display: none;
}

body:not(.boards-mode) .boards-band {
  display: none;
}

body.final-analysis-mode .metrics,
body.final-analysis-mode .filters,
body.final-analysis-mode .insight-band,
body.final-analysis-mode .bbo-results-band,
body.final-analysis-mode .deal-band,
body.final-analysis-mode .boards-band,
body.final-analysis-mode .table-band {
  display: none;
}

body.boards-mode .metrics,
body.boards-mode .filters,
body.boards-mode .insight-band,
body.boards-mode .bbo-results-band,
body.boards-mode .deal-band,
body.boards-mode .final-analysis-band,
body.boards-mode .table-band {
  display: none;
}

.boards-band {
  overflow: hidden;
}

.boards-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.boards-head-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.board-filter-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(210px, 1.35fr) repeat(4, minmax(135px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.board-filter {
  min-width: 0;
}

.board-design-filter select {
  border-color: rgba(50, 184, 155, 0.65);
}

.board-view-filter select {
  border-color: rgba(202, 165, 92, 0.72);
}

.board-pivot-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(50, 184, 155, 0.35);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(50, 184, 155, 0.08), transparent);
}
.board-pivot-panel[hidden] { display: none; }
.board-pivot-field { flex: 1 1 240px; min-width: 0; max-width: 380px; }
.board-pivot-panel .button { align-self: flex-end; }
.board-pivot-panel p { flex: 1 1 280px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.board-round-overview-panel {
  margin: 16px;
  border: 1px solid rgba(202, 165, 92, 0.38);
  border-radius: 12px;
  background: #12110f;
  overflow: hidden;
}

.board-round-overview-panel[hidden] {
  display: none;
}

.board-round-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(202, 165, 92, 0.09), rgba(50, 184, 155, 0.055));
}

.board-round-overview-head h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.board-round-overview-head p {
  margin: 0;
  color: var(--muted);
}

.board-round-player-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 8px;
  width: min(980px, 72%);
}

.round-empty { grid-column: 1 / -1; }

.board-round-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 315px), 340px));
  justify-content: center;
  gap: 12px;
  padding: 12px;
}

.round-board-card {
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #181612;
  overflow: hidden;
}

.round-board-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #211e1a;
}

.round-board-card > header div {
  display: grid;
  gap: 2px;
}

.round-board-card > header span {
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
}

.round-board-card > header small {
  color: var(--muted);
}

.round-board-card > header .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.round-mini-board {
  --round-hand-width: 132px;
  --round-center-size: 64px;
  --round-danger-bg: #f1d5d2;
  --round-danger-ink: #8d343b;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--round-center-size) minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-items: center;
  align-content: start;
  gap: 4px;
  padding: 8px 4px;
  color: #233b32;
  background: linear-gradient(145deg, #f4f2e9, #e9eee6);
}

.round-mini-hand {
  width: min(100%, var(--round-hand-width));
  min-width: 0;
  padding: 6px;
  border: 1px solid #dce0d5;
  border-radius: 7px;
  background: #fffef8;
  box-shadow: 0 2px 4px #2b403908;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.round-mini-hand-north { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
.round-mini-hand-west { grid-column: 1; grid-row: 2; justify-self: end; }
.round-mini-hand-east { grid-column: 3; grid-row: 2; justify-self: start; }
.round-mini-hand-south { grid-column: 1 / -1; grid-row: 3; justify-self: center; }

.round-mini-hand > strong {
  display: table;
  width: fit-content;
  margin: -1px 0 5px -3px;
  padding: 1px 3px;
  border-radius: 3px;
  color: #527165;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}
.round-mini-hand > strong.vulnerable { background: var(--round-danger-bg); color: var(--round-danger-ink); }
.round-suit {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  min-height: 19px;
  align-items: baseline;
  line-height: 1.4;
}
.round-suit.red-suit { color: #ac344b; }
.round-suit i { font-style: normal; font-weight: 650; font-size: 14px; line-height: 1; }
.round-suit-ranks { min-width: 0; white-space: normal; overflow-wrap: normal; }

.round-mini-center {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  place-self: center;
  width: var(--round-center-size);
  aspect-ratio: 1;
  border: 1px solid #a5b6a7;
  border-radius: 50%;
  background: #e6ede3;
  color: #244d3c;
}
.round-mini-center > strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 21px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.round-direction { position: absolute; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; color: #527165; font-size: 9px; font-weight: 600; line-height: 1; }
.round-direction-n { top: 2px; left: 50%; transform: translateX(-50%); }
.round-direction-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.round-direction-w { left: 2px; top: 50%; transform: translateY(-50%); }
.round-direction-e { right: 2px; top: 50%; transform: translateY(-50%); }
.round-direction.vulnerable { background: var(--round-danger-bg); color: var(--round-danger-ink); }
.round-direction.is-dealer { text-decoration-thickness: 1px; text-underline-offset: 2px; }

@container (max-width: 335px) {
  .round-mini-board { --round-center-size: 58px; }
  .round-mini-hand { padding: 6px; font-size: 12px; }
  .round-suit { grid-template-columns: 12px minmax(0, 1fr); gap: 3px; min-height: 18px; }
  .round-mini-center > strong { font-size: 18px; }
  .round-direction { width: 13px; height: 13px; font-size: 8px; border-radius: 3px; }
}

.board-round-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.round-theme-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 6px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.round-switch-track { width: 34px; height: 20px; padding: 3px; border-radius: 20px; background: #625f58; }
.round-switch-track::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 150ms; }
.round-theme-toggle[aria-checked="true"] .round-switch-track { background: #248b75; }
.round-theme-toggle[aria-checked="true"] .round-switch-track::after { transform: translateX(14px); }
.round-theme-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 4px; }
.round-dark .round-mini-board { --round-danger-bg: #59373d; --round-danger-ink: #ffd0d4; color: #e3e9df; background: linear-gradient(145deg, #172a22, #1b3027); }
.round-dark .round-mini-hand { background: #24372c; border-color: #405347; box-shadow: none; }
.round-dark .round-mini-hand > strong:not(.vulnerable), .round-dark .round-direction:not(.vulnerable) { color: #b8cebd; }
.round-dark .round-suit.red-suit { color: #f4a4b2; }
.round-dark .round-mini-center { background: #1b3024; border-color: #647f6a; color: #e3e9df; }


/* The preview and the printed sheet share physical dimensions. */
#roundPrintOutput { display: none; }
.round-print-dialog { width: min(860px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #514d42; border-radius: 12px; background: #252621; color: var(--ink); }
.round-print-dialog[open] { display: flex; flex-direction: column; }
.round-print-dialog::backdrop { background: #060b09c9; }
.round-print-dialog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; }
.round-print-dialog-head > div { flex: 1; min-width: 210px; display: grid; gap: 4px; }
.round-print-dialog-head strong { font-size: 18px; }
.round-print-dialog-head span { font-size: 12px; color: #b7b9ae; }
.round-print-preview { overflow: auto; padding: 20px; background: #4c5048; }
.round-print-sheet { box-sizing: border-box; width: 196mm; height: 281mm; margin: 0 auto; background: #fff; color: #15251d; font-family: Arial, sans-serif; }
.round-print-preview .round-print-sheet { outline: 3mm solid #fff; box-shadow: 0 3px 18px #0005; }
.round-print-preview .round-print-sheet:not(:last-child) { margin-bottom: 10mm; }
.round-print-heading { height: 7mm; margin-bottom: 3mm; display: flex; align-items: center; justify-content: space-between; gap: 3mm; border-bottom: 0.3mm solid #526857; }
.round-print-heading strong { font-size: 11pt; letter-spacing: 0.2mm; }
.round-print-heading > span { font-size: 8pt; }
.round-print-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, 65mm); gap: 2mm; }
.round-print-footer { display: flex; align-items: center; justify-content: space-between; height: 5mm; font-size: 6pt; color: #445047; }
.round-print-sheet .round-board-card { container-type: normal; grid-template-rows: 4.5mm minmax(0, 1fr) 18mm; border: 0.2mm solid #a2afa4; border-radius: 1mm; background: #fff; color: #15251d; }
.round-print-sheet .round-board-card > header { padding: 0.3mm 1mm; border-bottom: 0.2mm solid #c5ccc3; background: #f3f5ef; }
.round-print-sheet .round-board-card > header span { color: #15251d; font-size: 7pt; }
.round-print-sheet .round-mini-board {
  --round-center-size: 13mm;
  --round-danger-bg: #f1d5d2;
  --round-danger-ink: #8d343b;
  /* Equal outer rows keep the compass on the diagram's horizontal axis. */
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.8mm 1.2mm;
  padding: 0.8mm 1.2mm;
  background: #fff;
  color: #15251d;
}
.round-print-sheet .round-mini-hand {
  /* Center the visible cards, without the screen layout's empty hand width. */
  width: max-content;
  max-width: 100%;
  padding: 0.3mm 0.5mm;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-size: 7pt;
}
.round-print-sheet .round-mini-hand-north,
.round-print-sheet .round-mini-hand-south { max-width: 34mm; }
.round-print-sheet .round-mini-hand > strong { display: none; }
.round-print-sheet .round-suit { grid-template-columns: 2.4mm minmax(0, 1fr); gap: 0.5mm; min-height: 2.7mm; line-height: 1.1; }
.round-print-sheet .round-suit i { font-size: 7.5pt; }
.round-print-sheet .round-suit.red-suit { color: #a52d42; }
.round-print-sheet .round-mini-center { background: #f4f5ef; border: 0.2mm solid #9bab9c; color: #15251d; }
.round-print-sheet .round-mini-center > strong { font-size: 9pt; }
.round-print-sheet .round-direction { width: 3mm; height: 3mm; border-radius: 0.6mm; font-size: 5.5pt; color: #415c49; }
.round-print-sheet .round-direction.vulnerable { color: #8d343b; outline: 0.15mm solid #bf8589; }
.round-print-sheet .round-player-results { border-top: 0.2mm solid #c5ccc3; background: #c5ccc3; gap: 0.2mm; }
.round-print-sheet .round-player-result { align-content: start; gap: 0.4mm; padding: 0.7mm 0.6mm; background: #fff; }
.round-print-sheet .round-player-result strong,
.round-print-sheet .round-player-result span,
.round-print-sheet .round-player-result small { overflow: visible; white-space: normal; text-overflow: clip; color: #15251d; font-size: 6.5pt; line-height: 1.15; }
.round-print-sheet .round-player-result small { font-size: 6pt; }
.round-print-sheet .round-player-result strong { min-height: 5.3mm; overflow-wrap: anywhere; }
.round-print-sheet .round-player-result span { min-height: 5.2mm; }

.round-player-results {
  display: grid;
  grid-template-columns: repeat(var(--round-player-count), minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.round-player-result {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  background: #191713;
}

.round-player-result strong,
.round-player-result span,
.round-player-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-player-result strong {
  color: var(--ink);
  font-size: 11px;
}

.round-player-result span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.round-player-result small {
  color: var(--muted);
  font-size: 10px;
  white-space: normal;
}

.round-player-result.missing span {
  color: var(--muted);
}

.board-dossier {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.8fr);
  gap: 14px 24px;
  margin: 16px 16px 0;
  padding: 16px;
  border: 1px solid rgba(50, 184, 155, 0.36);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(50, 184, 155, 0.09), rgba(202, 165, 92, 0.045));
}

.board-dossier-title {
  display: grid;
  align-content: start;
  gap: 3px;
}

.board-dossier-title strong {
  font-size: 16px;
}

.board-dossier-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  gap: 8px;
}

.board-dossier-facts > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 16, 14, 0.72);
}

.board-dossier-facts small,
.board-dossier > p {
  color: var(--muted);
}

.board-dossier > p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.board-design-gallery {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.board-design-gallery.single-design {
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}

.board-comparison-panel {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12110f;
  overflow: hidden;
}

.board-comparison-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.board-comparison-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.board-comparison-head p {
  margin: 0;
  color: var(--muted);
}

.board-player-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  min-width: min(620px, 55%);
}

.board-comparison-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.board-comparison-cards.two-results {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
}

.board-score-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(260px, 1.25fr);
  gap: 18px;
  padding: 16px 16px 16px 54px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #191713;
}

.board-score-label {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #07110f;
  font-weight: 900;
}

.board-score-card > div {
  display: grid;
  align-content: center;
  gap: 5px;
}

.board-score-card small,
.board-score-card dt,
.board-score-delta small,
.board-score-delta span {
  color: var(--muted);
}

.board-score-card > div strong {
  color: var(--gold);
  font-size: 19px;
}

.board-score-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0;
}

.board-score-card dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.board-score-delta {
  min-width: 100px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  text-align: center;
}

.board-score-delta strong {
  font-size: 18px;
}

.board-replay-panel {
  container-type: inline-size;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12110f;
  overflow: hidden;
}

.board-replay-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.board-replay-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.board-replay-head p {
  margin: 0;
  color: var(--muted);
}

.board-replay-player-field {
  min-width: min(460px, 48%);
}

.board-replay-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.board-replay-meta > span {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  background: #191713;
}

.board-replay-meta small {
  color: var(--muted);
}

.board-replay-meta strong {
  color: var(--gold);
}

.board-replay-controls {
  display: grid;
  grid-template-columns: repeat(3, auto) minmax(180px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #17140f;
}

.board-replay-controls input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.board-replay-stage {
  padding: 16px;
}

.replay-table {
  --replay-hand-width: 164px;
  --replay-trick-size: 192px;
  --danger-bg: #efd0cd;
  --danger-ink: #832e32;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--replay-trick-size) minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 9px;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  border: 2px solid #547567;
  border-radius: 22px;
  background: radial-gradient(ellipse at center, #225d49, #113e2f 72%, #103428);
  box-shadow: inset 0 0 25px #082a2240;
}

.replay-hand {
  width: min(100%, var(--replay-hand-width));
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #ddd6c4;
  border-radius: 8px;
  background: #f4f0e3;
  color: #222b24;
  box-shadow: 0 2px 6px #061d1733;
}

.replay-hand.is-next { border-color: #72d8b7; box-shadow: 0 0 0 2px #72d8b7; }
.replay-hand-heading { display: flex; align-items: baseline; gap: 6px; padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid #d9d6c8; }
.replay-hand-heading strong { flex-shrink: 0; font-size: 12px; border-radius: 4px; padding: 1px 3px; margin-left: -3px; }
.replay-hand-heading .vulnerable { background: var(--danger-bg); color: var(--danger-ink); }
.replay-hand-heading > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #697065; font-size: 10px; }
.replay-hand .board-suit { grid-template-columns: 17px minmax(0, 1fr); gap: 4px; color: #222b24; }
.replay-hand .board-suit.red-suit { color: #ad2e45; }
.replay-hand-north { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
.replay-hand-west { grid-column: 1; grid-row: 2; justify-self: end; }
.replay-hand-east { grid-column: 3; grid-row: 2; justify-self: start; }
.replay-hand-south { grid-column: 1 / -1; grid-row: 3; justify-self: center; }

/* Seat positions are fixed even when a trick contains only one or two cards. */
.replay-current-trick {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  grid-template-areas: ". north ." "west caption east" ". south .";
  place-items: center;
  width: var(--replay-trick-size);
  aspect-ratio: 1;
  padding: 6px;
  border: 1px solid #89b49d66;
  border-radius: 50%;
  background: #0b302680;
  color: #f6f2e7;
  text-align: center;
}

.replay-trick-caption { grid-area: caption; display: grid; gap: 1px; }
.replay-trick-caption small { color: #b7cec0; font-size: 10px; }
.replay-trick-caption strong { font-size: 23px; line-height: 1.1; font-weight: 600; }
.replay-play { display: grid; gap: 2px; justify-items: center; }
.replay-play-n { grid-area: north; }
.replay-play-e { grid-area: east; }
.replay-play-s { grid-area: south; }
.replay-play-w { grid-area: west; }
.replay-play i { color: #c5d9ce; font-size: 10px; line-height: 1; font-weight: 600; font-style: normal; }
.replay-card,
.replay-card-slot {
  display: inline-grid;
  width: 38px;
  height: 46px;
  place-items: center;
  padding: 2px;
  border: 1px solid #d9d1c3;
  border-radius: 5px;
  background: #fffdf8;
  color: #1c251e;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 5px #001d1640;
}
.replay-card-slot { background: #d2f1dc06; border: 1px dashed #b5d4c42b; box-shadow: none; }
.replay-card.red-suit { color: #b22943; }
.replay-play.is-latest .replay-card { border-color: #60cda7; box-shadow: 0 0 0 1px #60cda7; }
.replay-card.trick-winner { outline: 2px solid var(--amber); outline-offset: 1px; }
.replay-turn-status { margin: 9px 0 0; text-align: center; color: #bad1c3; font-size: 12px; }

@container (max-width: 640px) {
  .replay-table { --replay-hand-width: 152px; --replay-trick-size: 162px; padding: 12px; gap: 7px; }
  .replay-current-trick .replay-card,
  .replay-current-trick .replay-card-slot { width: 30px; height: 36px; font-size: 12px; }
  .replay-trick-caption strong { font-size: 20px; }
}

@container (max-width: 460px) {
  .board-replay-stage { padding: 8px; }
  .replay-table { --replay-trick-size: 108px; padding: 10px 6px; gap: 4px; border-radius: 16px; }
  .replay-hand { padding: 6px; }
  .replay-hand-heading { flex-wrap: wrap; gap: 1px 4px; }
  .replay-hand-heading > span { flex-basis: 100%; font-size: 9px; }
  .replay-hand .board-suit { grid-template-columns: 12px minmax(0, 1fr); gap: 2px; font-size: 12px; min-height: 20px; }
  .replay-hand .board-suit > span:first-child { font-size: 14px; }
  .replay-current-trick { padding: 3px; }
  .replay-current-trick .replay-card,
  .replay-current-trick .replay-card-slot { width: 23px; height: 25px; font-size: 10px; border-radius: 3px; }
  .replay-play { gap: 1px; }
  .replay-play i { font-size: 8px; }
  .replay-trick-caption small { font-size: 8px; }
  .replay-trick-caption strong { font-size: 16px; }
}


.replay-details {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  max-width: 1120px;
  margin: 16px auto 0;
}

.replay-details section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #191713;
}

.replay-details h4 {
  margin: 0 0 10px;
  color: var(--gold);
}

.replay-auction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.replay-auction-list > span {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #11100e;
}

.replay-auction-list small {
  color: var(--muted);
}

.replay-trick-history {
  display: grid;
  gap: 7px;
  max-height: 330px;
  overflow: auto;
}

.replay-trick-history > div {
  display: grid;
  grid-template-columns: 24px repeat(4, minmax(45px, auto)) 28px;
  align-items: center;
  gap: 6px;
}

.replay-trick-history .replay-card {
  min-width: 34px;
  min-height: 38px;
  font-size: 12px;
}

.replay-trick-history small {
  color: var(--gold);
  font-weight: 800;
}

@media (max-width: 900px) {
  .board-replay-head {
    align-items: stretch;
    flex-direction: column;
  }

  .board-replay-player-field {
    min-width: 0;
  }

  .board-replay-controls {
    grid-template-columns: repeat(3, 1fr);
  }

  .board-replay-controls input[type="range"] {
    grid-column: 1 / -1;
    grid-row: 1;
  }



  .replay-details {
    grid-template-columns: 1fr;
  }
}

.board-results-panel {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12110f;
  overflow: hidden;
}

.board-results-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.board-results-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.board-results-head p {
  margin: 0;
  color: var(--muted);
}

.board-results-wrap {
  max-height: 520px;
  margin: 0;
}

.board-results-wrap table {
  min-width: 620px;
}

.board-results-wrap thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #181511;
}

.board-design-card {
  --board-hand-width: 168px;
  --board-compass-size: 104px;
  --board-rule: #383e38;
  --board-surface: #191c18;
  --board-text: #f3efe7;
  --board-muted: #b2b3a7;
  --direction-bg: #edece3;
  --direction-ink: #27352e;
  --danger-bg: #efd0cd;
  --danger-ink: #832e32;
  min-width: 0;
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121410;
  color: var(--board-text);
  overflow: hidden;
  break-inside: avoid;
}

.board-design-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--board-rule);
}

.board-design-title > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #07110f;
  font-size: 12px;
  font-weight: 800;
}

.board-design-title h3 { margin: 0; font-size: 16px; }
.board-design-title p { margin: 2px 0 0; color: var(--board-muted); font-size: 12px; }

.board-design-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: start;
  gap: 16px;
  padding: 16px;
  min-width: 0;
  max-width: 980px;
  margin: 0 auto;
}

/* Hands size to their cards; the compass never stretches their row. */
.bridge-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--board-compass-size) minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-items: center;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.board-hand {
  width: min(100%, var(--board-hand-width));
  min-width: 0;
  align-self: center;
  border: 1px solid var(--board-rule);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--board-surface);
}

.board-hand-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--board-rule);
  font-size: 13px;
}

.board-hand-label strong { border-radius: 4px; padding: 1px 4px; margin-left: -4px; }
.board-hand.vulnerable .board-hand-label strong { background: var(--danger-bg); color: var(--danger-ink); }
.board-hand-label > span { color: var(--board-muted); font-size: 11px; white-space: nowrap; }

.board-suit {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
  min-height: 22px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.board-suit > span:first-child { font-size: 17px; line-height: 1; }
.board-suit > span:last-child { overflow-wrap: anywhere; }
.board-hand-north { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
.board-hand-west { grid-column: 1; grid-row: 2; justify-self: end; }
.board-hand-east { grid-column: 3; grid-row: 2; justify-self: start; }
.board-hand-south { grid-column: 1 / -1; grid-row: 3; justify-self: center; }

.board-center {
  grid-column: 2;
  grid-row: 2;
  place-self: center;
  width: var(--board-compass-size);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  border: 1px solid #60746a;
  background: #10271f;
  color: #f4f1e7;
}

.board-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.compass-seat,
.auction-direction {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 5px;
  background: var(--direction-bg);
  color: var(--direction-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.compass-seat { position: absolute; }
.compass-north { top: 4px; left: 50%; transform: translateX(-50%); }
.compass-south { bottom: 4px; left: 50%; transform: translateX(-50%); }
.compass-west { left: 4px; top: 50%; transform: translateY(-50%); }
.compass-east { right: 4px; top: 50%; transform: translateY(-50%); }
.compass-seat.vulnerable,
.auction-direction.vulnerable { background: var(--danger-bg); color: var(--danger-ink); }
.is-dealer { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.board-side-panel { display: grid; align-content: start; align-items: start; gap: 12px; min-width: 0; }
.board-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 7px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--board-rule);
  border-radius: 8px;
  background: var(--board-surface);
  font-size: 13px;
}
.board-facts dt { color: var(--board-muted); font-size: 11px; }
.board-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.board-auction { border: 1px solid var(--board-rule); border-radius: 8px; overflow: hidden; background: var(--board-surface); }
.board-auction h4 { margin: 0; padding: 10px 12px 7px; font-size: 13px; font-weight: 600; }
.board-auction table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.board-auction th,
.board-auction td {
  width: 25%;
  height: 29px;
  padding: 2px;
  border: 0;
  border-bottom: 1px solid var(--board-rule);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.board-auction th { position: static; z-index: auto; background: transparent; padding-bottom: 6px; }
.auction-direction { margin: 0 auto; }
.board-auction tbody tr:last-child td { border-bottom: 0; padding-bottom: 5px; }
.board-auction tr:hover { background: transparent; }
.bid-call,
.bid-pass,
.bid-double {
  display: inline-grid;
  place-items: center;
  width: 4.2em;
  max-width: 100%;
  min-height: 23px;
  border-radius: 4px;
  padding: 1px 2px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.bid-call { background: #dcece5; color: #194d3e; }
.bid-pass { color: var(--board-muted); font-weight: 400; }
.bid-double { background: #efd0cd; color: #832e32; }
.auction-empty { color: var(--board-muted); opacity: .35; }

.board-style-kompakt { --board-hand-width: 166px; --board-compass-size: 88px; }
.board-style-kompakt .board-design-main { gap: 12px; padding: 12px; }
.board-style-kompakt .board-hand { padding: 6px 8px; }
.board-style-kompakt .board-suit { min-height: 20px; font-size: 13px; }
.board-style-kompakt .board-number { font-size: 25px; }

.board-style-zeitung,
.board-style-druck {
  --board-rule: #d2c9b6;
  --board-surface: #faf6ec;
  --board-text: #29271f;
  --board-muted: #6e685b;
  background: #eee8db;
}
.board-style-zeitung .bridge-board,
.board-style-zeitung .board-side-panel { font-family: Georgia, "Times New Roman", serif; }
.board-style-zeitung .board-center { background: #f8f2e4; color: #29271f; border-color: #b7aa94; }
.board-style-zeitung .board-suit.red-suit { color: #a52d40; }
.board-style-druck { --board-rule: #c8c8c1; --board-surface: #fff; --board-text: #111; --board-muted: #50504a; background: #fff; }
.board-style-druck .board-center { background: #fff; color: #111; border-color: #777; }
.board-style-druck .board-suit.red-suit { color: #933; }
.board-style-druck .compass-seat.vulnerable,
.board-style-druck .auction-direction.vulnerable { outline: 1px solid #a65c61; }

.board-style-club .board-design-main { background: linear-gradient(135deg, #12221d, #1e1712); }
.board-style-club .board-center { border: 2px solid #9a8860; }
.board-style-klassisch .board-hand { border-color: transparent; background: transparent; }
.board-style-klassisch .board-hand-label { border-bottom: 0; }
.board-style-tisch .bridge-board {
  padding: 16px 12px;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #245545, #12392c 65%, #102a21);
  box-shadow: inset 0 0 0 1px #54736640;
}
.board-style-tisch .board-hand,
.board-style-karten .board-hand {
  --board-rule: #d7d3c5;
  --board-muted: #6b6b5e;
  background: #f2efe3;
  color: #222b24;
  box-shadow: 0 2px 5px #06190f24;
}
.board-style-tisch .board-suit.red-suit,
.board-style-karten .board-suit.red-suit { color: #ac2d43; }
.board-style-score .board-side-panel { border-left: 2px solid var(--amber); padding-left: 12px; }
.board-style-lehrbuch { --board-surface: #19242b; --board-rule: #374750; --board-muted: #adb9bf; background: #10191e; }
.board-style-karten .board-hand { border-radius: 5px; background: #faf7ef; box-shadow: 0 5px 12px #0004; }
.board-style-karten .board-center { border-radius: 12px; }
.board-style-poster { grid-column: 1 / -1; --board-hand-width: 210px; --board-compass-size: 116px; }
.board-style-poster .board-suit { font-size: 17px; min-height: 25px; }
.board-style-poster .board-number { font-size: 34px; }

@container (max-width: 760px) {
  .board-design-main { grid-template-columns: minmax(0, 1fr); max-width: 570px; }
  .board-side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-facts { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .board-facts dd + dt { margin-top: 5px; }
}

@container (max-width: 430px) {
  .board-design-main { padding: 10px; gap: 12px; }
  .bridge-board { --board-compass-size: 74px; gap: 5px; }
  .board-style-tisch .bridge-board { padding: 12px 6px; }
  .board-hand { padding: 6px; }
  .board-hand-label { gap: 3px; font-size: 12px; }
  .board-hand-label > span { font-size: 10px; }
  .board-suit { font-size: 13px; min-height: 21px; grid-template-columns: 14px minmax(0, 1fr); gap: 3px; }
  .board-suit > span:first-child { font-size: 15px; }
  .board-center .board-number { font-size: 22px; }
  .compass-seat { width: 18px; height: 18px; font-size: 10px; border-radius: 4px; }
  .compass-north { top: 2px; }
  .compass-south { bottom: 2px; }
  .compass-west { left: 2px; }
  .compass-east { right: 2px; }
  .board-side-panel { grid-template-columns: minmax(0, 1fr); }
  .board-facts { grid-template-columns: max-content minmax(0, 1fr); gap: 7px 10px; }
  .board-facts dd + dt { margin-top: 0; }
}


.final-search {
  min-width: 220px;
  max-width: 320px;
}

.final-analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #141210;
}

.final-analysis-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.05fr) minmax(520px, 0.95fr);
  min-height: 520px;
}

.final-opponent-wrap,
.final-detail-wrap {
  max-height: 560px;
}

.final-opponent-wrap {
  border-right: 1px solid var(--line);
}

.final-detail {
  min-width: 0;
  background: #171512;
}

.final-detail .panel-head {
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.opponent-select-button {
  all: unset;
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.opponent-select-button:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

tr.selected-opponent {
  background: #26352f;
}

.positive {
  color: #7ce0c7;
}

.negative {
  color: #ff9a8f;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.deal-analysis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(280px, 1.6fr);
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #141210;
}

.analysis-card {
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #302c26;
  border-radius: 8px;
  background: #1b1815;
}

.analysis-card.highlight {
  border-color: rgba(50, 184, 155, 0.55);
}

.analysis-card strong {
  color: var(--ink);
  font-size: 16px;
}

.analysis-card span {
  color: var(--muted);
  font-size: 12px;
}

.comparison-list {
  display: grid;
  gap: 5px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 58px 62px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.comparison-row em {
  color: var(--muted);
  font-style: normal;
}

.table-head {
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 330px);
}

.deal-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  border-top: 1px solid var(--line);
}

.deal-table-wrap {
  max-height: 520px;
  border-right: 1px solid var(--line);
}

.deal-detail {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  padding: 12px 14px;
  color: var(--muted);
  background: #171512;
}

.deal-detail h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.deal-detail h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
}

.deal-summary {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 10px;
  margin: 0 0 12px;
}

.deal-detail dt {
  color: #d7cec3;
  font-weight: 600;
}

.deal-detail dd {
  margin: 0;
}

.deal-detail p {
  margin: 0 0 8px;
}

.detail-block {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #302c26;
  border-radius: 8px;
  background: #141210;
}

.hand-diagram {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(70px, auto) minmax(150px, 1fr);
  grid-template-areas:
    ". north ."
    "west center east"
    ". south .";
  gap: 8px;
  align-items: center;
}

.hand-seat {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #2d2924;
  border-radius: 8px;
  background: #1b1815;
  color: #d8d0c6;
}

.hand-seat strong {
  color: var(--ink);
  font-size: 12px;
}

.hand-seat.north {
  grid-area: north;
}

.hand-seat.west {
  grid-area: west;
}

.hand-seat.east {
  grid-area: east;
}

.hand-seat.south {
  grid-area: south;
}

.hand-center {
  grid-area: center;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: var(--field);
}

.suit-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 6px;
  min-width: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.red-suit {
  color: #ff9a8f;
}

.sequence-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sequence-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid #39342d;
  border-radius: 999px;
  background: #1d1a17;
  color: #e3d9cd;
  font-size: 12px;
}

.mini-table-wrap {
  overflow: auto;
  max-height: 250px;
}

.field-results {
  max-height: 360px;
}

.mini-table {
  min-width: 760px;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 7px 8px;
}

.empty-inline {
  color: var(--muted);
  font-size: 12px;
}

.comparison-summary p {
  color: var(--muted);
  font-size: 12px;
}

.replay-header {
  border-color: rgba(208, 154, 69, 0.5);
}

.replay-header.missing-replay {
  border-color: #302c26;
}

.replay-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.replay-title span,
.replay-title strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #211e1a;
  color: var(--muted);
  font-size: 12px;
}

.replay-title strong {
  color: var(--ink);
}

.comparison-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.comparison-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #211e1a;
  color: var(--muted);
  font-size: 12px;
}

.comparison-stats strong {
  color: var(--ink);
}

.deal-row-button {
  all: unset;
  cursor: pointer;
  color: inherit;
}

.replay-select-button {
  all: unset;
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.replay-select-button:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

tr.selected-deal {
  background: #2d3325;
}

tr.selected-replay {
  background: #332b1f;
}

tr[data-replay-game] {
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #2d2924;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #211e1a;
  color: #d7cec3;
  font-size: 12px;
  font-weight: 700;
}

th button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

td.num,
th.num {
  text-align: right;
}

.result-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 280px;
  white-space: normal;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: #302c26;
  color: #d9c7a7;
  font-size: 11px;
  text-decoration: none;
}

.result-pill.linked {
  background: rgba(50, 184, 155, 0.18);
  color: #7ce0c7;
}

.result-pill.linked:hover {
  background: rgba(50, 184, 155, 0.28);
  color: #b9fff0;
}

.result-pill.missing {
  color: #8f877b;
}

tr.mine {
  background: #17382f;
}

tr:hover {
  background: #211f1b;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #302c26;
  color: #d9c7a7;
}

.badge.ok {
  background: rgba(50, 184, 155, 0.18);
  color: #7ce0c7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #25211d;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .insight-band {
    grid-template-columns: 1fr;
  }

  .bbo-results-layout {
    grid-template-columns: 1fr;
  }

  .bbo-result-wrap:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .deal-layout {
    grid-template-columns: 1fr;
  }

  .deal-analysis {
    grid-template-columns: 1fr;
  }

  .final-analysis-layout,
  .final-analysis-metrics {
    grid-template-columns: 1fr;
  }

  .board-design-gallery {
    grid-template-columns: 1fr;
  }

  .board-filter-grid,
  .board-dossier-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-design-filter,
  .board-dossier-title {
    grid-column: 1 / -1;
  }

  .board-dossier {
    grid-template-columns: 1fr;
  }

  .board-comparison-head {
    align-items: stretch;
    flex-direction: column;
  }

  .board-round-overview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .board-round-player-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }


  .board-player-selectors {
    min-width: 0;
  }

  .board-comparison-cards.two-results {
    grid-template-columns: 1fr;
  }

  .board-score-card {
    grid-template-columns: 1fr;
  }

  .bridge-board {
    min-height: 0;
  }

  .final-opponent-wrap {
    border-right: 0;
  }

  .deal-table-wrap {
    border-right: 0;
  }

  .snapshot-row {
    align-items: stretch;
    flex-direction: column;
  }

  .field,
  .field.wide,
  .field.search {
    min-width: 100%;
  }

  .boards-tools {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Neue Informationsarchitektur: Saison -> Ansicht -> Kontext */
.season-switch,
.platform-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #11100e;
}

.season-tab,
.platform-tab,
.view-tab {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.season-tab {
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
}

.season-tab span {
  display: block;
  margin-bottom: -3px;
  color: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.season-tab:hover,
.platform-tab:hover,
.view-tab:hover {
  color: var(--ink);
  background: #2a2621;
}

.season-tab.active,
.season-tab[aria-pressed="true"],
.platform-tab.active,
.platform-tab[aria-pressed="true"] {
  background: var(--teal);
  color: #07110f;
}

.data-menu {
  position: relative;
}

.data-menu > summary {
  display: flex;
  align-items: center;
  list-style: none;
  user-select: none;
}

.data-menu > summary::-webkit-details-marker {
  display: none;
}

.data-menu > summary::after {
  content: "⌄";
  margin-left: 8px;
  color: var(--muted);
}

.data-menu[open] > summary::after {
  content: "⌃";
}

.data-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #171512;
  box-shadow: var(--shadow);
}

.data-menu-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-menu .section-action,
.data-menu .archive-write-actions {
  display: none;
}

body.section-funbridge .data-menu .funbridge-action,
body.section-bbo .data-menu .bbo-action,
body.section-hands .data-menu .hands-action {
  display: block;
}

body:not(.archive-mode) .data-menu .archive-write-actions {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

body.archive-mode .data-menu label[for="snapshotFile"] {
  display: none;
}

.data-menu .folder-select,
.data-menu .deal-select {
  width: 100%;
  max-width: none;
}

.view-nav {
  position: sticky;
  top: 73px;
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 14, 12, 0.96);
  backdrop-filter: blur(12px);
}

.view-tab {
  min-height: 34px;
  padding: 0 15px;
  font-weight: 600;
}

.view-tab.active,
.view-tab[aria-pressed="true"] {
  background: var(--panel-soft);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--teal);
}

.view-tab:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

body.season-2025 [data-view-target="katowice"] {
  display: none;
}

.context-row {
  display: grid;
  grid-template-columns: minmax(230px, 360px) auto minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.platform-switch {
  display: none;
  align-self: end;
}

body.season-2026 .platform-switch {
  display: inline-flex;
}

.platform-tab {
  min-height: 34px;
  padding: 0 12px;
}

.archive-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(208, 154, 69, 0.36);
  border-radius: 8px;
  background: rgba(208, 154, 69, 0.08);
  color: #ded6ca;
}

.archive-notice strong {
  color: #e7b96e;
  white-space: nowrap;
}

.archive-notice span {
  color: var(--muted);
  font-size: 12px;
}

body.season-2026 .archive-notice {
  border-color: rgba(50, 184, 155, 0.32);
  background: rgba(50, 184, 155, 0.07);
}

body.season-2026 .archive-notice strong {
  color: var(--teal);
}

.snapshot-history {
  position: relative;
  justify-self: end;
}

.snapshot-history > summary,
.advanced-filters > summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.snapshot-history-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(460px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171512;
  box-shadow: var(--shadow);
}

.filters {
  align-items: start;
}

.filters > .field.search {
  min-width: min(420px, 100%);
}

.advanced-filters {
  flex: 1;
  padding-top: 22px;
}

.advanced-filter-grid {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141210;
}

.control-band,
.bbo-results-band,
.deal-band,
.final-analysis-band,
.boards-band,
.table-band,
.platform-comparison-band,
.player-journeys-band,
.open-final-results-band,
.wbf-finalists-band,
.katowice-map-band,
.data-sources-band {
  border-radius: 12px;
}

.platform-comparison-band,
.player-journeys-band,
.open-final-results-band,
.wbf-finalists-band,
.data-sources-band {
  display: none;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.journeys-head {
  align-items: end;
  gap: 18px;
}

.journey-filters {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.journey-search {
  min-width: 230px;
}

.journey-notice {
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  border-radius: 5px;
  background: #141210;
  color: var(--muted);
  line-height: 1.5;
}

.journey-notice strong {
  color: var(--text);
}

.journey-table-wrap {
  margin: 0 14px 14px;
  max-height: 62vh;
}

.journey-table-wrap td strong,
.journey-accounts {
  display: block;
}

.journey-accounts {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.journey-path {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.journey-path.path-open {
  color: var(--gold);
}

.journey-empty {
  padding: 28px !important;
  color: var(--muted);
  text-align: center;
}

.wbf-finalists-head {
  align-items: center;
  gap: 18px;
}

.open-final-results-head {
  align-items: center;
  gap: 18px;
}

.open-final-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-final-segment-tabs {
  display: flex;
  gap: 6px;
  padding: 0 14px 14px;
}

.final-segment-tab {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141210;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.final-segment-tab.active {
  border-color: var(--gold);
  background: rgba(202, 165, 92, 0.12);
  color: var(--gold);
}

.open-final-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.open-final-podium-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141210;
}

.open-final-podium-card > span,
.open-final-podium-card > small {
  color: var(--muted);
}

.open-final-podium-card > strong {
  font-size: 18px;
}

.open-final-podium-card > b {
  color: var(--teal);
  font-size: 22px;
}

.open-final-podium-card > em {
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
}

.open-final-podium-card.podium-1 {
  border-color: rgba(202, 165, 92, 0.8);
  box-shadow: inset 0 0 0 1px rgba(202, 165, 92, 0.16);
}

.open-final-filter-row {
  padding-top: 0;
}

.open-final-table-wrap {
  margin: 0 14px 14px;
  max-height: 68vh;
}

.open-final-unmatched {
  margin: 0 14px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #141210;
}

.open-final-unmatched summary {
  color: var(--teal);
  cursor: pointer;
  font-weight: 800;
}

.open-final-unmatched > p {
  color: var(--muted);
  line-height: 1.5;
}

.open-final-unmatched-table-wrap {
  margin-top: 10px;
}

.open-final-top-1 td:first-child strong {
  color: var(--gold);
}

.wbf-finalists-actions,
.wbf-filter-row {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.wbf-filter-row {
  padding: 0 14px 14px;
}

.wbf-change-note {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

.wbf-finalist-table-wrap {
  margin: 0 14px 14px;
  max-height: 62vh;
}

.wbf-account-lines {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.wbf-account-lines span {
  display: block;
}

.wbf-account-lines .secondary-route {
  color: var(--muted);
  font-size: 11px;
}

.wbf-status {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wbf-status.regular {
  background: rgba(44, 192, 163, 0.14);
  color: var(--teal);
}

.wbf-status.replacement {
  background: rgba(226, 177, 79, 0.16);
  color: var(--gold);
}

.wbf-status.unresolved {
  background: rgba(220, 90, 90, 0.14);
  color: #ef8d8d;
}

.wbf-replacement-row {
  background: rgba(226, 177, 79, 0.035);
}

.katowice-map-band {
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 0%, rgba(50, 184, 155, 0.13), transparent 34%),
    var(--panel);
}

.katowice-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.katowice-intro-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.katowice-intro h2 {
  margin: 4px 0 6px;
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.15;
}

.katowice-intro p,
.katowice-map-help,
.katowice-place p,
.katowice-travel-note span {
  color: var(--muted);
}

.katowice-kicker,
.katowice-place-type {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.katowice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
  gap: 16px;
  padding: 16px;
}

.katowice-map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #11100e;
}

.katowice-map {
  width: 100%;
  min-height: 570px;
  background-color: #d8d4c9;
  background-image:
    linear-gradient(rgba(69, 79, 74, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 79, 74, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Der für diese Karte benötigte Leaflet-Kern liegt lokal, damit die Darstellung
   nicht von einem externen Stylesheet abhängt. */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  outline-offset: 1px;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

.leaflet-zoom-animated {
  transform-origin: 0 0;
}

.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top { top: 0; }
.leaflet-right { right: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-control { float: left; clear: both; }
.leaflet-right .leaflet-control { float: right; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-bottom .leaflet-control { margin-bottom: 10px; }
.leaflet-left .leaflet-control { margin-left: 10px; }
.leaflet-right .leaflet-control { margin-right: 10px; }

.leaflet-control-zoom,
.leaflet-control-attribution {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  color: #222;
  font: 700 18px/30px Arial, sans-serif;
  text-align: center;
  text-decoration: none;
}

.leaflet-control-zoom a + a {
  border-top: 1px solid #bbb;
}

.leaflet-control-attribution {
  padding: 3px 7px;
  font-size: 10px;
}

.leaflet-control-attribution a {
  color: #176e8d;
}

.leaflet-control-scale {
  padding: 5px 7px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #222222;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.leaflet-control-scale::before {
  content: "Maßstab";
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leaflet-control-scale-line {
  box-sizing: border-box;
  min-width: 58px;
  padding: 2px 5px 1px;
  overflow: hidden;
  border: 2px solid #222222;
  border-top: 0;
  background: rgba(255, 255, 255, 0.3);
  color: #111111;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.leaflet-popup {
  position: absolute;
  margin-bottom: 20px;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content {
  margin: 13px 18px;
  line-height: 1.4;
  text-align: left;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  margin: -10px auto 0;
  background: #fff;
  transform: rotate(45deg);
}

.leaflet-popup-close-button {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 20px;
  cursor: pointer;
}

.katowice-map-help {
  padding: 10px 12px;
  font-size: 11px;
}

.katowice-place-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.katowice-place {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 16, 14, 0.92);
}

.katowice-place.hotel-place {
  border-color: rgba(208, 154, 69, 0.48);
}

.katowice-place.venue-place {
  border-color: rgba(50, 184, 155, 0.48);
}

.katowice-place-number,
.katowice-marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 7px;
  background: #5d7895;
  color: #fff;
  font-weight: 900;
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
}

.katowice-place-number {
  margin-top: 2px;
}

.katowice-place-number,
.katowice-marker {
  font-size: 0;
}

.katowice-place-number::after,
.katowice-marker::after {
  content: attr(data-number);
  font-size: 14px;
  transform: rotate(45deg);
}

.katowice-place:nth-child(1) .katowice-place-number::after {
  content: "1";
}

.katowice-place:nth-child(2) .katowice-place-number,
.katowice-marker.hotel {
  background: var(--amber);
  color: #17110a;
}

.katowice-place:nth-child(2) .katowice-place-number::after {
  content: "2";
}

.katowice-place:nth-child(3) .katowice-place-number,
.katowice-marker.venue {
  background: var(--teal);
  color: #07110f;
}

.katowice-place:nth-child(3) .katowice-place-number::after {
  content: "3";
}

.katowice-marker.station::after {
  content: "1";
}

.katowice-marker.hotel::after {
  content: "2";
}

.katowice-marker.venue::after {
  content: "3";
}

.katowice-place h3 {
  margin: 3px 0 5px;
  font-size: 16px;
}

.katowice-place p {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.katowice-place a,
.katowice-popup a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.katowice-place a:hover,
.katowice-popup a:hover {
  text-decoration: underline;
}

.katowice-place-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.katowice-travel-note {
  display: flex;
  gap: 10px;
  margin: 0 16px 16px;
  padding: 13px 15px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: #11100e;
}

.katowice-travel-note strong {
  white-space: nowrap;
}

.katowice-food-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 0 16px 10px;
  padding: 13px 15px;
  border: 1px solid rgba(208, 154, 69, 0.48);
  border-radius: 8px;
  background: rgba(208, 154, 69, 0.08);
}

.katowice-food-note strong,
.katowice-food-note span {
  display: block;
}

.katowice-food-note span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.katowice-zone-swatch {
  width: 24px;
  height: 24px;
  margin: 0 !important;
  border: 2px dashed var(--amber);
  border-radius: 6px;
  background: rgba(208, 154, 69, 0.24);
}

.katowice-food-label-host {
  border: 0;
  background: transparent;
}

.katowice-food-label {
  display: block;
  width: max-content;
  padding: 5px 9px;
  border: 1px solid rgba(83, 56, 15, 0.45);
  border-radius: 999px;
  background: rgba(255, 246, 220, 0.95);
  color: #4c3512;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  white-space: nowrap;
}

.katowice-marker-host {
  border: 0;
  background: transparent;
}

.katowice-popup {
  display: grid;
  gap: 4px;
  min-width: 190px;
  color: #1c1916;
}

.katowice-popup span {
  color: #605b54;
  font-size: 12px;
}

.katowice-map-fallback {
  min-height: 570px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 30px;
  color: #27231f;
  text-align: center;
}

.katowice-map-fallback span {
  color: #5c5750;
}

.comparison-metrics,
.source-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.comparison-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.comparison-card,
.source-card,
.comparison-notes article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #141210;
}

.comparison-card > span,
.source-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-card > strong,
.source-card > strong {
  font-size: 18px;
}

.comparison-card dl {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
}

.comparison-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.comparison-card dt,
.comparison-card dd {
  margin: 0;
}

.comparison-card dt,
.source-card p,
.comparison-notes p {
  color: var(--muted);
}

.comparison-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 14px 14px;
}

.comparison-notes .method-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.source-status-grid {
  grid-template-columns: repeat(3, 1fr);
}

.source-card p {
  margin-top: 8px;
}

.source-file-list {
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #11100e;
}

.source-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  color: var(--muted);
}

.source-file-list ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-file-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding-top: 5px;
  border-top: 1px solid #292620;
}

.source-file-list li span,
.source-empty {
  color: var(--muted);
}

.source-file-list code {
  overflow-wrap: anywhere;
}

/* Pro Ansicht bleibt nur das fachlich Relevante sichtbar. */
body.view-overview .filters,
body.view-overview .table-band,
body.view-overview .bbo-results-band,
body.view-overview .deal-band,
body.view-overview .final-analysis-band,
body.view-overview .boards-band,
body.view-rankings .insight-band,
body.view-rankings .deal-band,
body.view-rankings .final-analysis-band,
body.view-rankings .boards-band,
body.view-comparison .metrics,
body.view-comparison .filters,
body.view-comparison .insight-band,
body.view-comparison .bbo-results-band,
body.view-comparison .deal-band,
body.view-comparison .table-band,
body.view-comparison .boards-band,
body.view-journeys .metrics,
body.view-journeys .filters,
body.view-journeys .insight-band,
body.view-journeys .bbo-results-band,
body.view-journeys .deal-band,
body.view-journeys .final-analysis-band,
body.view-journeys .platform-comparison-band,
body.view-journeys .boards-band,
body.view-journeys .data-sources-band,
body.view-journeys .table-band,
body.view-finalists .metrics,
body.view-finalists .filters,
body.view-finalists .insight-band,
body.view-finalists .bbo-results-band,
body.view-finalists .deal-band,
body.view-finalists .final-analysis-band,
body.view-finalists .player-journeys-band,
body.view-finalists .platform-comparison-band,
body.view-finalists .boards-band,
body.view-finalists .data-sources-band,
body.view-finalists .table-band,
body.view-katowice .control-band,
body.view-katowice .metrics,
body.view-katowice .filters,
body.view-katowice .insight-band,
body.view-katowice .bbo-results-band,
body.view-katowice .deal-band,
body.view-katowice .final-analysis-band,
body.view-katowice .player-journeys-band,
body.view-katowice .open-final-results-band,
body.view-katowice .wbf-finalists-band,
body.view-katowice .platform-comparison-band,
body.view-katowice .boards-band,
body.view-katowice .data-sources-band,
body.view-katowice .table-band,
body.view-boards .metrics,
body.view-boards .filters,
body.view-boards .insight-band,
body.view-boards .bbo-results-band,
body.view-boards .deal-band,
body.view-boards .table-band,
body.view-sources .metrics,
body.view-sources .filters,
body.view-sources .insight-band,
body.view-sources .bbo-results-band,
body.view-sources .deal-band,
body.view-sources .final-analysis-band,
body.view-sources .boards-band,
body.view-sources .table-band {
  display: none !important;
}

body.view-comparison .platform-comparison-band,
body.view-journeys .player-journeys-band,
body.view-finalists .open-final-results-band,
body.view-finalists .wbf-finalists-band,
body.season-2026.view-katowice .katowice-map-band,
body.view-sources .data-sources-band {
  display: block;
}

body:not(.view-katowice) .katowice-map-band,
body.season-2025 .katowice-map-band {
  display: none !important;
}

body.view-katowice main > section:not(.katowice-map-band) {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    gap: 12px;
  }

  .open-final-podium {
    grid-template-columns: 1fr;
  }

  .brand {
    min-width: 0;
  }

  .season-switch {
    width: 100%;
  }

  .season-tab {
    flex: 1;
  }

  .data-menu {
    width: 100%;
  }

  .data-menu > summary {
    justify-content: center;
  }

  .data-menu-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .view-nav {
    top: 0;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .context-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .snapshot-history {
    justify-self: stretch;
  }

  .snapshot-history-panel {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .advanced-filters {
    width: 100%;
    padding-top: 0;
  }

  .comparison-metrics,
  .comparison-groups,
  .source-status-grid,
  .comparison-notes {
    grid-template-columns: 1fr;
  }

  .comparison-notes .method-note {
    grid-column: auto;
  }

  .katowice-intro,
  .katowice-food-note,
  .katowice-travel-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .katowice-food-note {
    display: flex;
  }

  .katowice-layout {
    grid-template-columns: 1fr;
  }

  .katowice-map {
    min-height: 460px;
  }

  .source-file-list li {
    grid-template-columns: 1fr;
  }
}

body.katowice-printing .katowice-layout {
  display: block;
  padding: 2mm 0 0;
}

body.katowice-printing .katowice-map-band {
  width: 281mm;
  max-width: 281mm;
  margin-right: auto;
  margin-left: auto;
  border: 0;
}

body.katowice-printing .katowice-map,
body.katowice-printing .katowice-map-fallback {
  min-height: 143mm;
  height: 143mm;
}

body.katowice-printing .katowice-place-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

body.katowice-printing .katowice-food-note,
body.katowice-printing .katowice-travel-note {
  display: none;
}

@media print {
  body.round-printing { margin: 0; padding: 0; width: auto; height: auto; overflow: visible; }
  body.round-printing > :not(#roundPrintOutput) { display: none !important; }
  body.round-printing #roundPrintOutput { display: block !important; page: auto; margin: 0; height: auto; overflow: visible; }
  body.round-printing .round-print-grid { break-inside: avoid; page-break-inside: avoid; }
  body.round-printing .round-print-sheet { break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always; }
  body.round-printing .round-print-sheet:last-child { break-after: auto; page-break-after: auto; }
  body.round-printing .round-board-card { overflow: visible; }
  body.round-printing dialog::backdrop { display: none; }
  .board-round-toolbar { display: none !important; }
  .round-print-sheet { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  :root {
    --bg: #ffffff;
    --ink: #111111;
    --muted: #555555;
    --line: #222222;
    --panel: #ffffff;
    --panel-soft: #ffffff;
    --field: #ffffff;
    --shadow: none;
  }

  body {
    background: #ffffff;
    color: #111111;
    font-size: 11pt;
  }

  .topbar,
  .control-band,
  .boards-head .boards-head-actions,
  .boards-head .board-filter-grid,
  .board-pivot-panel,
  .board-dossier,
  .board-comparison-panel,
  .board-replay-panel,
  .toast {
    display: none !important;
  }

  main {
    display: block;
    padding: 0;
  }

  body.boards-mode .boards-band {
    display: block;
  }

  .boards-band {
    max-width: none;
    border: 0;
    box-shadow: none;
  }

  .boards-head {
    padding: 0 0 8px;
  }

  .board-design-gallery {
    grid-template-columns: 1fr;
    gap: 10mm;
    padding: 0;
  }

  .board-round-overview-panel {
    margin: 0;
    border: 0;
    background: #ffffff;
  }

  .board-round-overview-head {
    padding: 0 0 6mm;
    border: 0;
    background: #ffffff;
  }

  .board-round-player-controls {
    display: none;
  }

  .board-round-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5mm;
    padding: 0;
  }

  .round-board-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #222222;
  }

  .round-direction.vulnerable,
  .round-mini-hand > strong.vulnerable {
    outline: 1px solid #a65c61;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .board-results-panel {
    display: none;
  }

  .board-design-card {
    --board-text: #111111;
    --board-muted: #444444;
    --board-rule: #aaaaaa;
    border-color: #222222;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #ffffff !important;
    color: #111111 !important;
  }

  .board-design-main,
  .board-style-poster .board-design-main {
    grid-template-columns: 1fr 0.72fr;
  }

  .bridge-board {
    min-height: 0;
  }

  .board-side-panel { grid-template-columns: minmax(0, 1fr); }

  .compass-seat.vulnerable,
  .auction-direction.vulnerable { outline: 1px solid #a65c61; print-color-adjust: exact; }

  .board-hand,
  .board-center,
  .board-facts,
  .board-auction,
  .board-design-title {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #222222 !important;
    box-shadow: none !important;
  }

  .board-style-tisch .bridge-board,
  .board-style-club .board-design-main,
  .board-style-lehrbuch .board-design-main {
    background: #ffffff !important;
  }

  .board-design-title > span {
    border: 1px solid #222222;
    background: #ffffff;
    color: #111111;
  }

  body.view-katowice {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.view-katowice .view-nav,
  body.view-katowice .katowice-intro-actions,
  body.view-katowice .katowice-map-help {
    display: none !important;
  }

  body.view-katowice main {
    padding: 0;
  }

  body.season-2026.view-katowice .katowice-map-band {
    display: block !important;
    width: 281mm;
    max-width: 281mm;
    margin-right: auto;
    margin-left: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #111111;
    box-shadow: none;
  }

  body.view-katowice .katowice-intro {
    display: block;
    padding: 0 0 2mm;
    border-bottom: 1px solid #777777;
  }

  body.view-katowice .katowice-intro h2 {
    margin: 0.5mm 0;
    color: #111111;
    font-size: 14pt;
  }

  body.view-katowice .katowice-intro p {
    font-size: 8pt;
  }

  body.view-katowice .katowice-intro p,
  body.view-katowice .katowice-place p,
  body.view-katowice .katowice-travel-note span {
    color: #444444;
  }

  body.view-katowice .katowice-kicker,
  body.view-katowice .katowice-place-type {
    color: #177b68;
  }

  body.view-katowice .katowice-layout {
    display: block;
    padding: 2mm 0 0;
  }

  body.view-katowice .katowice-map-shell {
    break-inside: avoid;
    border-color: #777777;
    border-radius: 2mm;
  }

  body.view-katowice .katowice-map,
  body.view-katowice .katowice-map-fallback {
    min-height: 143mm;
    height: 143mm;
  }

  body.view-katowice .katowice-place-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2mm;
    margin-top: 2mm;
  }

  body.view-katowice .katowice-place {
    min-height: 22mm;
    break-inside: avoid;
    grid-template-columns: 7mm 1fr;
    gap: 1.5mm;
    padding: 2mm;
    border-color: #888888;
    background: #ffffff;
    color: #111111;
  }

  body.view-katowice .katowice-place-number {
    width: 6.5mm;
    height: 6.5mm;
    box-shadow: none;
  }

  body.view-katowice .katowice-place h3 {
    margin: 0.5mm 0;
    color: #111111;
    font-size: 9pt;
  }

  body.view-katowice .katowice-place-type {
    font-size: 6pt;
  }

  body.view-katowice .katowice-place p {
    margin: 0;
    font-size: 7pt;
    line-height: 1.25;
  }

  body.view-katowice .katowice-place a {
    display: none;
  }

  body.view-katowice .katowice-travel-note,
  body.view-katowice .katowice-food-note {
    display: none !important;
  }

  body.view-katowice .leaflet-control-zoom {
    display: none !important;
  }

  body.view-katowice .leaflet-control-scale {
    display: block !important;
    margin: 0 0 3mm 3mm;
    border: 1px solid #222222;
    background: #ffffff;
    box-shadow: none;
  }

  body.view-katowice .leaflet-control-scale::before {
    font-size: 7pt;
  }

  body.view-katowice .leaflet-control-scale-line {
    border-color: #111111;
    color: #111111;
    font-size: 8pt;
  }
}
