:root {
  color-scheme: dark;
  --night: #081220;
  --ink: #f3f0eb;
  --muted: #aab7ca;
  --gold: #efc78b;
  --edge: clamp(20px, 4.3vw, 72px);
  --serif: Georgia, 'Times New Roman', serif;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--night);
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.scene {
  isolation: isolate;
  position: relative;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 69% 43%, #183044 0%, #0e1e32 43%, #081220 79%);
}
#map-region { position: absolute; inset: 0; cursor: grab; touch-action: none; }
#map-region.dragging { cursor: grabbing; }
#map-region:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
#sky-canvas { position: relative; display: block; width: 100%; height: 100%; }
#star-glints { position: absolute; inset: 0; pointer-events: none; }
.star-glint {
  position: absolute;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, #d7ebff 0%, #c1dcff85 27%, #c1dcff00 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .star-glint { animation: star-glint var(--glint-period) ease-in-out var(--glint-phase) infinite; }
}
@keyframes star-glint {
  0%, 64%, 100% { opacity: 0; }
  29% { opacity: .42; }
}
.compass-overlay { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.compass-overlay span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: #081220be;
  color: #e8d4ae;
  font-size: .8rem;
  font-weight: 650;
}
.compass-north, .compass-south { left: 50%; transform: translateX(-50%); }
.compass-north { top: max(3px, env(safe-area-inset-top)); }
.compass-south { bottom: max(5px, env(safe-area-inset-bottom)); }
.compass-east, .compass-west { top: 50%; transform: translateY(-50%); }
.compass-east { right: max(2px, calc(var(--edge) * .5 - .72rem), env(safe-area-inset-right)); }
.compass-west { left: max(2px, calc(var(--edge) * .5 - .72rem), env(safe-area-inset-left)); }
.scene::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, #07111ee8, transparent 38%), linear-gradient(90deg, #0812209e, transparent 44%);
}
.glass {
  background: #0a1626df;
  border: 1px solid #b7cad831;
  box-shadow: 0 14px 46px #02071143;
  backdrop-filter: blur(12px);
}
.topbar {
  position: absolute;
  z-index: 3;
  inset: 29px var(--edge) auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.logo-link { justify-self: start; }
.logo { width: clamp(185px, 22vw, 288px); height: auto; display: block; }
.navigation { display: flex; padding: 4px; gap: 3px; border-radius: 99px; }
.navigation button, .map-tools button, .dialog-close button {
  border: 0;
  background: transparent;
  padding: .65rem .95rem;
  border-radius: 99px;
}
.navigation button { font-size: .875rem; white-space: nowrap; color: #cbd6e3; }
.navigation button:hover, .navigation .active, .map-tools button:hover { color: var(--gold); background: #e4bb7d15; }
.preview-status { justify-self: end; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 3px 0; border: 0; background: none; color: #d8dfe8; font-size: .84rem; text-align: right; }
.preview-status:hover, .spark { color: var(--gold); }
.intro { position: absolute; z-index: 2; top: clamp(140px, 21.5vh, 250px); left: var(--edge); pointer-events: none; }
.eyebrow { color: var(--gold); margin: 0 0 .7rem; text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600; }
h1, h2 { font-family: var(--serif); font-weight: normal; }
h1 { font-size: clamp(3.15rem, 6.05vw, 7rem); line-height: .98; margin: 0; letter-spacing: -.055em; text-shadow: 0 3px 25px #07111e; }
.tagline { margin: 1rem 0 0; font-size: clamp(1rem, 1.5vw, 1.25rem); color: #c9d2df; }
.sky-status { margin: .62rem 0 0; color: #d5dfec; font-size: .875rem; }
.sky-status span { color: var(--gold); padding: 0 .2em; }
.sky-status time { font-variant-numeric: tabular-nums; }
.advent-started .intro { top: clamp(105px, 16vh, 145px); }
.advent-started #title { font-size: clamp(1.7rem, 3.3vw, 3.25rem); }
.advent-started .intro .eyebrow, .advent-started .tagline { display: none; }
.meteor {
  --meteor-angle: -27deg;
  position: absolute;
  z-index: 1;
  top: 20%;
  right: 13%;
  width: clamp(46px, 9vw, 140px);
  height: 1px;
  opacity: 0;
  background: linear-gradient(90deg, #ffe6b800 1%, #e8d8bd74 82%, #fff0d8);
  box-shadow: 0 0 7px #ffe3ab30;
  pointer-events: none;
}
.meteor::after { content: ''; position: absolute; right: 0; top: -1px; width: 3px; height: 3px; border-radius: 50%; background: #fff0d8; box-shadow: 0 0 9px 2px #f8d9a56e; }

@media (prefers-reduced-motion: no-preference) {
  .meteor { animation: meteor-flight 48s linear 9s infinite; }
}

@keyframes meteor-flight {
  /* Der Flug dauert rund eine Sekunde. Danach bleibt der Himmel ruhig. */
  0% {
    opacity: 0;
    transform: rotate(var(--meteor-angle)) translateX(clamp(-155px, -14vw, -42px));
  }
  .55% { opacity: .85; }
  1.55% { opacity: .68; }
  2.3%, 100% {
    opacity: 0;
    transform: rotate(var(--meteor-angle)) translateX(clamp(14px, 4vw, 48px));
  }
}
.portrait {
  position: absolute;
  z-index: 2;
  right: var(--edge);
  bottom: 56px;
  width: min(340px, 31vw);
  padding: 23px 25px 21px;
  border-radius: 16px;
}
.portrait .eyebrow { margin-bottom: 8px; }
.portrait h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -.035em; }
.latin { color: var(--muted); font: italic 1rem var(--serif); margin: .45rem 0 .6rem; }
.portrait-copy { font-size: 1rem; line-height: 1.5; color: #dce2ea; margin: .85rem 0; }
.portrait-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .75rem; color: var(--muted); font-size: .83rem; }
.portrait-meta strong { color: var(--gold); font-weight: 600; }
.figure-visibility { color: var(--muted); margin: .45rem 0 0; font-size: .83rem; }
.portrait-actions { display: flex; justify-content: space-between; gap: 12px; margin: 1rem 0 0; border-top: 1px solid #b7cad831; }
.portrait-action {
  border: 0;
  padding: .65rem 0 0;
  background: none;
  text-align: left;
  font-size: .875rem;
  color: var(--gold);
}
.portrait-action:not(:disabled):hover { text-decoration: underline; }
.portrait-action:disabled { color: var(--muted); opacity: .7; cursor: default; }
.search-active .intro, .search-active .portrait,
.search-active #preview-open, .search-active #show-days { display: none; }
.search-panel {
  position: absolute;
  left: var(--edge);
  bottom: 55px;
  z-index: 3;
  width: min(380px, calc(100% - 2 * var(--edge)));
  padding: 15px 18px;
  border-radius: 14px;
}
.search-progress { color: var(--gold); font-size: .875rem; }
.search-panel h2 { margin: .32rem 0 0; font-size: clamp(1.55rem, 3vw, 2rem); }
.search-panel p { margin: .45rem 0 .7rem; color: #d5dfec; font-size: .875rem; line-height: 1.45; }
.search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.search-panel .search-actions button { min-height: 34px; padding-block: .3rem; font-size: .875rem; }
.search-targets { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.search-target {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid #ebcb95b5;
  border-radius: 50%;
  background: #162b43f0;
  color: #fff0d5;
  font-size: .875rem;
  font-weight: 650;
  pointer-events: auto;
  box-shadow: 0 2px 8px #050a13a0;
}
.search-target:not(:disabled):hover { background: var(--gold); color: var(--night); }
.search-target:disabled { cursor: default; pointer-events: none; }
.search-target.search-correct { background: #6c4d22; border-color: var(--gold); }
.search-target.search-wrong { background: #572b39; border-color: #eeabb2; }
.map-tools { position: absolute; z-index: 2; right: var(--edge); bottom: 11px; display: flex; border-radius: 99px; }
.map-tools button { padding: 5px 13px; font-size: 1rem; }
.map-caption { position: absolute; z-index: 2; bottom: 14px; left: var(--edge); display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8125rem; pointer-events: none; }
.map-caption button { pointer-events: auto; min-height: 32px; padding: 4px 0; border: 0; background: none; }
.map-caption button:hover { color: var(--gold); }
dialog { width: min(565px, calc(100% - 32px)); max-height: calc(100svh - 24px); color: var(--ink); background: #0e1d30; border: 1px solid #b7cad854; border-radius: 16px; padding: clamp(20px, 4vw, 34px); }
dialog::backdrop { background: #040d19c6; backdrop-filter: blur(5px); }
dialog h2 { font-size: clamp(1.7rem, 5vw, 2.5rem); margin: 0; padding-right: 1.8rem; }
dialog h3 { font-size: 1.1rem; margin: 1.15rem 0 .3rem; }
dialog p, dialog label { color: #c9d2df; line-height: 1.55; }
dialog p.eyebrow { color: var(--gold); }
dialog a { color: var(--gold); text-underline-offset: .2em; }
#share-url { width: 100%; border: 1px solid #b7cad854; border-radius: 7px; background: #142841; color: var(--ink); padding: .65rem .8rem; font: inherit; }
.dialog-close { position: absolute; top: 7px; right: 8px; }
.dialog-close button { font-size: 1.35rem; }
.dialog-days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.dialog-days button { border: 1px solid #b7cad832; background: #d5e4ff09; border-radius: 4px; min-height: 42px; font-size: .84rem; padding: 0; }
.dialog-days button:not(:disabled):hover { border-color: var(--gold); }
.dialog-days button:disabled { color: #8c9aaf; cursor: default; opacity: .75; }
.dialog-days button[aria-current='date'] { color: #192638; background: var(--gold); border-color: var(--gold); font-weight: 650; }
.preview-section { margin-top: 18px; padding: 16px; border: 1px solid #b7cad831; border-radius: 9px; }
.preview-section p { margin: .5rem 0 0; font-size: .875rem; }
#preview-day { display: block; accent-color: var(--gold); width: 100%; margin: 12px 0; }
.dialog-actions, .result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.primary-button, .quiet-button, .answer-button {
  min-height: 42px;
  border: 1px solid #b7cad854;
  border-radius: 7px;
  background: #142841;
  padding: .55rem .85rem;
}
.primary-button { color: #1b2330; background: var(--gold); border-color: var(--gold); }
.primary-button:disabled { opacity: .55; cursor: default; }
.primary-button:not(:disabled):hover { background: #ffdb9f; }
.quiet-button:hover, .answer-button:not(:disabled):hover { border-color: var(--gold); }
.text-button { border: 0; padding: .4rem 0; background: none; color: var(--gold); }
.text-button:hover { text-decoration: underline; }
.dialog-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.close-button { border: 0; background: none; font-size: 1.5rem; padding: 0 5px; }
fieldset { margin: 1rem 0; padding: 0; border: 0; }
legend { color: var(--gold); font-size: .875rem; margin-bottom: .45rem; }
dialog input { accent-color: var(--gold); }
.radio-card { display: flex; align-items: center; gap: 10px; padding: .65rem; border: 1px solid #b7cad835; border-radius: 7px; margin: .4rem 0; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--gold); }
.radio-card small { display: block; }
.privacy-note, .muted { color: var(--muted); font-size: .875rem; }
.quiz-progress { display: flex; justify-content: space-between; gap: 12px; color: var(--gold); margin-bottom: .65rem; }
.quiz-figure-svg, .detail-art { width: 100%; height: auto; display: block; margin: .85rem 0; border-radius: 8px; background: #142841; }
.quiz-figure-svg, .detail-art { max-height: 42svh; }
.quiz-figure-svg path, .detail-art path { stroke: #d6b680; stroke-width: 1.25; fill: none; }
.quiz-figure-svg circle, .detail-art circle { fill: #f4e8d2; }
.detail-art circle.featured-star-ring { fill: none; stroke: var(--gold); stroke-width: .9; }
.quiz-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.answer-button { text-align: left; }
.answer-button:disabled { cursor: default; }
.answer-button.correct { background: #214236; border-color: #9fdbb2; }
.answer-button.incorrect { background: #4a2d34; border-color: #eeabb2; }
.quiz-feedback { margin: .7rem 0; line-height: 1.5; }
.quiz-feedback:empty, #reset-status:empty { display: none; }
.result-star { font-size: 2rem; color: var(--gold); }
.source-list { padding-left: 1.3rem; line-height: 1.55; }
.source-list li + li { margin-top: .5rem; }
.toast:empty { display: none; }
.toast { display: none; position: fixed; z-index: 5; bottom: 55px; right: var(--edge); max-width: min(320px, 85vw); color: #182130; background: #efd195; padding: .7rem .9rem; border-radius: 6px; }
.toast.visible { display: block; }
.noscript { position: absolute; z-index: 5; left: var(--edge); bottom: 15px; background: var(--night); padding: 10px; }
@media (max-width: 860px) {
  .portrait { width: 275px; padding: 17px 19px; }
  .topbar { gap: 12px; }
  .preview-status { font-size: .75rem; }
}
@media (max-width: 640px) {
  .topbar { top: 16px; grid-template-columns: 1fr auto; gap: 9px 0; }
  .logo { width: min(185px, 47vw); }
  .navigation { grid-area: 2 / 1 / 3 / -1; justify-self: center; }
  .navigation button { padding: .47rem .77rem; }
  .intro { top: 129px; }
  .advent-started .intro { top: 117px; }
  h1 { font-size: clamp(2.6rem, 10vw, 4.3rem); }
  .tagline { margin-top: .65rem; }
  .meteor { top: 31%; right: 12%; }
  .portrait { bottom: 47px; width: auto; left: var(--edge); right: var(--edge); padding: 13px 15px; }
  .search-panel { bottom: 46px; padding: 12px 14px; }
  .search-target { width: 32px; height: 32px; }
  .portrait h2 { font-size: 1.65rem; }
  .portrait .eyebrow { margin: 0 0 .3rem; font-size: .7rem; }
  .portrait .latin, .portrait-copy { display: none; }
  .portrait-meta { margin-top: .38rem; }
  .portrait-actions { margin-top: .5rem; }
  .portrait-action { padding-top: .45rem; }
  .dialog-days { gap: 3px; }
  .dialog-days button { min-height: 24px; font-size: .75rem; }
  .map-tools { bottom: 5px; }
  .map-caption { bottom: 8px; font-size: .8rem; }
  .map-instructions { display: none; }
}
@media (max-width: 360px) {
  .preview-status { font-size: .72rem; }
}
@media (max-height: 510px) and (min-width: 641px) {
  .intro { top: 99px; }
  h1 { font-size: clamp(2.35rem, 5vw, 4rem); }
  .portrait-copy, .portrait .latin { display: none; }
}
