/* Größen-Spiele — gemeinsame Engine (Bühne 1280×720, skaliert) */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap");

:root {
  --p: #2a6fdb;          /* Primärfarbe (pro Spiel überschrieben) */
  --a: #ffb703;          /* Akzent */
  --bg1: #1b2a4a; --bg2: #2a6fdb;
  --ok: #2bb673; --bad: #e63946; --ink: #1d1d1f;
  --font: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0e1424; overflow: hidden; font-family: var(--font); color: var(--ink); user-select: none; -webkit-user-select: none; }
#g-wrap { position: fixed; inset: 0; display: grid; place-items: center; }
#g-stage { position: relative; width: 1280px; height: 720px; transform-origin: center center; overflow: hidden; overflow: clip;
  background: radial-gradient(1200px 700px at 30% 20%, var(--bg2), var(--bg1)); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#g-stage.shake { animation: g-shake .38s; }
@keyframes g-shake { 0%,100%{transform:translate(0,0) scale(var(--s,1))} 20%{transform:translate(-10px,0) scale(var(--s,1))} 40%{transform:translate(9px,0) scale(var(--s,1))} 60%{transform:translate(-6px,0) scale(var(--s,1))} 80%{transform:translate(4px,0) scale(var(--s,1))} }

/* Hintergrundmotiv (Arbeitsblatt, unscharf) */
#g-bgimg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(14px) saturate(1.2); opacity: .28; z-index: 0; }
#g-play, #g-hud { z-index: 1; }

/* HUD */
#g-hud { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0)); z-index: 20; color: #fff; pointer-events: none; }
#g-hud > * { pointer-events: auto; }
.g-pill { background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.35); border-radius: 30px; padding: 5px 14px; font-weight: 600; font-size: 20px; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(4px); white-space: nowrap; }
#g-level { background: var(--p); border-color: rgba(255,255,255,.6); }
#g-score b { font-size: 24px; min-width: 70px; display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }
#g-hearts { font-size: 24px; letter-spacing: 2px; }
#g-hearts .lost { filter: grayscale(1) opacity(.35); }
#g-hearts .pop { animation: g-heartpop .5s; display: inline-block; }
@keyframes g-heartpop { 0%{transform:scale(1)} 40%{transform:scale(1.6) rotate(-15deg)} 100%{transform:scale(1)} }
#g-combo { background: var(--a); color: #222; border-color: #fff; transform: scale(0); transition: transform .2s; }
#g-combo.on { transform: scale(1); }
#g-prog { flex: 1; height: 14px; background: rgba(255,255,255,.2); border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,.35); }
#g-prog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), #fff5c0); transition: width .4s; }
#g-timer { min-width: 86px; justify-content: center; }
#g-timer.low { background: var(--bad); animation: g-pulse .6s infinite alternate; }
@keyframes g-pulse { to { transform: scale(1.08); } }
.g-btn-icon { cursor: pointer; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 20px; display: grid; place-items: center; }
.g-btn-icon:hover { background: rgba(255,255,255,.3); }

/* Spielfläche */
#g-play { position: absolute; inset: 64px 0 0 0; }
.g-task { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); border-radius: 18px; padding: 10px 26px; font-size: 26px; font-weight: 600; box-shadow: 0 6px 0 rgba(0,0,0,.18); text-align: center; width: max-content; max-width: 1100px; line-height: 1.25; }
.g-task small { display: block; font-size: 17px; font-weight: 400; color: #555; margin-top: 2px; }

/* Buttons */
.g-btn { font-family: var(--font); font-weight: 600; font-size: 26px; border: none; border-radius: 18px; padding: 14px 30px; cursor: pointer; color: #fff; background: var(--p);
  box-shadow: 0 6px 0 rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s; }
.g-btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.g-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.g-btn.alt { background: #fff; color: var(--ink); }
.g-btn.big { font-size: 34px; padding: 18px 46px; }
.g-choice { font-family: var(--font); font-weight: 600; font-size: 28px; min-width: 150px; padding: 16px 22px; border-radius: 20px; border: 4px solid #fff; background: rgba(255,255,255,.95); color: var(--ink);
  cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.22); transition: transform .1s; }
.g-choice:hover { transform: translateY(-3px) scale(1.03); }
.g-choice.right { background: var(--ok); color: #fff; animation: g-bounce .5s; }
.g-choice.wrong { background: var(--bad); color: #fff; animation: g-wiggle .4s; }
.g-choice:disabled { cursor: default; }
@keyframes g-bounce { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 100%{transform:scale(1)} }
@keyframes g-wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-6deg)} 75%{transform:rotate(6deg)} }

/* Overlays */
.g-overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8,12,28,.62); backdrop-filter: blur(3px); animation: g-fade .25s; }
@keyframes g-fade { from { opacity: 0; } }
.g-card { background: #fff; border-radius: 28px; padding: 30px 40px; min-width: 560px; max-width: 900px; text-align: center; box-shadow: 0 16px 0 rgba(0,0,0,.2), 0 30px 60px rgba(0,0,0,.35); animation: g-pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes g-pop { from { transform: scale(.6); opacity: 0; } }
.g-card h1 { margin: 0 0 6px; font-size: 48px; color: var(--p); line-height: 1.05; }
.g-card h2 { margin: 0 0 10px; font-size: 34px; color: var(--p); }
.g-card p { font-size: 21px; line-height: 1.4; margin: 8px 0; color: #333; }
.g-card ul { text-align: left; font-size: 20px; line-height: 1.5; margin: 10px auto; max-width: 640px; }
.g-card .row { display: flex; gap: 14px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.g-stars { font-size: 70px; letter-spacing: 8px; margin: 6px 0; }
.g-stars span { display: inline-block; filter: grayscale(1) opacity(.3); transform: scale(.4); transition: all .4s cubic-bezier(.2,1.8,.4,1); }
.g-stars span.on { filter: none; transform: scale(1); }
.g-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.g-badge { background: #fff7e0; border: 3px solid var(--a); border-radius: 16px; padding: 6px 12px; font-size: 17px; font-weight: 600; animation: g-pop .4s both; }
.g-badge.locked { filter: grayscale(1); opacity: .4; border-style: dashed; }
.g-hs { font-size: 18px; color: #777; }

/* Start */
#g-start { position: absolute; inset: 0; z-index: 50; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; background: var(--bg1); }
#g-start .cover { background-size: cover; background-position: center; position: relative; }
#g-start .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0) 60%, var(--bg1)); }
#g-start .panel { padding: 50px 50px 40px 30px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
#g-start h1 { font-size: 62px; margin: 0; line-height: 1; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
#g-start .sub { font-size: 24px; opacity: .9; margin: 10px 0 18px; }
#g-start ul { font-size: 20px; line-height: 1.45; padding-left: 22px; margin: 0 0 22px; }
#g-start .meta { font-size: 17px; opacity: .75; margin-top: 14px; }

/* Effekte */
.g-float { position: absolute; z-index: 45; font-weight: 700; font-size: 34px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35); pointer-events: none; animation: g-floatup 1s forwards; }
@keyframes g-floatup { to { transform: translateY(-80px); opacity: 0; } }
.g-tip { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 30; background: #fff8e1; border: 4px solid var(--a); border-radius: 20px; padding: 12px 22px; font-size: 22px; max-width: 900px; box-shadow: 0 8px 20px rgba(0,0,0,.25); animation: g-pop .3s; text-align: center; }
.g-tip b { color: #b35c00; }
canvas.g-fx { position: absolute; inset: 0; z-index: 44; pointer-events: none; }
.g-flash { position: absolute; inset: 0; z-index: 43; pointer-events: none; animation: g-flash .45s forwards; }
@keyframes g-flash { from { opacity: .45; } to { opacity: 0; } }

/* Drag & Drop */
.g-drag { cursor: grab; touch-action: none; }
.g-drag.dragging { cursor: grabbing; z-index: 35; filter: drop-shadow(0 12px 12px rgba(0,0,0,.35)); }
.g-drop.hot { outline: 5px dashed var(--a); outline-offset: 4px; }
