/* bullshit-games.com – Windows-95-Desktop. Kein Framework, kein Build. */

:root {
  --teal: #24546a;
  --face: #c0c0c0;
  --navy: #000080;
  --title-end: #1084d0;
  --font: Tahoma, "MS Sans Serif", "Segoe UI", Verdana, Geneva, sans-serif;
  --mono: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  --raised: inset -1px -1px #000, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #fff;
  --button: inset -1px -1px #000, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  --sunken: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #000;
  --cell: 88px;
  --icon: 48px;
  --row-bottom: 40px;
}

* { box-sizing: border-box; }

html {
  font: 14px/1.35 var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--teal);
  color: #000;
}

a { color: var(--navy); }
img { max-width: 100%; }

/* ---------- Bausteine ---------- */

.window {
  display: flex;
  flex-direction: column;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--raised), 4px 4px 0 rgba(0, 0, 0, .28);
}

.titlebar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 2px 2px 4px;
  background: linear-gradient(90deg, var(--navy), var(--title-end));
  color: #fff;
  font-weight: bold;
  user-select: none;
  -webkit-user-select: none;
}

.titlebar > img { flex: none; width: 16px; height: 16px; image-rendering: pixelated; }

.titlebar .title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
  font: inherit;
}

.tb-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 16px;
  padding: 0;
  border: 0;
  background: var(--face);
  box-shadow: var(--button);
  color: #000;
  cursor: default;
}
.tb-btn svg { width: 9px; height: 9px; fill: currentColor; pointer-events: none; }
.tb-btn:active { box-shadow: var(--sunken); }

.btn {
  display: inline-block;
  min-width: 78px;
  padding: 6px 14px;
  border: 0;
  background: var(--face);
  box-shadow: var(--button);
  color: #000;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: default;
}
.btn:active { box-shadow: var(--sunken); }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn.is-disabled { color: #808080; text-shadow: 1px 1px #fff; }

.statusbar {
  flex: none;
  margin-top: 2px;
  padding: 3px 6px;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}

/* ---------- Icons ---------- */

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--cell);
  padding: 4px 2px;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px #0e2630;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.icon img {
  width: var(--icon);
  height: var(--icon);
  image-rendering: pixelated;
  pointer-events: none;
}
.icon.is-app img { image-rendering: auto; border-radius: 8px; box-shadow: 0 0 0 1px #000; }

.icon span { padding: 1px 3px; overflow-wrap: anywhere; }

.icon:focus { outline: none; }
.icon:focus-visible span,
.icon.is-selected span,
.icon.is-target span {
  background: var(--navy);
  color: #fff;
  text-shadow: none;
  outline: 1px dotted #fff;
  outline-offset: -1px;
}
.icon.is-selected img,
.icon.is-target img { filter: brightness(.75) sepia(1) hue-rotate(190deg) saturate(3); }

.folder {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px 4px;
  padding: 8px;
}
.folder .icon { color: #000; text-shadow: none; }

/* ---------- Hintergrund ---------- */

.wallpaper {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 16px;
  text-align: center;
}
.wallpaper img {
  width: min(72vw, 640px);
  height: auto;
  image-rendering: pixelated;
}
.wallpaper h1 { margin: 0; font-size: 0; line-height: 0; }

/* ---------- Ohne JavaScript: alles untereinander, scrollbar ---------- */

#icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}

.sources {
  display: grid;
  gap: 20px;
  max-width: 720px;
  margin: 16px auto 32px;
  padding: 0 12px;
}
.sources > * {
  padding: 12px 16px;
  background: #fff;
  box-shadow: var(--sunken), 0 0 0 3px var(--face);
}

.doc {
  font: 15px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.doc h2, .doc h3, .sources h2 { margin: 0 0 1em; font: inherit; font-weight: bold; }
.doc h3 { margin-top: 1.5em; }
.doc p, .doc ul { margin: 0 0 1em; }
.doc ul { padding-left: 2ch; list-style: "- "; }
.doc a { cursor: pointer; }

.tray {
  display: flex;
  justify-content: center;
  gap: 2px;
  width: max-content;
  margin: 0 auto 24px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--raised);
}
.tray a {
  min-width: 32px;
  padding: 3px 6px;
  box-shadow: var(--button);
  color: #000;
  text-align: center;
  text-decoration: none;
}
.tray a[aria-current] { box-shadow: var(--sunken); font-weight: bold; background: #dfdfdf; }
.tray a:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- Mit JavaScript: Desktop ohne Scrollen ---------- */

html.js, html.js body { height: 100%; overflow: hidden; overscroll-behavior: none; }

.js #desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.js .wallpaper {
  position: absolute;
  inset: 0;
  place-content: center;
  padding-bottom: var(--row-bottom);
  pointer-events: none;
}

.js .sources { display: none; }

.js #icons { display: block; padding: 0; }
.js #icons .icon { position: absolute; touch-action: none; }
.js #icons .icon.is-dragging { z-index: 50; opacity: .85; }
.js #icons .icon.is-returning { transition: left .35s ease-out, top .35s ease-out; }

.js [data-pos="about"]   { left: 12px; top: 12px; }
.js [data-pos="games"]   { left: 12px; top: calc(12px + var(--icon) + 52px); }
.js [data-pos="imprint"] { left: 12px; bottom: var(--row-bottom); }
.js [data-pos="support"] { left: calc(30% - var(--cell) / 2); bottom: var(--row-bottom); }
.js [data-pos="contact"] { left: calc(50% - var(--cell) / 2); bottom: var(--row-bottom); }
.js [data-pos="privacy"] { left: calc(70% - var(--cell) / 2); bottom: var(--row-bottom); }
.js [data-pos="trash"]   { right: 12px; bottom: var(--row-bottom); }

.js .tray {
  position: absolute;
  right: 4px;
  bottom: 4px;
  margin: 0;
}

/* Fenster */

#windows { position: absolute; inset: 0; pointer-events: none; }
#windows > * { pointer-events: auto; }

.js #windows .window {
  position: absolute;
  min-width: 220px;
  min-height: 150px;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  resize: both;
}
.js #windows .window.is-max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  resize: none;
  box-shadow: var(--raised);
}
.js #windows .window:not(.is-active) .titlebar {
  background: linear-gradient(90deg, #808080, #b5b5b5);
  color: #dfdfdf;
}
#windows .titlebar { touch-action: none; }

.menubar { display: flex; flex: none; padding: 1px 0; }
.menubar span { padding: 2px 7px; }
.menubar span::first-letter { text-decoration: underline; }

.win-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  box-shadow: var(--sunken);
  padding: 2px;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.win-body .doc {
  min-height: 100%;
  padding: 6px 8px;
  outline: none;
  cursor: text;
}

/* Blinkender Cursor am Textende, solange der Editor nicht den echten Fokus hat */
.win-body .doc:not(:focus) > :last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  background: #000;
  vertical-align: text-bottom;
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.empty-note { margin: 0; padding: 12px; color: #808080; }

/* Meldungsfenster */

.modal {
  position: absolute;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 12px;
  touch-action: none;
}
.msgbox { width: min(340px, 100%); }
.msg { display: flex; align-items: center; gap: 14px; padding: 16px 12px 12px; }
.msg svg { flex: none; width: 32px; height: 32px; }
.msg p { margin: 0; }
.msg-actions { display: flex; justify-content: center; padding: 4px 0 10px; }

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 640px), (max-height: 480px) {
  html { font-size: 14px; }
  :root { --cell: min(76px, 19.4vw); --icon: 40px; --row-bottom: 38px; }
  .icon { font-size: 11px; }
  .js [data-pos="about"], .js [data-pos="games"], .js [data-pos="imprint"] { left: 2px; }
  .js [data-pos="trash"] { right: 2px; }
  .js [data-pos="about"] { top: 8px; }
  .js [data-pos="games"] { top: calc(8px + var(--icon) + 48px); }
  .titlebar { min-height: 32px; }
  .tb-btn { width: 28px; height: 26px; }
  .tb-btn svg { width: 11px; height: 11px; }
  .tb-btn.max { display: none; }
  .tray a { min-width: 38px; padding: 5px 8px; }
  .win-body .doc { font-size: 15px; }
  .folder { --cell: 84px; --icon: 48px; }
  .folder .icon { font-size: 12px; }
}

/* Querformat am Handy: die beiden oberen Icons nebeneinander */
@media (max-height: 420px) {
  .js [data-pos="games"] { top: 8px; left: calc(2px + var(--cell)); }
}

@media (prefers-reduced-motion: reduce) {
  .win-body .doc:not(:focus) > :last-child::after { animation: none; }
  .js #icons .icon.is-returning { transition: none; }
}

/* ---------- Landingpage (klassische, scrollbare Seite) ---------- */

.lp { padding: 20px 12px 40px; font-size: 15px; line-height: 1.55; }
.lp .window { max-width: 980px; margin: 0 auto; }
.lp .titlebar { font-size: 13px; line-height: 1.35; }
.lp .tb-btn { text-decoration: none; }

.lp-body {
  margin-top: 2px;
  padding: 0 0 8px;
  background: #fff;
  box-shadow: var(--sunken);
}
.lp-hero { display: block; width: 100%; height: auto; padding: 2px 2px 0; }

.lp-section { padding: 20px clamp(14px, 4vw, 40px) 0; }
.lp-section h2 { margin: 0 0 10px; font-size: 18px; }
.lp-section p { margin: 0 0 12px; max-width: 70ch; }
.lp-section ul { margin: 0 0 12px; padding-left: 20px; max-width: 75ch; }
.lp-section li { margin-bottom: 6px; }

.lp-intro { display: flex; gap: 18px; align-items: center; }
.lp-intro img { flex: none; width: 96px; height: 96px; border-radius: 16px; box-shadow: 0 0 0 1px #000; }
.lp-intro h1 { margin: 0 0 2px; font-size: 30px; line-height: 1.15; }
.lp-intro p { margin: 0; color: #404040; }
.lp-lead { font-size: 17px; }

.lp-stores { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.lp-stores .btn { padding: 10px 18px; font-weight: bold; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none !important;
}
.shots li { margin: 0; }
.shots a { display: block; padding: 2px; box-shadow: var(--sunken); background: #000; }
.shots img { display: block; width: 100%; height: auto; }

.lp .statusbar { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 13px; }
.lp .statusbar .spacer { flex: 1; }
.lp .tray { margin: 0; box-shadow: none; padding: 0; }
