/* =========================================================
   POTATO RUNNERS – Oberfläche
   Layout: Vollbild-3D-Bühne, darüber dicke Cartoon-Panels
   (eine bewusst einheitliche, helle Optik – kein Dark-Mode)
   ========================================================= */
:root {
  --ketchup: #e8352b;
  --ketchup-d: #b8231b;
  --fry: #ffc93c;
  --fry-d: #e09a0c;
  --potato: #d9a35f;
  --crust: #3b1f0e;
  --cream: #fff6e3;
  --cream-2: #ffe9c2;
  --lettuce: #4fb83e;
  --lettuce-d: #2f8a24;
  --ice: #2fb4e8;
  --ink: #3b1f0e;
  --font-display: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --font-body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --r: 18px;
  --edge: 3px solid var(--crust);
  --lift: 0 5px 0 var(--crust);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffe6c2; color: var(--ink); font-family: var(--font-body); font-weight: 800; }
body { touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, .tab:focus-visible, input:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Bildschirme ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + var(--safe-t)) max(16px, var(--safe-r)) calc(14px + var(--safe-b)) max(16px, var(--safe-l));
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s;
}
.screen.show { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.screen.show > * { pointer-events: auto; }
.screen.dim { background: rgba(59, 31, 14, 0.45); justify-content: center; backdrop-filter: blur(3px); }
.hud.show > * { pointer-events: none; }
.hud.show #btn-pause, .hud.show #btn-board, .hud.show .hud-right { pointer-events: auto; }

/* ---------- Grundbausteine ---------- */
.btn {
  border: var(--edge); border-radius: 16px; background: var(--cream); box-shadow: var(--lift);
  padding: 12px 20px; font-family: var(--font-display); font-size: 20px; letter-spacing: .02em; color: var(--crust);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--crust); }
.btn[disabled] { filter: grayscale(.7) opacity(.7); cursor: not-allowed; }
.btn-green { background: var(--lettuce); color: #fff; text-shadow: 0 2px 0 var(--lettuce-d); }
.btn-red { background: var(--ketchup); color: #fff; text-shadow: 0 2px 0 var(--ketchup-d); }
.btn-ghost { background: rgba(255, 246, 227, .7); }
.icon-btn {
  width: 46px; height: 46px; display: grid; place-items: center; border: var(--edge); border-radius: 14px;
  background: var(--cream); box-shadow: 0 4px 0 var(--crust); padding: 0; transition: transform .08s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--crust); }
.icon-btn svg, .nav-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--crust); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: var(--crust); stroke: none; }
.icon-btn.off { background: #d8cbb4; }
.icon-btn.off svg { opacity: .45; }
.icon-btn.off .wave { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 6px;
  border: var(--edge); border-radius: 999px; background: var(--cream); box-shadow: 0 3px 0 var(--crust);
  font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pill small { font-family: var(--font-body); font-size: 12px; font-weight: 900; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.pill.best { padding-left: 14px; }
.ico-coin {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-block; position: relative;
  background: radial-gradient(circle at 38% 34%, #fff3a6 0 18%, #ffcb2e 45%, #d68a00 100%);
  border: 2px solid #b86f00;
}
.ico-coin::after { content: ''; position: absolute; left: 30%; top: 22%; width: 42%; height: 56%; border-radius: 50%; background: #e09a0c; transform: rotate(20deg); }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 1px; border: 2px solid var(--crust); border-bottom-width: 4px;
  border-radius: 7px; background: var(--cream); font-family: var(--font-body); font-size: 12px; font-weight: 900; text-align: center;
}
.card {
  background: var(--cream); border: 4px solid var(--crust); border-radius: 26px; box-shadow: 0 8px 0 var(--crust), 0 18px 40px rgba(59, 31, 14, .35);
  padding: 22px; width: min(440px, 100%);
  animation: pop-in .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
.card h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; text-align: center; letter-spacing: .02em; }
.sub { margin: 4px 0 14px; text-align: center; font-size: 15px; opacity: .8; text-wrap: balance; }
@keyframes pop-in { from { transform: scale(.7) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Ladebildschirm ---------- */
#loading { background: #ffe6c2; justify-content: center; gap: 18px; z-index: 50; }
#loading p { font-size: 18px; margin: 0; }
.load-potato { width: 90px; height: 110px; border-radius: 50% 48% 52% 50% / 55% 55% 45% 45%; background: var(--potato); border: 4px solid var(--crust); position: relative; animation: wobble 0.7s ease-in-out infinite alternate; }
.load-potato span::before, .load-potato span::after { content: ''; position: absolute; top: 38%; width: 14px; height: 18px; border-radius: 50%; background: var(--crust); }
.load-potato span::before { left: 26%; } .load-potato span::after { right: 26%; }
@keyframes wobble { from { transform: rotate(-10deg) translateY(4px); } to { transform: rotate(10deg) translateY(-8px); } }

/* ---------- Menü ---------- */
#scr-menu { justify-content: flex-start; }
#scr-menu .menu-bottom { margin-top: auto; }
.topbar { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-end { margin-left: auto; display: flex; gap: 8px; }
.logo { margin: 8px 0 0; display: flex; flex-direction: column; align-items: center; line-height: .86; font-family: var(--font-display); font-weight: 400; pointer-events: none; }
.logo span { display: flex; }
.logo i { display: inline-block; font-style: normal; animation: letter-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .09s); }
.logo-top i { font-size: clamp(48px, 11vw, 104px); color: var(--fry); -webkit-text-stroke: 3px var(--crust); text-shadow: 0 6px 0 var(--crust), 0 10px 18px rgba(59, 31, 14, .3); paint-order: stroke fill; }
.logo-bottom i { font-size: clamp(38px, 8.4vw, 80px); color: var(--ketchup); -webkit-text-stroke: 3px var(--crust); text-shadow: 0 5px 0 var(--crust), 0 10px 18px rgba(59, 31, 14, .3); paint-order: stroke fill; }
@keyframes letter-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-3deg); } }
.tagline { margin: 10px 0 0; padding: 6px 14px; border-radius: 999px; background: var(--crust); color: var(--cream); font-size: 15px; pointer-events: none; }
.menu-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(560px, 100%); }
.btn-play {
  width: min(360px, 100%); padding: 16px 20px; font-size: 34px; border-width: 4px; border-radius: 22px;
  background: linear-gradient(180deg, #ffd85c 0%, var(--fry) 55%, #f4b21f 100%); box-shadow: 0 7px 0 var(--crust), 0 14px 30px rgba(232, 53, 43, .35);
  animation: pulse 1.6s ease-in-out infinite;
}
.btn-play span { -webkit-text-stroke: 1.5px var(--crust); color: #fff; text-shadow: 0 3px 0 var(--crust); paint-order: stroke fill; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.menu-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; font-size: 16px; min-width: 0; }
.nav-btn .nav-ico { width: 34px; height: 34px; }
.badge { position: absolute; top: -9px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--ketchup); color: #fff; border: 2px solid var(--crust); font-size: 13px; display: grid; place-items: center; animation: pulse 1s infinite; }
.controls-hint { margin: 0; font-size: 12px; text-align: center; opacity: .85; line-height: 2; background: rgba(255, 246, 227, .75); padding: 2px 12px; border-radius: 12px; }

/* ---------- Shop ---------- */
#scr-shop { align-items: flex-end; justify-content: stretch; padding-top: calc(10px + var(--safe-t)); }
.shop-panel {
  width: min(560px, 54%); height: 100%; display: flex; flex-direction: column; min-height: 0;
  background: var(--cream); border: 4px solid var(--crust); border-radius: 26px; box-shadow: 0 8px 0 var(--crust);
  overflow: hidden; animation: slide-in .35s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes slide-in { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.panel-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; text-align: left; }
.tasks-card .panel-head { padding: 0 0 6px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 10px; }
.tab { border: var(--edge); border-radius: 12px; background: var(--cream-2); padding: 8px 4px; font-family: var(--font-display); font-size: 16px; box-shadow: 0 3px 0 var(--crust); }
.tab.on { background: var(--ketchup); color: #fff; text-shadow: 0 2px 0 var(--ketchup-d); }
.shop-body { flex: 1; overflow-y: auto; padding: 4px 14px 14px; min-height: 0; touch-action: pan-y; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.item {
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 6px 8px; min-width: 0;
  border: var(--edge); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--crust); text-align: center;
  transition: transform .1s;
}
.item:hover { transform: translateY(-2px); }
.item.sel { background: #fff3c4; outline: 3px solid var(--ketchup); outline-offset: 2px; }
.item img { width: 100%; aspect-ratio: 1; max-width: 120px; object-fit: contain; border-radius: 10px; background: radial-gradient(circle at 50% 60%, #fff3d6, #ffe0a6); }
.item .nm { font-size: 13px; line-height: 1.15; margin-top: 4px; min-height: 30px; display: grid; place-items: center; }
.item .tag { margin-top: 4px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--cream-2); border: 2px solid var(--crust); font-variant-numeric: tabular-nums; }
.item .tag .ico-coin { width: 16px; height: 16px; border-width: 1.5px; }
.item .tag.own { background: var(--lettuce); color: #fff; }
.item .tag.eq { background: var(--ketchup); color: #fff; }
.item .tag.lock { background: #e8dcc6; }
.item.locked img { filter: grayscale(.85) brightness(.75); }
.shop-detail { border-top: 3px solid var(--crust); padding: 12px 14px calc(12px + var(--safe-b)); background: #fff3d6; display: flex; flex-direction: column; gap: 8px; }
.shop-detail h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.shop-detail p { margin: 0; font-size: 14px; opacity: .85; }
.detail-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-row .btn { margin-left: auto; }
.perk { display: inline-block; padding: 3px 10px; border-radius: 10px; background: var(--crust); color: var(--cream); font-size: 13px; }
.progress { position: relative; height: 16px; border: 2px solid var(--crust); border-radius: 10px; background: #fff; overflow: hidden; flex: 1; min-width: 120px; }
.progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--lettuce), #8ee06a); border-radius: 8px; }
.progress span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 12px; }
.up-list, .extra-list { display: flex; flex-direction: column; gap: 10px; }
.up-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: var(--edge); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--crust); }
.up-ico { width: 52px; height: 52px; border-radius: 14px; border: var(--edge); display: grid; place-items: center; }
.up-ico svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.up-row h4 { margin: 0; font-size: 16px; }
.up-row p { margin: 2px 0 6px; font-size: 12px; opacity: .8; }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 10px; border-radius: 4px; border: 2px solid var(--crust); background: #fff; }
.pips i.on { background: var(--fry); }
.up-row .btn { font-size: 15px; padding: 8px 10px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.up-row .btn .ico-coin { width: 18px; height: 18px; }
.extra-hint { font-size: 13px; opacity: .8; margin: 4px 2px 0; }

/* ---------- Aufgaben ---------- */
#scr-tasks { justify-content: center; }
.tasks-card { width: min(520px, 100%); max-height: 100%; overflow-y: auto; }
.tasks-card h3 { margin: 18px 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: var(--edge); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--crust); }
.task .tier { width: 40px; height: 40px; border-radius: 50%; border: var(--edge); display: grid; place-items: center; font-family: var(--font-display); font-size: 18px; color: #fff; }
.task .tier.t0 { background: var(--lettuce); } .task .tier.t1 { background: var(--ice); } .task .tier.t2 { background: var(--ketchup); }
.task p { margin: 0 0 6px; font-size: 14px; line-height: 1.25; }
.task .btn { font-size: 14px; padding: 8px 10px; display: inline-flex; align-items: center; gap: 4px; }
.task .btn .ico-coin { width: 18px; height: 18px; }
.task.claimed { opacity: .6; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.stats div { padding: 8px 10px; border: 2px solid var(--crust); border-radius: 12px; background: #fff; }
.stats dt { font-size: 12px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- HUD ---------- */
.hud { padding-top: calc(10px + var(--safe-t)); }
.hud-top { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hud-dist { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 4px; font-family: var(--font-display); color: #fff; -webkit-text-stroke: 2px var(--crust); paint-order: stroke fill; text-shadow: 0 4px 0 var(--crust); }
.hud-dist span { font-size: clamp(34px, 7vw, 52px); font-variant-numeric: tabular-nums; }
.hud-dist small { font-size: 24px; }
.hud-dist em { flex-basis: 100%; font-style: normal; font-family: var(--font-body); font-size: 13px; -webkit-text-stroke: 0; color: var(--crust); text-shadow: none; background: rgba(255, 246, 227, .8); border-radius: 8px; padding: 1px 8px; width: max-content; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.pill.big { height: 46px; font-size: 24px; }
.pill b { background: var(--ketchup); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 16px; margin-left: 4px; animation: pulse .6s infinite; }
.coin-bump { animation: bump .18s ease; }
@keyframes bump { 50% { transform: scale(1.12); } }
.hud-pu { position: absolute; left: max(14px, var(--safe-l)); top: calc(110px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }
.pu { display: flex; align-items: center; gap: 8px; animation: pop-in .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.pu .up-ico { width: 40px; height: 40px; border-radius: 12px; }
.pu .up-ico svg { width: 24px; height: 24px; }
.pu .bar { width: 80px; height: 12px; border: 2px solid var(--crust); border-radius: 8px; background: rgba(255, 255, 255, .85); overflow: hidden; }
.pu .bar i { display: block; height: 100%; background: var(--fry); transition: width .1s linear; }
.board-btn {
  position: absolute; right: max(16px, var(--safe-r)); bottom: calc(18px + var(--safe-b)); width: 84px; height: 84px; border-radius: 50%;
  border: var(--edge); background: var(--fry); box-shadow: 0 5px 0 var(--crust); display: grid; place-items: center; padding: 0;
}
.board-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--crust); }
.board-btn .ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.board-btn .ring circle { fill: none; stroke-width: 5; }
.board-btn .ring circle:first-child { stroke: transparent; }
.board-btn .ring circle:last-child { stroke: var(--lettuce); stroke-linecap: round; stroke-dasharray: 182.2; stroke-dashoffset: 182.2; transition: stroke-dashoffset .1s linear; }

.board-btn b { position: absolute; top: -6px; right: -6px; min-width: 30px; height: 30px; border-radius: 15px; background: var(--ketchup); color: #fff; border: var(--edge); font-size: 15px; display: grid; place-items: center; }
.board-btn small { position: absolute; bottom: 9px; font-size: 9px; font-weight: 900; }
.board-btn.empty { filter: grayscale(.8); }
.board-btn.active { animation: pulse .5s infinite; }
.chef-warn {
  position: absolute; left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%) scale(.6); opacity: 0;
  padding: 8px 16px; border-radius: 14px; background: var(--ketchup); color: #fff; border: var(--edge); font-size: 15px; white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.chef-warn.on { opacity: 1; transform: translateX(-50%) scale(1); animation: shake-x .4s infinite; }
@keyframes shake-x { 0%, 100% { margin-left: 0; } 25% { margin-left: -4px; } 75% { margin-left: 4px; } }
.tutorial { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(560px, calc(100% - 140px)); }
.tutorial div { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 12px; background: rgba(255, 246, 227, .92); border: 2px solid var(--crust); font-size: 13px; }

/* ---------- Effekte ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
#fx-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(232, 53, 43, .55) 100%); }
#fx-vignette.on { opacity: 1; animation: vig 0.8s ease-in-out infinite alternate; }
@keyframes vig { from { opacity: .55; } to { opacity: 1; } }
#fx-speed { background: repeating-conic-gradient(from 0deg at 50% 45%, transparent 0deg 7deg, rgba(255, 255, 255, .45) 7.5deg 8deg); -webkit-mask: radial-gradient(circle at 50% 45%, transparent 28%, #000 70%); mask: radial-gradient(circle at 50% 45%, transparent 28%, #000 70%); }
#fx-speed.on { opacity: 1; animation: spin-lines .25s linear infinite; }
@keyframes spin-lines { to { transform: rotate(4deg) scale(1.03); } }
#fx-flash { background: #fff; }
#fx-flash.warn { background: var(--ketchup); }

#toasts { position: absolute; top: calc(90px + var(--safe-t)); left: max(16px, var(--safe-l)); right: max(16px, var(--safe-r)); display: block; text-align: center; pointer-events: none; z-index: 20; }
.toast {
  padding: 8px 16px; border-radius: 14px; border: var(--edge); background: var(--cream); box-shadow: 0 4px 0 var(--crust);
  font-family: var(--font-display); font-size: 20px; text-align: center; display: block; width: -webkit-fit-content; width: fit-content; max-width: 100%; margin: 0 auto 6px; overflow-wrap: anywhere; line-height: 1.2;
  animation: toast-in .35s cubic-bezier(.2, 1.6, .4, 1) both, toast-out .3s ease 1.9s forwards;
}
.toast.power { background: var(--fry); }
.toast.record { background: linear-gradient(90deg, #ffd85c, #fff3a6, #ffd85c); font-size: 28px; }
.toast.warn { background: var(--ketchup); color: #fff; }
.toast.task { background: var(--lettuce); color: #fff; font-family: var(--font-body); font-size: 15px; padding: 8px 14px; }
.toast.board { background: #ffe08a; }
.toast.info { font-family: var(--font-body); font-size: 14px; opacity: .92; }
.toast.biome { font-size: 30px; background: var(--crust); color: var(--fry); border-color: var(--fry); letter-spacing: .03em; animation: toast-in .45s cubic-bezier(.2, 1.6, .4, 1) both, toast-out .4s ease 2.4s forwards; }
@keyframes toast-in { from { transform: translateY(-20px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-14px) scale(.9); opacity: 0; } }

#countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 25; }
#countdown span { font-family: var(--font-display); font-size: 140px; color: var(--fry); -webkit-text-stroke: 5px var(--crust); paint-order: stroke fill; text-shadow: 0 10px 0 var(--crust); animation: cd .9s ease both; }
@keyframes cd { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.7); opacity: 0; } }

/* ---------- Pause & Game Over ---------- */
.small-card { display: flex; flex-direction: column; gap: 12px; width: min(360px, 100%); }
.toggles { display: flex; justify-content: center; gap: 18px; font-size: 15px; margin-top: 4px; }
.toggles input { width: 18px; height: 18px; accent-color: var(--ketchup); vertical-align: -3px; }
.over-card { display: flex; flex-direction: column; gap: 12px; }
.over-title { font-size: 46px !important; color: var(--ketchup); -webkit-text-stroke: 2px var(--crust); paint-order: stroke fill; text-shadow: 0 4px 0 var(--crust); animation: wiggle .6s ease .3s; }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.record-badge { align-self: center; padding: 6px 18px; border-radius: 999px; border: var(--edge); background: linear-gradient(90deg, #ffd85c, #fff3a6, #ffd85c); font-family: var(--font-display); font-size: 22px; animation: pulse .7s infinite; }
.over-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.over-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border: var(--edge); border-radius: 16px; background: #fff; min-width: 0; }
.over-stats small { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.over-stats strong { font-family: var(--font-display); font-weight: 400; font-size: 26px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.over-stats .ico-coin { width: 20px; height: 20px; }
.btn-revive { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ice); color: #fff; text-shadow: 0 2px 0 #1a7aa8; }
.btn-revive em { font-style: normal; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 10px; background: rgba(255, 255, 255, .9); color: var(--crust); text-shadow: none; }
.btn-revive .ico-coin { width: 20px; height: 20px; }
.over-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.mini-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mini-tasks li { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; }
.mini-tasks .progress { min-width: 0; height: 14px; }

/* ---------- Icons & Gerät ---------- */
.nav-ico { display: inline-block; width: 30px; height: 30px; flex: none; }
.nav-ico svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 0 rgba(59, 31, 14, .25)); }
.nav-ico.big { width: 76px; height: 76px; }
.is-mobile .only-desktop, .is-desktop .only-mobile { display: none !important; }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--ketchup); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Spieler-Chip ---------- */
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 3px 14px 3px 3px; max-width: 220px; min-width: 0;
  border: var(--edge); border-radius: 999px; background: var(--cream); box-shadow: 0 3px 0 var(--crust); text-align: left;
}
.player-chip img { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #fff3d6, #ffd98a); border: 2px solid var(--crust); object-fit: cover; flex: none; }
.player-chip span { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.player-chip b { font-family: var(--font-display); font-weight: 400; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-chip small { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Segment-Schalter & Formular ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin: 0 0 12px; border: var(--edge); border-radius: 14px; background: var(--cream-2); }
.seg-btn { position: relative; border: 0; border-radius: 10px; background: transparent; padding: 8px 6px; font-family: var(--font-display); font-size: 17px; }
.seg-btn.on { background: var(--ketchup); color: #fff; box-shadow: 0 3px 0 var(--ketchup-d); }
.mini-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; background: var(--lettuce); color: #fff; font-size: 12px; vertical-align: 2px; }
.login-card { display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); max-height: 100%; overflow-y: auto; }
.login-hero { display: grid; place-items: center; margin-top: -6px; }
.login-hero .nav-ico { animation: wobble .9s ease-in-out infinite alternate; }
#login-form { display: flex; flex-direction: column; gap: 6px; }
#login-form label { font-size: 14px; }
#login-form label small { opacity: .7; }
#login-form input {
  width: 100%; padding: 12px 14px; border: var(--edge); border-radius: 14px; background: #fff; color: var(--ink);
  font: 800 18px var(--font-body); box-shadow: inset 0 3px 0 rgba(59, 31, 14, .08); user-select: text; -webkit-user-select: text;
}
#login-form input#l-pin { letter-spacing: .5em; font-size: 22px; }
.form-msg { min-height: 20px; margin: 2px 0; font-size: 14px; }
.form-msg.bad { color: var(--ketchup-d); }
.fine { margin: 2px 0 0; font-size: 12px; opacity: .75; text-align: center; text-wrap: balance; }
#login-done, #login-form-wrap { display: flex; flex-direction: column; gap: 10px; }
#login-form-wrap[hidden], #login-done[hidden] { display: none; }
.login-card h2 { margin-top: -4px; }

/* ---------- Rangliste ---------- */
#scr-rank { justify-content: center; }
.rank-card { width: min(520px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.rank-card .panel-head { padding: 0 0 4px; }
.rank-list { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; flex: 1; touch-action: pan-y; }
.rank-list li { display: grid; grid-template-columns: 34px 38px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--crust); border-radius: 14px; background: #fff; }
.rank-list li.me { background: #fff3c4; outline: 3px solid var(--ketchup); outline-offset: 1px; }
.rank-list .pos { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); background: var(--cream-2); border: 2px solid var(--crust); }
.rank-list .top0 .pos { background: #ffcb2e; } .rank-list .top1 .pos { background: #d9dee3; } .rank-list .top2 .pos { background: #e09a5a; }
.rank-list img { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #fff3d6, #ffd98a); object-fit: cover; }
.rank-list .nm { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rank-list .val { font-family: var(--font-display); font-size: 18px; font-variant-numeric: tabular-nums; }
.rank-list .rank-empty { display: block; text-align: center; padding: 18px; line-height: 1.5; }
.rank-me { margin-top: 10px; text-align: center; font-size: 15px; }
.rank-me .btn { width: 100%; }
.rank-hint { margin: 0; text-align: center; font-size: 14px; padding: 6px 10px; border-radius: 12px; background: var(--cream-2); }

/* ---------- Challenges ---------- */
.task.ach .medal { width: 40px; height: 40px; border-radius: 50%; border: var(--edge); display: grid; place-items: center; font-size: 20px; color: #fff; background: #cbbfa8; }
.task.ach .medal.ready { background: var(--lettuce); animation: pulse 1s infinite; }
.task.ach .medal.got { background: #ffcb2e; color: var(--crust); }
#tasks-body .sub { margin-top: 0; }
.up-ico.plain { background: #fff3d6; }
.up-ico.plain svg { width: 40px; height: 40px; stroke: none; }
.perk-dot { position: absolute; top: 4px; right: 6px; color: var(--ketchup); font-size: 16px; }

/* ---------- Pommes-Board: auffällig ---------- */
.board-btn { width: 92px; height: 92px; background: radial-gradient(circle at 40% 35%, #ffe78a, var(--fry) 60%, #f0a81a); }
.board-btn .nav-ico { width: 52px; height: 52px; margin-top: -8px; }
.board-btn small { bottom: 8px; font-size: 10px; }
.board-btn.ready { animation: board-glow 1.4s ease-in-out infinite; }
@keyframes board-glow { 0%, 100% { box-shadow: 0 5px 0 var(--crust), 0 0 0 0 rgba(255, 201, 60, .8); } 50% { box-shadow: 0 5px 0 var(--crust), 0 0 0 12px rgba(255, 201, 60, 0); } }
.is-mobile .board-btn { width: 104px; height: 104px; }
.is-mobile .board-btn .nav-ico { width: 60px; height: 60px; }
.board-bar {
  position: absolute; bottom: calc(24px + var(--safe-b)); left: 0; right: 0; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; border: var(--edge); border-radius: 18px; background: linear-gradient(180deg, #fff3b0, var(--fry)); box-shadow: 0 4px 0 var(--crust);
  animation: pop-in .35s cubic-bezier(.2, 1.6, .4, 1) both; width: min(320px, calc(100% - 32px));
}
.board-bar .nav-ico { width: 40px; height: 40px; }
.is-mobile .board-bar { left: max(16px, var(--safe-l)); width: auto; margin: 0; right: calc(136px + var(--safe-r)); }
.board-bar > div { flex: 1; min-width: 0; }
.board-bar b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-bar .bar { height: 10px; border: 2px solid var(--crust); border-radius: 6px; background: #fff; overflow: hidden; margin-top: 2px; }
.board-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ketchup), #ff8a3c); transition: width .1s linear; }
.board-bar span { font-family: var(--font-display); font-size: 22px; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.board-bar.low { animation: shake-x .3s infinite; }
.toast.boardbig { display: flex; align-items: center; gap: 8px; font-size: 30px; background: linear-gradient(90deg, #ffd85c, #fff3a6, #ffd85c); padding: 8px 18px 8px 10px; animation: toast-in .45s cubic-bezier(.2, 1.6, .4, 1) both, toast-out .4s ease 2.4s forwards; }
.toast.boardbig svg { width: 46px; height: 46px; }
#fx-flash.board { background: radial-gradient(circle at 50% 70%, #fff6c0, #ffc93c 60%, rgba(255, 201, 60, 0)); }

/* ---------- Tutorial ---------- */
.tut-step { position: absolute; top: calc(118px + var(--safe-t)); left: 0; right: 0; margin: 0 auto; width: -webkit-fit-content; width: fit-content; display: flex; flex-direction: column; align-items: center; padding: 6px 18px; border-radius: 16px; background: var(--crust); color: var(--cream); border: 3px solid var(--fry); }
.tut-step.pop { animation: pop-in .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.tut-step small { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.tut-step b { font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--fry); }
.tut-prompt {
  position: absolute; left: 0; right: 0; margin: 0 auto; bottom: calc(22px + var(--safe-b)); width: min(440px, calc(100% - 260px));
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 4px solid var(--crust); border-radius: 22px; background: var(--cream);
  box-shadow: 0 6px 0 var(--crust), 0 16px 40px rgba(59, 31, 14, .35); animation: pop-in .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
.tut-prompt p { margin: 0; font-size: 18px; line-height: 1.25; text-wrap: balance; }
.tut-ico { flex: none; display: flex; align-items: center; gap: 4px; min-width: 64px; justify-content: center; position: relative; }
.tut-ico > svg { width: 52px; height: 52px; }
.tut-ico .arrow svg { width: 46px; height: 46px; animation: pulse .7s infinite; }
.tut-ico kbd { font-size: 20px; min-width: 40px; padding: 4px 8px; border-width: 3px; border-bottom-width: 6px; animation: key-press .8s ease-in-out infinite; }
.tut-ico kbd.wide { min-width: 110px; }
@keyframes key-press { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(3px); } }
.tut-ico .hand { position: absolute; width: 40px; height: 40px; right: -6px; bottom: -14px; }
.tut-ico .hand svg { width: 100%; height: 100%; }
.hand.swipe-x { animation: sw-x 1s ease-in-out infinite; } .hand.swipe-up { animation: sw-up 1s ease-in-out infinite; }
.hand.swipe-down { animation: sw-down 1s ease-in-out infinite; } .hand.tap2 { position: static; animation: tap2 1s ease-in-out infinite; }
@keyframes sw-x { 0%, 100% { transform: translateX(-16px); } 50% { transform: translateX(16px); } }
@keyframes sw-up { 0% { transform: translateY(14px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-18px); opacity: 0; } }
@keyframes sw-down { 0% { transform: translateY(-18px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
.is-mobile .tut-prompt, .tut-prompt.top { bottom: auto; top: calc(196px + var(--safe-t)); width: auto; left: max(16px, var(--safe-l)); right: max(16px, var(--safe-r)); max-width: 440px; }
@keyframes tap2 { 0%, 40%, 100% { transform: scale(1); } 15%, 55% { transform: scale(.82); } }

/* ---------- Bereichs-Banner (oben, hochwertig) ---------- */
.zone {
  --zc1: #2a2f36; --zc2: #ffd21f;
  position: absolute; z-index: 22; top: calc(64px + var(--safe-t)); left: 0; right: 0; margin: 0 auto; width: min(440px, calc(100% - 200px));
  display: flex; flex-direction: column; align-items: center; padding: 10px 18px 12px; pointer-events: none;
  background: var(--zc1); color: var(--zc2); border: 4px solid var(--crust); border-radius: 20px;
  box-shadow: 0 6px 0 var(--crust), 0 16px 34px rgba(59, 31, 14, .35); overflow: hidden;
}
.zone.go { animation: zone-in 3s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes zone-in { 0% { transform: translateY(-140%) scale(.8); opacity: 0; } 12% { transform: none; opacity: 1; } 82% { transform: none; opacity: 1; } 100% { transform: translateY(-60%) scale(.9); opacity: 0; } }
.zone-stripe { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .07) 0 14px, transparent 14px 28px); animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 40px 0; } }
.zone small { position: relative; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.zone b { position: relative; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 6vw, 38px); line-height: 1.05; text-align: center; -webkit-text-stroke: 1.5px var(--crust); paint-order: stroke fill; text-shadow: 0 3px 0 var(--crust); }
.zone-speed { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 10px 2px 4px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 14px; }
.zone-speed .nav-ico { width: 22px; height: 22px; }
.zone-speed em { font-style: normal; font-variant-numeric: tabular-nums; }

/* ---------- Meilenstein ---------- */
.milestone { position: absolute; z-index: 21; top: 36%; left: 0; right: 0; margin: 0 auto; width: fit-content; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.milestone b { font-family: var(--font-display); font-weight: 400; font-size: clamp(48px, 13vw, 84px); color: #fff; -webkit-text-stroke: 3px var(--crust); paint-order: stroke fill; text-shadow: 0 6px 0 var(--crust); }
.milestone span { display: inline-flex; align-items: center; gap: 4px; margin-top: -4px; padding: 4px 12px; border-radius: 999px; background: var(--fry); border: 3px solid var(--crust); font-family: var(--font-display); font-size: 22px; }
.milestone em { font-style: normal; }
.milestone.go { animation: ms-in 1.8s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes ms-in { 0% { transform: scale(2.4); opacity: 0; } 15% { transform: scale(1); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-60px) scale(.8); opacity: 0; } }

/* ---------- Aufgaben-Feier ---------- */
.quest-pop { position: absolute; z-index: 30; top: calc(150px + var(--safe-t)); left: 0; right: 0; margin: 0 auto; width: min(420px, calc(100% - 28px)); pointer-events: none; }
.qp-rays { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 210, 31, .5) 0 10deg, transparent 10deg 20deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); opacity: 0; }
.qp-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 4px solid var(--crust); border-radius: 22px;
  background: linear-gradient(160deg, #fff8dc, #ffe58a); box-shadow: 0 7px 0 var(--crust), 0 18px 40px rgba(59, 31, 14, .4);
}
.quest-pop.qp-ach .qp-card { background: linear-gradient(160deg, #fff3c4, #ffc93c 70%, #ff9f2e); }
.qp-stamp { flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--lettuce); border: 4px solid var(--crust); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18); }
.quest-pop.qp-ach .qp-stamp { background: var(--ketchup); }
.qp-stamp svg { width: 46px; height: 46px; fill: none; }
.qp-stamp svg circle { stroke: rgba(255, 255, 255, .45); stroke-width: 3; stroke-dasharray: 4 5; }
.qp-stamp svg path { stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.qp-body { min-width: 0; flex: 1; }
.qp-body small { display: block; font-family: var(--font-display); font-size: 22px; letter-spacing: .02em; color: var(--ketchup-d); }
.qp-body p { margin: 2px 0 6px; font-size: 14px; line-height: 1.25; }
.qp-reward { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qp-coins, .qp-xp { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 4px; border-radius: 999px; background: #fff; border: 2px solid var(--crust); font-family: var(--font-display); font-size: 18px; }
.qp-xp { padding-left: 10px; background: #e6f4ff; }
.qp-coins .ico-coin { width: 22px; height: 22px; }
.qp-reward em { font-style: normal; font-size: 11px; opacity: .7; }
.qp-confetti { position: absolute; left: 50%; top: 40%; }
.qp-confetti i { position: absolute; width: 10px; height: 14px; border-radius: 2px; opacity: 0; }
.quest-pop.go .qp-card { animation: qp-in 3.2s cubic-bezier(.2, 1.4, .4, 1) both; }
.quest-pop.go .qp-rays { animation: qp-rays 3.2s linear both; }
.quest-pop.go .qp-stamp { animation: qp-stamp .6s cubic-bezier(.2, 1.8, .4, 1) .25s both; }
.quest-pop.go .qp-stamp path { animation: qp-check .45s ease .55s forwards; }
.quest-pop.go .qp-confetti i { animation: qp-conf 1.6s cubic-bezier(.1, .7, .3, 1) var(--d) forwards; }
@keyframes qp-in { 0% { transform: translateY(-120px) scale(.6) rotate(-4deg); opacity: 0; } 10% { transform: none; opacity: 1; } 86% { transform: none; opacity: 1; } 100% { transform: translateY(-40px) scale(.9); opacity: 0; } }
@keyframes qp-rays { 0% { opacity: 0; transform: rotate(0); } 15% { opacity: 1; } 80% { opacity: .8; } 100% { opacity: 0; transform: rotate(90deg); } }
@keyframes qp-stamp { from { transform: scale(2.6) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qp-check { to { stroke-dashoffset: 0; } }
@keyframes qp-conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) * -1 + 120px)) rotate(var(--r)); } }

/* ---------- Level & XP ---------- */
.ava-wrap { position: relative; flex: none; }
.lvl-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--ice); color: #fff; border: 2px solid var(--crust); font-family: var(--font-display); font-weight: 400; font-size: 13px; }
.ava-wrap .lvl-badge { position: absolute; right: -6px; bottom: -4px; }
.lvl-badge.big { min-width: 34px; height: 34px; border-radius: 17px; font-size: 18px; }
.chip-xp { display: block; width: 100%; height: 5px; margin-top: 2px; border-radius: 3px; background: rgba(59, 31, 14, .15); overflow: hidden; }
.chip-xp i { display: block; height: 100%; background: var(--ice); }
.xp-box { padding: 10px 12px; border: var(--edge); border-radius: 16px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.xp-head { display: flex; align-items: center; gap: 8px; }
.xp-head b { font-family: var(--font-display); font-weight: 400; font-size: 20px; flex: 1; }
.xp-head em { font-style: normal; font-family: var(--font-display); color: var(--ice); font-size: 18px; }
.xp-bar { height: 14px; border: 2px solid var(--crust); border-radius: 8px; background: #e9f5fc; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2fb4e8, #7fdcff); }
.levelup { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 12px; background: linear-gradient(90deg, #ffd85c, #fff3a6, #ffd85c); border: 2px solid var(--crust); font-family: var(--font-display); font-size: 22px; animation: pop-in .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.levelup span { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; }
.levelup svg { width: 26px; height: 26px; }
.next-goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.next-goals li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #fff6dc; border: 2px dashed rgba(59, 31, 14, .35); font-size: 14px; line-height: 1.25; }
.next-goals .nav-ico { width: 28px; height: 28px; }

/* ---------- Tägliche Belohnung ---------- */
.daily-card { display: flex; flex-direction: column; gap: 10px; width: min(460px, 100%); }
.daily-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.daily-days li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: var(--edge); border-radius: 14px; background: #fff; min-width: 0; }
.daily-days li:last-child { grid-column: span 2; background: linear-gradient(160deg, #fff3c4, #ffc93c); }
.daily-days small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.daily-days .dr { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--font-display); font-size: 16px; }
.daily-days .dr .ico-coin { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }
.daily-days .db { display: inline-flex; align-items: center; } .daily-days .db svg { width: 26px; height: 26px; }
.daily-days .gift svg { width: 34px; height: 34px; }
.daily-days li.got { background: #e6f6dd; opacity: .75; }
.daily-days li.now { border-color: var(--ketchup); box-shadow: 0 0 0 3px var(--fry); animation: pulse 1s infinite; }
.daily-days li.pop { animation: pop-in .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.daily-days .tick { position: absolute; top: -8px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--lettuce); color: #fff; border: 2px solid var(--crust); display: grid; place-items: center; font-style: normal; font-size: 13px; }
.btn-big { font-size: 26px; padding: 14px; }

@media (max-width: 640px) {
  .zone { top: calc(100px + var(--safe-t)); width: calc(100% - 32px); padding: 8px 14px 10px; }
  .quest-pop { top: calc(170px + var(--safe-t)); }
  .qp-stamp { width: 54px; height: 54px; } .qp-stamp svg { width: 38px; height: 38px; }
  .qp-body small { font-size: 19px; }
  .daily-days { gap: 6px; }
}

/* ---------- Ultimate: Platzierung im Lauf (alles oben, Spielfeld frei) ---------- */
.milestone { top: 15%; }
.is-mobile .hud-dist em { display: none; }
.is-mobile .rage { margin-top: 2px; }
.is-mobile #toasts { top: calc(98px + var(--safe-t)); }
.is-mobile .zone, .is-mobile .quest-pop { top: calc(6px + var(--safe-t)); }
.is-mobile .tut-step { top: calc(6px + var(--safe-t)); }
.is-mobile .tut-prompt { top: calc(100px + var(--safe-t)); }
@media (min-width: 641px) { .quest-pop { top: calc(84px + var(--safe-t)); } .zone { top: calc(8px + var(--safe-t)); } }

/* ---------- Icons statt nur Schrift ---------- */
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.tab .nav-ico { width: 20px; height: 20px; }
.btn-ico { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-ico .nav-ico { width: 24px; height: 24px; }
.over-stats div .nav-ico { width: 24px; height: 24px; margin-bottom: 2px; }
.menu-nav { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 640px) { .menu-nav { grid-template-columns: repeat(3, 1fr); } .nav-btn { flex-direction: row; justify-content: center; gap: 6px; padding: 8px 4px; } .nav-btn .nav-ico { width: 26px; height: 26px; } }

/* ---------- Highscore-Feier ---------- */
.over-card.wait { visibility: hidden; }
.record-pop { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.record-pop.go { animation: rp-fade 2.7s ease both; }
@keyframes rp-fade { 0% { opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
.rp-rays { position: absolute; width: 900px; height: 900px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 210, 31, .55) 0 9deg, transparent 9deg 18deg); -webkit-mask: radial-gradient(circle, #000 15%, transparent 62%); mask: radial-gradient(circle, #000 15%, transparent 62%); animation: rp-spin 6s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
.rp-trophy { position: relative; width: 140px; height: 140px; filter: drop-shadow(0 8px 0 rgba(59, 31, 14, .35)); }
.record-pop.go .rp-trophy { animation: rp-trophy 1s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes rp-trophy { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.record-pop small { position: relative; font-family: var(--font-display); font-size: clamp(30px, 8vw, 54px); color: var(--fry); -webkit-text-stroke: 3px var(--crust); paint-order: stroke fill; text-shadow: 0 6px 0 var(--crust); }
.record-pop b { position: relative; font-family: var(--font-display); font-weight: 400; font-size: clamp(54px, 15vw, 104px); color: #fff; -webkit-text-stroke: 4px var(--crust); paint-order: stroke fill; text-shadow: 0 8px 0 var(--crust); font-variant-numeric: tabular-nums; line-height: 1; }
.record-pop em { position: relative; font-style: normal; margin-top: 8px; padding: 4px 14px; border-radius: 999px; background: var(--crust); color: var(--cream); font-size: 15px; }
.record-pop.go small { animation: pop-in .5s cubic-bezier(.2, 1.6, .4, 1) .25s both; }
.rp-confetti { position: absolute; left: 50%; top: 45%; }
.rp-confetti i { position: absolute; width: 12px; height: 16px; border-radius: 2px; opacity: 0; }
.record-pop.go .rp-confetti i { animation: qp-conf 2s cubic-bezier(.1, .7, .3, 1) var(--d) forwards; }

/* ---------- Wochen-Turnier ---------- */
#scr-tourney { justify-content: center; }
.tourney-card { width: min(540px, 100%); display: flex; flex-direction: column; gap: 10px; }
.tourney-card .panel-head { padding: 0; }
.t-hero { display: flex; gap: 10px; }
.t-hero > div { flex: 1; padding: 10px 12px; border-radius: 16px; border: var(--edge); background: linear-gradient(150deg, #2b3fa8, #1d2a6b); color: #fff; }
.t-hero .t-ends { flex: 0 0 auto; background: var(--crust); }
.t-hero small { display: block; font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.t-hero b { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--fry); font-variant-numeric: tabular-nums; }
.t-hero .t-ends b { font-size: 20px; color: #fff; }
.t-tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-tiers li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: var(--edge); border-left: 8px solid var(--tc); border-radius: 16px; background: #fff; }
.t-tiers li.ready { background: #fff8d6; box-shadow: 0 0 0 3px var(--fry); animation: pulse 1.2s infinite; }
.t-tiers li.got { opacity: .65; }
.t-tiers img { width: 54px; height: 54px; border-radius: 12px; background: radial-gradient(circle at 50% 60%, #fff3d6, #ffd98a); object-fit: contain; }
.t-medal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--crust); }
.t-medal svg { width: 40px; height: 40px; }
.t-info { min-width: 0; }
.t-info b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.t-rw { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; margin: 2px 0 4px; }
.t-rw .ico-coin { width: 16px; height: 16px; } .t-rw svg { width: 20px; height: 20px; vertical-align: -5px; }
.t-ex { padding: 1px 8px; border-radius: 999px; background: var(--ketchup); color: #fff; font-size: 12px; }
.t-need { font-family: var(--font-display); font-size: 16px; opacity: .7; white-space: nowrap; }
.t-tiers .btn { font-size: 15px; padding: 8px 12px; }
.t-sub { margin: 6px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.t-rank { max-height: 260px; }
.tier-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--crust); vertical-align: 1px; }

/* ---------- Tempo-Linien bei hoher Geschwindigkeit ---------- */
#fx-speed.fast { opacity: .35; animation: spin-lines .3s linear infinite; }

/* ---------- Meldungen am Handy: kleiner und unter der Anzeige ---------- */
.is-mobile #toasts { top: calc(200px + var(--safe-t)); }
.is-mobile .toast { font-size: 16px; padding: 6px 12px; border-width: 2px; box-shadow: 0 3px 0 var(--crust); }
.is-mobile .toast.task { font-size: 13px; }
.is-mobile .toast.biome, .is-mobile .toast.record, .is-mobile .toast.boardbig { font-size: 22px; }
.is-mobile .toast.boardbig svg { width: 34px; height: 34px; }

/* ---------- Koch-Wut-Anzeige ---------- */
.rage { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin-top: 4px; -webkit-text-stroke: 0; text-shadow: none; }
.rage .nav-ico { width: 30px; height: 30px; }
.rage-bar { width: 120px; height: 12px; border: 2px solid var(--crust); border-radius: 8px; background: rgba(255, 255, 255, .9); overflow: hidden; }
.rage-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffc93c, #ff7a1a); transition: width .15s linear; }
.rage.hot .rage-bar i { background: linear-gradient(90deg, #ff7a1a, var(--ketchup)); }
.rage.hot .nav-ico { animation: shake-x .3s infinite; }

/* ---------- Credits ---------- */
.credits-card { display: flex; flex-direction: column; gap: 10px; }
.credits-card h3 { margin: 4px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.credits-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }

/* ---------- Fenster scrollbar, falls der Bildschirm zu klein ist ---------- */
.card { max-height: 100%; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.shop-body, .rank-list, #tasks-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (max-height: 760px) {
  .card { padding: 16px; }
  .card h2 { font-size: 28px; }
  .over-title { font-size: 38px !important; }
  .over-card, .login-card, .small-card { gap: 8px; }
  .over-stats strong { font-size: 22px; }
  .mini-tasks { display: none; }
  .login-hero .nav-ico.big { width: 52px; height: 52px; }
  .sub { margin-bottom: 8px; font-size: 14px; }
}

/* ---------- Shop am Handy: mehr Platz für die Auswahl ---------- */
.detail-row h3 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) and (orientation: portrait) {
  .shop-panel { height: 64%; border-radius: 22px; }
  .shop-panel .panel-head { padding: 8px 12px 6px; }
  .shop-panel .panel-head h2 { font-size: 24px; }
  .shop-panel .icon-btn { width: 40px; height: 40px; }
  .shop-panel .pill { height: 36px; font-size: 18px; }
  .tabs { padding: 0 12px 8px; gap: 5px; }
  .tab { font-size: 14px; padding: 6px 2px; }
  .shop-body { padding: 2px 12px 10px; }
  .item { padding: 4px 4px 6px; border-radius: 14px; }
  .item img { max-width: 92px; }
  .shop-detail { padding: 8px 12px calc(10px + var(--safe-b)); gap: 4px; }
  .shop-detail h3 { font-size: 19px; }
  .shop-detail p { font-size: 12px; line-height: 1.3; }
  .shop-detail .detail-row { flex-wrap: nowrap; gap: 8px; }
  .shop-detail .btn { font-size: 15px; padding: 8px 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; flex: none; }
  .shop-detail .btn .ico-coin { width: 18px; height: 18px; }
  .shop-detail .perk { display: none; }
  .up-row { grid-template-columns: 44px 1fr auto; padding: 8px; gap: 8px; }
  .up-row .up-ico { width: 44px; height: 44px; }
  .up-row p { font-size: 11px; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 520px) {
  .menu-nav { gap: 6px; }
  .nav-btn { padding: 8px 2px 6px; }
  .nav-btn span { font-size: 12px !important; }
  .nav-btn .nav-ico { width: 30px; height: 30px; }
  .topbar .pill.best { display: none; }
  .player-chip { max-width: 170px; }
}
@media (orientation: landscape) and (min-width: 720px) {
  #scr-menu { align-items: flex-start; }
  .logo { align-items: flex-start; margin-left: 1vw; }
  .tagline { margin-left: 1vw; }
  .menu-bottom { width: min(520px, 46%); align-items: stretch; }
  .btn-play { width: 100%; }
  .controls-hint { text-align: left; }
}
@media (max-width: 760px) and (orientation: portrait) {
  #scr-shop { align-items: stretch; justify-content: flex-end; }
  .shop-panel { width: 100%; height: 60%; animation-name: slide-up; }
  @keyframes slide-up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .item .nm { font-size: 12px; min-height: 28px; }
  .item .tag { font-size: 12px; padding: 1px 6px; }
  .nav-btn span { font-size: 14px; }
  .controls-hint { display: none; }
  .tutorial { bottom: calc(118px + var(--safe-b)); width: calc(100% - 32px); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .logo-top i { font-size: 52px; } .logo-bottom i { font-size: 40px; }
  .tagline, .controls-hint { display: none; }
  .btn-play { padding: 10px; font-size: 26px; }
  .shop-panel { width: min(520px, 58%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* =========================================================
   PREMIUM-SCHLIFF: feinere Kanten, weiche Schatten, Glanz,
   dunkles Glas im HUD statt dicker Comic-Ränder
   ========================================================= */
:root {
  --edge: 2px solid rgba(43, 22, 8, .92);
  --lift: 0 3px 0 rgba(43, 22, 8, .9), 0 8px 18px rgba(43, 22, 8, .22);
  --gloss: inset 0 1.5px 0 rgba(255, 255, 255, .65), inset 0 -3px 0 rgba(0, 0, 0, .12);
  --glass: linear-gradient(180deg, rgba(34, 20, 12, .72), rgba(18, 10, 6, .78));
  --glass-edge: 1px solid rgba(255, 220, 160, .22);
}
.btn { border-radius: 14px; box-shadow: var(--lift), var(--gloss); background: linear-gradient(180deg, #fffaf0, #fbe7c4); letter-spacing: .03em; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(43, 22, 8, .9), var(--gloss); }
.btn-green { background: linear-gradient(180deg, #7ad65f 0%, #4fb83e 48%, #36962a 100%); text-shadow: 0 1.5px 0 rgba(0, 60, 0, .55); }
.btn-red { background: linear-gradient(180deg, #ff6a55 0%, #e8352b 50%, #bf241b 100%); text-shadow: 0 1.5px 0 rgba(90, 0, 0, .55); }
.btn-ghost { background: linear-gradient(180deg, rgba(255, 250, 240, .9), rgba(251, 231, 196, .85)); }
.icon-btn { border-radius: 13px; background: linear-gradient(180deg, #fffaf0, #f6dfb6); box-shadow: 0 3px 0 rgba(43, 22, 8, .9), 0 6px 14px rgba(43, 22, 8, .2), var(--gloss); }
.icon-btn:active { transform: translateY(2px); }
.icon-btn.off { background: linear-gradient(180deg, #e6dccb, #c9bba2); }

.btn-play {
  border-width: 2px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffe37a 0%, #ffc93c 45%, #f2a516 100%);
  box-shadow: 0 4px 0 rgba(43, 22, 8, .92), 0 14px 34px rgba(242, 140, 22, .45), inset 0 2px 0 rgba(255, 255, 255, .8), inset 0 -5px 0 rgba(170, 90, 0, .25);
  animation: play-breathe 2.4s ease-in-out infinite;
}
.btn-play::after { content: ''; position: absolute; top: 0; bottom: 0; width: 38%; left: -50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); animation: sheen 3.2s ease-in-out infinite; pointer-events: none; }
.btn-play span { -webkit-text-stroke: 1.2px rgba(43, 22, 8, .95); text-shadow: 0 2px 0 rgba(43, 22, 8, .9); }
@keyframes play-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes sheen { 0%, 55% { left: -50%; } 85%, 100% { left: 125%; } }

.pill { border: var(--glass-edge); background: var(--glass); color: #fff7e6; box-shadow: 0 6px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pill small { color: #ffd98a; opacity: .9; }
.pill b { background: linear-gradient(180deg, #ff6a55, #d92c22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.ico-coin { border: 1.5px solid #a86200; box-shadow: inset 0 -2px 0 rgba(150, 80, 0, .35), 0 1px 2px rgba(0, 0, 0, .25); }

.card { border: 2px solid rgba(43, 22, 8, .92); border-radius: 24px; background: linear-gradient(180deg, #fffaf1 0%, #fdf0d8 100%); box-shadow: 0 4px 0 rgba(43, 22, 8, .9), 0 24px 60px rgba(20, 8, 2, .45), inset 0 1px 0 #fff; }
.card h2 { letter-spacing: .03em; }
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(40, 18, 6, .35), rgba(20, 8, 2, .7)); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.shop-panel { border-width: 2px; border-radius: 24px; background: linear-gradient(180deg, #fffaf1, #fdf0d8); box-shadow: 0 4px 0 rgba(43, 22, 8, .9), 0 24px 60px rgba(20, 8, 2, .4); }
.tab { border-width: 2px; border-radius: 11px; background: linear-gradient(180deg, #fff5e0, #f6dfb6); box-shadow: 0 2px 0 rgba(43, 22, 8, .85), var(--gloss); }
.tab.on { background: linear-gradient(180deg, #ff6a55, #d92c22); }
.item { border-width: 2px; border-radius: 15px; background: linear-gradient(180deg, #fff, #fff6e6); box-shadow: 0 2px 0 rgba(43, 22, 8, .85), 0 6px 14px rgba(43, 22, 8, .1); }
.item.sel { background: linear-gradient(180deg, #fff8dc, #ffecb0); outline: 2px solid #e8352b; box-shadow: 0 0 0 5px rgba(232, 53, 43, .18), 0 2px 0 rgba(43, 22, 8, .85); }
.item .tag { border-width: 1.5px; }
.up-row, .task, .xp-box { border-width: 2px; background: linear-gradient(180deg, #fff, #fff7ea); box-shadow: 0 2px 0 rgba(43, 22, 8, .85), 0 6px 14px rgba(43, 22, 8, .08); }
.up-ico { border-width: 2px; box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.progress, .xp-bar, .pu .bar, .board-bar .bar, .rage-bar { border-width: 1.5px; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .12); }
.progress i, .xp-bar i, .pu .bar i, .board-bar .bar i, .rage-bar i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.over-stats div { border-width: 2px; background: linear-gradient(180deg, #fff, #fff6e6); box-shadow: 0 2px 0 rgba(43, 22, 8, .85); }
.badge { border-width: 1.5px; background: linear-gradient(180deg, #ff6a55, #d92c22); box-shadow: 0 2px 6px rgba(150, 0, 0, .4); }
kbd { border-width: 1.5px; border-bottom-width: 3px; background: linear-gradient(180deg, #fff, #f2e3c8); }

/* Logo: Verlauf, Tiefe statt Wackel-Comic */
.logo i { animation-duration: 3.6s; }
@keyframes letter-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.logo-top i { color: #ffd34d; -webkit-text-stroke: 2.5px #2b1608; text-shadow: 0 3px 0 #c97a00, 0 6px 0 #2b1608, 0 16px 26px rgba(43, 22, 8, .4); }
.logo-bottom i { color: #ff4a3a; -webkit-text-stroke: 2.5px #2b1608; text-shadow: 0 3px 0 #a3170f, 0 6px 0 #2b1608, 0 16px 26px rgba(43, 22, 8, .4); }
.tagline { background: var(--glass); border: var(--glass-edge); color: #ffe7b8; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); letter-spacing: .02em; }
.controls-hint { background: var(--glass); color: #ffe7b8; border: var(--glass-edge); }
.controls-hint kbd { color: #2b1608; }

/* Icons: weicher Schatten statt harter Kante */
.nav-ico svg { filter: drop-shadow(0 2px 2px rgba(43, 22, 8, .28)); }

/* ---------- HUD: Glas-Look ---------- */
.hud-dist { -webkit-text-stroke: 1.6px #2b1608; text-shadow: 0 3px 0 #2b1608, 0 8px 18px rgba(0, 0, 0, .35); }
.hud-dist em { background: var(--glass); color: #ffe7b8; border: var(--glass-edge); }
.icon-btn#btn-pause { background: var(--glass); border: var(--glass-edge); box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
.icon-btn#btn-pause svg { stroke: #fff7e6; }
.icon-btn#btn-pause svg .fill { fill: #fff7e6; }
.board-btn { border-width: 2px; background: radial-gradient(circle at 50% 30%, #ffe37a, #ffc93c 55%, #e89a10); box-shadow: 0 4px 0 rgba(43, 22, 8, .9), 0 10px 24px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .7); }
.board-btn b { border-width: 2px; background: linear-gradient(180deg, #ff6a55, #d92c22); }
.board-bar, .tut-step, .tut-prompt, .chef-warn { border-width: 2px !important; }

/* Tempo-Anzeige oben in der Mitte */
.speedo {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 14px 7px 8px; margin-top: 2px;
  border-radius: 14px; border: var(--glass-edge); background: var(--glass); color: #fff7e6; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); --p: 0; --c: #7ee06a; transition: box-shadow .3s;
}
.speedo .nav-ico { width: 30px; height: 30px; }
.speedo div { display: flex; flex-direction: column; line-height: 1; }
.speedo b { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--c); font-variant-numeric: tabular-nums; letter-spacing: .02em; transition: color .3s; }
.speedo small { font-size: 10.5px; font-weight: 900; color: rgba(255, 231, 184, .75); letter-spacing: .06em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.speedo::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p) * 100%); background: linear-gradient(90deg, #7ee06a, #ffcb2e, #ff4a3a); background-size: calc(100% / max(var(--p), .05)) 100%; transition: width .4s ease; }
.speedo[data-lvl="warm"] { --c: #ffcb2e; }
.speedo[data-lvl="hot"] { --c: #ff6a4a; box-shadow: 0 6px 16px rgba(0, 0, 0, .28), 0 0 18px rgba(255, 74, 58, .45); }
.speedo[data-lvl="turbo"] { --c: #6fe3ff; box-shadow: 0 6px 16px rgba(0, 0, 0, .28), 0 0 22px rgba(80, 210, 255, .65); }
.speedo[data-lvl="hot"] .nav-ico, .speedo[data-lvl="turbo"] .nav-ico { animation: shake-x .35s infinite; }
.speedo.bump b { animation: speedo-bump .45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes speedo-bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hud-top .speedo { flex: none; }
@media (max-width: 520px) {
  .speedo { padding: 4px 10px 6px 6px; gap: 4px; border-radius: 12px; }
  .speedo .nav-ico { width: 24px; height: 24px; }
  .speedo b { font-size: 19px; }
  .speedo small { font-size: 9px; }
}
@media (max-width: 370px) { .speedo small { display: none; } }

/* =========================================================
   Pommes-Zähler (ersetzt Board-Knopf und Board-Leiste)
   ========================================================= */
.hud-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.hud-left .hud-pu { position: static; margin-top: 2px; }
.board-count {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 6px; overflow: hidden;
  border-radius: 12px; border: var(--glass-edge); background: var(--glass); color: #fff7e6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-family: var(--font-display); transition: background .25s, box-shadow .25s;
}
.board-count .nav-ico { position: relative; width: 28px; height: 28px; }
.board-count b { position: relative; font-weight: 400; font-size: 21px; font-variant-numeric: tabular-nums; }
.board-count b::before { content: '×'; font-size: 15px; opacity: .7; margin-right: 1px; }
.board-count span { position: relative; font-size: 15px; font-variant-numeric: tabular-nums; color: #ffe08a; }
.board-count span:empty { display: none; }
.board-count .bc-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); transition: transform .12s linear; pointer-events: none; }
.board-count[data-state="ready"] { box-shadow: 0 6px 16px rgba(0, 0, 0, .28), 0 0 0 1.5px rgba(255, 201, 60, .7), 0 0 14px rgba(255, 201, 60, .35); }
.board-count[data-state="empty"] { opacity: .6; }
.board-count[data-state="empty"] .nav-ico { filter: grayscale(1); }
.board-count[data-state="ride"] { background: linear-gradient(180deg, rgba(120, 66, 0, .8), rgba(70, 36, 0, .85)); }
.board-count[data-state="ride"] .bc-fill { background: linear-gradient(90deg, rgba(255, 201, 60, .55), rgba(255, 138, 60, .55)); }
.board-count[data-state="ride"] span { color: #fff; }
.board-count[data-state="cool"] .bc-fill { background: rgba(255, 255, 255, .16); }
.board-count[data-state="cool"] .nav-ico { filter: grayscale(.85) brightness(.8); }
.board-count[data-state="cool"] span { color: #ffb4a8; }
.board-count[data-state="cool"] span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 3px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: bc-spin .8s linear infinite; vertical-align: -1px; }
@keyframes bc-spin { to { transform: rotate(360deg); } }
.board-count.low[data-state="ride"] { animation: bc-blink .4s ease-in-out infinite alternate; }
@keyframes bc-blink { to { box-shadow: 0 0 0 2px #ff4a3a, 0 0 18px rgba(255, 74, 58, .6); } }
.board-count.bump { animation: bc-bump .5s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes bc-bump { 35% { transform: scale(1.22); } }
.board-count.deny { animation: shake-x .3s 2; }
.is-mobile .board-count { height: 32px; padding: 0 10px 0 5px; }
.is-mobile .board-count .nav-ico { width: 24px; height: 24px; }
.is-mobile .board-count b { font-size: 18px; }
.is-mobile .board-count span { font-size: 13px; }

/* Meldungen: kompakt, nie über dem Meilenstein */
.toast { max-width: min(340px, 86%); }
.is-mobile .toast { max-width: min(290px, 82%); font-size: 15px; }
#toasts { transition: transform .25s ease; }
body.ms-on #toasts { transform: translateY(150px); }

/* Aktive Power-ups im Lauf: goldener Rahmen wie die Items auf der Strecke */
.pu .up-ico { border: 2px solid #ffd34d; box-shadow: 0 0 0 1.5px rgba(122, 74, 0, .9), 0 0 12px rgba(255, 201, 60, .7), inset 0 1.5px 0 rgba(255, 255, 255, .5); }
.pu .bar { border-color: rgba(122, 74, 0, .9); }
/* =========================================================
   Lesbarkeit: weiße Schrift nur auf kräftigen, dunklen Farben
   ========================================================= */
.btn-green { background: linear-gradient(180deg, #45a634 0%, #2f8a24 55%, #236e1a 100%); text-shadow: 0 1.5px 0 rgba(0, 40, 0, .6); }
.btn-red, .tab.on, .seg-btn.on { background: linear-gradient(180deg, #e8352b 0%, #c8261d 55%, #a51c15 100%); color: #fff; text-shadow: 0 1.5px 0 rgba(80, 0, 0, .6); }
.btn-revive { background: linear-gradient(180deg, #1f8fc4, #16739f); }
.task .tier.t0, .mini-badge, .daily-days .tick, .item .tag.own { background: #2f8a24; }
.task .tier.t1, .lvl-badge { background: #1a77a6; }
.task .tier.t2, .item .tag.eq, .t-ex, .badge, .pill b { background: #c8261d; }
.task.ach .medal { background: #8a7a66; }
.task .tier, .lvl-badge, .badge, .mini-badge, .task.ach .medal { text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
/* Ausgegraute Knöpfe: dunkle Schrift auf hellem Grau statt Weiß auf Blassgrün */
.btn[disabled], .btn-green[disabled], .btn-red[disabled] {
  filter: none; opacity: 1; background: linear-gradient(180deg, #ece4d6, #d9cfbf) !important;
  color: #7a6a58 !important; text-shadow: none !important; cursor: not-allowed;
}
.btn[disabled] .ico-coin { filter: grayscale(.6); }
/* ---------- Rechtliches: nur auf der eigenen Website sichtbar ---------- */
.legal-only { display: none !important; }
.own-site .legal-only { display: block !important; }
.legal-links { margin: 6px 0 0; text-align: center; font-size: 12px; }
.legal-links a, .fine a { color: inherit; font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.menu-legal { padding: 3px 12px; border-radius: 10px; background: var(--glass); border: var(--glass-edge); color: #ffe7b8; width: fit-content; margin-left: auto; margin-right: auto; }
.link.danger { display: block; margin: 10px auto 0; background: none; border: 0; color: #b8231b; font-weight: 900; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.del-box { margin-top: 12px; padding: 12px; border-radius: 14px; border: 2px solid #c8261d; background: #fff1ee; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.del-box p { margin: 0; font-size: 13px; line-height: 1.35; }
.del-box label { font-size: 13px; font-weight: 900; }
.del-box input { font: inherit; font-size: 20px; letter-spacing: .3em; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(43, 22, 8, .9); background: #fff; }
.del-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.del-actions .btn { font-size: 15px; padding: 10px 8px; }
/* Schalter „In Rangliste anzeigen“ */
.check-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: #2f8a24; margin: 0; }
/* =========================================================
   Handy-Browser: Seite fest auf den sichtbaren Bereich (iOS Safari)
   ========================================================= */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; }
#app { inset: auto; left: 0; top: 0; width: 100%; height: 100%; max-width: 100vw; }

/* Quest-/Challenge-Meldung im Lauf unter die Anzeige oben statt darüber */
.quest-pop { top: calc(150px + var(--safe-t)) !important; }
@media (min-width: 641px) { .quest-pop { top: calc(120px + var(--safe-t)) !important; } }
.is-mobile .quest-pop .qp-card { transform: scale(.88); transform-origin: top center; }

/* ---------- Gems ---------- */
.ico-gem {
  width: 22px; height: 22px; flex: none; display: inline-block; position: relative; vertical-align: -5px;
  background: linear-gradient(135deg, #e0d0ff 0%, #9b6bff 35%, #6a3ae0 70%, #4a1fb0 100%);
  clip-path: polygon(25% 8%, 75% 8%, 100% 38%, 50% 96%, 0 38%);
}
.ico-gem::after { content: ''; position: absolute; left: 22%; top: 14%; width: 30%; height: 24%; background: rgba(255, 255, 255, .7); clip-path: polygon(0 100%, 30% 0, 100% 0, 70% 100%); }
.pill.gems .ico-gem { width: 24px; height: 24px; }
.pill.gems { padding-left: 8px; }
.rw-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rw-btn .ico-gem { width: 17px; height: 17px; margin-left: 4px; }
.qp-gems { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-weight: 900; }
.qp-gems .ico-gem { width: 20px; height: 20px; }
@media (max-width: 520px) { .topbar .pill.gems { height: 36px; font-size: 17px; } }

/* ---------- Challenges ---------- */
.chal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chal-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 2px solid rgba(43, 22, 8, .9); border-radius: 16px; background: linear-gradient(180deg, #fff, #fff4e4); box-shadow: 0 2px 0 rgba(43, 22, 8, .85); }
.chal-list li.done { background: linear-gradient(180deg, #eefbe8, #dff3d5); }
.chal-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(180deg, #3a1f5e, #22113a); }
.chal-ico svg { width: 32px; height: 32px; }
.chal-info b { font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.chal-info p { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.3; opacity: .85; }
.chal-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; align-items: center; }
.chal-goal { padding: 1px 8px; border-radius: 999px; background: #2b1608; color: #ffe7b8; }
.chal-rw { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; }
.chal-rw .ico-coin { width: 15px; height: 15px; } .chal-rw .ico-gem { width: 15px; height: 15px; }
.chal-done { font-family: var(--font-display); color: #2f8a24; font-size: 15px; white-space: nowrap; }
.chal-list .btn { font-size: 15px; padding: 9px 12px; }
@media (max-width: 420px) { .chal-list li { grid-template-columns: 40px 1fr; } .chal-ico { width: 40px; height: 40px; } .chal-list li > .btn, .chal-list li > .chal-done { grid-column: 1 / -1; justify-self: stretch; text-align: center; } }

/* ---------- Board-Stufen im Shop ---------- */
.up-board { gap: 8px; }
.up-board .lv { font-family: var(--font-display); font-size: 16px; padding: 2px 10px; border-radius: 999px; background: #2b1608; color: #ffd36b; }
.gads { display: flex; flex-wrap: wrap; gap: 4px; }
.gad { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1.5px solid rgba(43, 22, 8, .35); color: #7a6a58; background: #f3ebde; }
.gad.on { color: #fff; background: #6a3ae0; border-color: #4a1fb0; }

/* Board-Zähler: kaufen möglich */
.board-count[data-state="buy"] { box-shadow: 0 6px 16px rgba(0, 0, 0, .28), 0 0 0 1.5px rgba(155, 107, 255, .8); }
.board-count[data-state="buy"] span { color: #ffd36b; font-size: 12px; }
/* ---------- Shop: 5 Reiter ---------- */
.tabs { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.tab { font-size: 14px; padding: 7px 2px; gap: 3px; }
.tab .nav-ico { width: 18px; height: 18px; }
@media (max-width: 520px) { .tab span { font-size: 11.5px; } .tab .nav-ico { width: 16px; height: 16px; } }
.item .tag.gem { background: #efe6ff; }
.item .tag .ico-gem { width: 14px; height: 14px; vertical-align: -3px; }

/* ---------- Boxen ---------- */
.box-list { display: flex; flex-direction: column; gap: 10px; }
.box-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 2px solid rgba(43, 22, 8, .9); border-radius: 16px; background: linear-gradient(180deg, #fff, #fff6e6); box-shadow: 0 2px 0 rgba(43, 22, 8, .85); }
.box-row h4 { margin: 0; font-size: 16px; } .box-row p { margin: 2px 0 0; font-size: 12px; opacity: .8; }
.box-art { position: relative; width: 56px; height: 50px; display: block; }
.box-art .body { position: absolute; left: 4px; right: 4px; bottom: 0; height: 32px; border-radius: 6px; background: linear-gradient(180deg, var(--bc), color-mix(in srgb, var(--bc) 60%, #2b1608)); border: 2px solid #2b1608; }
.box-art .lid { position: absolute; left: 0; right: 0; top: 4px; height: 16px; border-radius: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--bc) 70%, #fff), var(--bc)); border: 2px solid #2b1608; z-index: 2; transform-origin: 10% 100%; }
.box-art .band { position: absolute; left: 50%; top: 4px; bottom: 0; width: 10px; margin-left: -5px; background: linear-gradient(180deg, #ff6a55, #c8261d); border-left: 2px solid #2b1608; border-right: 2px solid #2b1608; z-index: 3; }
.box-art.big { width: 140px; height: 124px; }
.box-art.big .body { height: 80px; border-radius: 12px; border-width: 3px; } .box-art.big .lid { height: 40px; top: 6px; border-radius: 12px; border-width: 3px; } .box-art.big .band { width: 24px; margin-left: -12px; top: 6px; }

.box-open { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at 50% 45%, rgba(60, 25, 90, .82), rgba(15, 6, 20, .92)); }
.box-open[hidden] { display: none; }
.bo-rays { position: absolute; width: 700px; height: 700px; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(rgba(255, 220, 120, .35) 0 10deg, transparent 10deg 20deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%); animation: rp-spin 8s linear infinite; }
.bo-box { position: relative; }
.box-open.shake .bo-box { animation: bo-shake .14s ease-in-out infinite alternate; }
@keyframes bo-shake { from { transform: rotate(-7deg) scale(1); } to { transform: rotate(7deg) scale(1.06); } }
.box-open.opened .bo-box .lid { animation: bo-lid .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes bo-lid { to { transform: translate(-30px, -70px) rotate(-35deg); opacity: 0; } }
.box-open.opened .bo-box { animation: bo-drop .6s ease forwards .35s; }
@keyframes bo-drop { to { transform: translateY(40px) scale(.7); opacity: .35; } }
.bo-prize { position: absolute; top: 34%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 22px; border-radius: 20px; background: linear-gradient(180deg, #fffaf1, #fdf0d8); border: 2px solid #2b1608; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-family: var(--font-display); font-size: 30px; transform: scale(0); opacity: 0; }
.bo-prize img { width: 110px; height: 110px; border-radius: 14px; background: radial-gradient(circle at 50% 60%, #fff3d6, #ffe0a6); }
.bo-prize small { font-family: var(--font-body); font-size: 13px; font-weight: 900; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.bo-prize b { font-weight: 400; font-size: 22px; }
.bo-prize .ico-coin, .bo-prize .ico-gem { width: 30px; height: 30px; vertical-align: -6px; }
.bo-prize svg { width: 54px; height: 54px; vertical-align: middle; }
.bo-prize.rare1 { box-shadow: 0 0 0 3px #9b6bff, 0 16px 40px rgba(155, 107, 255, .6); }
.bo-prize.rare2 { box-shadow: 0 0 0 3px #ffd34d, 0 0 50px rgba(255, 211, 77, .8); }
.box-open.opened .bo-prize { animation: bo-pop .55s cubic-bezier(.2, 1.7, .4, 1) forwards .3s; }
.box-open.opened .bo-rays { opacity: 1; transition: opacity .4s .3s; }
@keyframes bo-pop { to { transform: scale(1); opacity: 1; } }
.bo-ok { position: absolute; bottom: calc(60px + var(--safe-b)); min-width: 180px; opacity: 0; pointer-events: none; }
.box-open.opened .bo-ok { opacity: 1; pointer-events: auto; transition: opacity .3s .8s; }

/* ---------- Meldungen kleiner: neue Welt, Erfolge, Aufgaben ---------- */
.zone { padding: 6px 14px 8px !important; width: auto !important; max-width: min(320px, calc(100% - 32px)); }
.zone small { font-size: 10px !important; }
.zone b { font-size: clamp(18px, 4.6vw, 24px) !important; }
.zone-speed { font-size: 12px; margin-top: 2px !important; }
.quest-pop .qp-card { transform: scale(.78) !important; transform-origin: top center; }
.is-mobile .quest-pop .qp-card { transform: scale(.7) !important; }
.quest-pop .qp-rays { opacity: .5; transform: scale(.7); }
.toast.biome, .toast.record { font-size: 20px !important; padding: 6px 14px !important; }
.is-mobile .toast.biome, .is-mobile .toast.record { font-size: 16px !important; }
.milestone b { font-size: clamp(36px, 10vw, 60px) !important; }