@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: #1d4a1b; --bar: #24561f; --fg: #fff; --muted: #d6e8c8; --acc: #ffd23d; --pink: #ff3d7f; --card: rgba(20, 40, 18, .92); --line: rgba(255,255,255,.16); }
body[data-theme="klassisch"] { --bg: #5d616b; --bar: #474b54; --muted: #e3e5ea; --card: rgba(40, 43, 50, .94); }
body[data-theme="nacht"] { --bg: #0b0e20; --bar: #121633; --muted: #b8c0ee; --acc: #3dd6ff; --card: rgba(16, 20, 48, .94); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }
#bar { flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 6px; background: var(--bar); box-shadow: 0 2px 10px rgba(0,0,0,.25); position: relative; z-index: 2; }
#bar button { appearance: none; border: 0; cursor: pointer; color: #fff; }
#btnMenu { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.cnt { display: flex; align-items: center; gap: 6px; font-size: 22px; font-variant-numeric: tabular-nums; justify-self: center; background: rgba(0,0,0,.28); padding: 5px 12px; border-radius: 12px; min-width: 86px; justify-content: center; }
.cnt svg { opacity: .9; }
#face { width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a0, #ffd23d 55%, #e0a400); box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 -3px 0 rgba(0,0,0,.15); position: relative; justify-self: center; transition: transform .1s; }
#face:active { transform: scale(.92); }
#face i { position: absolute; inset: 0; }
#face i::before { content: ""; position: absolute; left: 14px; right: 14px; top: 17px; height: 6px; background: radial-gradient(circle, #2a1a00 2.4px, transparent 3px) left/12px 6px no-repeat, radial-gradient(circle, #2a1a00 2.4px, transparent 3px) right/12px 6px no-repeat; }
#face i::after { content: ""; position: absolute; left: 15px; right: 15px; top: 27px; height: 9px; border: 3px solid #2a1a00; border-top: 0; border-radius: 0 0 14px 14px; }
#face[data-s="won"] i::before { top: 15px; height: 9px; background: #2a1a00; border-radius: 3px; left: 11px; right: 11px; box-shadow: none; clip-path: polygon(0 0, 100% 0, 100% 40%, 60% 40%, 56% 100%, 44% 100%, 40% 40%, 0 40%); }
#face[data-s="lost"] i::before { background: none; height: 10px; top: 14px; }
#face[data-s="lost"] i::before { background: linear-gradient(45deg, transparent 40%, #2a1a00 40% 60%, transparent 60%) left/10px 10px no-repeat, linear-gradient(-45deg, transparent 40%, #2a1a00 40% 60%, transparent 60%) left/10px 10px no-repeat, linear-gradient(45deg, transparent 40%, #2a1a00 40% 60%, transparent 60%) right/10px 10px no-repeat, linear-gradient(-45deg, transparent 40%, #2a1a00 40% 60%, transparent 60%) right/10px 10px no-repeat; }
#face[data-s="lost"] i::after { border: 3px solid #2a1a00; border-bottom: 0; border-radius: 14px 14px 0 0; top: 30px; }
#modeLbl { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
#wrap { flex: 1 1 auto; position: relative; overflow: hidden; }
#board { position: absolute; inset: 0; touch-action: none; display: block; }
#tools { flex: 0 0 auto; display: flex; justify-content: center; gap: 12px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px); background: var(--bar); }
#tools button { appearance: none; border: 0; cursor: pointer; color: #fff; font: 700 15px "Space Grotesk", sans-serif; }
#btnFlag { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 14px; background: rgba(255,255,255,.12); border: 2px solid transparent; }
#btnFlag.on { background: #ff2f4e; border-color: #fff; box-shadow: 0 0 16px rgba(255,47,78,.6); }
#btnFlag.on path:last-child { fill: #fff; }
#zoomBox { display: flex; gap: 6px; }
#zoomBox button { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 24px; }
@media (hover: hover) and (pointer: fine) { #btnFlag { display: none; } }

/* Bildschirme */
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.scr { pointer-events: auto; position: absolute; inset: 0; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 56px) 16px calc(env(safe-area-inset-bottom) + 70px); display: flex; flex-direction: column; align-items: center; gap: 12px; background: radial-gradient(ellipse at 50% 0%, rgba(80,160,60,.55), rgba(10,30,10,.94)); touch-action: pan-y; }
body[data-theme="klassisch"] .scr { background: radial-gradient(ellipse at 50% 0%, rgba(140,150,170,.6), rgba(25,28,34,.95)); }
body[data-theme="nacht"] .scr { background: radial-gradient(ellipse at 50% 0%, rgba(70,60,160,.6), rgba(6,8,20,.96)); }
.scr > * { width: 100%; max-width: 480px; }
.scr.end { justify-content: center; background: rgba(0,0,0,.45); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .85; font-size: clamp(56px, 17vw, 96px); letter-spacing: -.02em; margin: 4px 0 0; filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)); transform: rotate(-2deg); }
.logo span { background: linear-gradient(180deg, #fff 0%, #fff2a8 35%, #ffd23d 55%, #ff8a1a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #20330f; }
.logo span + span { background: linear-gradient(180deg, #fff 0%, #c8ff9a 40%, #6fd13c 60%, #2e8a1e 100%); -webkit-background-clip: text; background-clip: text; margin-left: .7em; }
.claim { margin: 0; text-align: center; color: var(--muted); }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lvl { appearance: none; border: 0; cursor: pointer; border-radius: 16px; padding: 14px 6px 10px; color: #fff; background: linear-gradient(180deg, #5bbf3a, #2f8a1f); box-shadow: 0 4px 0 #1b5a10, 0 8px 18px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 3px; align-items: center; font-family: inherit; }
.lvl:nth-child(2) { background: linear-gradient(180deg, #ffb340, #e07a00); box-shadow: 0 4px 0 #8a4a00, 0 8px 18px rgba(0,0,0,.25); }
.lvl:nth-child(3) { background: linear-gradient(180deg, #ff5a7a, #d0103c); box-shadow: 0 4px 0 #7a0020, 0 8px 18px rgba(0,0,0,.25); }
.lvl:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.lvl b { font-size: 16px; } .lvl small { font-size: 12px; opacity: .9; } .lvl em { font-style: normal; font-size: 11px; opacity: .8; }
.switch { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: var(--card); padding: 10px 14px; border-radius: 14px; cursor: pointer; border: 1.5px solid var(--line); }
.switch input { position: absolute; opacity: 0; }
.switch span { grid-row: span 2; width: 48px; height: 28px; border-radius: 14px; background: rgba(255,255,255,.25); position: relative; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: #3dc45a; } .switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid #fff; }
.switch small { color: var(--muted); font-size: 12px; }
.btn { appearance: none; border: 0; border-radius: 14px; padding: 12px 14px; font: 700 16px/1.1 "Space Grotesk", sans-serif; color: #fff; background: rgba(255,255,255,.14); box-shadow: 0 3px 0 rgba(0,0,0,.3); cursor: pointer; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.big { font-size: 22px; padding: 16px; background: linear-gradient(180deg, #ff6b8a, #ff2f4e 55%, #c8102e); box-shadow: 0 4px 0 #7a0018, 0 10px 24px rgba(255,47,78,.35); }
.btn.small { font-size: 14px; padding: 8px 12px; }
.btn.tag { display: flex; align-items: center; gap: 14px; text-align: left; background: linear-gradient(90deg, rgba(61,214,255,.25), rgba(123,92,255,.3)); border: 1.5px solid rgba(255,255,255,.3); }
.btn.tag b { display: block; font-size: 18px; } .btn.tag small { color: var(--muted); font-size: 13px; }
.cal { flex: 0 0 52px; height: 56px; border-radius: 10px; background: #fff; color: #222; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 24px; line-height: 1; box-shadow: inset 0 9px 0 #ff2f4e; padding-top: 8px; }
.cal small { color: #ff2f4e !important; font-size: 11px !important; margin-top: 2px; }
.row { display: flex; gap: 8px; } .row .btn { flex: 1; }
.link { appearance: none; background: none; border: 0; color: var(--muted); text-decoration: underline; font: 700 15px "Space Grotesk", sans-serif; cursor: pointer; }
h2 { margin: 4px 0; text-align: center; font-size: 28px; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.end .card, .card.end { text-align: center; }
.card.end h2 { font-size: 30px; }
.card.end.won h2 { color: var(--acc); }
.card.end .big { font-size: 40px; margin: 4px 0; }
.card.end .sub { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.card.end .btn { display: block; width: 100%; margin-top: 8px; }
.card.end .row .btn { margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0; font-size: 12px; color: var(--muted); }
.stats b { display: block; font-size: 18px; color: #fff; }
.form label, .lbl { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 15px; }
.form input[type=number] { font: 700 18px "Space Grotesk", sans-serif; padding: 10px; border-radius: 10px; border: 0; background: rgba(255,255,255,.9); color: #111; }
.form input[type=range] { accent-color: var(--pink); }
.chk { flex-direction: row !important; align-items: flex-start; gap: 10px !important; }
.chk input { width: 20px; height: 20px; accent-color: #3dc45a; flex: 0 0 auto; margin-top: 1px; }
.seg { display: flex; gap: 6px; } .seg button { flex: 1; appearance: none; border: 1.5px solid var(--line); background: rgba(0,0,0,.25); color: var(--muted); border-radius: 10px; padding: 9px 4px; font: 700 14px "Space Grotesk", sans-serif; cursor: pointer; }
.seg button.on { background: var(--pink); color: #fff; }
.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.st { width: 100%; border-collapse: collapse; font-size: 13px; }
.st th { color: var(--muted); font-weight: 700; text-align: right; padding: 4px; } .st th:first-child { text-align: left; }
.st td { padding: 6px 4px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; } .st td:first-child { text-align: left; }
.help p { line-height: 1.45; margin: 0 0 10px; font-size: 15px; }
.demo { display: grid; grid-template-columns: repeat(3, 34px); gap: 2px; margin: 4px auto 12px; width: max-content; }
.d { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 3px; font-size: 20px; color: #1e6fd9; }
.d.o { background: #f0dcb0; } .d.h { background: #8ed15a; } .d.f { background: #8ed15a; position: relative; }
.d.f::after { content: ""; position: absolute; left: 13px; top: 7px; width: 3px; height: 20px; background: #3a2a1a; box-shadow: 3px 0 0 0 transparent; }
.d.f::before { content: ""; position: absolute; left: 16px; top: 7px; border-left: 12px solid #ff2f4e; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
#toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(0,0,0,.8); padding: 9px 16px; border-radius: 14px; font-size: 15px; opacity: 0; pointer-events: none; z-index: 20; max-width: 90vw; text-align: center; transition: opacity .25s; }
#toast.show { opacity: 1; }
.noscript { padding: 20px; }
@media (orientation: landscape) and (max-height: 520px) {
  #app { display: grid; grid-template-columns: calc(env(safe-area-inset-left) + 92px) 1fr calc(env(safe-area-inset-right) + 84px); grid-template-rows: 100%; }
  #bar { grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: center; gap: 10px; padding: 8px 6px 8px calc(env(safe-area-inset-left) + 6px); box-shadow: 2px 0 10px rgba(0,0,0,.25); }
  .cnt { font-size: 17px; padding: 4px 6px; min-width: 0; width: 100%; }
  #face { width: 46px; height: 46px; }
  #face i::before { left: 12px; right: 12px; top: 15px; } #face i::after { left: 13px; right: 13px; top: 24px; height: 8px; }
  #btnMenu { justify-self: center; }
  #modeLbl { display: none; }
  #tools { flex-direction: column; justify-content: center; align-items: center; padding: 8px calc(env(safe-area-inset-right) + 6px) 8px 6px; }
  #btnFlag { flex-direction: column; padding: 8px 6px; font-size: 12px; gap: 2px; }
  #zoomBox { flex-direction: column; }
  .scr { padding-top: 12px; } .logo { font-size: 52px; }
}
@media (min-aspect-ratio: 5/4) and (min-height: 521px) { .scr.titel { padding-top: 40px; } }

body.menu #bar, body.menu #tools { visibility: hidden; }
.lostTxt { font-size: 22px; color: var(--muted); }
