:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #101a2b;
  color: #f9f1de;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #243b55, transparent 62%), #101a2b;
}
main { position: relative; width: min(100% - 2rem, 48rem); margin: auto; padding: clamp(3.5rem, 7vw, 4rem) 0 2rem; }
header { text-align: center; }
.info-icon, .info-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #718398;
  border-radius: 50%;
  background: #17263a;
  color: #f9f1de;
  cursor: pointer;
}
.info-icon {
  position: absolute;
  top: .75rem;
  right: 0;
  font: bold 1.35rem Georgia, serif;
}
.info-close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  font: 1.65rem/1 system-ui, sans-serif;
}
.info-icon:hover, .info-close:hover { background: #2b405a; }
.info-icon:focus-visible, .info-close:focus-visible { outline: 2px solid #ffd465; outline-offset: 3px; }
#info-dialog {
  width: min(100% - 2rem, 30rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid #60748a;
  border-radius: 1.25rem;
  background: #17263a;
  color: #f9f1de;
  box-shadow: 0 1rem 3rem #050910a8;
}
#info-dialog::backdrop { background: #080e19b8; }
#info-title {
  margin: 0;
  padding-right: 2.5rem;
  font: 400 1.8rem/1.2 Georgia, serif;
}
#info-dialog p { margin: .9rem 0 0; line-height: 1.55; color: #dce4ed; }
#info-dialog strong { color: #ffd465; }
h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.65rem, 8vw, 5rem);
  line-height: 1.1;
  letter-spacing: -.045em;
}
#connection {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  margin: 1.35rem 0 0;
  color: #c6d3e0;
}
#connection span:first-child {
  width: .65rem; height: .65rem; border-radius: 50%; background: #e7a26d;
}
#connection[data-online="true"] span:first-child { background: #83e3ad; }
.comet {
  isolation: isolate;
  display: grid;
  place-items: center;
  position: relative;
  width: min(100%, 41rem);
  margin: clamp(1.4rem, 4vw, 2.75rem) auto;
}
.comet img { grid-area: 1 / 1; display: block; width: 100%; height: auto; }
/* Exclude stray rays from the second comet at the bottom of the source crop. */
.comet-off {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 36% 100%, 36% 89%, 29.5% 89%, 29.5% 91%, 0 91%);
}
#lit {
  opacity: 0;
  transition: opacity .18s ease;
  filter: drop-shadow(0 0 1.15rem #ffb94970);
}
.comet[data-on="true"] #lit { opacity: 1; }
.comet[data-on="true"] img:first-child { visibility: hidden; }
.controls {
  width: min(100%, 34rem);
  margin: auto;
  padding: clamp(1.1rem, 4vw, 1.8rem);
  border: 1px solid #45556a;
  border-radius: 1.5rem;
  background: #111c2e;
  text-align: center;
  box-shadow: 0 1rem 3rem #070e1b65;
}
.timer p { color: #ced7e3; margin: 0 0 .8rem; }
.clock {
  display: grid;
  place-items: center;
  width: max-content;
  margin: auto;
  border: 1px solid #4d4d4a;
  border-radius: .7rem;
  padding: .75rem 1rem;
  background: #090f1a;
  color: #ffd465;
  font: 2.5rem ui-monospace, monospace;
}
#digits { display: flex; align-items: center; gap: .34rem; }
.digit { position: relative; width: 1.75rem; height: 3rem; }
.seg {
  position: absolute;
  background: currentColor;
  opacity: .11;
  clip-path: polygon(12% 0, 88% 0, 100% 50%, 88% 100%, 12% 100%, 0 50%);
}
.seg.active { opacity: 1; }
.seg:nth-child(1), .seg:nth-child(4), .seg:nth-child(7) { left: .24rem; width: 1.27rem; height: .25rem; }
.seg:nth-child(1) { top: 0; }
.seg:nth-child(7) { top: 1.375rem; }
.seg:nth-child(4) { bottom: 0; }
.seg:nth-child(2), .seg:nth-child(3), .seg:nth-child(5), .seg:nth-child(6) {
  width: .25rem; height: 1.19rem;
  clip-path: polygon(50% 0, 100% 12%, 100% 88%, 50% 100%, 0 88%, 0 12%);
}
.seg:nth-child(2), .seg:nth-child(3) { right: 0; }
.seg:nth-child(5), .seg:nth-child(6) { left: 0; }
.seg:nth-child(2), .seg:nth-child(6) { top: .2rem; }
.seg:nth-child(3), .seg:nth-child(5) { bottom: .2rem; }
.colon { display: grid; gap: .55rem; margin: 0 .18rem; }
.colon::before, .colon::after { content: ""; width: .25rem; height: .25rem; background: currentColor; }
.action { position: relative; }
#click-flash {
  position: absolute;
  z-index: 1;
  top: .35rem;
  right: max(0rem, calc(50% - 8.5rem));
  display: grid;
  place-items: center;
  width: 5.3rem;
  height: 3.2rem;
  padding-bottom: .12rem;
  background: #ffd465;
  color: #501720;
  clip-path: polygon(0% 51%, 17% 37%, 9% 13%, 34% 20%, 46% 0%, 57% 16%, 80% 6%, 78% 25%, 100% 36%, 87% 51%, 99% 70%, 78% 72%, 83% 95%, 60% 86%, 46% 100%, 37% 81%, 13% 92%, 21% 69%);
  transform: rotate(-12deg);
  font: italic 900 1.1rem system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
}
#activate {
  --button-size: clamp(8.7rem, 38vw, 10.5rem);
  position: relative;
  display: inline-grid;
  place-items: center;
  inline-size: var(--button-size);
  block-size: var(--button-size);
  margin: 1.4rem auto .6rem;
  padding: 1.8rem 1.25rem 1.3rem;
  border: .25rem solid #36131e;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 22%, #fa6370 0%, #e83849 31%,
    #c21a35 65%, #97162d 100%);
  color: #fff;
  font: 800 1.05rem/1.18 system-ui, sans-serif;
  text-shadow: 0 1px 2px #5a101c;
  text-wrap: balance;
  box-shadow: inset 0 0 0 2px #ff96917d, inset 0 -8px 12px #7c122b77,
    0 7px 0 2px #6b1830, 0 10px 0 3px #090f1a, 2px 14px 15px #070e1baa;
  cursor: pointer;
  user-select: none;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 90ms ease-out;
}
#activate::before {
  content: "";
  position: absolute;
  top: 12%;
  left: 15%;
  width: 31%;
  height: 15%;
  border-top: .25rem solid #ffd4c2;
  border-radius: 50%;
  transform: rotate(-33deg);
  opacity: .83;
  pointer-events: none;
}
#activate:not(:disabled):hover { filter: brightness(1.1); }
#activate:not(:disabled):active {
  transform: translateY(6px);
  box-shadow: inset 0 2px 8px #7c122baa, inset 0 0 0 2px #ff969166,
    0 1px 0 2px #6b1830, 0 4px 0 3px #090f1a, 1px 6px 7px #070e1baa;
  filter: brightness(.87);
}
#activate:focus-visible { outline: 3px solid #ffd465; outline-offset: 6px; }
#activate:disabled {
  filter: saturate(.48) brightness(.83);
  cursor: not-allowed;
}
#message { margin: .55rem 0 .7rem; min-height: 1.4em; color: #ccd5e0; font-size: .9rem; }
.slots { display: flex; justify-content: center; align-items: center; gap: .75rem; color: #c6d3e0; }
.slots span { white-space: nowrap; }
.slots strong { color: #f9f1de; font-variant-numeric: tabular-nums; }
#capacity {
  width: clamp(2.8rem, 24vw, 10rem);
  height: .7rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #394556;
}
#capacity span {
  display: block;
  height: 100%;
  background: linear-gradient(to right,
    #57d68b 12%, #ffd465 50%, #f16a71 88%);
  clip-path: inset(0 var(--unfilled, 100%) 0 0 round 1rem);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  #lit, #activate { transition: none; }
  #activate:not(:disabled):active { transform: none; }
}
