/* zimpe.ch — Startseite mit Pacman.
 * Hellgrüner Seitenhintergrund, dunkelroter Pacman: so gewünscht. Der Rest
 * ist darauf abgestimmt — dunkles Grün für Wände und Text, gedecktes Orange
 * für die Kraftpillen. Keine Webfonts, keine externen Dateien. */

:root {
  --hellgruen: #c7ecab;
  --hellgruen-dunkler: #b3e293;
  --boden: #f2fbe6;
  --dunkelgruen: #2f5d3f;
  --dunkelrot: #8f1420;
  --text: #16281c;
  --grau: #5b6b59;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2rem 1rem 3rem;
  background: var(--hellgruen);
  /* Ein sehr flacher Verlauf, damit die Fläche nicht ganz tot wirkt. */
  background-image: radial-gradient(circle at 50% 0%,
    #d8f4c2 0%, var(--hellgruen) 45%, var(--hellgruen-dunkler) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.kopf {
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  letter-spacing: 0.06em;
  color: var(--dunkelrot);
  text-shadow: 2px 2px 0 rgba(47, 93, 63, 0.18);
}

.untertitel {
  margin: 0.4rem 0 0;
  color: var(--grau);
  font-size: 0.95rem;
}

main {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.spielkasten {
  width: 100%;
  background: var(--boden);
  border: 3px solid var(--dunkelgruen);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 10px 24px rgba(22, 40, 28, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.anzeige {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wert {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 4.5rem;
}

.marke {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grau);
}

.leben {
  color: var(--dunkelrot);
  letter-spacing: 0.1em;
}

canvas {
  display: block;
  width: 100%;
  max-width: 528px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--boden);
  /* Beim Wischen soll die Seite nicht mitscrollen. */
  touch-action: none;
  cursor: crosshair;
}

canvas:focus-visible {
  outline: 3px solid var(--dunkelrot);
  outline-offset: 2px;
}

.knoepfe {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  color: var(--boden);
  background: var(--dunkelgruen);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}

button:hover { background: #3d7551; }
button:active { transform: translateY(1px); }
button:disabled { background: var(--grau); opacity: 0.5; cursor: default; }
button:focus-visible { outline: 3px solid var(--dunkelrot); outline-offset: 2px; }

.hilfe {
  margin: 0;
  font-size: 0.78rem;
  color: var(--grau);
  text-align: center;
  line-height: 1.7;
}

.hilfe strong { color: var(--dunkelgruen); }

.hinweis {
  margin: 0;
  padding: 0.8rem;
  background: #fdf3d6;
  border-left: 4px solid var(--dunkelrot);
  border-radius: 4px;
  font-size: 0.85rem;
}

.notiz {
  width: 100%;
  font-size: 0.88rem;
  color: var(--text);
}

.notiz h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--dunkelgruen);
  letter-spacing: 0.04em;
}

.notiz p { margin: 0 0 0.7rem; }

.fuss {
  color: var(--grau);
  font-size: 0.82rem;
}

a {
  color: var(--dunkelrot);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover { color: #6d0f18; }

@media (max-width: 420px) {
  body { padding: 1.2rem 0.6rem 2rem; }
  .spielkasten { padding: 0.6rem; border-radius: 10px; }
  .wert { font-size: 0.95rem; min-width: 3.8rem; }
}

/* Wer Bewegung reduziert haben will, bekommt keinen Verlauf und keine
   Übergänge — das Spiel selbst bleibt natürlich in Bewegung. */
@media (prefers-reduced-motion: reduce) {
  body { background-image: none; }
  button { transition: none; }
}
