/* =====================================================================
   apps.css — Oberflächen der Demo-Anwendungen
   ===================================================================== */

/* =====================================================================
   WEB FORGING
   ===================================================================== */
.wf {
  display: flex;
  height: 100%;
  min-height: 0;
  background: var(--xp-face);
}

/* ---- Blockpalette (links) ------------------------------------------ */
.wf-pal {
  width: 172px;
  flex: none;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #b9b6a8;
  background: linear-gradient(180deg, #f4f2ea 0%, #e9e6da 100%);
  min-height: 0;
}
.wf-pal-head, .wf-props-head, .wf-code-head {
  flex: none;
  padding: 4px 8px;
  font-weight: 700;
  color: #16335e;
  background: linear-gradient(180deg, #e8f0fb 0%, #cfe0f5 100%);
  border-bottom: 1px solid #adc4e2;
}
.wf-pal-list { flex: 1; overflow: auto; padding: 4px; }
.wf-block-btn {
  width: 100%;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 6px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  cursor: grab;
  text-align: left;
  font: 11px Tahoma, sans-serif;
  color: #1a2b46;
}
.wf-block-btn:hover { border-color: #9fc0e8; background: linear-gradient(180deg, #fbfdff, #dfeafb); }
.wf-block-btn:active { cursor: grabbing; background: linear-gradient(180deg, #cfe1f8, #eaf3ff); }
.wf-block-btn .glyph {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: 3px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(180deg, #6ea8e8, #2f6ab8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.wf-block-btn b { display: block; font-weight: 700; }
.wf-block-btn em { font-style: normal; font-size: 10px; color: #5d6a80; }

.wf-pal-foot {
  flex: none;
  padding: 6px 8px;
  border-top: 1px solid #cfccbe;
  font-size: 10px;
  color: #5d6a80;
  line-height: 1.45;
}

/* ---- Mitte: Leinwand + Quelltext ----------------------------------- */
.wf-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.wf-canvas-bar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 3px 7px;
  background: linear-gradient(180deg, #f7f6f0, #e9e7db);
  border-bottom: 1px solid #c8c5b7;
  font-size: 11px;
}
.wf-canvas-bar label { display: flex; align-items: center; gap: 4px; color: #33405a; }
.wf-canvas-bar .spacer { flex: 1; }

.wf-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  justify-content: center;
  background:
    repeating-conic-gradient(#c9c6bb 0 25%, #d8d5cb 0 50%) 0 0 / 16px 16px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.18);
}
.wf-viewport {
  width: 100%;
  max-width: var(--wf-vw, 100%);
  height: fit-content;
  align-self: flex-start;
  background: #fff;
  border: 1px solid #7f8a96;
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
  display: flex; flex-direction: column;
}
.wf-vp-chrome {
  flex: none;
  height: 20px;
  display: flex; align-items: center; gap: 5px;
  padding: 0 6px;
  background: linear-gradient(180deg, #e9e7db, #d3d0c2);
  border-bottom: 1px solid #a9a698;
  font-size: 10px; color: #4a4a42;
}
.wf-vp-chrome i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b9b6a8; box-shadow: inset 0 1px 1px rgba(0,0,0,.25);
}
.wf-vp-chrome span { margin-left: 4px; opacity: .8; }
.wf-frame { display: block; width: 100%; height: 430px; border: 0; background: #fff; }

/* ---- Quelltextpanel ------------------------------------------------ */
.wf-code {
  flex: none;
  height: 176px;
  min-height: 26px;
  display: flex; flex-direction: column;
  border-top: 1px solid #b9b6a8;
  background: #12161f;
}
.wf-code.collapsed { height: 26px; }
.wf-code.collapsed .wf-code-body { display: none; }
.wf-code-head {
  display: flex; align-items: stretch; gap: 0;
  padding: 0;
  background: linear-gradient(180deg, #e8f0fb 0%, #cfe0f5 100%);
}
.wf-tab {
  padding: 4px 12px;
  border: 0; border-right: 1px solid #adc4e2;
  background: none;
  cursor: pointer;
  font: 11px Tahoma, sans-serif;
  color: #33507e;
}
.wf-tab.on { background: #12161f; color: #9fd0ff; font-weight: 700; }
.wf-code-head .spacer { flex: 1; }
.wf-code-toggle {
  border: 0; background: none; cursor: pointer;
  padding: 0 10px; color: #33507e; font: 11px Tahoma, sans-serif;
}
.wf-code-toggle:hover { background: rgba(255,255,255,.5); }

.wf-code-body { flex: 1; min-height: 0; overflow: auto; }
.wf-code-body pre {
  margin: 0;
  padding: 8px 10px;
  font: 11px/1.55 "Lucida Console", Consolas, monospace;
  color: #b9c6d8;
  tab-size: 2;
  white-space: pre;
}
.wf-code-body::-webkit-scrollbar { width: 14px; height: 14px; }
.wf-code-body::-webkit-scrollbar-track { background: #0d1017; }
.wf-code-body::-webkit-scrollbar-thumb { background: #2b3446; border: 1px solid #3d4a61; border-radius: 2px; }

.tk-tag  { color: #7fb2ff; }
.tk-atr  { color: #b4e08a; }
.tk-str  { color: #f0a868; }
.tk-cmt  { color: #5b6a80; font-style: italic; }
.tk-doc  { color: #d07ad0; }
.tk-css  { color: #8ad8d0; }

.wf-log { padding: 8px 10px; font: 11px/1.7 "Lucida Console", Consolas, monospace; color: #9fb0c6; }
.wf-log b { color: #7fe08a; font-weight: 400; }
.wf-log i { color: #f0c05a; font-style: normal; }
.wf-log u { color: #6fa8e8; text-decoration: none; }

/* ---- Eigenschaften (rechts) ---------------------------------------- */
.wf-props {
  width: 214px;
  flex: none;
  display: flex; flex-direction: column;
  border-left: 1px solid #b9b6a8;
  background: linear-gradient(180deg, #f4f2ea 0%, #e9e6da 100%);
  min-height: 0;
}
.wf-props-body { flex: 1; overflow: auto; padding: 8px; }
.wf-empty { color: #6b7688; font-size: 11px; line-height: 1.6; padding: 10px 4px; text-align: center; }

.wf-field { margin-bottom: 9px; }
.wf-field > label {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #3c4a63;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wf-field .xp-input, .wf-field .xp-select, .wf-field .xp-area { width: 100%; }
.wf-field .xp-area { height: 56px; font: 11px/1.5 Tahoma, sans-serif; }
.wf-row { display: flex; align-items: center; gap: 6px; }
.wf-row .xp-input { flex: 1; min-width: 0; }

.wf-order { display: flex; gap: 4px; margin-top: 10px; }
.wf-order .xp-btn { min-width: 0; flex: 1; padding: 0 4px; }

.wf-swatches { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.wf-swatch {
  width: 18px; height: 18px;
  border: 1px solid #7f9db9;
  cursor: pointer; padding: 0;
}
.wf-swatch:hover { box-shadow: 0 0 0 2px #ffd24a; }

/* Fortschrittsdialog beim Schmieden */
.forge-steps {
  margin: 8px 0 0;
  padding: 0 0 0 2px;
  list-style: none;
  font-size: 11px;
  color: #3a3a34;
}
.forge-steps li { padding: 1px 0; opacity: .45; }
.forge-steps li.done { opacity: 1; }
.forge-steps li.done::before { content: "\2713 "; color: #2f8f22; font-weight: 700; }
.forge-steps li.active { opacity: 1; font-weight: 700; }

/* =====================================================================
   EXPLORER / ARBEITSPLATZ
   ===================================================================== */
.exp { display: flex; height: 100%; min-height: 0; background: #fff; }
.exp-side {
  width: 178px; flex: none;
  padding: 10px 8px;
  overflow: auto;
  background: linear-gradient(180deg, #7ba2e0 0%, #6d97dc 6%, #93b5e8 12%, #b6cef0 100%);
}
.exp-panel {
  background: #fff;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.exp-panel > h4 {
  margin: 0;
  padding: 5px 9px;
  font: 700 11px Tahoma, sans-serif;
  color: #16335e;
  background: linear-gradient(180deg, #f0f5fd 0%, #dbe7f8 100%);
}
.exp-panel ul { margin: 0; padding: 6px 9px 8px; list-style: none; }
.exp-panel li {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0;
  color: #1c3f7a; cursor: default;
}
.exp-panel li:hover { color: #ff6a00; text-decoration: underline; }
.exp-panel li svg { width: 16px; height: 16px; }
.exp-panel p { margin: 0; padding: 6px 9px 9px; font-size: 11px; color: #33445e; line-height: 1.5; }

.exp-main { flex: 1; min-width: 0; overflow: auto; padding: 10px 12px; }
.exp-group { margin-bottom: 14px; }
.exp-group > h3 {
  margin: 0 0 6px;
  padding-bottom: 3px;
  font: 700 11px Tahoma, sans-serif;
  color: #16335e;
  border-bottom: 1px solid #b6cef0;
}
.exp-tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.exp-tile {
  width: 168px;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px;
  border: 1px solid transparent;
  cursor: default;
}
.exp-tile svg, .exp-tile .ico { width: 32px; height: 32px; flex: none; }
.exp-tile b { display: block; font-weight: 400; color: #000; }
.exp-tile small { color: #5a6472; }
.exp-tile:hover { background: #d9e8fb; border-color: #a8c8ee; }
.exp-tile.selected { background: #316ac5; border-color: #1c4a9e; }
.exp-tile.selected b, .exp-tile.selected small { color: #fff; }

/* =====================================================================
   INTERNET EXPLORER
   ===================================================================== */
.ie { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ie-bar {
  flex: none;
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px;
  background: linear-gradient(180deg, #fdfdfb, #eeece1);
  border-bottom: 1px solid #c8c5b7;
}
.ie-bar > label { color: #4a4a42; }
.ie-url { flex: 1; min-width: 0; }
.ie-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.ie-throb {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1c4a9e, #6fa8e8, #1c4a9e);
  box-shadow: inset 0 0 0 4px #ece9d8;
}
.ie-throb.spin { animation: throb 1s linear infinite; }
@keyframes throb { to { transform: rotate(360deg); } }

/* =====================================================================
   EDITOR (NOTEPAD)
   ===================================================================== */
.np-area {
  width: 100%; height: 100%;
  border: 0;
  padding: 3px 5px;
  resize: none;
  font: 12px/1.35 "Lucida Console", Consolas, monospace;
  color: #000;
  background: #fff;
  outline: none;
  white-space: pre;
  overflow: auto;
}
.np-area.wrap { white-space: pre-wrap; }

/* =====================================================================
   MINESWEEPER
   ===================================================================== */
.ms {
  padding: 6px;
  background: #c0c0c0;
  height: 100%;
  font-family: Tahoma, sans-serif;
}
.ms-panel {
  border: 2px inset #f5f5f5;
  padding: 5px;
  background: #c0c0c0;
}
.ms-head {
  display: flex; align-items: center; justify-content: space-between;
  border: 2px inset #f5f5f5;
  padding: 4px 6px;
  margin-bottom: 5px;
}
.ms-lcd {
  font: 700 20px/1 "Lucida Console", Consolas, monospace;
  color: #ff2b2b;
  background: #000;
  padding: 2px 4px;
  letter-spacing: 1px;
  border: 1px solid #7b7b7b;
}
.ms-face {
  width: 26px; height: 26px;
  border: 2px outset #f5f5f5;
  background: #c0c0c0;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}
.ms-face:active { border-style: inset; }
.ms-grid {
  display: grid;
  gap: 0;
  border: 2px inset #f5f5f5;
  width: fit-content;
}
.ms-cell {
  width: 18px; height: 18px;
  border: 2px outset #f5f5f5;
  background: #c0c0c0;
  padding: 0;
  font: 700 12px/1 "Lucida Console", monospace;
  cursor: default;
  display: grid; place-items: center;
  user-select: none;
}
.ms-cell.open {
  border: 1px solid #9a9a9a;
  background: #c0c0c0;
}
.ms-cell.mine { background: #d94b4b; }
.ms-cell.flag { color: #d40000; }
.ms-c1 { color: #0000ff; } .ms-c2 { color: #008000; } .ms-c3 { color: #ff0000; }
.ms-c4 { color: #000080; } .ms-c5 { color: #800000; } .ms-c6 { color: #008080; }
.ms-c7 { color: #000000; } .ms-c8 { color: #808080; }

/* =====================================================================
   DO NOT CLICK.exe — Ausbruch, Beben, Glitch, Stop-Bildschirm
   ===================================================================== */
.junk-body { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 12px 14px 10px; }
.junk-text { font-size: 11px; line-height: 1.45; }
.junk-btns { display: flex; justify-content: flex-end; gap: 6px; }
.win.junk { animation: junk-in .12s ease-out; }
@keyframes junk-in { from { transform: scale(.7); opacity: 0; } }

/* Das ganze Bild bebt */
.layer-desktop.quake { animation: quake .09s steps(2) infinite; }
@keyframes quake {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6px, 3px); }
  50%  { transform: translate(5px, -4px); }
  75%  { transform: translate(-3px, -5px); }
  100% { transform: translate(4px, 4px); }
}

/* Die Röhre kommt aus dem Tritt: Farbschlieren, Zeilenversatz */
.screen.glitch .vres { animation: glitch-hue .35s steps(3) infinite; }
.screen.glitch .fx-scan { opacity: 1; }
.screen.glitch .fx-roll { animation-duration: .6s; opacity: 1; }
@keyframes glitch-hue {
  0%   { filter: hue-rotate(0deg) contrast(1); }
  33%  { filter: hue-rotate(-40deg) contrast(1.35) saturate(1.6); }
  66%  { filter: hue-rotate(35deg) contrast(1.15); transform: scale(var(--scale)) translateX(6px); }
  100% { filter: hue-rotate(0deg) contrast(1); }
}

/* Eigener Stop-Bildschirm — kein Nachbau eines fremden Bluescreens */
.crash-screen {
  position: absolute; inset: 0;
  z-index: 95;
  background: #1d3f8f;
  color: #dfe8ff;
  padding: 52px 64px;
  animation: fade-in .08s steps(1);
}
.crash-text {
  margin: 0;
  white-space: pre-wrap;
  font: 15px/1.5 "Lucida Console", Consolas, monospace;
}

/* =====================================================================
   SYSTEMEIGENSCHAFTEN / INFO
   ===================================================================== */
.sys { padding: 16px 18px; font-size: 11px; line-height: 1.7; }
.sys h3 { margin: 0 0 4px; font-size: 12px; color: #16335e; }
.sys .sys-grid { display: grid; grid-template-columns: 130px 1fr; gap: 2px 10px; margin: 8px 0 14px; }
.sys .sys-grid dt { color: #4a5568; }
.sys .sys-grid dd { margin: 0; }
.sys hr { border: 0; border-top: 1px solid #c9c6b8; border-bottom: 1px solid #fff; margin: 12px 0; }
.sys ul { margin: 6px 0 0; padding-left: 18px; }
.sys li { margin-bottom: 3px; }
.sys code {
  font: 11px "Lucida Console", monospace;
  background: #fff;
  border: 1px solid #d5d2c4;
  padding: 0 3px;
}
