:root {
  --yellow: #145a32;
  --red: #d01012;
  --blue: #006db7;
  --bg: #f4f1ea;
  --surface: #ffffff;
  --text: #1b1b1b;
  --muted: #6b675f;
  --line: #d9d4c7;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --surface: #222222;
    --text: #f2efe8;
    --muted: #a39f95;
    --line: #3a3a3a;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  display: flex;
  flex-direction: column;
  height: 85dvh;
  max-width: 1200px;
  margin: 0 auto;
}

.header-title{
  padding-left: 20%;
}


.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--yellow);
  color: #1b1b1b;
  border-bottom: 4px solid var(--red);
}

.brand { display: flex; align-items: center; gap: 6px; }
.brand strong { margin-left: 6px; font-size: 1.05rem; }

.stud {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.progress { 
  font-size: 0.85rem; 
  font-weight: 600; 
  text-align: right;
  padding-right:20%}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  touch-action: pan-y;
}

.viewer {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  user-select: none;
}

.card, .message {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--blue);
  border-radius: var(--radius);
  text-align: center;
}

.message { margin-top: 20vh; }
.card h1, .message h1 { margin: 0 0 8px; font-size: 1.4rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.label { font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.2; }
.label small { display: block; font-weight: 600; font-size: 0.8rem; color: var(--muted); }

.nav {
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav:first-child { justify-self: start; }
.nav:last-child { justify-self: end; }
.nav:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

.hint { margin: 0; padding: 0 16px 8px; text-align: center; font-size: 0.9rem; color: var(--muted); }

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 4px 16px 14px;
  list-style: none;
}

.dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
}
.dot.on { background: var(--yellow); border-color: var(--yellow); color: #bdbdbd; cursor: pointer; }
.dot.current { background: var(--blue); border-color: var(--blue); color: #fff; }
.dot.off { cursor: not-allowed; opacity: 0.55; }

button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

@media (max-width: 520px) {
  .progress { font-size: 0.75rem; }
  .nav { padding: 12px 12px; }
}

.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.4rem;
    position: fixed;
    top: -10%;
    animation: fall linear infinite;
}

.snowflake:nth-child(1) { left: 3%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 7%; animation-duration: 13s; animation-delay: 2s; font-size: 1.8rem; }
.snowflake:nth-child(3) { left: 15%; animation-duration: 9s;  animation-delay: 4s; }
.snowflake:nth-child(4) { left: 82%; animation-duration: 14s; animation-delay: 1s; font-size: 1.6rem; }
.snowflake:nth-child(5) { left: 87%; animation-duration: 11s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 95%; animation-duration: 12s; animation-delay: 5s; }

@keyframes fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

/* hidden-Attribut muss auch bei Elementen mit eigenem display (flex/grid) gelten */
[hidden] { display: none !important; }

/* ---------- Weihnachtsfinale ---------- */
.finale {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(120, 20, 30, 0.55), rgba(8, 14, 36, 0.92) 70%),
    rgba(8, 14, 36, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.finale.open { opacity: 1; }

.finale-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.finale-box {
  position: relative;
  max-width: 420px;
  padding: 26px 28px 22px;
  text-align: center;
  color: #fff4d6;
  background: rgba(10, 16, 40, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.55);
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.22), inset 0 0 24px rgba(255, 215, 0, 0.08);
}

.finale-box h2 {
  margin: 4px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  color: #ffe27a;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.55);
}

.finale-star {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
  animation: finale-twinkle 1.8s ease-in-out infinite;
}

.finale-sub { margin: 0 0 16px; font-size: 0.95rem; color: #f3e6c4; }

.finale-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.finale .btn { background: #d01012; color: #fff; }
.finale .btn.ghost { background: transparent; color: #ffe27a; box-shadow: inset 0 0 0 2px #ffe27a; }
.finale .btn.attention { animation: finale-pulse 1.4s ease-in-out infinite; }

@keyframes finale-twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.9) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
@keyframes finale-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px #ffe27a, 0 0 0 0 rgba(255, 226, 122, 0.55); }
  50% { box-shadow: inset 0 0 0 2px #ffe27a, 0 0 0 8px rgba(255, 226, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .finale { transition: none; }
  .finale-star, .finale .btn.attention { animation: none; }
}