:root {
  --bg: #000000;
  --card: #111214;
  --card-hi: #1a1b1f;
  --ink: #f6f5f1;
  --soft: rgba(246, 245, 241, 0.52);
  --line: rgba(255, 255, 255, 0.1);
  --calm: #7be495;
  --warn: #ffb547;
  --over: #ff5a5f;
  --tone: var(--calm);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
}

.tmr {
  --tone: var(--calm);
  width: min(368px, 100%);
  padding: 16px 18px 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px var(--line),
    0 36px 80px -34px color-mix(in srgb, var(--tone) 46%, transparent);
  transition: box-shadow 0.8s ease;
}
.tmr.is-warn { --tone: var(--warn); }
.tmr.is-over { --tone: var(--over); }
.tmr__head { display: flex; align-items: center; justify-content: space-between; }
.tmr__room { font-size: 12.5px; font-weight: 560; color: var(--soft); }
.tmr__state { height: 26px; padding: 0 11px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone); font-size: 12px; line-height: 26px; font-weight: 660; white-space: nowrap; transition: background-color 0.5s ease, color 0.5s ease; }
.tmr__state span { display: block; }
.tmr.is-over .tmr__state { background: var(--over); color: #1a0506; }

/* the time: every digit sits in a box of its own width, so the line does not jump as they change */
.tmr__time { display: flex; align-items: baseline; justify-content: center; height: clamp(84px, 27vw, 112px); margin: 6px 0 4px; font-size: clamp(78px, 25vw, 104px); line-height: clamp(84px, 27vw, 112px); font-weight: var(--wght, 500); font-stretch: var(--wdth, 125%); letter-spacing: -0.02em; color: var(--ink); transition: color 0.6s ease; white-space: nowrap; }
.tmr.is-warn .tmr__time { color: var(--warn); }
.tmr.is-over .tmr__time { color: var(--over); }
.tmr__d { display: inline-block; width: 0.66em; text-align: center; }
.tmr__colon { display: inline-block; width: 0.3em; text-align: center; transform: translateY(-0.06em); }
.tmr__sign { display: none; width: 0.5em; text-align: center; font-size: 0.6em; }
.tmr.is-over .tmr__sign { display: inline-block; }

.tmr__line { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tmr__line span { display: block; height: 100%; border-radius: 3px; background: var(--tone); transform-origin: 0 50%; transition: background-color 0.5s ease; }

.tmr__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.tmr__talk { min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmr__talk i { display: block; margin-top: 1px; font-style: normal; font-size: 12px; font-weight: 460; color: var(--soft); }
.tmr__keys { flex: none; display: flex; gap: 6px; }
.tmr__keys button { position: relative; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tmr__keys button svg { position: absolute; inset: 10px; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tmr__keys button:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .tmr__keys button:hover { background: rgba(255, 255, 255, 0.14); }
}
@media (min-width: 700px) and (min-height: 500px) {
  .tmr { zoom: 1.3; }
}
@media (min-width: 1100px) and (min-height: 760px) {
  .tmr { zoom: 1.6; }
}
