@font-face {
  font-family: "Gidole";
  src: url("./Gidole-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  --text: rgba(255, 255, 255, 0.96);
  --text-soft: rgba(255, 255, 255, 0.72);
  --panel: rgba(10, 13, 24, 0.28);
  --line: rgba(255, 255, 255, 0.22);
  --bg-image: url("./photo-1501785888041-af3ef285b470.png");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background-color: #000;
}

html {
  background-color: transparent;
  background-image: var(--bg-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  font-family: "Gidole", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: transparent;
}

body.is-immersive {
  overflow: hidden;
}

.app {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 78px 20px 78px;
  display: grid;
  place-items: start center;
}

.app.is-immersive {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  padding:
    max(12px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  z-index: 9999;
}

.gmt {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 3;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.fullscreen-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  width: 92px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 180ms ease, background 180ms ease, transform 180ms ease;
}

.fullscreen-floating:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.corner-btn {
  position: fixed;
  z-index: 4;
  width: 92px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 180ms ease, background 180ms ease, transform 180ms ease;
}

.corner-btn:hover,
.fullscreen-floating:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.corner-btn-left {
  left: 18px;
  top: 18px;
}

.corner-btn-right {
  right: 18px;
  top: 18px;
}

.timer-card {
  position: relative;
  z-index: 2;
  width: min(700px, 100%);
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.2), rgba(10, 13, 24, 0.28));
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  margin-top: 13vh;
  transition:
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 500ms ease-in-out,
    filter 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(560px, 100%);
  margin: 0 auto 10px;
}

.progress-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.96);
  transition: width 180ms linear;
}

.progress-value {
  min-width: 64px;
  justify-self: end;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  color: var(--text);
  text-align: right;
}

.timer-display {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  text-align: center;
  transition: transform 260ms ease, gap 260ms ease, margin-bottom 260ms ease;
}

.timer-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.time-unit {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  align-content: center;
  justify-self: center;
  height: 100%;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.time-value {
  font-size: clamp(3.1rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.time-label {
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: center;
  width: 100%;
  align-self: center;
}

.time-separator {
  align-self: center;
  justify-self: center;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.82);
  user-select: none;
  opacity: 0;
  transition: opacity 180ms ease;
  transform: translateY(-0.05em);
}

.timer-card.show-colons .time-separator {
  opacity: 1;
}

.stepper {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  height: 66px;
  width: 34px;
  justify-self: center;
  align-self: center;
}

.step-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.step-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.step-btn:active {
  transform: translateY(0) scale(0.96);
}

.actions {
  display: none;
}

.timer-card.is-running {
  width: min(640px, 94vw);
  transform: translateY(-12vh) scale(0.76);
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  filter: none;
}

.timer-card.is-running .timer-display {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}

.timer-card.is-running .progress-wrap {
  display: grid;
}

.timer-card.is-running .time-value {
  font-size: clamp(3.7rem, 7.8vw, 5.7rem);
}

.timer-card.is-running .time-label {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
}

.timer-card.is-running .time-unit {
  gap: 8px;
}

.timer-card.is-running .stepper {
  height: 68px;
  width: 36px;
  gap: 6px;
}

.timer-card.is-running .step-btn {
  width: 36px;
  height: 36px;
  font-size: 1.18rem;
}

.timer-card.is-running .actions {
  display: none;
}

.timer-card.is-running .stepper {
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  width: 0;
  overflow: hidden;
}

.progress-wrap[hidden] {
  display: none;
}

.photo-nav-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 50px);
  justify-content: center;
  gap: 12px;
  margin-top: -2px;
}

.photo-nav {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(10, 13, 24, 0.12);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.96);
  font-family: inherit;
  font-size: 1.95rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
  display: grid;
  place-items: center;
  padding: 0;
}

.photo-nav:hover {
  background: rgba(10, 13, 24, 0.24);
  transform: translateY(-1px);
}

.corner-btn:focus-visible,
.fullscreen-floating:focus-visible,
.photo-nav:focus-visible,
.step-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .corner-btn,
  .fullscreen-floating {
    width: 82px;
    height: 32px;
    font-size: 0.68rem;
  }

  .timer-card {
    width: min(100%, 560px);
  }

  .timer-display {
    grid-template-columns: 1fr;
  }

  .time-value {
    font-size: clamp(3.5rem, 20vw, 5.1rem);
  }

  .timer-card.is-running {
    transform: translateY(-7vh) scale(0.88);
  }
}
