@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url(/fonts/CormorantGaramond-normal-300.woff2) format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url(/fonts/CormorantGaramond-italic-300.woff2) format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url(/fonts/Jost-normal-300.woff2) format('woff2');
}

:root {
  --green: #0c241b;
  --green-2: #14342a;
  --green-3: #1e4637;
  --brass: #a3864c;
  --brass-l: #c9ad74;
  --brass-d: #7d6534;
  --ivory: #f6f2ea;
  --paper: #fbf9f4;
  --line: #e3ddd0;
  --muted: #77736a;
  --ink: #1b1b18;
  --red: #8f2d2d;
  --display: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #050f1a;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

#stage {
  position: relative;
  height: 100dvh;
  margin: 0 auto;
  width: fit-content;
  max-width: 100vw;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  touch-action: none;
}

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: #fff;
  text-shadow: 0 1px 6px rgba(5, 15, 26, 0.8);
}

.hud-label {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hud-score {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.hud-mult {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 10px;
  border: 1px solid var(--brass-l);
  border-radius: 999px;
  color: var(--brass-l);
  font-size: 15px;
  background: rgba(12, 36, 27, 0.7);
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  /* Platz fuer den Ton-Knopf rechts oben */
  padding-right: 48px;
}

.hud-lives { display: flex; gap: 5px; font-size: 22px; line-height: 40px; }
.hud-lives span { color: var(--brass-l); transition: opacity 0.3s, transform 0.3s; }
.hud-lives span.lost { opacity: 0.22; transform: scale(0.8); }

.hud-buttons { pointer-events: auto; position: absolute; top: calc(58px + env(safe-area-inset-top)); right: 12px; }

.hud-festive {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(104px + env(safe-area-inset-top));
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.hud-festive span { display: block; height: 100%; background: #ffe39a; width: 100%; transform-origin: left; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 173, 116, 0.7);
  background: rgba(12, 36, 27, 0.72);
  color: var(--ivory);
  font: 500 15px var(--sans);
  cursor: pointer;
  padding: 0;
}
.icon-btn.mute {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  font-size: 19px;
}
.icon-btn.mute.off { color: rgba(246, 242, 234, 0.35); text-decoration: line-through; }

/* ---------- Bildschirme ---------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  background: rgba(5, 15, 26, 0.5);
}

.card {
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  overflow-y: auto;
  padding: 28px 24px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--brass), 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card.tall { align-self: stretch; }

.logo { display: flex; flex-direction: column; align-items: center; gap: 7px; line-height: 1; margin-bottom: 6px; }
.logo-top, .logo-sub {
  font-size: 8.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--green);
  padding-left: 0.42em;
}
.logo-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.2em;
  color: var(--brass-d);
  padding-left: 0.2em;
  white-space: nowrap;
}
.logo-name em { font-style: italic; letter-spacing: 0; font-weight: 300; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--green);
  margin: 0;
  line-height: 1.1;
}
h1 { font-size: 40px; font-style: italic; font-weight: 300; }
h2 { font-size: 32px; }
h3 { font: 500 12px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--green); margin: 18px 0 6px; }

.lead { margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  font: 500 13px var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn.primary { background: var(--green); color: var(--ivory); }
.btn.ghost { border-color: var(--line); }
.btn:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--green-3); color: var(--ivory); }
}

.link {
  background: none;
  border: 0;
  padding: 6px;
  color: var(--muted);
  font: 400 13px var(--sans);
  text-decoration: underline;
  cursor: pointer;
}
.link.inline { padding: 0; color: var(--green); font-size: inherit; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.how { text-align: left; margin: 4px 0 8px; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.how li { margin-bottom: 7px; }
.how b { font-weight: 500; color: var(--green); }

.big-score {
  font-family: var(--display);
  font-size: 76px;
  line-height: 1;
  color: var(--brass-d);
  font-variant-numeric: lining-nums;
}

/* ---------- Formular ---------- */

form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-bottom: 4px; }
label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
input[type='text'], input[type='email'] {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 400 16px var(--sans);
  border-radius: 0;
  user-select: text;
  -webkit-user-select: text;
}
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.4; color: var(--ink); }
label.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--green); }
.error { margin: 0; color: var(--red); font-size: 14px; }

/* ---------- Rangliste ---------- */

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  text-align: left;
}
.board li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.board .rank { font-family: var(--display); font-size: 20px; color: var(--muted); font-variant-numeric: lining-nums; }
.board .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pts { font-family: var(--display); font-size: 22px; color: var(--green); font-variant-numeric: lining-nums tabular-nums; }
.board li:first-child .rank, .board li:first-child .pts { color: var(--brass-d); }
.board li.me { background: #f1ead9; }
.board li.empty { display: block; text-align: center; color: var(--muted); border: 0; padding: 24px 0; }
.board-me { margin: 0; font-size: 14px; color: var(--green); }

.terms { flex: 1; overflow-y: auto; text-align: left; font-size: 14px; line-height: 1.5; border-top: 1px solid var(--line); padding-top: 10px; }
.terms p { margin: 0 0 9px; }
.terms b { font-weight: 500; color: var(--green); }

@media (max-height: 640px) {
  .card { padding: 18px 20px 16px; gap: 8px; }
  h1 { font-size: 32px; }
  .big-score { font-size: 56px; }
  .logo-name { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Tagesuebersicht auf dem Startbildschirm ---------- */

.today { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0 6px; }
.day-title { font: 500 12px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-d); margin-bottom: 4px; }
.today .lead { margin: 0; }

.attempts { margin: -4px 0 2px; font-size: 13px; color: var(--muted); }
.attempts .dots { letter-spacing: 4px; color: var(--brass-d); margin-right: 4px; }

.btn.small { min-height: 42px; padding: 8px 4px; font-size: 11px; letter-spacing: 0.1em; }
.btn.gold { border-color: var(--brass); background: #f3ead6; color: var(--brass-d); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 12px; }

.code-line { margin: -2px 0 2px; font-size: 14px; color: var(--green); }
.code-line b, .code-box b { font-weight: 500; letter-spacing: 0.12em; user-select: text; -webkit-user-select: text; }

.hud-label.dark { color: var(--muted); }

/* ---------- Adventsweg ---------- */

.path-detail { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; }
.path-detail .day-title { margin-bottom: 2px; }
.path-detail p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.path-detail .btn { min-height: 40px; padding: 8px; }
.path-detail .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.path-scroll { flex: 1; min-height: 120px; overflow-y: auto; }
.path { position: relative; }
.path svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.path svg polyline { fill: none; stroke: var(--brass-l); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.node {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: 400 21px var(--display);
  font-variant-numeric: lining-nums;
  cursor: pointer;
  padding: 0;
}
.node.done { background: var(--green); border-color: var(--green); color: var(--ivory); }
.node.missed { background: var(--paper); color: var(--muted); border-style: dashed; }
.node.today { background: var(--brass-l); border-color: var(--brass-d); color: var(--green); box-shadow: 0 0 0 5px rgba(201, 173, 116, 0.3); }
.node.special::after { content: '★'; position: absolute; top: -7px; right: -5px; font: 14px var(--sans); color: var(--brass-d); }
.node.selected { outline: 2px solid var(--green); outline-offset: 3px; }

.node-label { position: absolute; margin-top: -16px; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.node-label b { display: block; font: 400 17px var(--display); color: var(--green); font-variant-numeric: lining-nums; }
.node-label.left { text-align: right; transform: translateX(-100%); margin-left: -32px; }
.node-label.right { margin-left: 32px; }

/* ---------- Rangliste: Reiter ---------- */

.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--green); }
.tab { min-height: 38px; border: 0; background: transparent; color: var(--green); font: 500 12px var(--sans); letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; }
.tab.active { background: var(--green); color: var(--ivory); }

/* ---------- Erfolge ---------- */

.ach { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 100px; overflow-y: auto; border-top: 1px solid var(--line); text-align: left; }
.ach li { display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 9px 2px; border-bottom: 1px solid var(--line); opacity: 0.5; }
.ach li.got { opacity: 1; }
.ach .mark { font-size: 20px; line-height: 1.1; color: var(--muted); }
.ach li.got .mark { color: var(--brass-d); }
.ach .t { font: 400 19px var(--display); color: var(--green); line-height: 1.15; }
.ach .d { font-size: 13px; color: var(--muted); line-height: 1.35; }

.earned { list-style: none; margin: 0; padding: 8px 10px; background: #f3ead6; border: 1px solid var(--brass-l); text-align: left; font-size: 14px; }
.earned li { padding: 2px 0; color: var(--green); }
.earned li::before { content: '★ '; color: var(--brass-d); }

/* ---------- Quiz ---------- */

.quiz-result { margin: 0; font-size: 15px; line-height: 1.4; color: var(--green); }
.quiz-result.bad { color: var(--red); }
.code-box { padding: 12px; border: 1px dashed var(--brass); background: #f3ead6; font-size: 14px; line-height: 1.5; color: var(--green); }
.code-box b { display: block; font-size: 24px; font-family: var(--display); color: var(--brass-d); }

.card.tall .how { flex: 1; overflow-y: auto; }
.attempts.error { color: var(--red); }

/* ================= Modernere Oberflaeche: Tiefe, Rundungen, Animationen ================= */

.card {
  border-radius: 20px;
  border: 0;
  box-shadow: 0 0 0 1px rgba(201, 173, 116, 0.55), 0 2px 0 1px rgba(255, 255, 255, 0.6) inset, 0 34px 70px -18px rgba(0, 0, 0, 0.75);
  animation: card-in 0.34s cubic-bezier(0.22, 0.68, 0.16, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.btn {
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(12, 36, 27, 0.18);
  transition: transform 0.08s, box-shadow 0.08s, background 0.2s, color 0.2s;
}
.btn.primary {
  border-color: #0c241b;
  background: linear-gradient(180deg, #2a5c49 0%, #14342a 55%, #0c241b 100%);
  box-shadow: 0 4px 0 #04100b, 0 12px 20px -6px rgba(12, 36, 27, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.gold {
  background: linear-gradient(180deg, #f6e7bd 0%, #dcc07f 100%);
  border-color: var(--brass);
  color: #4d3d17;
  box-shadow: 0 4px 0 #8a6f33, 0 12px 20px -8px rgba(125, 101, 52, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #04100b; }
.btn:disabled { box-shadow: none; }
input[type='text'], input[type='email'] { border-radius: 12px; }
.tabs { border-radius: 12px; overflow: hidden; }
.icon-btn { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18); }

.hud-score { text-shadow: 0 2px 0 rgba(5, 15, 26, 0.6), 0 6px 18px rgba(5, 15, 26, 0.9); }
.hud-mult { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }

/* ---------- Tagesuebersicht (Startseite) ---------- */

.screen.home {
  padding: 0;
  display: block;
  background: linear-gradient(180deg, rgba(5, 15, 26, 0.78) 0%, rgba(8, 28, 22, 0.62) 45%, rgba(5, 15, 26, 0.86) 100%);
}
.home-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
  color: var(--ivory);
  text-align: center;
}
.home-head { flex: none; }
.home .logo { margin-bottom: 8px; }
.home .logo-top, .home .logo-sub { color: rgba(246, 242, 234, 0.75); font-size: 7.5px; }
.home .logo-sub { display: none; }
.home .logo-name { color: var(--brass-l); font-size: 27px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.home .day-title { color: var(--brass-l); font-size: 13px; margin-bottom: 3px; }
.home .lead { color: rgba(246, 242, 234, 0.8); margin: 0; font-size: 14px; }
.home .attempts { color: rgba(246, 242, 234, 0.8); margin: 6px 0 0; }
.home .attempts .dots { color: var(--brass-l); }

.home .path-scroll {
  flex: 1;
  min-height: 0;
  margin: 10px -16px 0;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  scrollbar-width: none;
}
.home .path-scroll::-webkit-scrollbar { display: none; }
.home .path svg polyline { stroke: rgba(201, 173, 116, 0.75); stroke-width: 3; stroke-dasharray: 1 10; }

.home .node {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border: 0;
  border-radius: 50%;
  outline-offset: 4px;
  background: radial-gradient(circle at 34% 26%, #3d8468 0%, #1e4637 46%, #0c241b 100%);
  color: var(--ivory);
  font: 400 26px var(--display);
  font-variant-numeric: lining-nums;
  box-shadow: 0 6px 0 #04100b, 0 14px 18px rgba(0, 0, 0, 0.5), inset 0 2px 1px rgba(255, 255, 255, 0.3), inset 0 -3px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.home .node:active { transform: translateY(5px); box-shadow: 0 1px 0 #04100b, 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 2px 1px rgba(255, 255, 255, 0.3); }
.home .node.done { box-shadow: 0 0 0 3px var(--brass-l), 0 6px 0 3px #6b5526, 0 16px 18px rgba(0, 0, 0, 0.5), inset 0 2px 1px rgba(255, 255, 255, 0.3); }
.home .node.locked {
  background: radial-gradient(circle at 34% 26%, #52636a 0%, #2a3a41 50%, #18252b 100%);
  color: rgba(246, 242, 234, 0.4);
  box-shadow: 0 5px 0 #0a1317, 0 10px 14px rgba(0, 0, 0, 0.4), inset 0 2px 1px rgba(255, 255, 255, 0.14);
}
.home .node.today {
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  font-size: 34px;
  color: #3a2d0e;
  background: radial-gradient(circle at 34% 26%, #fff3c9 0%, #e2c27a 42%, #a3864c 100%);
  box-shadow: 0 7px 0 #6b5526, 0 18px 24px rgba(0, 0, 0, 0.55), inset 0 2px 1px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(255, 226, 150, 0.55);
  animation: today-pulse 1.8s ease-out infinite;
}
@keyframes today-pulse {
  0% { box-shadow: 0 7px 0 #6b5526, 0 18px 24px rgba(0, 0, 0, 0.55), inset 0 2px 1px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(255, 226, 150, 0.6); }
  100% { box-shadow: 0 7px 0 #6b5526, 0 18px 24px rgba(0, 0, 0, 0.55), inset 0 2px 1px rgba(255, 255, 255, 0.7), 0 0 0 22px rgba(255, 226, 150, 0); }
}
.home .node.special::after { content: '★'; position: absolute; top: -8px; right: -4px; font: 17px var(--sans); color: #ffe39a; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); }

.home .node-label {
  position: absolute;
  margin-top: -10px;
  font: 500 12px var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-l);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  transform: none;
}
.home .node-label.left { transform: translateX(-100%); margin-left: -46px; text-align: right; }
.home .node-label.right { margin-left: 46px; }

.home-nav { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.home-nav .btn {
  min-height: 44px;
  padding: 8px 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ivory);
  border-color: rgba(201, 173, 116, 0.6);
  background: linear-gradient(180deg, rgba(30, 70, 55, 0.92), rgba(12, 36, 27, 0.92));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.home .link { color: rgba(246, 242, 234, 0.6); font-size: 12px; padding: 6px 6px 0; }

/* ---------- Karte zum angetippten Tag ---------- */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  background: rgba(5, 15, 26, 0.6);
  animation: fade-in 0.2s;
}
@keyframes fade-in { from { opacity: 0; } }
.sheet-card {
  position: relative;
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  padding: 46px 22px calc(22px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -1px 0 var(--brass-l), 0 -20px 50px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: sheet-up 0.34s cubic-bezier(0.22, 0.68, 0.16, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } }
#sheet-body { display: flex; flex-direction: column; gap: 10px; }
.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #efeae0;
  color: var(--green);
  font: 400 20px var(--sans);
  cursor: pointer;
}
.coin {
  position: absolute;
  top: -34px;
  left: 50%;
  width: 68px;
  height: 68px;
  margin-left: -34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 400 32px var(--display);
  font-variant-numeric: lining-nums;
  color: var(--ivory);
  background: radial-gradient(circle at 34% 26%, #3d8468 0%, #1e4637 46%, #0c241b 100%);
  box-shadow: 0 0 0 4px var(--paper), 0 6px 0 4px #cfc6b2, inset 0 2px 1px rgba(255, 255, 255, 0.3);
}
.coin.gold { color: #3a2d0e; background: radial-gradient(circle at 34% 26%, #fff3c9 0%, #e2c27a 42%, #a3864c 100%); }
.sheet-card { overflow: visible; }
.sheet-card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-card .lead { margin: 0; }

/* ---------- Ladeanimation ---------- */

.loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--ivory);
  background: radial-gradient(circle at 50% 38%, #24543f 0%, #0c241b 55%, #050f1a 100%);
  transition: opacity 0.45s, transform 0.45s;
}
.loader.out { opacity: 0; transform: scale(1.12); pointer-events: none; }
.loader-ring { position: relative; width: 168px; height: 168px; margin-bottom: 14px; }
.loader-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.loader-ring circle { fill: none; stroke-width: 5; }
.loader-ring .track { stroke: rgba(246, 242, 234, 0.14); }
.loader-ring .bar { stroke: var(--brass-l); stroke-linecap: round; stroke-dasharray: 465; stroke-dashoffset: 465; filter: drop-shadow(0 0 6px rgba(255, 226, 150, 0.8)); }
.loader.run .bar { animation: ring-fill 1.6s cubic-bezier(0.5, 0, 0.2, 1) forwards; }
@keyframes ring-fill { to { stroke-dashoffset: 0; } }
.loader-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 300 88px var(--display);
  font-variant-numeric: lining-nums;
  color: var(--brass-l);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(255, 226, 150, 0.35);
}
.loader.run .loader-num { animation: num-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes num-in { from { opacity: 0; transform: scale(0.3) rotate(-12deg); } }
.loader-kind { font: 500 11px var(--sans); letter-spacing: 0.34em; text-transform: uppercase; color: rgba(246, 242, 234, 0.75); padding-left: 0.34em; }
.loader-title { font: italic 300 40px var(--display); line-height: 1.1; }
.loader-text { max-width: 300px; font-size: 15px; line-height: 1.45; color: rgba(246, 242, 234, 0.8); }
.loader.run .loader-kind, .loader.run .loader-title, .loader.run .loader-text { animation: rise 0.6s cubic-bezier(0.22, 0.68, 0.16, 1) both; }
.loader.run .loader-title { animation-delay: 0.18s; }
.loader.run .loader-text { animation-delay: 0.32s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Intro ---------- */

.intro {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  color: var(--ivory);
  background: radial-gradient(circle at 50% 42%, #24543f 0%, #0c241b 52%, #050f1a 100%);
  transition: opacity 0.65s, transform 0.65s;
}
.intro.out { opacity: 0; transform: scale(1.18); pointer-events: none; }
.intro-star { font-size: 30px; color: #ffe39a; text-shadow: 0 0 24px rgba(255, 226, 150, 0.9); animation: star-in 1.1s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes star-in { from { opacity: 0; transform: translateY(-70px) scale(0.2) rotate(-180deg); } }
.intro-top, .intro-sub { font: 400 9px var(--sans); letter-spacing: 0.42em; text-transform: uppercase; padding-left: 0.42em; color: rgba(246, 242, 234, 0.8); animation: rise 0.8s 0.9s both; }
.intro-name {
  font: 400 clamp(34px, 11vw, 52px) var(--display);
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: var(--brass-l);
  white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 34px rgba(255, 226, 150, 0.3);
  animation: name-in 1.3s 0.35s cubic-bezier(0.22, 0.68, 0.16, 1) both;
}
.intro-name em { font-style: italic; font-weight: 300; letter-spacing: 0; }
@keyframes name-in { from { opacity: 0; letter-spacing: 0.7em; filter: blur(8px); } }
.intro-line { width: 190px; height: 1px; background: linear-gradient(90deg, transparent, var(--brass-l), transparent); animation: line-in 0.9s 1.1s both; }
@keyframes line-in { from { transform: scaleX(0); opacity: 0; } }
.intro-title { font: italic 300 38px var(--display); animation: rise 0.9s 1.45s both; }
.intro-hint { position: absolute; bottom: calc(26px + env(safe-area-inset-bottom)); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(246, 242, 234, 0.45); animation: rise 0.8s 2.1s both; }
.intro-snow { position: absolute; inset: -20% 0 0; pointer-events: none; background-image: radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 31% 62%, rgba(255, 255, 255, 0.8) 50%, transparent 51%), radial-gradient(2px 2px at 54% 31%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 72% 78%, rgba(255, 255, 255, 0.7) 50%, transparent 51%), radial-gradient(2px 2px at 88% 44%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 43% 88%, rgba(255, 255, 255, 0.8) 50%, transparent 51%); background-size: 100% 50%; animation: snow-fall 7s linear infinite; opacity: 0.7; }
@keyframes snow-fall { to { transform: translateY(40%); } }

@media (prefers-reduced-motion: reduce) {
  .card, .sheet, .sheet-card, .intro *, .loader * { animation: none !important; }
  .loader .bar { stroke-dashoffset: 0; }
  .home .node.today { animation: none; }
}

/* Die Tageskarte liegt innerhalb der dunklen Uebersicht, hat aber hellen Grund. */
.home .sheet-card .lead { color: var(--muted); font-size: 15px; }
.home .sheet-card .attempts { color: var(--muted); margin: -2px 0 2px; }
.home .sheet-card .attempts.error { color: var(--red); }
.loader-ring .bar { filter: none; }

/* Kurzer Hinweis am unteren Rand (z. B. nach dem Eintragen) */
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 30;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--green);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 0 0 1px var(--brass-l), 0 18px 40px rgba(0, 0, 0, 0.6);
  animation: card-in 0.3s cubic-bezier(0.22, 0.68, 0.16, 1);
}

/* Leiste des Master-Modus in der Tagesuebersicht */
.master-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px dashed var(--brass-l);
  border-radius: 12px;
  background: rgba(12, 36, 27, 0.85);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-l);
}
.master-bar select, .master-bar button {
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(201, 173, 116, 0.7);
  border-radius: 8px;
  background: var(--paper);
  color: var(--green);
  font: 400 13px var(--sans);
}
.board li.house .name { color: var(--brass-d); }

/* ================= Tagesuebersicht: ruhiges Bild, groessere Schrift und Knoepfe ================= */

/* Oben und unten abgedunkelt, damit Text und Knoepfe gut lesbar sind; in der Mitte bleibt die Boutique sichtbar. */
.screen.home {
  background: linear-gradient(180deg,
    rgba(4, 12, 20, 0.92) 0%, rgba(4, 12, 20, 0.74) 20%, rgba(4, 12, 20, 0.2) 40%,
    rgba(4, 12, 20, 0.2) 62%, rgba(4, 12, 20, 0.8) 82%, rgba(4, 12, 20, 0.95) 100%);
}
.home-panel { padding: calc(14px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom)); }
.home .logo { margin-bottom: 10px; gap: 5px; }
.home .logo-top { font-size: 9px; letter-spacing: 0.34em; color: rgba(246, 242, 234, 0.85); }
.home .logo-name { font-size: 31px; }
.home .day-title { font-size: 15px; letter-spacing: 0.16em; margin-bottom: 5px; }
.home .lead { font-size: 16px; line-height: 1.4; color: rgba(246, 242, 234, 0.92); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.home .attempts { font-size: 15px; margin-top: 7px; color: rgba(246, 242, 234, 0.9); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }

/* Der Weg steht am unteren Rand: Solange er kuerzer ist als der Platz, bleibt oben Luft. */
.home .path-scroll { margin-top: 8px; display: flex; flex-direction: column; }
.home .path { flex: none; margin-top: auto; }
.home .path svg polyline { stroke: rgba(226, 198, 138, 0.9); stroke-width: 3; stroke-dasharray: 1 10; }
.home .node-label {
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 12, 20, 0.6);
  margin-top: -13px;
}
.home .node-label.left { margin-left: -42px; }
.home .node-label.right { margin-left: 42px; }
.path-more {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 242, 234, 0.7);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.home-nav { gap: 10px; margin-top: 10px; }
.home-nav .btn {
  min-height: 54px;
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 8px 4px;
  border-radius: 16px;
}

@media (max-height: 640px) {
  .home .logo-top { display: none; }
  .home .logo-name { font-size: 26px; }
  .home .lead { font-size: 15px; }
  .home-nav .btn { min-height: 48px; }
}

/* ================= Tagesuebersicht auf beigem Schleier: dunkle Schrift, geschwungener Weg ================= */

.screen.home { background: none; }
.home .logo-top { color: var(--green); }
.home .logo-name { color: var(--brass-d); text-shadow: none; }
.home .day-title { color: var(--brass-d); }
.home .lead, .home .attempts { color: var(--green); text-shadow: none; }
.home .attempts .dots { color: var(--brass-d); }
.home .path svg path {
  fill: none;
  stroke: var(--brass-d);
  stroke-width: 3;
  stroke-dasharray: 1 10;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.home .node-label {
  background: rgba(251, 249, 244, 0.92);
  color: var(--brass-d);
  text-shadow: none;
  box-shadow: 0 0 0 1px rgba(163, 134, 76, 0.4);
}
.home .node.special::after { color: var(--brass-d); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.path-more { color: var(--muted); text-shadow: none; }
body.light .screen:not(.home) { background: rgba(58, 46, 24, 0.28); }
body.light .sheet { background: rgba(58, 46, 24, 0.42); }

/* Rechtstexte: kleiner Textlink mittig unten */
.home-legal-link {
  flex: none;
  align-self: center;
  margin-top: 8px;
  padding: 8px 12px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 400 13px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.master-info { color: var(--ivory); letter-spacing: 0.04em; text-transform: none; font-size: 13px; }

/* Intro: deutliche Aufforderung zum Starten */
.intro { cursor: pointer; }
.intro-hint {
  padding: 12px 26px;
  border: 1px solid rgba(201, 173, 116, 0.8);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--brass-l);
  animation: rise 0.8s 1.7s both, hint-pulse 1.8s 2.6s ease-in-out infinite;
}
@keyframes hint-pulse {
  50% { box-shadow: 0 0 0 10px rgba(201, 173, 116, 0); background: rgba(201, 173, 116, 0.16); }
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 173, 116, 0.45); background: transparent; }
}

/* Anleitung mit Bildern */
.how-body { flex: 1; min-height: 120px; overflow-y: auto; text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }
.how-lead { margin: 0 0 4px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.how-body h3 { margin: 16px 0 4px; }
.how-body h3.how-good { color: #2f6a47; }
.how-body h3.how-bad { color: var(--red); }
.how-items { list-style: none; margin: 0; padding: 0; }
.how-items li { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.how-items canvas { width: 60px; height: 60px; border-radius: 12px; background: #14342a; }
.how-items b { display: block; font: 400 20px/1.15 var(--display); color: var(--green); }
.how-items span { font-size: 14px; line-height: 1.35; color: var(--muted); }
#how-avoid canvas { background: #3a1f1f; }
.card.tall .how-body .how { flex: none; overflow: visible; margin: 4px 0 8px; }

/* ================= Quiz: eine Frage nach der anderen, mit Uhr ================= */

.quiz-rules { margin: 0; font-size: 15px; line-height: 1.45; color: var(--green); }
.quiz-play { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.quiz-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-d); }
.quiz-clock {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--ivory);
  font: 400 23px var(--display);
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  transition: background 0.3s;
}
.quiz-clock.low { background: var(--red); }
.quiz-bar { flex: none; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.quiz-bar span { display: block; height: 100%; background: var(--brass); transform-origin: left; }
.quiz-question { margin: 6px 0 2px; font: 400 25px/1.2 var(--display); color: var(--green); }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-options .opt {
  min-height: 52px;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 16px var(--sans);
  cursor: pointer;
}
.quiz-options .opt:disabled { cursor: default; }
.quiz-options .opt.sel { border-color: var(--green); background: #e9efe9; }
.quiz-options .opt.right { border-color: #2f6a47; background: #dcebdd; color: #1d4a30; }
.quiz-options .opt.wrong { border-color: var(--red); background: #f6e4e4; color: var(--red); }
.quiz-feedback { margin: 2px 0 0; text-align: center; font: 500 17px var(--sans); }
.quiz-feedback.good { color: #2f6a47; }
.quiz-feedback.bad { color: var(--red); }

/* Anleitung: Produkte aus der Boutique als Fotos */
.how-items img { width: 60px; height: 60px; padding: 6px; border-radius: 12px; background: #ece3d0; object-fit: contain; }

