:root {
  --bg: #020308;
  --cyan: #3df2ff;
  --magenta: #ff3df2;
  --amber: #ffc53d;
  --red: #ff4d5e;
  --orange: #ff8a3d;
  --green: #5dff8a;
  --text: #e9f7ff;
  --dim: #8fa3c8;
  --line: rgba(61, 242, 255, 0.28);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; /* iPhone/iPad: kein Bild-Menü bei langem Druck auf Symbole */
  -webkit-text-size-adjust: 100%;
  touch-action: none;
}
body { position: fixed; inset: 0; }

/* Bühne: klassische Zeichenfläche, 3D-Zeichenfläche und eine dünne Ebene für Texte in 3D */
#stage {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}
#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#labels { pointer-events: none; }

/* Liegt exakt über dem Spielfeld. --u ist eine Spielfeld-Einheit in Bildschirm-Pixeln. */
#frame {
  --u: 1px;
  --oy: 0px;
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
  font-size: max(13.5px, calc(var(--u) * 16));
  line-height: 1.35;
}

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ Anzeige im Spiel */

#hud { position: absolute; inset: 0; font-size: calc(var(--u) * 16); }

.hud-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 0.5em;
  padding: max(0.7em, calc(env(safe-area-inset-top, 0px) - var(--oy))) 0.8em 0;
}

#score {
  font-size: 1.75em;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 0.35em rgba(61, 242, 255, 0.9), 0 0 0.9em rgba(61, 242, 255, 0.45);
}
.combo { display: flex; align-items: center; gap: 0.5em; margin-top: 0.4em; opacity: 0.35; transition: opacity 0.2s; }
.combo.on { opacity: 1; }
.combo span {
  font-weight: 800;
  font-size: 1.05em;
  color: var(--amber);
  text-shadow: 0 0 0.5em rgba(255, 197, 61, 0.8);
  font-variant-numeric: tabular-nums;
}
.combo i, .rapid i {
  display: block;
  width: 4.2em;
  height: 0.28em;
  border-radius: 1em;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.combo b, .rapid b { display: block; height: 100%; width: 0; background: var(--amber); box-shadow: 0 0 0.5em var(--amber); }

.hud-wave { text-align: center; line-height: 1; padding-top: 0.1em; }
.hud-wave span { display: block; font-size: 0.68em; letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim); }
.hud-wave b { display: block; margin-top: 0.2em; font-size: 1.5em; font-weight: 800; font-variant-numeric: tabular-nums; }

.hud-right { display: flex; justify-content: flex-end; align-items: center; gap: 0.6em; }
.lives { display: flex; gap: 0.1em; }
.lives img { width: 1.5em; height: 1.5em; display: block; }

.icon-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  width: 2.7em;
  height: 2.7em;
  min-width: 40px;
  min-height: 40px;
  border-radius: 0.7em;
  border: 1px solid var(--line);
  background: rgba(5, 8, 22, 0.6);
}
.icon-btn i { width: 0.26em; height: 0.95em; border-radius: 1px; background: var(--cyan); box-shadow: 0 0 0.5em var(--cyan); }
.icon-btn:active { background: rgba(61, 242, 255, 0.2); }

.boss { position: absolute; left: 12%; right: 12%; top: calc(max(0.7em, calc(env(safe-area-inset-top, 0px) - var(--oy))) + 3.9em); text-align: center; }
.boss-name { font-size: 0.72em; font-weight: 800; letter-spacing: 0.4em; margin-right: -0.4em; color: var(--red); text-shadow: 0 0 0.6em rgba(255, 77, 94, 0.9); }
.boss-bar { margin-top: 0.35em; height: 0.5em; border-radius: 1em; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 77, 94, 0.45); overflow: hidden; }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--amber)); box-shadow: 0 0 0.8em var(--red); transition: width 0.12s linear; }
.boss.rage #boss-fill { background: linear-gradient(90deg, #ff1f4b, var(--red)); animation: pulse 0.5s infinite alternate; }

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 0.9em max(0.9em, calc(env(safe-area-inset-bottom, 0px) - var(--oy)));
}
.status { display: flex; flex-direction: column; gap: 0.5em; }
.rapid { display: flex; flex-direction: column; gap: 0.25em; }
.rapid span { font-size: 0.62em; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); }
.rapid.laser span { color: #c9a2ff; }
.rapid.laser b { background: #a45dff; box-shadow: 0 0 0.5em #a45dff; }
.rapid.homing span { color: var(--cyan); }
.rapid.homing b { background: var(--cyan); box-shadow: 0 0 0.5em var(--cyan); }
.pips { display: flex; gap: 0.25em; }
.pips i { width: 1.05em; height: 0.34em; border-radius: 1em; background: rgba(255, 255, 255, 0.16); }
.pips i.on { background: var(--green); box-shadow: 0 0 0.6em var(--green); }

.bomb-btn {
  pointer-events: auto;
  position: relative;
  width: 4.3em;
  height: 4.3em;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: radial-gradient(circle at 50% 40%, rgba(255, 138, 61, 0.3), rgba(5, 8, 22, 0.72));
  box-shadow: 0 0 1.1em rgba(255, 138, 61, 0.5), inset 0 0 0.8em rgba(255, 138, 61, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bomb-btn img { width: 62%; height: 62%; display: block; pointer-events: none; }
.bomb-btn span {
  position: absolute;
  right: -0.15em;
  top: -0.15em;
  min-width: 1.5em;
  height: 1.5em;
  border-radius: 1em;
  background: var(--orange);
  color: #160600;
  font-weight: 800;
  font-size: 0.95em;
  line-height: 1.5em;
  text-align: center;
}
.bomb-btn kbd { position: absolute; bottom: -0.2em; left: 50%; transform: translateX(-50%); font: 700 0.6em var(--font); padding: 0.1em 0.45em; border-radius: 0.4em; background: #0a0d1f; border: 1px solid var(--line); color: var(--dim); }
.touch .bomb-btn kbd { display: none; }
.bomb-btn:active { transform: scale(0.94); }
.bomb-btn.empty { opacity: 0.35; filter: grayscale(0.8); box-shadow: none; }

/* ------------------------------------------------------------ Einblendungen */

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 31%;
  text-align: center;
  font-size: calc(var(--u) * 34);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 0.4em;
  opacity: 0;
  color: #fff;
  text-shadow: 0 0 0.25em var(--cyan), 0 0 0.7em rgba(61, 242, 255, 0.75), 0 0 1.6em rgba(255, 61, 242, 0.55);
}
.banner small { display: block; margin-top: 0.5em; font-size: 0.42em; font-style: normal; letter-spacing: 0.3em; color: var(--amber); text-shadow: 0 0 0.6em rgba(255, 197, 61, 0.8); }
.banner.show { animation: banner var(--dur, 1.8s) ease-out both; }
.banner.warn { color: #fff; text-shadow: 0 0 0.25em var(--red), 0 0 0.8em rgba(255, 77, 94, 0.9), 0 0 1.8em rgba(255, 77, 94, 0.6); }
.banner.warn.show { animation: banner var(--dur, 3s) ease-out both, blink 0.34s steps(2, jump-none) infinite; }
.banner.good { text-shadow: 0 0 0.25em var(--green), 0 0 0.8em rgba(93, 255, 138, 0.8), 0 0 1.6em rgba(61, 242, 255, 0.5); }

@keyframes banner {
  0% { opacity: 0; transform: scale(1.5); letter-spacing: 0.5em; }
  14% { opacity: 1; transform: scale(1); letter-spacing: 0.14em; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.96); }
}
@keyframes blink { 0% { filter: brightness(1); } 100% { filter: brightness(0.45); } }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.7); } }

/* ------------------------------------------------------------ Bildschirme (Menü, Pause, Ende) */

.screen {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: max(1.4em, calc(env(safe-area-inset-top, 0px) - var(--oy))) 1.2em max(1.4em, calc(env(safe-area-inset-bottom, 0px) - var(--oy)));
  background: radial-gradient(ellipse at 50% 20%, rgba(18, 12, 48, 0.55), rgba(2, 3, 8, 0.86) 75%);
  animation: fade 0.25s ease-out;
}
/* im Menü läuft dahinter die Vorführung, deshalb etwas dunkler als nötig für reine Lesbarkeit */
#screen-menu, #screen-hangar { background: radial-gradient(ellipse at 50% 22%, rgba(10, 8, 30, 0.62), rgba(2, 3, 8, 0.86) 80%); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel { width: 100%; max-width: 26em; margin: auto; display: flex; flex-direction: column; align-items: stretch; gap: 0.9em; text-align: center; }
.panel.narrow { max-width: 19em; }

.logo {
  margin: 0.2em 0 0;
  font-size: 3.3em;
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo span:first-child {
  color: #f4feff;
  text-shadow: 0 0 0.12em #fff, 0 0 0.3em var(--cyan), 0 0 0.7em var(--cyan), 0 0 1.4em rgba(61, 242, 255, 0.55);
  animation: flicker 5s infinite;
}
.logo span:last-child {
  margin-left: 0.5em;
  color: #fff3fe;
  text-shadow: 0 0 0.12em #fff, 0 0 0.3em var(--magenta), 0 0 0.7em var(--magenta), 0 0 1.4em rgba(255, 61, 242, 0.55);
}
@keyframes flicker {
  0%, 91%, 94%, 97%, 100% { opacity: 1; }
  92%, 96% { opacity: 0.55; }
}
.tagline { margin: 0; color: var(--dim); font-size: 0.95em; }

.title {
  margin: 0;
  font-size: 2.3em;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4feff;
  text-shadow: 0 0 0.3em var(--cyan), 0 0 0.9em rgba(61, 242, 255, 0.6);
}
.title.long { font-size: 1.6em; letter-spacing: 0.06em; }
.title.over { color: #fff1f3; text-shadow: 0 0 0.3em var(--red), 0 0 0.9em rgba(255, 77, 94, 0.7); }

.btn {
  min-height: 48px;
  padding: 0.75em 1.4em;
  border-radius: 0.8em;
  border: 1.5px solid var(--line);
  background: rgba(8, 12, 30, 0.72);
  color: var(--text);
  font-weight: 800;
  font-size: 1em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 1.1em rgba(61, 242, 255, 0.35); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn.primary {
  border: 0;
  font-size: 1.15em;
  color: #04060f;
  background: linear-gradient(100deg, var(--cyan), #9a7bff 55%, var(--magenta));
  box-shadow: 0 0 1.3em rgba(61, 242, 255, 0.45), 0 0 2.2em rgba(255, 61, 242, 0.3);
}
.btn.primary:hover { box-shadow: 0 0 1.6em rgba(61, 242, 255, 0.7), 0 0 2.8em rgba(255, 61, 242, 0.45); }

.best { margin: -0.2em 0 0; color: var(--dim); font-size: 0.9em; }
.best b { color: var(--amber); font-variant-numeric: tabular-nums; }

.board { border: 1px solid var(--line); border-radius: 0.9em; background: rgba(6, 9, 24, 0.66); padding: 0.8em 0.9em 0.6em; text-align: left; }
.board h2 { margin: 0 0 0.5em; font-size: 0.78em; font-weight: 800; letter-spacing: 0.26em; text-transform: uppercase; color: var(--cyan); display: flex; justify-content: space-between; gap: 1em; align-items: baseline; }
.board h2 small { font-size: 0.9em; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--dim); text-align: right; }
.board-list { list-style: none; margin: 0; padding: 0; max-height: 15.5em; overflow-y: auto; touch-action: pan-y; }
.board-list li { display: grid; grid-template-columns: 1.9em 1fr auto auto; gap: 0.6em; align-items: baseline; padding: 0.32em 0.4em; border-radius: 0.4em; font-variant-numeric: tabular-nums; }
.board-list li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.board-list .rank { color: var(--dim); font-weight: 700; text-align: right; }
.board-list .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .wave { color: var(--dim); font-size: 0.82em; }
.board-list .pts { font-weight: 800; text-align: right; }
.board-list li:nth-child(1) .rank, .board-list li:nth-child(1) .pts { color: var(--amber); text-shadow: 0 0 0.6em rgba(255, 197, 61, 0.6); }
.board-list li:nth-child(2) .rank, .board-list li:nth-child(2) .pts { color: #dfeaff; }
.board-list li:nth-child(3) .rank, .board-list li:nth-child(3) .pts { color: var(--orange); }
.board-list li.me { background: rgba(61, 242, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(61, 242, 255, 0.5); }
.board-list .empty { display: block; color: var(--dim); text-align: center; padding: 0.9em 0; }

.toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em; }
.chip {
  min-height: 40px;
  padding: 0.45em 0.9em;
  border-radius: 2em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 30, 0.6);
  color: var(--dim);
  font-size: 0.85em;
  font-weight: 700;
}
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 0.8em rgba(61, 242, 255, 0.3); }
.touch [data-toggle="autoFire"] { display: none; }
.chip::after { content: ": aus"; }
.chip[aria-pressed="true"]::after { content: ": an"; }

.help { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0.9em; background: rgba(6, 9, 24, 0.6); text-align: left; padding: 0 0.9em; font-size: 0.9em; }
.help summary { padding: 0.75em 0; font-weight: 700; cursor: pointer; color: var(--text); }
.help h3 { margin: 0.6em 0 0.3em; font-size: 0.8em; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan); }
.help p { margin: 0 0 0.8em; color: #c3d2ee; }
.help ul { margin: 0 0 0.8em; padding: 0; list-style: none; color: #c3d2ee; }
.help li { margin: 0.35em 0; }
.help kbd { display: inline-block; margin: 0 0.12em; padding: 0.05em 0.45em; border-radius: 0.35em; border: 1px solid var(--line); background: #0a0d1f; font: 700 0.85em var(--font); color: var(--text); }
.powerups li { display: flex; align-items: center; gap: 0.6em; }
.powerups img { width: 1.9em; height: 1.9em; flex: none; }
.powerups b { color: var(--text); }

.result { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7em; }
.result div { border: 1px solid var(--line); border-radius: 0.9em; background: rgba(6, 9, 24, 0.66); padding: 0.6em 0.4em; }
.result span { display: block; font-size: 0.7em; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); }
.result b { display: block; font-size: 1.9em; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 0 0.4em rgba(61, 242, 255, 0.7); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4em; margin: 0; }
.stats div { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0.7em; background: rgba(6, 9, 24, 0.55); padding: 0.4em 0.2em; min-width: 0; }
.stats dt { font-size: 0.6em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 0.1em 0 0; font-size: 1.05em; font-weight: 800; font-variant-numeric: tabular-nums; }
.ship-card .ship-record { flex: none; font-size: 0.7em; color: var(--amber); font-variant-numeric: tabular-nums; }
.record { margin: 0; font-weight: 800; letter-spacing: 0.08em; color: var(--amber); text-shadow: 0 0 0.7em rgba(255, 197, 61, 0.7); animation: pulse 0.7s infinite alternate; }

.entry { display: flex; flex-direction: column; gap: 0.4em; text-align: left; }
.entry label { font-size: 0.82em; color: var(--dim); }
.entry-row { display: flex; gap: 0.5em; }
.entry input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 0.9em;
  border-radius: 0.8em;
  border: 1.5px solid var(--line);
  background: rgba(4, 6, 16, 0.85);
  color: var(--text);
  font: 700 16px var(--font); /* 16px verhindert das Hineinzoomen auf dem iPhone */
  -webkit-user-select: text;
  user-select: text;
}
.entry .btn { letter-spacing: 0.1em; padding: 0.75em 1em; }
.msg { margin: 0; min-height: 1.3em; font-size: 0.9em; font-weight: 700; color: var(--green); }
.msg.error { color: var(--red); }
.msg:empty { display: none; }
.version { margin: 0; font-size: 0.75em; color: var(--dim); opacity: 0.7; }

/* ------------------------------------------------------------ Hangar */

.gem { color: var(--amber); text-shadow: 0 0 0.6em rgba(255, 197, 61, 0.8); }
.crystals { margin: 0; font-size: 1.05em; }
.crystals b { color: var(--amber); font-variant-numeric: tabular-nums; }
.hint { margin: -0.4em 0 0; font-size: 0.85em; color: var(--dim); }
.section { margin: 0.4em 0 -0.3em; font-size: 0.78em; font-weight: 800; letter-spacing: 0.26em; text-transform: uppercase; color: var(--cyan); text-align: left; }

.hangar-btn { display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.hangar-info { font-size: 0.82em; font-weight: 700; letter-spacing: 0.04em; text-transform: none; color: var(--dim); }
.hangar-info b { color: var(--amber); font-variant-numeric: tabular-nums; }

.ships { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; }
.ship-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  padding: 0.6em 0.4em 0.55em;
  border-radius: 0.9em;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 9, 24, 0.66);
  min-width: 0;
}
.ship-card.selected { border-color: var(--cyan); box-shadow: 0 0 1em rgba(61, 242, 255, 0.35), inset 0 0 1.2em rgba(61, 242, 255, 0.12); }
.ship-card.locked img { opacity: 0.45; filter: grayscale(0.6); }
.ship-card img { width: 4.2em; height: 4.3em; object-fit: contain; }
.ship-card b { font-size: 1em; letter-spacing: 0.06em; }
.ship-card p { margin: 0; flex: 1; font-size: 0.72em; line-height: 1.3; color: #c3d2ee; }
.ship-card .btn { width: 100%; }

.upgrades { display: flex; flex-direction: column; gap: 0.45em; }
.upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 0.7em;
  border-radius: 0.8em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 9, 24, 0.6);
  text-align: left;
}
.upgrade b { display: flex; align-items: center; gap: 0.6em; }
.upgrade p { margin: 0.15em 0 0; font-size: 0.8em; color: #c3d2ee; }

.btn.small { min-height: 40px; padding: 0.4em 0.8em; font-size: 0.8em; letter-spacing: 0.06em; white-space: nowrap; }
.btn.small .gem { margin-right: 0.2em; }

/* ------------------------------------------------------------ Einstellungen und Einstiegshilfe */

.slider { display: grid; grid-template-columns: 4.2em 1fr 2.4em; align-items: center; gap: 0.7em; text-align: left; font-weight: 700; }
.slider output { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
.slider input { width: 100%; min-height: 40px; accent-color: var(--cyan); touch-action: pan-x; }
.chip.choice::after { content: none; }
.chip.choice { color: var(--text); border-color: var(--line); }
.hint-text { margin: -0.3em 0 0; font-size: 0.8em; color: var(--dim); }

/* Einstiegshilfe im Spiel (nur dieses eine Element, nicht die kleinen Hinweistexte in den Menüs) */
#hint {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 56%;
  padding: 0.8em 1em;
  border-radius: 0.9em;
  border: 1px solid var(--line);
  background: rgba(4, 6, 18, 0.82);
  text-align: center;
  font-size: calc(var(--u) * 17);
  line-height: 1.5;
  animation: hint 9s ease-out both;
}
#hint p { margin: 0; }
#hint kbd { display: inline-block; margin: 0 0.1em; padding: 0.05em 0.45em; border-radius: 0.35em; border: 1px solid var(--line); background: #0a0d1f; font: 700 0.85em var(--font); }
#hint .for-touch { display: none; }
.touch #hint .for-touch { display: block; }
.touch #hint .for-keys { display: none; }
@keyframes hint { 0% { opacity: 0; transform: translateY(0.6em); } 6% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }

.fps { position: fixed; left: 2vw; right: 2vw; bottom: 6px; z-index: 20; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.7); color: #9fe8ff; font: 600 11px ui-monospace, Menlo, Consolas, monospace; text-align: center; pointer-events: none; }

/* ------------------------------------------------------------ Koop */

.coop-box { display: flex; flex-direction: column; gap: 0.9em; }
#coop-msg { overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.entry input.code { text-align: center; letter-spacing: 0.4em; text-transform: uppercase; font-size: 18px; }
.room-code { margin: -0.4em 0 0; font-size: 3em; font-weight: 900; letter-spacing: 0.25em; margin-right: -0.25em; color: #f4feff; text-shadow: 0 0 0.25em var(--cyan), 0 0 0.8em rgba(61, 242, 255, 0.6); -webkit-user-select: text; user-select: text; }
.coop-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35em; }
.coop-players li { display: flex; align-items: baseline; gap: 0.6em; padding: 0.5em 0.8em; border-radius: 0.7em; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(6, 9, 24, 0.6); text-align: left; }
.coop-players li.me { border-color: var(--cyan); box-shadow: inset 0 0 0.9em rgba(61, 242, 255, 0.14); }
.coop-players li.free { color: var(--dim); border-style: dashed; justify-content: center; font-size: 0.85em; }
.coop-players .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coop-players .ship { color: var(--dim); font-size: 0.85em; }
.coop-players .host { color: var(--amber); font-size: 0.75em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ------------------------------------------------------------ Missionen und Tageslauf */

.missions { display: flex; flex-direction: column; gap: 0.4em; }
.mission { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.3em 0.7em; padding: 0.5em 0.7em; border-radius: 0.8em; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(6, 9, 24, 0.6); text-align: left; font-size: 0.9em; }
.mission .reward { font-weight: 800; color: var(--amber); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mission .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6em; font-size: 0.8em; color: var(--dim); font-variant-numeric: tabular-nums; }
.mission .bar i { flex: 1; height: 0.3em; border-radius: 1em; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.mission .bar b { display: block; height: 100%; background: var(--green); box-shadow: 0 0 0.5em var(--green); }

.mission-done { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3em; }
.mission-done li { display: flex; justify-content: space-between; gap: 0.8em; padding: 0.45em 0.7em; border-radius: 0.7em; border: 1px solid rgba(93, 255, 138, 0.45); background: rgba(93, 255, 138, 0.1); text-align: left; font-size: 0.88em; }
.mission-done li::before { content: "✓"; color: var(--green); font-weight: 800; }
.mission-done span { flex: 1; }
.mission-done b { color: var(--amber); white-space: nowrap; }

.mode { margin: -0.5em 0 0; font-size: 0.85em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.tabs { display: flex; gap: 0.3em; }
.tab { padding: 0.35em 0.7em; min-height: 32px; border-radius: 2em; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: var(--dim); font-size: 1em; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.tab.on { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0.7em rgba(61, 242, 255, 0.3); }

/* ------------------------------------------------------------ Hinweise */

.rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 8, 0.96);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 2em;
}
@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) {
  .rotate { display: flex; }
}
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .logo span:first-child, .record, .boss.rage #boss-fill { animation: none; }
  .banner.warn.show { animation: banner var(--dur, 3s) ease-out both; }
}
