:root {
  --bg: #1f2a36; --bg2: #283646; --card: #fffaf0; --ink: #1f2a36; --mut: #6b7684;
  --yel: #ffc21a; --yel2: #d99a00; --red: #d52b1e; --red2: #9b1d14; --grn: #2fa66a; --grn2: #1d7a4b;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; max-width: 560px; margin: 0 auto; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; overflow-y: auto; padding: calc(12px + var(--safe-t)) 16px calc(20px + var(--safe-b)); }
.screen.on { display: block; }
#s-game.on { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

/* ---------- Knöpfe ---------- */
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 14px 16px; margin: 8px 0; font-weight: 900; font-size: 18px;
  background: var(--yel); color: var(--ink); box-shadow: 0 5px 0 var(--yel2); transition: transform .08s; text-align: center; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--yel2); }
.btn small { display: block; font-weight: 600; font-size: 13px; opacity: .75; margin-top: 2px; }
.btn.sec { background: #e8edf2; box-shadow: 0 5px 0 #b6c0ca; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red2); }
.btn.grn { background: var(--grn); color: #fff; box-shadow: 0 5px 0 var(--grn2); }
.btn.ad { background: #4b3f8f; color: #fff; box-shadow: 0 5px 0 #2f275e; font-size: 16px; }
.btn[disabled] { opacity: .45; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.top h2 { margin: 0; font-size: 24px; flex: 1; }
.back { border: 0; background: #ffffff1c; width: 44px; height: 44px; border-radius: 14px; font-size: 22px; }
.coins { background: #ffffff1c; border-radius: 999px; padding: 6px 12px; font-weight: 900; white-space: nowrap; }

/* ---------- Start ---------- */
.hero { position: relative; text-align: center; padding: 6px 0 4px; }
.hero img { width: 116px; height: 116px; border-radius: 28px; box-shadow: 0 10px 30px #0006; }
.hero h1 { margin: 8px 0 0; font-size: 44px; letter-spacing: -1px; color: var(--yel); text-shadow: 0 3px 0 #0005; transform: rotate(-2deg); }
.hero .sub { color: #cfd8e3; font-weight: 600; margin-top: 2px; }
.hrow { display: flex; gap: 8px; justify-content: center; margin: 10px 0 4px; flex-wrap: wrap; }
.hrow .coins { font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 .btn { font-size: 16px; padding: 12px 8px; }
.goals { background: var(--bg2); border-radius: 18px; padding: 12px 14px; margin-top: 12px; }
.goals .gh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .goals .gh b { flex: 1; }
.gbadge { background: var(--red); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 900; }
.gl { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #ffffff14; }
.gl.ok { opacity: .55; } .gtx { flex: 1; font-size: 15px; }
.gp { height: 6px; background: #ffffff1c; border-radius: 4px; margin-top: 4px; overflow: hidden; } .gp i { display: block; height: 100%; background: var(--yel); }
.gc { border: 0; background: var(--grn); color: #fff; border-radius: 12px; padding: 6px 10px; font-weight: 900; font-size: 13px; }
.gr { font-size: 12px; text-align: right; color: #cfd8e3; } .gdone { color: var(--grn); font-weight: 900; font-size: 20px; }
.foot { text-align: center; color: #8d9aab; font-size: 12px; margin-top: 16px; }

/* ---------- Karte ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; border: 0; border-radius: 12px; padding: 9px 4px; background: #ffffff14; font-weight: 800; font-size: 13px; }
.tabs button.on { background: var(--yel); color: var(--ink); }
.msub { color: #cfd8e3; font-size: 14px; margin: 0 0 6px; text-align: center; }
.mapw { position: relative; }
.mapw svg { width: 100%; height: auto; display: block; border-radius: 22px; }
.node { position: absolute; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; border: 4px solid #fff; background: var(--yel); color: var(--ink);
  font-weight: 900; font-size: 19px; box-shadow: 0 4px 0 #0005; padding: 0; }
.node.done { background: var(--grn); color: #fff; } .node.lock { background: #8693a3; color: #dfe5ec; border-color: #c9d1da; }
.node.cur { animation: pulse 1.2s infinite; }
.node .st { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); font-size: 12px; color: #ffd84a; text-shadow: 0 1px 2px #000; white-space: nowrap; letter-spacing: -1px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 #ffc21a99, 0 4px 0 #0005; } 50% { box-shadow: 0 0 0 12px #ffc21a00, 0 4px 0 #0005; } }
.mlock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #1f2a36c4; border-radius: 22px; padding: 18px; text-align: center; }
.mlock .bx { background: var(--card); color: var(--ink); border-radius: 20px; padding: 16px; max-width: 320px; }
.mlock h3 { margin: 4px 0 6px; }

/* ---------- Spiel ---------- */
.ghud { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 6px; background: #1a232dee; }
.hbtn { border: 0; background: #ffffff1c; width: 40px; height: 40px; border-radius: 12px; font-size: 18px; flex: none; }
.glbl { flex: 1; min-width: 0; line-height: 1.15; } .glbl b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glbl small { color: #b8c4d2; font-size: 12px; }
.gstats { display: flex; gap: 6px; }
.pill { background: #ffffff18; border-radius: 999px; padding: 6px 9px; font-size: 14px; white-space: nowrap; transition: background .2s; }
.pill.warn { background: var(--red); }
.pill.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.gwrap { position: relative; flex: 1; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#bigtxt { position: absolute; z-index: 25; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; font-size: min(56px, 11vw); font-weight: 1000; color: var(--yel);
  text-shadow: 0 4px 0 #8a5a00, 0 8px 24px #000a; opacity: 0; transform: scale(.3) rotate(-6deg); letter-spacing: -1px; }
#bigtxt.on { animation: big 1.9s forwards; }
#bigtxt small { display: block; font-size: 20px; color: #fff; text-shadow: 0 2px 4px #000; letter-spacing: 0; }
@keyframes big { 0% { opacity: 0; transform: scale(.3) rotate(-6deg); } 18% { opacity: 1; transform: scale(1.15) rotate(-3deg); } 30% { transform: scale(1) rotate(-3deg); } 85% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-3deg); } }
.gpanel { background: #1a232d; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 2px solid #ffffff10; }
.ginfo { min-height: 40px; font-size: 14px; color: #dbe3ec; line-height: 1.25; padding: 0 2px 6px; }
.ginfo b { color: #fff; } .ginfo .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid #0004; }
.gmeth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mb { border: 0; border-radius: 14px; padding: 8px 4px 7px; background: #e8edf2; color: var(--ink); box-shadow: 0 4px 0 #9aa6b3; text-align: center; line-height: 1.15; min-height: 74px; position: relative; }
.mb .i { font-size: 22px; display: block; } .mb b { font-size: 13px; display: block; } .mb small { font-size: 12px; display: block; color: #3c4855; font-weight: 700; margin-top: 2px; }
.mb.best::after { content: '👍'; position: absolute; right: 4px; top: 2px; font-size: 14px; }
.mb.last { outline: 3px solid var(--yel); }
.mb:active { transform: translateY(3px); box-shadow: 0 1px 0 #9aa6b3; }
.mb[disabled] { opacity: .4; box-shadow: none; }
.mb .warn { color: var(--red); }
.gtools { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tbtn { border: 0; background: #ffffff16; border-radius: 12px; padding: 7px 10px; font-size: 13px; font-weight: 800; }
#gKinks { flex: 1; text-align: center; font-size: 13px; color: #b8c4d2; }
#ov { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: #10161dcc; z-index: 20; }
#ov.on { display: flex; }
#ov.clear { background: #10161d77; align-items: flex-end; }
.card { background: var(--card); color: var(--ink); border-radius: 24px; padding: 18px; width: 100%; max-width: 420px; max-height: 100%; overflow: auto; box-shadow: 0 12px 40px #0008; text-align: center; animation: pop .25s; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.card h2 { margin: 2px 0 6px; font-size: 26px; } .card p { margin: 6px 0; font-size: 16px; line-height: 1.35; }
.card .big { font-size: 56px; line-height: 1; }
.card .muted { color: var(--mut); font-size: 14px; }
.card .stars { font-size: 44px; color: #d4d9df; letter-spacing: 4px; } .card .stars i { font-style: normal; } .card .stars i.on { color: #ffb400; text-shadow: 0 3px 0 #c98600; }
.card .stars i.on { animation: starp .4s backwards; } .card .stars i:nth-child(2) { animation-delay: .25s; } .card .stars i:nth-child(3) { animation-delay: .5s; }
@keyframes starp { from { transform: scale(2.4); opacity: 0; } }
.card .cm { font-size: 40px; font-weight: 1000; color: var(--red); } .card .cm small { font-size: 16px; color: var(--mut); font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; text-align: left; background: #f1ebdc; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.kv b { text-align: right; }
.goal3 { text-align: left; background: #f1ebdc; border-radius: 14px; padding: 8px 12px; margin: 8px 0; font-size: 15px; }
.goal3 div { padding: 3px 0; }
.opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 2px solid #e0d6c0; background: #fff; border-radius: 14px; padding: 11px 12px; margin: 7px 0; text-align: left; font-weight: 800; font-size: 15px; color: var(--ink); }
.opt span { flex: 1; } .opt em { font-style: normal; font-size: 13px; color: var(--red); white-space: nowrap; }
.opt:active { background: #fff3cf; } .opt[disabled] { opacity: .4; }
.coach { background: #fff3cf; border-radius: 14px; padding: 8px 10px; font-size: 14px; text-align: left; margin: 8px 0; }

/* ---------- Abstimmung ---------- */
.vote h2 { font-size: 22px; }
.vmeter { position: relative; height: 26px; background: #e9dfca; border-radius: 13px; overflow: hidden; margin: 8px 0 4px; }
.vmeter i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2fa66a, #5fd08f); transition: width .15s; }
.vmeter::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 3px dashed #1f2a36; }
.vmeter b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.vtime { height: 6px; background: #e9dfca; border-radius: 3px; overflow: hidden; margin-bottom: 8px; } .vtime i { display: block; height: 100%; background: var(--red); }
.vgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vslot { aspect-ratio: 1 / 1.05; border-radius: 12px; background: #efe7d6; border: 2px dashed #d8ccb2; position: relative; }
.poster { position: absolute; inset: 0; border: 0; border-radius: 10px; font-weight: 1000; font-size: 13px; line-height: 1.1; padding: 6px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: pop .15s; box-shadow: 0 4px 0 #0003; }
.poster .pb { font-size: 26px; letter-spacing: -1px; }
.poster.ja { background: var(--grn); } .poster.nein { background: var(--red); }
.poster.hit { animation: hit .25s forwards; }
@keyframes hit { to { transform: scale(1.3); opacity: 0; } }

/* ---------- Werkhof ---------- */
.sec h3 { margin: 16px 0 6px; font-size: 18px; color: var(--yel); }
.up { display: flex; gap: 10px; align-items: center; background: var(--bg2); border-radius: 16px; padding: 10px 12px; margin: 7px 0; }
.up .ic { font-size: 30px; width: 40px; text-align: center; flex: none; }
.up .tx { flex: 1; } .up .tx b { display: block; } .up .tx span { font-size: 13px; color: #cfd8e3; }
.up .lv { font-size: 12px; color: var(--yel); }
.up button { border: 0; border-radius: 12px; padding: 9px 10px; font-weight: 900; background: var(--yel); color: var(--ink); white-space: nowrap; }
.up button[disabled] { opacity: .45; }
.up .ok { color: #7ee2a8; font-weight: 900; white-space: nowrap; }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skin { border: 3px solid transparent; background: var(--bg2); border-radius: 16px; padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 700; }
.skin.on { border-color: var(--yel); } .skin.lock { opacity: .55; }
.skin canvas { width: 64px; height: 64px; display: block; margin: 0 auto 4px; }

/* ---------- Hilfe & Einstellungen ---------- */
.txt { background: var(--bg2); border-radius: 18px; padding: 12px 16px; line-height: 1.45; font-size: 15px; }
.txt ul { padding-left: 20px; margin: 6px 0; } .txt li { margin: 5px 0; }
table.rk { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.rk td, table.rk th { padding: 6px 4px; border-bottom: 1px solid #ffffff16; text-align: center; }
table.rk td:first-child, table.rk th:first-child { text-align: left; }
table.rk .bst { color: #7ee2a8; font-weight: 900; }
#ov table.rk td, #ov table.rk th { border-bottom-color: #0001; }
#ov table.rk .bst { color: var(--grn2); }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 120px); background: #10161d; color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 800;
  transition: transform .3s; z-index: 200; max-width: 92%; text-align: center; box-shadow: 0 6px 20px #0006; }
#toast.on { transform: translate(-50%, 0); }
@media (min-width: 700px) { #app { border-left: 1px solid #ffffff10; border-right: 1px solid #ffffff10; } }
@media (max-height: 640px) { .mb { min-height: 62px; padding: 5px 3px; } .mb .i { font-size: 18px; } .ginfo { min-height: 34px; font-size: 13px; } }
/* Screenshot-Modus: Animationen sofort im Endzustand */
.shot *, .shot *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
