/* flippingreality Spiele – gemeinsames Aussehen aller Spiele. Keine fremden Schriften, alles lokal. */
:root {
  --bg: #f4efe6; --card: #fffdf8; --ink: #1f2430; --muted: #6b6f7a; --line: #e2d9c8; --soft: #ece5d7;
  --acc: #1f2430; --acc-ink: #fff;
  --ok: #1f9e89; --near: #f0a43a; --no: #8b93a1; --bad: #d1495b;
  --r: 14px; --shadow: 0 1px 0 rgba(31,36,48,.06), 0 6px 18px rgba(31,36,48,.07);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
.g-wortjagd { --acc: #e2703a; }
.g-neunerfeld { --acc: #2f6fdb; }
.g-laenderkreuz { --acc: #2a9d6f; }
.g-grenzgaenger { --acc: #b0418f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.fr-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.fr-brand { font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 15px; white-space: nowrap; }
.fr-brand span { color: var(--muted); font-weight: 600; }
.fr-title { flex: 1; text-align: center; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--acc); }
.fr-tools { display: flex; gap: 6px; }
.fr-icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; display: grid; place-items: center; }
.fr-icon:hover { border-color: var(--ink); }
@media (max-width: 480px) {
  .fr-top { padding: 8px 10px; gap: 6px; }
  .fr-brand { font-size: 13px; }
  .fr-brand span { display: none; }
  .fr-top { flex-wrap: wrap; row-gap: 4px; }
  .fr-tools { margin-left: auto; align-items: center; }
  .fr-title { order: 3; flex-basis: 100%; text-align: center; font-size: 18px; }
  .fr-icon { width: 34px; height: 34px; }
}
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 14px 28px; }
.fr-foot { text-align: center; font-size: 13px; color: var(--muted); padding: 18px 12px 24px; }
.fr-foot a { color: var(--muted); margin: 0 8px; }
.fr-btn { border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 700; cursor: pointer; background: var(--acc); color: var(--acc-ink); }
.fr-btn.alt { background: var(--soft); color: var(--ink); }
.fr-btn:disabled { opacity: .45; cursor: default; }
.fr-btn:focus-visible, .fr-icon:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.fr-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.fr-seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; }
.fr-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.fr-seg button.on { background: var(--card); box-shadow: var(--shadow); color: var(--acc); }
.fr-center { text-align: center; }
.fr-muted { color: var(--muted); }
.fr-small { font-size: 13px; }
.fr-msg { min-height: 24px; text-align: center; font-weight: 600; margin: 10px 0; }
/* Dialog */
.fr-veil { position: fixed; inset: 0; background: rgba(31,36,48,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.fr-dlg { background: var(--card); border-radius: 18px; max-width: 460px; width: 100%; max-height: 88vh; overflow: auto; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.fr-dlg h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.02em; }
.fr-dlg p, .fr-dlg li { line-height: 1.5; }
.fr-toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 600; z-index: 60; pointer-events: none; }
.fr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin: 8px 0 14px; }
.fr-stats b { display: block; font-size: 26px; }
.fr-stats span { font-size: 12px; color: var(--muted); }
.fr-bars div { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 13px; }
.fr-bars i { display: block; background: var(--no); color: #fff; font-style: normal; text-align: right; padding: 2px 6px; border-radius: 4px; min-width: 22px; }
.fr-bars i.on { background: var(--acc); }

/* ---------- Spiele-Übersicht ---------- */
.hub-head { text-align: center; margin: 10px 0 22px; }
.hub-head h1 { font-size: 34px; letter-spacing: -.03em; margin: 0 0 6px; }
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hub a { display: block; text-decoration: none; background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); border-top: 6px solid var(--acc); }
.hub a:hover { transform: translateY(-2px); }
.hub h2 { margin: 0 0 6px; color: var(--acc); letter-spacing: -.02em; }
.hub p { margin: 0; color: var(--muted); line-height: 1.45; }

/* ---------- Wortjagd ---------- */
.wj-grid { display: grid; gap: 7px; justify-content: center; margin: 4px auto 8px; }
.wj-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.wj-row.shake { animation: wj-shake .35s; }
.wj-t { width: min(15vw, 60px); height: min(15vw, 60px); border-radius: 12px; background: var(--card); border: 2px solid var(--line);
  display: grid; place-items: center; font-size: min(7.5vw, 30px); font-weight: 800; text-transform: uppercase; }
.wj-t.fill { border-color: var(--ink); }
.wj-t.s2, .wj-t.s1, .wj-t.s0 { color: #fff; border-color: transparent; animation: wj-pop .4s both; animation-delay: calc(var(--n) * 90ms); }
.wj-t.s2 { background: var(--ok); } .wj-t.s1 { background: var(--near); } .wj-t.s0 { background: var(--no); }
.wj-kb { display: grid; gap: 6px; margin-top: 10px; user-select: none; }
.wj-kr { display: flex; gap: 5px; justify-content: center; }
.wj-k { flex: 1; max-width: 46px; height: 52px; border: 0; border-radius: 8px; background: var(--soft); font-weight: 700; cursor: pointer; font-size: 16px; padding: 0; }
.wj-k.wide { max-width: 72px; flex: 1.6; font-size: 13px; }
.wj-k.s2 { background: var(--ok); color: #fff; } .wj-k.s1 { background: var(--near); color: #fff; } .wj-k.s0 { background: var(--no); color: #fff; }
@keyframes wj-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes wj-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Neunerfeld ---------- */
.nf-wrap { display: flex; flex-direction: column; align-items: center; }
.nf-bar { display: flex; justify-content: space-between; width: min(94vw, 468px); font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.nf-grid { display: grid; grid-template-columns: repeat(9, 1fr); width: min(94vw, 468px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--card); }
.nf-c { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); font-size: min(6vw, 26px); font-weight: 600; color: var(--acc); cursor: pointer; padding: 0; position: relative; }
.nf-c.giv { color: var(--ink); font-weight: 800; }
.nf-c.br { border-right: 2px solid var(--ink); } .nf-c.bb { border-bottom: 2px solid var(--ink); }
.nf-c.peer { background: #eef3fd; } .nf-c.same { background: #d7e4fb; } .nf-c.sel { background: #bcd2f8; }
.nf-c.err { color: var(--bad); background: #fbe3e6; }
.nf-c.win { animation: nf-win .5s both; animation-delay: calc(var(--n) * 8ms); }
.nf-notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: min(2.4vw, 10px); color: var(--muted); font-weight: 600; line-height: 1; }
.nf-notes i { font-style: normal; display: grid; place-items: center; }
.nf-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; width: min(94vw, 468px); margin-top: 12px; }
.nf-d { height: 50px; border: 0; border-radius: 10px; background: var(--soft); font-size: 20px; font-weight: 700; cursor: pointer; }
.nf-d.done { opacity: .3; }
.nf-tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.nf-tools button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.nf-tools button.on { background: var(--acc); color: #fff; border-color: var(--acc); }
@keyframes nf-win { 50% { background: #bcd2f8; } }

/* ---------- Länderkreuz ---------- */
.lk-board { display: grid; grid-template-columns: minmax(70px, 1fr) repeat(3, minmax(0, 1.25fr)); gap: 6px; max-width: 560px; margin: 0 auto; }
.lk-h { display: grid; place-items: center; text-align: center; font-size: 13px; font-weight: 700; padding: 8px 4px; background: var(--soft); border-radius: 10px; line-height: 1.25; min-height: 64px; }
.lk-h small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.lk-c { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; text-align: center; padding: 4px; font-size: 13px; font-weight: 700; }
.lk-c:hover { border-color: var(--acc); }
.lk-c.sel { border: 2px solid var(--acc); box-shadow: 0 0 0 3px rgba(42,157,111,.18); }
.lk-c.ok { background: var(--acc); color: #fff; border: 2px solid var(--acc); cursor: default; }
.lk-c.ok small { display: block; font-weight: 500; opacity: .9; font-size: 11px; }
.lk-c.miss { background: var(--soft); color: var(--muted); border-style: solid; cursor: pointer; font-weight: 500; }
.lk-corner { display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); }
.lk-corner b { display: block; font-size: 24px; color: var(--ink); }
.lk-in { position: relative; max-width: 560px; margin: 14px auto 0; }
.lk-in input { width: 100%; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--line); font: inherit; font-size: 17px; background: var(--card); }
.lk-in input:focus { outline: none; border-color: var(--acc); }
.lk-sug { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-top: 4px; z-index: 5; box-shadow: var(--shadow); overflow: hidden; }
.lk-sug button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-size: 16px; }
.lk-sug button:hover, .lk-sug button.on { background: var(--soft); }
.lk-sug button.used { color: var(--muted); text-decoration: line-through; }
.lk-list { columns: 2; font-size: 14px; padding-left: 18px; }

/* ---------- Grenzgänger ---------- */
.gg-task { text-align: center; font-size: 18px; margin: 4px 0 10px; }
.gg-task b { color: var(--acc); }
.gg-stage { position: relative; width: min(94vw, 600px); margin: 0 auto; background: #e7eef2; border-radius: 16px; overflow: hidden; touch-action: none; box-shadow: inset 0 0 0 1px var(--line); }
.gg-stage svg { display: block; width: 100%; height: auto; max-height: 66vh; cursor: crosshair; }
.gg-land { fill: #f3e7cf; stroke: #f3e7cf; stroke-width: 2; stroke-linejoin: round; }
.gg-coast { fill: none; stroke: #4a4f5c; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.gg-pen { fill: none; stroke: var(--acc); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.gg-true { fill: none; stroke: var(--ink); stroke-width: 4; stroke-dasharray: 10 7; stroke-linecap: round; }
.gg-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.gg-dots i { width: 34px; height: 8px; border-radius: 4px; background: var(--line); }
.gg-dots i.cur { background: var(--acc); } .gg-dots i.done { background: var(--ink); }
.gg-score { text-align: center; margin: 10px 0 0; }
.gg-score b { font-size: 40px; color: var(--acc); display: block; letter-spacing: -.03em; }
.gg-sum { max-width: 420px; margin: 12px auto; }
.gg-sum div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- Rechtsseiten ---------- */
.legal { background: var(--card); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); line-height: 1.6; }
.legal h1 { margin-top: 0; letter-spacing: -.02em; }
.legal h2 { font-size: 19px; margin-top: 26px; }

/* ---------- Etappe 3: Länderquiz, Juwelen, Arcade, Casino ---------- */
.g-laenderquiz { --acc: #1a8fa0; }
.g-juwelen { --acc: #7b4fd6; }
.g-arcade { --acc: #e0533d; }
.g-casino { --acc: #b8860b; }
.x-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; max-width: 560px; margin: 0 auto; }
.x-q { font-size: 20px; font-weight: 700; text-align: center; margin: 6px 0 16px; line-height: 1.35; }
.x-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.x-opt { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px 10px; font-weight: 700; cursor: pointer; font-size: 16px; }
.x-opt:hover:not(:disabled) { border-color: var(--acc); }
.x-opt.good { background: var(--ok); color: #fff; border-color: var(--ok); }
.x-opt.bad { background: var(--bad); color: #fff; border-color: var(--bad); }
.x-info { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--soft); text-align: center; }
.x-hud { display: flex; justify-content: space-between; max-width: 560px; margin: 0 auto 8px; font-weight: 700; color: var(--muted); }
.x-hud b { color: var(--ink); }
.x-end { text-align: center; }
.x-end .big { font-size: 34px; font-weight: 800; color: var(--acc); letter-spacing: -.02em; }
/* Juwelen */
.jw-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(94vw, 440px); aspect-ratio: 1; margin: 0 auto; touch-action: none; user-select: none; }
.jw-g { display: grid; place-items: center; font-size: min(7vw, 32px); background: var(--card); border-radius: 10px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s; }
.jw-g.sel { outline: 3px solid var(--acc); transform: scale(1.06); }
.jw-g.pop { animation: jw-pop .26s forwards; }
.jw-g.fall { animation: jw-fall .3s ease-in both; }
.jw-g.shake { animation: wj-shake .3s; }
@keyframes jw-pop { to { transform: scale(0); opacity: 0; } }
@keyframes jw-fall { from { transform: translateY(calc(var(--d) * -105%)); } }
/* Arcade */
.ar-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ar-list button { text-align: left; border: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; cursor: pointer; }
.ar-list b { display: block; font-size: 18px; color: var(--acc); }
.ar-list small { color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }
.ar-stage { display: grid; justify-items: center; gap: 10px; }
.ar-stage canvas { width: min(92vw, 360px); height: auto; border-radius: 16px; box-shadow: var(--shadow); touch-action: none; background: #111; }
/* Casino */
.cs-note { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.cs-chips { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.cs-chip { width: 48px; height: 48px; border-radius: 50%; border: 3px dashed #d9b44a; background: #fff8e1; font-weight: 800; cursor: pointer; }
.cs-chip.on { background: var(--acc); color: #fff; border-style: solid; }
.cs-strip { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.cs-n { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.cs-n.r { background: #c0392b; } .cs-n.b { background: #22252e; } .cs-n.g { background: #1f9e6a; }
.cs-n.mid { transform: scale(1.25); box-shadow: 0 0 0 3px #e0a526; }
.cs-bets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cs-bet { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 16px; font-weight: 700; cursor: pointer; }
.cs-bet.on { border-color: var(--acc); background: #fff4d6; }
.cs-bet.r { color: #c0392b; } .cs-bet.b { color: #22252e; }
.cs-nums { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin: 12px auto 0; max-width: 520px; }
.cs-num { border: 0; border-radius: 6px; color: #fff; font-weight: 700; padding: 6px 0; cursor: pointer; font-size: 13px; }
.cs-num.r { background: #c0392b; } .cs-num.b { background: #22252e; } .cs-num.g { background: #1f9e6a; }
.cs-num.on { outline: 3px solid #e0a526; }
.cs-dice { display: flex; gap: 14px; justify-content: center; margin: 12px 0; }
.cs-die { width: 64px; height: 64px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px; }
.cs-die i { display: block; width: 12px; height: 12px; border-radius: 50%; place-self: center; }
.cs-die i.p { background: #22252e; }
.cs-hand { text-align: center; margin: 10px 0; }
.cs-cards { display: flex; gap: 6px; justify-content: center; margin-top: 4px; min-height: 76px; }
.cs-card { width: 52px; height: 74px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-weight: 800; font-size: 18px; line-height: 1; }
.cs-card.rot { color: #c0392b; }
.cs-card.zu { background: repeating-linear-gradient(45deg, #b8860b, #b8860b 6px, #d4a83a 6px, #d4a83a 12px); }
.cs-msg { text-align: center; font-weight: 700; min-height: 26px; margin: 10px 0; }
.cs-msg.ok { color: var(--ok); } .cs-msg.no { color: var(--bad); }
.cs-gate { text-align: center; }
@media (max-width: 480px) { .cs-nums { grid-template-columns: repeat(7, 1fr); } .x-opts { grid-template-columns: 1fr; } }

/* ---------- Etappe 4: Canvas-Spiele (Pixel Dash, Abenteuer) ---------- */
.g-pixeldash { --acc: #3b5bdb; }
.g-abenteuer { --acc: #2f9e44; }
.g-nightaudit { --acc: #9c7a2c; }
.g-maumau { --acc: #c2255c; }
.cv-main { max-width: 980px; }
.cv-wrap { position: relative; width: 100%; max-width: 900px; margin: 0 auto; }
.cv-wrap canvas { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); background: #06061a; image-rendering: pixelated; touch-action: none; }
.cv-menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #fff;
  background: rgba(6, 6, 26, .82); border-radius: 14px; padding: 12px; }
.cv-menu h1 { margin: 0; font: 800 clamp(26px, 6vw, 44px)/1 'Courier New', monospace; color: #ffd700; letter-spacing: .04em; }
.cv-sub { margin: 0; color: #aab; font-size: 14px; }
.cv-erg { margin: 2px 0; color: #ffd700; font-weight: 700; font-size: 14px; min-height: 1em; }
.cv-best { margin: 0; color: #889; font-size: 12px; }
.cv-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cv-hc { background: #c92a2a; }
@media (max-width: 600px) { .cv-menu { gap: 4px; } .cv-menu .fr-btn { padding: 9px 14px; } .cv-sub, .cv-best { font-size: 11px; } }

/* ---------- App-Modus: jede Spielseite füllt den Bildschirm wie eine App, nie scrollen ---------- */
.fr-back { display: none; }
.fr-menu { display: grid; gap: 6px; }
.fr-menu a { display: block; padding: 12px 14px; border-radius: 12px; background: var(--soft); text-decoration: none; font-weight: 700; }
html.fr-app, html.fr-app body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.fr-app body { height: 100dvh; min-height: 0; touch-action: manipulation; }
html.fr-app .fr-top { flex: none; flex-wrap: nowrap; gap: 8px; padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
html.fr-app .fr-title { order: 0; flex: 1 1 auto; flex-basis: auto; min-width: 0; font-size: clamp(15px, 4.4vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.fr-app .fr-tools { margin-left: 0; }
html.fr-app .fr-icon { width: 36px; height: 36px; flex: none; }
html.fr-app main { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); container-type: size; }
html.fr-app main > * { max-width: 100%; }
html.fr-app .fr-foot { display: none; }
@media (max-width: 560px) {
  html.fr-app .fr-brand .fr-bt, html.fr-app .fr-brand span { display: none; }
  html.fr-app .fr-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); font-size: 22px; line-height: 1; }
  html.fr-app .fr-top .k-name { display: none; }
}
/* Canvas-Spiele: Feld = main, Bild per FR.einpassen eingepasst, Steuerung liegt im Spiel */
html.fr-app .cv-main { position: relative; padding: 0; background: #06061a; justify-content: flex-start; }
html.fr-app .cv-main .cv-wrap, html.fr-app #gameWrap { flex: none; max-width: none; margin: auto; }
html.fr-app .cv-wrap canvas, html.fr-app #gameWrap canvas { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
html.fr-app .cv-menu { border-radius: 0; overflow: auto; }
html.fr-app .sk-pad { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)); pointer-events: none; z-index: 5; align-items: flex-end; }
html.fr-app .sk-pad .sk-btn, html.fr-app .sk-pad .sk-stick { pointer-events: auto; }
html.fr-app .sk-btn { background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(2px); width: clamp(52px, 15vw, 68px); height: clamp(52px, 15vw, 68px); font-size: clamp(20px, 6vw, 26px); }
html.fr-app .sk-btn.on { background: rgba(224,165,38,.9); color: #1f2430; }
html.fr-app .sk-stick { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
html.fr-app .sk-stick i { background: rgba(255,255,255,.55); }
html.fr-app .sk-grp { align-items: flex-end; flex-wrap: wrap; max-width: 50%; justify-content: flex-end; }
html.fr-app .sk-grp.sk-links { justify-content: flex-start; }
html.fr-app .cv-unten { margin-top: auto; }
html.fr-app main > .ab-pad, html.fr-app main > #pdPad { position: static; }
html.fr-app main > .ab-pad > .sk-stick { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 6; width: clamp(110px, 32vw, 140px); height: clamp(110px, 32vw, 140px); }
/* App-Modus: Inhalt mittig, aber nie oben abgeschnitten; Größen aus der Feldhöhe (cqh) */
html.fr-app main { justify-content: safe center; }
html.fr-app main > .fr-row { margin: 2px 0 8px; flex: none; }
html.fr-app .fr-msg { margin: 4px 0; min-height: 22px; flex: none; }
/* Wortjagd: Kacheln und Tastatur teilen sich die Höhe */
html.fr-app .g-wortjagd main, html.fr-app body.g-wortjagd main { --kh: clamp(40px, 7.2cqh, 56px); --t: min(60px, 16.5cqw, calc((100cqh - 150px - 3 * var(--kh)) / 6.3)); }
html.fr-app .wj-t { width: var(--t); height: var(--t); font-size: calc(var(--t) * .5); border-radius: calc(var(--t) * .2); }
html.fr-app .wj-grid, html.fr-app .wj-row { gap: min(7px, calc(var(--t) * .12)); }
html.fr-app .wj-grid { margin: 0 auto 4px; }
html.fr-app .wj-kb { margin-top: 4px; width: min(100%, 520px); gap: 5px; }
html.fr-app .wj-k { height: var(--kh); }
/* Neunerfeld: Gitter so groß wie Platz ist */
html.fr-app body.g-neunerfeld main { --dh: clamp(38px, 6.2cqh, 50px); --g: min(468px, 100cqw - 4px, calc(100cqh - 198px - var(--dh))); }
html.fr-app .nf-bar, html.fr-app .nf-grid, html.fr-app .nf-pad { width: var(--g); }
html.fr-app .nf-c { font-size: calc(var(--g) / 17); }
html.fr-app .nf-notes { font-size: calc(var(--g) / 42); }
html.fr-app .nf-pad { margin-top: 8px; gap: 4px; }
html.fr-app .nf-d { height: var(--dh); font-size: calc(var(--dh) * .42); }
html.fr-app .nf-tools { margin-top: 6px; gap: 6px; }
html.fr-app .nf-tools button { padding: 6px 10px; font-size: 13px; }
html.fr-app body.g-neunerfeld main > .fr-row { gap: 6px; }
html.fr-app body.g-neunerfeld .fr-seg button { padding: 6px 10px; font-size: 13px; }
/* Arcade: Liste zweispaltig, Spielfläche nach Höhe */
html.fr-app .ar-list { grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 640px); }
html.fr-app .ar-list button { padding: 12px; }
html.fr-app .ar-list b { font-size: 16px; }
html.fr-app .ar-list small { font-size: 12px; }
html.fr-app .ar-stage { gap: 4px; }
html.fr-app .ar-stage h2 { margin: 0; font-size: 18px; }
html.fr-app .ar-stage canvas { width: min(360px, 94cqw, calc((100cqh - 80px) * .696)); }
html.fr-app .ar-stage p { margin: 0; }
/* Querformat am Handy: Rätsel und Kartenspiele brauchen Hochformat; Canvas-Spiele (body.fr-quer) laufen quer */
@media (orientation: landscape) and (max-height: 460px) and (pointer: coarse) {
  html.fr-app body:not(.fr-quer)::after { content: '📱  Bitte das Handy hochkant halten'; position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--ink); font-weight: 800; font-size: 20px; z-index: 40; }
}
/* Länderkreuz: Brett nach Höhe begrenzen */
html.fr-app .lk-board, html.fr-app .lk-in { width: min(560px, 100cqw, calc((100cqh - 150px) * 1.05)); }
html.fr-app .lk-in { margin-top: 10px; }
/* ---------- Neue Spiele (30.11.): Langfinger, Stolperfalle, Farbschieber, Wellenflug, Fluchtweg ---------- */
.g-langfinger { --acc: #6b4fd6; }
.g-stolperfalle { --acc: #d6336c; }
.g-farbschieber { --acc: #1c7ed6; }
.g-wellenflug { --acc: #0ca678; }
.g-fluchtweg { --acc: #e8590c; }
.g-tastenblitz { --acc: #ae3ec9; }
.g-sternsprung { --acc: #f59f00; }
.g-turbokurve { --acc: #e03131; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; width: min(100%, 420px); margin-top: 10px; }
.lv-btn { border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; border-radius: 12px; padding: 8px 2px; cursor: pointer; display: grid; gap: 2px; }
.lv-btn b { font-size: 18px; } .lv-btn small { font-size: 10px; color: #ffd700; letter-spacing: 1px; }
.lv-btn:disabled { opacity: .35; cursor: default; }
.lv-btn:not(:disabled):hover { border-color: #ffd700; }
