:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.12);
  --warn: #d9770b;
  --good: #128a5e;
  --tone: var(--ink);
}

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

.ex { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(336px, 100%); padding: 16px 18px 18px; border-radius: 24px; background: color-mix(in srgb, var(--tone) 4%, #ffffff); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--tone) 26%, transparent), 0 28px 44px -30px color-mix(in srgb, var(--tone) 55%, transparent); transition: background-color 0.45s, box-shadow 0.45s; }
.ex[data-state="warn"] { --tone: var(--warn); }
.ex[data-state="done"] { --tone: var(--good); }

.ex__head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; height: 24px; }
.ex__course { font-size: 12.500px; font-weight: 640; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex__badge { position: absolute; right: -4px; top: 0; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px 0 7px; border-radius: 12px; background: var(--warn); color: #ffffff; font-size: 11.500px; font-weight: 720; white-space: nowrap; opacity: 0; visibility: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 14px -8px var(--warn); }
.ex__badge svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }

.ex__clock { display: flex; justify-content: flex-start; align-items: center; height: 60px; margin-top: 4px; font-size: 58px; line-height: 60px; font-weight: 760; font-stretch: 88%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--tone); transition: color 0.45s; transform-origin: 0 60%; }
.ex__d { display: block; width: 0.620em; height: 60px; overflow: hidden; text-align: center; }
.ex__d span { display: block; }
.ex__colon { display: block; width: 0.300em; text-align: center; transform: translateY(-0.060em); opacity: 0.55; }
.ex__sub { height: 18px; overflow: hidden; margin-top: 2px; font-size: 13px; line-height: 18px; font-weight: 620; color: var(--soft); white-space: nowrap; }
.ex__sub span { display: block; }

.ex__qs { display: flex; align-items: center; gap: 3px; height: 14px; margin-top: 14px; }
.ex__qs i { display: block; flex: 1 1 0; height: 6px; border-radius: 3px; background: rgba(23, 23, 26, 0.13); transition: background-color 0.3s; }
.ex__qs i.is-done { background: var(--ink); }
.ex__qs i.is-now { background: color-mix(in srgb, var(--tone) 48%, #ffffff); }
.ex__qs i.is-flag { background: var(--warn); }
.ex[data-state="done"] .ex__qs i.is-done:not(.is-flag) { background: var(--good); }

.ex__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; height: 16px; margin-top: 8px; font-size: 12px; line-height: 16px; font-weight: 620; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ex__count { display: block; height: 16px; overflow: hidden; }
.ex__count span { display: block; }
.ex__flags { display: inline-flex; align-items: center; gap: 4px; height: 16px; overflow: hidden; }
.ex__flags svg, .ex__flag svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }
.ex__flags svg { color: var(--warn); }
.ex__flags span { display: block; }

.ex__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 16px; }
.ex__main { position: relative; height: 46px; border-radius: 23px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 18px -12px rgba(23, 23, 26, 0.7); transition: background-color 0.4s; }
.ex[data-state="done"] .ex__main { background: var(--good); }
.ex__main:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.ex__face { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; white-space: nowrap; opacity: 0; }
.ex__face[data-face="next"] { opacity: 1; }
.ex__face svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.200; stroke-linecap: round; stroke-linejoin: round; }
.ex__face [data-tick] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ex__flag { display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 15px; border-radius: 23px; font-size: 13.500px; font-weight: 680; color: var(--ink); box-shadow: inset 0 0 0 1.500px var(--line); transition: background-color 0.25s, color 0.25s, box-shadow 0.25s; }
.ex__flag[aria-pressed="true"] { background: color-mix(in srgb, var(--warn) 12%, #ffffff); color: color-mix(in srgb, var(--warn) 78%, #17171a); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--warn) 55%, transparent); }
.ex__flag[aria-pressed="true"] svg path { fill: currentColor; fill-opacity: 0.25; }
.ex__flag:disabled { opacity: 0.4; cursor: default; }
.ex__flag:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
@media (hover: hover) { .ex__flag:not(:disabled):hover { background: rgba(23, 23, 26, 0.05); } .ex__flag[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--warn) 18%, #ffffff); } }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.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-height: 330px) { .ex__clock { height: 48px; font-size: 46px; line-height: 48px; } .ex__d { height: 48px; } .ex__qs { margin-top: 8px; } .ex__actions { margin-top: 10px; } }
@media (prefers-reduced-motion: reduce) { .ex, .ex__clock, .ex__qs i, .ex__main, .ex__flag { transition: none; } }
