/* Stunde 04 – Die Tastatur (Tastatur-Expedition in drei Stufen) */
.huelle-s4 { max-width: 1180px; }
.klein { font-size: 13.5px; color: var(--gedaempft); margin: 6px 0 0; }
.mono { font-family: var(--schrift-mono); font-weight: 700; }
.knopf.gross { padding: 13px 26px; font-size: 16.5px; }
.link-knopf { background: none; border: 0; padding: 0; font: inherit; color: var(--akzent-tief); text-decoration: underline; cursor: pointer; }
.unterzeile { margin: 30px 0 4px; font-size: 20px; }
.info-zeile { color: var(--tinte-2); font-size: 15px; margin: 4px 0 14px; }
.merk { padding: 12px 16px; border-left: 4px solid var(--akzent); background: var(--akzent-zart); border-radius: 0 10px 10px 0; font-size: 14.5px; color: var(--tinte); margin-top: 14px; }

/* ---------- Stufen sichtbar machen ---------- */
html:not([data-stufe]) .mit-stufe { display: none; }
html[data-stufe] .ohne-stufe { display: none; }
[data-stufe="1"] .ab-2, [data-stufe="1"] .ab-3, [data-stufe="2"] .ab-3 { display: none !important; }
[data-stufe="1"] :is(.nur-2, .nur-3):not(.nur-1),
[data-stufe="2"] :is(.nur-1, .nur-3):not(.nur-2),
[data-stufe="3"] :is(.nur-1, .nur-2):not(.nur-3) { display: none !important; }
.ohne-stufe { text-align: center; padding: 30px 20px; margin: 10px 0 30px; border: 2px dashed var(--rand-stark); border-radius: var(--radius); color: var(--tinte-2); font-size: 17px; font-weight: 600; }

/* ---------- Start ---------- */
.s4-start { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 30px; align-items: start; padding: 6px 0 10px; }
.held-bild { width: 100%; max-width: 620px; height: auto; margin-top: 14px; }
.pass {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 18px 20px; scroll-margin-top: 80px;
}
.pass-kopf { display: flex; align-items: center; gap: 10px; }
.pass-kopf h3 { margin: 0; font-size: 18px; }
.pass-gesamt { margin-left: auto; font-size: 13px; color: var(--gedaempft); }
.pass-gesamt b { color: var(--akzent-tief); font-size: 16px; }
.pass-liste { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 7px; }
.pass-liste li { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 4px 0; }
.pass-liste li b { margin-left: auto; font-size: 13px; color: var(--gedaempft); font-weight: 600; white-space: nowrap; }
.stempel {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  border: 2px dashed var(--rand-stark); filter: grayscale(1); opacity: .45; transition: all .3s;
}
.pass-liste li.fertig .stempel { border: 2px solid var(--gut); background: var(--gut-zart); filter: none; opacity: 1; transform: rotate(-8deg); }
.pass-liste li.fertig b { color: var(--gut); }
.pass-liste li.neu .stempel { animation: stempeln .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stempeln { 0% { transform: scale(2.4) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(-8deg); opacity: 1; } }

/* ---------- Stufenwahl ---------- */
.stufen { padding: 26px 0 8px; }
.stufen h2 { margin: 0 0 4px; }
.stufen-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stufe-karte {
  --f: #1E9B6B;
  text-align: left; font: inherit; color: var(--tinte); cursor: pointer; display: grid; gap: 6px; align-content: start;
  padding: 18px 20px; border-radius: var(--radius); background: var(--flaeche); border: 2px solid var(--rand); box-shadow: var(--schatten);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.stufe-karte.s2 { --f: #2F7BEA; }
.stufe-karte.s3 { --f: #8B5CF6; }
.stufe-karte:hover { transform: translateY(-2px); border-color: var(--f); }
.stufe-karte[aria-pressed="true"] { border-color: var(--f); background: color-mix(in srgb, var(--f) 10%, var(--flaeche)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--f) 22%, transparent), var(--schatten); }
.sk-bild { font-size: 34px; line-height: 1; }
.sk-nr { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--f); }
.stufe-karte strong { font-size: 19px; }
.stufe-karte span:last-child { font-size: 14.5px; color: var(--tinte-2); }

/* ---------- Abschnittsleiste ---------- */
.s4-nav {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 10px 0; margin: 18px 0 6px;
  background: color-mix(in srgb, var(--papier) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rand);
}
.s4-nav a {
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; color: var(--tinte-2); background: var(--flaeche); border: 1px solid var(--rand);
}
.s4-nav a:hover { border-color: var(--akzent); color: var(--akzent-tief); }
.s4-nav-stufe { font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; color: #fff; background: #1E9B6B; }
[data-stufe="2"] .s4-nav-stufe { background: #2F7BEA; }
[data-stufe="3"] .s4-nav-stufe { background: #8B5CF6; }
.s4-nav-pass { margin-left: auto; font-size: 14px; }
.s4-teil { padding: 38px 0 10px; scroll-margin-top: 64px; }
.s4-teil > h2 { margin-bottom: 6px; }

/* ---------- Tastatur ---------- */
.tk-rahmen { overflow-x: auto; padding: 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); margin: 14px 0 10px; outline: none; -webkit-overflow-scrolling: touch; }
.tk-rahmen:focus-visible, .tk-rahmen:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 25%, transparent), var(--schatten); }
.tastatur { --u: 44px; display: flex; gap: 14px; width: max-content; margin: 0 auto; }
.tk-mittel .tastatur { --u: 38px; }
.tk-block { display: grid; grid-auto-rows: var(--u); }
.tk-haupt { grid-template-columns: repeat(60, calc(var(--u) / 4)); }
.tk-nav { grid-template-columns: repeat(12, calc(var(--u) / 4)); }
.tk-num { grid-template-columns: repeat(16, calc(var(--u) / 4)); }
.tk {
  position: relative; margin: 2px; padding: 0; border: 1px solid var(--rand-stark); border-radius: 7px; border-bottom-width: 3px;
  background: var(--flaeche-2); color: var(--tinte); font: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  overflow: hidden; cursor: pointer; transition: background .08s, transform .08s; -webkit-tap-highlight-color: transparent;
}
.tk:hover { border-color: var(--akzent); }
.tk i { position: absolute; font-style: normal; pointer-events: none; }
.tk .k-o { left: 5px; top: 5px; color: var(--tinte-2); font-size: 11.5px; }
.tk .k-u { left: 5px; bottom: 5px; font-size: 13.5px; }
.tk .k-a { right: 5px; bottom: 5px; color: var(--akzent); font-size: 11.5px; font-weight: 700; }
.tk .k-m { inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; text-align: center; }
.tk.kl .k-m { font-size: 10.5px; }
.tk-mittel .tk .k-o, .tk-mittel .tk .k-a { font-size: 10px; }
.tk-mittel .tk .k-u { font-size: 12px; }
.tk-mittel .tk .k-m { font-size: 12px; }
.tk-mittel .tk.kl .k-m { font-size: 9.5px; }
.tk-mittel .tk { margin: 1.5px; border-radius: 6px; }
.g-b { background: var(--flaeche-2); }
.g-z { background: color-mix(in srgb, #2F7BEA 16%, var(--flaeche)); }
.g-u { background: color-mix(in srgb, #F08A24 24%, var(--flaeche)); }
.g-s { background: color-mix(in srgb, #8B5CF6 20%, var(--flaeche)); }
.g-e { background: color-mix(in srgb, #1E9B6B 22%, var(--flaeche)); }
.g-n { background: color-mix(in srgb, #E8509A 20%, var(--flaeche)); }
.g-f { background: color-mix(in srgb, #E9B80D 28%, var(--flaeche)); }
.tk.noppe::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 12px; height: 2px; margin-left: -6px; background: var(--tinte-2); border-radius: 2px; opacity: .8; }
.tk.an { background: var(--akzent) !important; color: #fff; border-color: var(--akzent-tief); transform: translateY(2px) scale(.96); }
.tk.an .k-o, .tk.an .k-a { color: #fff; }
.tk.such::before, .such-muster {
  content: ""; position: absolute; right: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: #E8509A; box-shadow: 0 0 0 0 rgba(232, 80, 154, .6); animation: puls 1.6s infinite;
}
.such-muster { position: relative; display: inline-block; right: auto; top: auto; vertical-align: middle; }
@keyframes puls { 70% { box-shadow: 0 0 0 7px rgba(232, 80, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 80, 154, 0); } }
.tk.gefunden::before { content: "✓"; position: absolute; right: 3px; top: 2px; font-size: 10px; font-weight: 900; color: var(--gut); }
.tk.tipp { animation: tipp .8s ease-in-out infinite; border-color: #E8509A; }
@keyframes tipp { 50% { background: #FFB24A; transform: scale(1.08); } }
.tk.richtig { background: var(--gut) !important; color: #fff; border-color: var(--gut); }
.tk.richtig .k-o, .tk.richtig .k-a { color: #fff; }
.tk.falsch { animation: falsch .6s; }
@keyframes falsch { 0%, 100% { background: var(--flaeche-2); } 30% { background: var(--schlecht); color: #fff; transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.tk.gewaehlt { box-shadow: inset 0 0 0 3px #2F7BEA; background: color-mix(in srgb, #2F7BEA 30%, var(--flaeche)) !important; }

/* ---------- 1 Landkarte ---------- */
.gebiete { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.gb { padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 650; border: 1px solid var(--rand-stark); color: var(--tinte); }
.karte-unten { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.steckbrief {
  display: flex; gap: 18px; padding: 20px 22px; border-radius: var(--radius); background: var(--flaeche);
  border: 2px solid var(--akzent); box-shadow: var(--schatten-xl);
}
.steckbrief.auf { animation: auf .35s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes auf { from { transform: scale(.92) rotate(-1deg); opacity: 0; } }
.sb-bild { flex: none; width: 74px; height: 74px; border-radius: 18px; display: grid; place-items: center; font-size: 40px; background: var(--akzent-zart); }
.sb-text h4 { margin: 2px 0 8px; font-size: 20px; }
.sb-text p { margin: 0 0 8px; font-size: 15px; color: var(--tinte-2); }
.sb-engl { font-size: 12.5px !important; text-transform: uppercase; letter-spacing: .05em; color: var(--akzent) !important; font-weight: 700; }
.sb-merke { background: var(--flaeche-2); padding: 8px 12px; border-radius: 9px; }
.sb-neu { color: var(--gut) !important; font-weight: 700; }
.sb-bonus { color: #8B5CF6 !important; font-weight: 650; }
.album-box { padding: 18px 20px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand); box-shadow: var(--schatten); }
.album-kopf { display: flex; align-items: center; }
.album-kopf h3 { margin: 0; font-size: 17px; }
.album-kopf b { margin-left: auto; color: var(--akzent-tief); }
.album { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.album li { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 2px dashed var(--rand-stark); text-align: center; }
.album li span { font-size: 24px; line-height: 1; color: var(--gedaempft); font-weight: 800; }
.album li small { font-size: 10.5px; line-height: 1.2; color: var(--gedaempft); hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.album li.hat { border: 2px solid var(--gut); background: var(--gut-zart); }
.album li.hat small { color: var(--tinte); font-weight: 650; }

/* ---------- 2 Wer bin ich ---------- */
.regel-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.regel-chips li { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--flaeche-2); border: 1px solid var(--rand); }
.raetsel-box, .aufzug {
  margin-top: 16px; padding: 22px 26px; border-radius: var(--radius); background: var(--flaeche); border: 2px dashed var(--rand-stark);
  box-shadow: var(--schatten); text-align: center; outline: none;
}
.raetsel-box:focus, .aufzug:focus { border-style: solid; border-color: var(--akzent); }
.rt-kopf, .az-kopf { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.rt-leben { font-size: 18px; letter-spacing: 2px; }
.rt-text { font-size: clamp(18px, 2.4vw, 23px); font-weight: 650; margin: 10px auto 12px; max-width: 760px; line-height: 1.4; }
.rt-nr { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--akzent); margin-bottom: 8px; }
.rt-rueck, .az-rueck { min-height: 24px; margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--gedaempft); }
.rt-rueck.gut, .az-rueck.gut { color: var(--gut); }
.rt-rueck.nein, .az-rueck.nein { color: var(--schlecht); }
.rt-knoepfe { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.wackeln { animation: wackel .3s; }
@keyframes wackel { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* ---------- 3 Tasten-Haus ---------- */
.haus-reihe { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 16px; padding: 18px; border-radius: var(--radius); outline: none; border: 2px dashed transparent; }
.haus-reihe:focus { border-color: var(--akzent); }
.tastenhaus { position: relative; width: 100%; max-width: 380px; }
.tastenhaus svg { width: 100%; height: auto; display: block; }
.th-dach { fill: color-mix(in srgb, var(--akzent) 22%, var(--flaeche)); stroke: var(--akzent); stroke-width: 3; }
.th-wand { fill: var(--flaeche-2); stroke: var(--rand-stark); stroke-width: 2; }
.th-taste { fill: var(--flaeche); stroke: var(--tinte-2); stroke-width: 3; }
.th-z { font: 800 44px var(--schrift-mono); fill: var(--gedaempft); text-anchor: middle; transition: fill .2s, font-size .2s; }
[data-aktiv="eg"] .th-eg { fill: #1E9B6B; font-size: 58px; }
[data-aktiv="og"] .th-og { fill: #F08A24; font-size: 58px; }
[data-aktiv="dg"] .th-dg { fill: #8B5CF6; font-size: 58px; }
.th-lab { font: 800 14px var(--schrift); fill: var(--gedaempft); }
.th-lab2 { font: 600 11.5px var(--schrift); fill: var(--gedaempft); }
.th-pf { stroke: var(--rand-stark); stroke-width: 2; stroke-dasharray: 3 3; }
[data-aktiv="eg"] .th-lab-eg { fill: #1E9B6B; }
[data-aktiv="og"] .th-lab-og { fill: #D9730D; }
[data-aktiv="dg"] .th-lab-dg { fill: #8B5CF6; }
[data-aktiv="eg"] .th-pf-eg { stroke: #1E9B6B; stroke-dasharray: none; }
[data-aktiv="og"] .th-pf-og { stroke: #F08A24; stroke-dasharray: none; }
[data-aktiv="dg"] .th-pf-dg { stroke: #8B5CF6; stroke-dasharray: none; }
.haus-steuer p { margin: 0 0 10px; color: var(--tinte-2); }
.etagen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.etage {
  --f: #1E9B6B;
  font: inherit; font-weight: 700; font-size: 15px; line-height: 1.25; padding: 12px 10px; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--f) 12%, var(--flaeche)); border: 2px solid color-mix(in srgb, var(--f) 50%, var(--rand)); color: var(--tinte);
}
.etage small { font-weight: 600; font-size: 12px; color: var(--gedaempft); }
.etage.e-og { --f: #F08A24; }
.etage.e-dg { --f: #8B5CF6; }
.etage[aria-pressed="true"], .etage:not(:disabled):hover { background: var(--f); color: #fff; border-color: var(--f); }
.etage[aria-pressed="true"] small, .etage:not(:disabled):hover small { color: #fff; }
.etage:disabled { opacity: .45; cursor: default; }
.haus-schirm { margin-top: 12px; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; background: #1F2733; color: #E9F0F8; min-height: 72px; }
.hs-zeichen { font: 800 42px var(--schrift-mono); color: #7EE0B0; width: 52px; text-align: center; }
.hs-text { font-size: 15px; }
.etagen-spiel { max-width: 640px; margin: 12px auto 14px; }
.az-leiste { display: flex; flex-wrap: wrap; gap: 5px; }
.az-leiste span { width: 20px; height: 8px; border-radius: 4px; background: var(--rand); }
.az-leiste span.aktuell { background: var(--akzent); }
.az-leiste span.ok { background: var(--gut); }
.az-leiste span.fehler { background: #F08A24; }
.az-uhr { font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 999px; background: var(--flaeche-2); }
.az-uhr.knapp { background: var(--schlecht); color: #fff; }
.az-auftrag { margin: 12px 0 4px; font-size: 19px; font-weight: 650; }
.az-klein { display: block; font-size: 14px; font-weight: 600; color: var(--gedaempft); margin-bottom: 4px; }
.az-ziel { display: inline-grid; place-items: center; min-width: 84px; height: 84px; padding: 0 14px; border-radius: 18px; font: 800 52px var(--schrift-mono); background: var(--akzent-zart); color: var(--akzent-tief); border: 3px solid var(--akzent); }
.profi-box { margin-top: 22px; padding: 18px 22px; border-radius: var(--radius); border: 2px solid #8B5CF6; background: color-mix(in srgb, #8B5CF6 7%, var(--flaeche)); }
.profi-box.ab-2 { border-color: #2F7BEA; background: color-mix(in srgb, #2F7BEA 6%, var(--flaeche)); }
.profi-box h3 { margin: 0 0 6px; font-size: 17px; display: flex; gap: 10px; align-items: center; }
.profi-box h3 b { margin-left: auto; font-size: 14px; color: #6D45D9; }
.profi-box p { margin: 0 0 10px; font-size: 14.5px; color: var(--tinte-2); }
.botschaften { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.bt { position: relative; padding: 10px 12px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--rand); }
.bt-soll { font: 700 16px var(--schrift-mono); margin: 0 0 6px !important; color: var(--tinte) !important; user-select: none; -webkit-user-select: none; }
.bt input { width: 100%; font: 600 16px var(--schrift-mono); padding: 8px 36px 8px 10px; border-radius: 9px; border: 2px solid var(--rand-stark); background: var(--flaeche); color: var(--tinte); }
.bt input:focus { outline: none; border-color: var(--akzent); }
.bt.fast input { border-color: #E9B80D; }
.bt.nein input { border-color: var(--schlecht); }
.bt.ok input { border-color: var(--gut); background: color-mix(in srgb, var(--gut) 10%, var(--flaeche)); }
.bt.ok .bt-haken::after { content: "✓"; position: absolute; right: 22px; bottom: 19px; color: var(--gut); font-weight: 900; }

/* ---------- 4 Rallye ---------- */
.rallye { margin-top: 16px; padding: 20px 22px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand); box-shadow: var(--schatten); }
.ry-kopf { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ry-kopf h3 { margin: 0 0 4px; font-size: 18px; }
.ry-kopf p { margin: 0; color: var(--tinte-2); font-size: 15.5px; }
.ry-kopf > div:first-child { flex: 1 1 360px; }
.ry-uebersicht { display: flex; flex-wrap: wrap; gap: 6px; }
.ry-et { font: inherit; width: 44px; padding: 4px 0; border-radius: 10px; border: 1px solid var(--rand-stark); background: var(--flaeche-2); cursor: pointer; display: grid; justify-items: center; line-height: 1.1; color: var(--tinte); }
.ry-et b { font-size: 14px; }
.ry-et span { font-size: 9.5px; color: #E9A50D; letter-spacing: -1px; min-height: 11px; }
.ry-et.ok { border-color: var(--gut); background: var(--gut-zart); }
.ry-et.jetzt { box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 35%, transparent); border-color: var(--akzent); }
.ry-feld {
  margin: 16px 0 8px; padding: 18px 20px; min-height: 90px; border-radius: 12px; outline: none; cursor: text;
  background: #1F2733; color: #E9F0F8; font: 600 clamp(17px, 2.3vw, 22px)/1.65 var(--schrift-mono); border: 3px solid transparent;
  white-space: pre; overflow-x: auto;
}
.ry-feld.aktiv { border-color: var(--akzent); }
.ry-zeile { min-height: 1.65em; }
.ry-cur { display: inline-block; width: 0; height: 1.2em; vertical-align: -.2em; border-left: 3px solid #FFB24A; margin-right: -3px; animation: blink 1s steps(1) infinite; position: relative; z-index: 1; }
.ry-feld:not(.aktiv) .ry-cur { animation: none; opacity: .6; }
.ry-block { background: #FFB24A; color: #1F2733; border-radius: 2px; animation: blinkb 1s steps(1) infinite; }
@keyframes blink { 50% { border-color: transparent; } }
@keyframes blinkb { 50% { background: color-mix(in srgb, #FFB24A 45%, transparent); } }
.ry-g { filter: drop-shadow(0 0 6px #7EE0FF); }
.ry-leiste { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ry-modus { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--flaeche-2); color: var(--gedaempft); }
.ry-modus.warn { background: var(--schlecht); color: #fff; }
.ry-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ry-k { font: 700 15px var(--schrift); min-width: 54px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--rand-stark); border-bottom-width: 4px; background: color-mix(in srgb, #E8509A 16%, var(--flaeche)); color: var(--tinte); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ry-k:active { transform: translateY(2px); border-bottom-width: 2px; }
.ry-rueck { min-height: 24px; font-weight: 600; margin: 8px 0; color: var(--tinte-2); }
.ry-rueck.gut { color: var(--gut); }
.ry-rueck.nein { color: var(--schlecht); }
.ry-sterne { color: #E9A50D; font-size: 20px; letter-spacing: 2px; }
.ry-unten { display: flex; gap: 10px; flex-wrap: wrap; }
.drei-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0 0; }
.karte-info { padding: 14px 18px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand); }
.karte-info h4 { margin: 0 0 6px; font-size: 16px; }
.karte-info p { margin: 0; font-size: 14.5px; color: var(--tinte-2); }

/* ---------- 5 Tastenregen ---------- */
.regen {
  position: relative; margin-top: 14px; height: 420px; border-radius: var(--radius); overflow: hidden; outline: none;
  background: linear-gradient(180deg, #1C2A44 0%, #2D4670 60%, #3E6A8F 100%); border: 3px solid transparent; box-shadow: var(--schatten);
}
.regen:focus { border-color: var(--akzent); }
.rg-leiste { position: absolute; z-index: 3; left: 0; right: 0; top: 0; display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 16px; color: #D8E4F2; font-size: 13.5px; background: rgba(0, 0, 0, .22); }
.rg-leiste b { color: #fff; font-size: 15px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.rg-himmel { position: absolute; inset: 40px 0 0 0; }
.rg-boden { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(180deg, #3D7A4E, #2E5E3B); border-top: 3px solid #7EC48D; }
.rg-mitte { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; }
.rg-mitte .knopf { pointer-events: auto; }
.rg-mitte .knopf[hidden] { display: none; }
.rg-ansage { position: absolute; z-index: 3; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; color: #fff; font-weight: 650; font-size: 14.5px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.tropfen {
  position: absolute; top: 0; padding: 12px 14px 10px; min-width: 52px; text-align: center; will-change: transform;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #BFE3FF 9% 40%, #6DB6F2 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; color: #0E2A4A; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
}
.tropfen.lang { font-size: 14px; border-radius: 22px; padding: 10px 14px; }
.tropfen.peng { animation: peng .35s forwards; }
.tropfen.platsch { animation: platsch .4s forwards; }
@keyframes peng { to { transform: scale(1.8); opacity: 0; filter: brightness(1.8); } }
@keyframes platsch { to { opacity: 0; border-radius: 50% 50% 10% 10%; } }

/* ---------- 6 QWERTZ ---------- */
.qw-zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.qw-zwei p { color: var(--tinte-2); font-size: 15.5px; }
.schreibmaschine { padding: 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand); box-shadow: var(--schatten); }
#typenkorb { width: 100%; height: auto; display: block; }
.sm-walze { fill: #3D3D3A; }
.sm-blatt { fill: #fff; stroke: var(--rand-stark); }
.sm-papiertext { font: 700 15px var(--schrift-mono); fill: #141413; text-anchor: middle; }
.sm-punkt { fill: var(--akzent); }
.hb line { stroke: #8A8F98; stroke-width: 4; stroke-linecap: round; transition: all .18s ease-out; }
.hb circle { fill: var(--flaeche-2); stroke: #6B7078; stroke-width: 2; }
.hb text { font: 800 10px var(--schrift); fill: var(--tinte); text-anchor: middle; }
.hb.hoch line { stroke: var(--akzent); }
.hb.hoch circle { fill: var(--akzent-zart); stroke: var(--akzent); }
#typenkorb.klemmt .hb.hoch line { stroke: var(--schlecht); stroke-width: 6; }
#typenkorb.klemmt { animation: wackel .25s 3; }
.sm-steuer { display: grid; gap: 10px; margin-top: 8px; }
.sm-reihe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sm-reihe .knopf { padding: 7px 14px; font-size: 14px; }
.chip-knopf { font: inherit; font-size: 13.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rand-stark); background: var(--flaeche-2); color: var(--tinte); cursor: pointer; }
.chip-knopf[aria-pressed="true"] { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.sm-info { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--flaeche-2); font-size: 14.5px; min-height: 42px; }
.sm-info.gut { background: var(--gut-zart); }
.sm-info.nein { background: var(--schlecht-zart); }
.laender { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.land { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--flaeche); border: 2px solid var(--rand); }
.land-tasten { display: flex; gap: 5px; }
.land-tasten i { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--rand-stark); border-bottom-width: 3px; background: var(--flaeche-2); }
.land select, .frage-zeile select, .frage-zeile input { font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 9px; border: 2px solid var(--rand-stark); background: var(--flaeche); color: var(--tinte); }
.land.ok, .frage-zeile.ok { border-color: var(--gut); }
.land.ok select, .frage-zeile.ok input, .frage-zeile.ok select { border-color: var(--gut); }
.land.nein select, .frage-zeile.nein input { border-color: var(--schlecht); }
.q-rueck { font-size: 14px; font-weight: 650; color: var(--schlecht); }
.ok > .q-rueck, .q-rueck.gut { color: var(--gut); }
.frage-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.frage-zeile > span:first-child { flex: 1 1 100%; font-size: 15px; color: var(--tinte-2); }
.frage-zeile input { width: 150px; text-transform: uppercase; font-family: var(--schrift-mono); font-weight: 700; }

/* ---------- 7 Geheim ---------- */
.zwei-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; margin-top: 14px; align-items: start; }
.auftrag-karte { padding: 18px 22px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand); box-shadow: var(--schatten); }
.auftrag-karte h3 { margin: 0 0 8px; font-size: 18px; }
.auftrag-karte p { color: var(--tinte-2); font-size: 15px; margin: 0 0 10px; }
.haken-zeile { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--flaeche-2); margin-bottom: 8px; cursor: pointer; font-size: 14.5px; }
.haken-zeile input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gut); flex: none; }
.altcodes { display: grid; gap: 8px; }
.altcode { display: grid; grid-template-columns: 46px minmax(0, 1fr) 90px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--rand); }
.ac-z { font-size: 28px; font-weight: 800; text-align: center; color: var(--gedaempft); }
.ac-c { display: grid; font-size: 14.5px; }
.ac-c small { color: var(--gedaempft); font-size: 12.5px; }
.altcode input { font: 700 20px var(--schrift-mono); text-align: center; padding: 6px; border-radius: 9px; border: 2px dashed var(--rand-stark); background: var(--flaeche); color: var(--tinte); width: 100%; }
.altcode.ok { border-color: var(--gut); background: var(--gut-zart); }
.altcode.ok .ac-z { color: var(--gut); }
.altcode.ok input { border-style: solid; border-color: var(--gut); }
.detektiv { margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 2px solid #8B5CF6; background: color-mix(in srgb, #8B5CF6 7%, var(--flaeche)); }
.detektiv h4 { margin: 0 0 6px; }
.detektiv .q-rueck { flex: 1 1 100%; font-weight: 600; }

/* ---------- 8 Quiz + Diplom ---------- */
.quiz { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 14px; margin-top: 16px; align-items: start; }
.frage-karte { padding: 16px 20px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); box-shadow: var(--schatten); margin: 0; min-width: 0; }
.frage-karte legend { padding: 0; font-weight: 650; font-size: 16px; float: left; width: 100%; margin-bottom: 8px; }
.frage-karte legend span { color: var(--akzent); margin-right: 6px; }
.frage-karte label { clear: both; display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; margin: 5px 0; border: 1px solid var(--rand); border-radius: 10px; cursor: pointer; font-size: 15px; background: var(--flaeche-2); }
.frage-karte label:hover { border-color: var(--akzent); }
.frage-karte input { margin-top: 4px; accent-color: var(--akzent); }
.frage-karte.ok { border-color: var(--gut); }
.frage-karte.nein { border-color: var(--schlecht); }
.frage-karte label.richtig { border-color: var(--gut); background: color-mix(in srgb, var(--gut) 14%, var(--flaeche)); }
.frage-karte label.falsch { border-color: var(--schlecht); background: color-mix(in srgb, var(--schlecht) 12%, var(--flaeche)); }
.frage-karte .erklaerung { clear: both; margin: 8px 0 0; font-size: 14px; color: var(--tinte-2); padding: 8px 12px; border-radius: 8px; background: var(--akzent-zart); }
.quiz-ende { display: flex; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.quiz-ergebnis { position: relative; padding: 20px 24px; border-radius: var(--radius); background: var(--flaeche); border: 2px solid var(--gut); box-shadow: var(--schatten); margin-bottom: 20px; overflow: hidden; }
.quiz-ergebnis.nein { border-color: #F08A24; }
.quiz-ergebnis h3 { font-size: 24px; margin: 0 0 6px; }
.quiz-ergebnis p { margin: 0; color: var(--tinte-2); }
.diplom-steuer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; }
.diplom-steuer input { font: inherit; font-size: 16px; padding: 8px 12px; border-radius: 9px; border: 2px solid var(--rand-stark); background: var(--flaeche); color: var(--tinte); margin-left: 6px; min-width: 220px; }
.diplom-sperre { display: flex; gap: 14px; align-items: center; padding: 18px 22px; border-radius: var(--radius); border: 2px dashed var(--rand-stark); color: var(--tinte-2); }
.diplom-sperre span { font-size: 30px; }
.diplom-sperre p { margin: 0; }
.diplom { max-width: 760px; margin: 0 auto; padding: 14px; border-radius: 10px; background: #FFFDF6; color: #141413; box-shadow: var(--schatten-xl); }
.dp-rand { border: 3px double #A94E2F; outline: 1px solid #A94E2F; outline-offset: 5px; padding: 30px 34px; text-align: center; border-radius: 4px; background-image: radial-gradient(circle at 50% 0, rgba(198, 97, 63, .08), transparent 60%); }
.dp-oben { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #73726C; margin: 0; }
.dp-titel { font-family: Georgia, "Times New Roman", serif; font-size: 44px; margin: 10px 0 0; color: #A94E2F; }
.dp-sterne { color: #E9A50D; font-size: 28px; letter-spacing: 6px; margin: 4px 0 12px; }
.dp-rand p { margin: 6px 0; font-size: 16px; }
.dp-name { font-family: Georgia, serif; font-size: 32px !important; font-style: italic; border-bottom: 1px solid #A94E2F; display: inline-block; padding: 0 30px 4px; margin: 10px 0 !important; min-width: 60%; }
.dp-liste { list-style: none; padding: 0; margin: 16px auto 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; max-width: 520px; text-align: left; font-size: 14px; color: #73726C; }
.dp-liste li.ok { color: #3D5A2A; font-weight: 650; }
.dp-werte { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 13.5px !important; color: #3D3D3A; }
.dp-werte b { color: #A94E2F; }
.dp-fuss { display: flex; justify-content: space-between; align-items: end; margin-top: 28px; font-size: 13px; color: #3D3D3A; }
.dp-fuss span:first-child, .dp-fuss span:last-child { border-top: 1px solid #73726C; padding-top: 4px; min-width: 170px; }
.dp-siegel { font-size: 38px; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: #F6E4DB; border: 3px solid #C6613F; }

/* ---------- Konfetti, Toast ---------- */
.konfetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.raetsel-box, .aufzug, .quiz-ergebnis, .rallye { position: relative; }
.konfetti i { position: absolute; top: -10px; width: 9px; height: 14px; border-radius: 2px; animation: fallen 1.6s ease-in forwards; }
@keyframes fallen { to { transform: translate(var(--dx), 460px) rotate(var(--dr)); opacity: 0; } }
.s4-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
  padding: 12px 20px; border-radius: 999px; background: #141413; color: #FAF9F5; font-weight: 650; font-size: 15px;
  box-shadow: var(--schatten-xl); transition: opacity .4s, transform .4s; max-width: calc(100vw - 32px); text-align: center;
}
.s4-toast.weg { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }

/* ---------- Schmal (iPad hochkant, Handy) ---------- */
@media (max-width: 960px) {
  .s4-start, .karte-unten, .qw-zwei, .haus-reihe { grid-template-columns: minmax(0, 1fr); }
  .tastenhaus { margin: 0 auto; }
}
@media (max-width: 720px) {
  .stufen-wahl { grid-template-columns: minmax(0, 1fr); }
  .quiz, .zwei-karten, .botschaften { grid-template-columns: minmax(0, 1fr); }
  .s4-nav a { padding: 5px 10px; font-size: 12.5px; }
  .s4-nav-pass { margin-left: 0; }
  .steckbrief { flex-direction: column; gap: 10px; }
  .etagen { grid-template-columns: minmax(0, 1fr); }
  .regen { height: 380px; }
  .altcode { grid-template-columns: 40px minmax(0, 1fr) 70px; }
  .dp-liste { grid-template-columns: 1fr; }
  .dp-titel { font-size: 32px; }
  .dp-rand { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tk.tipp, .tk.such::before, .such-muster, .wackeln, .ry-cur, .ry-block, #typenkorb.klemmt, .steckbrief.auf, .pass-liste li.neu .stempel { animation: none !important; }
}

/* ---------- Druck: nur das Diplom ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff !important; }
  body::before, body::after { display: none !important; }
  .kopf, .s4-toast, .huelle > *:not(.mit-stufe), .mit-stufe > *:not(#pruefung), #pruefung > *:not(#diplom) { display: none !important; }
  .huelle, #pruefung { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .diplom { max-width: none; box-shadow: none; background: #fff; padding: 0; }
  .dp-rand { padding: 18mm 20mm; }
}
