@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
:root { --bg: #2b1a10; --bg2: #3a2416; --card: #fff7ea; --ink: #3b2314; --muted: #8a6a52; --gold: #ffc83d; --pink: #ff5d8f; --green: #3fbf7f; --line: rgba(59,35,20,.14); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: #fff; overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; }
button { font-family: inherit; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 46fr) minmax(0, 54fr); grid-template-columns: minmax(0, 1fr); }
/* ---------- Backbereich ---------- */
#bake { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 55%, #6e3f1e 0%, #45260f 55%, #2b1a10 100%); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#fx { position: absolute; inset: 0; pointer-events: none; }
#counter { position: absolute; top: calc(env(safe-area-inset-top) + 50px); left: 0; right: 0; text-align: center; z-index: 3; pointer-events: none; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 18px rgba(0,0,0,.5); }
#kCount { font-size: clamp(26px, 7vw, 40px); line-height: 1.05; }
#kRate { font-size: 15px; color: #ffe2b8; margin-top: 2px; }
#kRate .hot { color: var(--gold); animation: pulse .5s infinite alternate; display: inline-block; }
#cookieWrap { position: absolute; left: 50%; top: 56%; width: min(58vw, 38vh, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2; }
#rays { position: absolute; inset: -40%; border-radius: 50%; background: repeating-conic-gradient(rgba(255,220,150,.13) 0 10deg, transparent 10deg 20deg); animation: spin 40s linear infinite; -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#cookie { position: absolute; inset: 0; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); transition: transform .12s; touch-action: manipulation; }
#cookie svg { width: 100%; height: 100%; display: block; }
#cookie:hover { transform: scale(1.04); }
#cookie.hit { animation: squash .14s ease-out; }
#cookie:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
@keyframes squash { 0% { transform: scale(.92); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.float { position: absolute; z-index: 4; pointer-events: none; font-size: 22px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5); transform: translate(-50%, -50%); animation: up 1s ease-out forwards; white-space: nowrap; }
@keyframes up { to { transform: translate(-50%, -110px); opacity: 0; } }
#buffs { position: absolute; left: 10px; bottom: 44px; z-index: 3; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.buff { background: rgba(0,0,0,.45); border: 2px solid var(--gold); border-radius: 12px; padding: 5px 10px; font-size: 13px; display: flex; gap: 8px; animation: pulse .6s infinite alternate; }
.buff.click { border-color: var(--pink); }
#news { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 8px 12px; background: rgba(0,0,0,.35); font-size: 13px; color: #ffe2b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
#newsTxt.in { animation: newsIn .5s ease-out; display: inline-block; }
@keyframes newsIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { to { transform: scale(1.06); } }
/* ---------- Goldener Keks ---------- */
#goldLayer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.gold { position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 0; padding: 0; background: none; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 0 14px #ffd84a) drop-shadow(0 0 30px #ffb300); animation: goldIn .5s ease-out, wob 1.2s ease-in-out infinite alternate .5s; touch-action: manipulation; }
.gold svg { width: 100%; height: 100%; }
@keyframes goldIn { from { transform: scale(0) rotate(-90deg); } }
@keyframes wob { from { transform: rotate(-12deg) scale(1); } to { transform: rotate(12deg) scale(1.12); } }
/* ---------- Laden ---------- */
#store { background: var(--card); color: var(--ink); display: flex; flex-direction: column; min-height: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.35); z-index: 5; }
#tabs { display: flex; gap: 2px; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: none; flex: none; }
#tabs::-webkit-scrollbar { display: none; }
#tabs button { flex: 1 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 9px 10px; border-radius: 12px 12px 0 0; cursor: pointer; white-space: nowrap; }
#tabs button.on { background: #f3e2c6; color: var(--ink); }
#tabs b { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 12px; }
#tabs b:empty { display: none; }
#pane { flex: 1; overflow-y: auto; background: #f3e2c6; padding: 10px 10px calc(env(safe-area-inset-bottom) + 56px); -webkit-overflow-scrolling: touch; }
.amount { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.amount button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 10px; font-size: 13px; color: var(--ink); cursor: pointer; }
.amount button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.list { display: flex; flex-direction: column; gap: 7px; }
.bld, .upg { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 7px 10px; color: var(--ink); cursor: pointer; opacity: .62; transition: opacity .15s, transform .1s; font-size: 14px; }
.bld.can, .upg.can { opacity: 1; border-color: #e3b46b; box-shadow: 0 3px 0 #e3b46b; }
.bld:active, .upg:active { transform: translateY(2px); }
.bld.locked { opacity: .45; cursor: default; }
.bld.pop, .upg.pop { animation: popa .25s; }
@keyframes popa { 50% { transform: scale(1.03); } }
.ic { width: 50px; height: 50px; border-radius: 12px; background: #fdf0d9; display: grid; place-items: center; position: relative; font-size: 22px; color: var(--muted); }
.ic svg { width: 42px; height: 42px; }
.ic i { position: absolute; right: -4px; bottom: -4px; background: var(--green); color: #fff; font-style: normal; font-size: 11px; padding: 1px 4px; border-radius: 7px; }
.bi { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bi b { font-size: 15px; }
.bi small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.bi .bt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi .sub { color: #b07a2a; }
.bp { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.price { font-size: 14px; white-space: nowrap; }
.price::before { content: "🍪 "; }
.own { font-size: 24px; color: #c8a07a; line-height: 1; }
.note, .empty { font-size: 13px; color: var(--muted); margin: 6px 2px 10px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ach { background: #fff; border: 2px dashed var(--line); border-radius: 12px; padding: 7px 9px; opacity: .55; }
.ach.ok { opacity: 1; border: 2px solid #e3b46b; background: #fffaf0; }
.ach b { display: block; font-size: 13px; }
.ach small { font-size: 11px; color: var(--muted); }
.prest { text-align: center; }
.prest .stars { font-size: 46px; color: #e0a100; text-shadow: 0 3px 0 #b07a00; }
.card { background: #fff; border-radius: 16px; padding: 12px; margin: 10px 0; border: 2px solid var(--line); }
.small { font-size: 12.5px; color: var(--muted); }
.gain { color: #c98a00; font-size: 20px; }
.erbe { display: grid; grid-template-columns: 60px 1fr; text-align: left; gap: 8px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; opacity: .55; border: 2px solid var(--line); }
.erbe.ok { opacity: 1; border-color: #e3b46b; }
.erbe > b { color: #c98a00; text-align: center; }
.erbe small { display: block; font-size: 12px; color: var(--muted); }
h2 { margin: 4px 0 10px; font-size: 22px; }
h3 { margin: 16px 0 8px; font-size: 16px; }
.more table { width: 100%; border-collapse: collapse; font-size: 14px; }
.more td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.more td + td { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.sl { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 14px; }
.sl input { accent-color: #c97a2a; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn { border: 0; border-radius: 14px; padding: 11px 16px; font-size: 15px; color: #fff; background: linear-gradient(180deg, #a4673a, #7b4520); box-shadow: 0 3px 0 #4e2a10; cursor: pointer; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #4e2a10; }
.btn.big { font-size: 18px; padding: 13px 20px; background: linear-gradient(180deg, #ff86a9, var(--pink) 55%, #d8346a); box-shadow: 0 4px 0 #8e1d43; }
.btn.warn { background: linear-gradient(180deg, #d9534f, #a8322e); box-shadow: 0 3px 0 #6b1a17; }
.btn[disabled] { opacity: .45; filter: grayscale(.6); cursor: default; }
#more .btn { margin-top: 4px; }
/* ---------- Straße ---------- */
#street { display: none; }
/* ---------- Toasts & Modal ---------- */
#toasts { position: absolute; right: 8px; bottom: 44px; z-index: 40; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: min(320px, 80vw); }
.toast { background: #fff7ea; color: var(--ink); border-radius: 14px; padding: 8px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: tin .3s ease-out; transition: opacity .4s, transform .4s; border-left: 6px solid #c97a2a; }
.toast.ach { border-left-color: var(--gold); }
.toast b { display: block; font-size: 14px; }
.toast span { font-size: 12px; color: var(--muted); }
.toast.out { opacity: 0; transform: translateX(30px); }
@keyframes tin { from { transform: translateX(40px); opacity: 0; } }
.bigtoast { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 45; text-align: center; pointer-events: none; animation: bigIn 2.2s ease forwards; }
.bigtoast b { display: block; font-size: clamp(32px, 9vw, 56px); color: var(--gold); text-shadow: 0 4px 0 #7a4a00, 0 0 24px rgba(255,200,60,.7); }
.bigtoast span { display: inline-block; margin-top: 6px; font-size: 18px; background: rgba(0,0,0,.6); padding: 6px 14px; border-radius: 12px; }
@keyframes bigIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(20,10,4,.6); display: grid; place-items: center; padding: 16px; }
#modal .box { background: var(--card); color: var(--ink); border-radius: 20px; padding: 18px; width: min(460px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: tin .25s; }
#modal textarea { width: 100%; font: 12px/1.3 ui-monospace, monospace; border-radius: 10px; border: 2px solid var(--line); padding: 8px; }
.err { color: #c0392b; font-size: 13px; min-height: 1em; }
/* ---------- große Bildschirme ---------- */
@media (min-width: 860px) {
  #app { grid-template-rows: 1fr; grid-template-columns: minmax(340px, 38fr) minmax(0, 30fr) minmax(360px, 32fr); }
  #store { border-radius: 0; }
  #tabs button { font-size: 13px; padding: 9px 8px; }
  #street { display: block; overflow-y: auto; background: linear-gradient(180deg, #4a2c18, #2b1a10); padding: 60px 14px 60px; border-left: 4px solid #1d110a; border-right: 4px solid #1d110a; }
  #street h2 { font-size: 18px; color: #ffe2b8; }
  #street .row { flex-direction: column; align-items: stretch; gap: 4px; margin: 0 0 12px; background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px; }
  #street .rn { font-size: 13px; color: #ffe2b8; }
  #street .rn b { color: var(--gold); }
  .ricons { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
  .ricons svg { width: 28px; height: 28px; }
  .ricons em { font-style: normal; font-size: 12px; color: #ffe2b8; margin-left: 4px; }
  #street .empty { color: #ffe2b8; }
  #cookieWrap { width: min(28vw, 50vh, 360px); top: 54%; }
  #pane { padding-bottom: 60px; }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 859px) {
  #app { grid-template-rows: 1fr; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); }
  #store { border-radius: 0; }
  #counter { top: 46px; }
  #cookieWrap { width: min(36vw, 52vh); top: 58%; }
  #pane { padding-bottom: 50px; }
}
@media (prefers-reduced-motion: reduce) { #rays, .gold, .buff, #kRate .hot { animation: none; } }
