:root {
  --navy: #07152d;
  --navy-2: #0d2346;
  --surface: #fff;
  --surface-2: #f7f9fc;
  --ink: #13213a;
  --paper: #f3f6fa;
  --red: #ff5d57;
  --lime: #b9ef19;
  --selection-bg: #314b69;
  --selection-text: #f7fbff;
  --selection-border: #607a98;
  --line: #e1e7ef;
  --muted: #6e7b90;
  --radius: 16px;
  --shadow: 0 12px 38px rgba(13, 35, 70, 0.08);
  --shadow-lg: 0 24px 70px rgba(7, 21, 45, 0.16);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #b9c3d0 transparent;
}
html {
  color-scheme: light;
  font-size: clamp(14px, 0.18vw + 13.4px, 16px);
}
body {
  min-width: 320px;
}
::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}
[hidden] {
  display: none !important;
}
body {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--paper);
  letter-spacing: -0.01em;
}
button,
input,
select,
textarea {
  border-radius: 9px;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s,
    background 0.18s;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid
    color-mix(in srgb, var(--selection-border) 50%, transparent);
  outline-offset: 2px;
}
header {
  height: 78px;
  padding: 0 3vw;
  gap: 2.4vw;
  border: 0;
  background: rgba(7, 21, 45, 0.97);
  color: #fff;
  box-shadow: 0 8px 30px rgba(7, 21, 45, 0.14);
}
header .brand i {
  background: var(--lime);
  color: var(--navy);
  box-shadow: 0 0 0 6px rgba(185, 239, 25, 0.12);
}
.brand .product-mark {
  width: 42px;
  height: 42px;
  padding: 5px;
  border-radius: 12px;
  background: #0d2346;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 6px rgba(185, 239, 25, 0.08);
}
header .brand .header-brand-logo {
  display: block;
  width: 190px;
  height: 48px;
  max-width: none;
  object-fit: contain;
  object-position: left center;
  border-radius: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
}
.brand b {
  font-family: Inter, ui-sans-serif, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: -0.04em;
}
.brand em {
  color: var(--lime);
}
.login .brand .product-mark {
  background: var(--navy);
}
.login .brand b {
  color: var(--navy);
  font-size: 18px;
}
.login .brand em {
  color: #8bbb00;
}
header .brand em {
  color: var(--lime);
}
header nav {
  gap: 4px;
  padding: 10px 0;
}
header nav button {
  padding: 0 17px;
  border-radius: 10px;
  color: #aebad0;
  font-weight: 650;
}
header nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
header nav button.active {
  color: var(--selection-text);
  background: var(--selection-bg);
  box-shadow: inset 0 0 0 1px var(--selection-border);
}
header nav button.active:after {
  display: none;
}
.home-button {
  min-width: 44px;
  font-size: 23px;
  line-height: 1;
}
.home-view {
  padding: 42px 3vw 80px;
}
.home-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 42px clamp(24px, 5vw, 72px);
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(185, 239, 25, 0.18),
      transparent 30%
    ),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  box-shadow: var(--shadow-lg);
}
.home-welcome h1 {
  margin: 6px 0 10px;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -0.055em;
}
.home-welcome p:not(.overline) {
  max-width: 620px;
  color: #bdc8d9;
}
.home-welcome img {
  width: min(300px, 28vw);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22));
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 24px;
}
.mode-card {
  min-height: 285px;
  padding: 28px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: #bdc9d8;
  box-shadow: var(--shadow-lg);
}
.mode-card .mode-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 35px;
  border-radius: 15px;
  background: var(--navy);
  color: var(--lime);
  font-size: 25px;
}
.mode-card small {
  color: var(--red);
  font:
    800 9px ui-monospace,
    monospace;
  letter-spacing: 0.13em;
}
.mode-card h2 {
  margin: 8px 0;
  font-size: 22px;
}
.mode-card p {
  min-height: 58px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.mode-card b {
  display: block;
  margin-top: 22px;
  color: var(--navy);
  font-size: 12px;
}
.mode-card.scratcher .mode-icon {
  background: var(--red);
  color: #fff;
}
.mode-card.tournament .mode-icon {
  background: #7047eb;
  color: #fff;
}
.mode-card.teams .mode-icon {
  background: #eaf4c8;
  color: #608400;
}
header #orgSelect {
  background: #14284b;
  color: #fff;
  border-color: #2c4265;
  border-radius: 10px;
}
header #account {
  color: #aebad0;
}
.round {
  border-color: #415474;
  color: #fff;
  background: #14284b;
}
.round:hover {
  background: var(--red);
  border-color: var(--red);
}
.score-hero {
  min-height: 282px;
  margin: 28px 3vw 0;
  padding: 42px clamp(20px, 4vw, 64px);
  border: 0;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(185, 239, 25, 0.14),
      transparent 28%
    ),
    radial-gradient(
      circle at 85% 10%,
      rgba(255, 93, 87, 0.17),
      transparent 28%
    ),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.club small {
  color: #aebad0;
}
.club h1 {
  font-weight: 800;
  letter-spacing: -0.045em;
}
.club span {
  color: #aebad0;
}
.club > img {
  width: 82px;
  height: 82px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.versus {
  border-color: rgba(255, 255, 255, 0.13);
}
.versus .overline {
  color: var(--lime);
}
.versus strong b {
  font-size: 72px;
  letter-spacing: -0.08em;
}
.versus strong i {
  color: var(--red);
}
.versus > p:last-child {
  color: #aebad0;
}
.view {
  width: 100%;
  max-width: 1680px;
  margin: auto;
}
.toolbar {
  padding: 42px 3vw 22px;
}
.toolbar h2 {
  font-size: 34px;
  letter-spacing: -0.04em;
}
.overline {
  color: var(--red);
}
.progress-wrap > div {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: #dfe5ed;
}
.progress-wrap i {
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--selection-bg),
    var(--selection-border)
  );
}
.primary {
  height: 48px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--navy);
  font-size: 10px;
  box-shadow: 0 8px 22px rgba(142, 190, 0, 0.16);
}
.primary:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
  box-shadow: 0 12px 28px rgba(142, 190, 0, 0.25);
}
.outline {
  border-radius: 10px;
  border-color: #cbd4e0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.outline:hover {
  background: #fff;
  border-color: #9facc0;
}
.schedule {
  padding: 0 3vw 70px;
  gap: 12px;
}
.fixture {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(13, 35, 70, 0.045);
  overflow: hidden;
}
.fixture:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: #cad4e1;
}
.fixture.done {
  background: #f8fafc;
}
.fixture-no {
  border-color: var(--line);
  background: #fafbfd;
}
.fixture-no b {
  color: var(--red);
}
.fixture > button {
  background: var(--navy);
}
.fixture > button:hover {
  background: #1d3654;
}
.fixture > button.correction {
  background: #e8edf3;
  color: #243a55;
  border-left: 1px solid var(--line);
}
.fixture > button.correction:hover {
  background: #d9e2ec;
}
.side i,
.list-row i {
  background: #eaf0f6;
  color: var(--navy);
}
.management,
.settings-grid {
  padding-left: 3vw;
  padding-right: 3vw;
  gap: 28px;
}
.catalog {
  gap: 14px;
}
.catalog-card,
.team-card,
.league-rules {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.catalog-card {
  padding: 19px;
}
.catalog-card:hover {
  border-color: #c9d3df;
  transform: translateY(-1px);
}
.team-logo b {
  background: var(--navy);
}
.match-badge {
  display: inline-block;
  margin-right: 7px;
  padding: 4px 7px;
  border-radius: 99px;
  background: rgba(185, 239, 25, 0.2);
  color: #557900;
  font:
    800 8px ui-monospace,
    monospace;
  font-style: normal;
}
.match-badge.friendly {
  background: rgba(255, 93, 87, 0.14);
  color: #d34640;
}
.dark-card {
  border-radius: 18px;
  background: linear-gradient(155deg, var(--navy), #102a54);
  box-shadow: var(--shadow-lg);
}
.dark-card input,
.dark-card select,
.dark-card textarea {
  border-color: #304568;
  background: #13294d;
}
.dark-card h3 {
  font-size: 20px;
}
.dark-card select[multiple] {
  height: auto;
  min-height: 138px;
  padding: 8px;
}
.dark-card select[multiple] option {
  padding: 7px 9px;
  border-radius: 6px;
}
.dark-card select[multiple] option:checked {
  background: linear-gradient(var(--selection-bg), var(--selection-bg));
  color: var(--selection-text);
}
.dark-card small {
  display: block;
  margin: 6px 0 12px;
  color: #aebad0;
  font-size: 10px;
  line-height: 1.4;
}
.calendar-list {
  padding: 0 3vw 70px;
}
.calendar-month {
  margin-bottom: 28px;
}
.calendar-month > h3 {
  text-transform: capitalize;
  font-size: 22px;
}
.calendar-month article {
  display: grid;
  grid-template-columns: 115px 1fr auto;
  align-items: center;
  gap: 20px;
  margin: 10px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.calendar-month time {
  display: flex;
  align-items: center;
  gap: 12px;
}
.calendar-month time b {
  font-size: 31px;
  color: var(--red);
}
.calendar-month time span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.calendar-month h4 {
  margin: 5px 0;
  font-size: 17px;
}
.calendar-month small {
  color: var(--muted);
  font:
    800 9px ui-monospace,
    monospace;
}
.empty-calendar {
  padding: 35px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.player-ranking {
  margin: 0 3vw 70px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
#playerRankingList {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
#playerRankingList article {
  display: grid;
  grid-template-columns: 45px 1fr 110px auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
#playerRankingList article > b {
  font:
    800 20px ui-monospace,
    monospace;
  color: var(--red);
}
#playerRankingList strong,
#playerRankingList small {
  display: block;
}
#playerRankingList small {
  margin-top: 3px;
  color: var(--muted);
}
#playerRankingList input {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
}
.danger {
  border-color: #ff8b87 !important;
  color: #d33f3a !important;
}
.danger-zone {
  border-color: #ffb3b0 !important;
}
.danger-zone h3 {
  color: #d33f3a;
}
.league-hint > div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(13, 35, 70, 0.04);
}
.league-rules {
  background: #fff;
}
.teamleg {
  border-radius: 18px;
  background: var(--navy);
  box-shadow: var(--shadow-lg);
}
.login {
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(185, 239, 25, 0.16),
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(255, 93, 87, 0.16),
      transparent 28%
    ),
    var(--navy);
}
.card {
  border-radius: 22px;
  padding: 48px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
}
.card h1 {
  color: var(--navy);
  letter-spacing: -0.055em;
}
.card .brand i {
  background: var(--lime);
  color: var(--navy);
}
dialog .modal {
  border-radius: 20px;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.35);
}
dialog::backdrop {
  background: rgba(4, 13, 28, 0.75);
}
footer {
  background: var(--navy);
  color: #8fa0bb;
}
.empty h1 {
  letter-spacing: -0.04em;
}
:root[data-theme="dark"] {
  --ink: #edf3fb;
  --paper: #07111f;
  --surface: #0d1b2d;
  --surface-2: #112136;
  --line: #263a54;
  --muted: #98a8bd;
  --selection-bg: #29445f;
  --selection-text: #f2f7fc;
  --selection-border: #527494;
}
html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background: #07111f;
}
html[data-theme="dark"] header {
  background: rgba(4, 13, 28, 0.97);
}
html[data-theme="dark"] .score-hero {
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(185, 239, 25, 0.13),
      transparent 28%
    ),
    radial-gradient(
      circle at 85% 10%,
      rgba(255, 93, 87, 0.15),
      transparent 28%
    ),
    linear-gradient(135deg, #0c1e3d, #132d56);
}
html[data-theme="dark"] .fixture,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .catalog-card,
html[data-theme="dark"] .league-rules,
html[data-theme="dark"] .league-hint > div,
html[data-theme="dark"] .scoring > div {
  background: var(--surface);
}
html[data-theme="dark"] .fixture.done,
html[data-theme="dark"] .fixture-no {
  background: #101f32;
}
html[data-theme="dark"] .outline {
  background: #0d1b2d;
  border-color: #31465f;
}
html[data-theme="dark"] .side i {
  background: #1b3048;
  color: #fff;
}
html[data-theme="dark"] .fixture > button.correction {
  background: #1a3048;
  color: #dbe8f5;
  border-left-color: #314b66;
}
html[data-theme="dark"] .fixture > button.correction:hover {
  background: #24415e;
}
html[data-theme="dark"] .progress-wrap > div {
  background: #1c3047;
}
@media (max-width: 1280px) {
  header .brand .header-brand-logo {
    width: 160px;
  }
  header nav button {
    padding: 0 12px;
    font-size: 13px;
  }
  .fixture {
    grid-template-columns: 78px minmax(170px, 1fr) 74px minmax(170px, 1fr) 104px;
  }
  .side {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media (max-width: 1050px) {
  header {
    padding: 11px 18px;
  }
  header nav {
    padding: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  header nav button {
    flex: 0 0 auto;
    min-height: 42px;
  }
  .score-hero {
    margin: 18px 18px 0;
  }
  .management,
  .settings-grid {
    padding-left: 18px;
    padding-right: 18px;
  }
  .mode-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  header {
    border-radius: 0;
  }
  header nav button {
    padding: 0 12px;
  }
  .home-button {
    position: sticky;
    left: 0;
    z-index: 2;
  }
  .home-view {
    padding: 18px 12px 55px;
  }
  .home-welcome {
    padding: 28px 22px;
  }
  .home-welcome img {
    display: none;
  }
  .mode-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mode-card {
    min-height: 230px;
  }
  .mode-card .mode-icon {
    margin-bottom: 20px;
  }
  .score-hero {
    margin: 12px 10px 0;
    border-radius: 16px;
    padding: 26px 13px;
    min-height: 230px;
  }
  .club > img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .versus strong {
    gap: 8px;
  }
  .versus strong b {
    font-size: 42px;
  }
  .toolbar {
    padding: 30px 14px 18px;
  }
  .fixture {
    border-radius: 12px;
  }
  .card {
    padding: 34px 26px;
  }
  .card h1 {
    font-size: 44px;
  }
}
.form-hint {
  margin: 8px 0 16px;
  color: #b9c8dc;
  font-size: 11px;
  line-height: 1.55;
}
.wide-dialog {
  width: min(1180px, calc(100% - 24px));
  max-width: none;
}
.scratcher-control {
  max-height: min(900px, calc(100vh - 24px));
  overflow: auto;
}
.scratcher-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 30px;
}
.scratcher-head h2 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 44px);
}
.scratcher-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.scratch-status {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--selection-border);
  border-radius: 99px;
  background: color-mix(in srgb, var(--selection-bg) 12%, var(--surface));
  color: var(--selection-bg);
  font:
    800 10px ui-monospace,
    monospace;
}
.scratch-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 26px 0;
}
.scratch-board {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.scratch-board h3 {
  margin: 0 0 4px;
}
.scratch-board > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
}
.scratch-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.scratch-score span,
.scratch-score b,
.scratch-score small {
  display: block;
}
.scratch-score small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.scratch-score input {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

/* Turnierregeln, lesbare Auswahl und Turnierspieltag. */
.mode-card .mode-icon img {
  width: 38px;
  height: 38px;
  display: block;
}
.tournament-symbol img {
  width: 54px;
  height: 54px;
  display: block;
}
.rule-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #304568;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}
.board-settings,
#scratcherSettings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #304568;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
#scratcherSettings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.board-settings label,
#scratcherSettings label {
  margin: 0 !important;
}
#scratcherSettings .form-hint {
  grid-column: 1 / -1;
}
.scratch-spare {
  color: #8fd3ff;
  white-space: nowrap;
}
.display-window-btn {
  border: 1px solid #7696b8;
  border-radius: 10px;
  background: #173a61;
  color: #f7fbff;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.display-window-btn:hover,
.display-window-btn:focus-visible {
  background: #28527d;
  outline: 2px solid #a9c9e8;
  outline-offset: 2px;
}
.certificate-dialog {
  width: min(720px, calc(100vw - 32px));
}
.certificate-dialog form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.certificate-dialog form button {
  grid-column: 1 / -1;
}
@media (max-width: 680px) {
  .certificate-dialog form {
    grid-template-columns: 1fr;
  }
  .certificate-dialog form button {
    grid-column: auto;
  }
}
.rule-picker legend {
  padding: 0 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.rule-picker label {
  margin: 0 !important;
}
.rule-picker .form-hint {
  grid-column: 1 / -1;
  margin: 2px 0 0;
}
#tournamentPlayers option {
  min-height: 38px;
  padding: 9px 11px;
  background: #13294d;
  color: #f3f7fc;
}
#tournamentPlayers option:checked {
  background: linear-gradient(#d7e8f7, #d7e8f7);
  color: #07152d;
  font-weight: 800;
}
html[data-theme="dark"] #tournamentPlayers option:checked {
  background: linear-gradient(#527494, #527494);
  color: #fff;
}
.tournament-match-view {
  padding: 34px 3vw 70px;
}
.tournament-match-head,
.tournament-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.tournament-match-head h1,
.tournament-round-head h2 {
  margin: 5px 0 8px;
  font-size: clamp(30px, 5vw, 54px);
}
.tournament-match-head p:last-child {
  color: #c3cede;
  line-height: 1.55;
}
.tournament-round-head {
  padding: 22px 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.tournament-round-head h2 {
  font-size: clamp(26px, 3vw, 38px);
}
.tournament-fixtures {
  display: grid;
  gap: 14px;
}
.tournament-fixture {
  display: grid;
  grid-template-columns: 90px minmax(330px, 1fr) minmax(190px, auto);
  align-items: stretch;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tournament-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.tournament-players button {
  min-height: 54px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}
.tournament-players button:not(:disabled):hover {
  border-color: var(--selection-border);
}
.tournament-players button.selected-winner {
  border-color: #608400;
  background: #eaf4c8;
  color: #294000;
  opacity: 1;
}
.tournament-result {
  display: flex;
  align-items: center;
  padding: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.tournament-winner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 34px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.tournament-winner img {
  width: 76px;
  height: 76px;
}
.tournament-winner h2 {
  margin: 5px 0 0;
  font-size: clamp(32px, 5vw, 52px);
}
.tournament-rules {
  margin-top: 22px;
  padding: 22px;
  border-left: 4px solid var(--red);
  border-radius: 12px;
  background: var(--surface);
}
.scratch-life-choice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  margin: 8px 0;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}
.scratch-life-choice input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
}
.scratch-life-choice span b,
.scratch-life-choice span small {
  display: block;
}
.scratch-life-choice span small {
  margin-top: 4px;
  color: var(--muted);
}
.scratch-life-choice strong {
  color: var(--muted);
  font-size: 11px;
}
.scratch-life-choice:has(input:checked) {
  border-color: #c23f3a;
  background: #ffe1df;
  color: #4b100d;
}
.scratch-life-choice:has(input:checked) strong {
  color: #a52f2a;
}
html[data-theme="dark"] .scratch-life-choice:has(input:checked) {
  border-color: #ff817b;
  background: #4a2328;
  color: #fff;
}
@media (max-width: 900px) {
  .rule-picker {
    grid-template-columns: 1fr;
  }
  .board-settings,
  #scratcherSettings {
    grid-template-columns: 1fr;
  }
  .tournament-fixture {
    grid-template-columns: 70px minmax(0, 1fr);
  }
  .tournament-result {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
@media (max-width: 650px) {
  .tournament-match-view {
    padding: 18px 12px 55px;
  }
  .tournament-match-head,
  .tournament-round-head {
    align-items: stretch;
    flex-direction: column;
  }
  .tournament-players {
    grid-template-columns: 1fr;
  }
  .tournament-players strong {
    text-align: center;
  }
  .scratch-life-choice {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .scratch-life-choice strong {
    grid-column: 2;
  }
}
.scratch-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.scratch-roster,
.scratch-history {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.scratch-roster li,
.scratch-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
.scratch-roster small,
.scratch-history span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.scratch-roster strong {
  color: var(--selection-bg);
  white-space: nowrap;
}
.scratch-roster li.eliminated {
  opacity: 0.58;
}
.scratch-roster [data-correct-scratch-lives] {
  margin-left: auto;
  white-space: nowrap;
}
.scratch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.scratch-winner {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid var(--selection-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--selection-bg) 10%, var(--surface));
}
.scratch-winner h3 {
  margin: 4px 0 0;
  font-size: 24px;
}
html[data-theme="dark"] .scratch-status,
html[data-theme="dark"] .scratch-winner {
  color: var(--selection-text);
}
@media (max-width: 760px) {
  .scratcher-control {
    padding: 28px 16px;
  }
  .scratcher-head,
  .scratch-overview {
    grid-template-columns: 1fr;
  }
  .scratcher-head {
    display: grid;
  }
  .scratch-status {
    justify-self: start;
  }
  .scratch-boards {
    grid-template-columns: 1fr;
  }
  .scratch-score {
    grid-template-columns: 1fr 104px;
  }
}
@media (max-width: 650px) {
  header .brand .header-brand-logo {
    width: 145px;
    height: 42px;
  }
}
@media (max-width: 650px) {
  .calendar-list {
    padding: 0 14px 55px;
  }
  .calendar-month article {
    grid-template-columns: 80px 1fr;
  }
  .calendar-month article > button {
    grid-column: 1/-1;
    width: 100%;
  }
  .player-ranking {
    margin: 0 14px 55px;
    padding: 18px;
  }
  #playerRankingList article {
    grid-template-columns: 35px 1fr 85px;
  }
  #playerRankingList article button {
    grid-column: 2/-1;
  }
}
.ranking-heading {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.ranking-list article {
  display: grid;
  grid-template-columns: 45px minmax(150px, 1fr) 90px minmax(260px, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.ranking-list article > b {
  font:
    800 20px ui-monospace,
    monospace;
  color: var(--red);
}
.ranking-list strong,
.ranking-list small {
  display: block;
}
.ranking-list small {
  margin-top: 3px;
  color: var(--muted);
}
.ranking-points {
  text-align: center;
}
.ranking-points strong {
  font-size: 22px;
}
.ranking-stats {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 650px) {
  .ranking-list article {
    grid-template-columns: 35px 1fr 70px;
  }
  .ranking-stats {
    grid-column: 2/-1;
  }
  .ranking-list article button {
    grid-column: 2/-1;
  }
}

/* Lesbare Erstellungsdialoge und einheitliche Anmeldung. */
#encountersView .management,
#tournamentsView .management {
  grid-template-columns: minmax(0, 1fr) minmax(440px, 600px);
  align-items: start;
}
#addEncounter,
#addTournament,
#addOrg {
  padding: clamp(26px, 3vw, 42px);
}
#addTournament {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}
#addEncounter h3,
#addTournament h3,
#addOrg h3 {
  margin: 0 0 22px;
  font-size: clamp(24px, 2vw, 30px);
}
#addEncounter label,
#addTournament label,
#addOrg label {
  margin: 18px 0;
  color: #dbe7f7;
  font: 750 13px/1.45 Inter, ui-sans-serif, "Segoe UI", sans-serif;
}
#addOrg label { color: var(--ink); }
#addEncounter input,
#addEncounter select,
#addTournament input,
#addTournament select,
#addTournament textarea,
#addOrg input {
  min-height: 52px;
  margin-top: 9px;
  padding: 11px 14px;
  font: 500 16px/1.4 Inter, ui-sans-serif, "Segoe UI", sans-serif;
}
#addTournament textarea { min-height: 112px; }
#addTournament select[multiple] { min-height: 210px; padding: 10px; }
#addEncounter .primary,
#addTournament .primary,
#addTournament .outline,
#addOrg .primary {
  min-height: 52px;
  padding: 0 20px;
  font-size: 13px;
}
.login {
  padding: clamp(18px, 4vw, 56px);
}
.login .card {
  width: min(560px, 100%);
  padding: clamp(34px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
}
.login .card h1 {
  margin: 10px 0 34px;
  color: var(--ink);
  font-size: clamp(44px, 7vw, 62px);
  line-height: 0.98;
}
.login .card label {
  display: block;
  margin: 22px 0;
  color: var(--ink);
  font: 750 14px/1.45 Inter, ui-sans-serif, "Segoe UI", sans-serif;
}
.login .card input {
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 9px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  caret-color: var(--red);
  font: 550 18px/1.35 Inter, ui-sans-serif, "Segoe UI", sans-serif;
}
.login .card input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  opacity: 1;
}
.login .card input:focus {
  border-color: var(--selection-border);
  outline: 4px solid color-mix(in srgb, var(--selection-border) 22%, transparent);
}
.login .card .primary {
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  font-size: 14px;
}
.home-view {
  width: min(1700px, 100%);
  margin: 0 auto;
}
.mode-card { background: var(--surface); }
@media (max-width: 1050px) {
  #encountersView .management,
  #tournamentsView .management { grid-template-columns: minmax(0, 1fr); }
  #addEncounter,
  #addTournament {
    grid-row: 1;
    position: static;
    max-height: none;
    overflow: visible;
  }
}
@media (max-width: 650px) {
  #addEncounter,
  #addTournament,
  #addOrg { padding: 24px 18px; }
  .login .card { padding: 34px 24px; }
  .login .card h1 { font-size: 42px; }
  .login .card input { min-height: 58px; font-size: 17px; }
}

/* OchePilot Accessible UI 2026 */
:root {
  --a11y-bg: #eef3f8;
  --a11y-surface: #ffffff;
  --a11y-surface-alt: #e7eef6;
  --a11y-text: #142238;
  --a11y-muted: #526176;
  --a11y-border: #9eafc2;
  --a11y-action: #164f7a;
  --a11y-action-hover: #0e3b5d;
  --a11y-selected: #d5e8f7;
  --a11y-selected-text: #0b2c46;
  --a11y-focus: #f0a500;
  --a11y-danger: #a5232b;
  --radius: 14px;
}
html { font-size: clamp(17px, .35vw + 15px, 20px); scroll-behavior: smooth; }
body { background: var(--a11y-bg); color: var(--a11y-text); line-height: 1.55; }
body, button, input, select, textarea { font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font-size: 1rem; }
button, .button { min-height: 48px; padding: 11px 18px; font-weight: 750; letter-spacing: .01em; }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea {
  min-height: 52px; padding: 12px 14px; border: 2px solid var(--a11y-border); background: var(--a11y-surface); color: var(--a11y-text);
}
textarea { min-height: 120px; resize: vertical; }
label { gap: 8px; color: var(--a11y-text); font-weight: 700; }
small, .muted { color: var(--a11y-muted); font-size: .86rem; }
h1 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.15; }
h3 { font-size: clamp(1.18rem, 2vw, 1.5rem); }
p { font-size: 1rem; }
.primary { background: var(--a11y-action) !important; border: 2px solid var(--a11y-action) !important; color: #fff !important; text-shadow: none; }
.primary:hover { background: var(--a11y-action-hover) !important; border-color: var(--a11y-action-hover) !important; }
.outline { background: var(--a11y-surface) !important; border: 2px solid #587089 !important; color: #17344f !important; }
.outline:hover { background: var(--a11y-selected) !important; color: var(--a11y-selected-text) !important; }
.danger, .outline.danger { border-color: var(--a11y-danger) !important; color: var(--a11y-danger) !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 4px solid var(--a11y-focus) !important; outline-offset: 3px !important; box-shadow: none !important;
}
header { min-height: 86px; height: auto; }
header nav { row-gap: 8px; }
header nav button { min-height: 48px; color: #d7e1ec; }
header nav button.active { background: #d5e8f7 !important; color: #0b2c46 !important; box-shadow: inset 0 0 0 2px #7ba2c2; }
.view, .home-view { max-width: 1640px; margin-inline: auto; }
.toolbar { gap: 24px; margin-bottom: 26px; }
.card, .team-card, .dark-card, .catalog-card, .mode-card, .match-card {
  border: 2px solid var(--a11y-border); border-radius: 16px; background: var(--a11y-surface); color: var(--a11y-text); box-shadow: 0 8px 24px rgba(19, 45, 72, .08);
}
.catalog-card { min-height: 108px; gap: 16px; padding: 18px; }
.catalog-card h3 { margin-block: 5px; }
.catalog-card > span { min-width: min(100%, 320px); }
.match-badge, .overline { font-size: .78rem; letter-spacing: .08em; }
.mode-card { min-height: 310px; }
.mode-card p { min-height: auto; font-size: .96rem; }
.score-hero { border-radius: 18px; }
dialog { width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 18px; }
dialog.wide-dialog { width: min(1280px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(5, 16, 29, .72); backdrop-filter: blur(4px); }
.modal, dialog > form { max-height: calc(100vh - 28px); overflow: auto; padding: clamp(22px, 4vw, 42px); background: var(--a11y-surface); color: var(--a11y-text); }
.close { min-width: 48px; min-height: 48px; font-size: 1.5rem; }
.check-row { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; background: var(--a11y-surface-alt); }
.check-row input { width: 24px; height: 24px; flex: 0 0 auto; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.status-message { min-height: 1.6em; color: #164f7a; font-weight: 700; }
.mail-center { grid-column: 1 / -1; }
.mail-center form { display: grid; gap: 16px; margin-top: 20px; }
.login { padding: 24px; background: linear-gradient(145deg, #e7eef6, #f8fafc); }
.login .card { width: min(560px, 100%); padding: clamp(28px, 5vw, 54px); }
.login .card label { font-size: 1rem; }
.login .card input { font-size: 1.08rem; }
.login .text-button { color: #164f7a; font-size: .95rem; text-decoration: underline; }
@media (max-width: 900px) {
  header { position: static; padding: 14px 16px; flex-wrap: wrap; }
  header nav { width: 100%; overflow-x: auto; padding-bottom: 8px; }
  header nav button { flex: 0 0 auto; }
  .catalog-card { grid-template-columns: 1fr; align-items: stretch; }
  .catalog-card button { width: 100%; }
  .management, .settings-grid, .form-grid, .two-columns { grid-template-columns: 1fr !important; }
}
[data-theme="dark"] {
  --a11y-bg: #0d1825; --a11y-surface: #172536; --a11y-surface-alt: #223348; --a11y-text: #f2f6fa; --a11y-muted: #bdc9d6; --a11y-border: #667b92; --a11y-action: #4c91c4; --a11y-action-hover: #6aa9d4; --a11y-selected: #385875; --a11y-selected-text: #ffffff; --a11y-focus: #ffd166; --a11y-danger: #ff8a91;
  color-scheme: dark;
}
[data-theme="dark"] body, [data-theme="dark"] .login { background: var(--a11y-bg); color: var(--a11y-text); }
[data-theme="dark"] .outline { background: #172536 !important; border-color: #8ca0b6 !important; color: #f2f6fa !important; }
[data-theme="dark"] .outline:hover { background: var(--a11y-selected) !important; color: #fff !important; }
[data-theme="dark"] header nav button.active { background: #385875 !important; color: #fff !important; box-shadow: inset 0 0 0 2px #86a9c8; }
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), [data-theme="dark"] select, [data-theme="dark"] textarea { background: #0f1c2a; color: #fff; border-color: #778ba1; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
