/* Original interface styling: © 2026 202ch.com. */
:root {
  color-scheme: dark;
  --bg: #0b0e0d;
  --panel: #171b18;
  --line: #343b35;
  --cream: #f2e8d5;
  --muted: #929b93;
  --gold: #d8b875;
  --green: #287a57;
  --red: #a83b41;
}

.mode-card,
.result-card,
.arrangement-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121513;
  box-shadow: 0 12px 28px #0005;
}
.game-selector {
  margin: 5px 11px 3px;
  padding: 8px;
  border-radius: 10px;
  background: #101311;
  box-shadow: none;
}
.finish-message {
  margin: 2px 11px 5px;
  padding: 10px;
  border: 1px solid #48a47b;
  border-radius: 9px;
  color: #6fe0a7;
  background: #163b2b;
  text-align: center;
  font-weight: 900;
}
.result-card {
  margin-top: 10px;
  margin-bottom: 0;
}
.inline-card {
  margin: 5px 11px 0;
  box-shadow: none;
}
.result-card.inline-card {
  margin-top: 5px;
  padding-block: 9px;
}
.arrangement-card {
  margin-top: 10px;
  margin-bottom: 0;
  border-color: #75623e;
  background: linear-gradient(135deg, #1b1a14, #121513);
}
.arrangement-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.arrangement-card span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
}
.arrangement-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.arrangement-card > strong {
  display: block;
  margin-top: 6px;
  color: #fff8e8;
  font-size: 23px;
  line-height: 1.25;
}
.arrangement-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.result-head h2 {
  margin: 2px 0 7px;
  font-size: 17px;
}
.stats {
  display: grid;
  text-align: right;
}
.stats span {
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.stats strong {
  font-size: 16px;
}
.stats small {
  color: var(--muted);
  font-size: 9px;
}
.empty-result {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.result-list {
  max-height: 190px;
  overflow-y: auto;
  scrollbar-color: #596159 transparent;
  scrollbar-width: thin;
}
.result-row {
  padding: 9px 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.round-summary {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.round-summary strong {
  color: var(--gold);
  font-size: 13px;
}
.round-summary b {
  color: var(--cream);
  font-weight: 900;
}
.dart-result {
  color: var(--muted);
  line-height: 1.45;
}
.round-ppd {
  display: grid;
  text-align: right;
  white-space: nowrap;
}
.round-ppd small {
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.round-ppd strong {
  color: #fff;
  font-size: 13px;
}
.result-row.bust .round-summary b {
  color: #ff777d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -15%, #29332c 0, transparent 35rem), var(--bg);
  color: var(--cream);
  font-family: Arial, "Noto Sans JP", sans-serif;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}
.app {
  width: min(560px, 100%);
  min-height: 100dvh;
  margin: auto;
  padding: 12px;
}
.calculator {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, #1e231f, var(--panel));
  box-shadow: 0 20px 48px #0007;
}
header {
  min-height: 65px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #101311;
}
header > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
header span,
.round-score span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}
header strong {
  font-family: Georgia, serif;
  font-size: 26px;
}
.total strong {
  color: #fff;
  font-size: 39px;
}
.round-score {
  padding: 10px 16px 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.remaining-score {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.remaining-score strong {
  color: #fff9ec;
  font-family: Georgia, serif;
  font-size: 58px;
  line-height: 1;
}
.current-ppd {
  display: grid;
  flex: 0 0 auto;
  text-align: right;
}
.current-ppd strong {
  color: #fff;
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}
.current-ppd span {
  font-size: 9px;
}
.throws {
  padding: 8px 11px 11px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.throws > div {
  min-height: 44px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 5px;
  border: 1px dashed #465047;
  border-radius: 10px;
  color: #717a72;
  background: #111412;
}
.throws > div.filled {
  border-style: solid;
  border-color: #657067;
  color: var(--cream);
  background: #272d28;
}
.throws span,
.throws small {
  font-size: 10px;
  font-weight: 800;
}
.throws strong {
  font-size: 19px;
  text-align: center;
}
.manual {
  padding: 8px 11px;
  display: grid;
  grid-template-columns: 1fr 106px;
  gap: 6px;
  border-block: 1px solid var(--line);
  background: #101311;
}
.manual input {
  min-width: 0;
  height: 45px;
  padding: 0 11px;
  border: 1px solid #4a534c;
  border-radius: 9px;
  outline: 0;
  color: var(--cream);
  background: #171b18;
  font-size: 16px;
}
.manual input:focus {
  border-color: var(--gold);
}
.manual button {
  border: 0;
  border-radius: 9px;
  color: #181b19;
  background: var(--cream);
  font-size: 13px;
  font-weight: 900;
}
.multipliers {
  padding: 9px 11px 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.multipliers button {
  min-height: 47px;
  border: 1px solid #4b544d;
  border-radius: 9px;
  color: #fff;
  background: #292f2a;
  font-weight: 900;
  font-size: 15px;
}
.multipliers small {
  margin-left: 5px;
  opacity: 0.7;
}
.multipliers .triple.selected {
  border-color: #4fc28c;
  background: var(--green);
  box-shadow: 0 0 0 2px #35a77633;
}
.multipliers .double.selected {
  border-color: #ec7479;
  background: var(--red);
  box-shadow: 0 0 0 2px #df555a33;
}
.numbers {
  padding: 0 11px 7px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.numbers button {
  min-height: 50px;
  border: 1px solid #d5c9b3;
  border-radius: 9px;
  color: #161916;
  background: var(--cream);
  box-shadow: inset 0 -3px #0002;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 900;
}
.numbers button:active,
.bull button:active {
  transform: translateY(1px);
  box-shadow: none;
}
.bull,
.actions {
  padding: 0 11px 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.bull button {
  min-height: 42px;
  border: 1px solid #46a57a;
  border-radius: 9px;
  color: #fff;
  background: #225f46;
  font-weight: 900;
  font-size: 14px;
}
.bull button:last-child {
  border-color: #d9656a;
  background: #86343a;
}
.actions button {
  min-height: 39px;
  border: 1px solid #505a52;
  border-radius: 9px;
  color: var(--cream);
  background: transparent;
  font-weight: 800;
  font-size: 14px;
}
.confirm {
  width: calc(100% - 22px);
  min-height: 48px;
  margin: 0 11px 4px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
  font-size: 15px;
  font-weight: 900;
}
.reset {
  width: calc(100% - 22px);
  min-height: 48px;
  margin: 5px 11px 4px;
  border: 1px solid #75623e;
  border-radius: 10px;
  color: #fff8e8;
  background: #393326;
  font-size: 15px;
  font-weight: 900;
}
.mode-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.mode-title span,
.mode-line > span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.mode-line {
  display: grid;
  grid-template-columns: 18px 70px 1fr;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
}
.language-line {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.language-line > span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.language-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.mode-line > strong {
  color: var(--gold);
  text-align: center;
}
.zero-one-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}
.rule-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.zero-one-buttons button,
.rule-buttons button,
.countup-button,
.compact-mode,
.language-buttons button {
  min-height: 30px;
  padding: 3px;
  border: 1px solid #465048;
  border-radius: 6px;
  color: var(--muted);
  background: #1c211d;
  font-size: 11px;
  font-weight: 900;
}
.countup-button {
  width: 100%;
}
.compact-mode {
  min-height: 25px;
  padding-inline: 10px;
}
.zero-one-buttons button.active,
.rule-buttons button.active,
.countup-button.active,
.compact-mode.active,
.language-buttons button.active {
  border-color: var(--cream);
  color: #171a18;
  background: var(--cream);
}
.related-tool {
  display: flex;
  justify-content: center;
  margin: 12px 0 0;
}
.related-tool a {
  padding: 7px 12px;
  border: 1px solid #465048;
  border-radius: 999px;
  color: var(--gold);
  background: #121513;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}
.related-tool a:hover,
.related-tool a:focus-visible {
  border-color: var(--gold);
  color: var(--cream);
}
.site-footer {
  padding: 11px 4px 3px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #6f7871;
  font-size: 9px;
}

@media (max-width: 430px) {
  .app {
    padding: 3px;
  }
  .mode-card {
    margin: 3px 4px 2px;
    padding: 4px 5px;
  }
  .result-card {
    padding: 8px;
    border-radius: 12px;
  }
  .inline-card {
    margin: 3px 4px 0;
  }
  .mode-title {
    margin-bottom: 1px;
  }
  .mode-title span,
  .mode-line > span {
    font-size: 8px;
  }
  .mode-line {
    grid-template-columns: 14px 58px 1fr;
    gap: 2px;
    margin-top: 2px;
  }
  .language-line {
    grid-template-columns: 72px 1fr;
    gap: 2px;
    margin-top: 3px;
    padding-top: 3px;
  }
  .language-line > span {
    font-size: 8px;
  }
  .language-buttons {
    gap: 2px;
  }
  .zero-one-buttons {
    gap: 2px;
  }
  .zero-one-buttons button,
  .rule-buttons button,
  .countup-button,
  .language-buttons button {
    min-height: 24px;
    border-radius: 4px;
    font-size: 8px;
  }
  .compact-mode {
    min-height: 21px;
    font-size: 8px;
  }
  .arrangement-card {
    padding: 8px;
    border-radius: 12px;
  }
  .arrangement-card > strong {
    font-size: 20px;
  }
  .arrangement-card p {
    font-size: 8px;
  }
  header {
    min-height: 42px;
    padding: 3px 8px;
  }
  header strong {
    font-size: 19px;
  }
  .total strong {
    font-size: 27px;
  }
  .round-score {
    padding: 2px 8px 0;
    gap: 7px;
  }
  .remaining-score {
    gap: 7px;
  }
  .remaining-score strong {
    font-size: 36px;
  }
  .current-ppd strong {
    font-size: 23px;
  }
  .current-ppd span {
    font-size: 8px;
  }
  .throws {
    padding: 1px 4px 3px;
    gap: 3px;
  }
  .throws > div {
    min-height: 34px;
    padding: 2px 4px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 3px;
  }
  .throws span,
  .throws small {
    font-size: 9px;
  }
  .throws strong {
    font-size: 17px;
    text-align: center;
  }
  .manual {
    padding: 3px 4px;
    grid-template-columns: 1fr 82px;
  }
  .manual input {
    height: 31px;
    font-size: 13px;
  }
  .manual button {
    font-size: 11px;
  }
  .multipliers {
    padding: 3px 4px 2px;
    gap: 3px;
  }
  .multipliers button {
    min-height: 31px;
    font-size: 13px;
  }
  .numbers {
    padding: 0 4px 2px;
    gap: 2px;
  }
  .numbers button {
    min-height: 34px;
    border-radius: 5px;
    font-size: 20px;
  }
  .bull,
  .actions {
    padding: 0 4px 2px;
    gap: 2px;
  }
  .bull button,
  .actions button {
    min-height: 28px;
    font-size: 12px;
  }
  .confirm {
    width: calc(100% - 8px);
    min-height: 35px;
    margin: 0 4px 1px;
    font-size: 13px;
  }
  .reset {
    width: calc(100% - 8px);
    min-height: 35px;
    margin: 3px 4px 2px;
    font-size: 13px;
  }
  .result-row {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 4px;
    font-size: 10px;
  }
  .round-summary {
    display: grid;
    gap: 0;
  }
  .round-summary strong,
  .round-ppd strong {
    font-size: 11px;
  }
  .dart-result {
    font-size: 10px;
  }
  .result-list {
    max-height: 154px;
  }
  .site-footer {
    padding-inline: 2px;
    font-size: 7px;
  }
}
