.timer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 22px;
  margin-bottom: 22px;
  align-items: start;
}
.timer-stage {
  --timer-color: var(--brand-light);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(
    ellipse at 50% 43%,
    color-mix(in srgb, var(--timer-color) 7%, #11150f),
    #0b0e0b 70%
  );
  border: 1px solid color-mix(in srgb, var(--timer-color) 28%, #232a20);
  border-radius: 16px;
  padding: 22px;
  color: #f7f8f0;
  box-shadow:
    inset 0 1px #ffffff13,
    0 15px 45px #0002;
}
.timer-stage:before {
  content: "鍛錬";
  position: absolute;
  right: -16px;
  bottom: 34px;
  writing-mode: vertical-rl;
  font: 120px var(--kanji);
  color: #ffffff04;
  z-index: -1;
}
.timer-stage[data-phase="trabajo"] {
  --timer-color: #efbd37;
}
.timer-stage[data-phase="descanso"] {
  --timer-color: #55cda2;
}
.timer-stage[data-phase="enfriamiento"] {
  --timer-color: #78adf1;
}
.timer-stage[data-phase="fin"] {
  --timer-color: #55cda2;
}
[data-theme="SOL NACIENTE JAPÓN"] .timer-stage {
  --timer-color: #ff6769;
}
.timer-top,
.timer-session,
.timer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.timer-top > span {
  font: 600 13px var(--sports);
  letter-spacing: 0.12em;
  color: #b9c4ae;
  display: flex;
  gap: 8px;
  align-items: center;
}
.timer-top .btn {
  font-size: 12px;
  min-height: 36px;
  color: #d7dfd0;
  border-color: #ffffff20;
}
.timer-session {
  margin: 27px 0 7px;
  font: 700 21px var(--sports);
  letter-spacing: 1px;
  color: var(--timer-color);
}
.timer-session > span:last-child {
  font-size: 16px;
  color: #a5b19b;
}
.timer-circle {
  width: min(100%, 410px);
  aspect-ratio: 1;
  position: relative;
  margin: 5px auto 20px;
}
.timer-circle > svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke: #ffffff0b;
  stroke-width: 5;
}
.timer-circle #timer-progress {
  stroke: var(--timer-color);
  stroke-linecap: round;
  filter: drop-shadow(
    0 0 6px color-mix(in srgb, var(--timer-color) 35%, transparent)
  );
  transition: stroke-dasharray 100ms linear;
}
.timer-circle > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.timer-circle #timer-phase {
  font: italic 800 29px var(--sports);
  text-transform: uppercase;
  color: var(--timer-color);
  text-align: center;
}
.timer-circle strong {
  font: 800 clamp(70px, 7.2vw, 112px)/0.95 var(--sports);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.timer-circle #timer-status {
  font-size: 13px;
  color: #b7c1ad;
  letter-spacing: 0.13em;
  text-align: center;
}
.timer-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.timer-controls .btn {
  font-size: 13px;
  color: #e3e9dd;
  border-color: #ffffff26;
  min-height: 46px;
  justify-content: center;
}
.timer-controls .timer-primary {
  grid-column: 1/-1;
  background: var(--timer-color);
  color: #11180d;
  font: 800 24px var(--sports);
  height: 58px;
  box-shadow: 0 6px 23px color-mix(in srgb, var(--timer-color) 15%, transparent);
}
.timer-bottom {
  font-size: 12px;
  color: #acb79f;
  margin-top: 22px;
  flex-wrap: wrap;
}
.timer-sound-state {
  text-align: center;
  font-size: 12px;
  color: #a8b399;
  margin-top: 17px;
}
.timer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.timer-fields .wide {
  grid-column: 1/-1;
}
.timer-settings .field {
  font-size: 13px;
  margin-bottom: 10px;
}
.timer-settings input {
  min-width: 0;
  width: 100%;
}
.timer-settings input[type="range"] {
  padding: 0;
}
.timer-settings select {
  width: 100%;
}
.timer-sound-tests {
  display: flex;
  gap: 8px;
  margin: 15px 0;
  flex-wrap: wrap;
}
.timer-sound-tests .btn {
  font-size: 13px;
}
.timer-settings .actions .btn {
  font-size: 13px;
}
.timer-settings .note {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 16px;
}
.timer-sequence {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 4px 0 12px;
}
.phase-pill {
  display: block;
  flex: none;
  min-width: 82px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: var(--soft);
}
.phase-pill small {
  font-size: 12px;
  margin-top: 3px;
}
.phase-pill.trabajo {
  border-top: 3px solid var(--acento);
}
.phase-pill.descanso {
  border-top: 3px solid var(--judo);
}
.phase-pill.current {
  box-shadow: 0 0 0 2px var(--acento);
  background: var(--panel);
}
.timer-stage:fullscreen,
.timer-expanded {
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 25px max(20px, calc((100vw - 900px) / 2));
  overflow: auto;
}
.timer-expanded {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.timer-stage:fullscreen .timer-circle,
.timer-expanded .timer-circle {
  width: min(64vh, 560px);
  margin: 0 auto;
}
.timer-stage:fullscreen .timer-circle strong,
.timer-expanded .timer-circle strong {
  font-size: clamp(90px, 15vh, 190px);
}
.timer-stage:fullscreen .timer-top {
  margin-bottom: 8px;
}
@media (max-width: 1180px) {
  .timer-layout {
    grid-template-columns: 1fr;
  }
  .timer-circle {
    width: 360px;
  }
  .timer-circle strong {
    font-size: 105px;
  }
  .timer-settings .timer-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .timer-fields .wide {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  .timer-stage {
    padding: 18px 15px;
  }
  .timer-top > span {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .timer-top .btn {
    font-size: 11px;
    padding: 7px;
  }
  .timer-session {
    font-size: 19px;
  }
  .timer-circle {
    width: min(100%, 330px);
  }
  .timer-circle strong {
    font-size: 90px;
  }
  .timer-circle #timer-phase {
    font-size: 25px;
  }
  .timer-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .timer-controls .btn {
    flex-wrap: wrap;
    font-size: 11px;
    line-height: 1.4;
    padding: 9px 5px;
  }
  .timer-controls .timer-primary {
    font-size: 24px;
  }
  .timer-settings .timer-fields {
    grid-template-columns: 1fr 1fr;
  }
  .timer-bottom {
    font-size: 11px;
  }
  .timer-stage:fullscreen {
    padding: 16px;
  }
  .timer-stage:fullscreen .timer-circle {
    width: min(80vw, 50vh);
  }
}
