/* deneaux.de – Visitenkarte mit Gleitschirm-Spiel */

@font-face {
  font-family: "B612";
  src: url("fonts/b612-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "B612";
  src: url("fonts/b612-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --himmel: #1f5a9e;
  --schirm: #f5c21b;
  --schirm-dunkel: #c4960c;
  --tinte: #132a44;
  --panel: rgba(19, 42, 68, 0.74);
  --boden: #1d3d36;
  --boden-text: #e4ede7;
  --font: "B612", "DejaVu Sans", "Segoe UI", system-ui, sans-serif;
  --rand: clamp(16px, 6vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--boden);
}

/* ---------- Szene ---------- */

.scene {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: var(--himmel);
}
#sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}
.scene.flying #sky { touch-action: none; cursor: pointer; }

/* ---------- Visitenkarte ---------- */

.card {
  position: absolute;
  left: var(--rand);
  top: clamp(72px, 15vh, 170px);
  max-width: 34rem;
  padding-right: 16px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(19, 42, 68, 0.35);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.card.away { opacity: 0; visibility: hidden; }

h1 {
  margin: 0 0 0.3em;
  font-size: clamp(2.5rem, 7.2vw, 5.4rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.lede {
  margin: 0 0 0.35em;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}
.contact { margin: 0; }
.contact a {
  color: #fff;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.contact a:hover { text-decoration-thickness: 2px; }

.launch {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
}
.best { margin: 0; font-weight: 700; }
.hint {
  flex-basis: 100%;
  margin: 0;
  max-width: 30rem;
  font-size: 0.92rem;
}

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 6px;
  padding: 0.75em 1.35em;
  cursor: pointer;
  color: var(--tinte);
  background: #dfe8f0;
  text-shadow: none;
}
.btn.primary {
  background: var(--schirm);
  box-shadow: 0 3px 0 var(--schirm-dunkel);
}
.btn.primary:hover { background: #ffd23f; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--schirm-dunkel); }

.btn:focus-visible,
.tool:focus-visible,
.hold:focus-visible,
.contact a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.result .btn:focus-visible { outline-color: var(--tinte); }

/* ---------- Instrumente im Flug ---------- */

.hud {
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: start;
  gap: 0.35rem 1.4rem;
  padding: 0.8rem 1.1rem;
  color: #fff;
  background: var(--panel);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.vario {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 0.4rem;
}
.gauge {
  position: relative;
  width: 8px;
  height: 66px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}
.gauge i {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  background: var(--schirm);
}
.gauge i.sink { background: #9cc3e6; }
.gauge::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #fff;
}
.instr { display: flex; flex-direction: column; }
.lbl { font-size: 0.74rem; opacity: 0.78; }
.val {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.val.big { font-size: 2.2rem; line-height: 1.1; }
.val small { font-size: 0.9rem; font-weight: 400; }
.instr.low .val { color: var(--schirm); }

.toolbar {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  gap: 0.5rem;
}
.tool {
  font: inherit;
  font-size: 0.85rem;
  border: 0;
  border-radius: 6px;
  padding: 0.45em 0.85em;
  color: #fff;
  background: var(--panel);
  cursor: pointer;
}

.controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 0.6rem;
}
.hold {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 8rem;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--panel);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.hold small { font-size: 0.74rem; font-weight: 400; opacity: 0.75; }
.hold.on { color: var(--tinte); background: var(--schirm); }

.pause-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.9rem 1.3rem;
  color: #fff;
  background: var(--panel);
  border-radius: 10px;
  text-align: center;
}

/* ---------- Ergebnis nach der Landung ---------- */

.result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(36rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 1.4rem 1.5rem 1.5rem;
  color: var(--tinte);
  background: rgba(244, 248, 251, 0.97);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(19, 42, 68, 0.35);
}
.result h2 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.05;
}
.result p { margin: 0 0 1rem; max-width: 60ch; }
.result .newbest { font-weight: 700; color: #7a5a00; }
#profile {
  display: block;
  width: 100%;
  height: 150px;
  border-radius: 8px;
  background: #e3ecf4;
}
.caption { font-size: 0.8rem; opacity: 0.75; margin: 0.45rem 0 1rem !important; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem 1rem;
  margin: 0 0 1.3rem;
}
.stats dt { font-size: 0.75rem; opacity: 0.75; }
.stats dd { margin: 0; font-size: 1.05rem; font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Unter der Szene ---------- */

.ground {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--rand) 2.5rem;
  color: var(--boden-text);
  background: var(--boden);
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  gap: 2.2rem 4rem;
  max-width: 70rem;
}
.ground h2 {
  margin: 0 0 0.9rem;
  font-size: 1.25rem;
  color: #fff;
}
.keys {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr;
  gap: 0.55rem 1.3rem;
  margin: 0;
}
.keys dt { font-weight: 700; color: var(--schirm); }
.keys dd { margin: 0; }
.tips { margin: 0; padding-left: 1.1rem; max-width: 60ch; }
.tips li { margin-bottom: 0.45rem; }
.fine {
  margin: 2.8rem 0 0;
  max-width: 70rem;
  font-size: 0.85rem;
  opacity: 0.72;
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 600px) {
  .hud { gap: 0.25rem 0.9rem; padding: 0.6rem 0.75rem; }
  .val { font-size: 1rem; }
  .val.big { font-size: 1.6rem; }
  .gauge { height: 52px; }
  .toolbar { top: auto; bottom: 96px; }            /* über den Steuerknöpfen */
  .controls { left: 16px; }
  .hold { flex: 1; min-width: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .keys { grid-template-columns: 1fr; gap: 0.2rem; }
  .keys dd { margin-bottom: 0.6rem; }
}
@media (max-aspect-ratio: 1/1) {
  .card { top: 21svh; }                          /* Hochformat: unter die Wolkenbasis */
}
@media (pointer: coarse) {
  .hold { min-height: 64px; min-width: 8.5rem; justify-content: center; }
  .hold small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
