/* Gemeinsames Aussehen der Pixelhalle: Karo, Panel, Knoepfe, Dialoge.
   Jedes Spiel legt sein eigenes Blatt darueber. */

:root {
  --sand: #f3a95c;
  --sand-dunkel: #eb9d49;
  --panel: #f7ecd9;
  --panel-rand: #ecd9b4;
  --braun: #7c4f28;
  --gold: #e8a33d;
}

* {
  box-sizing: border-box;
  /* Doppeltipp zoomt nicht mehr -- beim schnellen Tippen auf die Stapel ist das
     sonst staendig passiert. Pinch-Zoom und Scrollen bleiben erlaubt.
     touch-action vererbt sich nicht, muss also auf jedem Element stehen. */
  touch-action: manipulation;
}

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  color: var(--braun);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  /* warmes Karo wie in der Vorlage */
  background-color: var(--sand);
  background-image:
    repeating-linear-gradient(45deg, var(--sand-dunkel) 0 28px, transparent 28px 56px),
    repeating-linear-gradient(-45deg, var(--sand-dunkel) 0 28px, transparent 28px 56px);
  background-blend-mode: soft-light;
}

header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: max(8px, env(safe-area-inset-top)) 10px 6px;
}

h1 {
  font-size: 19px;
  margin: 0;
  flex: 1;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 0 #ffffff88;
}

button {
  font: inherit;
  font-weight: 700;
  color: var(--braun);
  background: #fffaf2;
  border: 2px solid var(--panel-rand);
  border-radius: 14px;
  box-shadow: 0 3px 0 #0000001f;
  padding: 6px 10px;
  cursor: pointer;
  min-width: 42px;
  min-height: 42px;
}

@media (max-width: 420px) {
  /* bis zu sieben Knoepfe plus Titel muessen nebeneinander passen */
  header { gap: 3px; padding-left: 5px; padding-right: 5px; }
  header button { min-width: 31px; min-height: 36px; padding: 2px 3px; font-size: 14px; }
  h1 { font-size: 15px; white-space: nowrap; }
}

button:active { transform: translateY(2px); box-shadow: none; }

button[aria-pressed="true"] { background: var(--gold); color: #fff; }

main { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: 10px; padding: 0 10px 14px; }

/* Dialoge */
dialog {
  background: var(--panel);
  color: var(--braun);
  border: 4px solid var(--panel-rand);
  border-radius: 22px;
  max-width: min(94vw, 420px);
  width: 100%;
  max-height: 92vh;
  overflow: auto;
}

dialog::backdrop { background: #4a2d1266; }

dialog h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; }

dialog label { display: grid; grid-template-columns: 7em 1fr 2.5em; gap: 8px; align-items: center; margin: 8px 0; }

dialog input[type="text"] { -webkit-user-select: text; user-select: text; font: inherit; padding: 7px; border-radius: 12px; border: 2px solid var(--panel-rand); background: #fffdf8; color: var(--braun); }

dialog input[type="range"] { accent-color: var(--gold); }

.zeile { display: flex; gap: 8px; margin-top: 12px; }

.zeile button { flex: 1; }

dialog h3 { margin: 14px 0 6px; font-size: 15px; font-weight: 800; }

from { transform: scale(0.6); opacity: 0; }

to { transform: scale(1); opacity: 1; }
