:root {
  --red: #e8402a;
  --red-d: #a8241a;
  --yellow: #ffd02a;
  --yellow-d: #d89a10;
  --blue: #2a7ae8;
  --ink: #2a1a20;
  --paper: #fff8e8;
  --green: #3ab04a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a0e20; font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); touch-action: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#touch { position: fixed; inset: 0; z-index: 1; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* Buttons */
.btn {
  font-family: 'Luckiest Guy', 'Nunito', sans-serif; letter-spacing: 1px;
  background: linear-gradient(#ffe25a, var(--yellow) 55%, var(--yellow-d));
  color: var(--ink); border: 3px solid var(--ink); border-radius: 16px;
  padding: 10px 18px; font-size: 20px; box-shadow: 0 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.big { font-size: 34px; padding: 12px 44px; background: linear-gradient(#ff7a5a, var(--red) 55%, var(--red-d)); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.green { background: linear-gradient(#7ae86a, var(--green) 55%, #1a7a2a); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.blue { background: linear-gradient(#7ab8ff, var(--blue) 55%, #1a4aa8); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.mini { font-size: 15px; padding: 6px 12px; box-shadow: 0 3px 0 var(--ink); border-radius: 12px; }
.btn.off { filter: grayscale(1) brightness(.85); }
.btn:disabled { filter: grayscale(1); opacity: .6; }
.btn.back { width: 46px; height: 46px; padding: 0; font-size: 34px; line-height: 40px; border-radius: 50%; }

/* Screens */
.screen { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; padding-top: var(--safe-t); }
#scr-title { align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, rgba(255,208,42,.0) 0 22%, rgba(0,0,0,.25) 70%); }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; width: 100%; max-width: 480px; }
.logo { font-family: 'Luckiest Guy', sans-serif; text-align: center; line-height: .85; transform: rotate(-4deg); filter: drop-shadow(0 6px 0 var(--ink)); }
.logo span { display: block; -webkit-text-stroke: 3px var(--ink); }
.logo .l1 { font-size: clamp(54px, 17vw, 96px); color: var(--yellow); }
.logo .l2 { font-size: clamp(64px, 21vw, 118px); color: var(--red); margin-left: 20px; }
#lineup { display: flex; justify-content: center; gap: 2px; margin: 4px 0; flex-wrap: nowrap; }
#lineup img { width: 54px; height: 54px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fine { color: #fff; font-size: 12px; opacity: .85; text-align: center; text-shadow: 1px 1px 0 #000; margin: 4px 0 0; }

.scr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--red); border-bottom: 4px solid var(--ink); margin-top: 54px; }
.scr-head h2 { font-family: 'Luckiest Guy', sans-serif; color: #fff; margin: 0; font-size: 24px; text-shadow: 2px 2px 0 var(--ink); flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hstars { color: var(--yellow); font-weight: 900; min-width: 46px; text-align: right; text-shadow: 1px 1px 0 var(--ink); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(24px + var(--safe-b)); touch-action: pan-y; background: rgba(255,248,232,.92); }

/* Statusleiste */
#topbar { position: fixed; top: calc(8px + var(--safe-t)); left: 0; right: 0; z-index: 8; display: flex; justify-content: center; gap: 8px; pointer-events: auto; }
.pill { background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; padding: 3px 12px 3px 6px; display: flex; align-items: center; gap: 6px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); font-size: 16px; }
.pill small { font-size: 11px; color: #a04030; }
.ico { font-size: 18px; }
.coin-ico { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff2a0, #ffc823 45%, #c88a10); border: 2px solid #8a5a10; }

/* Episodenliste */
.ep-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 10px; margin-bottom: 12px; box-shadow: 0 4px 0 var(--ink); position: relative; }
.ep-card.locked { filter: grayscale(.9); opacity: .65; }
.ep-card img { width: 64px; height: 64px; border-radius: 14px; border: 3px solid var(--ink); flex: none; }
.ep-card .num { font-family: 'Luckiest Guy'; font-size: 13px; color: var(--red); }
.ep-card h3 { margin: 0; font-family: 'Luckiest Guy', sans-serif; font-weight: normal; font-size: 19px; line-height: 1.1; }
.ep-card .meta { font-size: 13px; color: #6a5a5a; }
.ep-card .st { margin-left: auto; font-weight: 900; color: var(--yellow-d); white-space: nowrap; }
.ep-card .lock { position: absolute; right: 12px; top: 10px; font-size: 22px; }

.ep-banner { display: flex; gap: 12px; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 10px; margin-bottom: 8px; }
.ep-banner img { width: 76px; height: 76px; border-radius: 14px; border: 3px solid var(--ink); }
.ep-banner p { margin: 0 0 8px; font-size: 14px; }

#levelMap { position: relative; margin: 0 auto; max-width: 420px; }
.lvl-node { position: absolute; width: 66px; height: 66px; margin-left: -33px; border-radius: 50%; border: 4px solid var(--ink); background: linear-gradient(#ffe25a, var(--yellow-d)); font-family: 'Luckiest Guy'; font-size: 24px; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--ink); color: var(--ink); }
.lvl-node.locked { background: #b8b0a8; color: #6a6060; }
.lvl-node.next { animation: pulse 1s infinite; background: linear-gradient(#ff8a6a, var(--red)); color: #fff; }
.lvl-node .s { position: absolute; bottom: -20px; font-size: 15px; letter-spacing: -2px; color: #ccc; text-shadow: 1px 1px 0 var(--ink); }
.lvl-node .s b { color: var(--yellow); }
.lvl-node .cardmark { position: absolute; top: -10px; right: -8px; font-size: 18px; }
.lvl-path { position: absolute; left: 0; top: 0; pointer-events: none; }
@keyframes pulse { 50% { scale: 1.1; } }

/* Figuren / Album / Shop */
.hero-card, .shop-item, .album-ep { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 12px; margin-bottom: 12px; box-shadow: 0 4px 0 var(--ink); }
.hero-card { display: flex; gap: 12px; align-items: center; }
.hero-card img { width: 80px; height: 80px; border-radius: 16px; border: 3px solid var(--ink); flex: none; }
.hero-card h3, .shop-item h3, .album-ep h3 { margin: 0 0 4px; font-family: 'Luckiest Guy'; font-weight: normal; font-size: 20px; }
.hero-card p, .shop-item p { margin: 2px 0; font-size: 14px; }
.hero-card.locked img { filter: brightness(0); }
.shop-item { display: flex; align-items: center; gap: 12px; }
.shop-item .big-ico { font-size: 34px; }
.shop-item .lvls { display: flex; gap: 4px; margin-top: 4px; }
.shop-item .lvls i { width: 18px; height: 10px; border: 2px solid var(--ink); border-radius: 4px; background: #ddd; }
.shop-item .lvls i.on { background: var(--green); }
.shop-item .btn { margin-left: auto; white-space: nowrap; font-size: 16px; }
.album-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.acard { aspect-ratio: 3/4; border: 3px solid var(--ink); border-radius: 8px; background: #cfc6bc; display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; position: relative; }
.acard.got { background: linear-gradient(160deg, #ff8a6a, var(--red)); }
.acard.got img { width: 100%; height: 100%; object-fit: cover; }
.acard.got span { position: absolute; bottom: 0; left: 0; right: 0; font-size: 8px; line-height: 1.1; background: rgba(0,0,0,.6); color: #fff; padding: 2px; text-align: center; }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 4; pointer-events: none; padding-top: var(--safe-t); }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 10px 0; gap: 6px; }
.hud-obj, .hud-coins { background: rgba(30,18,24,.72); color: #fff; border-radius: 14px; padding: 5px 10px; display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 18px; border: 2px solid rgba(255,255,255,.25); min-width: 84px; }
.hud-obj.done { background: rgba(40,140,60,.85); }
#hudObjIco { font-size: 22px; }
.hud-score { text-align: center; background: rgba(30,18,24,.72); border-radius: 14px; padding: 2px 12px 4px; border: 2px solid rgba(255,255,255,.25); }
.hud-stars i { font-style: normal; font-size: 24px; color: #6a6060; -webkit-text-stroke: 1px #000; }
.hud-stars i.on { color: var(--yellow); }
#hudScore { display: block; color: #fff; font-size: 16px; margin-top: -4px; }
.hud-coins { justify-content: flex-end; }
.hud-progress { position: relative; margin: 8px auto 0; width: 60%; max-width: 300px; height: 8px; background: rgba(0,0,0,.4); border-radius: 6px; border: 2px solid rgba(255,255,255,.3); }
#hudProg { height: 100%; width: 0; background: var(--yellow); border-radius: 6px; }
#hudProgHero { position: absolute; top: -10px; left: 0; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; border: 2px solid #fff; background-size: cover; }
.hud-progress::after { content: '🏠'; position: absolute; right: -24px; top: -8px; font-size: 18px; }
.hud-power { position: absolute; top: calc(108px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: rgba(30,18,24,.72); padding: 4px 10px; border-radius: 12px; }
.hud-power .bar { width: 120px; height: 10px; background: #444; border-radius: 5px; overflow: hidden; }
#hudPowerBar { height: 100%; background: linear-gradient(90deg, #7ae86a, #ffd02a); }
#hudPowerIco { font-size: 20px; }
.hud-thief { position: absolute; top: 36%; left: 50%; transform: translateX(-50%); font-family: "Luckiest Guy"; color: #fff; font-size: 17px; max-width: 92vw; background: var(--red); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; animation: pulse .6s infinite; white-space: nowrap; }
.hud-pause { pointer-events: auto; position: absolute; left: 12px; bottom: calc(14px + var(--safe-b)); width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; border: 3px solid var(--ink); font-size: 18px; font-weight: 900; box-shadow: 0 4px 0 var(--ink); }
.hud-ability { pointer-events: auto; position: absolute; right: 12px; bottom: calc(14px + var(--safe-b)); width: 86px; height: 86px; border-radius: 50%; border: none; background: none; padding: 0; }
.hud-ability svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hud-ability .ring-bg { fill: rgba(30,18,24,.75); stroke: rgba(255,255,255,.25); stroke-width: 8; }
.hud-ability .ring { fill: none; stroke: var(--yellow); stroke-width: 8; stroke-dasharray: 276.5; stroke-dashoffset: 276.5; stroke-linecap: round; }
.hud-ability img { position: absolute; left: 13px; top: 13px; width: 60px; height: 60px; border-radius: 50%; filter: grayscale(.8) brightness(.8); }
.hud-ability.ready img { filter: none; }
.hud-ability.ready { animation: pulse .7s infinite; }
.hud-ability.ready .ring-bg { fill: rgba(255,208,42,.5); }
.hud-ability.active .ring { stroke: #7ae86a; }
.hud-ability.disabled { opacity: .35; }

.bubble { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); max-width: 86%; background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 8px 14px 8px 8px; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 16px; box-shadow: 0 4px 0 var(--ink); animation: pop .25s; }
.bubble img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.bubble.chaser { background: #ffe0d8; }
@keyframes pop { from { transform: translateX(-50%) scale(.3); } to { transform: translateX(-50%) scale(1); } }
#floaters { position: absolute; left: 0; right: 0; top: 42%; text-align: center; }
.floater { position: absolute; left: 50%; transform: translateX(-50%); font-family: 'Luckiest Guy'; font-size: 26px; color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); animation: floatUp 1s forwards; white-space: nowrap; }
@keyframes floatUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -70px; } }
#flash { position: fixed; inset: 0; background: #ff2a2a; opacity: 0; pointer-events: none; z-index: 6; transition: opacity .3s; }
.tip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #fff; font-family: 'Luckiest Guy'; font-size: 24px; text-shadow: 2px 2px 0 #000; }
.tip .hand { font-size: 56px; }
.tip .hand.lr { animation: swLR 1s infinite; }
.tip .hand.up { animation: swUp 1s infinite; }
.tip .hand.down { animation: swDown 1s infinite; }
@keyframes swLR { 0%,100% { transform: translateX(-50px); } 50% { transform: translateX(50px); } }
@keyframes swUp { from { transform: translateY(40px); opacity: 1; } to { transform: translateY(-40px); opacity: .2; } }
@keyframes swDown { from { transform: translateY(-40px); opacity: 1; } to { transform: translateY(40px); opacity: .2; } }

/* Modal */
#modal { position: fixed; inset: 0; z-index: 20; background: rgba(20,10,20,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal .card { background: var(--paper); border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); width: 100%; max-width: 400px; max-height: 92vh; overflow-y: auto; padding: 18px 16px; text-align: center; animation: popIn .25s; }
@keyframes popIn { from { transform: scale(.6); } to { transform: scale(1); } }
.card h2 { font-family: 'Luckiest Guy'; font-weight: normal; font-size: 30px; margin: 0 0 6px; color: var(--red); -webkit-text-stroke: 1px var(--ink); }
.card .sub { font-size: 14px; margin: 0 0 10px; }
.obj-box { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px; margin: 10px 0; font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 10px; justify-content: center; }
.obj-box .big-ico { font-size: 32px; }
.star-req { display: flex; justify-content: center; gap: 12px; font-size: 13px; margin: 6px 0 10px; }
.star-req div { background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px; }
.star-req b { color: var(--yellow-d); }
.boosters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.booster { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 4px; font-size: 12px; font-weight: 900; }
.booster.on { background: #c8f5b8; }
.booster .bi { font-size: 26px; display: block; }
.booster .bc { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 2px; }
.booster .bc .coin-ico { width: 14px; height: 14px; }
.big-stars { font-size: 56px; letter-spacing: 4px; margin: 4px 0; }
.big-stars i { font-style: normal; color: #bbb; -webkit-text-stroke: 2px var(--ink); display: inline-block; transform: scale(0); animation: starIn .4s forwards; }
.big-stars i.on { color: var(--yellow); }
@keyframes starIn { to { transform: scale(1); } }
.res-line { display: flex; justify-content: space-between; font-weight: 900; font-size: 17px; padding: 4px 8px; border-bottom: 2px dashed #d8c8b8; }
.btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.wheel-wrap { position: relative; width: 260px; height: 260px; margin: 10px auto; }
.wheel-wrap canvas { width: 100%; height: 100%; }
.wheel-wrap .ptr { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 34px; filter: drop-shadow(0 2px 0 var(--ink)); }
.story { font-size: 16px; line-height: 1.4; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 12px; margin: 10px 0; }
.vs { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Luckiest Guy'; font-size: 28px; color: var(--red); }
.vs img { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--ink); background: #fff; }
.card-show img { width: 150px; border-radius: 12px; border: 4px solid var(--ink); }

#loading { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle, #ff6a4a, #a8241a); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 900; }
#loading.gone { opacity: 0; pointer-events: none; transition: opacity .4s; }

@media (min-aspect-ratio: 4/3) {
  .scroll { max-width: 640px; width: 100%; margin: 0 auto; }
  .scr-head { justify-content: center; }
}

/* ===== Zynga-Stil: türkise Panels ===== */
:root { --teal: #2a8a8c; --teal-d: #1d6668; --teal-l: #3aa6a8; }
#modal .card { background: linear-gradient(#36a2a4, var(--teal) 30%, var(--teal-d)); color: #fff; border-color: #0e3a3c; box-shadow: 0 8px 0 #0e3a3c, inset 0 2px 0 rgba(255,255,255,.3); position: relative; padding-top: 26px; }
#modal .card h2 { color: var(--yellow); -webkit-text-stroke: 1.5px #0e3a3c; text-shadow: 0 3px 0 #0e3a3c; }
#modal .card .sub { color: #e8fbfb; }
#modal .card .sub b { color: var(--yellow); }
#modal .obj-box, #modal .story, #modal .star-req div { background: rgba(0,0,0,.22); border-color: #0e3a3c; color: #fff; }
#modal .obj-box small { color: var(--yellow); font-family: 'Luckiest Guy'; font-size: 16px; }
#modal .booster { background: rgba(255,255,255,.92); color: var(--ink); }
#modal .res-line { border-bottom-color: rgba(255,255,255,.25); }
.ribbon { position: relative; margin: -44px auto 4px; width: 210px; background: linear-gradient(#ff5a4a, #c8241a); color: #fff; font-family: 'Luckiest Guy'; font-size: 30px; padding: 6px 0 4px; border: 3px solid #5a0a0a; border-radius: 6px; text-shadow: 2px 2px 0 #5a0a0a; transform: rotate(-3deg); box-shadow: 0 4px 0 #5a0a0a; }
.ribbon::before, .ribbon::after { content: ''; position: absolute; top: 10px; width: 22px; height: 100%; background: #a81a10; z-index: -1; border: 3px solid #5a0a0a; }
.ribbon::before { left: -18px; } .ribbon::after { right: -18px; }
.lvl-stars { font-size: 44px; line-height: 1; margin-top: 4px; }
.lvl-stars i { font-style: normal; color: rgba(0,0,0,.3); -webkit-text-stroke: 2px #0e3a3c; }
.lvl-stars i.on { color: var(--yellow); }
.slots { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px auto 2px; background: #222a2a; border: 4px solid #0e3a3c; border-radius: 14px; padding: 8px; width: fit-content; }
.slots .reel { order: 0; width: 70px; height: 70px; background: linear-gradient(#555, #333 40%, #333 60%, #555); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 32px; color: #ccc; font-family: 'Luckiest Guy'; border: 2px solid #111; }
.slots #r0 { order: 0; } .slots #r1 { order: 1; } .slots #r2 { order: 2; } .slots .spin { order: 3; }
.slots .reel small { font-size: 11px; color: #fff; font-family: Nunito; font-weight: 900; }
.slots .reel.won { background: linear-gradient(#ffe25a, #d89a10); color: var(--ink); }
.slots .reel.spinning { animation: shakeR .1s infinite; }
@keyframes shakeR { 50% { transform: translateY(3px); } }
.slots .spin { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff7a6a, #c8241a); color: #fff; font-family: 'Luckiest Guy'; font-size: 18px; border: 4px solid #5a0a0a; box-shadow: 0 4px 0 #5a0a0a; }
.slots .spin:disabled { filter: grayscale(.7); }
.slots .spin:active { transform: translateY(3px); box-shadow: 0 1px 0 #5a0a0a; }
.tiny { font-size: 12px !important; margin-top: 2px !important; }
.btn.run { font-size: 40px; padding: 8px 56px; background: linear-gradient(#ffe25a, var(--yellow) 55%, var(--yellow-d)); color: #c8241a; text-shadow: 2px 2px 0 #fff; }
.hud-fork { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-family: 'Luckiest Guy'; color: #fff; font-size: 18px; background: rgba(42,138,140,.92); border: 3px solid #0e3a3c; border-radius: 14px; padding: 6px 14px; white-space: nowrap; animation: pulse .6s infinite; }
.scr-head { background: linear-gradient(#36a2a4, var(--teal-d)); border-bottom-color: #0e3a3c; }
.scr-head h2 { color: var(--yellow); text-shadow: 2px 2px 0 #0e3a3c; }
.scroll { background: linear-gradient(rgba(42,138,140,.88), rgba(29,102,104,.94)); }
.ep-card, .hero-card, .shop-item, .album-ep, .ep-banner { background: linear-gradient(#fff, #e8f6f6); border-color: #0e3a3c; box-shadow: 0 4px 0 #0e3a3c; }
.album-ep { background: linear-gradient(#b8241a, #7a0a0a); color: #fff; }
.album-ep h3 { color: var(--yellow); text-align: center; }
.album-ep h3 small { color: #fff; font-family: Nunito; font-size: 13px; }
.album-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acard { background: #4a1010; color: #8a5050; border-color: #2a0505; }
.pill { border-color: #0e3a3c; box-shadow: 0 3px 0 #0e3a3c; }
