/* ============================================================
   PANTALLAS — específico de Study Timer.
   tokens.css, base.css y components.css son idénticos a los de
   Decision: no se tocan, se copian.
   ============================================================ */

.screen {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  flex: 1;
  animation: rise var(--base) var(--ease) both;
}

.screen__title {
  font-size: var(--step-3);
  max-width: 14ch;
}

.screen__hint {
  color: var(--text-muted);
  max-width: 34ch;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-5);
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
}

/* ---------- Elegir bloque ---------- */
.blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.blocks button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--sp-4) var(--sp-2);
  background: var(--surface);
  border: var(--bd) solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.blocks button:active {
  transform: scale(0.96);
}

.blocks button[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.blocks b {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--text);
}

.blocks button[aria-pressed='true'] b {
  color: var(--on-primary);
}

.blocks small {
  font-size: var(--step--1);
  font-weight: 700;
}

.blocks i {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ---------- Tira de la semana en el home ---------- */
.weekstrip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: var(--bd) solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  text-align: left;
  color: var(--text);
}

.weekstrip__n {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--primary);
  line-height: 1;
}

.weekstrip__l {
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.weekstrip__go {
  font-size: var(--step--1);
  font-weight: 800;
  color: var(--text-muted);
}

/* ---------- Corriendo ---------- */
.run {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  flex: 1;
  justify-content: center;
  text-align: center;
  min-height: 46dvh;
}

.run__subject {
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.ring {
  position: relative;
  width: min(74vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.ring__track {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 7;
}

.ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.ring--break .ring__fill {
  stroke: var(--success);
}

.ring__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.clock {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 15vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.clock__label {
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.run--paused .clock {
  color: var(--text-muted);
}

.run__state {
  min-height: 22px;
  font-weight: 700;
  color: var(--warning);
  font-size: var(--step--1);
}

.run__row {
  display: flex;
  gap: var(--sp-2);
  width: 100%;
}

.run__row .btn {
  flex: 1;
}

/* ---------- La pregunta honesta ---------- */
.ask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 10, 10, 0.86);
  display: grid;
  place-items: end center;
  padding: 0;
  animation: fadein var(--fast) var(--ease);
}

@media (min-width: 700px) {
  .ask {
    place-items: center;
    padding: var(--sp-5);
  }
}

@keyframes fadein {
  from {
    opacity: 0;
  }
}

.ask__box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: var(--bd) solid var(--primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--sp-5) var(--gutter) calc(var(--sp-5) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  animation: up var(--base) var(--ease) both;
}

@media (min-width: 700px) {
  .ask__box {
    border-radius: var(--radius-lg);
    padding-bottom: var(--sp-5);
  }
}

@keyframes up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

.ask__box h2 {
  font-size: var(--step-2);
}

/* ---------- Bloque terminado ---------- */
.done {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  background: var(--surface);
  border: var(--bd) solid var(--primary);
  border-radius: var(--radius-lg);
  animation: pop var(--slow) var(--ease) both;
}

.done h1 {
  font-size: var(--step-4);
  color: var(--primary);
}

.done p {
  margin-top: var(--sp-3);
  font-size: var(--step-1);
  font-weight: 700;
}

/* ---------- Semana ---------- */
.total {
  text-align: center;
  padding-block: var(--sp-5);
}

.total b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 0.9;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.total span {
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-2);
  align-items: end;
  height: 150px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  height: 100%;
  justify-content: flex-end;
}

.day__bar {
  width: 100%;
  background: var(--surface-2);
  border-radius: 5px 5px 0 0;
  min-height: 4px;
  animation: growup var(--slow) var(--ease) both;
  transform-origin: bottom;
}

.day--on .day__bar {
  background: var(--primary);
}

.day--today .day__bar {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.day__l {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

.day--today .day__l {
  color: var(--text);
}

@keyframes growup {
  from {
    transform: scaleY(0);
  }
}

.subjrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding-block: var(--sp-3);
  border-top: 1px solid var(--border);
}

.subjrow:first-of-type {
  border-top: 0;
}

.subjrow__n {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.subjrow__t {
  font-family: var(--font-display);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.subjrow__bar {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.subjrow__bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  animation: growx var(--slow) var(--ease) both;
  transform-origin: left;
}

@keyframes growx {
  from {
    transform: scaleX(0);
  }
}

.honest {
  padding: var(--sp-4);
  border: var(--bd) dashed var(--border);
  border-radius: var(--radius);
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.5;
}

.honest b {
  color: var(--warning);
}

/* ---------- Desktop: sigue siendo una columna ---------- */
@media (min-width: 768px) {
  .screen__title {
    font-size: var(--step-4);
  }

  .actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }

  .actions .btn--block {
    width: auto;
    min-width: 200px;
  }

  .run__row .btn {
    flex: 0 0 auto;
    min-width: 160px;
  }

  .run__row {
    justify-content: center;
  }
}
