:root {
  color-scheme: dark;
  --lights-ivory: #fff1d2;
  --lights-gold: #ffd883;
  --lights-muted: #e4d4b5;
}
body {
  color: var(--lights-ivory);
  background: #071d17;
  font-family: var(--garland-body);
}
.lights {
  width: min(100%, 1120px);
  margin: auto;
  padding: clamp(16px, 4vw, 32px);
}
.lights [hidden] { display: none; }
.lights :is(a, button, input, summary):focus-visible {
  outline: 3px solid #ffc946;
  outline-offset: 3px;
}
.lights-header {
  padding: 4px 0 20px;
}
.lights-brand, .lights-back, .lights-link { color: var(--lights-ivory); }
.lights-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}
.lights-brand::before {
  content: "";
  width: 25px;
  height: 23px;
  background: currentColor;
  mask: url("./winter-puppy.webp") 49% top / 36px auto no-repeat;
}
.lights-back {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  font-size: .9rem;
  text-underline-offset: 3px;
}
.lights h1, .lights h2 {
  font-family: var(--garland-display);
  line-height: 1.06;
}
.lights h1 {
  margin: 4px 0 9px;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
}
.lights-header p { color: var(--lights-muted); }
.lights .lights-totals {
  margin-top: 15px;
  color: var(--lights-gold);
  font-weight: 700;
}
.lights-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #587467;
  border-radius: 12px;
  margin: 0 0 12px;
  max-width: 470px;
}
.lights-scope button {
  min-height: 46px;
  padding: 5px;
  color: var(--lights-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
}
.lights-scope button[aria-pressed="true"] {
  color: var(--lights-ivory);
  border-color: #bda06b;
  background: linear-gradient(145deg, #395c43, #183328);
}
.lights-map {
  position: relative;
  isolation: isolate;
  height: clamp(275px, 43vw, 465px);
  overflow: hidden;
  touch-action: none;
  border-radius: clamp(12px, 2.5vw, 24px);
  border: 1px solid #7d7651;
  background: #102b24;
  cursor: grab;
}
.lights-map.is-dragging { cursor: grabbing; }
.lights-map canvas, .lights-markers { position: absolute; inset: 0; width: 100%; height: 100%; }
.lights-markers { pointer-events: none; }
.lights-point {
  pointer-events: auto;
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  color: #221506;
  background: transparent;
  cursor: pointer;
}
.lights-point::before {
  content: "";
  position: absolute;
  inset: calc(50% - var(--glow));
  border-radius: 50%;
  background: radial-gradient(circle, #fff4bd 0 9%, #ffcc69 20%, #eda83b88 37%, #eaaa4600 73%);
}
.lights-point.is-selected { z-index: 1; }
.lights-point.is-selected::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid #fff3a7;
  box-shadow: 0 0 10px #ffc54d;
}
.lights-point.is-spark::after { animation: lights-spark 1s ease-out both; }
@keyframes lights-spark {
  from { transform: scale(2.2); opacity: .3; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .lights-point.is-spark::after { animation: none; } }
.lights-point-count {
  position: absolute;
  inset: 13px;
  height: 18px;
  min-width: max-content;
  justify-self: center;
  padding: 0 4px;
  border-radius: 50px;
  background: #ffdd88;
  font-size: .75rem;
  font-weight: 700;
}
.lights-point-name { display: none; }
.lights-point.is-selected .lights-point-name {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 180px;
  min-width: max-content;
  padding: 3px 8px;
  border: 1px solid #d5ab62;
  border-radius: 6px;
  background: #102b21;
  color: var(--lights-ivory);
  font-size: .85rem;
  font-weight: 700;
}
.lights-controls { position: absolute; right: 9px; bottom: 9px; display: flex; gap: 5px; }
.lights-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid #cfb47a;
  border-radius: 50%;
  color: var(--lights-ivory);
  background: #0c2b22ee;
  font-size: 1.45rem;
  cursor: pointer;
}
.lights-under {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1px 14px;
  margin: 10px 0;
  color: var(--lights-muted);
}
.lights-link {
  min-height: 42px;
  border: 0;
  background: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lights-share {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #cfb47a;
  border-radius: 50%;
  color: var(--lights-ivory);
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
}
.lights-status:empty { display: none; }
.lights-paper {
  border-radius: 16px;
  background: radial-gradient(ellipse at top left, #fff1d2, #eed2a2);
  color: #282116;
  border: 1px solid #c89762;
  padding: clamp(14px, 4vw, 29px);
  margin: 14px 0;
  box-shadow: 0 14px 28px #02110b76;
}
.lights-paper h2 { font-size: clamp(1.7rem, 4vw, 2.55rem); margin-bottom: 5px; }
.lights-paper a, .lights-paper button { color: #503119; }
.lights-paper ul { list-style: none; margin: 10px 0; }
.lights-paper li { border-top: 1px solid #94704665; }
.lights-paper li :is(a, button) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: none;
  text-align: left;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lights-paper li a { text-decoration: none; }
.lights-paper li a strong { text-decoration: underline; }
.lights-read-more {
  display: block;
  margin-top: 5px;
}
.lights-paper li p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}
.lights-paper input { width: min(100%, 380px); padding: 10px; margin: 8px 0; }
.lights-credits {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  color: var(--lights-muted);
}
.lights-credits summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  list-style: none;
  cursor: pointer;
}
.lights-credits summary::-webkit-details-marker { display: none; }
.lights-credits div {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: max-content;
  max-width: min(250px, 70vw);
  padding: 8px 10px;
  border: 1px solid #7d7651;
  border-radius: 8px;
  background: #102b21;
  font-size: .75rem;
}
.lights-credits a { color: inherit; }
.lights-story-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

#lights-share-status input {
  display: block;
  width: min(100%, 520px);
  min-height: 44px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #a49162;
  border-radius: 8px;
  background: #193628;
  color: var(--lights-ivory);
  font: inherit;
}
