*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #000;
  color: #fff;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.panel--display {
  background: #000;
  border-bottom: 1px solid #333;
  min-height: 50vh;
}

.display-layout {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  align-self: stretch;
}

.display-board {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  column-gap: clamp(0.65rem, 2.5vw, 1.35rem);
  row-gap: 0.75rem;
  width: 100%;
}

.display-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.display-col--score {
  min-width: min(5rem, 22vw);
}

.display-col--score-total {
  min-width: min(6.5rem, 30vw);
}

.display-col--timer {
  flex: 0 1 auto;
  max-width: 100%;
}

.display-board .display-col > .label,
.display-board .interval-round-column > .label,
.timer-hero .timer-display-block > .label {
  margin: 0 0 0.35rem;
  min-height: 1.35em;
  line-height: 1.2;
}

.display-board .display-col--score .score-value {
  margin: 0;
  font-family: "Share Tech Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: clamp(2.25rem, 9vw, 4.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #fff;
}

.timer-hero--count-up,
.timer-hero--interval-work,
.timer-hero--interval-rest,
.timer-hero--interval-idle,
.timer-hero--interval-done {
  background: #000;
}

.timer-display-block {
  width: auto;
  max-width: 100%;
  text-align: center;
}

.timer-hero {
  width: auto;
  max-width: 100%;
}

.interval-round-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.panel--controls {
  background: #000;
  align-items: stretch;
  max-width: 52rem;
  margin: 0 auto;
  width: 100%;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  width: 100%;
  align-items: start;
}

.controls-column .controls-heading {
  margin-top: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #333;
  color: #fff;
}

.controls-column--timer {
  padding-right: 0.5rem;
}

.controls-column--score {
  padding-left: 0.5rem;
  border-left: 1px solid #333;
}

@media (max-width: 700px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .controls-column--score {
    padding-left: 0;
    border-left: none;
    padding-top: 1rem;
    border-top: 1px solid #333;
  }
}

.label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.timer-block {
  text-align: center;
  margin-bottom: 2rem;
}

.timer {
  margin: 0;
  line-height: 1;
}

.timer--digital,
.interval-round {
  font-family: "Share Tech Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: clamp(2.25rem, 9vw, 4.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}

.timer--digital {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  margin: 0;
  color: #ff1a1a;
  text-shadow:
    0 0 8px rgba(255, 40, 40, 0.55),
    0 0 24px rgba(255, 30, 30, 0.25);
}

.timer-hero--interval-rest .timer--digital {
  color: #4dabf7;
  text-shadow:
    0 0 8px rgba(77, 171, 247, 0.55),
    0 0 24px rgba(51, 136, 255, 0.28);
}

.interval-round {
  display: inline-block;
  vertical-align: baseline;
  min-width: 1.2ch;
  color: #00e676;
  text-shadow:
    0 0 8px rgba(0, 230, 120, 0.5),
    0 0 24px rgba(0, 200, 100, 0.25);
}

.timer__main {
  color: inherit;
}

.timer__frac {
  font-size: 0.42em;
  font-weight: 400;
  color: inherit;
  vertical-align: baseline;
  opacity: 0.95;
}

.scores {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.score-card {
  text-align: center;
  min-width: 6rem;
}

.score-value {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #fff;
}

.controls-heading {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label {
  font-weight: 500;
  color: #fff;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
}

.btn-row--timer {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control-group--timer {
  align-items: flex-start;
}

.control-group--field {
  flex-wrap: wrap;
}

.control-group--checkbox {
  align-items: flex-start;
}

.is-hidden {
  display: none !important;
}

.select {
  min-width: 12rem;
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  border: 1px solid #fff;
  border-radius: 2px;
  background: #000;
  color: #fff;
}

.input-num {
  width: 5rem;
  padding: 0.45rem 0.5rem;
  font-size: 1rem;
  border: 1px solid #fff;
  border-radius: 2px;
  background: #000;
  color: #fff;
}

.input-mmss {
  width: 5.5rem;
  font-variant-numeric: tabular-nums;
}

.control-group--score {
  align-items: center;
}

.control-group--score-reset {
  justify-content: flex-start;
}

.score-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-num--score {
  width: 4.5rem;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem 0.35rem;
}

.score-edit .btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #fff;
  cursor: pointer;
}

.checkbox-label input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: #fff;
}

.score-card--wide {
  min-width: 10rem;
}

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

.btn:disabled:hover {
  background: #000;
  border-color: #666;
}

.btn-accent {
  min-width: 4rem;
  min-height: 3rem;
  font-size: 1rem;
  font-weight: 600;
  border-color: #fff;
  background: #000;
  color: #fff;
}

.btn-accent:hover:not(:disabled) {
  background: #1a1a1a;
  border-color: #fff;
}

.btn {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1;
  border: 1px solid #fff;
  border-radius: 2px;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.btn:hover {
  background: #1a1a1a;
  border-color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  min-height: 3rem;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-color: #fff;
  background: #000;
  color: #fff;
}

.btn-primary:hover {
  background: #1a1a1a;
  border-color: #fff;
}

.btn-small {
  min-width: auto;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
}

.custom-segments-list {
  width: 100%;
  margin-top: 0.35rem;
}

.custom-segment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.45rem;
}

.custom-segment-idx {
  min-width: 1.25rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.custom-segment-x {
  color: #666;
  font-size: 0.85rem;
  margin: 0 0.05rem;
}
