/* ============================================================
   HÜPFER
   Das Spiel selbst wird komplett im Canvas gezeichnet –
   hier geht es nur um die Seite drumherum.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px 50px;
  background:
    radial-gradient(ellipse at 50% -10%, #24345c 0%, transparent 60%),
    #12142a;
  color: #e8e8f5;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

header {
  position: relative;
  padding: 28px 0 18px;
  text-align: center;
}

.zurueck {
  position: absolute;
  top: 28px;
  left: 0;
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #33334a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #8a8aa8;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.zurueck:hover,
.zurueck:focus-visible {
  border-color: #6ad4ff;
  background: rgba(106, 212, 255, 0.12);
  color: #e8e8f5;
  outline: none;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  color: #8dffc8;
}

main { max-width: 940px; margin: 0 auto; }

#spielfeld {
  aspect-ratio: 900 / 540;
  width: 100%;
  border: 2px solid #33334a;
  border-radius: 12px;
  overflow: hidden;
  background: #1b2a4a;
  box-shadow: 0 0 70px rgba(141, 255, 200, 0.12);
}

canvas { display: block; width: 100%; height: 100%; }
body.touch canvas { touch-action: none; }
body.touch { touch-action: manipulation; }

#hilfe {
  margin: 14px 0 0;
  text-align: center;
  color: #8a8aa8;
  font-size: 13.5px;
}

.tipp {
  display: block;
  margin-top: 6px;
  color: #6a6a88;
  font-size: 13px;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #3a3a5c;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #1a1a2e;
  color: #dcdcf0;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 600;
}

/* Manche Hinweise gelten nur für Tastatur, andere nur für Finger.
   Welche Sorte gezeigt wird, entscheidet die Klasse "touch" am
   body – die setzt touch.js, wenn das Gerät einen Finger meldet. */
.nur-handy { display: none; }
body.touch .nur-rechner { display: none; }
body.touch .nur-handy { display: inline; }

/* ---------------- Knöpfe fürs Handy ---------------- */

#steuerung {
  display: none;
  /* Links das Laufkreuz, rechts ein großer Sprungknopf.
     Zwischen beiden ein Spalt, damit der Daumen nicht
     aus Versehen auf den falschen rutscht. */
  grid-template-columns: 1fr 1fr 0.4fr 2.2fr;
  gap: 8px;
  margin-top: 14px;
  touch-action: none;
}

/* Die Lücke in der Mitte ist nur Luft */
#steuerung::before {
  content: '';
  grid-column: 3;
}

#steuerung .knopf.sprung { grid-column: 4; }

body.touch #steuerung { display: grid; }

#knopfreihe {
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  touch-action: none;
}

body.touch #knopfreihe { display: grid; }

.knopf {
  height: 60px;
  border: 1px solid #3a3a5c;
  border-bottom-width: 4px;
  border-radius: 12px;
  background: #1a1a2e;
  color: #e8e8f5;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.knopf.richtung { height: 96px; font-size: 34px; }

.knopf.sprung {
  height: 96px;
  border-color: #2f7a60;
  background: #14322a;
  font-size: 26px;
  font-weight: 800;
}

.knopf.aktiv {
  border-bottom-width: 1px;
  background: #2a2a4e;
  transform: translateY(3px);
}

.knopf.sprung.aktiv { background: #1e5644; }

/* ---------------- Erklärungen ---------------- */

.infos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.infos article {
  padding: 20px 22px;
  border: 1px solid #33334a;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.infos h2 { margin: 0 0 10px; font-size: 18px; }
.infos ul, .infos ol { margin: 0; padding-left: 20px; }
.infos li { margin-bottom: 6px; font-size: 14.5px; }
.infos p { margin: 0 0 10px; font-size: 14.5px; }

.infos pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid #33334a;
  border-radius: 8px;
  background: #0e0f20;
}

.infos code {
  color: #8dffc8;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
}

.notiz {
  margin: 12px 0 0 !important;
  padding-top: 10px;
  border-top: 1px solid #33334a;
  color: #8a8aa8;
  font-size: 13px !important;
}

footer {
  max-width: 940px;
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid #33334a;
  text-align: center;
  color: #8a8aa8;
  font-size: 13.5px;
}

footer a { color: #8dffc8; }

@media (max-width: 620px) {
  header { padding: 18px 0 14px; }
  .zurueck { position: static; display: inline-block; margin-bottom: 10px; }

  body { padding: 0 10px 40px; }

  .knopf { height: 50px; font-size: 18px; }
  .knopf.richtung, .knopf.sprung { height: 88px; }
  .knopf.richtung { font-size: 30px; }
  .knopf.sprung { font-size: 22px; }
  #steuerung { grid-template-columns: 1fr 1fr 0.25fr 2fr; gap: 6px; }
}

/* Quer gehaltenes Handy: da ist wenig Höhe, also flacher */
@media (orientation: landscape) and (max-height: 500px) {
  .knopf.richtung, .knopf.sprung { height: 62px; }
  .infos, footer { display: none; }
}
