/* ============================================================
   PARKOUR-EDITOR
   Der Editor selbst wird komplett im Canvas gezeichnet –
   hier geht es nur um die Seite drumherum.

   Die Farben sind die eines Bauplans: dunkles Blau und Cyan.
   Das sagt ohne ein Wort, dass hier gebaut und nicht gespielt
   wird.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px 50px;
  background:
    radial-gradient(ellipse at 50% -10%, #1b3242 0%, transparent 60%),
    #0b1119;
  color: #e6f1f5;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  touch-action: manipulation;
}

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 #2a3d4d;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #7d94a3;
  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: #4fd6e8;
  background: rgba(79, 214, 232, 0.12);
  color: #e6f1f5;
  outline: none;
}

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

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

/* Das Seitenverhaeltnis gehoert an die Leinwand SELBST.
   Vorher stand es am Rahmen - und weil dessen Rand mitzaehlt,
   war die Leinwand innen 4 Pixel kleiner und ein kleines
   bisschen breiter gezogen als 900:540. Kacheln waren dadurch
   keine Quadrate mehr, sondern 41 breit und 40 hoch. Genau das
   sah beim Bauen ungenau aus. */
#spielfeld {
  width: 100%;
  border: 2px solid #2a3d4d;
  border-radius: 12px;
  overflow: hidden;
  background: #0e1622;
  box-shadow: 0 0 70px rgba(79, 214, 232, 0.1);
  line-height: 0;
}

canvas {
  display: block;
  aspect-ratio: 900 / 540;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

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

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

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

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

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

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

.infos h2 { margin: 0 0 10px; font-size: 18px; }
.infos p { margin: 0 0 10px; font-size: 14.5px; }

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

.notiz {
  margin: 12px 0 0 !important;
  padding-top: 10px;
  border-top: 1px solid #2a3d4d;
  color: #7d94a3;
  font-size: 13px !important;
}

footer {
  max-width: 940px;
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid #2a3d4d;
  text-align: center;
  color: #7d94a3;
  font-size: 13.5px;
}

footer a { color: #4fd6e8; }

footer .rechte {
  display: block;
  margin-top: 8px;
  opacity: 0.7;
  font-size: 0.92em;
}

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

/* ---------------------------------------------------------
   DER NAME

   Denselben Kasten gibt es auch in den anderen Spielen. Der
   Name liegt für alle an derselben Stelle im Speicher – man
   tippt ihn also nur einmal. Hier braucht man ihn zum Teilen
   von Leveln.
   --------------------------------------------------------- */
#namensfeld {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid #24364a;
  border-radius: 12px;
  background: rgba(79, 214, 232, 0.04);
}

#namensfeld label { font-size: 15px; font-weight: 600; }

#namensfeld input {
  width: 170px;
  padding: 9px 12px;
  border: 1px solid #35566a;
  border-radius: 8px;
  background: #0a141a;
  color: #e6f1f5;
  font-family: inherit;
  font-size: 15px;
}

#namensfeld input:focus { border-color: #4fd6e8; outline: none; }

#namensfeld .hinweis {
  flex-basis: 100%;
  order: 2;
  text-align: center;
  color: #6a8a94;
  font-size: 13px;
}

.name-meldung {
  flex-basis: 100%;
  order: 1;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
}

.name-meldung.gut { color: #6fdc86; }
.name-meldung.leer { color: #6a8a94; font-weight: 400; }
.name-meldung.schlecht { color: #ff8f8f; }

#namensfeld input.gespeichert {
  border-color: #6fdc86;
  box-shadow: 0 0 0 3px rgba(111, 220, 134, 0.18);
  transition: border-color 0.12s, box-shadow 0.12s;
}
