*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background: transparent;
  color: #fff;
  font-family: "First Coffee", "Segoe UI", system-ui, sans-serif;
}

body.preview {
  background: radial-gradient(circle at 50% 30%, #1a1030 0%, #080810 70%);
}

#overlay {
  position: relative;
  display: grid;
  place-items: center;
  width: min(90vw, 520px);
  aspect-ratio: 1;
  opacity: 0;
  cursor: pointer;
  will-change: transform, opacity;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 6;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-progress {
  stroke: #7cf5ff;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 10px rgba(124, 245, 255, 0.65));
}

.content {
  position: relative;
  z-index: 1;
  text-align: center;
}

#label {
  font-size: 24px;
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.75rem;
}

#countdown {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15em;
  font-size: clamp(2.8rem, 12vw, 4.5rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow:
    0 0 20px rgba(124, 245, 255, 0.45),
    0 0 40px rgba(124, 245, 255, 0.2);
}

.segment {
  display: inline-block;
  min-width: 1.15em;
  will-change: transform, opacity;
}

.sep {
  opacity: 0.45;
  will-change: opacity;
}

.hours-sep,
.hours {
  display: inline-block;
  max-width: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  vertical-align: baseline;
  pointer-events: none;
}

body.show-hours .hours {
  max-width: 1.4em;
  min-width: 1.15em;
}

body.show-hours .hours-sep {
  max-width: 0.6em;
}

body.show-hours .hours,
body.show-hours .hours-sep {
  pointer-events: auto;
}

#label,
#sublabel,
#status {
  will-change: transform, opacity;
}

#status {
  min-height: 1.2em;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
}

/* AFK count-up */

body.afk.preview {
  background: radial-gradient(circle at 50% 30%, #201508 0%, #080810 70%);
}

body.afk .ring-progress {
  stroke: #ffb347;
  filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.65));
}

body.afk #countdown {
  text-shadow:
    0 0 20px rgba(255, 179, 71, 0.45),
    0 0 40px rgba(255, 179, 71, 0.2);
}

body.afk #sublabel {
  font-size: 18px;
  letter-spacing: 0.28em;
  color: rgba(255, 179, 71, 0.5);
  margin-bottom: 0.45rem;
}

body.afk.long-afk #label {
  color: rgba(255, 140, 90, 0.75);
}
