/* Funkgerät-Simulator auf der Startseite (public/funkgeraet.js, Daten aus src/drills.mjs). Flach: 2px-Linien, Ecken höchstens 6px. */
.drill-band { --lcd: #dfe6d3; --lcd-ink: #1b2b20; --lcd-aus: #c9cfc0; --geraet: var(--card); }
:root[data-theme="dark"] .drill-band { --lcd: #1c2b22; --lcd-ink: #b8e6a2; --lcd-aus: #141d18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drill-band { --lcd: #1c2b22; --lcd-ink: #b8e6a2; --lcd-aus: #141d18; } }

.drill-band { padding-top: 56px; padding-bottom: 64px; border-top: 2px solid var(--ink); }
.drill-kopf { max-width: 760px; margin-bottom: 28px; }
.drill-kopf h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.1; margin: 0 0 .35em; }
.drill-intro { font-size: 1.15rem; color: var(--ink-2); margin: 0; }

.drill { display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); gap: 40px; align-items: start; }
.drill[hidden] { display: none; }
.fg-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gerät ---------- */
.fg { position: sticky; top: 84px; }
.fg-uebung { margin: 0 0 8px; font: italic 600 .95rem/1.3 var(--serif); color: var(--red); }
.fg-gehaeuse { background: var(--geraet); border: 2px solid var(--ink); border-radius: 6px; padding: 16px; display: grid; gap: 14px; }
.fg button { font: inherit; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fg button:focus-visible, .fg-panel button:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }

.fg-zeile1 { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.fg-knopf-box { display: grid; justify-items: center; gap: 4px; }
.fg-knopf { width: 64px; height: 64px; padding: 0; border: 0; background: none; border-radius: 50%; }
.fg-knopf svg { width: 100%; height: 100%; display: block; fill: var(--paper-2, var(--paper)); stroke: var(--ink); stroke-width: 2; transition: transform .35s ease; }
.fg-knopf .fg-knopf-innen { fill: none; stroke-dasharray: 3 4; }
.fg-knopf path { stroke-width: 3; stroke-linecap: round; }
.fg.ist-an .fg-knopf svg { transform: rotate(120deg); }
.fg-schild { font: 700 .66rem/1 var(--mono); letter-spacing: .06em; color: var(--ink-3); }

.fg-display { background: var(--lcd-aus); color: var(--lcd-ink); border: 2px solid var(--ink); border-radius: 4px; min-height: 118px; padding: 8px 10px;
  display: grid; grid-template-rows: auto 1fr auto; font-family: var(--mono); transition: background .2s; }
.fg.ist-an .fg-display { background: var(--lcd); }
.fg-d-oben { font-size: .72rem; font-weight: 700; letter-spacing: .04em; min-height: 1.2em; }
.fg-d-mitte { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fg-d-ch { font-size: .75rem; font-weight: 700; visibility: hidden; }
.fg.ist-an .fg-d-ch { visibility: visible; }
.fg-display.ch-weg .fg-d-ch { display: none; }
.fg-d-gross { font: 400 3.1rem/1.05 var(--mono); font-weight: 700; letter-spacing: .02em; min-height: 1.05em; }
.fg-display.ch-weg:not(.zahl) .fg-d-gross { font-size: 1.15rem; line-height: 1.25; padding: .7em 0; }
.fg-d-unten { font-size: .74rem; min-height: 1.2em; overflow-wrap: anywhere; }
.fg-display.blinkt .fg-d-oben { animation: fg-blink .65s steps(2) infinite; }
@keyframes fg-blink { 50% { opacity: .25; } }

.fg-zeile2 { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: stretch; }
.fg-ls { display: grid; grid-template-rows: 1fr auto; gap: 4px; justify-items: center; }
.fg-ls-gitter { width: 100%; min-height: 64px; border: 2px solid var(--ink); border-radius: 4px;
  background: repeating-linear-gradient(0deg, var(--ink) 0 2px, transparent 2px 7px); opacity: .55; }
.fg-ls-text { font: 700 .66rem/1 var(--mono); letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.fg.empfaengt .fg-ls-gitter { opacity: 1; background: repeating-linear-gradient(0deg, var(--ok) 0 2px, transparent 2px 7px); animation: fg-ls .3s ease-in-out infinite alternate; }
.fg.empfaengt .fg-ls-text { color: var(--ok); }
@keyframes fg-ls { to { transform: scaleY(.94); } }

.fg-tasten { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.fg-tasten > * { grid-column: span 2; }
.fg-tasten > [data-t="menu"], .fg-tasten > [data-t="ok"] { grid-column: span 3; }
.fg-taste { min-height: 44px; border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); font: 700 .85rem/1 var(--mono) !important; letter-spacing: .03em; touch-action: manipulation; }
.fg-taste:active { transform: translateY(1px); background: var(--sea-soft); }
.fg-taste[data-t="16"] { background: var(--sea-soft); }

.fg-zeile3 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.fg-not { position: relative; display: grid; min-height: 104px; }
.fg.klappe-auf .fg-not { padding-top: 32px; }
.fg-distress { position: relative; overflow: hidden; border: 2px solid var(--ink); border-radius: 6px; background: var(--red); color: #fff !important;
  font: 400 1.05rem/1.1 var(--display) !important; letter-spacing: .04em; display: grid; place-content: center; gap: 2px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fg-distress small { font: italic 600 .8rem/1 var(--serif); letter-spacing: 0; }
.fg-distress::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: calc(var(--voll, 0) * 100%); background: #fff; }
.fg-distress:disabled { cursor: default; }
.fg.haelt .fg-distress { background: var(--red-ink); }
/* Rote Klappe: liegt über dem Knopf, klappt nach oben weg */
.fg-klappe { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 6px; background: color-mix(in srgb, var(--red) 22%, var(--geraet));
  color: var(--ink) !important; font: 700 .85rem/1.1 var(--mono) !important; letter-spacing: .04em; text-transform: uppercase;
  background-image: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--red) 35%, transparent) 10px 12px);
  transform-origin: top; transition: transform .25s ease; }
.fg.klappe-auf .fg-klappe { inset: 0 0 auto 0; height: 26px; background: var(--geraet); background-image: none; font-size: .72rem !important; }

.fg-ptt { border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); font: 400 1.25rem/1.1 var(--display) !important; letter-spacing: .04em;
  display: grid; place-content: center; gap: 2px; touch-action: manipulation; }
.fg-ptt small { font: italic 600 .8rem/1 var(--serif); letter-spacing: 0; }
.fg-ptt[aria-pressed="true"] { background: var(--ink); color: var(--paper) !important; }
.fg-ton { margin-top: 8px; font-size: .9rem; }

/* ---------- Aufgabe ---------- */
.fg-panel { min-width: 0; }
.fg-leiste { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 4px; }
.fg-leiste li { height: 8px; border: 2px solid var(--ink); border-radius: 2px; background: transparent; }
.fg-leiste li.ok { background: var(--ink); }
.fg-leiste li.jetzt { background: var(--red); border-color: var(--red); }
.fg-nr { margin: 0; font: italic 600 .95rem/1.3 var(--serif); color: var(--ink-3); }
.fg-aufgabe { font-size: 1.35rem; line-height: 1.4; margin: .2em 0 .4em; max-width: 34em; }
.fg-tippzeile { min-height: 1.6em; }
.fg-tipp { margin: .3em 0 0; padding-left: 14px; border-left: 3px solid var(--sun); color: var(--ink-2); max-width: 36em; }
.fg-rueck { min-height: 1.5em; margin: .6em 0; font-weight: 600; max-width: 36em; }
.fg-rueck[data-art="fehler"] { color: var(--red-ink); }
.fg-rueck[data-art="gut"] { color: var(--ok); }

.fg-bau { border-top: 2px solid var(--ink); padding-top: 14px; margin-top: 8px; }
.fg-bau h3, .fg-ende h3 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; margin: 0; }
.fg-bau-kopf { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fg-ptt2 { border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); font: 700 .85rem/1 var(--mono); letter-spacing: .03em; padding: 0 12px; min-height: 40px; cursor: pointer; }
.fg-ptt2[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.fg-gesagt { margin: 0 0 12px; padding: 0 0 0 1.6em; font: 600 .92rem/1.45 var(--mono); }
.fg-gesagt li { padding: 3px 0; }
.fg-gesagt:empty { display: none; }
.fg-bau-hinweis { margin: 0 0 8px; color: var(--ink-3); font-style: italic; }
.fg-bau.wartet .fg-bau-hinweis::before { content: "Erst die Sprechtaste drücken. "; color: var(--red-ink); font-style: normal; font-weight: 600; }
.fg-bausteine { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-baustein { text-align: left; border: 2px solid var(--ink); border-radius: 4px; background: var(--card); padding: 8px 11px; min-height: 44px;
  font: 600 .86rem/1.35 var(--mono); color: var(--ink); cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.fg-baustein:hover { background: var(--sea-soft); }
.fg-baustein.weg { text-decoration: line-through; opacity: .45; cursor: default; background: none; }
.fg-baustein.wackelt { animation: fg-wackeln .3s; border-color: var(--red); }
.fg-bau.wartet .fg-baustein:not(.weg) { opacity: .7; }
@keyframes fg-wackeln { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .fg-baustein.wackelt, .fg.empfaengt .fg-ls-gitter, .fg-display.blinkt .fg-d-oben { animation: none; } .fg-knopf svg { transition: none; } }

.fg-empfang { margin: 16px 0; border: 2px solid var(--ok); border-radius: 6px; padding: 12px 14px; }
.fg-empfang-kopf { margin: 0 0 6px; font: italic 600 .92rem/1.3 var(--serif); color: var(--ok); }
.fg-empfang-text p { margin: 0; font: 700 .95rem/1.5 var(--mono); }

.fg-ende { margin-top: 10px; outline: none; }
.fg-ende h3 { margin: 18px 0 8px; }
.fg-werte { display: flex; flex-wrap: wrap; gap: 0; margin: 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.fg-werte div { padding: 10px 20px 10px 0; margin-right: 20px; }
.fg-werte div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.fg-werte dt { font: italic 600 .85rem/1.2 var(--serif); color: var(--ink-3); }
.fg-werte dd { margin: 0; font: 400 1.5rem/1.2 var(--display); }
.fg-mehr a { font-weight: 600; }

/* ---------- Weitere Szenarien ---------- */
.drill-mehr { margin-top: 48px; }
.drill-mehr h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin: 0 0 14px; }
.drill-kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.drill-kachel { width: 100%; height: 100%; text-align: left; display: grid; align-content: start; gap: 4px; border: 2px solid var(--ink); border-radius: 6px;
  background: var(--card); padding: 14px 16px; font: inherit; color: var(--ink); cursor: pointer; position: relative; }
.drill-kachel::after { content: ""; position: absolute; top: 14px; right: 14px; width: 12px; height: 9px; border: 2px solid var(--ink-3); border-radius: 2px; }
.drill-kachel::before { content: ""; position: absolute; top: 7px; right: 16px; width: 8px; height: 8px; border: 2px solid var(--ink-3); border-bottom: 0; border-radius: 4px 4px 0 0; }
.drill-kachel:hover, .drill-kachel.gewaehlt { background: var(--paper-2, var(--paper)); }
.drill-kachel.gewaehlt { box-shadow: inset 0 0 0 1px var(--ink); }
.drill-kachel:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.drill-kachel-stufe { font: italic 600 .85rem/1.3 var(--serif); color: var(--ink-3); padding-right: 22px; }
.drill-kachel b { font: 400 1.1rem/1.2 var(--display); }
.drill-kachel small { font-size: .9rem; color: var(--ink-2); }
.drill-kachel-teaser { font-size: .93rem; line-height: 1.4; color: var(--ink-2); margin-top: 4px; }
.drill-tor { margin-top: 16px; border-left: 3px solid var(--red); padding: 4px 0 4px 18px; max-width: 46em; outline: none; }
.drill-tor p { margin: 0 0 10px; font-size: 1.05rem; }
.drill-tor-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

@media (max-width: 860px) {
  .drill { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .fg { position: static; max-width: 440px; }
  .drill-band { padding-top: 40px; padding-bottom: 48px; }
}
@media (max-width: 380px) {
  .fg-gehaeuse { padding: 12px; gap: 12px; }
  .fg-zeile1, .fg-zeile2 { grid-template-columns: 64px 1fr; gap: 10px; }
  .fg-knopf { width: 56px; height: 56px; }
  .fg-d-gross { font-size: 2.6rem; }
}
