/* Pickerl-Rechner. Derselbe Stil wie die Einblendungen im Erklaervideo:
   dicke dunkle Kontur, warme Palette, klobige Radien, das Gold aus dem Logo. */

:root {
  --nacht: #16141a;
  --nacht-2: #221e26;
  --dunkel: #26201a;
  --creme: #fcf6eb;
  --creme-2: #efe6d6;
  --gold: #e8ae2c;
  --gold-hell: #ffd66e;
  --gruen: #56b24a;
  --gelb: #eeb02e;
  --rot: #d64430;
  --rot-tief: #9f2c22;
  --blau: #343e7a;
  --kontur: 4px solid var(--dunkel);
  --schatten: 0 6px 0 rgba(0, 0, 0, .35);
  --r: 22px;
}

* { box-sizing: border-box; }
/* Ausgeblendet heisst ausgeblendet - auch wenn eine Regel unten "display" setzt. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(120% 60% at 50% 0%, #2a2430 0%, var(--nacht) 60%);
  background-color: var(--nacht);
  color: var(--creme);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
main, .kopf, .fuss { max-width: 460px; margin: 0 auto; }

/* ---------------------------------------------------------------- Kopf */
.kopf { display: flex; align-items: center; gap: 12px; padding: 18px 0 10px; }
.kopf-logo { width: 44px; height: 44px; }
.kopf h1 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: .01em; }
.kopf p { margin: 2px 0 0; color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* ---------------------------------------------------------------- Karten */
.karte {
  background: var(--creme);
  color: var(--dunkel);
  border: var(--kontur);
  border-radius: var(--r);
  box-shadow: var(--schatten);
  padding: 18px 16px 20px;
  margin: 14px 0;
}
.karte h2 { margin: 0 0 12px; font-size: 21px; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; }
legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: #5a4c3c; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .monat, .jahr-knopf, .aktion, .los, .installieren {
  font: inherit;
  cursor: pointer;
  border: 3px solid var(--dunkel);
  border-radius: 14px;
  background: #fff;
  color: var(--dunkel);
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, background-color .15s ease;
}
.chip { padding: 8px 12px; font-size: 15px; font-weight: 600; }
.chip[aria-pressed="true"], .monat[aria-pressed="true"] {
  background: var(--gold); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.chip:active, .monat:active, .jahr-knopf:active, .aktion:active, .los:active { transform: translateY(2px); }

.monate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* Nachfrage nach dem echten Pickerl */
.pickerl-frage { margin-top: 4px; padding-top: 14px; border-top: 3px dashed #d8ccb8; }
.annahme { margin: 0 0 10px; font-size: 16px; }
.eigenes { margin-top: 12px; }
.eigenes .klein { margin: 0 0 8px; font-size: 13px; color: #6a5c4a; }
.pk-jahre { margin-top: 10px; }
.pk-jahre .chip { flex: 1 0 auto; min-width: 64px; text-align: center; font-weight: 700; }
.fehler { margin: 10px 0 0; padding: 8px 12px; background: #fde3dc; border: 3px solid var(--rot); border-radius: 12px; font-size: 14px; font-weight: 600; }
.monat { padding: 10px 0; font-weight: 700; font-size: 15px; }

.jahr-wahl { display: flex; gap: 8px; align-items: stretch; }
.jahr-knopf { width: 56px; font-size: 26px; font-weight: 700; line-height: 1; }
#jahr {
  flex: 1;
  font-family: inherit; font-weight: 800; font-size: 24px; line-height: 1;
  text-align: center;
  text-align-last: center;
  border: 3px solid var(--dunkel);
  border-radius: 14px;
  background: #fff;
  color: var(--dunkel);
  padding: 10px;
  appearance: none;
  -webkit-appearance: none;
}

:focus-visible { outline: 3px solid var(--gold-hell); outline-offset: 3px; }

/* ---------------------------------------------------------------- Maschine */
.maschine-bereich { position: relative; height: 430px; margin: 6px auto 0; width: 300px; }

.pickerl-ein, .pickerl-aus { width: 92px; }
.pickerl-ein {
  position: absolute; left: 50%; top: 4px; z-index: 1;
  transform: translateX(-50%) rotate(-6deg);
  filter: drop-shadow(0 5px 0 rgba(0,0,0,.35));
}
.pickerl-ein.leer { opacity: .35; }
.pickerl-ein.einwerfen {
  animation: einwerfen .55s cubic-bezier(.55, 0, .75, .3) forwards;
}
@keyframes einwerfen {
  0%   { transform: translateX(-50%) rotate(-6deg) translateY(0); }
  30%  { transform: translateX(-50%) rotate(0deg) translateY(-10px); }
  100% { transform: translateX(-50%) rotate(0deg) translateY(118px); }
}

.maschine {
  position: absolute; left: 0; right: 36px; top: 112px; z-index: 2;
  height: 300px;
  background: linear-gradient(180deg, #e0503c 0%, var(--rot) 45%, var(--rot-tief) 100%);
  border: var(--kontur);
  border-radius: 34px 34px 22px 22px;
  box-shadow: var(--schatten), inset 0 6px 0 rgba(255,255,255,.18);
}
.maschine.rattern { animation: rattern .09s linear 9; }
@keyframes rattern {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-2px, 1px) rotate(-.6deg); }
  50% { transform: translate(2px, -1px) rotate(.5deg); }
  75% { transform: translate(-1px, 0) rotate(-.3deg); }
}

.schlitz {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  width: 108px; height: 12px; border-radius: 8px;
  background: #1a0d0a; box-shadow: inset 0 3px 0 rgba(0,0,0,.6);
}
.schild-oben {
  position: absolute; left: 14px; right: 14px; top: 34px;
  background: var(--gold); color: var(--dunkel);
  border: 3px solid var(--dunkel); border-radius: 12px;
  text-align: center; font-weight: 900; letter-spacing: .12em; font-size: 15px; padding: 4px 0;
}

.walzen {
  position: absolute; left: 14px; right: 14px; top: 78px;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px;
  background: #1a0d0a; border: 3px solid var(--dunkel); border-radius: 14px; padding: 8px;
}
.walze {
  position: relative; height: 72px; overflow: hidden;
  background: linear-gradient(180deg, #cfc6b4 0%, var(--creme) 22%, var(--creme) 78%, #cfc6b4 100%);
  border-radius: 8px;
}
.walze::before, .walze::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18px; z-index: 1; pointer-events: none;
}
.walze::before { top: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent); }
.walze::after { bottom: 0; background: linear-gradient(0deg, rgba(0,0,0,.35), transparent); }
.band { will-change: transform; }
.band div {
  height: 72px; display: flex; align-items: center; justify-content: center;
  color: var(--dunkel); font-weight: 900; font-size: 28px; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.walze.laeuft .band { filter: blur(1.4px); }

.lampen { position: absolute; left: 0; right: 0; top: 176px; display: flex; justify-content: center; gap: 12px; }
.lampen i {
  width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--dunkel);
  background: #5a2a22;
}
.lampen.lauf i { animation: lampe .5s steps(1) infinite; }
.lampen.lauf i:nth-child(2) { animation-delay: .1s; }
.lampen.lauf i:nth-child(3) { animation-delay: .2s; }
.lampen.lauf i:nth-child(4) { animation-delay: .3s; }
.lampen.lauf i:nth-child(5) { animation-delay: .4s; }
@keyframes lampe { 0% { background: var(--gold-hell); box-shadow: 0 0 10px var(--gold-hell); } 50% { background: #5a2a22; box-shadow: none; } }
.lampen.an i { background: var(--gold-hell); box-shadow: 0 0 10px var(--gold-hell); }

.ausgabe {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: 150px; height: 88px;
  background: #1a0d0a; border: 3px solid var(--dunkel); border-radius: 14px 14px 20px 20px;
  box-shadow: inset 0 6px 0 rgba(0,0,0,.5);
}
/* Das neue Pickerl springt ganz aus dem Fach und bleibt vorne stehen - man
   soll die Loecher sehen. */
.pickerl-aus {
  position: absolute; left: 50%; top: 6px; z-index: 3;
  transform: translate(-50%, 10px) scale(.35); opacity: 0;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
}
.pickerl-aus.raus { animation: auswerfen .6s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes auswerfen {
  from { transform: translate(-50%, 10px) scale(.35) rotate(0); opacity: 0; }
  30%  { opacity: 1; }
  to   { transform: translate(-50%, -22px) scale(1.08) rotate(4deg); opacity: 1; }
}

.hebel { position: absolute; right: -34px; top: 60px; width: 30px; height: 160px; }
.hebel .stange {
  position: absolute; left: 11px; bottom: 0; width: 8px; height: 132px;
  background: linear-gradient(90deg, #8a8f96, #e9edf1 45%, #8a8f96);
  border: 2px solid var(--dunkel); border-radius: 6px;
  transform-origin: 50% 100%;
}
.hebel .knauf {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a70, var(--rot) 55%, var(--rot-tief));
  border: 3px solid var(--dunkel);
}
.hebel .stange::after {
  content: ""; position: absolute; left: -9px; bottom: -8px; width: 22px; height: 14px;
  background: #5b5f66; border: 2px solid var(--dunkel); border-radius: 6px;
}
/* Beim Ziehen wird die Stange kuerzer und der Knauf faehrt mit ihr nach unten,
   als wuerde man den Hebel nach vorne ziehen. */
.hebel.ziehen .stange { animation: stange .6s ease-in-out; }
.hebel.ziehen .knauf { animation: knauf .6s ease-in-out; }
@keyframes stange { 0%, 100% { transform: scaleY(1); } 40%, 55% { transform: scaleY(.42); } }
@keyframes knauf  { 0%, 100% { transform: translateY(0); } 40%, 55% { transform: translateY(76px); } }
.hebel { cursor: pointer; }

/* ---------------------------------------------------------------- Los-Knopf */
.los {
  display: block; width: 100%; margin: 4px 0 8px;
  background: var(--gold); padding: 16px; font-size: 20px; font-weight: 900; letter-spacing: .02em;
  box-shadow: var(--schatten), inset 0 -4px 0 rgba(0,0,0,.18);
}
.los:disabled { background: #6a6060; color: #d8d0c4; cursor: default; box-shadow: none; }

/* ---------------------------------------------------------------- Ergebnis */
.ergebnis { position: relative; padding-top: 22px; margin-top: 92px; }
.ergebnis.zeigen { animation: aufklappen .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes aufklappen { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.gesicht { position: absolute; right: 16px; top: -88px; width: 104px; height: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); }
.gesicht.wackeln { animation: wackeln .6s ease; }
@keyframes wackeln { 0%{transform:rotate(0)} 25%{transform:rotate(-8deg)} 50%{transform:rotate(6deg)} 75%{transform:rotate(-3deg)} 100%{transform:rotate(0)} }

.status {
  display: inline-block; margin: 0 0 10px; padding: 5px 12px;
  border: 3px solid var(--dunkel); border-radius: 999px;
  font-weight: 800; font-size: 14px; letter-spacing: .02em; color: #fff;
}
.status.gruen { background: var(--gruen); }
.status.gelb { background: var(--gelb); color: var(--dunkel); }
.status.rot { background: var(--rot); }

.ergebnis h2 { font-size: 25px; line-height: 1.15; margin: 0 0 6px; }
.zeitraum {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: 10px 0 12px; padding: 12px 14px 14px;
  border: var(--kontur); border-radius: 18px; box-shadow: 0 5px 0 rgba(0, 0, 0, .28);
}
.zeitraum.gold { background: #ffe9a8; }
.zeitraum.gruen { background: #d9f0d3; }
.zeitraum.rot { background: #fde3dc; border-color: var(--rot-tief); }
.zr-oben { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6a5620; }
.zeitraum.gruen .zr-oben { color: #2f6a27; }
.zeitraum.rot .zr-oben { color: var(--rot-tief); }
.zr-datum { font-size: 24px; font-weight: 900; line-height: 1.15; margin-top: 4px; white-space: nowrap; }
.zr-und { font-size: 14px; font-weight: 700; color: #6a5c4a; margin-top: 2px; }
.zr-unten { font-size: 15px; font-weight: 700; margin-top: 6px; }
.hinweis { margin: 8px 0; padding: 10px 12px; background: #fff3d6; border: 3px solid var(--dunkel); border-radius: 14px; font-size: 15px; }
.naechste { margin: 10px 0 0; font-size: 17px; }
.warnung {
  margin: 0 0 14px; padding: 10px 12px; background: var(--rot); color: #fff;
  border: 3px solid var(--dunkel); border-radius: 14px; font-weight: 700; font-size: 15px;
}

.ergebnis h3 { margin: 18px 0 8px; font-size: 16px; color: #5a4c3c; }
.zeitleiste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.zeitleiste li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 3px solid var(--dunkel); border-radius: 12px; padding: 7px 12px; font-size: 15px;
}
.zeitleiste li b { font-size: 16px; white-space: nowrap; }
.zeitleiste .wann { display: flex; flex-direction: column; line-height: 1.2; }
.zeitleiste .wann small { font-size: 12.5px; font-weight: 600; color: #8a6d1f; white-space: nowrap; }
.zeitleiste li span { color: #6a5c4a; font-size: 14px; text-align: right; }
.zeitleiste li.tausch { background: #eaf6e7; }
.zeitleiste li.abgelaufen { background: #fde3dc; }

.aktionen { display: grid; gap: 8px; margin-top: 16px; }
.aktion {
  display: block; text-align: center; text-decoration: none; padding: 12px; font-weight: 800; font-size: 17px;
}
.aktion.haupt { background: var(--gold); }

.installieren {
  display: block; width: 100%; margin: 6px 0; padding: 12px; background: transparent; color: var(--gold);
  border-color: var(--gold); font-weight: 800;
}

/* ---------------------------------------------------------------- Fuss */
.fuss { margin-top: 18px; font-size: 13px; color: #b8ac9c; text-align: center; }
.fuss p { margin: 6px 0; }
.fuss strong { color: var(--creme); }
.fuss-marke { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--gold); font-weight: 700; letter-spacing: .03em; }
.fuss-klein { font-size: 12px; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
