/* ── Общая шапка игр Kreativlabor-online (14.10.2026) ──
   ИСТОЧНИК — ~/Kreativ-Labor/spiele-leiste/kl-leiste.css; в играх копия (обновляет deploy-dev2.sh). Править только здесь.
   .kl-leiste — верхняя полоса, одинаковая у всех игр; .kl-spielleiste — полоса настроек игры (у каждой своя разметка).
   Подключать ДО style.css игры: игра может что-то уточнить у себя. */

.kl-leiste {
  flex: none; position: relative; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 8px 16px;
  background: #442378; color: #fff;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.kl-leiste svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kl-leiste a, .kl-leiste button { cursor: default; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* «Startseite» */
.kl-home { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px; border-radius: 10px;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 700; background: rgba(255, 255, 255, .13); white-space: nowrap; }
.kl-home svg { width: 18px; height: 18px; }

/* название игры; на сайте — кнопка ▾ со списком других игр */
.kl-spielwahl { position: relative; min-width: 0; }
.kl-titel { margin: 0 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; line-height: 1.2; }
.kl-titel span { font-weight: 500; opacity: .75; }
.kl-titel__knopf { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 -8px; padding: 4px 8px 4px 8px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; letter-spacing: inherit; }
.kl-titel__knopf span { margin-left: -1px; }
.kl-pfeil { width: 18px; height: 18px; stroke-width: 2.6 !important; opacity: .8; transition: transform .15s; }
.kl-titel__knopf[aria-expanded="true"] { background: rgba(255, 255, 255, .13); }
.kl-titel__knopf[aria-expanded="true"] .kl-pfeil { transform: rotate(180deg); }

.kl-menu { position: absolute; left: -4px; top: calc(100% + 8px); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; min-width: 250px; padding: 6px;
  background: #fff; color: #2b2150; border-radius: 14px; box-shadow: 0 14px 34px rgba(40, 20, 90, .28); }
.kl-menu[hidden] { display: none; }
.kl-menu__spiel { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px;
  color: inherit; text-decoration: none; font-size: 16px; }
.kl-menu__spiel img, .kl-menu__spiel svg { width: 34px; height: 28px; object-fit: contain; flex: none; }
.kl-menu__spiel b { font-weight: 700; }
.kl-menu__spiel.is-jetzt { background: #f1eefc; color: #34106c; }
.kl-menu__spiel i { margin-left: auto; font-style: normal; font-weight: 800; color: #5b2fc9; }
.kl-menu__alle { margin-top: 4px; padding: 9px 10px 7px; border-top: 1px solid #e2dcf3; color: #5b2fc9; text-decoration: none; font-size: 14px; font-weight: 700; }

/* справа: Vorlagen drucken · Ton · Musik */
.kl-rechts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.kl-knopf { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, .13); color: #fff; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.kl-knopf svg { width: 17px; height: 17px; }
#klVorlagen { margin-right: 6px; }
/* Ton / Musik: включено — белая, как выбранная кнопка; выключено — бледная и перечёркнутая */
.kl-schalter[aria-pressed="true"] { background: #fff; color: #34106c; }
.kl-schalter[aria-pressed="false"] { color: rgba(255, 255, 255, .72); }
.kl-schalter[aria-pressed="false"] span { text-decoration: line-through; text-decoration-thickness: 2px; }
@media (hover: hover) {
  .kl-home:hover, .kl-knopf:hover, .kl-titel__knopf:hover { background: rgba(255, 255, 255, .24); }
  .kl-schalter[aria-pressed="true"]:hover { background: #efe9fb; }
  .kl-menu__spiel:not(.is-jetzt):hover, .kl-menu__alle:hover { background: #f4f1fb; }
}

/* ── полоса настроек игры ── */
.kl-spielleiste {
  flex: none; position: relative; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  min-height: 48px; padding: 6px 16px;
  background: #5e4093; color: #fff;
}
/* переключатель из нескольких кнопок (Leicht/Mittel/Schwer, Zahlen/Bild …): role="radiogroup", у кнопок aria-checked */
.kl-wahl { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .13); }
.kl-wahl button { border: 0; background: none; color: #fff; padding: 5px 14px; border-radius: 8px; font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; }
.kl-wahl button small { font-size: 12px; opacity: .85; font-weight: 700; }
.kl-wahl button[aria-checked="true"] { background: #fff; color: #2b2150; }
.kl-wahl button[aria-checked="true"] small { opacity: .8; }
@media (hover: hover) { .kl-wahl button[aria-checked="false"]:hover { background: rgba(255, 255, 255, .16); } }
/* «Neu mischen» / «Neues Labyrinth» — справа: настройки слева, действие справа */
.kl-neu { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 10px;
  background: #fff; color: #34106c; font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; }
.kl-neu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .kl-neu:hover { background: #efe9fb; } }
.kl-leiste button:active, .kl-spielleiste button:active { transform: translateY(1px); }

/* планшет стоя и меньше */
@media (max-width: 760px) {
  .kl-leiste { gap: 8px; padding: 8px 12px; }
  .kl-titel { font-size: 18px; }
  .kl-titel span { display: none; }
  .kl-schalter svg { display: none; }
  .kl-spielleiste { padding: 6px 12px; gap: 6px 8px; }
  .kl-wahl button { padding: 5px 11px; font-size: 14px; }
}
/* телефон: «Startseite» и «Vorlagen» — только значком, слово в подсказке */
@media (max-width: 560px) {
  .kl-home { padding: 0 8px; }
  .kl-home__lbl, .kl-knopf__lbl { display: none; }
  #klVorlagen { padding: 0 9px; margin-right: 0; }
  .kl-knopf { padding: 0 10px; font-size: 13px; }
  .kl-titel { font-size: 17px; margin-left: 0; }
  .kl-rechts { gap: 4px; }
  .kl-menu { min-width: 230px; }
  .kl-spielleiste { justify-content: center; }
  .kl-neu { height: 32px; padding: 0 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .kl-pfeil { transition: none; } }

/* ── Freies Spiel / Reise (klReise в kl-leiste.js) ── */
.kl-modus { flex: none; }
/* карта этапов: в нижней полосе (тёмный фон) и в окне победы (.kl-karte--hell) */
.kl-karte { display: flex; align-items: center; padding-bottom: 8px; }
.kl-karte[hidden] { display: none; }
.kl-weg { width: 8px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.kl-etappe { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 13px; font-weight: 800; }
.kl-etappe:disabled { opacity: .5; font-size: 10px; border-color: rgba(255, 255, 255, .25); }
.kl-etappe.is-fertig { background: #fff; border-color: #fff; color: #34106c; }
.kl-etappe.is-jetzt { border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, .35); }
.kl-etappe.is-jetzt:not(:disabled) { animation: kl-puls 1.6s ease-in-out infinite; }
@keyframes kl-puls { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 63, .2); } }
.kl-etappe__st { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); font-size: 8px; letter-spacing: -1px; line-height: 1; color: #ffd23f; white-space: nowrap; }
@media (hover: hover) { .kl-etappe:not(:disabled):not(.is-fertig):hover { background: rgba(255, 255, 255, .24); } }
.kl-karte--hell { justify-content: center; padding-bottom: 10px; }
.kl-karte--hell .kl-weg { width: 4px; background: #e2dcf3; }
.kl-karte--hell .kl-etappe { width: 23px; height: 23px; border-color: #e2dcf3; background: #fff; color: #6f6792; font-size: 11.5px; }
.kl-karte--hell .kl-etappe.is-fertig { background: #5b2fc9; border-color: #5b2fc9; color: #fff; }
.kl-karte--hell .kl-etappe.is-jetzt { border-color: #f5b400; box-shadow: 0 0 0 3px rgba(245, 180, 0, .25); }
.kl-karte--hell .kl-etappe__st { color: #f5b400; }

/* экран выбора при запуске игры — под общей шапкой (top ставит скрипт) */
.kl-start { position: fixed; left: 0; right: 0; bottom: 0; top: 50px; z-index: 15; overflow-y: auto;
  display: flex; padding: 20px 16px; background: rgba(250, 248, 255, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; color: #2b2150; }
.kl-start__innen { margin: auto; width: min(760px, 100%); }
.kl-start__frage { margin: 0 0 18px; text-align: center; font-size: 26px; font-weight: 800; }
.kl-start__karten { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kl-start__karte { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px 20px; border-radius: 22px;
  border: 3px solid transparent; font: inherit; color: inherit; text-align: center; cursor: default;
  box-shadow: 0 10px 30px rgba(60, 30, 120, .14); transition: transform .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.kl-start__karte svg { width: 120px; height: 64px; margin-bottom: 4px; }
.kl-start__karte b { font-size: 24px; font-weight: 800; }
.kl-start__text { font-size: 15px; font-weight: 600; color: #6f6792; max-width: 280px; }
/* обе карточки одинаковые, белые (Лина 14.10: Reise не должна выделяться); различаются картинкой и кнопкой — у Reise жёлтая, как звёзды */
.kl-start__karte--frei, .kl-start__karte--reise { background: #fff; border-color: #e2dcf3; }
.kl-start__stand { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #6f6792; }
.kl-start__punkte { display: flex; gap: 4px; }
.kl-start__punkte i { width: 10px; height: 10px; border-radius: 50%; background: #e2dcf3; }
.kl-start__punkte i.is-fertig { background: #f5b400; }
.kl-start__los { margin-top: auto; padding: 10px 22px; border-radius: 999px; font-size: 16px; font-weight: 800; }
.kl-start__karte--frei .kl-start__los { background: #5b2fc9; color: #fff; }
.kl-start__karte--reise .kl-start__los { background: #ffd23f; color: #2b2150; }
.kl-start__karte:focus-visible { outline: 3px solid #5b2fc9; outline-offset: 3px; }
@media (hover: hover) { .kl-start__karte:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(60, 30, 120, .2); } }
.kl-start__karte:active { transform: translateY(1px); }
@media (max-width: 560px) {
  .kl-start { padding: 14px 12px; }
  .kl-start__frage { font-size: 20px; margin-bottom: 12px; }
  .kl-start__karten { grid-template-columns: 1fr; gap: 12px; }
  .kl-start__karte { padding: 14px 14px 16px; gap: 6px; }
  .kl-start__karte svg { width: 96px; height: 50px; }
  .kl-start__karte b { font-size: 20px; }
  .kl-etappe { width: 24px; height: 24px; font-size: 12px; }
  .kl-weg { width: 4px; }
}
@media (prefers-reduced-motion: reduce) { .kl-etappe.is-jetzt { animation: none !important; } .kl-start__karte { transition: none; } }

/* очень узкие телефоны (15.10.2026, мобильная проверка): название игры ▾ не налезает на кнопки справа (по-русски длиннее) */
@media (max-width: 360px) { .kl-leiste { gap: 6px; padding-inline: 8px; } .kl-titel { font-size: 15px; } .kl-titel__knopf { gap: 3px; padding-inline: 6px; margin-left: -2px; } .kl-knopf { padding: 0 8px; } #klVorlagen { padding: 0 7px; } .kl-rechts { gap: 3px; } }

/* ── настройки игры на телефоне (15.10.2026, kl-leiste.js: .kl-opt-knopf + .kl-optionen) ── */
.kl-optionen { display: contents; }
.kl-opt-knopf { display: none; }
.kl-opt-knopf[hidden] { display: none !important; }
@media (max-width: 560px) {
  .kl-spielleiste:not(.kl-spielleiste--tabs) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 12px 10px; }
  .kl-spielleiste:not(.kl-spielleiste--tabs) > .kl-modus { order: -2; grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .kl-spielleiste:not(.kl-spielleiste--tabs) > .kl-karte { order: -1; grid-column: 1 / -1; justify-content: center; }
  .kl-spielleiste:not(.kl-spielleiste--tabs) > .kl-neu { order: 2; grid-column: 2; margin-left: 0; height: 40px; }
  .kl-opt-knopf { order: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .13); color: #fff; font: inherit; font-size: 15px; font-weight: 700; text-align: left; }
  .kl-opt-knopf > svg:first-child { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .kl-opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kl-opt-knopf .kl-pfeil { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
  .kl-opt-knopf[aria-expanded="true"] { background: rgba(255, 255, 255, .22); }
  .kl-opt-knopf[aria-expanded="true"] .kl-pfeil { transform: rotate(180deg); }
  .kl-optionen { order: 3; grid-column: 1 / -1; display: none; flex-direction: column; gap: 6px; }
  .kl-optionen.is-offen { display: flex; }
  .kl-optionen > .kl-wahl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .kl-optionen > .kl-wahl[hidden] { display: none; }
  .kl-optionen > .kl-wahl button { padding: 8px 6px; text-align: center; }
  .kl-modus button { padding: 7px 6px; text-align: center; }
  /* Reise: выбирать нечего (кнопки настроек нет) — «Neu» по центру под картой этапов */
  .kl-opt-knopf[hidden] ~ .kl-neu { grid-column: 1 / -1; justify-self: center; margin-inline: auto; }
}
