/* Shuttle Jam – Spielstil. Kit-Variablen hier an das Spiel angepasst. */
:root {
  --kit-ink: #1f2a3a;
  --kit-ink-soft: #55637a;
  --kit-accent: #e8462f;
  --kit-card: #fffaf0;
  --text: #1f2a3a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: #2f8fe8;
  color: var(--text); font-family: var(--kit-font); font-weight: 700;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#app { position: relative; height: 100%; max-width: 520px; margin: 0 auto; pointer-events: none; }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 10px) 12px calc(var(--safe-b) + 4px);
  opacity: 0; visibility: hidden; transform: translateY(24px) scale(.98);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, 1.3, .4, 1), visibility 0s .35s;
}
.screen.active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.screen.active > * { pointer-events: auto; }
#screen-game.active { pointer-events: none; }
#screen-game .hud { pointer-events: auto; }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.spacer { flex: 1; }

/* Startbildschirm */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 4vh; text-align: center; gap: 10px; }
.title { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
/* Oberes Wort: weiß mit kräftiger Kontur, Buchstaben hüpfen der Reihe nach */
.t-top {
  font-size: clamp(54px, 17vw, 88px); letter-spacing: -1px; color: #fff;
  -webkit-text-stroke: 11px #232b45; paint-order: stroke fill;
  text-shadow: 0 7px 0 #232b45;
}
.t-top span { display: inline-block; animation: hop 2.4s cubic-bezier(.3, 1.6, .5, 1) infinite; animation-delay: calc(var(--i) * .08s); }
/* Unteres Wort: drei bunte Busse Stoßstange an Stoßstange */
.t-jam { display: flex; margin-top: 10px; transform: rotate(-3deg); }
.tile {
  --rot: -5deg; position: relative; display: grid; place-items: center;
  width: clamp(68px, 21vw, 96px); height: clamp(60px, 18.500vw, 84px); margin: 0 -2px;
  border: 5px solid #232b45; border-radius: 18px 28px 16px 16px; background: #ff3d2e;
  box-shadow: inset 0 -12px 0 rgba(35, 43, 69, .22), inset 0 6px 0 rgba(255, 255, 255, .3), 0 8px 0 #232b45;
  font-size: clamp(44px, 13.500vw, 62px); color: #fff;
  transform: rotate(var(--rot));
  animation: jam 2.8s cubic-bezier(.3, 1.6, .5, 1) infinite; animation-delay: calc(var(--i) * .17s);
}
.tile:nth-child(3n+2) { --rot: 4deg; background: #ffb000; }
.tile:nth-child(3n) { --rot: -2deg; background: #1f7dff; }
.tile b { -webkit-text-stroke: 8px #232b45; paint-order: stroke fill; }
/* Räder */
.tile::before, .tile::after { content: ""; position: absolute; bottom: -15px; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #232b45; border: 4px solid #5b627a; box-sizing: border-box; }
.tile::before { left: 12%; }
.tile::after { right: 12%; }
@keyframes jam {
  0%, 46%, 100% { transform: translateX(0) rotate(var(--rot)); }
  16% { transform: translateX(11px) rotate(calc(var(--rot) + 6deg)) scale(1.06, .94); }
  28% { transform: translateX(-4px) rotate(calc(var(--rot) - 2deg)); }
}
@keyframes hop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-14px) rotate(-4deg); } }
.subtitle {
  margin: 6px 0 0; font-size: 17px; max-width: 320px; color: #1f2a3a;
  background: rgba(255, 255, 255, .82); padding: 8px 14px; border-radius: 14px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-5px); } }

.actions { display: grid; gap: 12px; margin: 0 auto 10px; width: min(100%, 320px); }
.btn {
  font: 800 20px/1.1 var(--kit-font); padding: 16px; border-radius: 20px; border: var(--kit-line); cursor: pointer;
  box-shadow: 0 6px 0 var(--kit-ink); color: var(--kit-ink); background: var(--kit-card);
  transition: transform .1s; min-height: 48px;
}
.btn:active { transform: translateY(6px); box-shadow: none; }
.btn-primary { background: var(--kit-accent); color: #fff; font-size: 26px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: breathe 2s ease-in-out infinite; }
.btn-primary small { font-size: 14px; opacity: .95; }
@keyframes breathe { 50% { transform: scale(1.04); } }

/* Spiel-HUD */
.pill {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, .9); color: var(--kit-ink); box-shadow: 0 3px 0 rgba(31, 42, 58, .35);
}
.pill b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pilot-icon { width: 30px; height: 28px; margin: -3px 0 -3px -4px; flex: none; }
#hud-pilots.bump { animation: bump .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.4); } }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: var(--kit-line); background: rgba(255, 255, 255, .9);
  color: var(--kit-ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(31, 42, 58, .35);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }

.kit-footer { color: #1f2a3a; background: rgba(255, 255, 255, .75); border-radius: 12px; }

/* Dialoge */
.end-card { text-align: center; }
.end-img { width: 96px; height: 96px; margin: -8px auto 0; display: block; animation: float 2.4s ease-in-out infinite; }
.help-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; text-align: left; }

/* Hinweise oben unter der Kopfzeile zeigen, damit sie das Spielfeld nicht verdecken */
.kit-toast { bottom: auto; top: calc(var(--safe-t) + 68px); width: max-content; max-width: min(92vw, 400px); text-align: center; border-radius: 18px; line-height: 1.3; }
