:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #191c1f;
  --line: #34383c;
  --text: #f3f4f5;
  --muted: #9ca3a9;
  --red: #e3444e;
  --blue: #4089ee;
  --lime: #c5d843;
  --player: var(--red);
  font-family: Arial,"Yu Gothic",Meiryo,sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #24282c;
  color: var(--text);
  min-height: 42px;
  padding: 9px 12px;
  transition: background .12s;
}

button:hover:not(:disabled) {
  background: #353b41;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

h2, p {
  margin-top: 0;
}

.app {
  max-width: 1800px;
  margin: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid #2d3033;
  padding-right: 24px;
}

.game-badge {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: var(--blue);
  min-width: 260px;
}

.game-badge strong {
  font-size: 17px;
  letter-spacing: .055em;
}

.game-progress {
  font-size: 13px;
}

.game-progress>span {
  color: var(--muted);
  letter-spacing: .12em;
}

.game-progress strong {
  font-size: 20px;
  font-weight: 500;
}

.text-button {
  padding: 4px 8px;
  min-height: 32px;
  font-size: 12px;
  background: transparent;
}

.history-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.empty-history {
  font-size: 12px;
  color: #737b82;
  line-height: 1.8;
  padding: 6px;
}

.scoreboard {
  min-width: 0;
}

.player-two {
  --player: var(--blue);
}

.marks-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.marks-table th {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 0 8px 12px;
  overflow-wrap: anywhere;
}

.marks-table tbody tr {
  border-top: 1px solid var(--line);
}

.marks-table td {
  text-align: center;
  position: relative;
}

.target-number {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.target-number span {
  display: block;
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

.marks-table td:first-child {
  color: var(--red);
}

.marks-table td:last-child {
  color: var(--blue);
}

.mark-icon {
  display: block;
  margin: auto;
  width: 38px;
  height: 38px;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.mark-empty {
  width: 5px;
  height: 5px;
  display: block;
  background: #52585e;
  border-radius: 50%;
  margin: auto;
}

.scoring-cell {
  background: color-mix(in srgb,currentColor 7%,transparent);
}

.marks-table tr.both-closed {
  background: #ffffff02;
}

.both-closed .target-number {
  color: #68727b;
}

.both-closed .mark-icon {
  opacity: .35;
}

.dart-slots {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
}

.dart-slot {
  min-height: 55px;
  border: 1px solid var(--line);
  background: #ffffff03;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.dart-slot>span {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: .07em;
}

.dart-slot strong {
  font-size: 17px;
  font-weight: 500;
}

.dart-slot.pending {
  border-color: var(--player);
  background: color-mix(in srgb,var(--player) 8%,transparent);
}

.change-button {
  background: var(--lime);
  color: #171c09;
  border-color: var(--lime);
  font-size: 12px;
  font-weight: 700;
}

.change-button:hover:not(:disabled) {
  background: #d6e966;
}

.match-footer {
  display: grid;
  grid-template-columns: minmax(0,1fr) 180px minmax(0,1fr);
  gap: 18px;
  min-height: 130px;
  background: #070809;
  padding: 0 28px;
}

.footer-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 22px;
  min-width: 0;
  border-top: 3px solid transparent;
}

.footer-player.active {
  border-top-color: var(--player);
}

.footer-player.player-one.active {
  background: #D20A13;
}

.footer-player.player-two.active {
  background: #1853B5;
}

.footer-player.active .player-mpr {
  color: #ffffffd9;
}

.footer-player>div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.footer-player.player-two {
  text-align: right;
}

.player-label {
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--player);
}

.footer-player>div>strong {
  font-size: clamp(18px,2.1vw,34px);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.player-mpr {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .03em;
}

.player-mpr b {
  color: var(--text);
  font-size: 16px;
  margin-left: 6px;
  font-weight: 400;
}

.footer-score {
  font-size: clamp(44px,5.3vw,82px);
  font-weight: 500;
  letter-spacing: -.04em;
  color: #989fa6;
  font-variant-numeric: tabular-nums;
}

.active .footer-score {
  color: #fff;
}

.leg-score {
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.leg-score>span {
  font-size: 11px;
  letter-spacing: .09em;
  color: var(--muted);
}

.leg-score>div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leg-score strong {
  font-size: 40px;
  font-weight: 400;
}

.leg-score div span {
  font-size: 9px;
  color: #737b81;
  letter-spacing: .1em;
}

.message {
  padding: 9px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 36px;
  border-top: 1px solid #1d2023;
  background: #0c0e10;
}

.storage-warning {
  padding: 8px;
  color: #e9c882;
  font-size: 12px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

dialog {
  padding: 0;
  border: 1px solid #464d54;
  border-radius: 10px;
  background: #1b1f23;
  color: var(--text);
  width: min(580px,calc(100% - 28px));
  max-height: 90dvh;
  box-shadow: 0 20px 100px #0009;
}

dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 28px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 16px;
}

.kicker {
  font-size: 9px;
  color: var(--red);
  letter-spacing: .2em;
  margin-bottom: 10px;
}

.dialog-card h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.close-button {
  font-size: 24px;
  background: transparent;
  border: 0;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
}

.dialog-card>p:not(.kicker) {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 14px;
  margin: 22px 0;
}

.field {
  display: grid;
  align-content: start;
  gap: 8px;
  font-size: 11px;
  color: #b4bbc2;
}

.field input, .field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #444c54;
  border-radius: 4px;
  background: #101417;
  color: #fff;
  min-height: 46px;
  padding: 10px;
  font-size: 13px;
}

.field input:focus, .field select:focus {
  outline: 2px solid var(--lime);
  outline-offset: 1px;
}

.name-one {
  color: var(--red);
}

.name-two {
  color: var(--blue);
}

.primary-button {
  background: var(--lime);
  color: #192009;
  border-color: var(--lime);
  font-weight: 700;
  min-height: 48px;
  width: 100%;
}

.primary-button:hover:not(:disabled) {
  background: #d6e966;
}

.setup-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 20px 0;
}

.result-card {
  text-align: center;
}

.result-card h2 {
  font-size: 34px;
  margin-bottom: 12px;
}

.stats-comparison {
  margin: 22px 0;
}

.stats-comparison table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.stats-comparison th {
  padding: 12px 4px;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.stats-comparison th:first-child {
  width: 34%;
  font-size: 11px;
  color: var(--muted);
}

.stats-comparison th:nth-child(2) {
  color: var(--red);
}

.stats-comparison th:nth-child(3) {
  color: var(--blue);
}

.stats-comparison td {
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stats-comparison td:first-child {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-actions>.primary-button {
  grid-column: 1/-1;
}

@media(min-width:1500px) {
  .marks-table tbody tr {
    height: 63px;
  }

  .target-number {
    font-size: 36px;
  }

  .mark-icon {
    width: 44px;
    height: 44px;
  }

}

@media(max-width:1100px) {
  .match-footer {
    padding: 0 18px;
    grid-template-columns: 1fr 120px 1fr;
    gap: 8px;
  }

  .footer-player {
    padding: 14px;
  }

  .game-badge {
    min-width: 220px;
    padding: 16px 18px;
  }

  .game-badge strong {
    font-size: 15px;
  }

}

@media(max-width:920px) {
  .history-panel {
    grid-column: 1/-1;
    grid-row: 2;
  }

  .topbar {
    min-height: 75px;
    gap: 18px;
    padding-right: 18px;
  }

  .game-progress strong {
    font-size: 15px;
  }

  .game-progress {
    font-size: 10px;
  }

  .marks-table tbody tr {
    height: 53px;
  }

  .match-footer {
    min-height: 105px;
  }

  .footer-score {
    font-size: 50px;
  }

  .footer-player>div>strong {
    font-size: 19px;
  }

}

@media(max-width:600px) {
  .topbar {
    gap: 12px;
    min-height: 67px;
    padding-right: 10px;
    flex-wrap: wrap;
  }

  .game-badge {
    min-width: 0;
    padding: 12px;
    flex: 1;
  }

  .game-badge strong {
    font-size: 12px;
  }

  .game-progress {
    padding: 8px 0;
    gap: 5px;
  }

  .game-progress strong {
    font-size: 12px;
  }

  .scoreboard {
    order: 0;
  }

  .history-panel {
    order: 2;
  }

  .marks-table tbody tr {
    height: 42px;
  }

  .marks-table th {
    font-size: 10px;
  }

  .target-number {
    font-size: 25px;
  }

  .target-number span {
    font-size: 7px;
  }

  .mark-icon {
    width: 30px;
    height: 30px;
  }

  .dart-slots {
    gap: 8px;
  }

  .dart-slot {
    min-height: 51px;
  }

  .match-footer {
    grid-template-columns: minmax(0,1fr) 65px minmax(0,1fr);
    padding: 0 6px;
    gap: 5px;
    min-height: 112px;
  }

  .footer-player {
    padding: 12px 8px;
    gap: 5px;
  }

  .footer-player>div {
    gap: 7px;
  }

  .footer-player>div>strong {
    font-size: 13px;
  }

  .footer-score {
    font-size: 32px;
  }

  .player-label {
    font-size: 7px;
  }

  .player-mpr {
    font-size: 8px;
  }

  .player-mpr b {
    font-size: 12px;
    margin-left: 3px;
  }

  .leg-score>span {
    font-size: 8px;
    letter-spacing: 0;
  }

  .leg-score strong {
    font-size: 25px;
  }

  .leg-score div span {
    font-size: 7px;
  }

  .message {
    font-size: 10px;
    padding: 8px 12px;
  }

  .dialog-card {
    padding: 22px 18px;
  }

  .dialog-card h2 {
    font-size: 20px;
  }

  .form-grid {
    gap: 16px 10px;
  }

  .field {
    font-size: 10px;
  }

  .field input, .field select {
    font-size: 12px;
    padding: 8px;
  }

  .result-card h2 {
    font-size: 27px;
  }

}

.marks-table tbody .target-number {
  font-size: 30px;
  font-weight: 600;
  padding: 6px 2px;
  letter-spacing: -.02em;
  color: var(--text);
}

.marks-table tbody .both-closed .target-number {
  color: #68727b;
}

@media(min-width:1500px) {
  .marks-table tbody .target-number {
    font-size: 36px;
  }

}

@media(max-width:600px) {
  .marks-table tbody .target-number {
    font-size: 25px;
  }

}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
    scroll-behavior: auto!important;
  }

}

.desktop-history {
  display: none;
}

@media (min-width: 921px) {
  .app {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    display: grid;
  }

  .topbar {
    min-height: 0;
  }

  .game-badge {
    padding-block: 10px;
  }

  .history-panel {
    min-height: 0;
    overflow: hidden;
  }

  .text-button {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .desktop-history {
    display: flex;
    flex: 1;
    min-height: 0;
    padding-top: 12px;
  }

  .history-player-group:not([hidden]) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
  }

  .history-player-group[hidden] {
    display: none;
  }

  .history-player-heading {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--player);
    margin: 0 0 8px;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--player);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .history-player-rounds {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #41464b transparent;
  }

  .history-round {
    padding: 8px 5px;
    border-bottom: 1px solid #30353a;
  }

  .history-round.current {
    background: #ffffff05;
  }

  .history-player-rounds .empty-history {
    font-size: 10px;
  }

  .scoreboard {
    --closed-mark-size: clamp(30px, 5.5dvh, 64px);
    min-height: 0;
    display: grid;
  }

  .marks-table {
    height: 100%;
    min-height: 0;
  }

  .marks-table tbody tr {
    height: auto;
  }

  .marks-table tbody .target-number {
    padding: 2px;
    font-size: clamp(32px, 5.9dvh, 70px);
    line-height: 1;
  }

  .target-number span {
    font-size: 8px;
    margin-top: 3px;
  }

  .mark-icon {
    width: var(--closed-mark-size);
    height: var(--closed-mark-size);
  }

  .both-closed .target-number {
    position: relative;
  }

  .both-closed .target-number::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(242.307692% + var(--closed-mark-size) + 16px);
    height: 3px;
    transform: translate(-50%, -50%);
    background: #fff;
    z-index: 1;
    pointer-events: none;
  }

  .dart-slot {
    min-height: 36px;
    gap: 3px;
  }

  .dart-slot > span {
    font-size: 7px;
  }

  .dart-slot strong {
    font-size: 15px;
  }

  .match-footer {
    min-height: 0;
    padding-inline: 16px;
    grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1fr);
    gap: 12px;
  }

  .footer-player {
    padding: 6px 14px;
    gap: 8px;
    overflow: hidden;
  }

  .footer-player > div {
    gap: 2px;
  }

  .footer-player > div > strong {
    font-size: clamp(16px, 2.1vw, 32px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .footer-score {
    font-size: clamp(44px, 9.5dvh, 92px);
    line-height: 1;
    max-width: 65%;
  }

  .message {
    display: none;
  }

  .storage-warning {
    margin: 0;
    padding-block: 5px;
  }

}

@media (min-width: 921px) and (max-height: 650px) {
  .app {
    grid-template-rows: 54px minmax(0, 1fr) 104px auto;
  }

  .scoreboard {
    --closed-mark-size: clamp(22px, 5dvh, 32px);
    grid-template-rows: 26px minmax(0, 1fr);
  }

  .marks-table tbody .target-number {
    font-size: clamp(22px, 5.5dvh, 34px);
  }

  .target-number span {
    display: none;
  }

  .dart-slot {
    min-height: 32px;
  }

  .footer-player {
    padding: 7px 10px;
  }

  .footer-score {
    font-size: clamp(60px, 13.5dvh, 85px);
  }

  .player-mpr {
    font-size: 10px;
  }

}

.field select:disabled, .field input:disabled {
  opacity: .5;
}

#setupDialog {
  width: min(960px,calc(100% - 16px));
  max-height: calc(100dvh - 16px);
}

#setupDialog .dialog-card {
  padding: 20px;
}

#setupDialog .dialog-heading {
  margin-bottom: 12px;
  align-items: center;
}

#setupDialog .dialog-heading .kicker {
  display: none;
}

#setupDialog .dialog-heading h2 {
  font-size: 16px;
}

@media (max-width: 920px), (pointer: coarse), (hover: none) {
  #setupDialog .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
  }
}

@media (min-width: 921px) and (hover: hover) and (pointer: fine) {
  #setupDialog .settings-layout {
    width: min(1600px, 100%);
    --settings-controls-ratio: 3fr;
    padding-block: clamp(6px, calc(10dvh - 54px), 16px);
  }
  #setupDialog #setupForm { padding:clamp(8px, calc(10dvh - 52px), 20px); }
  #setupDialog .form-grid .match-column:not(.match-players) { display:contents; }
  #setupDialog .form-grid .setup-choice-field { grid-column:auto; }
  #setupDialog .form-grid .setup-choice-field:has([data-setup-choice="overkill"]) { grid-column:1/-1; }
  #setupDialog .match-players {
    grid-column:1/-1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  #setupDialog .form-grid {
    display: grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:clamp(6px, calc(10dvh - 54px), 14px);
  }
  #setupDialog .setup-player {
    margin-bottom: 0;
  }
  #setupDialog .player-setup-heading {
    flex-wrap: wrap;
  }
}

#setupDialog select[hidden] {
  display: none!important;
}

#setupDialog .setup-player {
  min-width: 0;
  gap: 6px;
}

#setupDialog .player-setup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

#setupDialog .setup-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  min-height: 26px;
}

#setupDialog .setup-switch input {
  position: absolute;
  opacity: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
}









#setupDialog .com-options {
  display: grid;
  grid-template-columns: minmax(0,1fr) 70px;
  gap: 8px;
}

#setupDialog .setup-choice-field {
  grid-column: 1/-1;
}

#setupDialog .setup-choices {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  min-height: 0;
}

#setupDialog .setup-choice {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #8a9397;
  background: #474a4d;
  color: #eaf4fc;
  font-size: 12px;
  letter-spacing: 0;
}

@media (max-width: 920px), (pointer: coarse), (hover: none) {
  #setupDialog .setup-choice {
    white-space: nowrap;
  }
  #setupDialog .setup-choice, #setupDialog .numeric-choices .setup-choice {
    padding: 10px 12px;
  }
}

@media (min-width: 921px) and (hover: hover) and (pointer: fine) {
  #setupDialog .setup-choice {
    white-space: normal;
  }
  #setupDialog .setup-choice, #setupDialog .numeric-choices .setup-choice {
    padding: 8px 2px;
  }
}

#setupDialog .setup-choice:disabled {
  opacity: .35;
  cursor: not-allowed;
}

#setupDialog .setup-choice:focus-visible {
  outline: 2px solid #b7d4e4;
  outline-offset: 2px;
}

#setupDialog .numeric-choices .setup-choice {
  font-size: clamp(16px,4.5vw,22px);
  font-weight: 700;
}

#setupDialog .setup-choice-field small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
}

@media(prefers-reduced-motion:reduce) {
  

}

#setupDialog {
  background: #474a4d;
  color: #eaf4fc;
  border: 1px solid #eaf4fc;
  border-radius: 0;
  box-shadow: none;
  font-family: Meiryo,"メイリオ","Noto Sans JP",sans-serif;
}

#setupDialog button, #setupDialog input, #setupDialog select {
  font-family: inherit;
  border-radius: 0;
  box-shadow: none;
}

#setupDialog .field label {
  color: #65818e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

#setupDialog .field input:not([type="checkbox"]), #setupDialog .field select {
  color: #173646;
  background: #f8fbfc;
  border: 1px solid #cfe1e9;
  font-size: 13px;
  padding: 9px 11px;
}

#setupDialog .setup-choice, #setupDialog .numeric-choices .setup-choice {
  color: #eaf4fc;
  background: #474a4d;
  border: 1px solid #8a9397;
  font-size: 13px;
  font-weight: 600;
  min-height: 46px;
  letter-spacing: 0;
}

#setupDialog .setup-choice[aria-pressed="true"] {
  color: #20262a;
  background: #d9e1e5;
  border-color: #d9e1e5;
}

#setupDialog .setup-choice:hover:not(:disabled) {
  border-color: #eaf4fc;
}

#setupDialog .field .setup-switch {
  font-size: 12px;
  letter-spacing: 0;
  gap: 8px;
  min-height: 32px;
  line-height: 1.4;
}

#setupDialog .setup-switch input {
  width: 44px;
  height: 26px;
}







#setupDialog .primary-button {
  width: 100%;
  background: #c3d825;
  border-color: #c3d825;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: .1em;
}

#setupDialog .primary-button:hover:not(:disabled) {
  background: #c3d825;
  filter: brightness(1.2);
}

.history-panel {
  order: 0;
  grid-column: 1;
  grid-row: 1;
}

.scoreboard {
  order: 1;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(0,1fr);
  min-height: 0;
}

.scoreboard .marks-table {
  height: 100%;
}

.marks-table .input-col {
  width: 34%;
}

.marks-table .mark-col {
  width: 10%;
}

.marks-table .number-col {
  width: 12%;
}

.marks-table tbody td:nth-child(2) {
  color: var(--red);
}

.marks-table tbody td:nth-child(4) {
  color: var(--blue);
}

.marks-table tbody tr {
  height: calc(100% / 7);
}

.marks-table .board-input {
  padding: 3px;
  color: var(--player);
}

.board-input.player-one {
  --player: var(--red);
}

.board-input.player-two {
  --player: var(--blue);
}

.board-hit-buttons {
  display: flex;
  align-items: center;
}

.board-hit-buttons button, .board-input .board-miss {
  flex: 0 0 var(--input-size);
  width: var(--input-size);
  height: var(--input-size);
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--player);
  border-radius: 0;
  background: #191c1f;
  color: var(--text);
  font-size: clamp(12px,1.5vw,20px);
  font-weight: 700;
}

.board-hit-buttons button:disabled, .board-input .board-miss:disabled {
  opacity: .28;
}

.board-hit-buttons button.keyboard-selected:not(:disabled) {
  background: color-mix(in srgb,var(--player) 22%,#191c1f);
}

.board-input .board-miss {
  min-height: 0;
  font-size: clamp(8px,2cqh,12px);
  letter-spacing: 0;
}

@media (min-width:921px) {
  .scoreboard {
    grid-template-rows: minmax(0,1fr);
  }

}

.visit-award {
  color: var(--player);
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  text-align: center;
}

.visit-award:empty {
  display: none;
}

.scoreboard {
  container-type: size;
  --input-size: clamp(24px,min(12.2cqh,7.5cqw),72px);
}

.marks-table .target-number {
  text-align: center;
  padding-inline: 0;
}

.marks-table .board-input.player-one {
  padding-inline: 0 8px;
  text-align: left;
}

.marks-table .board-input.player-two {
  padding-inline: 8px 0;
  text-align: right;
}

.board-input.player-one .board-hit-buttons {
  justify-content: flex-start;
}

.board-input.player-two .board-hit-buttons {
  justify-content: flex-end;
}

.board-hit-buttons {
  --hit-gap: 4px;
  gap: var(--hit-gap);
}

.board-hit-buttons button {
  flex-basis: calc(var(--input-size) * 1.5);
  width: calc(var(--input-size) * 1.5);
  height: var(--input-size);
  aspect-ratio: 1.5;
}

.bull-buttons button {
  flex-basis: calc(var(--input-size) * 2.25 + var(--hit-gap) * .5);
  width: calc(var(--input-size) * 2.25 + var(--hit-gap) * .5);
  aspect-ratio: auto;
}

.history-player-rounds .history-round {
  display: grid;
  grid-template-columns: 24px repeat(3,minmax(0,1fr));
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  min-height: 30px;
  border-bottom: 0;
}

.history-round > span:first-child {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.history-dart-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}

.history-dart-symbol .mark-icon {
  width: 100%;
  max-width: 24px;
  height: auto;
  aspect-ratio: 1;
}

.board-input .bull-buttons {
  justify-content: flex-start;
  overflow: visible;
}

.board-input.player-two .bull-buttons {
  margin-left: auto;
}

.board-input .bull-buttons .board-miss {
  flex: 0 0 calc(var(--input-size) * 2.25 + var(--hit-gap) * .5);
  width: calc(var(--input-size) * 2.25 + var(--hit-gap) * .5);
  height: var(--input-size);
  aspect-ratio: auto;
  font-size: clamp(9px,2cqh,13px);
}

.topbar {
  min-height: 44px;
  flex-wrap: nowrap;
  padding: 0 16px 0 0;
}

.game-badge {
  padding: 8px 16px;
}

.game-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.game-progress strong, .game-progress > span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

#nextBtn {
  text-align: center;
  line-height: 1.25;
  white-space: normal;
}

#nextBtn .change-part {
  display: inline-block;
  white-space: nowrap;
}

@media (min-width:921px) {
  .app {
    grid-template-rows: 44px minmax(0,1fr) clamp(118px,18.5dvh,180px) auto;
  }

}

.board-input .bull-buttons {
  width: calc(var(--input-size) * 4.5 + var(--hit-gap) * 2);
}

.board-input .bull-buttons button:not(.board-miss) {
  flex-basis: calc(var(--input-size) * 1.5);
  width: calc(var(--input-size) * 1.5);
}

.board-input.player-two .bull-buttons {
  justify-content: flex-end;
}

.history-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  flex-shrink: 0;
}

.history-controls button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 5px 2px;
  font-size: 11px;
}

#setupDialog .setup-switch input[type="checkbox"] { appearance: auto; position: static; opacity: 1; width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: #38667e; cursor: pointer; }
#setupDialog .setup-switch input:focus-visible { outline: 2px solid #b7d4e4; outline-offset: 3px; }
