/* Mathe-Survivor – Aussehen der Anzeigen (das Spielfeld selbst wird im Canvas gezeichnet) */

:root {
  --ui-hinten: rgba(22, 18, 40, 0.9);
  --ui-rand: #0d0b1a;
  --ui-linie: #f2d27a;
  --text: #fff8e7;
  --text-leise: #cfc6e8;
  --akzent: #f2c94c;
  --akzent-dunkel: #c99a1e;
  --xp: #6fd36b;
  --fehler: #ff9a8f;
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1d3a1f;
  color: var(--text);
  font-family: var(--schrift);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#spielfeld {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;          /* Finger steuern die Figur, nicht das Scrollen/Zoomen */
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Spieler-Leiste ---------- */

.hud {
  position: fixed;
  top: 12px;
  left: 12px;
  min-width: 200px;
  padding: 8px 12px 9px;
  background: var(--ui-hinten);
  border: 3px solid var(--ui-rand);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--ui-linie), 0 3px 0 rgba(0, 0, 0, 0.35);
  user-select: none;
  pointer-events: none;
}

.hud[hidden] { display: none; }

.hud-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #ffe28a;
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.hud-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.hud-klein { font-size: 13px; font-weight: 700; }

.hud-level {
  font-weight: 800;
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #3b2f6b;
  border: 2px solid var(--ui-rand);
}

.xp-balken {
  flex: 1;
  height: 10px;
  background: #2a2346;
  border: 2px solid var(--ui-rand);
  border-radius: 3px;
  overflow: hidden;
}

.xp-fuellung {
  width: 0;
  height: 100%;
  background: linear-gradient(#9ef59a, var(--xp) 60%, #3fa53b);
  transition: width 0.4s ease;
}

.muenze {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3b0 0 18%, var(--akzent) 22% 62%, var(--akzent-dunkel) 66%);
  border: 2px solid #6b4a0a;
  flex: none;
}

.hud-einheit { color: var(--text-leise); font-weight: 600; margin-left: -4px; }
.hud-xp-text { margin-left: auto; color: var(--text-leise); font-weight: 600; }

/* ---------- oben rechts: Verbindung und Ruckel-Anzeige ---------- */

.oben-rechts {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.netz-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700;
  background: var(--ui-hinten);
  border: 2px solid var(--ui-rand);
  border-radius: 999px;
}

.netz-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a84a3;
}

.netz-status[data-zustand="online"]::before { background: #6fd36b; box-shadow: 0 0 6px #6fd36b; }
.netz-status[data-zustand="verbinde"]::before,
.netz-status[data-zustand="suche"]::before { background: #f2b84c; animation: blinken 1s steps(2) infinite; }
.netz-status[data-zustand="aus"]::before { background: #ff8a80; }

@keyframes blinken { 50% { opacity: 0.25; } }

.netz-status[hidden] { display: none; }
.im-duell .oben-rechts { display: none; } /* im Duell nicht über die Namen legen */

/* ---------- Hinweis-Fenster ---------- */

.hinweis-titel {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--akzent);
  text-shadow: 2px 2px 0 #000;
}

.hinweis-text {
  margin: 0 0 16px;
  line-height: 1.45;
}

/* ---------- Ruckel-Anzeige ---------- */

.fps {
  padding: 6px 10px;
  font: 600 13px/1.2 Consolas, "Courier New", monospace;
  background: rgba(0, 0, 0, 0.75);
  color: #9ef59a;
  border-radius: 6px;
  pointer-events: none;
}

.fps[hidden] { display: none; }

/* ---------- Startbildschirm ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 14, 24, 0.45);
  overflow-y: auto;
}

.overlay[hidden] { display: none; }

.karte {
  width: min(420px, 100%);
  padding: 22px 24px 18px;
  text-align: center;
  background: var(--ui-hinten);
  border: 4px solid var(--ui-rand);
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px var(--ui-linie), 0 6px 0 rgba(0, 0, 0, 0.4);
}

.titel {
  margin: 0;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--akzent);
  text-shadow: 3px 3px 0 #7a3b0e, 5px 5px 0 #000;
}

.untertitel {
  margin: 6px 0 10px;
  color: var(--text-leise);
}

.vorschau {
  display: block;
  margin: 0 auto 10px;
  width: 64px;
  height: 96px;
  image-rendering: pixelated;
}

.feld-label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-leise);
  margin-bottom: 4px;
}

.feld {
  width: 100%;
  padding: 10px 12px;
  font: 700 20px var(--schrift);
  color: #1a1530;
  background: #fff8e7;
  border: 3px solid var(--ui-rand);
  border-radius: 8px;
  outline: none;
}

.feld:focus { box-shadow: 0 0 0 3px var(--akzent); }

.farben-box {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  text-align: left;
}

.farben-box legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-leise);
  margin-bottom: 4px;
  padding: 0;
}

.farben {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.farbe {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--farbe);
  border: 3px solid var(--ui-rand);
  cursor: pointer;
}

.farbe input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.figur-wahl { display: flex; gap: 8px; }
.figur-knopf {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  padding: 7px 8px; border: 2px solid var(--ui-linie); border-radius: 8px; font-weight: 800; background: rgba(255, 255, 255, 0.06);
}
.figur-knopf input { position: absolute; opacity: 0; pointer-events: none; }
.figur-knopf:has(input:checked) { border-color: var(--akzent); background: #3b2f6b; color: var(--akzent); }
.figur-knopf:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }
.farbe:has(input:checked) { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ui-rand); }
.farbe:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 4px; }

.fehler {
  min-height: 1.3em;
  margin: 10px 0 4px;
  color: var(--fehler);
  font-weight: 700;
}

.knopf {
  width: 100%;
  padding: 12px;
  font: 900 20px var(--schrift);
  color: #2a1a00;
  background: linear-gradient(#ffe48a, var(--akzent) 55%, var(--akzent-dunkel));
  border: 3px solid var(--ui-rand);
  border-radius: 10px;
  box-shadow: 0 4px 0 #6b4a0a;
  cursor: pointer;
}

.knopf:hover { filter: brightness(1.06); }
.knopf:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b4a0a; }
.knopf:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hilfe {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-leise);
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  font: 700 12px var(--schrift);
  color: var(--text);
  background: #3b2f6b;
  border: 2px solid var(--ui-rand);
  border-radius: 4px;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 20px;
}

/* ---------- Hinweis unten und Meldungen oben ---------- */

.aktion-hinweis {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  background: var(--ui-hinten);
  border: 3px solid var(--ui-rand);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--ui-linie);
  pointer-events: none;
}

.meldung {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 9px 16px;
  font-weight: 700;
  text-align: center;
  background: #2c2552;
  border: 3px solid var(--ui-rand);
  border-radius: 10px;
  pointer-events: none;
  z-index: 30;
}

.meldung[data-art="fehler"] { background: #6b2a2a; }
.meldung-neu { animation: meldung-rein 0.25s ease-out; }
@keyframes meldung-rein { from { transform: translate(-50%, -12px); opacity: 0; } }

.aktion-hinweis.klickbar {
  pointer-events: auto;
  cursor: pointer;
  background: #3b2f6b;
}
.aktion-hinweis.klickbar:hover { filter: brightness(1.15); }
.aktion-hinweis.klickbar:active { transform: translateX(-50%) translateY(2px); }

.aktion-hinweis[hidden], .meldung[hidden] { display: none; }

/* ---------- Herausforderung an mich ---------- */

.hf-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 18px 20px 14px;
  background: var(--ui-hinten);
  border: 4px solid var(--ui-rand);
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px var(--ui-linie), 0 6px 0 rgba(0, 0, 0, 0.4);
  z-index: 20;
  animation: meldung-rein-mitte 0.2s ease-out;
}

@keyframes meldung-rein-mitte { from { transform: translate(-50%, -46%); opacity: 0; } }

.hf-dialog[hidden] { display: none; }

.hf-titel {
  font-size: 21px;
  font-weight: 900;
  color: var(--akzent);
  text-shadow: 2px 2px 0 #000;
  text-align: center;
}

.hf-zeit, .duell-zeit {
  height: 10px;
  margin: 10px 0;
  background: #2a2346;
  border: 2px solid var(--ui-rand);
  border-radius: 4px;
  overflow: hidden;
}

.hf-zeit-balken, .duell-zeit-balken {
  height: 100%;
  background: linear-gradient(#ffe48a, var(--akzent));
  transform-origin: left center;
}

@keyframes schrumpfen { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.hf-frage { margin: 6px 0; color: var(--text-leise); font-weight: 700; }

.hf-kategorien {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.hf-kategorie {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.hf-kategorie:hover { background: rgba(255, 255, 255, 0.06); }
.hf-kategorie.gewaehlt { background: #3b2f6b; border-color: var(--akzent); }
.hf-nr { width: 20px; font-weight: 900; color: var(--akzent); }
.hf-name { flex: 1; font-weight: 700; }
.hf-anzahl { font-size: 12px; color: var(--text-leise); }

.hf-knoepfe { display: flex; gap: 10px; }
.hf-knoepfe .knopf { font-size: 17px; padding: 10px; }
.knopf-grau { background: linear-gradient(#d8d3e6, #b3abc9 55%, #8e86a8); box-shadow: 0 4px 0 #4a4466; }

/* ---------- Duell ---------- */

.duell {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.duell[hidden] { display: none; }

.duell-kopf {
  position: absolute;
  top: 2.5vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.duell-seite { display: flex; flex-direction: column; gap: 6px; }
.duell-seite.rechts { align-items: flex-end; text-align: right; }

.duell-name {
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}

.duell-punkte { display: flex; gap: 6px; }
.duell-punkte span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a2346;
  border: 3px solid var(--ui-rand);
}
.duell-punkte span.voll {
  background: radial-gradient(circle at 35% 35%, #fff3b0 0 18%, var(--akzent) 22% 62%, var(--akzent-dunkel) 66%);
}

.duell-mitte {
  text-align: center;
  padding: 6px 18px 8px;
  background: var(--ui-hinten);
  border: 3px solid var(--ui-rand);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--ui-linie);
}

.duell-kategorie { font-size: 13px; font-weight: 700; color: var(--text-leise); }
.duell-stand { font-size: clamp(30px, 4vw, 44px); font-weight: 900; color: var(--akzent); text-shadow: 3px 3px 0 #000; line-height: 1.1; }
.duell-doppelpunkt { margin: 0 10px; color: var(--text); }
.duell-ziel { font-size: 12px; color: var(--text-leise); }

.duell-box {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: min(560px, 46vw, calc(100% - 32px));
  padding: 14px 20px 12px;
  text-align: center;
  background: var(--ui-hinten);
  border: 4px solid var(--ui-rand);
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--ui-linie), 0 6px 0 rgba(0, 0, 0, 0.4);
}

.duell-box[hidden] { display: none; }

.duell-zeit.knapp .duell-zeit-balken { background: linear-gradient(#ff9a8f, #e04a4a); }

.duell-frage {
  min-height: 1.3em;
  margin: 8px 0 12px;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.duell-frage.wartet { color: var(--akzent); }
.duell-frage.lang { font-size: clamp(19px, 2.2vw, 27px); line-height: 1.3; }

.duell-form { display: flex; gap: 10px; }

.duell-antwort {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font: 800 26px var(--schrift);
  text-align: center;
  color: #1a1530;
  background: #fff8e7;
  border: 3px solid var(--ui-rand);
  border-radius: 10px;
  outline: none;
}

.duell-antwort:focus { box-shadow: 0 0 0 3px var(--akzent); }
.duell-antwort:disabled,
.duell-antwort.gesperrt { background: #b9b2cc; color: #4a4466; }
.duell-ok { width: auto; padding: 10px 18px; }

.wackeln { animation: wackeln 0.35s; }
@keyframes wackeln {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.duell-rueckmeldung {
  min-height: 1.4em;
  margin: 10px 0 2px;
  font-size: 18px;
  font-weight: 800;
}

.duell-rueckmeldung[data-art="gut"] { color: #8ef08a; }
.duell-rueckmeldung[data-art="schlecht"] { color: var(--fehler); }
.duell-rueckmeldung[data-art="info"] { color: var(--akzent); }

.duell-netz { margin-top: 6px; color: var(--fehler); font-weight: 700; }
.duell-netz[hidden] { display: none; }

.duell-ende {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  padding: 22px 24px 18px;
  text-align: center;
  background: var(--ui-hinten);
  border: 4px solid var(--ui-rand);
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--ui-linie), 0 8px 0 rgba(0, 0, 0, 0.45);
  animation: meldung-rein-mitte 0.25s ease-out;
}

.duell-ende[hidden] { display: none; }

.duell-ende-titel {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900;
  color: var(--akzent);
  text-shadow: 3px 3px 0 #7a3b0e, 5px 5px 0 #000;
}

.duell-ende[data-art="niederlage"] .duell-ende-titel { color: #c9c2e0; text-shadow: 3px 3px 0 #3b2f6b, 5px 5px 0 #000; }
.duell-ende-grund { margin: 4px 0 10px; font-size: 20px; font-weight: 800; }
.duell-ende-belohnung { margin-bottom: 16px; font-size: 18px; font-weight: 800; color: #8ef08a; }
.duell-ende[data-art="niederlage"] .duell-ende-belohnung { color: var(--text); }

/* ---------- Duell: Fußzeile mit Aufgeben ---------- */

.duell-fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.knopf-klein {
  padding: 5px 12px;
  font: 700 13px var(--schrift);
  color: var(--text);
  background: #3b2f6b;
  border: 2px solid var(--ui-rand);
  border-radius: 8px;
  cursor: pointer;
}
.knopf-klein:hover { filter: brightness(1.15); }

/* ---------- Handy und Tablet ---------- */

/* ohne Maus (Touch): Tastatur-Hinweise ausblenden */
@media (hover: none) {
  .nur-tastatur { display: none; }
  .duell-fuss { justify-content: center; }
}

@media (max-width: 600px) {
  .hud { top: 8px; left: 8px; min-width: 0; padding: 6px 9px 7px; }
  .hud-name { font-size: 15px; }
  .hud-xp-text { display: none; }
  .oben-rechts { top: 8px; right: 8px; }
  .netz-status { font-size: 12px; padding: 4px 9px; }
  .aktion-hinweis { bottom: 14px; font-size: 15px; }
  .duell-kopf { top: 8px; width: calc(100% - 16px); gap: 6px; }
  .duell-name { font-size: 15px; }
  .duell-punkte { gap: 3px; }
  .duell-punkte span { width: 13px; height: 13px; border-width: 2px; }
  .duell-mitte { padding: 4px 10px 6px; }
  .duell-ziel { display: none; }
  .duell-box { width: calc(100% - 24px); padding: 12px 14px 10px; }
}

/* Hochformat: Arena oben, Aufgabe direkt darunter (bleibt über der Bildschirmtastatur sichtbar) */
@media (orientation: portrait) and (max-width: 900px) {
  .duell-box {
    top: calc(var(--arena-unten, 45%) + 10px);
    transform: translateX(-50%);
    width: calc(100% - 24px);
  }
}

/* ---------- v1.5: Spieler-Leiste mit Knöpfen ---------- */

.hud-siege { margin-left: 4px; }
.hud-faehigkeiten { margin-top: 4px; font-size: 15px; letter-spacing: 3px; min-height: 0; }
.hud-faehigkeiten:empty { display: none; }
.hud-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.hud-knoepfe[hidden] { display: none; }
.hud-knoepfe .knopf-klein { pointer-events: auto; padding: 4px 9px; }
.hud-knoepfe .knopf-klein[hidden] { display: none; }
.knopf-neu { background: #8a5a12; animation: leuchten 1.2s ease-in-out infinite; }
.knopf-klein.knopf-aus { opacity: 0.65; }
@keyframes leuchten { 50% { box-shadow: 0 0 0 3px var(--akzent); } }

/* ---------- Survival-Anzeige ---------- */

.survival-leiste {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 6px 14px 7px;
  text-align: center;
  background: rgba(40, 22, 70, 0.92);
  border: 3px solid var(--ui-rand);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #b58cff;
  pointer-events: none;
}
.survival-leiste[hidden] { display: none; }
.survival-oben { font-weight: 800; font-size: 15px; color: #e2cfff; }
.survival-unten { font-weight: 700; font-size: 15px; margin-top: 2px; }
.in-survival .meldung { top: 84px; }
.im-duell .survival-leiste { display: none; }
/* Handy: oben ist kein Platz neben der Spieler-Leiste → über den Hinweis am unteren Rand */
@media (max-width: 600px) {
  .survival-leiste { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); padding: 4px 10px 5px; width: max-content; }
  .survival-oben, .survival-unten { font-size: 13px; }
}

/* ---------- Shop ---------- */

.shop-karte { position: relative; width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.schliessen {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; font-size: 18px; font-weight: 900;
  color: var(--text); background: #3b2f6b; border: 2px solid var(--ui-rand); border-radius: 8px; cursor: pointer;
}
.shop-gold { margin: 0 0 10px; font-weight: 800; font-size: 18px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.shop-reiter { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.shop-reiter .aktiv { background: var(--akzent); color: #2a1a00; }
.shop-waren { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ware {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 8px; background: #241e44; border: 2px solid #3b3460; border-radius: 10px;
}
.ware.traegt { border-color: var(--akzent); box-shadow: 0 0 0 2px rgba(242, 201, 76, 0.35); }
.ware-bild { width: 48px; height: 84px; image-rendering: pixelated; }
.ware-name { min-height: 84px; display: grid; place-items: center; font-weight: 900; font-size: 18px; text-shadow: 2px 2px 0 #000; word-break: break-word; }
.ware-name.verlauf { background-clip: text; -webkit-background-clip: text; color: transparent; text-shadow: none; }
.ware-titel { font-weight: 700; font-size: 14px; text-align: center; }
.ware-knopf { width: 100%; }
.ware-knopf.kaufen { background: #6b4a0a; }
.ware-knopf.zu-teuer { opacity: 0.55; }
.ware-knopf.aus { cursor: default; background: #2c5a2a; }

/* ---------- Waffengeschäft und Raketen ---------- */

.waffen-karte { width: min(420px, 100%); }
.waffen-ware { margin: 0 auto 10px; max-width: 260px; }
.waffen-bild { width: 90px; height: 45px; image-rendering: pixelated; }
.knopf-rakete { background: #7a2a22; font-weight: 800; }
.treffer-blitz {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 90px 30px rgba(230, 40, 30, 0.85);
}
.treffer-blitz.an { animation: treffer-blitz 0.7s ease-out; }
@keyframes treffer-blitz { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Fähigkeit wählen ---------- */

.fw-liste { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fw-wahl {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px;
  color: var(--text); background: #241e44; border: 2px solid #3b3460; border-radius: 10px; cursor: pointer; font: inherit;
}
.fw-wahl:hover, .fw-wahl:focus-visible { border-color: var(--akzent); }
.fw-symbol { font-size: 28px; }
.fw-text { display: flex; flex-direction: column; gap: 2px; }
.fw-text span { font-size: 14px; color: var(--text-leise); }

/* ---------- Rangliste ---------- */

.rang-sieger { font-size: 20px; font-weight: 800; color: #8ef08a; margin: 4px 0 10px; }
.rang-liste { list-style: none; padding: 0; margin: 0 0 14px; max-height: 50vh; overflow-y: auto; text-align: left; }
.rang-liste li { display: flex; gap: 10px; padding: 6px 10px; border-bottom: 1px solid #3b3460; font-weight: 700; }
.rang-liste li.ich { background: #3b2f6b; border-radius: 6px; }
.rang-platz { width: 34px; color: var(--akzent); }
.rang-name { flex: 1; }
.rang-siege { color: var(--text-leise); }

/* ---------- Duell: Fähigkeiten, Zeitdruck, Tipp ---------- */

.duell-druck {
  margin: 8px 0 0; padding: 6px 10px; font-weight: 900; font-size: 18px;
  color: #fff; background: #a8332a; border: 2px solid var(--ui-rand); border-radius: 8px;
  animation: blinken 0.6s steps(2) infinite;
}
.duell-druck[hidden] { display: none; }
.duell-tipp { min-height: 0; font-weight: 800; color: var(--akzent); margin-bottom: 4px; }
.duell-tipp:empty { display: none; }
.duell-faehigkeiten { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 2px; }
.duell-faehigkeiten:empty { display: none; }
.faehig-knopf {
  padding: 6px 10px; font: 700 14px var(--schrift); color: var(--text);
  background: #3b2f6b; border: 2px solid var(--ui-rand); border-radius: 8px; cursor: pointer;
}
.faehig-knopf:hover { filter: brightness(1.2); }
.faehig-knopf.benutzt { opacity: 0.4; cursor: default; text-decoration: line-through; }
.faehig-knopf.aktiv { background: #2c5a2a; }
.duell-ende-survival { margin: -6px 0 14px; font-size: 18px; font-weight: 800; }
.duell-ende-survival[hidden] { display: none; }

/* ---------- v1.6: Geheimzahl ---------- */

.pin-label { margin-top: 10px; }
.pin-feld { letter-spacing: 0.3em; }
.pin-hilfe { margin: 4px 0 0; text-align: left; }
.pin-label[hidden], .pin-feld[hidden], .pin-hilfe[hidden] { display: none; }
#pin-dialog .feld { text-align: center; letter-spacing: 0.3em; }
