@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: #0b0f2e; --fg: #fff; --muted: #c3c8ec; --pink: #ff4d8d; --gold: #ffd23d; --cyan: #3dd6ff; --green: #3ddc84; --red: #ff5c6c; --card: rgba(18, 22, 60, .86); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; touch-action: manipulation; }
#sky { position: fixed; inset: 0; z-index: 0; }
#ui { position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 52px) 14px calc(env(safe-area-inset-bottom) + 52px); overflow-y: auto; }
body.playing #ui { padding: calc(env(safe-area-inset-top) + 8px) 10px calc(env(safe-area-inset-bottom) + 8px); overflow: hidden; }
#ui > * { width: 100%; max-width: 560px; }
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.hidden { display: none !important; }
.top { display: flex; gap: 8px; justify-content: flex-end; }
.pill { padding: 6px 12px; border-radius: 999px; background: rgba(10, 14, 40, .7); border: 1.5px solid rgba(255,255,255,.2); font-size: 16px; }
.sky-title { flex: 1 1 auto; min-height: 120px; }
.panel { background: var(--card); border: 1.5px solid rgba(255,255,255,.15); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.4); backdrop-filter: blur(6px); }
.panel.full { margin: auto 0; }
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .88; font-size: clamp(44px, 13vw, 70px); letter-spacing: -.01em; transform: rotate(-3deg); filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)); }
.logo span { background: linear-gradient(180deg, #fff, #ffe680 45%, var(--gold) 60%, #ff7a1a); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #2a0f3a; }
.logo span + span { background: linear-gradient(180deg, #fff, #9ff2ff 45%, var(--cyan) 60%, #7b5cff); -webkit-background-clip: text; background-clip: text; margin-left: .7em; }
.claim { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
h2 { margin: 0; text-align: center; font-size: 28px; }
h3 { margin: 6px 0 0; font-size: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip { appearance: none; border: 2px solid rgba(255,255,255,.25); background: rgba(10,14,40,.6); color: var(--muted); border-radius: 999px; padding: 8px 12px; font: 700 15px "Space Grotesk", sans-serif; cursor: pointer; }
.chip.on { background: var(--cyan); color: #06233a; border-color: #fff; }
.chip.big { font-size: 18px; padding: 12px; min-width: 64px; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.btn { appearance: none; border: 0; border-radius: 16px; padding: 13px 14px; font: 700 17px/1.15 "Space Grotesk", sans-serif; color: #fff; background: linear-gradient(180deg, #4b54a8, #2f3678); box-shadow: 0 4px 0 #1a1f50; cursor: pointer; touch-action: manipulation; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1f50; }
.btn.big { font-size: 24px; padding: 16px; background: linear-gradient(180deg, #ff7aa8, var(--pink) 55%, #d2195e); box-shadow: 0 5px 0 #8a0f3c; }
.btn.big small { display: block; font-size: 14px; opacity: .9; margin-top: 2px; }
.btn.gold { background: linear-gradient(180deg, #ffe066, #f0a800); color: #3a2400; box-shadow: 0 4px 0 #9a6a00; }
.btn.done { background: linear-gradient(180deg, #3ddc84, #1d9a56); box-shadow: 0 4px 0 #116a3a; }
.btn.sm { font-size: 15px; padding: 10px 8px; }
.btn.danger { background: #7a1f2e; box-shadow: 0 4px 0 #3e0d16; }
.btn[disabled] { opacity: .45; }
.row.small .btn { flex: 1 1 0; }
.link { appearance: none; border: 0; background: none; color: var(--muted); font: 700 14px "Space Grotesk", sans-serif; text-decoration: underline; cursor: pointer; }
/* ---------- Spiel ---------- */
body.playing #ui > * { max-width: 620px; }
.hud { display: flex; align-items: center; gap: 10px; }
.iconbtn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; border: 2px solid rgba(255,255,255,.3); background: rgba(10,14,40,.6); color: #fff; font: 700 15px sans-serif; cursor: pointer; }
.prog { flex: 1; }
.pl { font-size: 14px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.15); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .3s; }
.stat { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; color: var(--muted); min-width: 64px; }
.stat b { font-size: 22px; color: #fff; }
.stat b.warn { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.sky-game { flex: 1 1 auto; min-height: 90px; position: relative; }
.combo { position: absolute; right: 6px; top: 6px; font-size: 20px; color: var(--green); opacity: 0; transition: opacity .2s; text-shadow: 0 0 12px rgba(61,220,132,.7); }
.combo.on { opacity: 1; }
.play { display: flex; flex-direction: column; gap: 10px; }
.card { background: rgba(250,250,255,.96); color: #141a46; border-radius: 22px; padding: 14px 16px 12px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.35); border: 4px solid transparent; transition: border-color .15s, transform .15s; }
.card.good { border-color: var(--green); }
.card.bad { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.q { font-size: clamp(30px, 9vw, 46px); line-height: 1.15; min-height: 1.2em; word-break: break-word; }
.q.long { font-size: clamp(19px, 5.2vw, 27px); }
.ans { margin: 8px auto 2px; min-width: 150px; max-width: 80%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 18px; border-radius: 14px; background: #e9ecff; font-size: 38px; color: #1a2370; }
.ans.empty #inp::before { content: '?'; color: #a6add8; }
.caret { width: 3px; height: 34px; background: #3d4cff; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.fb { min-height: 24px; font-size: 18px; color: #555; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fb.good { color: #13894a; }
.fb.bad { color: #c21f35; }
.fb.info { color: #b56b00; }
.fb small { color: #4a4f78; font-size: 15px; }
.fb .weiter { margin-top: 4px; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8px; grid-template-areas: "a b c del" "d e f sl" "g h i ok" "m z k ok"; }
.k { appearance: none; border: 0; border-radius: 14px; min-height: 56px; font: 700 28px "Space Grotesk", sans-serif; color: #fff; background: linear-gradient(180deg, #4b54a8, #2f3678); box-shadow: 0 4px 0 #1a1f50; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.k:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1f50; }
.k[disabled] { opacity: .25; }
.k[data-k="7"] { grid-area: a; } .k[data-k="8"] { grid-area: b; } .k[data-k="9"] { grid-area: c; }
.k[data-k="4"] { grid-area: d; } .k[data-k="5"] { grid-area: e; } .k[data-k="6"] { grid-area: f; }
.k[data-k="1"] { grid-area: g; } .k[data-k="2"] { grid-area: h; } .k[data-k="3"] { grid-area: i; }
.k[data-k="-"] { grid-area: m; } .k[data-k="0"] { grid-area: z; } .k[data-k=","] { grid-area: k; }
.k[data-k="del"] { grid-area: del; background: linear-gradient(180deg, #6b4b8a, #48306a); }
.k[data-k="/"] { grid-area: sl; background: linear-gradient(180deg, #6b4b8a, #48306a); }
.k.ok { grid-area: ok; background: linear-gradient(180deg, #4be39a, #1fa863); box-shadow: 0 4px 0 #0f6a3c; font-size: 26px; }
/* ---------- Ende, Listen ---------- */
.res { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.res div { background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 4px; }
.res b { display: block; font-size: 22px; }
.res span { font-size: 12px; color: var(--muted); }
.panel p { margin: 0; text-align: center; }
.bigpts { font-size: 40px; color: var(--gold); }
.share { font-size: 14px; color: var(--muted); }
.reihen { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
canvas#prev { width: 100%; height: auto; background: radial-gradient(ellipse at center, #2a2f70, #0d1030); border-radius: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { flex: 1 1 auto; appearance: none; border: 1.5px solid rgba(255,255,255,.2); background: rgba(10,14,40,.6); color: var(--muted); border-radius: 10px; padding: 8px; font: 700 14px "Space Grotesk", sans-serif; cursor: pointer; }
.tab.on { background: var(--pink); color: #fff; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.item { appearance: none; border: 2px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; border-radius: 14px; padding: 10px 6px; font: 700 15px "Space Grotesk", sans-serif; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.item.on { border-color: var(--green); }
.item small { color: var(--muted); font-size: 13px; }
.sw { width: 34px; height: 18px; border-radius: 9px; border: 2px solid rgba(255,255,255,.5); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.bdg { background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px; text-align: center; opacity: .4; filter: grayscale(1); display: flex; flex-direction: column; gap: 2px; }
.bdg.on { opacity: 1; filter: none; background: rgba(255,210,61,.14); border: 1.5px solid rgba(255,210,61,.5); }
.bdg span { font-size: 30px; }
.bdg small { color: var(--muted); font-size: 12px; }
.lern { display: flex; flex-direction: column; gap: 8px; }
.lr { display: grid; grid-template-columns: 1fr 90px 92px; gap: 8px; align-items: center; font-size: 15px; }
.lbar { height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; }
.lbar i { display: block; height: 100%; }
.lr small { color: var(--muted); font-size: 12px; text-align: right; }
.ee { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; font-size: 12px; text-align: center; }
.ee b { color: var(--muted); }
.ee span { background: rgba(255,255,255,.07); border-radius: 4px; padding: 3px 0; }
.ee span.g { background: rgba(61,220,132,.5); } .ee span.y { background: rgba(255,210,61,.45); } .ee span.r { background: rgba(255,92,108,.55); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 8px; background: rgba(255,255,255,.05); border-radius: 12px; cursor: pointer; }
.opt input { width: 24px; height: 24px; accent-color: var(--pink); flex: 0 0 auto; margin-top: 2px; }
.opt span { display: flex; flex-direction: column; gap: 2px; }
.opt small { color: var(--muted); font-size: 13px; }
.help p, .help li { text-align: left !important; font-size: 15px; line-height: 1.45; color: #e3e6fb; }
.help ul { margin: 0; padding-left: 18px; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,8,25,.7); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--card); border: 1.5px solid rgba(255,255,255,.2); border-radius: 22px; padding: 20px; width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; }
#toast { position: fixed; left: 50%; top: 14%; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 18px; background: linear-gradient(90deg, #7b5cff, var(--pink)); font-size: 17px; text-align: center; max-width: min(90vw, 420px); opacity: 0; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#toast.show { animation: toast 2.4s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 10% { opacity: 1; transform: translateX(-50%) scale(1.05); } 18% { transform: translateX(-50%) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; } }
body.gross .q { font-size: clamp(36px, 11vw, 56px); }
body.gross .q.long { font-size: clamp(22px, 6.4vw, 32px); }
body.gross .k { font-size: 34px; min-height: 64px; }
/* kleine Höhen: kompakter */
@media (max-height: 700px) and (orientation: portrait) { .k { min-height: 48px; font-size: 24px; } .ans { min-height: 46px; font-size: 32px; } .q { font-size: clamp(26px, 8vw, 38px); } }
/* Querformat: Himmel links, Rechnen rechts */
@media (orientation: landscape) and (min-width: 640px) {
  body[data-screen="game"] #ui { display: grid; grid-template-columns: 1fr minmax(320px, 440px); grid-template-rows: auto 1fr; gap: 10px; align-items: stretch; }
  body[data-screen="game"] #ui > * { max-width: none; }
  body[data-screen="game"] .hud { grid-column: 1; grid-row: 1; }
  body[data-screen="game"] .sky-game { grid-column: 1; grid-row: 2; }
  body[data-screen="game"] .play { grid-column: 2; grid-row: 1 / span 2; justify-content: center; }
  body[data-screen="title"] #ui, body[data-screen="ende"] #ui { display: grid; grid-template-columns: 1fr minmax(320px, 470px); grid-template-rows: auto 1fr; column-gap: 16px; }
  body[data-screen="title"] .top, body[data-screen="ende"] .top { grid-column: 1 / span 2; }
  body[data-screen="title"] .sky-title, body[data-screen="ende"] .sky-title { grid-column: 1; grid-row: 2; }
  body[data-screen="title"] .panel, body[data-screen="ende"] .panel { grid-column: 2; grid-row: 2; align-self: center; max-width: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  body[data-screen="game"] .k { min-height: 40px; font-size: 22px; }
  body[data-screen="game"] .pad { gap: 6px; }
  body[data-screen="game"] .q { font-size: 28px; }
  body[data-screen="game"] .q.long { font-size: 18px; }
  body[data-screen="game"] .ans { min-height: 40px; font-size: 28px; margin-top: 4px; }
  body[data-screen="game"] .card { padding: 8px 10px; }
  #ui { padding-top: calc(env(safe-area-inset-top) + 44px); }
  .logo { font-size: 40px; }
  body[data-screen="title"] .panel, body[data-screen="ende"] .panel { align-self: start; }
  canvas#prev { max-height: 110px; width: auto; align-self: center; }
  .panel { padding: 12px; gap: 7px; }
  .btn.big { font-size: 20px; padding: 11px; }
  .btn { padding: 10px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .card.bad, .stat b.warn, .caret { animation: none; } }
