#ub-time-precision-game,
#ub-time-precision-game * {
  box-sizing: border-box;
}

#ub-time-precision-game {
  --ubtpg-text: #31313d;
  --ubtpg-sub: #78788a;
  --ubtpg-line: rgba(104, 92, 164, 0.22);
  width: min(100%, 760px);
  max-width: 100%;
  margin: 16px auto;
  color: var(--ubtpg-text);
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  isolation: isolate;
}

#ub-time-precision-game button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

#ub-time-precision-game .ubtpg-shell {
  padding: 0 16px 16px;
  overflow: hidden;
  border: 1px solid var(--ubtpg-line);
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 16px 42px rgba(77, 65, 125, 0.10);
}

#ub-time-precision-game .ubtpg-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 16px 0 12px;
}

#ub-time-precision-game .ubtpg-title {
  margin: 0;
  color: var(--ubtpg-sub);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
}

#ub-time-precision-game .ubtpg-targets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

#ub-time-precision-game .ubtpg-target {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 8px 3px;
  border: 1px solid #d6d6d8;
  border-radius: 12px;
  background: #fff;
  color: #777;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

#ub-time-precision-game .ubtpg-target:hover:not(:disabled) {
  border-color: #b8b8bc;
  background: #fafafa;
}

#ub-time-precision-game .ubtpg-target.is-active {
  border-color: #8a8a8a;
  background: #8a8a8a;
  color: #fff;
}

#ub-time-precision-game .ubtpg-target:disabled {
  cursor: default;
  opacity: .8;
}

#ub-time-precision-game .ubtpg-field {
  display: grid;
  place-items: center;
  min-height: 408px;
  border: 1px solid rgba(104, 92, 164, 0.16);
  border-radius: 18px;
  background: linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)), repeating-linear-gradient(0deg, transparent 0, transparent 39px, rgba(120,105,180,.045) 40px);
}

#ub-time-precision-game .ubtpg-center {
  display: grid;
  grid-template-rows: 56px 74px 26px 116px 60px;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  text-align: center;
}

#ub-time-precision-game .ubtpg-target-summary {
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  text-align: center;
  justify-self: center;
  margin-inline: auto;
}

#ub-time-precision-game .ubtpg-phase {
  grid-row: 2 / 4;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  color: var(--ubtpg-sub);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .10em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#ub-time-precision-game.is-countdown .ubtpg-phase,
#ub-time-precision-game.is-running .ubtpg-phase {
  color: #65616f;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -.01em;
}

#ub-time-precision-game.is-running .ubtpg-phase {
  font-size: 24px;
}

#ub-time-precision-game .ubtpg-target-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#ub-time-precision-game .ubtpg-target-number {
  color: #555461;
  font-size: clamp(27px, 7vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
}

#ub-time-precision-game .ubtpg-target-unit {
  color: var(--ubtpg-sub);
  font-size: 13px;
  font-weight: 600;
}

#ub-time-precision-game .ubtpg-display-label {
  margin: 0;
  color: var(--ubtpg-sub);
  font-size: 11px;
  letter-spacing: .10em;
}

#ub-time-precision-game .ubtpg-results {
  grid-row: 4;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 400px);
  height: 116px;
  align-items: center;
}

#ub-time-precision-game .ubtpg-result-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--ubtpg-sub);
  font-size: 12px;
  letter-spacing: .03em;
}

#ub-time-precision-game .ubtpg-result {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  height: 100px;
  padding: 10px 4px;
  border: 1px solid rgba(104, 92, 164, .18);
  border-radius: 12px;
  background: #fff;
  visibility: hidden;
}

#ub-time-precision-game.is-result .ubtpg-result {
  visibility: visible;
}

#ub-time-precision-game.is-result .ubtpg-result-hint {
  visibility: hidden;
}

#ub-time-precision-game .ubtpg-result-label {
  color: var(--ubtpg-sub);
  font-size: 11px;
  font-weight: 600;
}

#ub-time-precision-game .ubtpg-result-measure {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

#ub-time-precision-game .ubtpg-result-value {
  display: block;
  min-width: 0;
  margin: 0;
  color: #4f4f5b;
  font-size: clamp(19px, 4.8vw, 25px);
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#ub-time-precision-game .ubtpg-result-unit {
  color: var(--ubtpg-sub);
  font-size: 10px;
}

#ub-time-precision-game .ubtpg-action {
  grid-row: 5;
  width: min(100%, 270px);
  height: 54px;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #8a8a8a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .12em;
}

#ub-time-precision-game .ubtpg-action:hover:not(:disabled) {
  background: #707070;
}

#ub-time-precision-game .ubtpg-action:active:not(:disabled) {
  background: #626262;
}

#ub-time-precision-game .ubtpg-action:disabled {
  opacity: .6;
  cursor: default;
}

#ub-time-precision-game .ubtpg-action:focus-visible,
#ub-time-precision-game .ubtpg-target:focus-visible {
  outline: 2px solid #7868b8;
  outline-offset: 2px;
}

#ub-time-precision-game .ubtpg-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px 12px;
}

#ub-time-precision-game .ubtpg-sound {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ubtpg-sub);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  white-space: nowrap;
}

#ub-time-precision-game .ubtpg-sound-toggle {
  position: relative;
  width: 38px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(104, 92, 164, 0.28);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

#ub-time-precision-game .ubtpg-sound-toggle[aria-pressed="true"] {
  border-color: rgba(154,134,255,0.62);
  background: linear-gradient(135deg, rgba(255,131,183,0.10), rgba(118,219,232,0.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}

#ub-time-precision-game .ubtpg-sound-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(104, 92, 164, 0.28);
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  transition: transform .16s ease, border-color .15s ease;
}

#ub-time-precision-game .ubtpg-sound-toggle[aria-pressed="true"] .ubtpg-sound-knob {
  transform: translateX(18px);
  border-color: rgba(154,134,255,0.62);
}

#ub-time-precision-game .ubtpg-sound-toggle:hover {
  border-color: rgba(154,134,255,0.62);
}

#ub-time-precision-game .ubtpg-sound-toggle:active {
  transform: scale(.96);
}

#ub-time-precision-game .ubtpg-sound-toggle:focus-visible {
  outline: 2px solid rgba(90, 82, 170, 0.68);
  outline-offset: 2px;
}

#ub-time-precision-game .ubtpg-notes {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--ubtpg-line);
  border-radius: 16px;
  background: transparent;
  color: var(--ubtpg-sub);
  text-align: center;
}

#ub-time-precision-game .ubtpg-notes-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
}

#ub-time-precision-game .ubtpg-notes p:not(.ubtpg-notes-title) {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
}

@media (max-width: 560px) {
  #ub-time-precision-game {
    width: calc(100% - 32px);
  }

  #ub-time-precision-game .ubtpg-shell {
    padding: 0 12px 12px;
    border-radius: 18px;
  }

  #ub-time-precision-game .ubtpg-targets {
    gap: 6px;
    margin-bottom: 12px;
  }

  #ub-time-precision-game .ubtpg-target {
    min-height: 44px;
    padding: 8px 2px;
    font-size: 12px;
  }

  #ub-time-precision-game .ubtpg-field {
    min-height: 390px;
  }

  #ub-time-precision-game .ubtpg-center {
    grid-template-rows: 52px 72px 24px 108px 56px;
    gap: 6px;
    padding: 10px;
  }

  #ub-time-precision-game .ubtpg-phase {
    height: 100%;
  }

  #ub-time-precision-game .ubtpg-target-summary {
    gap: 8px;
  }

  #ub-time-precision-game .ubtpg-target-number {
    font-size: clamp(26px, 7vw, 32px);
  }

  #ub-time-precision-game .ubtpg-results {
    height: 108px;
    gap: 6px;
  }

  #ub-time-precision-game .ubtpg-result {
    height: 96px;
  }

  #ub-time-precision-game .ubtpg-result-value {
    font-size: clamp(17px, 4.9vw, 22px);
  }

  #ub-time-precision-game .ubtpg-action {
    height: 52px;
    min-height: 52px;
  }
}

@media (max-width: 350px) {
  #ub-time-precision-game .ubtpg-result-value {
    font-size: 16px;
  }
}
