/* Anwendungen: Editor, WordPad, Explorer, Minesweeper, Systemdialoge */

::selection { background: var(--navy); color: var(--weiss); }

/* ---------- Meldungsfenster und Dialoge ---------- */

.win.dialog { min-width: 240px; max-width: min(460px, 96vw); }
.msgbox .dlg-buttons { padding: 14px 14px 14px; }
.msgbox .dlg-text { max-width: 290px; }
.sheet, .rundlg, .netdlg, .finddlg, .beenden { width: min(400px, 96vw); }
.grow { flex: 1; min-width: 0; }

.dlgsheet { padding: 8px 8px 0; }
.dlgsheet .dlg-buttons { padding: 10px 0 8px; }

/* Systemeigenschaften */
.sp-allgemein { display: flex; gap: 14px; }
.sp-art { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 6px; }
.sp-art img:first-child { width: 64px; height: 64px; }
.sp-info { min-width: 0; flex: 1; }
.sp-info .etched { margin: 8px 0; }
.sp-titel { margin-bottom: 1px; }
.sp-wert { padding-left: 18px; }
.sp-hinweis { margin: 4px 0 2px; }

/* Anzeige-Eigenschaften */
.disp { display: flex; flex-direction: column; }
.mon { width: 164px; margin: 4px auto 12px; }
.mon-rahmen { padding: 10px 10px 12px; background: var(--grau); box-shadow: var(--bevel-erhoben); }
.mon-schirm { height: 86px; box-shadow: var(--bevel-flach-hinein); }
.mon-fuss { width: 70px; height: 8px; margin: 0 auto; background: var(--grau); box-shadow: var(--bevel-erhoben); }
.mon-fuss::after { content: ""; display: block; width: 96px; height: 6px; margin: 8px 0 0 -13px; background: var(--grau); box-shadow: var(--bevel-erhoben); }
.disp-lab { margin: 10px 0 3px; }
.disp-liste { height: 94px; }

/* Ausführen, Beenden, Netzlaufwerk, Suchen */
.run { padding: 14px 14px 0; }
.run-row { display: flex; gap: 14px; }
.run-text { margin: 0; line-height: 1.35; }
.run-zeile { display: flex; align-items: center; gap: 10px; margin: 14px 0 0 46px; }
.run-feld { flex: 1; min-width: 0; }
.run-btns { justify-content: flex-end; padding: 14px 0 12px; }

.sdlg { padding: 0 0 0; }
.sd-row { display: flex; gap: 16px; padding: 16px 16px 0; }
.sd-wahl p { margin: 0 0 10px; }
.sd-wahl .rad { display: flex; margin: 6px 0; }
.sd-btns { padding: 14px 12px 14px; }

.nd { padding: 14px 14px 0; }
.nd-row { display: flex; gap: 14px; }
.nd-text { margin: 0; line-height: 1.35; }
.nd-form { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; margin: 16px 0 6px; }
.nd-pfad { width: 100%; }
.nd-laufwerk { width: 70px; }
.nd-btns { padding: 12px 0 14px; justify-content: flex-end; }
.progress { height: 20px; margin: 8px 0 0; padding: 2px; background: var(--weiss); box-shadow: var(--bevel-flach-hinein); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 9px, transparent 9px 11px); animation: pfuellen .85s steps(20) forwards; }
@keyframes pfuellen { to { width: 100%; } }

.find { padding: 12px; }
.find-main { display: flex; gap: 14px; }
.find-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.find-row { display: flex; align-items: center; gap: 8px; }
.find-btns { display: flex; flex-direction: column; gap: 6px; padding: 0; flex: none; }
.find-dir { display: flex; gap: 18px; align-self: flex-start; }

/* ---------- Werkzeugleisten ---------- */

.toolbar {
  flex: none; display: flex; align-items: center; min-height: 28px; padding: 2px 2px;
  border-bottom: 1px solid var(--grau-dunkel); box-shadow: 0 1px 0 var(--weiss);
  overflow-x: auto; overflow-y: hidden; margin-bottom: 1px; scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.tb-griff { flex: none; width: 3px; height: 22px; margin: 0 5px 0 2px; box-shadow: inset 1px 1px 0 var(--weiss), inset -1px -1px 0 var(--grau-dunkel); }
.tb-trenner { flex: none; width: 2px; height: 22px; margin: 0 4px; box-shadow: inset 1px 0 var(--grau-dunkel), inset -1px 0 var(--weiss); }
.tbb {
  -webkit-appearance: none; appearance: none; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 23px; height: 23px; margin: 0; padding: 0 3px; border: 0; border-radius: 0;
  background: transparent; color: var(--text); font: 11px var(--schrift); cursor: default;
}
.tbb:hover:not(:disabled) { box-shadow: var(--bevel-flach-heraus); }
.tbb:active:not(:disabled), .tbb.an { box-shadow: var(--bevel-flach-hinein); }
.tbb:active:not(:disabled) > *, .tbb.an > * { transform: translate(1px, 1px); }
.tbb.an { background: var(--dither); }
.tbb:focus-visible { outline: 1px dotted var(--schwarz); outline-offset: -3px; }
.tbb img, .tbb svg { display: block; }
.tbb svg { fill: currentColor; shape-rendering: crispEdges; }
.tbb:disabled { color: var(--grau-dunkel); text-shadow: 1px 1px 0 var(--weiss); }
.tbb:disabled > img { filter: grayscale(1) contrast(.55) brightness(1.25); opacity: .6; }
.tbb:disabled > svg { color: var(--grau-dunkel); filter: drop-shadow(1px 1px 0 var(--weiss)); }
.tbt { font: bold 13px var(--serif); width: 23px; }
.tbt i, .tbt u, .tbt b { font-size: 13px; }
.tbb-t { padding-right: 2px; }
.toolbar select { margin: 0 2px; height: 21px; flex: none; }
.wp-schrift { width: 150px; }
.wp-grad { width: 52px; }

/* ---------- Editor ---------- */

.np-wrap { flex: 1; min-height: 0; display: flex; background: var(--weiss); box-shadow: var(--bevel-feld); margin: 0 0 1px; }
.np-text {
  flex: 1; min-width: 0; min-height: 0; resize: none; border: 0; outline: 0; margin: 0; padding: 3px 4px;
  background: var(--weiss); color: var(--text);
  font: 13px/1.2 var(--mono); white-space: pre-wrap; overflow: auto;
  -webkit-user-select: text; user-select: text; cursor: text; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.np-text.nowrap { white-space: pre; overflow-wrap: normal; }

/* ---------- WordPad ---------- */

.wp { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ruler { flex: none; position: relative; height: 20px; overflow: hidden; border-bottom: 1px solid var(--grau-dunkel); box-shadow: 0 1px 0 var(--weiss); margin-bottom: 1px; }
.ruler-in { position: absolute; left: 10px; right: 0; top: 2px; height: 16px; background: var(--weiss); box-shadow: inset 1px 1px 0 var(--grau-dunkel); overflow: hidden; }
.ruler-svg { display: block; margin-left: 0; }
.ruler-marke { position: absolute; left: 7px; top: 12px; width: 7px; height: 5px; background: var(--schwarz); clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.wp-raum { flex: 1; min-height: 0; display: flex; background: var(--weiss); box-shadow: var(--bevel-feld); margin-bottom: 1px; }
.wp-doc {
  flex: 1; min-width: 0; overflow: auto; padding: 8px 12px 24px 10px; background: var(--weiss); color: var(--text);
  font: 13.33px/1.3 var(--serif); outline: 0; cursor: text;
  -webkit-user-select: text; user-select: text;
}
.wp-page h1 { margin: 0; font: bold 24px/1.15 var(--serif); }
.wp-page .wp-sub { margin: 2px 0 14px; font-size: 16px; font-style: italic; color: var(--text-leise); }
.wp-page h2 { margin: 16px 0 5px; padding-bottom: 1px; font: bold 16px/1.2 var(--serif); border-bottom: 1px solid var(--schwarz); }
.wp-page .wp-eintrag { margin: 5px 0 6px; }
.wp-page ul { margin: 4px 0 6px; padding-left: 24px; }
.wp-page li { margin: 3px 0; }
.wp-laden p { margin: 8px 0; }

/* ---------- Explorer ---------- */

.ex { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adrbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 2px 3px 3px 2px; border-bottom: 1px solid var(--grau-dunkel); box-shadow: 0 1px 0 var(--weiss); margin-bottom: 2px; }
.adrbar .tb-griff { margin-right: 2px; }
.adr-feld { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 2px 0 4px; background: var(--weiss); box-shadow: var(--bevel-feld); }
.adr-ico { flex: none; display: flex; }
.adr-ico img { width: 16px; height: 16px; }
.adr-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.adr-pfeil { flex: none; width: 16px; height: 17px; background: var(--pfeil-auswahl) no-repeat center / 16px 17px; }

.ex-main { flex: 1; min-height: 0; display: flex; container-type: inline-size; background: var(--weiss); box-shadow: var(--bevel-feld); }
.ex-pane { flex: none; width: 176px; padding: 14px 10px 10px 14px; overflow: hidden; background: var(--weiss); }
.ex-titel { margin: 0; font: bold 21px/1.15 "Arial Black", Arial, Verdana, sans-serif; letter-spacing: -.5px; color: var(--text); overflow-wrap: anywhere; }
.ex-linie { height: 3px; margin: 8px 0 10px; background: linear-gradient(90deg, var(--navy), var(--weiss)); }
.ex-text p { margin: 0 0 8px; }
.ex-hinweis { color: var(--text-leise); }
.ex-main.no-web .ex-pane { display: none; }
@container (max-width: 460px) { .ex-pane { display: none; } }

.ex-list { flex: 1; min-width: 0; position: relative; overflow: auto; background: var(--weiss); display: flex; flex-direction: column; }
.ex-kopf { display: none; position: sticky; top: 0; z-index: 2; flex: none; }
.ex-kopf span { padding: 1px 4px 2px; background: var(--grau); box-shadow: var(--bevel-erhoben); overflow: hidden; white-space: nowrap; }
.ex-kopf span:first-child { grid-column: 1 / 3; }

.exi {
  -webkit-appearance: none; appearance: none; display: flex; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--text); font: 11px var(--schrift); text-align: center; cursor: default; min-width: 0;
}
.exi:focus { outline: none; }
.exi .ib { margin: 0; }
.exs, .ext, .exd { display: none; }
.exl { padding: 1px 2px; overflow-wrap: anywhere; }
.exi.sel .exl { background: var(--navy); color: var(--weiss); outline: 1px dotted var(--weiss); outline-offset: -1px; }
.ex-list:not(:focus-within) .exi.sel .exl { background: var(--grau-dunkel); }
.exi:focus-visible .exl { outline: 1px dotted var(--schwarz); outline-offset: -1px; }
.exi.sel:focus-visible .exl { outline-color: var(--weiss); }

.v-gross .ex-items { display: flex; flex-wrap: wrap; align-content: flex-start; padding: 6px 4px; }
.v-gross .exi { width: 75px; min-height: 75px; flex-direction: column; align-items: center; padding: 4px 1px 0; }
.v-gross .exi .ib { margin-bottom: 4px; }
.v-gross .exl { max-width: 100%; }

.v-klein .ex-items { display: flex; flex-wrap: wrap; align-content: flex-start; padding: 4px; }
.v-klein .exi { width: 168px; height: 18px; flex-direction: row; align-items: center; gap: 3px; text-align: left; }
.v-klein .exl, .v-liste .exl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-klein .ib, .v-liste .ib, .v-details .ib { width: 16px; height: 16px; }

.v-liste { overflow-y: hidden; }
.v-liste .ex-items { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 18px); grid-auto-columns: 168px; align-content: start; padding: 4px; }
.v-liste .exi { height: 18px; flex-direction: row; align-items: center; gap: 3px; text-align: left; }

.v-details { --spalten: 16px minmax(110px, 2fr) 64px minmax(90px, 1fr) 84px; }
.v-details .ex-kopf { display: grid; grid-template-columns: var(--spalten); min-width: 440px; }
.v-details .ex-items { min-width: 440px; }
.v-details .exi { display: grid; grid-template-columns: var(--spalten); height: 18px; align-items: center; text-align: left; }
.v-details .exl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-self: start; max-width: 100%; margin-left: 3px; }
.v-details .exs, .v-details .ext, .v-details .exd { display: block; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-details .exs { text-align: right; }

.sb-ort { min-width: 100px; flex: none; }
.sb-mid { min-width: 70px; flex: none; }
.sb-num { min-width: 32px; flex: none; }

/* ---------- Minesweeper ---------- */

.ms-fenster { --ms-s: 1; }
.ms { margin: 3px; padding: 6px; background: var(--grau); box-shadow: inset 3px 3px 0 var(--weiss), inset -3px -3px 0 var(--grau-dunkel); }
.ms-kopf { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; padding: 4px 6px; box-shadow: inset 2px 2px 0 var(--grau-dunkel), inset -2px -2px 0 var(--weiss); }
.ms-zaehler { display: flex; gap: 1px; padding: 1px; background: var(--schwarz); box-shadow: 0 0 0 1px var(--grau-dunkel); }
.ms-ziffer { display: block; width: calc(13px * var(--ms-s)); height: calc(23px * var(--ms-s)); background: #000; }
.ms-ziffer .seg { fill: #350000; }
.ms-ziffer .seg.an { fill: #ff0000; }
.ms-smiley {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; padding: 0; border: 0; border-radius: 0;
  width: calc(26px * var(--ms-s)); height: calc(26px * var(--ms-s));
  background-color: var(--grau); background-repeat: no-repeat; background-position: center; background-size: calc(24px * var(--ms-s));
  box-shadow: 0 0 0 1px var(--grau-dunkel), inset 2px 2px 0 var(--weiss), inset -2px -2px 0 var(--grau-dunkel);
  cursor: default;
}
.ms-smiley:active { box-shadow: 0 0 0 1px var(--grau-dunkel), inset 1px 1px 0 var(--grau-dunkel); background-position: 1px 1px; }
.ms-smiley:focus-visible { outline: 1px dotted var(--schwarz); outline-offset: -4px; }
.face-smile { background-image: url("../icons/face-smile.svg"); }
.face-ooh { background-image: url("../icons/face-ooh.svg"); }
.face-dead { background-image: url("../icons/face-dead.svg"); }
.face-cool { background-image: url("../icons/face-cool.svg"); }

.ms-feldrahmen { box-shadow: inset 3px 3px 0 var(--grau-dunkel), inset -3px -3px 0 var(--weiss); padding: 3px; }
.ms-brett { display: grid; touch-action: none; -webkit-touch-callout: none; }
.ms-z {
  width: var(--z); height: var(--z); display: flex; align-items: center; justify-content: center;
  background: var(--grau) no-repeat center / 100% 100%;
  box-shadow: inset 2px 2px 0 var(--weiss), inset -2px -2px 0 var(--grau-dunkel);
  font: 900 calc(var(--z) * .78) / 1 Arial, "Arial Black", Verdana, sans-serif;
  -webkit-user-select: none; user-select: none;
}
.ms-z.offen, .ms-z.druck { box-shadow: inset 1px 1px 0 var(--grau-dunkel); }
.ms-z.flagge { background-image: url("../icons/cell-flag.svg"); }
.ms-z.mine { background-image: url("../icons/cell-mine.svg"); }
.ms-z.falsch { background-image: url("../icons/cell-wrong.svg"); }
.ms-z.platzt { background-color: #ff0000; }
.ms-z.n1 { color: #0000ff; } .ms-z.n2 { color: #008000; } .ms-z.n3 { color: #ff0000; } .ms-z.n4 { color: #000080; }
.ms-z.n5 { color: #800000; } .ms-z.n6 { color: #008080; } .ms-z.n7 { color: #000000; } .ms-z.n8 { color: #808080; }

/* ---------- Einwilligung und Bot-Schutz ---------- */

.win.consentdlg { width: min(470px, 96vw); max-width: min(470px, 96vw); }
.consent { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.consent .dlg-text { max-width: none; }
.co-gruppe { display: flex; flex-direction: column; gap: 8px; }
.co-opt .chk { align-items: flex-start; }
.co-opt .chk input { margin-top: 2px; }
.co-hint { margin: 1px 0 0 19px; color: var(--text-leise); font-size: 10px; line-height: 1.3; }
.co-link { padding: 0 2px; }
.linkbtn {
  -webkit-appearance: none; appearance: none; background: none; border: 0; margin: 0; padding: 0;
  color: var(--link); font: inherit; text-decoration: underline; cursor: default;
}
.linkbtn:focus { outline: 1px dotted var(--schwarz); outline-offset: 1px; }
.co-btns { padding: 6px 0 12px; gap: 6px; }
.co-btns .btn { min-width: 0; padding: 0 10px; }
.co-btns { justify-content: flex-start; }
.co-btns .co-alle { margin-left: auto; margin-right: 1px; }
.co-btns .btn:nth-child(2) { margin-right: 22px; }

.win.botbox { width: min(340px, 96vw); }
.botdlg .botcheck { min-height: 0; display: flex; justify-content: center; }
.botdlg .progress { margin: 4px 14px 0; }
.botdlg .dlg-row { padding: 0 14px; }
.progress-fill.indet { width: 30%; animation: pwandern 1.4s steps(14) infinite alternate; }
@keyframes pwandern { from { margin-left: 0; } to { margin-left: 70%; } }
@media (prefers-reduced-motion: reduce) { .progress-fill.indet { animation: none; } }

/* ---------- Mobil ---------- */

@media (max-width: 699px) {
  .ms-fenster { --ms-s: 1.5; }
  .np-text { font-size: 16px; }
  .wp-doc { font-size: 16px; }
  .win, .menu { font-size: 13px; }
  .co-hint { font-size: 11px; }
  .co-btns .btn { height: 30px; }
  .tbb { min-width: 34px; height: 34px; }
  .toolbar { min-height: 38px; }
  .exi { font-size: 13px; }
  .v-gross .exi { width: 86px; min-height: 92px; }
  .v-klein .exi, .v-liste .exi, .v-details .exi { height: 28px; }
  .v-details { --spalten: 16px minmax(110px, 2fr) 64px minmax(90px, 1fr) 84px; }
  .adr-feld { height: 30px; }
  .sp-info, .sp-allgemein { font-size: 13px; }
  .ex-pane { display: none; }
}
