* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0px;
  min-height: 100vh;
}

button, input, select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}


.btn {
  min-height: 44px;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  transition: filter 100ms, transform 100ms;
}

.btn:hover {
  filter: brightness(1.2);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: rgba(255, 201, 40, 0.45) solid 3px;
  outline-offset: 2px;
}

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


.modal {
  position: fixed;
  inset: 0px;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.modal[hidden] {
  display: none;
}

.setup {
  position: relative;
  overflow-x: hidden;
}

.field {
  display: grid;
  gap: 5px;
}

.field.half {
  grid-column: span 3;
}

.field label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.field input, .field select {
  width: 100%;
  min-height: 45px;
  border: 1px solid rgb(112, 48, 30);
  padding: 9px 11px;
  outline: none;
}

.field input:focus, .field select:focus {
  box-shadow: rgba(255, 201, 40, 0.13) 0px 0px 0px 3px;
}

.win-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

@media (max-width: 540px) {
  .field.half {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  ::before {
    transition: none !important;
  }

  ::after {
    transition: none !important;
  }
}


:root {
  color-scheme: light;
  --danger: #d94b55;
}

body {
  font-family: Inter, "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}



.btn {
  border-width: 1px;
  border-style: solid;
  border-image: none;
}

.btn.danger {
  color: rgb(188, 62, 73);
}

.modal {
  background: rgba(29, 67, 84, 0.44);
}

.setup {
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  border-width: 1px;
  border-style: solid;
  border-image: none;
  padding: clamp(22px, 5vw, 34px);
}

.stats-card {
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  border: 1px solid rgb(207, 227, 235);
  padding: clamp(22px, 5vw, 34px);
  color: rgb(23, 54, 70);
  background: rgb(255, 255, 255);
  box-shadow: rgba(24, 72, 94, 0.25) 0px 30px 90px;
}

.result-card {
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  border: 1px solid rgb(207, 227, 235);
  padding: clamp(22px, 5vw, 34px);
  color: rgb(23, 54, 70);
  background: rgb(255, 255, 255);
  box-shadow: rgba(24, 72, 94, 0.25) 0px 30px 90px;
}

.modal-kicker {
  color: rgb(22, 135, 184);
}

.stats-card h2 {
  margin: 4px 0px 20px;
  color: rgb(18, 61, 80);
  text-shadow: none;
  transform: none;
}

.result-card h2 {
  margin: 4px 0px 20px;
  color: rgb(18, 61, 80);
  text-shadow: none;
  transform: none;
}

.field label {
  color: rgb(101, 129, 142);
}

.field input {
  border-color: rgb(207, 225, 233);
  color: rgb(23, 54, 70);
  background: rgb(248, 251, 252);
}

.field select {
  border-color: rgb(207, 225, 233);
  color: rgb(23, 54, 70);
  background: rgb(248, 251, 252);
}

.stats-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.close-btn {
  width: 40px;
  height: 40px;
  border: 0px;
  color: rgb(84, 113, 127);
  background: rgb(237, 245, 248);
  font-size: 25px;
  cursor: pointer;
}

.stats-comparison {
  overflow: hidden;
  border: 1px solid rgb(217, 232, 238);
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(100px, 1.25fr) minmax(90px, 1fr);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid rgb(229, 238, 242);
  text-align: center;
}

.stats-row:last-child {
  border-bottom: 0px;
}

.stats-row:nth-child(2n) {
  background: rgb(247, 250, 252);
}

.stats-row.header {
  min-height: 52px;
  color: rgb(255, 255, 255);
  background: linear-gradient(135deg, rgb(38, 172, 216), rgb(22, 132, 178));
  font-weight: 900;
}

.stats-label {
  color: rgb(106, 133, 146);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.stats-number {
  color: rgb(23, 63, 82);
  font-size: 16px;
  font-weight: 900;
}

.result-card {
  text-align: center;
}

.result-card #resultSubtitle {
  margin: -12px 0px 22px;
  color: rgb(102, 131, 145);
}

.result-card .stats-comparison {
  margin-bottom: 20px;
  text-align: initial;
}

.win-actions {
  margin-top: 16px;
}

@media (max-width: 540px) {
  .stats-row {
    grid-template-columns: minmax(72px, 1fr) minmax(90px, 1.15fr) minmax(72px, 1fr);
  }

  .stats-label {
    font-size: 9px;
  }

  .stats-number {
    font-size: 13px;
  }
}


.quick-score {
  margin-top: 14px;
  border: 1px solid rgb(212, 229, 236);
  padding: 10px;
  background: rgb(248, 251, 252);
}

.quick-score > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.quick-score button {
  min-height: 42px;
  border: 1px solid rgb(175, 215, 230);
  color: rgb(8, 123, 169);
  background: rgb(255, 255, 255);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 920px) {
  .compact-game {
    display: flex;
    flex-direction: column;
  }

  .compact-game > .scoreboard {
    order: 1;
  }

}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0px, 0px, 0px, 0px) !important;
  white-space: nowrap !important;
}



.stats-note {
  margin: 12px 0px 0px;
  color: rgb(106, 133, 146);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  font-weight: 400;
}



:root {
  --black: #474a4d;
  --panel: #474a4d;
  --panel-2: #474a4d;
  --line: #eaf4fc;
  --red: #e9546b;
  --red-dark: #e2041b;
  --orange: #c3d825;
  --gold: #c3d825;
  --cream: #eaf4fc;
  --text: #eaf4fc;
  --muted: #eaf4fc;
  --green: #c3d825;
  --shadow: none;
}

body {
  color: rgb(234, 244, 252);
}

body::before {
  display: none;
}


.setup {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}


input {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}

select {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}

.btn {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}


.btn.primary {
  color: rgb(56, 60, 60);
  background: rgb(195, 216, 37);
  border-color: rgb(195, 216, 37);
  box-shadow: none;
}


.setup label {
  color: rgb(234, 244, 252);
}





.checkout-darts-card {
  width: min(420px, 100%);
  text-align: center;
}

.checkout-darts-card h2 {
  font-size: 20px;
}

.checkout-darts-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0px;
}

.checkout-darts-choices .btn {
  min-height: 56px;
  font-size: 17px;
}



#historyEditForm {
  width: min(720px, 100%);
  max-height: 90dvh;
  overflow: auto;
}

#historyEditRows {
  display: grid;
  gap: 8px;
  margin-block: 20px;
}

.history-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgb(187, 187, 187);
  color: rgb(23, 37, 44);
}

.history-edit-row input {
  width: 110px;
  min-height: 48px;
  font-size: 24px;
  color: rgb(23, 37, 44);
  background: rgb(255, 255, 255);
  border: 1px solid rgb(136, 136, 136);
  padding: 6px;
}

#historyEditError {
  color: rgb(180, 37, 42);
}



#keySettingsPanel {
  width: min(680px, 100%);
  max-height: 90dvh;
  overflow: auto;
}

.key-setting-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-block: 5px;
  border-bottom: 1px solid #cfd8dd;
}

.key-setting-row > span {
  padding-inline-start: 12px;
  border-inline-start: 1px solid #a4b0b6;
}

#keyEditDialog {
  width: min(440px, calc(100% - 24px));
  margin: auto;
}

#keyEditDialog::backdrop { background: #17252c80; }

.key-edit-controls {
  display: grid;
  gap: 8px;
}

.key-edit-controls select,
.key-edit-controls input {
  min-height: 44px;
  padding: 8px;
  color: rgb(23, 37, 44);
  background: white;
  border: 1px solid rgb(136, 147, 153);
}

#keySettingsStatus {
  color: rgb(180, 37, 42);
}


/* Button-based setup; game and result screens retain their existing styles. */
#setupModal .setup{width:min(960px,100%);max-width:960px;padding:24px}
#setupModal .setup .field.half{grid-column:span 1}
#setupModal .setup select[hidden]{display:none}
#setupModal .setup .setup-choices{display:flex;flex-wrap:wrap;gap:7px}
#setupModal .setup .setup-choice{flex:1 0 62px;min-height:46px;padding:10px 12px;border:1px solid #8a9397;background:#474a4d;color:#eaf4fc;font-size:13px;font-weight:600;cursor:pointer}
#setupModal .setup .setup-choice:hover{border-color:#eaf4fc}
#setupModal .setup .setup-choice.selected{background:#d9e1e5;color:#20262a;border-color:#d9e1e5}
#setupModal .setup .setup-choice:focus-visible{outline:2px solid #b7d4e4;outline-offset:2px}
@media(max-width:600px){#setupModal .setup{padding:18px 14px}#setupModal .setup .setup-choice{flex-basis:78px;min-height:46px;padding:9px 7px;font-size:12px}}

