:root {
  --gehaeuse: #2b2e33;
  --gehaeuse-hell: #3a3e45;
  --rand: #15171a;
  --kreuz: #1b1d21;
  --knopf: #8f3a56;
  --knopf-hell: #b04d6d;
  --schrift: #c9cdd2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--gehaeuse);
  color: var(--schrift);
  font-family: system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.geraet {
  height: 100vh;
  height: 100dvh;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
}

.bildschirm {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#leinwand {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #1b241c;
  border: 3px solid var(--rand);
  border-radius: 4px;
  box-sizing: content-box;
}

.tastenhinweis {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  opacity: .8;
}

.steuerung { display: none; }

html.touch .tastenhinweis { display: none; }

html.touch .geraet {
  max-width: none;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}

/* Am Telefon: Spielbild oben, Steuerung fuellt den Rest und sitzt im
   unteren Bereich (Daumen). */
html.touch .bildschirm { flex: 0 0 auto; align-items: flex-start; }

html.touch .steuerung {
  flex: 1 1 auto;
  min-height: 176px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 8px clamp(10px, 6vh, 64px);
}

.kreuz {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
}

.taste {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  touch-action: none;
  cursor: pointer;
}

.kreuz .taste, .kreuz .mitte { background: var(--kreuz); }
.kreuz .hoch { grid-column: 2; grid-row: 1; border-radius: 8px 8px 0 0; }
.kreuz .links { grid-column: 1; grid-row: 2; border-radius: 8px 0 0 8px; }
.kreuz .mitte { grid-column: 2; grid-row: 2; }
.kreuz .rechts { grid-column: 3; grid-row: 2; border-radius: 0 8px 8px 0; }
.kreuz .runter { grid-column: 2; grid-row: 3; border-radius: 0 0 8px 8px; }

.kreuz .taste::after {
  content: "";
  display: block;
  margin: auto;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}
.kreuz .hoch::after { border-bottom-color: var(--gehaeuse-hell); border-top-width: 0; }
.kreuz .runter::after { border-top-color: var(--gehaeuse-hell); border-bottom-width: 0; }
.kreuz .links::after { border-right-color: var(--gehaeuse-hell); border-left-width: 0; }
.kreuz .rechts::after { border-left-color: var(--gehaeuse-hell); border-right-width: 0; }

.ab {
  display: flex;
  gap: 14px;
  align-items: center;
  transform: rotate(-20deg);
}

.knopf {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--knopf);
  color: #f2dbe2;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--rand);
}

.knopf-a { margin-top: -28px; }

.taste.gedrueckt { filter: brightness(1.35); }
.knopf.gedrueckt { transform: translateY(2px); box-shadow: 0 1px 0 var(--rand); }
