/* Informatisches Problemloesen: Blocktyp "optimierung" und Werkzeuge "suche_gitter"/"ausbreitung" */
.optimierung [hidden], .pl-werkzeug [hidden] { display: none !important; }
.opt-figur .gsvg { max-height: 380px; margin: .5rem 0; user-select: none; }
.opt-klickbar { cursor: pointer; }
.gsvg-treffer.opt-klickbar { stroke: transparent; stroke-width: 18; pointer-events: stroke; }
.gsvg-kante.opt-gewaehlt { stroke: #16a34a !important; stroke-width: 6 !important; }
.gsvg-kante.opt-konflikt { stroke: #dc2626 !important; stroke-width: 5 !important; }
.gsvg-kante.opt-offen { stroke-dasharray: 6 5; stroke: #dc2626 !important; }
.opt-kamera .gsvg-kreis { fill: #fde68a !important; stroke: #b45309 !important; stroke-width: 4 !important; }
.opt-besucht .gsvg-kreis { fill: #bbf7d0 !important; }
.opt-fest .gsvg-kreis { fill: #86efac !important; stroke: #15803d !important; stroke-width: 3 !important; }
.opt-wert { font-size: 15px; font-weight: 700; fill: #1e3a8a; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.opt-wert-alt { text-decoration: line-through; fill: #94a3b8; font-weight: 400; }
.opt-wert-fest { fill: #15803d; }
.opt-stand { font-weight: 600; margin: .4rem 0; }
.opt-palette { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.opt-farbe { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #94a3b8;
  color: #fff; font-weight: 700; cursor: pointer; }
.opt-farbe.aktiv { box-shadow: 0 0 0 3px #0f172a; }
.opt-radierer { background: #f1f5f9; color: #334155; }
.opt-reihenfolge { font-family: ui-monospace, monospace; }
.opt-dijkstra-eingabe { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.opt-dijkstra-zeile { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
.opt-dijkstra-zeile input { width: 7rem; }
.opt-gegenstaende { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; margin: .5rem 0; }
.opt-gegenstand { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem;
  border: 2px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; }
.opt-gegenstand.eingepackt { border-color: #16a34a; background: #dcfce7; }
.opt-symbol { font-size: 1.8rem; }
.opt-balken { height: 1.1rem; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
.opt-balken-fuellung { height: 100%; width: 0; background: #22c55e; transition: width .2s; }
.opt-balken.zu-schwer .opt-balken-fuellung { background: #dc2626; }
.opt-brett { display: grid; max-width: 26rem; border: 2px solid #334155; }
.opt-feld-schach { aspect-ratio: 1; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0; }
.opt-feld-schach.hell { background: #f1e3c6; }
.opt-feld-schach.dunkel { background: #b58863; }
.opt-feld-schach.bedroht { color: #dc2626; box-shadow: inset 0 0 0 3px #dc2626; }
.opt-affen-brett { display: grid; gap: 2px; max-width: 22rem; background: #78716c; padding: 2px; margin: .5rem 0; }
.opt-affen-feld { aspect-ratio: 1; border: 0; padding: 0; background: #e7e5e4; cursor: pointer; }
.opt-affen-feld.passt-nicht { box-shadow: inset 0 0 0 3px #dc2626; }
.opt-affen-ablage { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt-affen-kachel { width: 4.5rem; height: 4.5rem; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; }
.opt-affen-kachel.aktiv { border-color: #0f172a; }
.opt-kachel-svg { width: 100%; height: 100%; display: block; }

/* Werkzeuge */
.pl-werkzeug { border: 1px solid #cbd5e1; border-radius: 10px; padding: .8rem; background: #f8fafc; }
.pl-steuerung { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.pl-steuerung input[type=range] { width: 10rem; }
.pl-leinwand { width: 100%; max-width: 520px; aspect-ratio: 1; display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; }
.pl-zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .3rem .8rem; margin-top: .5rem; }
.pl-zahlen dt { font-weight: 400; color: #475569; }
.pl-zahlen dd { margin: 0 0 .3rem; font-weight: 700; font-size: 1.1rem; }
.pl-fortschritt { height: .8rem; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.pl-fortschritt > div { height: 100%; background: #f97316; width: 0; }
@media (prefers-color-scheme: dark) {
  .pl-werkzeug, .opt-dijkstra-eingabe { background: transparent; }
}
.pl-wasser { stroke: #3b82f6; stroke-width: 7; stroke-linecap: round; opacity: .7; }
.pl-erreicht .gsvg-kreis { fill: #93c5fd !important; stroke: #1d4ed8 !important; }
.opt-affen-zurueck { margin: .3rem 0; }
.opt-affen-zurueck.aktiv { box-shadow: 0 0 0 3px #0f172a; }
.opt-affen-brett.zuruecklegen .opt-affen-feld { cursor: not-allowed; }

/* Tablets: groessere Trefferflaechen fuer Kanten, kein Doppeltipp-Zoom */
.optimierung svg, .pl-werkzeug svg, .pl-leinwand { touch-action: manipulation; }
@media (pointer: coarse) {
  .gsvg-treffer.opt-klickbar { stroke-width: 30; }
  .opt-dijkstra-zeile input { width: 8rem; }
  .opt-farbe { width: 2.9rem; height: 2.9rem; }
}
/* Gefuehrte Einfuehrung Dijkstra (Option anleitung) */
.opt-anleitung { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: .6rem .9rem; margin: 0 0 .8rem; }
.opt-anleitung p { margin: .2rem 0 .4rem; }
.opt-anleitung ol { margin: .2rem 0 .6rem; padding-left: 1.3rem; }
.opt-anleitung-kopf { font-weight: 600; }
.opt-tipp .gsvg-kreis { stroke: #f59e0b !important; stroke-width: 5 !important; animation: opt-tipp 1.2s ease-in-out infinite; }
@keyframes opt-tipp { 50% { stroke-opacity: .35; } }
