:root {
  --bg: #ffffff;
  --ink: #17181b;
  --soft: rgba(23, 24, 27, 0.58);
  --line: rgba(23, 24, 27, 0.1);
  --accent: #e0452f;
}

*, *::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: 10px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cc { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; width: min(348px, 100%); padding: 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(23, 24, 27, 0.4); }
.cc__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px; }
.cc__what { display: grid; gap: 1px; min-width: 0; }
.cc__what strong { font-size: 16px; line-height: 20px; font-weight: 740; letter-spacing: -0.01em; white-space: nowrap; }
.cc__what span { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; }
.cc__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.cc__state { flex: none; height: 26px; padding: 5px 11px; border-radius: 13px; background: rgba(23, 24, 27, 0.05); font-size: 12px; font-weight: 680; color: var(--soft); }

/* the two halves: one dark ground sits under whoever is to move and slides across at every tap */
.cc__clock { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 138px; padding: 4px; border-radius: 22px; background: rgba(23, 24, 27, 0.055); }
.cc__thumb { position: absolute; left: 4px; top: 4px; width: calc(50% - 4px); height: 130px; border-radius: 18px; background: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 20px -12px rgba(23, 24, 27, 0.7); pointer-events: none; transition: background-color 0.35s ease; }
.cc.is-flag .cc__thumb { background: var(--accent); }
.cc__side { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 3px; height: 130px; border-radius: 18px; color: var(--soft); transition: color 0.3s ease; }
.cc__side.is-on { color: rgba(255, 255, 255, 0.62); }
.cc__side:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.cc__name { font-size: 12px; line-height: 16px; font-weight: 680; }
.cc__time { display: block; height: 46px; white-space: nowrap; }
.cc__time b { display: block; font-size: 42px; line-height: 46px; font-weight: 680; font-stretch: 84%; letter-spacing: -0.02em; color: var(--ink); transition: color 0.3s ease; }
.cc__side.is-on .cc__time b { color: #ffffff; }
.cc__side.is-low:not(.is-on) .cc__time b { color: var(--accent); }
.cc__side.is-on.is-low .cc__time b { color: #ffb4a6; }
.cc.is-flag .cc__side.is-on .cc__time b { color: #ffffff; }
.cc__moves { max-width: 100%; padding: 0 8px; font-size: 11.500px; font-weight: 600; }
.cc__inc { position: absolute; left: 50%; top: 18px; height: 20px; margin-left: 30px; padding: 0 7px; border-radius: 10px; background: #1f9d6b; color: #ffffff; font-style: normal; font-size: 11.500px; line-height: 20px; font-weight: 740; opacity: 0; pointer-events: none; }

.cc__row { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.cc__hint { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--soft); }
.cc__btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(23, 24, 27, 0.06); transition: background-color 0.25s ease; }
.cc__btn svg { display: block; width: 16px; height: 16px; overflow: visible; }
.cc__ic-play { fill: var(--ink); }
.cc__ic-pause { fill: none; stroke: var(--ink); stroke-width: 2.400; stroke-linecap: round; opacity: 0; }
.cc__ic-line { fill: none; stroke: var(--ink); stroke-width: 1.700; stroke-linecap: round; stroke-linejoin: round; }
.cc.is-run .cc__ic-play { opacity: 0; }
.cc.is-run .cc__ic-pause { opacity: 1; }
.cc__btn:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
@media (hover: hover) { .cc__btn:hover { background: rgba(23, 24, 27, 0.11); } }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (max-width: 350px) { .cc { padding: 14px 12px; } .cc__time b { font-size: 38px; } .cc__inc { margin-left: 24px; } }
@media (max-height: 400px) { .cc { gap: 10px; } .cc__clock { height: 124px; } .cc__thumb, .cc__side { height: 116px; } }
@media (prefers-reduced-motion: reduce) { .cc__thumb, .cc__side, .cc__time b, .cc__btn { transition: none; } }
