html, body { width: 100%; height: 100%; overflow: hidden; }
body { background-color: #2a2622; background-image: var(--grain); }

#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1600px; height: 900px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  transform-origin: 50% 50%;
  background: var(--paper);
  background-image: var(--grain);
  overflow: hidden;
  user-select: none;
}
#world { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; }

.screen { position: absolute; inset: 0; display: none; }
.screen.show { display: block; }
#s-hud, #s-inspect { pointer-events: none; }
#s-inspect .receipt, #s-hud * { pointer-events: none; }

/* ---------- Logo ---------- */
.logo { position: relative; display: inline-block; line-height: .8; }
.logo-may {
  display: block;
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: 132px; letter-spacing: -.035em;
  color: var(--ink);
  text-shadow: 6px 6px 0 var(--red);
}
.logo-stamp {
  position: absolute; right: -18px; bottom: -34px;
  background: var(--red); color: #fff;
  border: 3px solid var(--ink);
  font-family: var(--display); font-weight: 850; font-stretch: 125%;
  font-size: 30px; letter-spacing: .18em;
  padding: 8px 14px 6px 18px;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-s);
}
.logo.small .logo-may { font-size: 120px; }
.logo.small .logo-stamp { font-size: 22px; bottom: -28px; }

/* ---------- Laden aufschließen ---------- */
#s-unlock { background: var(--paper); background-image: var(--grain); z-index: 50; }
.unlock-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 88px; }
.btn.huge { font-size: 34px; padding: 26px 46px; border-radius: 20px; }
.key-ico { width: 38px; height: 38px; background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='7.5' cy='12' r='4.5' fill='none' stroke='white' stroke-width='2.6'/><path d='M12 12h10M18 12v4M21 12v3' stroke='white' stroke-width='2.6' stroke-linecap='round'/></svg>"); }
.unlock-lang { display: flex; gap: 14px; margin-top: -40px; }
.lang-pill { border: 3px solid var(--ink); background: var(--card); border-radius: 999px; padding: 10px 26px; font-family: var(--display); font-weight: 800; font-size: 20px; box-shadow: var(--shadow-s); }
.lang-pill.on { background: var(--ink); color: var(--paper); }

/* ---------- Lobby ---------- */
.brand { position: absolute; left: 72px; top: 62px; }
.tagline { font-family: var(--hand); font-size: 34px; margin: 44px 0 0 6px; color: var(--ink-2); transform: rotate(-1.2deg); }

.how { position: absolute; left: 72px; top: 318px; width: 800px; }
.how h3, .crew h3, .final-awards h3, .final-catalog h3 {
  font-family: var(--display); font-weight: 850; font-stretch: 115%; text-transform: uppercase;
  letter-spacing: .12em; font-size: 17px; margin: 0 0 14px; color: var(--ink-2);
}
.how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: how; }
.how li {
  counter-increment: how; position: relative;
  padding: 2px 0 0 64px; min-height: 48px;
  font-size: 25px; line-height: 1.25; font-weight: 500; font-variation-settings: 'opsz' 30;
}
.how li::before {
  content: counter(how); position: absolute; left: 0; top: 0;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--yellow); border: 3px solid var(--ink);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 22px;
  box-shadow: 2px 3px 0 var(--ink);
}
.how li b { font-weight: 800; }

.join {
  position: absolute; right: 64px; top: 46px; width: 600px; height: 512px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 46px 44px 30px;
  box-shadow: 7px 8px 0 var(--ink);
  transform: rotate(.8deg);
}
.tag-hole { position: absolute; left: 50%; top: 18px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.join h2 {
  margin: 8px 0 22px; text-align: center;
  font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 44px; text-transform: uppercase; letter-spacing: -.01em;
}
.join-grid { display: flex; gap: 30px; align-items: center; }
.qr { width: 236px; height: 236px; flex: none; background: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-info { flex: 1; min-width: 0; }
.code-label { font-family: var(--display); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 15px; color: var(--ink-2); }
.code { display: flex; gap: 8px; margin: 8px 0 18px; }
.code span {
  width: 58px; height: 74px; display: grid; place-items: center;
  background: var(--ink); color: var(--yellow); border-radius: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 46px;
  box-shadow: inset 0 -37px 0 rgba(255,255,255,.06);
  position: relative;
}
.code span::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(0,0,0,.6); }
.join-how { margin: 0 0 6px; font-size: 18px; line-height: 1.3; color: var(--ink-2); }
.url { font-family: var(--mono); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--paper-2); padding: 6px 10px; border-radius: 6px; border: 2px dashed var(--ink-3); }
.wifi { margin: 22px 0 0; text-align: center; font-family: var(--hand); font-size: 24px; color: var(--ink-2); }

.crew { position: absolute; left: 72px; top: 606px; width: 940px; }
.crew-head { display: flex; align-items: baseline; gap: 14px; }
.crew-count { font-family: var(--mono); font-weight: 700; font-size: 16px; color: var(--ink-3); }
.crew-list { display: grid; grid-template-columns: repeat(10, 84px); gap: 8px; }
.badge {
  position: relative; width: 84px; height: 132px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 10px;
  box-shadow: var(--shadow-s);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 18px;
  animation: drop .5s cubic-bezier(.3,1.6,.5,1) both;
  transform-origin: 50% -30px;
}
.badge::before { content: ''; position: absolute; top: 6px; left: 50%; width: 24px; height: 6px; margin-left: -12px; border-radius: 3px; background: var(--paper-2); border: 2px solid var(--ink); }
.badge .b-av { width: 64px; height: 64px; border-radius: 50%; background: var(--paper-2); border: 2.5px solid var(--ink); overflow: hidden; }
.badge .b-name { margin-top: 8px; font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 15px; max-width: 78px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .b-lang { position: absolute; top: -9px; right: -9px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.badge.vip .b-lang { background: var(--red); }
.badge.off { opacity: .45; filter: grayscale(1); }
.badge.empty { background: transparent; border: 3px dashed var(--ink-3); box-shadow: none; animation: none; justify-content: center; padding: 0; }
.badge.empty::before { display: none; }
.badge.empty span { font-family: var(--display); font-weight: 900; font-size: 30px; color: var(--paper-3); }
@keyframes drop { 0% { transform: translateY(-160px) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.badge:nth-child(odd) { --sw: 1.5deg; }
.badge:not(.empty) { animation: drop .5s cubic-bezier(.3,1.6,.5,1) both, sway 4s 0.6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(calc(var(--sw, -1.5deg) * -1)); } 50% { transform: rotate(var(--sw, -1.5deg)); } }

.start-row { position: absolute; right: 64px; top: 600px; width: 480px; display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.btn.big { font-size: 30px; padding: 22px 40px; border-radius: 18px; }
.need-more { font-family: var(--hand); font-size: 28px; color: var(--ink-2); }
.lobby-tape { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; border-top: 3px solid var(--ink); }

/* ---------- Einarbeitung ---------- */
#s-tutorial { background: var(--paper); background-image: var(--grain); }
.tut-kicker { position: absolute; left: 80px; top: 70px; font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: .08em; background: var(--yellow); border: 3px solid var(--ink); padding: 6px 14px; box-shadow: var(--shadow-s); }
.tut-title { position: absolute; left: 80px; top: 120px; margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 96px; letter-spacing: -.03em; }
.tut-steps { position: absolute; left: 80px; right: 80px; top: 300px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.tut-card { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); padding: 24px 24px 28px; animation: rise .55s cubic-bezier(.2,1.4,.4,1) both; }
.tut-card:nth-child(2) { animation-delay: .12s; } .tut-card:nth-child(3) { animation-delay: .24s; } .tut-card:nth-child(4) { animation-delay: .36s; }
.tut-card .ill { height: 160px; border-radius: 10px; background: var(--paper-2); border: 2.5px solid var(--ink); display: grid; place-items: center; margin-bottom: 20px; overflow: hidden; }
.tut-card .ill svg { width: 82%; height: 82%; }
.tut-card h4 { margin: 0 0 8px; font-family: var(--display); font-weight: 900; font-stretch: 115%; font-size: 30px; }
.tut-card p { margin: 0; font-size: 21px; line-height: 1.3; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.tut-foot { position: absolute; left: 80px; right: 80px; bottom: 70px; display: flex; align-items: center; gap: 24px; font-family: var(--hand); font-size: 32px; }
.tut-bar { flex: 1; height: 16px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--card); }
.tut-bar i { display: block; height: 100%; width: 0; background: var(--red); }

/* ---------- Kunde kommt ---------- */
#s-intro { background: var(--paper); background-image: var(--grain); overflow: hidden; }
.intro-bg-word {
  position: absolute; left: -20px; bottom: -60px; white-space: nowrap;
  font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 330px; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 3px rgba(29,27,24,.08);
}
.intro-order {
  position: absolute; left: 70px; top: 60px;
  font-family: var(--display); font-weight: 900; font-stretch: 120%; font-size: 30px; text-transform: uppercase; letter-spacing: .08em;
  border: 4px solid var(--red); color: var(--red); padding: 8px 18px; border-radius: 8px; transform: rotate(-3deg);
  animation: stampIn .4s cubic-bezier(.3,1.8,.5,1) both;
}
.intro-customer { position: absolute; left: 90px; bottom: 0; width: 470px; height: 470px; animation: walkIn .9s cubic-bezier(.2,1.2,.4,1) .15s both; }
.intro-customer .av-head { animation: bob .9s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes bob { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-1px); } }
@keyframes walkIn { from { transform: translateX(-560px) rotate(-6deg); } to { transform: none; } }
.intro-name {
  position: absolute; left: 470px; bottom: 70px; transform: rotate(-2deg);
  background: var(--ink); color: var(--paper); padding: 8px 16px;
  font-family: var(--display); font-weight: 800; font-size: 24px; border-radius: 6px;
  animation: rise .5s .7s both;
}
.bubble {
  position: absolute; background: var(--card); border: 3.5px solid var(--ink); border-radius: 26px;
  box-shadow: var(--shadow);
  font-family: var(--hand); color: var(--ink);
}
.bubble::after {
  content: ''; position: absolute; width: 34px; height: 34px; background: var(--card);
  border-left: 3.5px solid var(--ink); border-bottom: 3.5px solid var(--ink);
}
.bubble.big { left: 620px; top: 120px; width: 900px; min-height: 200px; padding: 34px 42px; font-size: 50px; line-height: 1.12; animation: pop .35s cubic-bezier(.3,1.6,.5,1) 1s both; }
.bubble.big::after { left: -20px; bottom: 50px; transform: rotate(45deg) skew(10deg, 10deg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stampIn { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } to { transform: rotate(-3deg); opacity: 1; } }

.pricetag {
  position: absolute; left: 700px; top: 520px; width: 800px; padding: 28px 40px 30px 92px;
  background: var(--yellow); border: 3.5px solid var(--ink); border-radius: 14px 40px 40px 14px;
  box-shadow: var(--shadow); transform: rotate(-1.5deg);
  animation: rise .5s cubic-bezier(.2,1.4,.4,1) 1.6s both;
}
.pt-hole { position: absolute; left: 30px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.pt-name { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 76px; letter-spacing: -.02em; line-height: .95; }
.pt-title { font-size: 30px; font-weight: 600; margin-top: 8px; }
.pt-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.barcode { width: 200px; height: 40px; background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px, var(--ink) 5px 6px, transparent 6px 9px, var(--ink) 9px 13px, transparent 13px 15px); }
.pt-pieces { font-family: var(--mono); font-weight: 700; font-size: 22px; }

/* ---------- HUD ---------- */
.order-card {
  position: absolute; left: 22px; top: 16px; width: 430px; height: 112px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-s);
  display: flex; align-items: center; gap: 14px; padding: 0 16px 0 10px;
}
.oc-av { width: 92px; height: 92px; flex: none; border-radius: 50%; background: var(--paper-2); border: 2.5px solid var(--ink); overflow: hidden; }
.oc-av .av-head { animation: tap 0.6s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes tap { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.oc-txt { min-width: 0; }
.oc-count { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--ink-3); letter-spacing: .06em; }
.oc-name { font-family: var(--display); font-weight: 900; font-stretch: 120%; font-size: 30px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-title { font-size: 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bubble.small { left: 120px; top: 140px; max-width: 330px; padding: 12px 20px; font-size: 27px; line-height: 1.1; border-radius: 18px; opacity: 0; transform: scale(.5); transform-origin: 10% 0; transition: opacity .2s, transform .3s cubic-bezier(.3,1.6,.5,1); z-index: 3; }
.bubble.small::after { width: 22px; height: 22px; left: 26px; top: -13px; transform: rotate(135deg); }
.bubble.small.on { opacity: 1; transform: none; }

.timer {
  position: absolute; left: 540px; top: 16px; width: 520px; height: 112px;
  border: 3px solid var(--ink); border-radius: 14px; padding: 10px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, var(--ink) 16px 32px);
  box-shadow: var(--shadow-s);
}
.timer-in { height: 100%; background: var(--ink); border-radius: 6px; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; gap: 6px; }
.timer-digits { font-family: var(--mono); font-weight: 700; font-size: 50px; color: var(--yellow); text-align: center; line-height: 1; letter-spacing: .04em; }
.timer-bar { height: 10px; background: #3a3631; border-radius: 6px; overflow: hidden; }
.timer-bar i { display: block; height: 100%; width: 100%; background: var(--yellow); border-radius: 6px; transform-origin: 0 50%; }
.timer.hurry .timer-digits { color: #ff6a50; animation: hurry .5s ease-in-out infinite; }
.timer.hurry .timer-bar i { background: #ff6a50; }
@keyframes hurry { 50% { transform: scale(1.12); } }

.cash-card {
  position: absolute; right: 22px; top: 16px; width: 430px; height: 112px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-s);
  padding: 12px 18px; display: flex; flex-direction: column; justify-content: space-between;
}
.cc-money { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.cc-money b { font-family: var(--mono); font-size: 30px; color: var(--ink); letter-spacing: 0; margin-left: 6px; }
.cc-ready { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.cc-ready-av { display: flex; }
.cc-ready-av div { width: 38px; height: 38px; margin-left: -10px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--green); overflow: hidden; animation: pop .3s both; }

/* ---------- Abnahme ---------- */
.insp-stamp {
  position: absolute; left: 50%; top: 170px; transform: translateX(-50%) rotate(-4deg);
  font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 96px; letter-spacing: .02em;
  color: var(--red); border: 8px solid var(--red); border-radius: 18px; padding: 4px 34px;
  background: rgba(242,234,219,.85); opacity: 0;
  mix-blend-mode: multiply;
}
.insp-stamp.on { animation: stamp .45s cubic-bezier(.3,1.8,.5,1) forwards; }
@keyframes stamp { from { transform: translateX(-50%) rotate(-14deg) scale(2.6); opacity: 0; } to { transform: translateX(-50%) rotate(-4deg) scale(1); opacity: 1; } }
.insp-stamp.fade { transition: opacity .5s; opacity: 0 !important; animation: none; transform: translateX(-50%) rotate(-4deg); }
.insp-stars { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: flex; gap: 10px; }
.insp-stars svg { width: 96px; height: 96px; filter: drop-shadow(4px 5px 0 var(--ink)); opacity: 0; }
.insp-stars svg.on { animation: starPop .45s cubic-bezier(.3,1.9,.5,1) forwards; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.insp-customer { position: absolute; left: 30px; bottom: 0; width: 360px; height: 360px; transform: translateX(-420px); transition: transform .7s cubic-bezier(.2,1.3,.4,1); }
.insp-customer.on { transform: none; }
.insp-customer.shake .av-head { animation: shakeHead .25s linear infinite; transform-origin: 50% 70%; }
.insp-customer.jump { animation: jump .55s ease-in-out infinite; }
@keyframes shakeHead { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes jump { 0%, 100% { transform: none; } 40% { transform: translateY(-34px); } }
.bubble.mid { left: 300px; top: 470px; width: 520px; padding: 22px 28px; font-size: 38px; line-height: 1.1; opacity: 0; transform: scale(.5); transform-origin: 0 100%; transition: opacity .2s, transform .35s cubic-bezier(.3,1.6,.5,1); }
.bubble.mid::after { left: -20px; bottom: 30px; transform: rotate(45deg); }
.bubble.mid.on { opacity: 1; transform: none; }

.receipt {
  position: absolute; right: 60px; top: 160px; width: 420px;
  background: #fffdf7; padding: 30px 30px 44px;
  font-family: var(--mono); font-weight: 500; font-size: 19px; color: var(--ink);
  filter: drop-shadow(6px 7px 0 rgba(29,27,24,.85));
  transform: translateY(900px) rotate(2deg);
  transition: transform .8s cubic-bezier(.2,1.1,.4,1);
  --zz: 14px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zz)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zz)) 100%;
}
.receipt.on { transform: rotate(2deg); }
.receipt .r-head { text-align: center; font-weight: 700; font-size: 17px; letter-spacing: .04em; border-bottom: 2px dashed var(--ink); padding-bottom: 12px; margin-bottom: 12px; }
.receipt .r-head big { display: block; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 34px; letter-spacing: -.01em; }
.receipt .r-line { display: flex; justify-content: space-between; padding: 4px 0; }
.receipt .r-line.sum { border-top: 2px dashed var(--ink); margin-top: 10px; padding-top: 12px; font-weight: 700; font-size: 30px; }
.receipt .r-line.cash { font-size: 17px; color: var(--ink-2); }
.receipt .r-thanks { text-align: center; margin-top: 18px; font-family: var(--hand); font-size: 26px; }
.receipt .r-code { margin: 14px auto 0; width: 70%; height: 46px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 8px, var(--ink) 8px 9px, transparent 9px 12px); }
.intern-note {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(140px);
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 16px 26px;
  font-size: 26px; display: flex; align-items: center; gap: 16px; box-shadow: 5px 6px 0 var(--red);
  transition: transform .5s cubic-bezier(.2,1.4,.4,1);
}
.intern-note.on { transform: translateX(-50%); }
.intern-note .in-av { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: var(--paper-2); border: 2px solid var(--paper); }

/* ---------- Pausenraum ---------- */
#s-shop { background: var(--paper); background-image: var(--grain); }
.shop-head { position: absolute; left: 80px; top: 60px; right: 80px; }
.shop-head h1 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 92px; letter-spacing: -.03em; line-height: 1; }
.shop-head p { margin: 10px 0 0; font-family: var(--hand); font-size: 34px; color: var(--ink-2); }
.shop-cash { position: absolute; right: 0; top: 18px; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .06em; background: var(--card); border: 3px solid var(--ink); border-radius: 12px; padding: 12px 20px; box-shadow: var(--shadow-s); }
.shop-cash b { font-family: var(--mono); font-size: 36px; letter-spacing: 0; margin-left: 8px; }
.shop-cards { position: absolute; left: 80px; right: 80px; top: 270px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.up-card {
  position: relative; height: 470px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; animation: rise .5s cubic-bezier(.2,1.4,.4,1) both;
}
.up-card:nth-child(2) { animation-delay: .1s; } .up-card:nth-child(3) { animation-delay: .2s; } .up-card:nth-child(4) { animation-delay: .3s; }
.up-card .up-ill { height: 150px; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 12px; display: grid; place-items: center; }
.up-card .up-ill svg { width: 110px; height: 110px; }
.up-card h4 { margin: 18px 0 6px; font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: 30px; line-height: 1.05; }
.up-card p { margin: 0; font-size: 20px; line-height: 1.3; color: var(--ink-2); flex: 1; }
.up-card .up-price { align-self: flex-start; font-family: var(--mono); font-weight: 700; font-size: 28px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 8px; padding: 4px 14px; transform: rotate(-3deg); }
.up-card.cant .up-price { background: var(--paper-3); text-decoration: line-through; }
.up-card .up-votes { position: absolute; left: 18px; right: 18px; bottom: -26px; display: flex; justify-content: center; }
.up-card .up-votes div { width: 50px; height: 50px; margin: 0 -6px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); overflow: hidden; animation: pop .3s cubic-bezier(.3,1.8,.5,1) both; }
.up-card.win { outline: 6px solid var(--green); outline-offset: 6px; }
.up-card.win::after {
  content: attr(data-stamp); position: absolute; left: 50%; top: 20%; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 40px; color: var(--green); border: 6px solid var(--green); padding: 4px 16px; border-radius: 10px; background: rgba(251,247,238,.9);
  animation: stampIn2 .4s cubic-bezier(.3,1.8,.5,1) both;
}
@keyframes stampIn2 { from { transform: translate(-50%, -50%) rotate(-30deg) scale(2.5); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-12deg); opacity: 1; } }
.up-card.lose { opacity: .45; }
.shop-result { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; font-family: var(--hand); font-size: 40px; }
.shop-bar { position: absolute; left: 80px; right: 80px; bottom: 40px; height: 12px; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--card); }
.shop-bar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: 0 50%; }

/* ---------- Feierabend ---------- */
#s-final { background: var(--paper); background-image: var(--grain); }
.final-head { position: absolute; left: 70px; top: 44px; }
.final-head h1 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 96px; letter-spacing: -.035em; line-height: .95; text-shadow: 6px 6px 0 var(--red); }
.final-head p { margin: 8px 0 0; font-family: var(--hand); font-size: 30px; color: var(--ink-2); }
.final-score { position: absolute; left: 70px; top: 228px; width: 560px; display: grid; gap: 18px; }
.fs-block { background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-s); padding: 14px 20px; }
.fs-label { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.fs-stars { font-size: 52px; margin-top: 4px; }
.fs-stars .stars svg { filter: drop-shadow(2px 3px 0 var(--ink)); }
.fs-avg { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--ink-2); }
.fs-money { font-family: var(--mono); font-weight: 700; font-size: 54px; }
.fs-block.rank { background: var(--ink); color: var(--paper); }
.fs-block.rank .fs-label { color: var(--yellow); }
.fs-rank { font-family: var(--display); font-weight: 900; font-stretch: 118%; font-size: 40px; line-height: 1.05; margin-top: 4px; }
.final-awards { position: absolute; left: 680px; top: 228px; right: 60px; }
.award-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award-list.many { grid-template-columns: 1fr 1fr 1fr; }
.award-list.many .award { min-height: 70px; padding: 6px 10px 6px 6px; gap: 10px; }
.award-list.many .a-av { width: 48px; height: 48px; }
.award-list.many .a-title { font-size: 18px; }
.award-list.many .a-desc { font-size: 13px; }
.award { display: flex; align-items: center; gap: 14px; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px 8px 8px; box-shadow: var(--shadow-s); animation: rise .5s both; min-height: 82px; }
.award .a-av { width: 62px; height: 62px; flex: none; border-radius: 50%; overflow: hidden; background: var(--paper-2); border: 2.5px solid var(--ink); }
.award .a-name { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.award .a-title { font-family: var(--display); font-weight: 900; font-stretch: 110%; font-size: 23px; line-height: 1.05; }
.award .a-desc { font-size: 16px; color: var(--ink-2); }
.final-catalog { position: absolute; left: 680px; right: 60px; bottom: 128px; }
.catalog { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-item { background: var(--card); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-s); animation: rise .5s both; }
.cat-item canvas { display: block; width: 100%; height: 108px; background: var(--paper-2); border-bottom: 2.5px solid var(--ink); }
.cat-item .ci-name { font-family: var(--display); font-weight: 900; font-stretch: 110%; font-size: 14px; padding: 6px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-item .ci-stars { padding: 2px 8px 8px; font-size: 14px; }
.btn.again { position: absolute; right: 60px; bottom: 30px; padding: 16px 34px; font-size: 26px; }

/* ---------- Chaos-Banner ---------- */
.chaos-banner {
  position: absolute; left: 0; right: 0; top: 330px; height: 210px; display: none; z-index: 20;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 30px, var(--ink) 30px 60px);
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  transform: rotate(-2.5deg) scaleX(1.05);
}
.chaos-banner.on { display: block; animation: bannerIn .5s cubic-bezier(.2,1.5,.4,1) both; }
.chaos-banner.out { animation: bannerOut .35s ease-in both; display: block; }
@keyframes bannerIn { from { transform: rotate(-2.5deg) scaleX(1.05) translateX(-110%); } to { transform: rotate(-2.5deg) scaleX(1.05); } }
@keyframes bannerOut { to { transform: rotate(-2.5deg) scaleX(1.05) translateX(110%); } }
.cb-in { position: absolute; left: 230px; right: 230px; top: 26px; bottom: 26px; background: var(--ink); color: var(--paper); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.cb-title { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 76px; color: var(--yellow); letter-spacing: -.01em; line-height: 1; animation: shake .12s linear 6; }
.cb-sub { font-size: 28px; margin-top: 10px; font-weight: 600; }
@keyframes shake { 25% { transform: translate(3px, -2px) rotate(1deg); } 75% { transform: translate(-3px, 2px) rotate(-1deg); } }

/* Stromausfall */
#blackout { position: absolute; inset: 0; z-index: 15; pointer-events: none; display: none; --fx: 50%; --fy: 50%;
  background: radial-gradient(circle at var(--fx) var(--fy), rgba(10,9,8,0) 0 110px, rgba(10,9,8,.55) 150px, rgba(10,9,8,.985) 230px); }
#blackout.on { display: block; animation: flicker .5s steps(2) 1; }
@keyframes flicker { 0% { opacity: 0; } 20% { opacity: 1; } 40% { opacity: .2; } 60% { opacity: 1; } 80% { opacity: .5; } 100% { opacity: 1; } }

/* Toasts */
#toasts { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 25; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px 22px; font-size: 24px; font-weight: 600; box-shadow: 4px 5px 0 var(--red); animation: toastIn .35s cubic-bezier(.2,1.5,.4,1) both; display: flex; align-items: center; gap: 12px; }
.toast .t-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--paper-2); }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(30px); opacity: 0; } }

/* Ecke */
.corner { position: absolute; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 14px; z-index: 30; }
#stage:not(.ctrl-on) .ctrl .ctrl-btn:not(#btnMenu) { display: none; }
#stage.ctrl-on.final .corner { bottom: auto; top: 18px; }
.ctrl { display: flex; gap: 8px; opacity: .55; transition: opacity .2s; }
.ctrl:hover { opacity: 1; }
.ctrl-btn { width: 46px; height: 46px; border: 2.5px solid var(--ink); background: var(--card); border-radius: 10px; font-family: var(--display); font-weight: 900; font-size: 15px; display: grid; place-items: center; padding: 0; }
.ctrl-btn svg { width: 22px; height: 22px; }
.btn.next { font-size: 20px; padding: 12px 22px; pointer-events: auto; }
.btn.next kbd { font-family: var(--mono); font-size: 14px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 5px; padding: 0 6px; }
.conn-lost { position: absolute; left: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 50%; border: 3px solid var(--ink); font-size: 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Regeln-Link in der Lobby ---------- */
.rules-link { margin-top: 16px; display: inline-flex; align-items: center; gap: 10px; border: 2.5px solid var(--ink); background: var(--card); border-radius: 999px; padding: 7px 16px 7px 10px; font-family: var(--display); font-weight: 800; font-size: 17px; box-shadow: 2px 3px 0 var(--ink); }
.rules-link svg { width: 24px; height: 24px; }
.rules-link:hover { background: var(--yellow); }
kbd { font-family: var(--mono); font-size: 13px; font-weight: 700; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 5px; padding: 0 6px; }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 45; background: rgba(29,27,24,.55); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s both; }
@keyframes fadeIn { from { opacity: 0; } }
.ov-card { position: relative; background: var(--paper); background-image: var(--grain); border: 3.5px solid var(--ink); border-radius: 22px; box-shadow: 8px 9px 0 var(--ink); animation: rise .35s cubic-bezier(.2,1.4,.4,1) both; }
.ov-x { position: absolute; right: 18px; top: 18px; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); font-size: 22px; font-weight: 900; box-shadow: 2px 3px 0 var(--ink); }
.ov-x:hover { background: var(--yellow); }
.rules-card { width: 1380px; height: 820px; overflow: hidden; }
.rules-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 40px 60px 0 50px; scroll-behavior: smooth; }
.rules-scroll::-webkit-scrollbar { width: 14px; }
.rules-scroll::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 8px; border: 4px solid var(--paper); }
.rules-scroll .rb-toc { top: 0; }
.menu-card { width: 620px; padding: 38px 40px 34px; }
.menu-card h2 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 56px; letter-spacing: -.02em; }
.menu-running { margin: 4px 0 22px; font-family: var(--hand); font-size: 24px; color: var(--ink-2); }
.menu-list { display: grid; gap: 12px; }
.mbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; position: relative; border: 3px solid var(--ink); border-radius: 14px; background: var(--card); padding: 14px 18px; box-shadow: 3px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.mbtn:active { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--ink); }
.mbtn b { font-family: var(--display); font-weight: 900; font-size: 24px; }
.mbtn small { font-size: 16px; color: var(--ink-2); }
.mbtn kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.mbtn:hover { background: var(--yellow); }
.mbtn.warn:hover { background: #FFD9A8; }
.mbtn.danger { background: var(--red); color: #fff; }
.mbtn.danger small { color: #ffe3dd; }
.mbtn.danger:hover { background: var(--red-d); }
.mbtn.armed { animation: armed .35s ease-in-out infinite alternate; }
@keyframes armed { to { box-shadow: 0 0 0 5px var(--yellow), 2px 3px 0 var(--ink); } }

/* ---------- Geschlossen ---------- */
#s-closed { background: var(--paper); background-image: var(--grain); z-index: 44; }
.closed-sign { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.cs-string { width: 260px; height: 110px; border: 4px solid var(--ink); border-bottom: 0; border-radius: 130px 130px 0 0; position: relative; }
.cs-string::before { content: ''; position: absolute; left: 50%; top: -18px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--ink); }
.cs-board { width: 860px; background: var(--red); color: #fff; border: 4px solid var(--ink); border-radius: 20px; box-shadow: 9px 10px 0 var(--ink); padding: 40px 50px 46px; text-align: center; transform-origin: 50% -110px; animation: swing 3.2s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.cs-small { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 22px; letter-spacing: .2em; opacity: .85; }
.cs-title { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 86px; letter-spacing: -.035em; line-height: .95; margin: 14px 0 18px; text-shadow: 5px 5px 0 var(--ink); }
.cs-sub { font-family: var(--hand); font-size: 36px; }
.cs-btn { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); }
.cs-btn:active { transform: translateX(-50%) translate(4px, 5px); }

#stage.is-closed .corner { display: none; }
