:root {
  --bg: #f3f0ea;
  --ink: #17140f;
  --soft: rgba(23, 20, 15, 0.56);
  --line: rgba(23, 20, 15, 0.1);
  --fight: #df3b2c;
  --rest: #4a6f96;
}

*, *::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: 8px 16px;
}

/* --tone is the phase's colour: red for the round, blue for the rest */
.bx { --tone: var(--fight); display: flex; flex-direction: column; align-items: center; width: min(300px, 100%); }
.bx__roll { display: block; overflow: hidden; }
.bx__roll > span { display: block; white-space: nowrap; }

.bx__head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.bx__title b { display: block; font-size: 15px; line-height: 19px; font-weight: 680; font-stretch: 104%; }
.bx__title > span { display: block; font-size: 11.5px; line-height: 16px; font-weight: 560; color: var(--soft); }
.bx__bell { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(23, 20, 15, 0.4); }
.bx__bell svg { width: 30px; height: 30px; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.bx__ding { stroke: var(--tone); stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }

/* the ring is one button: a tap pauses and resumes */
.bx__ring { position: relative; display: block; width: min(232px, 54vh, 80vw); aspect-ratio: 1; margin-top: clamp(0px, 1vh, 6px); padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font: inherit; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.bx__ring svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; }
.bx__track { stroke: var(--line); stroke-width: 10; }
.bx__arc { stroke: var(--tone); stroke-width: var(--thick, 10); stroke-linecap: round; stroke-dasharray: 1 2; }
.bx__ring:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 40%, transparent); }
.bx__mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.bx__round { height: 17px; font-size: 12px; line-height: 17px; font-weight: 680; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.bx__time { font-size: clamp(46px, 15vh, 66px); line-height: 1.08; font-weight: 400; letter-spacing: -0.045em; font-variation-settings: "wght" var(--w, 560), "wdth" 90; white-space: nowrap; }
.bx__time i { display: inline-block; width: 0.580em; font-style: normal; text-align: center; }
.bx.is-warn .bx__time { color: var(--tone); }
.bx__state { height: 20px; font-size: 14px; line-height: 20px; font-weight: 700; font-stretch: 106%; color: var(--tone); }

/* one bar per round: done, running, to come */
.bx__bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; width: 78%; height: 5px; margin-top: clamp(4px, 2vh, 12px); }
.bx__bars i { border-radius: 3px; background: var(--line); overflow: hidden; }
.bx__bars b { display: block; height: 100%; border-radius: 3px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.bx__bars i.is-now b { background: var(--tone); }

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

/* on a large screen the scene is drawn bigger, so the poster and the preview video are not small in a big room */
@media (min-width: 900px) and (min-height: 680px) {
  .bx { zoom: 1.6; }
  /* inside the zoom the window's height no longer says how big the ring may be */
  .bx__ring { width: 232px; }
}
@media (min-width: 1100px) and (min-height: 800px) {
  .bx { zoom: 2; }
}
