.result-breakdown {
  display:grid;
  gap:6px;
  margin:14px 0;
  text-align:left;
}
.result-breakdown-row {
  display:flex;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid #ffffff25;
  padding:5px 0;
  font-size:clamp(13px,1.6cqw,20px);
  font-variant-numeric:tabular-nums;
}
.result-breakdown-row strong { font-weight:500; }
.result-breakdown small { color:#aaa;font-size:11px; }
* {
  box-sizing:border-box
}
 [hidden] {
  display:none!important
}
html,body {
  margin:0;
  width:100%;
  height:100%;
  overflow:hidden;
  background:#090a0b;
  color:#eee;
  font-family:Meiryo,"メイリオ","Noto Sans JP",sans-serif
}
button,input {
  font:inherit
}
button {
  cursor:pointer;
  border:1px solid #454748;
  border-radius:0;
  color:#eee;
  background:#191b1dcc;
  padding:8px;
  touch-action:manipulation
}
button:hover {
  filter:brightness(1.2)
}
button:active {
  transform:translateY(1px)
}
button:focus-visible,input:focus-visible {
  outline:3px solid #c3d825;
  outline-offset:2px
}
button:disabled {
  opacity:.35;
  cursor:default
}
.viewport {
  position:fixed;
  inset:0;
  width:100dvw;
  height:100dvh;
  container-type:size;
  display:grid;
  grid-template-columns:20% minmax(0,1fr) 22%;
  --footer-height:clamp(56px,15cqh,120px);
  grid-template-rows:minmax(0,1fr) var(--footer-height);
  background:radial-gradient(ellipse at 52% 25%,#292b2c,#0b0d0e 65%,#050607)
}
.rail {
  display:flex;
  flex-direction:column;
  min-height:0;
  padding:clamp(6px,1.2cqw,18px);
  border-right:1px solid #ffffff12
}
h1 {
  font-size:clamp(12px,1.8cqw,26px);
  margin:14px 0 3px;
  line-height:1.25
}
.cricket-game #gameTitle {
  white-space:pre-line
}
#ruleLabel {
  font-size:clamp(9px,1cqw,15px);
  color:#aaa;
  line-height:1.6;
  margin:0 0 12px
}
.round-heading {
  font-size:clamp(11px,1.5cqw,23px);
  padding-bottom:8px;
  border-bottom:3px solid #c3d825
}
.history {
  flex:1;
  overflow:auto;
  min-height:0;
  margin-top:5px;
  scrollbar-width:thin
}
.history-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid #ffffff25;
  padding:5px 2px;
  font-size:clamp(10px,1.3cqw,20px);
  gap:4px
}
.history-row strong {
  font-size:clamp(14px,2cqw,30px);
  font-weight:400
}
.history-row small {
  color:#aaa;
  font-size:.7em
}
.history-row.current {
  color:#c3d825
}
.rail-actions {
  display:grid;
  gap:5px;
  margin-top:8px
}
.rail-actions button {
  font-size:clamp(9px,1cqw,14px);
  min-height:28px
}
.arena {
  display:flex;
  flex-direction:column;
  align-items:center;
  min-height:0;
  min-width:0;
  padding:clamp(6px,1cqh,14px) 8px
}
.stages {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
  flex-shrink:0
}
.stage {
  font-size:clamp(8px,.95cqw,14px);
  color:#81888b;
  padding:4px 7px;
  border-bottom:2px solid #454748
}
.stage.active {
  color:#fff;
  border-color:#c3d825
}
.stage.done {
  color:#c3d825
}
.target-heading {
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
  min-height:clamp(26px,5cqh,54px);
  font-size:clamp(14px,2cqw,30px);
  font-weight:600;
  flex-shrink:0
}
.target-number {
  padding:0 4px
}
.board-wrap {
  flex:1;
  min-height:0;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden
}
.board-wrap svg {
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  user-select:none;
  touch-action:manipulation
}
.hit-zone {
  fill:transparent;
  cursor:pointer;
  outline:none
}
.hit-zone:hover,.hit-zone:focus-visible {
  fill:#ffffff44;
  stroke:#fff;
  stroke-width:2
}
.light {
  fill-opacity:.47;
  stroke-width:3;
  stroke-opacity:.8
}
.light-bull {
  fill-opacity:.6;
  stroke-width:2
}
.shoot-game .light,.shoot-game .light-bull {
  stroke-width:12;
  animation:targetGlow 1600ms ease-in-out infinite;
}
@keyframes targetGlow {
  0%,100% { stroke-opacity:.45;filter:drop-shadow(0 0 1px currentColor); }
  50% { stroke-opacity:1;filter:drop-shadow(0 0 14px currentColor); }
}
@media(prefers-reduced-motion:reduce) {
  .shoot-game .light,.shoot-game .light-bull { animation:none;stroke-opacity:1; }
}

.feedback {
  font-size:clamp(9px,1cqw,14px);
  color:#bfc5c7;
  min-height:18px;
  margin:6px 0 0;
  text-align:center;
  flex-shrink:0
}
.controls {
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:clamp(6px,1.2cqw,20px);
  gap:clamp(4px,1cqh,12px)
}
.metric span {
  display:block;
  color:#aaa;
  letter-spacing:.12em;
  font-size:clamp(9px,1cqw,15px)
}
.metric strong {
  font-size:clamp(28px,5cqw,80px);
  line-height:1.15;
  font-weight:500;
  font-variant-numeric:tabular-nums
}
.metric.small strong {
  font-size:clamp(22px,3.3cqw,50px)
}
.goal {
  font-size:clamp(9px,1.1cqw,17px);
  color:#c3d825;
  margin:4px 0 10px;
  line-height:1.5
}
.miss-btn {
  width:100%;
  min-height:clamp(38px,9cqh,84px);
  font-size:clamp(18px,2cqw,30px)
}
.miss-btn span {
  display:block;
  font-size:.5em;
  color:#aaa
}
.bull-buttons {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin-top:6px
}
.bull-buttons button {
  font-size:clamp(9px,1.1cqw,16px);
  min-height:32px
}

.footer {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(0,1.2fr) 1fr 1fr minmax(0,1.5fr);
  background:#050505;
  min-height:0
}
.player {
  background:#c3d825;
  color:#17252c;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:5px;
  overflow:hidden
}
.player span {
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:clamp(15px,2.5cqw,40px);
  font-weight:600
}
.player small {
  font-size:clamp(8px,1cqw,15px)
}
.footer-cell {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(5px,1cqw,14px);
  padding:6px;
  border-left:1px solid #ffffff18;
  min-width:0
}
.footer-cell span {
  font-size:clamp(8px,1cqw,15px);
  color:#aaa
}
.footer-cell strong {
  font-size:clamp(20px,3.5cqw,56px);
  font-weight:500;
  white-space:nowrap
}
.goal-cell strong {
  font-size:clamp(17px,2.7cqw,42px);
  color:#c3d825
}
.modal {
  position:absolute;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  padding:12px;
  background:#050709bc;
  backdrop-filter:blur(8px)
}
.setup,.result-card {
  width:min(580px,92%);
  max-height:calc(100cqh - 24px);
  overflow:auto;
  padding:clamp(16px,3cqw,36px);
  background:#343638;
  border:1px solid #6e7478
}
.kicker {
  font-size:11px;
  letter-spacing:.16em;
  color:#c3d825;
  margin:0 0 8px
}
h2 {
  font-size:clamp(22px,3cqw,36px);
  margin:0 0 20px
}
.setup label {
  display:block;
  font-size:12px;
  margin:14px 0 6px;
  color:#ddd
}
.setup input {
  width:100%;
  min-height:44px;
  padding:8px;
  border:1px solid #8a9397;
  border-radius:0;
  background:#474a4d;
  color:#eaf4fc
}
.setup-note {
  color:#aaa;
  font-size:11px;
  line-height:1.7
}
.start-btn {
  width:100%;
  min-height:48px;
  background:#c3d825;
  color:#17252c;
  border-color:#c3d825;
  font-weight:700;
  font-size:16px;
  margin-top:10px
}
.result-card {
  text-align:center
}
.result-card h2 {
  margin-bottom:12px
}
.result-card p {
  line-height:1.7
}
.result-stats {
  padding:14px;
  margin:14px 0;
  background:#ffffff09;
  font-size:22px
}
.result-stats>div {
  line-height:1.7
}
.result-round {
  font-weight:700;
  margin-bottom:16px
}
.result-rating-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(16px,3cqw,32px)
}
.result-rating-column {
  min-width:0;
  border-bottom:2px solid #929698;
  padding-bottom:10px
}
.result-rating-column h3 {
  margin:0 0 10px;
  padding-bottom:8px;
  border-bottom:2px solid #929698;
  font-size:clamp(13px,1.8cqw,20px);
  white-space:nowrap
}
.result-rating-values {
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:20px;
  font-size:clamp(22px,3cqw,32px)
}
.result-rating-stat {
  display:flex;
  justify-content:center;
  align-items:baseline;
  gap:12px;
  font-size:clamp(14px,2cqw,22px)
}
#saveResultBtn {
  width:100%;
  margin-top:8px;
  font-weight:700
}
.result-card>button:last-child,.setup>button:last-child:not(.start-btn) {
  width:100%;
  margin-top:8px
}

@media(orientation:portrait) {
  .viewport {
    inset:auto;
    top:50%;
    left:50%;
    width:100dvh;
    height:100dvw;
    transform:translate(-50%,-50%) rotate(90deg)
  }
  .viewport.setting-up {
    inset:0;
    top:0;
    left:0;
    width:100dvw;
    height:100dvh;
    transform:none
  }
}
@media(max-height:550px),(pointer:coarse) {
  .rail {
    padding:6px 8px
  }
  h1 {
    margin:8px 0 3px
  }
  #ruleLabel {
    margin-bottom:6px
  }
  .round-heading {
    padding-bottom:4px
  }
  .history-row {
    padding:3px 1px
  }
  .rail-actions {
    gap:3px
  }
  .rail-actions button {
    min-height:23px;
    padding:3px
  }
  .arena {
    padding:4px
  }
  .target-heading {
    min-height:25px
  }
  .feedback {
    margin-top:3px;
    min-height:12px
  }
  .controls {
    padding:6px;
    gap:4px
  }
  .goal {
    margin:2px 0 4px
  }
  .metric strong {
    font-size:clamp(24px,4cqw,54px)
  }
  .metric.small strong {
    font-size:clamp(20px,2.7cqw,40px)
  }
  .footer-cell {
    flex-direction:column;
    gap:0
  }
  .viewport { --footer-height:clamp(28px,7.5cqh,60px); }
  .footer-cell,.player { padding:2px; }
  .footer-cell span,.player small { font-size:8px;line-height:1; }
  .footer-cell strong { font-size:clamp(13px,4cqh,22px);line-height:1; }
  .player span { font-size:clamp(12px,3.4cqh,18px);line-height:1; }
  .keypad button {
    min-height:clamp(22px,6cqh,40px)
  }
  .entry {
    min-height:28px;
    font-size:24px
  }
  .bull-buttons button {
    padding:4px;
    min-height:24px
  }
  .setup,.result-card {
    padding:18px
  }
  .stages {
    gap:3px
  }
  .stage {
    padding:2px 4px
  }
  .feedback {
    font-size:10px
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important
  }
}
.result-card #resultUndoBtn {
  width:100%;
  margin-top:8px
}

.target-number.cleared {
  text-decoration:line-through;
  opacity:.65
}
.used-mask {
  fill:#71767b;
  fill-opacity:.76
}
.history-row.board-history {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:5px;
  align-items:center;
  font-size:clamp(9px,1cqw,15px);
  min-height:30px
}
.board-history .history-darts {
  font-size:clamp(9px,.95cqw,14px);
  line-height:1.5;
  overflow-wrap:anywhere;
  text-align:center
}
.history-row.board-history strong {
  font-size:clamp(14px,1.6cqw,25px)
}
.board-history small {
  grid-column:3;
  text-align:right
}

.used-mask.off-target {
  fill:#a46e73;
  fill-opacity:.76
}
.shoot-game .arena {
  padding:0 4px
}
.shoot-game .arena .stages,.shoot-game .arena .feedback,.shoot-game .controls .metric,.shoot-game .controls .goal,.shoot-game #missBtn {
  display:none
}
.shoot-game .controls {
  justify-content:center;
  align-items:center;
  padding:10px 18px
}
.shoot-game .target-heading {
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:center;
  flex-wrap:nowrap;
  gap:clamp(12px,5cqh,42px);
  margin:0;
  width:min(100%,160px);
  font-size:clamp(28px,5cqw,80px);
  font-weight:500;
  color:#fff
}
.shoot-game .target-number {
  display:block;
  width:100%;
  text-align:center;
  padding:0 2px 5px;
  border-bottom:2px solid #fff;
  line-height:1.15
}
.shoot-game .target-number.cleared {
  text-decoration:none;
  opacity:.35
}
.board-wrap {
  position:relative
}
.board-bull-actions {
  position:absolute;
  bottom:6px;
  left:6px;
  right:6px;
  z-index:2
}
.board-bull-actions .bull-buttons {
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:0
}
.board-bull-actions button {
  width:clamp(74px,11cqw,150px);
  min-height:clamp(30px,6cqh,48px);
  font-size:clamp(12px,1.4cqw,20px);
  background:#191b1df0
}
.bull-buttons button.used {
  color:#a7a7a7;
  border-color:#696969
}
@media(max-height:550px),(pointer:coarse) {
  .shoot-game .controls {
    justify-content:center
  }
  .shoot-game .target-heading {
    font-size:clamp(24px,4cqw,54px);
    gap:clamp(10px,4cqh,24px)
  }
  .board-bull-actions {
    bottom:4px;
    left:4px;
    right:4px
  }
}
.shoot-game {
  --shoot-side-space:calc(100cqw - 100cqh + var(--footer-height) - 8px);
  grid-template-columns:clamp(120px,calc(var(--shoot-side-space)*.58),20cqw) minmax(0,1fr) clamp(80px,calc(var(--shoot-side-space)*.42),20cqw)
}
.shoot-game .controls {
  padding-inline:8px
}
.shoot-game .target-number.bull-target {
  font-size:.5em
}
.shoot-game .target-heading::before {
  content:"TARGET";
  display:block;
  color:#fff;
  font-size:clamp(11px,1.2cqw,18px);
  letter-spacing:.12em;
  text-align:center;
  line-height:1.2
}
.shoot-multiplier {
  display:grid;
  place-items:center;
  width:min(100%,160px);
  height:clamp(44px,9cqh,80px);
  flex-shrink:0;
  border:2px solid #fff;
  color:#fff;
  font-size:clamp(24px,4cqh,40px);
  line-height:1;
}
.shoot-multiplier strong { display:flex;align-items:baseline;justify-content:center;gap:2px;font-weight:500; }
.shoot-multiplier .multiplier-symbol { font-size:.6em; }
.shoot-game .footer { grid-template-columns:inherit; }
.shoot-game #footerMprCell,.shoot-game #footerScoreLabel { display:none; }
.shoot-game #footerScoreCell { padding:0;overflow:hidden; }
.shoot-game #footerScore { font-weight:900;font-size:var(--footer-height);line-height:1; }

.rail {
  padding-top:0
}
.game-info {
  margin-inline:calc(-1 * clamp(6px,1.2cqw,18px));
  padding:clamp(6px,1.2cqh,14px);
  background:#EB6238;
  color:#fff;
  line-height:1.5
}
.game-info h1 {
  margin:0;
  font-size:clamp(10px,1.2cqw,16px);
  font-weight:900;
  line-height:1.5
}
.game-info #ruleLabel {
  margin:0;
  font-size:clamp(9px,1cqw,14px);
  color:#fff;
  line-height:1.5
}
.round-heading {
  margin-top:clamp(8px,1.2cqh,14px)
}
@media(max-height:550px),(pointer:coarse) {
  .rail {
    padding-top:0
  }
  .game-info {
    margin-inline:-8px;
    padding:3px 6px
  }
  .game-info h1 {
    font-size:clamp(9px,1.15cqw,12px)
  }
  .game-info #ruleLabel {
    font-size:clamp(8px,1cqw,11px)
  }
}


/* Standalone practice: no exam stages, goals, or 01 controls. */
.footer { grid-template-columns:minmax(0,1.2fr) 1fr 1fr 1fr; }
.setup-name { padding:14px 0; border-block:1px solid #ffffff25; overflow-wrap:anywhere; }
.setup-name strong { display:block; margin-top:6px; font-size:22px; }
.setup a { color:inherit; } .setup-links { display:flex;justify-content:space-between;gap:12px;margin-top:16px;font-size:12px; }
.rail-actions a { text-align:center; padding:6px; color:inherit; font-size:clamp(9px,1cqw,14px); }
.setup .start-btn { margin-top:20px; }
#recordStatus { position:absolute;left:8px;right:8px;bottom:0;z-index:30;background:#343638;font-size:11px;padding:8px; }
.result-card [data-result-actions] { display:flex;flex-direction:column;gap:8px; }
.result-card [data-result-actions] button { margin:0; }
