/* Aamurutiini — jumppa.rahko.eu */

:root {
  --bg: #0b0d10;
  --bg-2: #151b23;
  --fg: #f5f7fa;
  --muted: #9aa4b2;
  --accent: #fbbf24;
  --accent-ink: #1a1204;
  --overlay: rgba(5, 8, 12, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(130% 100% at 50% 0%, var(--bg-2) 0%, var(--bg) 65%);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* --- Taustavideo --- */
#video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#stickman {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#video-wrap video.active { opacity: 1; }
#overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

/* --- Näkymät --- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 28px)
    24px
    calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.screen.active { display: flex; }

h1 {
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 800;
}
.sub {
  color: var(--muted);
  margin-top: 10px;
  font-size: 1.05rem;
}

button {
  font: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--fg);
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 20px 64px;
  margin-top: 36px;
  box-shadow: 0 10px 36px rgba(251, 191, 36, 0.35);
  transition: transform 0.1s ease;
}
.primary-btn:active { transform: scale(0.96); }

/* --- Suoritusnäkymä --- */
#routine-screen { justify-content: space-between; }

#progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
  z-index: 2;
}
#progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}

#move-counter {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}
#move-name {
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

#timer {
  font-size: clamp(7rem, 40vw, 14rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.7);
}
#timer.ending { color: var(--accent); }

#next-up {
  color: var(--muted);
  font-size: 1rem;
  min-height: 1.4em;
}

#controls {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  justify-content: center;
}
#controls button {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 13px 30px;
  font-size: 1rem;
  font-weight: 600;
}
#controls button:active { background: rgba(255, 255, 255, 0.24); }

/* --- Lopetusnäkymä --- */
.check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}
