/*
 * WORTPINSELEI – SPIEL „Gramperls Blattlfang“ (WORTPINSELEI_SPIEL_V1)
 * Wird nur auf /spiel.html geladen; Farben und Schriften kommen aus /style.css.
 */
[hidden] { display: none !important; }

.game-hero {
  text-align: center;
  padding-block: clamp(36px, 5vw, 64px) clamp(22px, 3vw, 36px);
}
.game-hero h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.game-hero p {
  color: var(--ink-soft);
  max-width: 34em;
  margin: 18px auto 0;
  font-size: 18px;
}

/* Spielfläche */
.game-section { padding-bottom: clamp(40px, 5vw, 64px); }
.game-stage {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  aspect-ratio: 16 / 10;
  max-height: 78vh;
  border-radius: 22px;
  overflow: hidden;
  /* Gemalter Waldweg (Lotti Loscar); Aquarellränder laufen weich ins Papierweiß aus */
  background: #fdfdfa url(/assets/spiel/hintergrund.webp) center bottom / cover no-repeat;
  box-shadow: 0 24px 50px rgba(43, 58, 45, .14), inset 0 0 0 1px var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.game-stage:focus { outline: none; }
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 640px) {
  .game-stage { aspect-ratio: 3 / 4; border-radius: 16px; }
}

.game-hud {
  position: absolute; top: 12px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  pointer-events: none;
}
.game-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .85);
  border-radius: 999px; padding: 6px 14px;
  font-weight: 700; font-size: 16px; color: var(--ink);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(43, 58, 45, .08);
}
.game-pill img { width: 22px; height: 22px; object-fit: contain; }
.hearts { letter-spacing: 2px; color: #c4553a; font-size: 18px; }
.hearts .lost { color: #cfd8c6; }
.game-pause {
  pointer-events: auto;
  border: 0; background: none; padding: 0 4px;
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer;
}

/* Start-, Pause- und Endbildschirm */
.game-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(251, 250, 244, .74);
  backdrop-filter: blur(3px);
}
.game-card {
  display: grid; justify-items: center; gap: 10px;
  text-align: center; max-width: 420px;
}
.game-card img { width: clamp(100px, 20vw, 160px); filter: drop-shadow(0 10px 14px rgba(43, 58, 45, .18)); }
.game-card h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin-top: 4px; text-wrap: balance; }
.game-card p { margin: 0; color: var(--ink-soft); }
.game-card .btn { margin-top: 8px; }
.game-score { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.game-keys { font-size: 14px; color: var(--ink-soft); }
.game-keys kbd {
  font-family: var(--sans); font-size: 13px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  padding: 0 6px; background: #fff;
}
.game-pause:focus-visible, .game-card .btn:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; }
@media (hover: none) { .game-keys { display: none; } }

/* Spielregeln */
.game-rules {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
  max-width: 980px; margin: clamp(28px, 4vw, 44px) auto 0;
  list-style: none; padding: 0;
}
.game-rules li { border-top: 1.5px solid var(--line); padding-top: 14px; color: var(--ink-soft); min-width: 0; }
.game-rules strong { display: block; font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.game-credit { max-width: 980px; margin: 22px auto 0; font-size: 14px; color: var(--ink-faint); }
@media (max-width: 640px) { .game-rules { grid-template-columns: 1fr; gap: 12px; } }
