/* Handy-Feinschliff: letzte Stilschicht nach marke.css. Ziel: Spielkarte und Antwortflächen ohne Scrollen sichtbar. */

/* Memory-Rückseite mit dem Zeichen der Staplerschein-Akademie statt des alten Schriftzugs */
.memory-cover > * { display: none !important; }
.memory-cover::after { content: ""; position: absolute; inset: 22%; background: url("assets/marke/zeichen.svg") center / contain no-repeat; opacity: .92; }

@media (max-width: 760px) {
  .game-route-top { margin-bottom: 8px !important; }
  .game-board { padding: 14px 12px !important; }
  .game-board-head { gap: 6px !important; margin-bottom: 6px !important; align-items: center; }
  .game-board-head .game-eyebrow { display: none !important; }
  .game-board-head h2 { font-size: 21px !important; line-height: 1.1 !important; margin: 0 !important; }
  .game-points { font-size: 11px !important; padding: 3px 8px !important; }
  .game-controls { margin: 4px 0 !important; gap: 8px !important; }
  .game-controls button { min-height: 34px !important; padding: 5px 12px !important; font-size: 13px !important; }
  .game-meter { margin: 6px 0 8px !important; }

  /* Bildkarten sortieren: Karte kleiner, Antwortflächen direkt darunter */
  .sort-arena { gap: 10px !important; }
  .sort-card { padding: 10px 12px !important; }
  .sort-card .sort-card-tag { margin-bottom: 4px !important; }
  .sort-card img { max-height: 21vh !important; max-height: 21dvh !important; width: 100% !important; object-fit: cover !important; }
  .sort-card h3 { font-size: 17px !important; line-height: 1.2 !important; margin: 6px 0 !important; }
  .sort-card .card-listen { min-height: 30px !important; padding: 4px 12px !important; font-size: 13px !important; }
  .sort-bucket { min-height: 62px !important; padding: 6px !important; gap: 2px !important; }
  .sort-bucket > span { font-size: 22px !important; line-height: 1 !important; height: auto !important; }

  /* Memory: alle acht Karten auf einen Blick */
  .memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .memory-grid > .memory-card { height: auto !important; min-height: 0 !important; aspect-ratio: 3 / 4; }
  .memory-face > span { font-size: 10px !important; line-height: 1.15 !important; word-break: normal !important; overflow-wrap: normal !important; hyphens: auto; -webkit-hyphens: auto; padding: 0 3px !important; }
  .memory-cover { overflow: hidden !important; }

  /* Kopf: Titel und Schichtpunkte in einer Zeile, Aufgabe etwas kleiner */
  .game-board-head { display: flex !important; flex-wrap: wrap; justify-content: space-between; }
  .game-board-head > div { flex: 1 1 170px; min-width: 0; }
  .game-short { font-size: 15px !important; line-height: 1.3 !important; margin: 0 0 8px !important; }

  /* Reihenfolge-Spiele: flachere Karten, Prüfknopf bleibt am unteren Rand sichtbar */
  .game-order-list { gap: 6px !important; }
  .game-order-item { padding: 4px 8px !important; gap: 8px !important; grid-template-columns: 20px 60px minmax(0, 1fr) 36px !important; align-items: center !important; }
  .game-order-item > .game-icon { width: 60px !important; height: 46px !important; object-fit: cover !important; }
  .game-order-item strong { line-height: 1.25 !important; }
  .game-order-item > div:not(.order-moves) { gap: 2px !important; }
  .game-order-item > div:not(.order-moves) > button { min-height: 24px !important; padding: 2px 8px !important; font-size: 11px !important; }
  .order-moves { flex-direction: column !important; gap: 4px !important; }
  .order-moves button { min-height: 32px !important; height: 32px !important; width: 36px !important; }
  .game-action { position: sticky; bottom: 8px; z-index: 6; margin-top: 8px !important; }
  .game-action .game-primary { min-height: 44px !important; padding: 8px 18px !important; font-size: 16px !important; }

  /* Suchbilder: Vergleichsbild kleiner, Suchbild voll; Beschriftung liegt auf dem Bild */
  .scene-comparison.two-scenes { gap: 8px !important; }
  .scene-comparison.two-scenes > figure { position: relative; margin: 0 !important; }
  .scene-comparison.two-scenes > figure:not(:has(.scene-hit-area)) { width: 60%; justify-self: center; }
  .scene-comparison.two-scenes figcaption { position: absolute !important; top: 6px; left: 6px; z-index: 4; padding: 3px 8px !important; font-size: 11px !important; line-height: 1.2 !important; border-radius: 8px; pointer-events: none; background: #0b1d33e6 !important; }

  /* Kontrollblick: Bildkacheln kompakter */
  .inspection-tiles { gap: 8px !important; }
  .inspection-tile { padding: 0 0 6px !important; gap: 4px !important; }
}

/* Geführtes Modul (Ben erklärt, Du bist dran, Wissens-Check): drei Schritte in einer Zeile, Startknopf ohne Scrollen */
@media (max-width: 760px) {
  .gm-steps { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; }
  .gm-steps li { min-width: 0; }
  .gm-steps li > a, .gm-steps li > span { flex-direction: column; justify-content: center; gap: 3px !important; height: 100%; box-sizing: border-box; padding: 6px 4px !important; border-radius: 16px !important; font-size: 13px !important; text-align: center; }
  .gm-steps b { width: 24px !important; height: 24px !important; font-size: 13px !important; flex: none; }
  .gm-step-text { text-align: center !important; justify-items: center; }
  .gm-stand { font-size: 10.5px !important; }
  .gm-card { padding: 16px 14px !important; }
  .gm-text { font-size: 17px !important; line-height: 1.45 !important; }
  .gm-hear { font-size: 15px !important; padding: 7px 14px !important; margin: 0 0 10px !important; }
  .gm-go { font-size: 20px !important; padding: 14px 18px !important; margin-top: 10px !important; }
  /* Situationsfragen: Foto flacher, Frage und Antworten kompakter, Schrift bleibt gut lesbar */
  .gm-count { font-size: 15px !important; margin-bottom: 4px !important; }
  #gmPic .academy-photo { max-height: 26vh !important; max-height: 26dvh !important; width: 100% !important; object-fit: cover !important; }
  #gmPic .gm-icon.big { height: auto !important; aspect-ratio: auto !important; }
  .gm-q { font-size: 19px !important; line-height: 1.35 !important; margin-bottom: 10px !important; }
  .gm-answers { gap: 8px !important; }
  .gm-answer { font-size: 17px !important; padding: 10px 12px !important; min-height: 0 !important; gap: 12px !important; border-width: 2px !important; }
  .gm-answer > b { width: 36px !important; height: 36px !important; font-size: 18px !important; flex: none; }

  /* Bens Steuerung in zwei sauberen Zeilen: oben Abspielen und Vollbild, unten Zeit, Tempo und Hilfen */
  .ppt-controls { display: flex !important; flex-wrap: wrap !important; gap: 6px 5px !important; align-items: center; }
  .ppt-controls > button { width: 42px !important; min-width: 42px !important; height: 42px !important; min-height: 42px !important; padding: 0 !important; margin: 0 !important; flex: none; }
  .ppt-controls > #pptPrev { order: 1; } .ppt-controls > #pptPlay { order: 2; flex: 1 1 70px !important; width: auto !important; }
  .ppt-controls > #pptReplay { order: 3; } .ppt-controls > #pptNext { order: 4; } .ppt-controls > #pptFullscreen { order: 5; }
  .ppt-controls > .ppt-time { order: 7; font-size: 11px !important; letter-spacing: -.2px; min-width: 0 !important; margin: 0 !important; }
  .ppt-controls > .ppt-speed { order: 8; flex: 1 1 90px !important; min-width: 0 !important; font-size: 0 !important; margin: 0 !important; }
  .ppt-controls > .ppt-speed select { width: 100% !important; min-width: 0 !important; height: 42px !important; font-size: 12.5px !important; padding: 0 16px 0 6px !important; background-position: right 4px center !important; }
  .ppt-controls > #pptCC, .ppt-controls > #pptHelp, .ppt-controls > #pptZoom { width: 36px !important; min-width: 36px !important; }
  .ppt-controls > #pptCC { order: 9; } .ppt-controls > #pptHelp { order: 10; } .ppt-controls > #pptZoom { order: 11; }
  .ppt-controls::after { content: ""; order: 6; flex: 0 0 100%; height: 0; margin-top: -6px; }
  /* Im Kinomodus flache Leiste in einer Zeile, damit das Bild frei bleibt */
  .vb-an .ppt-controls::after { display: none; }
  .vb-an .ppt-controls { justify-content: center; }
  .vb-an .ppt-controls > #pptPlay { flex: 0 0 auto !important; width: auto !important; padding: 0 14px !important; }
  .vb-an .ppt-controls > .ppt-speed { flex: 0 0 140px !important; }
}

/* Lernbegleiter: Eingabefeld ohne Scrollen erreichbar, Verlauf scrollt im Fenster */
@media (max-width: 760px) {
  .chat-window { min-height: 150px !important; height: auto !important; max-height: 40vh !important; max-height: 40dvh !important; overflow-y: auto !important; }
  .chat-form { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: stretch; gap: 8px !important; }
  .chat-form input { flex: 1 1 auto !important; min-width: 0; }
  .chat-form .button { flex: none; width: auto !important; padding-inline: 16px !important; }
}

/* Sehr kleine Handys */
@media (max-width: 360px) {
  .arcade-cab-top { gap: 4px !important; }
  .arcade-type { letter-spacing: .6px !important; min-width: 0; }
  .game-board-head h2 { font-size: 19px !important; }
  .sort-card img { max-height: 18vh !important; max-height: 18dvh !important; }
}

/* Handy quer: Spielflächen nebeneinander statt untereinander, damit sie in die niedrige Höhe passen */
@media (orientation: landscape) and (max-height: 520px) {
  .game-board { padding: 10px 14px !important; }
  .game-short { margin-bottom: 6px !important; }
  .sort-arena { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) !important; align-items: stretch; }
  .sort-arena > .sort-card { grid-column: 2 !important; grid-row: 1 !important; }
  .sort-card img { max-height: 26vh !important; max-height: 26dvh !important; }
  .sort-bucket { min-height: 0 !important; }
  .game-order-list { display: grid !important; grid-template-columns: 1fr 1fr; }
  .scene-comparison.two-scenes { grid-template-columns: 1fr 1fr !important; align-items: start; }
  .scene-comparison.two-scenes > figure:not(:has(.scene-hit-area)) { width: 100%; }
  .scene-comparison:not(.two-scenes) > figure { width: min(100%, 74vh); width: min(100%, 74dvh); margin: 0 auto !important; }
  .inspection-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .memory-grid { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
}
