/* Shared controls, dialogs and game states. Layout lives in landscape.css. */
* {
  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;
}

.app {
  margin: 0px auto;
}

.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;
}

.form-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0px, 1fr));
  gap: 12px;
}

.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;
}

.start-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.win-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.half {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  ::before {
    transition: none !important;
  }

  ::after {
    transition: none !important;
  }
}

.score-menu {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.score-head-grid {
  display: grid;
  align-items: stretch;
}

.match-leg-title {
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1.25;
  white-space: nowrap;
}

.score-player {
  position: relative;
  min-width: 0px;
  border-right-width: 1px;
  border-right-style: solid;
  padding: 10px 12px 9px;
}

.score-player:last-child {
  border-right: 0px;
}

.score-player.player-one {
  border-right: 0px;
}

.score-player-name {
  overflow: hidden;
  font-size: clamp(14px, 2.5vw, 20px);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-action-btn {
  min-width: 0px;
  min-height: 27px;
  border-width: 1px;
  border-style: solid;
  border-image: none;
  padding: 3px 2px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.player-action-btn:hover:not(:disabled) {
  filter: brightness(1.16);
}

.player-action-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.score-values {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 8px;
  margin-top: 7px;
}

.score-value {
  min-width: 0px;
  text-align: right;
}

.score-value span {
  display: block;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.score-value strong {
  display: block;
  overflow: hidden;
  font-size: clamp(25px, 6vw, 42px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-sheet-wrap {
  scrollbar-color: rgb(114, 48, 29) transparent;
}

@media (max-width: 540px) {
  .score-player {
    padding-inline: 8px;
  }

  .score-values {
    gap: 4px;
  }
}

:root {
  color-scheme: light;
  --danger: #d94b55;
}

body {
  font-family: Inter, "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}



.score-menu {
  padding: 9px 12px;
}

.score-player {
  opacity: 0.72;
}

.score-player.active {
  opacity: 1;
}

.score-player-name {
  color: rgb(21, 60, 79);
}

.match-leg-title {
  color: rgb(100, 131, 145);
}

.player-action-btn:not(:disabled):active {
  background: rgb(223, 244, 251);
}

.score-value span {
  color: rgb(118, 144, 157);
}

.score-value.to-go strong {
  color: rgb(20, 63, 82);
}

.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);
}

.start-btn {
  border-width: 0px;
  border-style: none;
  border-image: none;
  color: rgb(255, 255, 255);
  box-shadow: rgba(8, 126, 174, 0.24) 0px 10px 25px;
}

.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;
  }
}

.mic-btn {
  width: 112px;
  flex: 0 0 auto;
  border-width: 1px;
  border-style: solid;
  border-image: none;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.mic-btn.listening,
.mic-btn[aria-pressed="true"] {
  border-color: #c3d825;
  color: #17252c;
  background: #c3d825;
  box-shadow: 0 0 12px #c3d82580;
}

.voice-status {
  min-height: 31px;
  margin: 9px 0px;
  padding: 7px 10px;
  color: rgb(104, 133, 147);
  background: rgb(242, 248, 250);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.keypad {
  display: grid;
  width: min(300px, 100%);
  margin: 0px auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.keypad button {
  min-height: 48px;
  border: 1px solid rgb(203, 223, 231);
  color: rgb(36, 75, 93);
  background: rgb(255, 255, 255);
  box-shadow: rgba(34, 84, 107, 0.06) 0px 3px 7px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.keypad button:hover {
  background: rgb(240, 249, 252);
}

.keypad .key-clear {
  color: rgb(189, 72, 81);
  background: rgb(255, 247, 247);
}

.keypad .key-enter {
  color: rgb(255, 255, 255);
  background: rgb(20, 139, 184);
  font-size: 11px;
}

.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;
  }

  .compact-game > .compact-input {
    order: 2;
  }
}

@media (max-width: 430px) {
  .mic-btn {
    width: 100%;
    min-height: 52px;
  }
}

.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;
}


.score-menu .mic-btn.compact {
  width: auto;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 0px;
  padding: 6px 10px;
}

@keyframes cursorBlink { 
  50% { opacity: 0; }
}

.compact-input .voice-status {
  min-height: 24px;
  margin: 0px 0px 7px;
  padding: 4px 8px;
}

.compact-input .keypad {
  gap: 0px;
  border-top: 1px solid rgb(184, 204, 213);
  border-left: 1px solid rgb(184, 204, 213);
}

.compact-input .keypad button {
  margin: 0px;
  border-width: 0px 1px 1px 0px;
  border-style: none solid solid none;
  border-color: currentcolor rgb(184, 204, 213) rgb(184, 204, 213) currentcolor;
  border-image: none;
  box-shadow: none;
}

.compact-input .quick-score {
  margin: 7px auto 0px;
  border: 0px;
  padding: 0px;
  background: transparent;
}

.score-sheet-wrap {
  overscroll-behavior: contain;
}

@media (max-width: 540px) {
  .score-menu {
    font-size: 8px;
  }

  .match-leg-title {
    font-size: 6px;
    letter-spacing: 0px;
  }

  .player-action-btn {
    min-height: 24px;
    padding-inline: 1px;
    font-size: 7px;
  }

  .compact-game {
    height: calc(100dvh - 60px);
    min-height: 0px;
    grid-template-rows: auto auto;
    align-content: start;
  }
}

.score-sheet-wrap {
  overflow-y: auto;
}

.score-player.player-one .score-values {
  grid-template-columns: minmax(0px, 1fr) minmax(72px, 0.45fr);
}

.score-player.player-two .score-values {
  grid-template-columns: minmax(72px, 0.45fr) minmax(0px, 1fr);
}

.score-value.to-go strong {
  overflow: visible;
  text-overflow: clip;
}

.compact-input .keypad {
  max-width: none;
}

.compact-input .quick-score {
  width: 100%;
  max-width: none;
}

@media (max-width: 540px) {
  .score-head-grid {
    grid-template-columns: minmax(0px, 1fr) 92px minmax(0px, 1fr);
  }
}

@media (max-width: 540px) {
  .score-player.player-one .score-values {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .score-player.player-two .score-values {
    gap: 2px;
  }

  .score-player.player-two .score-values {
    grid-template-columns: 1fr;
  }

  .score-player.player-one .score-value {
    text-align: center;
  }

  .score-player.player-two .score-value {
    text-align: center;
  }

  .score-player.player-two .score-values .score-value:first-child {
    order: 2;
  }

  .score-player.player-two .score-values .score-value.to-go {
    order: 1;
  }

  .score-value.to-go strong {
    white-space: nowrap;
  }

  .score-value strong {
    font-size: 20px;
  }
}

.score-player.player-one .score-values {
  display: block;
  margin-top: 3px;
}

.score-player.player-two .score-values {
  display: block;
  margin-top: 3px;
}

.score-player.player-one .score-value {
  text-align: center;
}

.score-player.player-two .score-value {
  text-align: center;
}

.score-value.to-go span {
  line-height: 1;
}

@media (max-width: 540px) {
  .score-player-name {
    font-size: 12px;
  }
}

.score-sheet-wrap {
  height: 236px;
  max-height: 236px;
}

@media (max-width: 540px) {
  .score-sheet-wrap {
    height: 214px;
    max-height: 214px;
  }
}

.score-value strong {
  font-family: Arial, sans-serif;
  font-weight: 500;
  line-height: 1;
  letter-spacing: normal;
}

.score-value.to-go strong {
  font-family: Arial, sans-serif;
  font-size: clamp(76px, 18vw, 132px);
  line-height: 1;
  letter-spacing: normal;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .score-value.to-go strong {
    font-size: clamp(56px, 21vw, 88px);
    line-height: 1;
    letter-spacing: normal;
  }
}

#playerName0 {
  font-weight: 950;
}

#playerName1 {
  font-weight: 950;
}

.score-value.to-go span {
  font-weight: 400;
}

.compact-input .keypad button {
  font-weight: 800;
}

.stats-note {
  margin: 12px 0px 0px;
  color: rgb(106, 133, 146);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  font-weight: 400;
}

.score-value.to-go strong {
  font-weight: 600;
}

.com-avg-field {
  transition: opacity 120ms, filter 120ms;
}

.com-avg-field.inactive {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.com-avg-field.inactive select {
  color: rgb(113, 133, 143);
  background: rgb(231, 238, 241);
  cursor: not-allowed;
}

.com-throw-overlay {
  position: fixed;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: transparent;
}

.com-throw-overlay[hidden] {
  display: none;
}

.com-throw-card {
  border-width: 2px;
  border-style: solid;
  border-image: none;
  border-radius: 0px;
}

@keyframes comThrowIn { 
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0px) scale(1); }
}

.com-throw-heading {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgb(199, 223, 232);
  padding: 0px 2px 9px;
}

.com-throw-heading span {
  color: rgb(102, 131, 146);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.com-throw-heading strong {
  overflow: hidden;
  color: rgb(8, 126, 174);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.com-throw-darts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.com-throw-dart {
  text-align: center;
}

.com-throw-dart span {
  display: block;
  color: rgb(113, 139, 151);
  font-size: 9px;
}

.com-throw-dart strong {
  display: block;
  margin-top: 3px;
  color: rgb(21, 62, 81);
  font-family: Arial, sans-serif;
  font-size: clamp(30px, 9vw, 48px);
  line-height: 1;
  font-weight: 400 !important;
}

.com-throw-dart small {
  display: block;
  color: rgb(8, 126, 174);
  font-size: 10px;
}

.com-throw-total {
  margin-top: 9px;
  border-top: 1px solid rgb(199, 223, 232);
  padding-top: 8px;
}

.com-throw-total span {
  color: rgb(113, 139, 151);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.com-throw-total strong {
  color: rgb(8, 126, 174);
  font-family: Arial, sans-serif;
  font-size: 34px;
  line-height: 1;
  font-weight: 400 !important;
}

.com-throw-card.bust {
  border-color: rgb(217, 75, 85);
}

.com-throw-card.bust .com-throw-total strong {
  color: rgb(188, 62, 73);
  font-size: 24px;
}

.com-throw-card.checkout {
  border-color: rgb(38, 162, 105);
}

.com-throw-card.checkout .com-throw-total strong {
  color: rgb(24, 121, 78);
}

@media (max-width: 540px) {
  .com-throw-card {
    width: min(390px, 100%);
    padding: 10px;
  }

  .com-throw-darts {
    gap: 4px;
  }

  .com-throw-dart {
    padding: 7px 2px;
  }

  .com-throw-dart strong {
    font-size: clamp(28px, 12vw, 42px);
  }
}

.com-throw-darts[data-visible="0"] {
  grid-template-columns: 1fr;
}

.com-throw-darts[data-visible="1"] {
  grid-template-columns: 1fr;
}

.com-throw-darts[data-visible="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.com-throw-darts[data-visible="3"] {
  grid-template-columns: repeat(3, 1fr);
}



@keyframes comDartStepIn { 
  0% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0px); }
}


.setup-option-field {
  transition: opacity 120ms, filter 120ms;
}

.setup-option-field.inactive {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.setup-option-field.inactive input {
  cursor: not-allowed;
}

.setup-option-field.inactive select {
  cursor: not-allowed;
}

.setup-section-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 2px 0px 0px;
}

.score-menu {
  align-items: center;
  justify-content: space-between;
  min-width: 0px;
}

#gameRule {
  min-width: 0px;
  flex: 1 1 0%;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-menu-actions {
  flex: 0 0 auto;
}

.score-menu-actions .btn {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.score-menu-actions .mic-btn.compact {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .score-menu {
    gap: 4px;
    padding-inline: 5px;
  }

  #gameRule {
    font-size: 7px;
  }

  .score-menu-actions {
    gap: 2px;
  }

  .score-menu-actions .btn {
    min-height: 30px;
    padding: 4px 5px;
    font-size: 7px;
  }

  .score-menu-actions .mic-btn.compact {
    min-height: 30px;
    padding: 4px 5px;
    font-size: 7px;
  }
}

: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;
}

.score-player {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}

.setup {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}

.com-throw-card {
  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;
}

.player-action-btn {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
  border-color: rgb(234, 244, 252);
  box-shadow: none;
}

.mic-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;
}

.score-player.active {
  color: rgb(56, 60, 60);
  border-color: rgb(195, 216, 37);
  box-shadow: none;
}

.player-action-btn.finish {
  color: rgb(56, 60, 60);
  background: rgb(195, 216, 37);
  border-color: rgb(195, 216, 37);
  box-shadow: none;
}

.score-value strong {
  color: rgb(195, 216, 37);
  text-shadow: none;
}

.setup label {
  color: rgb(234, 244, 252);
}

#gameRule {
  color: rgb(234, 244, 252);
}

.setup-section-divider {
  background: rgb(234, 244, 252);
}

.setup-option-field.inactive input {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
}

.setup-option-field.inactive select {
  color: rgb(234, 244, 252);
  background: rgb(71, 74, 77);
}

.score-player.active {
  background: rgb(224, 235, 175);
}

#newGameBtn {
  color: rgb(234, 244, 252);
}

.start-btn {
  background: rgb(195, 216, 37);
  border-color: rgb(195, 216, 37);
}


.score-head-grid {
  color: rgb(23, 37, 44);
  background: rgb(255, 255, 255);
  border-color: rgb(213, 221, 225);
  box-shadow: none;
}

.score-menu {
  flex-wrap: wrap;
  gap: 8px;
}

.score-menu #gameRule {
  color: rgb(82, 99, 107);
  letter-spacing: 0px;
}



.com-throw-card {
  color: rgb(23, 37, 44);
}

.match-heading {
  display: grid;
  align-items: center;
}


.match-player-heading:last-child {
  text-align: right;
}


.match-heading .match-leg-title {
  text-align: center;
}

.match-heading .match-leg-count {
  font: 26px / 1 Arial, sans-serif;
  text-align: center;
}

.history-panel {
  --history-heading-height: 38px;
  --history-row-height: 48px;
}

.player-name-field {
  grid-column: 1 / -1;
  min-width: 0px;
}

.player-name-heading {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: start;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.player-name-heading > label {
  margin: 0px;
  white-space: nowrap;
  letter-spacing: 0px;
  font-size: 12px;
}

.player-name-field.inactive > input {
  opacity: 0.34;
  cursor: not-allowed;
}

.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;
}

.field label.com-toggle {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  min-height: 28px;
  margin: 0px;
  padding: 0px;
  font-size: 12px;
  letter-spacing: 0px;
  line-height: 1.4;
  cursor: pointer;
}

.field .com-toggle input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0px;
  padding: 0px;
  border: 1px solid rgb(199, 209, 215);
  background: white;
  cursor: pointer;
}

.field .com-toggle input[type="checkbox"]:checked {
  background: rgb(8, 126, 174);
  border-color: rgb(8, 126, 174);
}

.field .com-toggle input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border-style: solid;
  border-color: white;
  border-image: none;
  border-width: 0px 2px 2px 0px;
  transform: translateY(-1px) rotate(45deg);
}


.history-checkout {
  position: absolute;
  top: var(--history-heading-height);
  left: 0px;
  right: 0px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: calc(2 * var(--history-row-height));
  padding: 8px;
  border-block: 1px solid rgb(199, 209, 215);
  color: rgb(23, 37, 44);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.history-checkout[hidden] {
  display: none;
}

.history-checkout span {
  letter-spacing: 0.1em;
}

.history-checkout strong {
  line-height: 1.2;
  white-space: nowrap;
  font-weight: 700 !important;
}

.compact-input {
  padding: 10px;
}

.checkout-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.checkout-actions .player-action-btn {
  min-height: 44px;
  padding: 8px;
  color: rgb(23, 37, 44);
  background: rgb(237, 243, 204);
  border-color: rgb(202, 215, 156);
  font-size: 15px;
}

.checkout-actions .player-action-btn:disabled {
  opacity: 1;
  color: rgb(131, 144, 150);
  background: rgb(247, 249, 250);
  border-color: rgb(220, 226, 229);
}

.compact-input .keypad {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0px, 1fr));
}

.compact-input .keypad button {
  min-height: 60px;
  font-size: 25px;
  touch-action: manipulation;
}

.compact-input .keypad .key-enter {
  font-size: 17px;
  background: rgb(195, 216, 37);
  color: rgb(23, 37, 44);
}

.compact-input .quick-score button {
  min-height: 44px;
  font-size: 17px;
  touch-action: manipulation;
}

@media (max-width: 540px) {
  html {
    min-width: 0px;
  }

  .app {
    padding: 6px;
  }

  .compact-game {
    gap: 8px;
  }

}

.player-history h3 {
  margin: 8px 0px;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-history-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(119, 119, 119, 0.4);
}


#scoreSheet {
  display: grid;
  grid-template-columns: minmax(0px, 1fr);
  gap: 16px;
}

.desktop-round {
  align-items: center;
  justify-content: space-between;
}

#editHistoryBtn {
  border: 1px solid rgb(136, 136, 136);
  color: inherit;
  background: transparent;
  cursor: pointer;
}

#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);
}


.footer-remaining {
  display: none;
}

.pc-only {
  display: none;
}

#keySettingsForm {
  width: min(680px, 100%);
  max-height: 90dvh;
  overflow: auto;
}

.key-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 14px;
}

.key-setting-row strong {
  width: 40px;
  flex-shrink: 0;
}

.key-setting-row select {
  flex: 1 1 0%;
  min-width: 0px;
}

.key-setting-row select, .key-setting-row input {
  min-height: 44px;
  padding: 8px;
  color: rgb(23, 37, 44);
  background: white;
  border: 1px solid rgb(136, 147, 153);
}

.key-setting-row input {
  width: 90px;
}

#keySettingsStatus {
  color: rgb(180, 37, 42);
}

@media (min-width: 921px) {
  .pc-only {
    display: block;
  }

  .score-menu-actions {
    max-height: calc(100dvh - 180px);
    overflow-y: auto;
    flex-wrap: nowrap;
  }

  #functionKeyLegend {
    flex: 0 0 auto;
    padding-bottom: 10px;
    border-bottom: 1px solid rgb(85, 85, 85);
  }

  #functionKeyLegend > div {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 24px;
    color: rgb(238, 238, 238);
    font-size: clamp(12px, 1.15vw, 18px);
    letter-spacing: 0px;
  }

  #functionKeyLegend kbd {
    min-width: 36px;
    color: rgb(170, 178, 184);
    font-family: inherit;
  }

  .score-menu-actions > button {
    flex-shrink: 0;
  }
}


/* Button-based setup; game and result screens retain their existing styles. */
#setupModal .setup{width:min(960px,100%);max-width:960px;padding:24px}
#setupModal .setup .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
#setupModal .setup .field.half{grid-column:span 1}
#setupModal .setup .choice-field{grid-column:1/-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}
#setupModal .setup .player-name-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 14px}
#setupModal .setup .com-toggle{position:relative;gap:8px;min-height:32px}
@media(max-width:600px){#setupModal .setup{padding:18px 14px}#setupModal .setup .form-grid{gap:13px 10px}#setupModal .setup .setup-choice{flex-basis:78px;min-height:46px;padding:9px 7px;font-size:12px}}

#setupModal .setup .com-toggle input[type="checkbox"] { appearance: auto; position: static; opacity: 1; display: inline-block; width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: #38667e; cursor: pointer; }
#setupModal .setup .com-toggle input[type="checkbox"]::after { content: none; }
#setupModal .setup .com-toggle input:focus-visible { outline: 2px solid #b7d4e4; outline-offset: 3px; }

.round-start-overlay { position: absolute; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.round-start-overlay[hidden] { display: none; }
.round-start-position { position: absolute; text-align: center; transform: translate(-50%, -50%); }
.round-start-position[data-placement="below"] { transform: translateX(-50%); }
.round-start-overlay .round-start-text { display: block; color: #fff; font-family: Arial, Helvetica, sans-serif; font-weight: 900; line-height: 1.1; letter-spacing: .06em; white-space: nowrap; text-shadow: 0 2px 18px #000, 0 0 40px #000; animation: iwashi-round-pass 1.3s ease-in-out both; }
@keyframes iwashi-round-pass {
  0% { transform: translateX(-150%); opacity: 0; }
  24%, 70% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(150%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .round-start-overlay .round-start-text { animation: none; } }


/* Merged from landscape.css (gameplay) */
/* Shared landscape canvas. Mobile setup stays upright; games rotate in portrait. */
html, body { min-width: 0; width: 100%; height: 100%; overflow: hidden; background: #090a0b; }
.game-viewport {
  position: fixed; inset: 0; width: 100dvw; height: 100dvh;
  container-type: size; background: #090a0b;
  --footer-height: clamp(76px, 14cqh, 148px);
  --score-size: min(25cqw, 42cqh, 420px);
  --rail-width: 20%;
}
@media (min-width: 921px) and (hover: hover) and (pointer: fine) {
  .game-viewport {
    --score-size: min(33cqw, 52cqh, 520px);
    --rail-width: 22%;
  }
  .score-head-grid #gameRule { width: 60%; }
  .score-head-grid .score-player, .score-head-grid .score-player.active, .score-head-grid .score-player.player-one { flex-basis: 60%; }
}
.game-viewport button {
  touch-action: manipulation;
}
@media (orientation: portrait) {
  .game-viewport {
    inset: auto; top: 50%; left: 50%; width: 100dvh; height: 100dvw;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}
body, button, input, select, textarea,
.score-value strong, .score-value.to-go strong,
.match-heading .match-leg-count, .match-player-heading .footer-remaining,
.com-throw-dart strong, .com-throw-total strong {
  font-family: Meiryo, "メイリオ", "Noto Sans JP", sans-serif;
}
.app { width: 100%; max-width: none; height: 100%; padding: 0; }
.compact-game {
  position: relative; display: block; width: 100%; max-width: none;
  height: 100%; min-height: 0; margin: 0; gap: 0;
  background: radial-gradient(ellipse at 52% 25%, #292b2c, #0b0d0e 65%, #050607);
}
.scoreboard { position: static; display: block; height: 100%; overflow: visible; border: 0; background: transparent; }
.score-menu { display: contents; }
.score-menu .game-title {
  position: absolute; top: 0; left: 0; z-index: 3; width: var(--rail-width);
  padding: clamp(6px, 1.2cqh, 14px); white-space: normal;
  color: #fff; background: #4089ee; font-size: 12px; font-weight: 700; line-height: 1.5;
}
.desktop-round {
  position: absolute; display: flex; top: clamp(62px, 10cqh, 96px); left: 0;
  width: var(--rail-width); padding: 0 clamp(6px, 1cqw, 14px);
  color: #eee; font-size: clamp(13px, 1.8cqw, 30px); gap: 4px;
}
#editHistoryBtn { font-size: clamp(11px, 1.2cqw, 16px); padding: 5px 8px; }
.history-panel {
  position: absolute; width: var(--rail-width); left: 0; top: clamp(98px, 16cqh, 158px);
  bottom: calc(var(--footer-height) + 8px); padding-inline: clamp(6px, 1cqw, 14px);
  background: transparent; overflow: visible; isolation: auto;
}
.history-panel .score-sheet-wrap { height: 100%; max-height: none; overflow: auto; }
.player-history { min-width: 0; color: #eee; }
.player-history-heading {
  display: flex; align-items: baseline; gap: 6px; justify-content: space-between;
  border-bottom: 3px solid #D20A13; padding-bottom: 5px;
}
.player-history[data-player="1"] .player-history-heading { border-color: #1853B5; }
.player-history .player-history-heading h3 {
  flex: 1; min-width: 0; margin: 0; padding: 0; border: 0;
  font-size: clamp(12px, 1.5cqw, 24px);
}
.history-average { display: block; flex-shrink: 0; font-size: clamp(10px, 1.25cqw, 21px); color: #ddd; white-space: nowrap; }
.player-history-row { min-height: clamp(26px, 4.4cqh, 44px); font-size: clamp(13px, 1.7cqw, 28px); padding: 2px 4px; }
.player-history-row strong { font-size: clamp(18px, 2.6cqw, 42px); }
.score-head-grid {
  position: absolute; inset: 0 0 calc(var(--footer-height) + 14cqh);
  display: flex; align-items: center; justify-content: center; padding: 0;
  background: transparent; pointer-events: none;
}
.score-head-grid #gameRule {
  position: absolute; left: 50%; bottom: calc(50% + min(15cqw, 25cqh, 250px) + 8px);
  z-index: 2; width: 60%; min-width: 0; height: auto; flex: none;
  transform: translateX(-50%); overflow: visible; text-overflow: clip;
  color: #bfc5c7; font-size: clamp(10px, 1.2cqw, 16px);
  font-weight: 600; line-height: 1.2; text-align: center; white-space: normal;
}
.score-head-grid .score-player, .score-head-grid .score-player.active, .score-head-grid .score-player.player-one {
  flex: 0 0 60%; padding: 0; border: 0; background: transparent;
}
.score-head-grid .score-player:not(.active) { display: none; }
.score-head-grid .score-player .score-values { display: block; width: 100%; margin: 0; }
.score-head-grid .score-value.to-go { width: 100%; text-align: center; }
.score-head-grid .score-value.to-go span { display: none; }
.score-head-grid .score-player .score-value.to-go strong,
.score-head-grid .score-player.active .score-value.to-go strong {
  font-family: Meiryo, "メイリオ", "Noto Sans JP", sans-serif;
  font-size: var(--score-size); font-weight: 600; line-height: 1.2;
  color: #f4f4f0; letter-spacing: .015em; text-indent: .015em; font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 6px rgba(170,170,170,.24);
}
.match-heading {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--footer-height);
  padding: 0 clamp(4px, 1cqw, 20px); gap: clamp(3px, .6cqw, 12px); border: 0; background: #050505; color: #fff;
  grid-template-columns: minmax(0,1fr) clamp(26px,4cqw,72px) auto clamp(26px,4cqw,72px) minmax(0,1fr);
}
.match-player-heading {
  display: flex; align-items: center; justify-content: space-between; align-self: stretch;
  min-width: 0; padding: clamp(4px,1cqw,14px); gap: clamp(4px,1cqw,16px); background: #050505;
}
#playerHeading0.throwing { background: #D20A13; }
#playerHeading1.throwing { background: #1853B5; }
.match-heading .score-player-name { flex: 1; min-width: 0; color: #fff; text-align: center; font-size: clamp(14px,2.6cqw,44px); }
.match-heading .match-leg-count { color: #fff; font-size: clamp(22px,3.6cqw,60px); }
.match-heading .match-leg-title { color: #fff; font-size: clamp(10px,1.5cqw,24px); }
.match-player-heading .footer-remaining {
  display: block; flex-shrink: 0; color: #aaa; font-size: clamp(30px,6cqw,110px);
  font-weight: 600; line-height: 1.2; letter-spacing: -.04em;
}
#playerHeading1 .footer-remaining { order: -1; }
.match-player-heading.throwing .footer-remaining { color: #fff; }
.compact-input { display: none; }
.keypad-toggle { display: none; }
.score-menu #newGameBtn { color: #eee; }
.live-history { color: #fff; background: #ffffff18; }
.score-menu-actions {
  position: absolute; top: auto; bottom: calc(var(--footer-height) + 12px); right: clamp(6px,1cqw,18px);
  display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
  width: clamp(94px,15cqw,210px); gap: clamp(4px,.9cqh,10px);
  max-height: calc(100cqh - var(--footer-height) - 24px); overflow-y: auto; z-index: 4;
}
.mobile-br { display: none; }
.score-menu .score-menu-actions .btn, .score-menu .score-menu-actions .mic-btn.compact {
  width: 100%; min-height: clamp(32px,4.5cqh,44px); flex-shrink: 0;
  justify-content: center; padding: 6px; border: 1px solid #454748;
  color: #eee; background: #191b1dcc; font-size: clamp(11px,1cqw,14px); text-align: center;
}
.score-menu .score-menu-actions .mic-btn.compact[aria-pressed="true"],
.score-menu .score-menu-actions .mic-btn.compact.listening {
  color: #17252c; background: #c3d825; border-color: #c3d825; box-shadow: 0 0 12px #c3d82580;
}
.history-panel .history-checkout {
  position: fixed; top: auto;
  bottom: calc(var(--footer-height) + clamp(50px,10cqh,108px) + 56px);
  left: 50%; right: auto; transform: translateX(-50%);
  width: 50cqw; height: auto; min-height: 32px; padding: 0; z-index: 9;
  border: 0; background: transparent; backdrop-filter: none; gap: 3px;
}
.history-checkout span { color: #aaa; font-size: clamp(8px,1cqw,12px); }
.history-checkout strong { color: #fff; font-size: clamp(16px,2.6cqw,40px); }
.com-throw-overlay {
  inset: auto auto calc(var(--footer-height) + 8px) 50%;
  transform: translateX(-50%);
  width: 48%; height: clamp(50px,10cqh,108px); padding: 0; z-index: 10;
}
.com-throw-card { display: flex; align-items: stretch; gap: 10px; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; animation: none; }
.com-throw-heading { display: none; }
.com-throw-darts, .com-throw-darts[data-visible] { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); flex: 3; min-width: 0; margin: 0; gap: 8px; }
.com-throw-dart { position: relative; height: 100%; min-width: 0; border: 0; border-bottom: 2px solid #888; padding: 0; background: transparent; }
.com-throw-dart.step-hidden { display: block; }
.com-throw-dart.step-hidden > * { visibility: hidden; }
.com-throw-dart.step-show { animation: none; }
.com-throw-dart strong, .com-throw-total strong { color: #fff; font-size: clamp(22px,3.6cqw,58px); }
.com-throw-dart span, .com-throw-dart small, .com-throw-total span { color: #bfc5c7; font-size: clamp(8px,.8cqw,12px); }
.com-throw-dart small { min-height: 0; margin-top: 0; }
.com-throw-total { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-bottom: 2px solid #ddd; gap: 2px; }
.com-throw-total.step-hidden { visibility: visible; }
.com-throw-total.step-hidden > * { visibility: hidden; }
.modal { position: absolute; max-width: 100%; padding: 10px; }
.modal > form, .modal > .stats-card, .modal > .result-card { max-height: calc(100cqh - 20px); overflow: auto; }

@media (pointer: coarse), (max-width: 920px) {
  .pc-only { display: none; }
  .game-viewport {
    --footer-height: clamp(56px,18cqh,76px);
    --mobile-button-height: clamp(32px,9.5cqh,40px);
    --mobile-menu-height: calc(2 * var(--mobile-button-height) + 4px);
    --mobile-title-height: clamp(36px,10cqh,48px);
    --mobile-history-row-height: clamp(12px,4.2cqh,24px);
    --mobile-history-heading-height: 18px;
  }
  .score-menu .game-title {
    left: clamp(6px,1cqw,14px); width: calc(var(--rail-width) - clamp(12px,2cqw,28px));
    height: var(--mobile-title-height); overflow: auto;
    padding: 3px 6px; font-size: 10px; line-height: 1.2;
  }
  .desktop-round {
    left: clamp(6px,1cqw,14px); width: calc(var(--rail-width) - clamp(12px,2cqw,28px));
    top: calc(var(--mobile-title-height) + 2px); height: 20px;
    font-size: clamp(11px,1.35cqw,16px); padding-inline: 0;
  }
  #editHistoryBtn {
    min-height: 20px; height: 20px; padding: 1px 6px;
    font-size: clamp(10px,1.2cqw,13px);
  }
  .score-menu-actions {
    position: absolute; z-index: 8;
    left: clamp(6px,1cqw,14px); right: auto;
    bottom: calc(var(--footer-height) + 6px);
    width: calc(var(--rail-width) - clamp(12px,2cqw,28px));
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 3px; height: var(--mobile-menu-height);
    max-height: none; grid-auto-rows: var(--mobile-button-height); overflow: visible;
  }
  .mobile-br { display: inline; }
  .score-menu .score-menu-actions .btn, .score-menu .score-menu-actions .mic-btn.compact {
    min-width: 0; min-height: 0; height: var(--mobile-button-height); padding: 2px;
    font-size: clamp(8.5px,1cqw,11px); line-height: 1.15;
    white-space: normal;
  }
  .score-menu .score-menu-actions #voiceLogBtn {
    font-size: clamp(7.5px, 0.85cqw, 10px);
    line-height: 1.1;
  }
  .history-panel {
    left: clamp(6px,1cqw,14px); width: calc(var(--rail-width) - clamp(12px,2cqw,28px));
    padding-inline: 0;
    top: calc(var(--mobile-title-height) + 26px);
    bottom: calc(var(--footer-height) + var(--mobile-menu-height) + 12px);
    height: auto;
  }
  .player-history-heading {
    position: sticky; top: 0; z-index: 2; height: var(--mobile-history-heading-height);
    box-sizing: border-box; background: #121415; padding-bottom: 2px;
  }
  .player-history-row {
    height: var(--mobile-history-row-height); min-height: 0; padding: 0 4px;
    font-size: clamp(11px,1.5cqw,20px); align-items: center;
  }
  .player-history-row strong { font-size: clamp(13px,1.8cqw,25px); line-height: 1; }
  .compact-input {
    position: absolute; display: flex; flex-direction: column;
    right: clamp(6px,1cqw,14px); top: clamp(8px,2cqh,20px);
    bottom: calc(var(--footer-height) + 8px);
    width: 24%; height: auto; padding: 0; overflow: auto;
    border: 0; background: transparent; z-index: 8;
  }
  .compact-input .checkout-actions { gap: 4px; margin-bottom: 6px; flex-shrink: 0; }
  .compact-input .checkout-actions .player-action-btn { min-height: 28px; padding: 3px; font-size: clamp(10px,1.2cqw,15px); }
  .compact-input .keypad {
    flex: 1; min-height: 120px; display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(4,minmax(0,1fr));
    border: 0; gap: 4px; width: 100%;
  }
  .compact-input .keypad button {
    min-height: 0; padding: 3px; color: #eee; background: #24282a;
    border: 1px solid #4a5053; font-size: clamp(19px,2.7cqw,34px);
  }
  .compact-input .keypad .key-enter { font-size: clamp(10px,1.3cqw,17px); color: #17252c; background: #c3d825; }
  .compact-input .quick-score { margin-top: 6px; padding: 0; border: 0; background: transparent; flex-shrink: 0; }
  .compact-input .quick-score > div { gap: 4px; }
  .compact-input .quick-score button {
    min-height: 28px; padding: 2px; font-size: clamp(11px,1.4cqw,17px);
    color: #eee; background: #24282a; border-color: #4a5053;
  }
}

.match-leg-summary { display: contents; }
@media (orientation: landscape) and (pointer: coarse), (orientation: landscape) and (hover: none) {
  .game-viewport {
    --rail-width: calc(24cqw + 2 * clamp(6px,1cqw,14px));
    --footer-height: max(clamp(48px,15cqh,64px), calc(clamp(30px,6cqw,110px) + clamp(4px,1cqw,14px) * 2 + 1px));
    --mobile-title-height: 20px;
    --mobile-menu-height: calc(2 * var(--mobile-button-height) + 4px);
  }
  .score-menu .game-title { left: clamp(6px,1cqw,14px); width: calc(var(--rail-width) - clamp(12px,2cqw,28px)); padding: 3px 4px; overflow: hidden; }
  .desktop-round { padding: 0; align-items: center; gap: 4px; line-height: 20px; }
  #editHistoryBtn { display: grid; place-items: center; flex-shrink: 0; line-height: 1; white-space: nowrap; }
  .score-menu-actions { bottom: 6px; }
  .history-panel { left: clamp(6px,1cqw,14px); width: calc(var(--rail-width) - clamp(12px,2cqw,28px)); padding-inline: 0; height: auto; bottom: calc(var(--mobile-menu-height) + 12px); }
  .score-head-grid #gameRule { top: 8px; bottom: auto; left: var(--rail-width); right: var(--rail-width); width: auto; transform: none; }
  .match-heading { left: var(--rail-width); right: calc(24% + 2 * clamp(6px,1cqw,14px)); padding-inline: 0; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .match-leg-summary { position: absolute; display: flex; align-items: center; justify-content: center; gap: 8px; left: calc(50cqw - var(--rail-width)); bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; }
  .score-menu .score-menu-actions #micBtn { position: fixed; z-index: 8; right: clamp(6px,1cqw,14px); bottom: calc(9px + (var(--footer-height) - 15px) / 2); width: 24%; height: calc((var(--footer-height) - 15px) / 2); min-height: 0; padding: 2px; }

  .match-player-heading { display: grid; grid-template-columns: minmax(max-content,1fr) auto minmax(0,1fr); padding: 4px; gap: 2px; }
  #playerHeading1 { grid-template-columns: minmax(0,1fr) auto minmax(max-content,1fr); }
  .match-player-heading .footer-remaining { grid-column: 2; grid-row: 1; }
  #playerHeading0 .score-player-name { grid-column: 1; text-align: left; }
  #playerHeading1 .score-player-name { grid-column: 3; text-align: right; }
  .match-player-heading .footer-remaining { line-height: 1; }
  .match-heading .score-player-name { grid-row: 1; font-size: clamp(10px,1.6cqw,14px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compact-input { bottom: calc(var(--footer-height) + 6px); }
  .compact-input .quick-score { display: none; }
}

.score-head-grid .score-values { position: relative; }
.voice-score-feedback { position: absolute; top: 100%; left: 0; width: 100%; color: #ffe083; text-align: center; font-weight: 700; font-size: clamp(14px, 2.2cqw, 32px); line-height: 1.4; }
button.round-history-score { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-radius: 4px; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
button.round-history-score:hover, button.round-history-score:focus-visible { background: #ffffff20; outline: 2px solid #ffe083; outline-offset: -2px; }
button.round-history-score:disabled { cursor: default; opacity: .65; }

@media (orientation: landscape) and (pointer: coarse), (orientation: landscape) and (hover: none) {
  .score-menu .score-menu-actions #singleDartMicBtn { position: fixed; z-index: 8; right: clamp(6px,1cqw,14px); bottom: 6px; width: 24%; height: calc((var(--footer-height) - 15px) / 2); min-height: 0; padding: 2px; }
}

.microphone-notice { position: absolute; z-index: 11; bottom: calc(var(--footer-height) + clamp(50px, 10cqh, 108px) + 14px); left: 50%; transform: translateX(-50%); width: 48%; color: #ffe083; font-size: clamp(10px, 1.2cqw, 17px); text-align: center; line-height: 1.4; pointer-events: none; padding: 4px 6px; background: #101214f2; border-radius: 4px; }
.score-menu-actions #micLabel { font-size: clamp(9px,1.15cqw,13px); }
.score-menu-actions #micLabel::after { content: none; }
#comThrowOverlay[data-mode="voice"] { pointer-events: none; }

.voice-dart-active .round-start-overlay { display: none; }

#comThrowOverlay[data-mode="voice"] .com-throw-dart small { display: none; }


