/* ============================================================
   Antibiotica Hero
   ============================================================ */

:root {
  color-scheme: dark;
  --ink: #04070a;
  --bone: #f4f0e6;
  --amber: #e8c07a;
  --amber-soft: rgba(232, 192, 122, 0.16);
  --danger: #d46a5c;
  --teal: #83b7a6;
  --panel: #0a100d;
  --panel-raised: #0e1713;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: var(--sans);
  color: var(--bone);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: var(--ink);
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s ease;
  touch-action: none;
  z-index: 0;
}

body.ready #game {
  opacity: 1;
}

/* ---------- Atmosphäre ---------- */

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 75% 68% at 50% 48%, transparent 42%, rgba(1, 3, 5, 0.34) 78%, rgba(1, 3, 5, 0.72) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  filter: grayscale(1) contrast(115%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  z-index: 3;
}

/* ---------- Erzähltext am Anfang ---------- */

.intro {
  position: absolute;
  top: 12vh;
  left: 50%;
  width: min(740px, calc(100% - 48px));
  transform: translate(-50%, 10px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease 0.9s, transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s;
  z-index: 20;
}

body.ready .intro {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.ready .intro.is-named {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0s;
  transition-duration: 0.9s;
}

.intro.is-dismissed,
body.ready .intro.is-dismissed {
  opacity: 0;
  transform: translate(-50%, -8px);
  transition-delay: 0s;
  transition-duration: 0.9s;
}

.intro-kicker {
  margin: 0 0 12px;
  color: rgba(232, 192, 122, 0.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.intro-title {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.9);
}

.intro-sub {
  margin: 12px 0 0;
  color: rgba(236, 240, 233, 0.62);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

.intro-guide {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: rgba(232, 192, 122, 0.8);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}

.intro-guide-arrow {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  animation: guide-nudge 2.2s ease-in-out infinite;
}

@keyframes guide-nudge {
  0%, 100% { transform: translateX(0); opacity: 0.65; }
  50% { transform: translateX(5px); opacity: 1; }
}

/* ---------- Tastaturhinweis ---------- */

#hint {
  position: absolute;
  left: 50%;
  bottom: max(30px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  color: rgba(232, 238, 230, 0.48);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease 0.7s, transform 1s ease 0.7s;
  z-index: 20;
}

body.ready #hint {
  opacity: 1;
}

body.ready #hint.hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
  transition-delay: 0s;
  transition-duration: 0.9s;
}

.hint-keys {
  display: grid;
  grid-template-columns: repeat(3, 25px);
  grid-template-rows: repeat(2, 25px);
  gap: 4px;
}

.hint-keys kbd:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.hint-keys kbd:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.hint-keys kbd:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.hint-keys kbd:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.hint-keys kbd {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(232, 238, 230, 0.16);
  border-radius: 7px;
  background: rgba(232, 238, 230, 0.035);
  color: rgba(232, 238, 230, 0.62);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.hint-label {
  padding-top: 1px;
}

/* ---------- Virtueller Joystick ---------- */

#joystick {
  position: absolute;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(26px, env(safe-area-inset-bottom));
  width: 124px;
  height: 124px;
  display: none;
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
  touch-action: none;
  pointer-events: auto;
  z-index: 22;
}

body.touch #joystick {
  display: block;
}

body.ready.touch #joystick {
  opacity: 1;
}

body.touch #hint {
  display: none;
}

.joy-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 241, 234, 0.17);
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012) 62%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.55),
    0 8px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.joy-base::before,
.joy-base::after {
  content: "";
  position: absolute;
  background: rgba(236, 241, 234, 0.1);
}

.joy-base::before {
  left: 50%;
  top: 12px;
  bottom: 12px;
  width: 1px;
  transform: translateX(-50%);
}

.joy-base::after {
  top: 50%;
  left: 12px;
  right: 12px;
  height: 1px;
  transform: translateY(-50%);
}

.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, #faf7ee, #ded9ca 55%, #b9b4a6 100%);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(255, 242, 206, 0.14),
    inset 0 -2px 6px rgba(70, 62, 45, 0.28);
  will-change: transform;
  pointer-events: none;
}

#joystick:not(.used) .joy-base {
  animation: joy-pulse 3s ease-out infinite;
}

@keyframes joy-pulse {
  0%, 55%, 100% {
    box-shadow:
      inset 0 0 28px rgba(0, 0, 0, 0.55),
      0 8px 32px rgba(0, 0, 0, 0.25),
      0 0 0 0 rgba(240, 240, 230, 0);
  }
  30% {
    box-shadow:
      inset 0 0 28px rgba(0, 0, 0, 0.55),
      0 8px 32px rgba(0, 0, 0, 0.25),
      0 0 0 9px rgba(240, 240, 230, 0.05);
  }
}

/* ---------- Medikamenten-Icon ---------- */

.pill-icon {
  --pw: 30px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  width: var(--pw);
  height: calc(var(--pw) * 0.5);
  border: 1px solid rgba(26, 21, 13, 0.5);
  border-radius: 999px;
  background: linear-gradient(90deg, #e9c174 0 50%, #f7f2e6 50% 100%);
  box-shadow:
    inset 0 -2px 4px rgba(70, 47, 16, 0.38),
    inset 0 2px 3px rgba(255, 255, 255, 0.58),
    0 0 18px rgba(232, 192, 122, 0.16);
  transform: rotate(-32deg);
  overflow: hidden;
}

.pill-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(83, 61, 25, 0.36);
}

.pill-icon::after {
  content: "";
  position: absolute;
  left: 13%;
  top: 17%;
  width: 34%;
  height: 22%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(-6deg);
}

.pill-icon--lg {
  --pw: 64px;
}

/* ---------- Inventar ---------- */

.inventory {
  position: absolute;
  right: max(26px, env(safe-area-inset-right));
  bottom: max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s linear 0.5s;
  z-index: 24;
}

.inventory.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s;
}

.inventory.is-awaiting {
  transform: none;
  transition: opacity 0.25s ease, visibility 0s;
}

.inventory-label {
  color: rgba(232, 238, 230, 0.38);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.inv-items {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.inv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inv-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(232, 192, 122, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 40% 30%, rgba(232, 192, 122, 0.08), transparent 65%),
    rgba(8, 13, 10, 0.76);
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.4),
    0 10px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.inv-item .inv-slot {
  border-color: rgba(232, 192, 122, 0.3);
}

.inv-item.is-pending .inv-slot {
  border-style: dashed;
  border-color: rgba(232, 192, 122, 0.34);
  background: rgba(9, 14, 11, 0.38);
}

.inv-slot .pill-icon {
  --pw: 32px;
  opacity: 1;
  transform: rotate(-32deg) scale(1);
  transition: opacity 0.2s ease, transform 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.inv-item.is-pending .pill-icon {
  opacity: 0;
  transform: rotate(-32deg) scale(0.55);
}

.inv-item.is-new .inv-slot {
  border-color: rgba(232, 192, 122, 0.42);
  background:
    radial-gradient(circle at 40% 30%, rgba(232, 192, 122, 0.16), transparent 68%),
    rgba(9, 14, 11, 0.8);
  animation: slot-arrive 0.6s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes slot-arrive {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(232, 192, 122, 0.08), 0 10px 28px rgba(0, 0, 0, 0.34); }
  100% { transform: scale(1); }
}

.inv-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  color: #1b1409;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.inv-item.is-pending .inv-count {
  display: none;
}

.inv-name {
  max-width: 62px;
  overflow: hidden;
  color: rgba(244, 240, 230, 0.48);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-item.is-pending .inv-name {
  opacity: 0.35;
}
/* ---------- Fliegende Pille ---------- */

.pill-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 220;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(232, 192, 122, 0.55));
  will-change: transform, opacity;
}

.pill-flyer .pill-icon {
  --pw: 44px;
}

/* ---------- Begegnungshinweis ---------- */

.encounter {
  position: absolute;
  left: 50%;
  bottom: 78px;
  width: min(560px, calc(100% - 40px));
  margin: 0;
  padding: 15px 20px 16px;
  border: 1px solid rgba(212, 106, 92, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(155deg, rgba(24, 13, 13, 0.9), rgba(7, 10, 8, 0.92));
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 0 30px rgba(212, 106, 92, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(244, 240, 230, 0.82);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 23;
}

.encounter.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.encounter-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: #df9c72;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.encounter-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 10px rgba(212, 106, 92, 0.7);
  animation: danger-pulse 1.6s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.encounter-text {
  margin: 7px 0 0;
}

.encounter-text strong {
  color: #f3d0b2;
  font-weight: 600;
}

/* ---------- Overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
  touch-action: pan-y;
}

.overlay[hidden] {
  display: none;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 4, 0.74);
  backdrop-filter: blur(8px) saturate(0.82);
  -webkit-backdrop-filter: blur(8px) saturate(0.82);
}

/* ---------- Namensabfrage ---------- */

.overlay--name {
  z-index: 130;
}

.overlay--name .overlay-scrim {
  background: rgba(2, 5, 4, 0.82);
  backdrop-filter: blur(10px) saturate(0.84);
  -webkit-backdrop-filter: blur(10px) saturate(0.84);
}

.name-shell {
  width: min(440px, 100%);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .name-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.name-card {
  width: 100%;
  padding: 32px 34px 25px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.name-portrait {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 35%, #fbfcfe 0%, #edf3f8 68%, #e3ecf3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 138, 166, 0.08),
    0 14px 26px rgba(82, 111, 136, 0.12);
}

.name-portrait img {
  display: block;
  width: auto;
  height: 72px;
  filter: drop-shadow(0 8px 10px rgba(45, 78, 100, 0.16));
}

.name-card .card-eyebrow {
  margin-bottom: 9px;
  text-align: center;
}

.name-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.name-sub {
  margin: 9px 0 0;
  color: #7c8b97;
  font-size: 12.5px;
  line-height: 1.55;
}

.name-form {
  margin-top: 23px;
  text-align: left;
}

.name-label {
  display: block;
  margin: 0 0 6px 2px;
  color: #8493a0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.name-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid #e1ebf1;
  border-radius: 12px;
  background: #f7fbfd;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.name-field:focus-within {
  border-color: #9ed4ef;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(112, 189, 229, 0.12);
}

.name-prefix {
  flex: 0 0 auto;
  color: #5b7b95;
  font-size: 13px;
  font-weight: 600;
}

.name-field input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #22384a;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
}

.name-field input::placeholder {
  color: #a9b7c1;
  font-weight: 400;
}

.name-hint {
  min-height: 14px;
  margin: 7px 2px 0;
  color: #a5b3be;
  font-size: 9px;
  line-height: 1.4;
}

.name-submit {
  width: 100%;
  margin-top: 10px;
}

.name-submit:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.name-footnote {
  margin: 15px 0 0;
  color: #b0bbc3;
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

/* ---------- Fund-Popup ---------- */

.overlay--found {
  z-index: 110;
}

.overlay--found .overlay-scrim {
  background: rgba(2, 5, 4, 0.80);
  backdrop-filter: blur(9px) saturate(0.84);
  -webkit-backdrop-filter: blur(9px) saturate(0.84);
}

.found-shell {
  width: min(420px, 100%);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .found-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.found-card {
  width: 100%;
  padding: 30px 32px 23px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.found-portrait {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 0 auto 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 35%, #fbfcfe 0%, #edf3f8 68%, #e3ecf3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 138, 166, 0.08),
    0 16px 28px rgba(82, 111, 136, 0.12);
}

.pill-icon--found {
  --pw: 80px;
  filter: drop-shadow(0 10px 12px rgba(96, 70, 30, 0.18));
}

.found-card .card-eyebrow {
  margin-bottom: 8px;
  text-align: center;
}

.found-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.found-name {
  margin: 6px 0 0;
  color: #31556d;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.found-text {
  margin: 13px 0 0;
  color: #7c8b97;
  font-size: 12.5px;
  line-height: 1.65;
}

.found-view {
  width: 100%;
  margin-top: 18px;
}

.found-footnote {
  margin: 12px 0 0;
  color: #b0bbc3;
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

/* ---------- Medikamenten-Karte ---------- */

.drug-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(1030px, 100%);
  max-height: calc(100dvh - 48px);
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .drug-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.drug-cards {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: 22px;
  align-items: stretch;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 240, 230, 0.22) transparent;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.drug-cards::-webkit-scrollbar {
  width: 6px;
}

.drug-cards::-webkit-scrollbar-thumb {
  background: rgba(244, 240, 230, 0.2);
  border-radius: 99px;
}

.drug-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 34px 34px 30px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.status-chip {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #eef4f8;
  color: #5b7b95;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.drug-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 2px auto 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 42%, #fbfcfe 0%, #edf3f8 65%, #e3ecf3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 138, 166, 0.08),
    0 18px 30px rgba(82, 111, 136, 0.12);
}

.portrait-ring {
  position: absolute;
  inset: -10px;
  border: 1px dashed rgba(111, 138, 163, 0.22);
  border-radius: 50%;
}

.pill-icon--hero {
  --pw: 138px;
  filter: drop-shadow(0 12px 14px rgba(96, 70, 30, 0.18));
}

.card-eyebrow {
  margin: 0 0 9px;
  color: #7690a6;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.drug-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.drug-sub {
  margin: 8px 0 0;
  color: #7c8b97;
  font-size: 12.5px;
  line-height: 1.55;
}

.drug-description {
  margin: 17px 0 0;
  color: #73828e;
  font-size: 12.5px;
  line-height: 1.7;
}

.drug-description strong {
  color: #2c3d48;
  font-weight: 600;
}

.card-divider {
  height: 1px;
  margin: 23px 0 6px;
  background: #e9eef2;
}

.drug-fields {
  display: flex;
  flex-direction: column;
}

.profile-row {
  display: grid;
  grid-template-columns: 24px 108px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f4;
}

.profile-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: #6c88a0;
}

.profile-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.profile-label {
  padding-top: 3px;
  color: #8493a0;
  font-size: 11.5px;
  line-height: 1.45;
}

.profile-value {
  color: #2a3b46;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.profile-note {
  color: #9ba8b3;
}

.literature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.literature-head .card-eyebrow {
  margin: 0;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5f1;
  color: #5e8d79;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.live-tag.is-offline {
  background: #f9efec;
  color: #af6a5e;
}

.literature-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: clamp(24px, 2.4vw, 29px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.literature-sub {
  margin: 9px 0 0;
  color: #7f8e99;
  font-size: 12px;
  line-height: 1.6;
}

.literature-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 15px 0 0;
}

.literature-tab {
  padding: 7px 11px;
  border: 1px solid #e2ebf1;
  border-radius: 999px;
  background: #ffffff;
  color: #748a99;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.literature-tab:hover {
  border-color: #bcdcee;
  background: #f7fcff;
  color: #3f7898;
}

.literature-tab[aria-pressed="true"] {
  border-color: #b7dcef;
  background: #eef9ff;
  color: #2d7899;
}

.literature-tab:focus-visible {
  outline: 2px solid #8ac8e8;
  outline-offset: 2px;
}

.pubmed-query {
  margin: 17px 0 0;
  padding: 10px 12px;
  border: 1px solid #e2ebf1;
  border-radius: 9px;
  background: #f2f7fa;
  color: #55738b;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  word-break: break-word;
}

.pubmed-results {
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

.pubmed-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #edf1f4;
  color: inherit;
  text-decoration: none;
}

.pubmed-item:first-child {
  padding-top: 1px;
  border-top: 0;
}

.pubmed-item:last-child {
  padding-bottom: 0;
}

.pubmed-item-icon {
  padding-top: 1px;
  color: #8ba2b5;
}

.pubmed-item-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.pubmed-item-body {
  min-width: 0;
}

.pubmed-item-title {
  display: block;
  color: #2b3c47;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.pubmed-item:hover .pubmed-item-title {
  color: #3f7297;
}

.pubmed-item-meta {
  display: block;
  margin-top: 4px;
  color: #96a3ae;
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.015em;
}

.pubmed-item-arrow {
  float: right;
  margin-left: 8px;
  color: #9fb3c3;
  font-size: 10px;
}

.pubmed-loading {
  display: grid;
  gap: 11px;
  padding: 1px 0;
}

.pubmed-skeleton span {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #eef2f5 20%, #f7fafb 50%, #eef2f5 80%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.pubmed-skeleton span + span {
  width: 62%;
  height: 6px;
  margin-top: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -80% 0; }
}

.pubmed-message {
  padding: 4px 0;
  color: #81909c;
  font-size: 11.5px;
  line-height: 1.65;
}

.pubmed-message a {
  color: #4f7b9c;
  text-decoration: none;
}

.pubmed-message a:hover {
  text-decoration: underline;
}

.pubmed-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-top: 13px;
  color: #4f7b9c;
  font-size: 10.5px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pubmed-more:hover {
  color: #2f5d80;
  text-decoration: underline;
}

.search-details {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #edf1f4;
}

.search-details .card-eyebrow {
  margin-bottom: 6px;
}

.search-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  color: #8b99a5;
  font-size: 10.5px;
  line-height: 1.5;
}

.search-detail-row strong {
  color: #40525f;
  font-weight: 500;
  text-align: right;
}

.drug-card--pubmed .pubmed-credit {
  margin-top: auto;
  padding-top: 18px;
}

.pubmed-credit {
  margin: 15px 0 0;
  color: #b5bec7;
  font-size: 8.5px;
  letter-spacing: 0.035em;
}

.drug-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
}

.drug-footnote {
  margin: 0;
  color: rgba(244, 240, 230, 0.4);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.pubmed-jump {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(244, 240, 230, 0.58);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.pubmed-jump span {
  font-size: 12px;
  line-height: 1;
}

.pubmed-jump:hover {
  color: var(--amber);
}

.pubmed-jump:focus-visible {
  outline: 2px solid rgba(232, 192, 122, 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 126px;
  padding: 13px 27px;
  border: 1px solid rgba(255, 225, 165, 0.45);
  border-radius: 999px;
  background: linear-gradient(160deg, #f0ce8d, #d6ad66);
  color: #1a140a;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 26px rgba(232, 192, 122, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.38),
    0 0 34px rgba(232, 192, 122, 0.18);
  transform: translateY(-1px);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid rgba(232, 192, 122, 0.7);
  outline-offset: 3px;
}

.btn-primary:active {
  transform: translateY(0);
}

.battle-kicker {
  margin: 0 0 6px;
  color: rgba(212, 106, 92, 0.75);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
/* ---------- Kampf-Overlay ---------- */

.overlay--battle {
  background: transparent;
}

.overlay--battle .overlay-scrim {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(225, 240, 248, 0.30), rgba(178, 208, 225, 0.86) 78%),
    rgba(208, 228, 239, 0.55);
  backdrop-filter: blur(14px) saturate(0.78);
  -webkit-backdrop-filter: blur(14px) saturate(0.78);
}

.battle-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(202, 235, 250, 0.55), rgba(129, 194, 228, 0.12) 55%, transparent 80%);
  opacity: 0;
  pointer-events: none;
}

.overlay--battle.is-open .battle-flash {
  animation: battle-flash 0.55s ease-out;
}

@keyframes battle-flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

.battle-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dbe8f0;
  border-radius: 24px;
  background: linear-gradient(165deg, #f9fcfd 0%, #edf5f9 100%);
  box-shadow:
    0 34px 92px rgba(5, 28, 43, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #22384a;
  font-family: var(--sans);
  transform: translateY(16px) scale(0.99);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.4s ease;
  scrollbar-width: thin;
  scrollbar-color: #c7dae5 transparent;
}

.overlay--battle.is-open .battle-shell {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.battle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 2px 6px 11px;
}

.battle-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.battle-kicker {
  margin: 0;
  color: #7c93a3;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.battle-context {
  color: #9bafbb;
  font-size: 11px;
  line-height: 1.3;
}

.battle-round {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #dce8ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6f8796;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.battle-round.is-new {
  animation: round-pulse 0.55s ease-out;
}

@keyframes round-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.07); border-color: #9dcfe7; color: #2f86ac; background: #f3fbff; }
  100% { transform: scale(1); }
}

.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 14px;
  min-height: 0;
  align-items: stretch;
}

.battle-field {
  position: relative;
  min-height: 488px;
  overflow: hidden;
  border: 1px solid #d9e8f1;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 44% 40% at 68% 32%, rgba(255, 255, 255, 0.92), transparent 72%),
    radial-gradient(ellipse 38% 42% at 18% 78%, rgba(157, 203, 226, 0.24), transparent 72%),
    linear-gradient(180deg, #e4f1fa 0%, #f6fbfd 62%, #dfeef7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.battle-field::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(207, 230, 242, 0) 0%, rgba(202, 226, 239, 0.7) 100%);
}

.battle-field::after {
  content: "";
  position: absolute;
  top: -16%;
  right: 3%;
  width: min(500px, 54%);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 68%);
}

.battle-enemy-card {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  z-index: 6;
  display: flex;
  gap: 11px;
  width: min(342px, calc(100% - 36px));
  padding: 12px 13px;
  border: 1px solid #e4edf2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(30, 72, 97, 0.10);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.battle-enemy-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fbf1f4;
}

.battle-enemy-avatar svg {
  display: block;
  width: 42px;
  height: auto;
}

.battle-enemy-details {
  flex: 1;
  min-width: 0;
}

.battle-name-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.battle-name-line strong {
  min-width: 0;
  color: #20384a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.battle-name-line > span {
  flex: 0 0 auto;
  color: #9aadb9;
  font-size: 9.5px;
  font-weight: 500;
}

.battle-enemy-sub {
  margin: 2px 0 7px;
  overflow: hidden;
  color: #7d93a2;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: #e9f0f4;
}

.hp-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
}

.hp-fill--enemy {
  background: linear-gradient(90deg, #e77f8c, #d55669);
}

.hp-fill--player {
  background: linear-gradient(90deg, #4cc7aa, #22a78d);
}

.hp-fill.is-low {
  background: linear-gradient(90deg, #df7865, #c64b57) !important;
}

.battle-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.battle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.battle-tag {
  padding: 2px 7px;
  border: 1px solid #e4edf2;
  border-radius: 999px;
  background: #f6fafc;
  color: #748a99;
  font-size: 8.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.battle-tag--enemy {
  border-color: #f1dfe3;
  background: #fdf4f5;
  color: #b85a69;
}

.battle-hp-value {
  flex: 0 0 auto;
  color: #8ba0ae;
  font-size: 9px;
  white-space: nowrap;
}

.battle-arena {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 82px 44px 118px;
}

.battle-fighter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.4s ease, filter 0.2s ease;
  will-change: transform;
}

.battle-fighter--player {
  width: 31%;
  max-width: 270px;
}

.battle-fighter--player img {
  display: block;
  width: auto;
  height: clamp(180px, 17vw, 240px);
  filter: drop-shadow(0 16px 16px rgba(30, 68, 88, 0.18));
}

.battle-fighter--enemy {
  width: 48%;
  max-width: 430px;
}

.diplococcus-art {
  display: block;
  width: min(380px, 100%);
  height: auto;
  max-height: 320px;
  filter: drop-shadow(0 18px 24px rgba(97, 48, 73, 0.20));
  animation: germ-hover 5.5s ease-in-out infinite;
}

.battle-fighter::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  z-index: -1;
  width: 76%;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(39, 84, 107, 0.17), transparent 70%);
  filter: blur(2px);
  transform: translateX(-50%);
}

@keyframes germ-hover {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

.battle-bottom {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.battle-message-box {
  flex: 1;
  min-width: 0;
  padding: 12px 18px 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--tone, #86a7b9);
  border-radius: 14px;
  background: #263a4a;
  color: #f7fbfd;
  box-shadow: 0 12px 30px rgba(22, 50, 68, 0.18);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.battle-message-box[data-tone="good"] { --tone: #62d0b4; }
.battle-message-box[data-tone="partial"] { --tone: #e8b86b; }
.battle-message-box[data-tone="none"] { --tone: #de8b83; }
.battle-message-box[data-tone="enemy"] { --tone: #ef7b87; }
.battle-message-box[data-tone="win"] { --tone: #e8c07a; }

.battle-message-label {
  display: block;
  margin-bottom: 3px;
  color: var(--tone, #94aebb);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.battle-message {
  margin: 0;
  color: #f7fbfd;
  font-size: 19px;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.battle-player-card {
  flex: 0 0 286px;
  padding: 11px 14px 10px;
  border: 1px solid #e2ebf0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(30, 72, 97, 0.10);
}

.battle-effect-banner {
  --effect-color: #128f74;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100% - 48px));
  padding: 14px 18px;
  border: 1px solid #cfeee5;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 48px rgba(27, 65, 90, 0.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.battle-effect-banner[hidden] {
  display: none;
}

.battle-effect-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.battle-effect-banner.is-good { --effect-color: #128f74; border-color: #cfeee5; }
.battle-effect-banner.is-partial { --effect-color: #b97a1e; border-color: #f3e2c4; }
.battle-effect-banner.is-none { --effect-color: #c4534d; border-color: #f2d8d6; }

.battle-effect-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e9f8f3;
  color: var(--effect-color);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.battle-effect-banner.is-partial .battle-effect-mark { background: #fcf4e6; }
.battle-effect-banner.is-none .battle-effect-mark { background: #fcefee; }

.battle-effect-copy {
  display: block;
  min-width: 0;
}

.battle-effect-copy strong {
  display: block;
  color: #20394b;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.battle-effect-copy > span {
  display: block;
  margin-top: 3px;
  color: #7c93a2;
  font-size: 10.5px;
}

.battle-damage {
  position: absolute;
  top: 4%;
  left: 50%;
  z-index: 9;
  pointer-events: none;
  color: #bf4657;
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 700;
  opacity: 0;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.75);
  transform: translate(-50%, 0);
}

.battle-damage.is-visible {
  animation: damage-float 0.85s ease-out forwards;
}

@keyframes damage-float {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1.1); }
}

.battle-fighter.is-attacking {
  animation: attack-lunge 0.38s ease-in-out;
}

@keyframes attack-lunge {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(18px); }
}

.battle-fighter--enemy.is-attacking {
  animation-name: attack-lunge-enemy;
}

@keyframes attack-lunge-enemy {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-18px); }
}

.battle-fighter.is-hit {
  animation: hit-shake 0.42s ease-out;
}

@keyframes hit-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-7px); }
  38% { transform: translateX(6px); }
  58% { transform: translateX(-3px); }
  78% { transform: translateX(2px); }
}

.battle-fighter.is-defeated {
  animation: germ-defeat 0.8s ease-in forwards;
}

@keyframes germ-defeat {
  0% { opacity: 1; transform: scale(1); filter: drop-shadow(0 18px 24px rgba(97, 48, 73, 0.2)); }
  100% { opacity: 0; transform: scale(0.72) translateY(20px); filter: blur(5px); }
}

.battle-beam {
  --beam-color: #3da6d9;
  position: absolute;
  z-index: 8;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--beam-color));
  box-shadow: 0 0 18px var(--beam-color), 0 0 5px rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: rotate(var(--beam-angle, 0deg)) scaleX(0);
}

.battle-beam::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--beam-color);
  box-shadow: 0 0 20px var(--beam-color);
}

.battle-beam.is-visible {
  animation: beam-fire 0.48s ease-out forwards;
}

@keyframes beam-fire {
  0% { opacity: 0; transform: rotate(var(--beam-angle, 0deg)) scaleX(0.05); }
  18% { opacity: 1; transform: rotate(var(--beam-angle, 0deg)) scaleX(1); }
  68% { opacity: 0.9; transform: rotate(var(--beam-angle, 0deg)) scaleX(1); }
  100% { opacity: 0; transform: rotate(var(--beam-angle, 0deg)) scaleX(1); }
}

.battle-beam--player { --beam-color: #36a9e0; }
.battle-beam--enemy { --beam-color: #df5a6b; }

.battle-impact {
  --impact-color: rgba(54, 169, 224, 0.22);
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--impact-x, 50%) var(--impact-y, 50%), var(--impact-color), transparent 58%);
}

.battle-impact.is-visible {
  animation: impact-flash 0.45s ease-out;
}

.battle-impact--player { --impact-color: rgba(54, 169, 224, 0.24); }
.battle-impact--enemy { --impact-color: rgba(223, 90, 107, 0.22); }

@keyframes impact-flash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.battle-actions {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border: 1px solid #e4edf2;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(30, 72, 97, 0.08);
}

.battle-actions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.battle-actions-head h3 {
  margin: 0;
  color: #20394b;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.battle-action-status {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 4px 9px;
  border: 1px solid #d6eee7;
  border-radius: 999px;
  background: #effaf6;
  color: #268c73;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.battle-action-status.is-busy {
  border-color: #f1d9dd;
  background: #fdf2f3;
  color: #c05c68;
}

.battle-command-hint {
  margin: 8px 0 15px;
  color: #8ba0ae;
  font-size: 10.5px;
  line-height: 1.5;
}

.battle-search {
  position: relative;
  margin: 0 0 10px;
}

.battle-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #8ba0ae;
  pointer-events: none;
  transform: translateY(-50%);
}

.battle-search-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.battle-search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  border: 1px solid #e1ebf1;
  border-radius: 10px;
  background: #f7fbfd;
  color: #22384a;
  font-family: var(--sans);
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.battle-search-input::placeholder {
  color: #a3b3be;
}

.battle-search-input:focus {
  border-color: #9ed4ef;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(112, 189, 229, 0.12);
}

.battle-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.battle-search-empty {
  margin: 5px 2px 0;
  color: #8ba0ae;
  font-size: 10.5px;
  line-height: 1.5;
}

.battle-antibiotics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 302px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #c9dce7 transparent;
}

.antibiotic-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e6eef3;
  border-radius: 12px;
  background: #ffffff;
  color: #22384a;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.antibiotic-card:hover:not(:disabled) {
  border-color: #b7dcef;
  background: #f4fbff;
  box-shadow: 0 6px 16px rgba(52, 137, 186, 0.10);
  transform: translateY(-1px);
}

.antibiotic-card:focus-visible {
  outline: 2px solid #70bde5;
  outline-offset: 2px;
  border-color: #a3d7f0;
  background: #eef9ff;
}

.antibiotic-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.antibiotic-card.is-cooling {
  background: #f8fafb;
}

.antibiotic-card.is-reacting {
  animation: card-react 0.7s ease-out;
}

.antibiotic-card.is-reacting[data-effect="good"] {
  border-color: #83d3bf;
  box-shadow: 0 0 0 3px rgba(34, 167, 141, 0.10);
}

.antibiotic-card.is-reacting[data-effect="partial"] {
  border-color: #e3bd7c;
  box-shadow: 0 0 0 3px rgba(201, 138, 44, 0.10);
}

.antibiotic-card.is-reacting[data-effect="none"] {
  border-color: #dfa6a1;
  box-shadow: 0 0 0 3px rgba(196, 83, 77, 0.08);
}

@keyframes card-react {
  0% { transform: translateX(0); }
  35% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.antibiotic-iconframe {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dcecf5;
  border-radius: 11px;
  background:
    radial-gradient(circle at 36% 26%, rgba(160, 214, 239, 0.42), transparent 70%),
    #f1f9fd;
}

.antibiotic-iconframe .pill-icon {
  --pw: 30px;
}

.antibiotic-info {
  min-width: 0;
}

.antibiotic-name {
  display: block;
  overflow: hidden;
  color: #20394b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.antibiotic-class {
  display: block;
  margin-top: 1px;
  color: #8297a5;
  font-size: 10.5px;
  line-height: 1.35;
}

.antibiotic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.3;
}

.antibiotic-uses {
  display: flex;
  gap: 3px;
}

.antibiotic-use-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #43bfa4;
}

.antibiotic-use-dot.is-spent {
  background: #dbe6ec;
}

.antibiotic-status {
  color: #8ba0ae;
  white-space: nowrap;
}

.antibiotic-card.is-cooling .antibiotic-status {
  color: #bd8754;
}

.battle-wait {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid #e6eef3;
  border-radius: 12px;
  background: #fbfdfe;
  color: #5c7486;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.battle-wait:hover:not(:disabled) {
  border-color: #d5e3ea;
  background: #f6fafc;
}

.battle-wait:focus-visible {
  outline: 2px solid #70bde5;
  outline-offset: 2px;
}

.battle-wait:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.battle-wait-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f1f5f8;
  color: #8ba0ae;
}

.battle-wait-copy {
  display: block;
  min-width: 0;
}

.battle-wait-copy strong {
  display: block;
  color: #516b7c;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

.battle-wait-copy span {
  display: block;
  margin-top: 1px;
  color: #93a6b2;
  font-size: 9.5px;
  line-height: 1.3;
}

.battle-disclaimer {
  margin: auto 0 0;
  padding-top: 14px;
  color: #a9b8c2;
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-align: center;
}
.battle-result {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border-radius: inherit;
  background: rgba(19, 44, 59, 0.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.battle-result[hidden] {
  display: none;
}

.battle-result-card {
  width: min(480px, 100%);
  padding: 30px 28px 25px;
  border: 1px solid #e1ecf2;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(12, 40, 58, 0.28);
  text-align: center;
}

.battle-result-card .battle-kicker {
  color: #7992a2;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.battle-result-title {
  margin: 0;
  color: #20394b;
  font-family: var(--sans);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.battle-result-text {
  margin: 11px 0 0;
  color: #6f8796;
  font-size: 13px;
  line-height: 1.6;
}

.battle-result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 21px;
  flex-wrap: wrap;
}

.battle-result-actions .btn-primary,
.battle-result-actions .btn-ghost {
  margin: 0;
}

.battle-result-card .btn-primary {
  padding: 11px 22px;
  border: 1px solid #1d9f87;
  border-radius: 999px;
  background: #1fa78c;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(31, 167, 140, 0.2);
}

.battle-result-card .btn-primary:hover {
  border-color: #178f78;
  background: #19977f;
  color: #ffffff;
}

.battle-result-card .btn-primary:focus-visible {
  outline-color: #74c4b1;
  outline-offset: 2px;
}

.battle-result-card .btn-ghost {
  padding: 10px 18px;
  border: 1px solid #dbe7ee;
  border-radius: 999px;
  background: #ffffff;
  color: #6d8493;
  font-family: var(--sans);
  font-size: 11px;
}

.battle-result-card .btn-ghost:hover {
  border-color: #b9d6e5;
  background: #f5fbfe;
  color: #2e7d9e;
}
.btn-ghost {
  margin: 0;
}
.btn-ghost {
  margin-top: 12px;
  padding: 10px 17px;
  border: 1px solid rgba(244, 240, 230, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(244, 240, 230, 0.6);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-ghost:hover {
  border-color: rgba(232, 192, 122, 0.35);
  background: rgba(232, 192, 122, 0.05);
  color: var(--amber);
}

/* ---------- Zielhinweis ---------- */

.encounter.is-goal {
  border-color: rgba(232, 192, 122, 0.32);
  background:
    linear-gradient(155deg, rgba(23, 21, 13, 0.92), rgba(7, 10, 8, 0.94));
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 0 30px rgba(232, 192, 122, 0.05);
}

.encounter.is-goal .encounter-kicker {
  color: #e8c07a;
}

.encounter.is-goal .encounter-dot {
  background: #e8c07a;
  box-shadow: 0 0 12px rgba(232, 192, 122, 0.65);
}

.encounter.is-goal .encounter-text {
  color: rgba(249, 239, 218, 0.82);
}

/* ---------- Levelabschluss ---------- */

.overlay--complete {
  z-index: 120;
}

.overlay--complete .overlay-scrim {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(77, 57, 23, 0.22), rgba(2, 5, 4, 0.86) 65%),
    rgba(2, 5, 4, 0.7);
  backdrop-filter: blur(9px) saturate(0.78);
  -webkit-backdrop-filter: blur(9px) saturate(0.78);
}

.completion-card {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 36px 40px 26px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 26px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f8faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow:
    0 40px 110px rgba(0, 0, 0, 0.58),
    0 3px 10px rgba(0, 0, 0, 0.12);
  transform: translateY(16px) scale(0.985);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.4s ease;
  scrollbar-width: thin;
}

.overlay.is-open .completion-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.completion-rays {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 48% at 50% 0%, rgba(232, 192, 122, 0.24), transparent 68%);
}

.completion-emblem,
.completion-card .card-eyebrow,
.completion-title,
.completion-text,
.completion-stats,
.completion-actions,
.completion-footnote {
  position: relative;
  z-index: 1;
}

.completion-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border: 1px solid rgba(191, 151, 77, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fffaf0, #f0dcae);
  color: #7b5a27;
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 600;
  box-shadow:
    0 15px 30px rgba(115, 84, 32, 0.18),
    inset 0 0 0 6px rgba(255, 255, 255, 0.52);
}

.completion-card .card-eyebrow {
  color: #a37f40;
  text-align: center;
}

.completion-title {
  margin: 8px 0 0;
  color: #1f2e38;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.completion-text {
  margin: 12px 0 0;
  color: #6f7f8b;
  font-size: 14px;
  line-height: 1.6;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 23px;
  border-top: 1px solid #e7ecee;
  border-bottom: 1px solid #e7ecee;
}

.completion-stat {
  padding: 14px 7px;
  border-left: 1px solid #e7ecee;
}

.completion-stat:first-child {
  border-left: 0;
}

.completion-stat span {
  display: block;
  color: #94a1ab;
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.completion-stat strong {
  display: block;
  margin-top: 4px;
  color: #2b3b46;
  font-size: 16px;
  font-weight: 600;
}

.completion-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 23px;
  flex-wrap: wrap;
}

.completion-secondary {
  padding: 12px 20px;
  border: 1px solid #dde4e8;
  border-radius: 999px;
  background: transparent;
  color: #728592;
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.completion-secondary:hover {
  border-color: #b9cbd7;
  color: #48697f;
}

.completion-secondary:focus-visible {
  outline: 2px solid rgba(232, 192, 122, 0.8);
  outline-offset: 3px;
}

.completion-actions .btn-primary:focus-visible {
  outline-color: rgba(58, 88, 104, 0.45);
  outline-offset: 2px;
}

.completion-footnote {
  margin: 18px 0 0;
  color: #b6c0c7;
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.completion-sparkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.completion-sparkles span {
  position: absolute;
  bottom: 12%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8c07a;
  opacity: 0;
  animation: completion-spark 3.2s ease-in-out infinite;
}

.completion-sparkles span:nth-child(1) { left: 10%; animation-delay: 0.1s; }
.completion-sparkles span:nth-child(2) { left: 22%; animation-delay: 1.7s; width: 3px; height: 3px; }
.completion-sparkles span:nth-child(3) { left: 36%; animation-delay: 0.8s; }
.completion-sparkles span:nth-child(4) { left: 48%; animation-delay: 2.2s; width: 4px; height: 4px; }
.completion-sparkles span:nth-child(5) { left: 62%; animation-delay: 1.1s; }
.completion-sparkles span:nth-child(6) { left: 74%; animation-delay: 2.7s; width: 3px; height: 3px; }
.completion-sparkles span:nth-child(7) { left: 86%; animation-delay: 0.4s; }
.completion-sparkles span:nth-child(8) { left: 93%; animation-delay: 1.9s; width: 4px; height: 4px; }

@keyframes completion-spark {
  0% { opacity: 0; transform: translateY(12px) scale(0.4); }
  22% { opacity: 0.9; }
  68% { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-175px) scale(1); }
}
/* ---------- Zustände ---------- */

body.modal-open #joystick,
body.modal-open #hint,
body.modal-open .intro,
body.modal-open .encounter {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.modal-open #joystick {
  transition-delay: 0s;
}

body.modal-open {
  cursor: default;
}

/* ---------- Material-Buttons (Start & Einwilligung) ---------- */

.overlay--start,
.overlay--consent {
  --md-primary: #477da8;
  --md-on-primary: #ffffff;
  --md-outline: #cbd8e2;
  --md-outline-hover: #a8bfd1;
}

.md-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  border-radius: 13px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.md-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.md-btn:hover::after {
  opacity: 0.07;
}

.md-btn:active::after {
  opacity: 0.12;
}

.md-btn:focus-visible {
  outline: 2px solid #8ab6d6;
  outline-offset: 3px;
}

.md-btn--filled {
  border: 0;
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.md-btn--outlined {
  border: 1px solid var(--md-outline);
  background: transparent;
  color: #3d5266;
  font-weight: 500;
}

.md-btn--outlined:hover {
  border-color: var(--md-outline-hover);
}

.md-btn--text {
  border: 0;
  background: transparent;
  color: var(--md-primary);
  font-weight: 600;
}

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

.overlay--start,
.overlay--levels {
  z-index: 100;
}

.overlay--start {
  --start-bg: #f8fafc;
  --start-ink: #17212b;
  --start-muted: #718096;
  --start-line: #dce3e9;

  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 4vh, 34px) 22px;
}

.overlay--start .overlay-scrim {
  overflow: hidden;
  background:
    radial-gradient(ellipse 74% 50% at 50% -6%, #eaf2f9 0%, rgba(234, 242, 249, 0) 72%),
    radial-gradient(ellipse 54% 46% at 6% 104%, rgba(219, 233, 243, 0.62), transparent 70%),
    radial-gradient(ellipse 46% 40% at 96% 86%, rgba(226, 238, 246, 0.55), transparent 72%),
    var(--start-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay--start .overlay-scrim::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(780px, 116vw);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 64%);
  pointer-events: none;
}

.overlay--start .overlay-scrim::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(720px, 108vw);
  aspect-ratio: 1;
  border: 1px solid rgba(71, 125, 168, 0.06);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.overlay--levels .overlay-scrim {
  background:
    radial-gradient(ellipse at 50% 43%, rgba(18, 38, 33, 0.10), rgba(2, 7, 9, 0.64) 82%),
    rgba(2, 7, 9, 0.18);
  backdrop-filter: blur(10px) brightness(0.94) saturate(0.86);
  -webkit-backdrop-filter: blur(10px) brightness(0.94) saturate(0.86);
}

.start-shell {
  position: relative;
  z-index: 2;
  width: min(394px, 100%);
  margin: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .start-shell {
  opacity: 1;
  transform: translateY(0);
}

.start-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

/* Figur: oben angeschnitten, weich in den Hintergrund auslaufend */
.start-hero {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 172px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 80%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 80%, rgba(0, 0, 0, 0) 100%);
}

.start-hero-halo {
  position: absolute;
  top: -34px;
  left: 50%;
  width: 272px;
  height: 272px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 46%, #ffffff 0%, #f0f6fb 46%, rgba(240, 246, 251, 0) 72%);
  box-shadow: inset 0 0 0 1px rgba(71, 125, 168, 0.08);
}

.start-hero img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: 278px;
  margin-top: 10px;
  filter: drop-shadow(0 14px 18px rgba(45, 78, 100, 0.16));
}

.start-title {
  margin: 8px 0 0;
  color: var(--start-ink);
  font-family: var(--sans);
  font-size: clamp(31px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.start-sub {
  max-width: 320px;
  margin: 10px 0 0;
  color: var(--start-muted);
  font-size: 13.5px;
  line-height: 1.62;
  letter-spacing: 0.005em;
  text-wrap: pretty;
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  margin-top: 24px;
}

.start-play {
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
}

.start-play-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.95;
}

.start-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.start-secondary {
  min-height: 46px;
  padding: 0 10px;
  font-size: 11.5px;
  line-height: 1.25;
}

.start-secondary svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--md-primary);
}

.start-support {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  font-size: 11.5px;
}

.start-support svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.start-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid var(--start-line);
  text-align: left;
}

.start-record-label {
  flex: 0 0 auto;
  color: #94a3b1;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.start-record-value {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--start-muted);
  font-size: 10px;
  line-height: 1.4;
}

.start-record-city {
  flex: 0 0 auto;
  color: #40566a;
  font-weight: 600;
}

.start-record-city::after {
  content: "·";
  margin-left: 7px;
  color: #b8c6d1;
  font-weight: 400;
}

.start-record-score {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes start-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overlay--start.is-open .start-hero {
  animation: start-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.overlay--start.is-open .start-title {
  animation: start-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.06s both;
}

.overlay--start.is-open .start-sub {
  animation: start-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both;
}

.overlay--start.is-open .start-actions {
  animation: start-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.18s both;
}

.overlay--start.is-open .start-record {
  animation: start-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.26s both;
}

@media (prefers-reduced-motion: reduce) {
  .overlay--start.is-open .start-hero,
  .overlay--start.is-open .start-title,
  .overlay--start.is-open .start-sub,
  .overlay--start.is-open .start-actions,
  .overlay--start.is-open .start-record {
    animation: none;
  }
}

/* ---------- Einwilligung ---------- */

.overlay--consent {
  z-index: 120;
}

.overlay--consent .overlay-scrim {
  background: rgba(23, 33, 43, 0.42);
  backdrop-filter: blur(3px) saturate(0.92);
  -webkit-backdrop-filter: blur(3px) saturate(0.92);
}

.consent-shell {
  width: min(560px, 100%);
  opacity: 0;
  transform: translateY(12px) scale(0.99);
  transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .consent-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.consent-card {
  padding: 30px 32px 24px;
  border: 1px solid #e3eaf1;
  border-radius: 22px;
  background: #ffffff;
  color: #17212b;
  color-scheme: light;
  box-shadow: 0 10px 28px rgba(23, 33, 43, 0.10);
}

.consent-card .card-eyebrow {
  color: #7d92a6;
}

.consent-title {
  margin: 0;
  color: #17212b;
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.consent-text {
  margin: 10px 0 0;
  color: #5f7080;
  font-size: 13px;
  line-height: 1.65;
}

.consent-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0 -10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #477da8;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.consent-more span {
  font-size: 15px;
  line-height: 1;
}

.consent-more:hover {
  background: rgba(71, 125, 168, 0.07);
  color: #3b6b92;
}

.consent-more:focus-visible {
  outline: 2px solid #8ab6d6;
  outline-offset: 2px;
}

.consent-details {
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid #e6edf3;
  border-radius: 14px;
  background: #f7fafc;
}

.consent-detail + .consent-detail {
  margin-top: 12px;
}

.consent-detail strong {
  color: #263744;
  font-size: 11px;
  font-weight: 650;
}

.consent-detail p {
  margin: 3px 0 0;
  color: #718096;
  font-size: 11px;
  line-height: 1.6;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: #47596a;
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
}

.consent-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #477da8;
}

.consent-continue {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 20px;
}

.consent-storage-hint {
  min-height: 13px;
  margin: 8px 0 0;
  color: #a87057;
  font-size: 9.5px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- Levelauswahl ---------- */

.levels-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(920px, 100%);
  max-height: calc(100dvh - 36px);
}

.levels-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 28px 24px;
  border: 1px solid rgba(31, 44, 54, 0.07);
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef6fa 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.42),
    0 3px 8px rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
  scrollbar-color: #c9dce7 transparent;
}

.levels-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.levels-back {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0 0 2px;
  border: 1px solid #dce8ef;
  border-radius: 50%;
  background: #ffffff;
  color: #668095;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.levels-back:hover {
  border-color: #b7dcef;
  background: #f4fbff;
  color: #2f7c9e;
}

.levels-back:focus-visible {
  outline: 2px solid #70bde5;
  outline-offset: 2px;
}

.levels-head .card-eyebrow {
  margin: 0 0 2px;
}

.levels-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.levels-count {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid #dce8ef;
  border-radius: 999px;
  background: #ffffff;
  color: #7c93a3;
  font-size: 9px;
  white-space: nowrap;
}

.level-path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 25px 0 17px;
}

.level-path::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 4px;
  left: 50%;
  border-left: 2px dashed #cfe0e9;
  transform: translateX(-50%);
}

.level-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: min(360px, 47%);
  padding: 12px 13px;
  border: 1px solid #e1ebf1;
  border-radius: 14px;
  background: #ffffff;
  color: #22384a;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(31, 72, 97, 0.045);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.level-node:nth-child(odd) {
  align-self: flex-start;
}

.level-node:nth-child(even) {
  align-self: flex-end;
}

.level-node:hover {
  border-color: #b7dcef;
  background: #f8fdff;
  box-shadow: 0 10px 22px rgba(52, 137, 186, 0.10);
  transform: translateY(-1px);
}

.level-node:focus-visible {
  outline: 2px solid #70bde5;
  outline-offset: 2px;
}

.level-node--tutorial {
  border-color: #c7e9df;
  background: linear-gradient(180deg, #ffffff, #f3fbf8);
}

.level-node--locked {
  background: #fbfdfe;
}

.level-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eef8fd;
  color: #4d94b8;
}

.level-node--tutorial .level-icon {
  background: #e9f8f3;
  color: #248c73;
}

.level-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.level-copy {
  min-width: 0;
  flex: 1;
}

.level-node-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.level-number {
  flex: 0 0 auto;
  color: #94a7b3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-name {
  overflow: hidden;
  color: #20394b;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-focus {
  display: block;
  margin-top: 3px;
  color: #7d93a2;
  font-size: 10px;
  line-height: 1.4;
}

.level-status {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.level-status--playable {
  border: 1px solid #ccece3;
  background: #effaf6;
  color: #248b73;
}

.level-status--locked {
  border: 1px solid #e6eef3;
  background: #f5f9fb;
  color: #9aadb9;
}

.free-play {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid #bce3da;
  border-radius: 15px;
  background: linear-gradient(120deg, #eefaf6 0%, #eef8fc 100%);
  color: #263b47;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(44, 132, 117, 0.07);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.free-play:hover {
  border-color: #86cfc0;
  background: linear-gradient(120deg, #e8faf4 0%, #e7f7fc 100%);
  transform: translateY(-1px);
}

.free-play:focus-visible {
  outline: 2px solid #4fc0b0;
  outline-offset: 2px;
}

.free-play-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: #ffffff;
  color: #24927a;
  box-shadow: inset 0 0 0 1px rgba(51, 150, 125, 0.12);
}

.free-play-icon svg {
  width: 22px;
  height: 22px;
}

.free-play-copy {
  min-width: 0;
  flex: 1;
}

.free-play-copy strong {
  display: block;
  color: #1e3b42;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.free-play-copy span {
  display: block;
  margin-top: 2px;
  color: #6e8a8b;
  font-size: 10px;
  line-height: 1.4;
}

.free-play-arrow {
  flex: 0 0 auto;
  color: #5fae9f;
  font-size: 17px;
}

.levels-toast {
  flex: 0 0 auto;
  min-height: 0;
  margin: 0 2px;
  color: #c0d1da;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- Freies Spiel: Modus ---------- */

.overlay--free-mode {
  z-index: 115;
}

.free-mode-shell {
  width: min(560px, 100%);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .free-mode-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.free-mode-card {
  padding: 28px 30px 24px;
  border: 1px solid rgba(31, 44, 54, 0.07);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.1);
}

.free-mode-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.free-mode-sub {
  margin: 9px 0 0;
  color: #7c8b97;
  font-size: 11.5px;
  line-height: 1.6;
}

.free-mode-options {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.free-mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #e1ebf1;
  border-radius: 12px;
  background: #ffffff;
  color: #263b47;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.free-mode-option:hover {
  border-color: #b7dcef;
  background: #f4fbff;
  transform: translateY(-1px);
}

.free-mode-option:focus-visible {
  outline: 2px solid #70bde5;
  outline-offset: 2px;
}

.free-mode-option-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #eef8fd;
  color: #388fae;
}

.free-mode-option-icon svg {
  width: 22px;
  height: 22px;
}

.free-mode-option strong {
  display: block;
  color: #20394b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.free-mode-option span span {
  display: block;
  margin-top: 2px;
  color: #8297a5;
  font-size: 10px;
}

.free-mode-inventory {
  margin: 14px 0 0;
  color: #8ba0ae;
  font-size: 9.5px;
  line-height: 1.4;
}

.free-mode-back {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #5f8aa2;
  font-family: var(--sans);
  font-size: 10px;
  cursor: pointer;
}

.free-mode-back:hover {
  color: #2f6e8b;
  text-decoration: underline;
}

/* ---------- Info-/App-/Support-Modal ---------- */

.overlay--menu-modal {
  z-index: 125;
}

.menu-modal-shell {
  width: min(560px, 100%);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .menu-modal-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.menu-modal-card {
  padding: 28px 30px 24px;
  border: 1px solid rgba(31, 44, 54, 0.07);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.1);
}

.menu-modal-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.menu-modal-body {
  margin-top: 12px;
  color: #6f8290;
  font-size: 11.5px;
  line-height: 1.65;
}

.menu-modal-body p {
  margin: 0 0 9px;
}

.menu-modal-body p:last-child {
  margin-bottom: 0;
}

.menu-modal-body strong {
  color: #304652;
  font-weight: 650;
}

.menu-modal-body ul {
  margin: 6px 0 0;
  padding-left: 17px;
}

.menu-modal-body li {
  margin-bottom: 4px;
}

.menu-modal-close {
  width: 100%;
  margin-top: 18px;
}

/* ---------- App-Installation ---------- */

.overlay--app {
  z-index: 128;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 3.6vh, 32px) 22px;
}

.overlay--app .overlay-scrim {
  background: rgba(12, 22, 29, 0.46);
  backdrop-filter: blur(4px) saturate(0.92);
  -webkit-backdrop-filter: blur(4px) saturate(0.92);
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(432px, 100%);
  margin: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .app-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-card {
  position: relative;
  padding: 26px 26px 24px;
  border: 1px solid rgba(31, 44, 54, 0.07);
  border-radius: 26px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.42),
    0 3px 8px rgba(0, 0, 0, 0.1);
}

.app-card:focus {
  outline: none;
}

.app-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 44, 54, 0.05);
  color: #7b8d9a;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.app-close:hover {
  background: rgba(31, 44, 54, 0.1);
  color: #3f5666;
}

.app-close:focus-visible {
  outline: 2px solid #477da8;
  outline-offset: 2px;
}

.app-close svg {
  width: 15px;
  height: 15px;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-right: 26px;
}

.app-icon {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 19px;
  background: #e6f4fd;
  box-shadow:
    0 0 0 1px rgba(31, 44, 54, 0.06),
    0 10px 22px rgba(45, 78, 100, 0.18);
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-head-copy {
  min-width: 0;
}

.app-kicker {
  margin: 0;
  color: #94a3b1;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.app-title {
  margin: 3px 0 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.app-meta {
  margin: 5px 0 0;
  color: #7b8d9a;
  font-size: 10.5px;
  line-height: 1.45;
}

.app-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid #e9eef2;
  border-bottom: 1px solid #e9eef2;
}

.app-fact span {
  display: block;
  color: #9aa9b5;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-fact strong {
  display: block;
  margin-top: 3px;
  color: #3f5666;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.app-description {
  margin: 15px 0 0;
  color: #6f8290;
  font-size: 12px;
  line-height: 1.65;
  text-wrap: pretty;
}

.app-steps {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #edf3f8;
  color: #5a6e7c;
  font-size: 10.5px;
  line-height: 1.55;
}

.app-steps-title {
  margin: 0 0 6px;
  color: #334b5c;
  font-size: 10.5px;
  font-weight: 650;
}

.app-steps ol {
  margin: 0;
  padding-left: 16px;
}

.app-steps li + li {
  margin-top: 4px;
}

.app-steps strong {
  color: #304652;
  font-weight: 650;
}

.app-install {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #477da8;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(71, 125, 168, 0.28);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease,
    opacity 0.18s ease;
}

.app-install:hover {
  background: #3f7099;
}

.app-install:active {
  transform: scale(0.985);
}

.app-install:focus-visible {
  outline: 2px solid #477da8;
  outline-offset: 3px;
}

.app-install:disabled {
  cursor: default;
  opacity: 0.62;
  box-shadow: none;
}

.app-install svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.app-install-check {
  display: none;
}

.app-install.is-installed {
  background: #2f7d5a;
  box-shadow: 0 8px 18px rgba(47, 125, 90, 0.24);
  opacity: 1;
}

.app-install.is-installed .app-install-check {
  display: block;
}

.app-install.is-installed .app-install-download {
  display: none;
}

.app-status {
  min-height: 16px;
  margin: 10px 0 0;
  color: #7b8d9a;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

@media (max-width: 420px) {
  .overlay--app {
    padding: 12px;
  }

  .app-card {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  .app-head {
    gap: 12px;
    padding-right: 24px;
  }

  .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .app-title {
    font-size: 20px;
  }

  .app-facts {
    gap: 6px;
  }

  .app-fact strong {
    font-size: 10.5px;
  }
}

@media (max-height: 560px) {
  .overlay--app {
    padding: 10px 18px;
  }

  .app-card {
    padding: 20px 22px 18px;
  }

  .app-head {
    gap: 12px;
  }

  .app-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
  }

  .app-facts {
    margin-top: 13px;
    padding: 9px 0;
  }

  .app-description {
    margin-top: 11px;
  }

  .app-install {
    min-height: 44px;
    margin-top: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell {
    transition: none;
  }
}

/* ---------- Info / Rechtliches ---------- */

.overlay--info {
  z-index: 129;
  align-items: center;
  overflow: hidden;
  padding: clamp(14px, 3.6vh, 32px) 22px;
}

.overlay--info .overlay-scrim {
  background: rgba(12, 22, 29, 0.46);
  backdrop-filter: blur(4px) saturate(0.92);
  -webkit-backdrop-filter: blur(4px) saturate(0.92);
}

.info-shell {
  position: relative;
  z-index: 2;
  width: min(600px, 100%);
  margin: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .info-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.info-card {
  position: relative;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 28px 24px;
  border: 1px solid rgba(31, 44, 54, 0.07);
  border-radius: 26px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.42),
    0 3px 8px rgba(0, 0, 0, 0.1);
}

.info-card:focus {
  outline: none;
}

.info-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fbfcfb;
  color: #7b8d9a;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(31, 44, 54, 0.05),
    0 4px 12px rgba(31, 44, 54, 0.14);
  transition: background 0.18s ease, color 0.18s ease;
}

.info-close:hover {
  background: #f1f5f8;
  color: #3f5666;
}

.info-close:focus-visible {
  outline: 2px solid #477da8;
  outline-offset: 2px;
}

.info-close svg {
  width: 15px;
  height: 15px;
}

.info-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 42px;
}

.info-portrait {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #f7ead4 0%, #f0dcb6 100%);
  box-shadow:
    0 0 0 1px rgba(31, 44, 54, 0.06),
    0 10px 22px rgba(45, 78, 100, 0.16);
}

.info-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 2%;
}

.info-head-copy {
  min-width: 0;
}

.info-kicker {
  margin: 0;
  color: #94a3b1;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.info-title {
  margin: 3px 0 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.info-meta {
  margin: 5px 0 0;
  color: #7b8d9a;
  font-size: 10.5px;
  line-height: 1.45;
}

.info-intro {
  margin-top: 18px;
  color: #6f8290;
  font-size: 12px;
  line-height: 1.68;
  text-wrap: pretty;
}

.info-intro p {
  margin: 0 0 10px;
}

.info-intro p:last-child {
  margin-bottom: 0;
}

.info-signature {
  color: #40566a;
  font-weight: 600;
}

.info-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.26);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.info-share:hover {
  background: #1fbe5b;
}

.info-share:active {
  transform: scale(0.985);
}

.info-share:focus-visible {
  outline: 2px solid #1fbe5b;
  outline-offset: 3px;
}

.info-share svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.info-legal {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e9eef2;
}

.info-legal-kicker {
  margin: 0 0 4px;
  color: #94a3b1;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.legal-doc {
  border-bottom: 1px solid #e9eef2;
}

.legal-doc:last-of-type {
  border-bottom: 0;
}

.legal-doc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  color: #334b5c;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.legal-doc summary::-webkit-details-marker {
  display: none;
}

.legal-doc summary:hover {
  color: #1e2c36;
}

.legal-doc summary:focus-visible {
  outline: 2px solid #477da8;
  outline-offset: 2px;
  border-radius: 4px;
}

.legal-chevron {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #94a3b1;
  transition: transform 0.2s ease;
}

.legal-doc[open] .legal-chevron {
  transform: rotate(180deg);
}

.legal-doc-body {
  padding: 0 0 14px;
  color: #6f8290;
  font-size: 11px;
  line-height: 1.62;
  text-wrap: pretty;
}

.legal-doc-body h3 {
  margin: 14px 0 6px;
  color: #304652;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.legal-doc-body h3:first-child {
  margin-top: 2px;
}

.legal-doc-body p {
  margin: 0 0 8px;
}

.legal-doc-body ul {
  margin: 0 0 8px;
  padding-left: 16px;
}

.legal-doc-body li {
  margin-bottom: 3px;
}

.legal-doc-body a {
  color: #477da8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef3f7;
  color: #40566a;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
}

.legal-note {
  color: #40566a;
  font-weight: 600;
}

.info-close-bottom {
  width: 100%;
  margin-top: 18px;
}

@media (max-width: 420px) {
  .overlay--info {
    padding: 12px;
  }

  .info-card {
    max-height: calc(100dvh - 24px);
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  .info-head {
    gap: 12px;
    padding-right: 40px;
  }

  .info-portrait {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .info-title {
    font-size: 20px;
  }

  .info-intro {
    margin-top: 14px;
    font-size: 11.5px;
  }

  .legal-doc summary {
    font-size: 11.5px;
  }

  .legal-doc-body {
    font-size: 10.5px;
  }
}

@media (max-height: 560px) {
  .overlay--info {
    padding: 10px 18px;
  }

  .info-card {
    max-height: calc(100dvh - 20px);
    padding: 20px 22px 18px;
  }

  .info-head {
    gap: 12px;
  }

  .info-portrait {
    width: 60px;
    height: 60px;
    border-radius: 15px;
  }

  .info-intro {
    margin-top: 12px;
  }

  .info-share {
    min-height: 44px;
    margin-top: 14px;
  }

  .info-legal {
    margin-top: 16px;
    padding-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-shell {
    transition: none;
  }
}


/* ---------- Freispiel-HUD ---------- */

.battle-free-hud {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-left: auto;
}

.battle-free-hud[hidden] {
  display: none;
}

.battle-free-mode {
  padding: 4px 8px;
  border: 1px solid #d9eef7;
  border-radius: 999px;
  background: #eef9ff;
  color: #2d7899;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.battle-free-chip {
  padding: 4px 8px;
  border: 1px solid #e2ebf0;
  border-radius: 999px;
  background: #ffffff;
  color: #6d8493;
  font-size: 8px;
  white-space: nowrap;
}

/* ---------- Lauf-HUD, Level-Atmosphäre, Kaffee ---------- */

.level-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      ellipse at 50% 50%,
      color-mix(in srgb, var(--level-accent, #9dbb9f) 9%, transparent) 0%,
      transparent 42%,
      color-mix(in srgb, var(--level-accent, #9dbb9f) 26%, transparent) 100%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--level-accent, #9dbb9f) 13%, transparent) 0%,
      transparent 42%,
      color-mix(in srgb, var(--level-accent, #9dbb9f) 20%, transparent) 100%
    );
  transition: opacity 0.9s ease;
  mix-blend-mode: screen;
}

.level-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--level-accent, #9dbb9f);
  opacity: 0.13;
  mix-blend-mode: color;
}

body.level-active .level-atmosphere {
  opacity: 0.92;
}

.run-hud {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(226px, calc(100% - 40px));
  padding: 9px 11px 8px;
  border: 1px solid rgba(232, 238, 230, 0.12);
  border-radius: 13px;
  background:
    radial-gradient(circle at 25% 10%, rgba(232, 192, 122, 0.06), transparent 65%),
    rgba(5, 10, 8, 0.58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  color: rgba(232, 238, 230, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.run-hud.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

body.modal-open .run-hud {
  opacity: 0 !important;
  visibility: hidden !important;
  transition-delay: 0s !important;
}

.run-level {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.run-level-kicker {
  flex: 0 0 auto;
  color: rgba(232, 192, 122, 0.72);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.run-level strong {
  overflow: hidden;
  color: rgba(248, 244, 235, 0.82);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-hp-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.run-hp-label {
  color: rgba(232, 238, 230, 0.34);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.run-hp-track {
  position: relative;
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.run-hp-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eaf93, #9bd6b9);
  transition: width 0.4s ease;
}

.run-hp-text {
  flex: 0 0 auto;
  color: rgba(232, 238, 230, 0.48);
  font-size: 7.5px;
  white-space: nowrap;
}

#run-hp-text {
  flex: 0 0 auto;
  color: rgba(232, 238, 230, 0.48);
  font-size: 7.5px;
  white-space: nowrap;
}

.run-enemies {
  color: rgba(232, 192, 122, 0.45);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.inv-items {
  max-width: min(520px, calc(100vw - 56px));
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 192, 122, 0.22) transparent;
}

.overlay--coffee {
  z-index: 110;
}

.overlay--coffee .overlay-scrim {
  background: rgba(2, 5, 4, 0.80);
  backdrop-filter: blur(9px) saturate(0.84);
  -webkit-backdrop-filter: blur(9px) saturate(0.84);
}

.coffee-shell {
  width: min(400px, 100%);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .coffee-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.coffee-card {
  width: 100%;
  padding: 28px 30px 22px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.coffee-portrait {
  display: grid;
  place-items: center;
  width: 102px;
  height: 102px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 32%, #fff7ed 0%, #f3e5d3 64%, #e8d6c0 100%);
  color: #93603b;
  box-shadow:
    inset 0 0 0 1px rgba(147, 96, 59, 0.12),
    0 15px 28px rgba(112, 76, 44, 0.14);
}

.coffee-portrait svg {
  width: 56px;
  height: 56px;
}

.coffee-card .card-eyebrow {
  margin-bottom: 8px;
  text-align: center;
}

.coffee-title {
  margin: 0;
  color: #263238;
  font-family: var(--sans);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.coffee-text {
  margin: 10px 0 0;
  color: #76838b;
  font-size: 12px;
  line-height: 1.6;
}

.coffee-hp {
  margin: 8px 0 0;
  color: #5d7b68;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.coffee-continue {
  width: 100%;
  margin-top: 17px;
}

.coffee-footnote {
  margin: 12px 0 0;
  color: #b0bbc3;
  font-size: 8.5px;
  letter-spacing: 0.03em;
}
.level-status--completed {
  border: 1px solid #cfe8df;
  background: #eef9f4;
  color: #277d67;
}

.level-node--completed {
  border-color: #d9ebe4;
  background: linear-gradient(180deg, #ffffff, #f6fbf8);
}

.level-node--completed .level-icon {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--level-accent, #67b5c8) 28%, transparent);
}

#diplo-left stop:first-child {
  stop-color: var(--germ-a, #b06a88);
}

#diplo-left stop:nth-child(2) {
  stop-color: var(--germ-b, #713f60);
}

#diplo-right stop:first-child {
  stop-color: var(--germ-a, #a05b7c);
}

#diplo-right stop:nth-child(2) {
  stop-color: var(--germ-b, #633854);
}

@media (max-width: 720px) {
  .run-hud {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    width: min(204px, calc(100% - 22px));
    padding: 7px 9px;
  }

  .run-level-kicker {
    font-size: 6.5px;
  }

  .run-level strong {
    font-size: 9.5px;
  }

  .run-hp-label,
  #run-hp-text,
  .run-enemies {
    font-size: 6.5px;
  }

  .coffee-card {
    padding: 24px 22px 20px;
  }

  .coffee-portrait {
    width: 88px;
    height: 88px;
    margin-bottom: 12px;
  }

  .coffee-portrait svg {
    width: 48px;
    height: 48px;
  }

  .coffee-title {
    font-size: 22px;
  }

  .inv-items {
    max-width: calc(100vw - 28px);
  }
}

@media (max-height: 520px) {
  .coffee-card {
    padding: 18px 24px 14px;
  }

  .coffee-portrait {
    width: 66px;
    height: 66px;
    margin-bottom: 8px;
  }

  .coffee-portrait svg {
    width: 38px;
    height: 38px;
  }

  .coffee-title {
    font-size: 20px;
  }

  .coffee-text {
    margin-top: 6px;
    font-size: 10.5px;
  }

  .coffee-continue {
    margin-top: 12px;
  }

  .coffee-footnote {
    display: none;
  }
}
/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .battle-shell {
    max-height: calc(100dvh - 24px);
    padding: 8px;
    border-radius: 18px;
  }

  .battle-top {
    gap: 8px;
    padding: 2px 3px 8px;
  }

  .battle-kicker {
    font-size: 8px;
  }

  .battle-context {
    font-size: 10px;
  }

  .battle-round {
    padding: 4px 8px;
    font-size: 9px;
  }

  .battle-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .battle-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
    padding: 9px;
    border-radius: 16px;
  }

  .battle-enemy-card {
    position: static;
    width: 100%;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .battle-enemy-avatar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .battle-enemy-avatar svg {
    width: 34px;
  }

  .battle-name-line strong {
    font-size: 12.5px;
  }

  .battle-name-line > span {
    font-size: 8.5px;
  }

  .battle-enemy-sub {
    margin: 1px 0 5px;
    font-size: 8.5px;
  }

  .hp-track {
    height: 5px;
  }

  .battle-card-foot {
    margin-top: 5px;
  }

  .battle-tag {
    padding: 1px 6px;
    font-size: 7.5px;
  }

  .battle-hp-value {
    font-size: 8px;
  }

  .battle-arena {
    position: relative;
    inset: auto;
    width: 100%;
    height: 136px;
    padding: 0 10px;
  }

  .battle-fighter--player {
    width: 32%;
    max-width: 130px;
  }

  .battle-fighter--player img {
    height: 108px;
  }

  .battle-fighter--enemy {
    width: 48%;
    max-width: 190px;
  }

  .diplococcus-art {
    width: min(168px, 100%);
    max-height: 140px;
  }

  .battle-fighter::after {
    bottom: -3px;
    height: 10px;
  }

  .battle-bottom {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .battle-message-box {
    width: 100%;
    padding: 8px 12px 9px;
    border-radius: 10px;
  }

  .battle-message-label {
    margin-bottom: 2px;
    font-size: 7px;
  }

  .battle-message {
    font-size: 13px;
    line-height: 1.3;
  }

  .battle-player-card {
    width: 100%;
    flex: none;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .battle-player-card .battle-name-line strong {
    font-size: 12.5px;
  }

  .battle-effect-banner {
    width: calc(100% - 20px);
    padding: 10px 12px;
    gap: 9px;
    border-radius: 13px;
  }

  .battle-effect-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 18px;
  }

  .battle-effect-copy strong {
    font-size: 16px;
  }

  .battle-effect-copy > span {
    font-size: 9px;
  }

  .battle-damage {
    font-size: 24px;
  }

  .battle-actions {
    padding: 10px;
    border-radius: 16px;
  }

  .battle-actions-head h3 {
    font-size: 19px;
  }

  .battle-action-status {
    padding: 3px 7px;
    font-size: 7.5px;
  }

  .battle-command-hint {
    margin: 5px 0 9px;
    font-size: 9px;
    line-height: 1.4;
  }

  .battle-antibiotics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .antibiotic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 7px;
    border-radius: 10px;
    text-align: center;
  }

  .antibiotic-iconframe {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .antibiotic-iconframe .pill-icon {
    --pw: 22px;
  }

  .antibiotic-info {
    width: 100%;
    text-align: center;
  }

  .antibiotic-name {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }

  .antibiotic-class {
    display: none;
  }

  .antibiotic-meta {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
  }

  .antibiotic-status {
    font-size: 7px;
  }

  .battle-wait {
    margin-top: 2px;
    padding: 8px 10px;
    gap: 9px;
  }

  .battle-wait-icon {
    width: 34px;
    height: 34px;
  }

  .battle-wait-copy strong {
    font-size: 11.5px;
  }

  .battle-wait-copy span {
    font-size: 8.5px;
  }

  .battle-disclaimer {
    padding-top: 7px;
    font-size: 7px;
  }

  .battle-result-card {
    padding: 22px 18px 20px;
  }

  .battle-result-title {
    font-size: 27px;
  }

  .battle-result-text {
    font-size: 11.5px;
  }

  .battle-result-actions {
    margin-top: 16px;
  }
}

@media (min-width: 761px) and (max-width: 920px) {
  .battle-arena {
    height: 156px;
    padding: 0 18px;
  }

  .battle-fighter--player img {
    height: 140px;
  }

  .diplococcus-art {
    width: 224px;
    max-height: 192px;
  }

  .battle-message {
    font-size: 14px;
  }

  .battle-message-label {
    font-size: 7.5px;
  }

  .battle-player-card .battle-name-line strong {
    font-size: 13px;
  }

  .battle-enemy-sub {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .intro {
    top: 9vh;
    width: calc(100% - 40px);
  }

  .intro-kicker {
    margin-bottom: 9px;
    font-size: 9px;
    letter-spacing: 0.28em;
  }

  .intro-title {
    font-size: clamp(22px, 7.2vw, 30px);
  }

  .intro-sub {
    margin-top: 9px;
    font-size: 12px;
  }

  .intro-guide {
    margin-top: 13px;
    font-size: 9px;
    letter-spacing: 0.22em;
  }

  .overlay {
    padding: 12px;
  }

  .name-shell {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .name-card {
    padding: 26px 20px 22px;
    border-radius: 20px;
  }

  .name-portrait {
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
  }

  .name-portrait img {
    height: 60px;
  }

  .name-title {
    font-size: 28px;
  }

  .name-sub {
    font-size: 11.5px;
  }

  .name-form {
    margin-top: 18px;
  }

  .name-field {
    padding: 10px 12px;
  }

  .name-field input {
    font-size: 16px;
  }

  .name-footnote {
    margin-top: 12px;
  }

  .found-shell {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .found-card {
    padding: 24px 20px 20px;
    border-radius: 20px;
  }

  .found-portrait {
    width: 96px;
    height: 96px;
    margin-bottom: 14px;
  }

  .pill-icon--found {
    --pw: 66px;
  }

  .found-title {
    font-size: 24px;
  }

  .found-text {
    font-size: 11.5px;
  }

  .battle-search-input {
    height: 34px;
  }

  .battle-arena {
    height: 128px;
  }

  .battle-wait {
    padding: 7px 10px;
  }

  .drug-shell {
    max-height: calc(100dvh - 24px);
    gap: 12px;
  }

  .drug-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .drug-card {
    padding: 24px 20px 22px;
    border-radius: 20px;
  }

  .status-chip {
    top: 18px;
    right: 18px;
  }

  .drug-portrait {
    width: 128px;
    height: 128px;
    margin-bottom: 20px;
  }

  .pill-icon--hero {
    --pw: 100px;
  }

  .card-eyebrow {
    font-size: 8.5px;
  }

  .drug-title {
    font-size: 30px;
  }

  .drug-sub {
    margin-top: 6px;
    font-size: 11.5px;
  }

  .drug-description {
    margin-top: 13px;
    font-size: 12px;
  }

  .card-divider {
    margin: 19px 0 4px;
  }

  .profile-row {
    grid-template-columns: 22px 90px minmax(0, 1fr);
    gap: 9px;
    padding: 11px 0;
  }

  .profile-label {
    font-size: 11px;
  }

  .profile-value {
    font-size: 11.5px;
  }

  .literature-title {
    font-size: 25px;
  }

  .literature-sub {
    font-size: 11.5px;
  }

  .drug-actions {
    gap: 10px;
    padding: 0 2px;
  }

  .drug-footnote {
    display: none;
  }

  .pubmed-jump {
    display: inline-flex;
  }

  .btn-primary {
    min-width: 108px;
    padding: 12px 22px;
  }

  .completion-card {
    padding: 27px 20px 20px;
    border-radius: 20px;
  }

  .completion-emblem {
    width: 72px;
    height: 72px;
    margin-bottom: 13px;
    font-size: 32px;
  }

  .completion-title {
    font-size: 38px;
  }

  .completion-text {
    font-size: 12.5px;
  }

  .completion-stats {
    margin-top: 19px;
  }

  .completion-stat {
    padding: 11px 5px;
  }

  .completion-stat span {
    font-size: 7px;
  }

  .completion-stat strong {
    font-size: 14px;
  }

  .completion-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 18px;
  }

  .completion-actions .btn-primary,
  .completion-secondary {
    width: 100%;
  }

  .completion-secondary {
    order: 2;
  }

  .completion-footnote {
    margin-top: 10px;
  }

  .encounter {
    bottom: 172px;
    width: calc(100% - 32px);
    padding: 12px 15px 13px;
    font-size: 12px;
  }

  .inventory {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
  }

  .inv-items {
    gap: 7px;
  }

  .inv-slot {
    width: 50px;
    height: 50px;
    border-radius: 12px;
  }

  .inv-slot .pill-icon {
    --pw: 29px;
  }

  .inv-name {
    max-width: 54px;
    font-size: 7.5px;
  }
}

@media (max-width: 380px) {
  .found-card {
    padding: 22px 16px 18px;
  }

  .found-portrait {
    width: 84px;
    height: 84px;
  }

  .pill-icon--found {
    --pw: 58px;
  }

  .found-title {
    font-size: 22px;
  }

  .found-text {
    font-size: 11px;
  }

  .found-footnote {
    display: none;
  }

  .name-card {
    padding: 22px 16px 18px;
  }

  .name-title {
    font-size: 25px;
  }

  .name-portrait {
    width: 68px;
    height: 68px;
  }

  .name-portrait img {
    height: 54px;
  }

  .name-sub {
    font-size: 11px;
  }

  .name-field input {
    font-size: 15px;
  }

  .name-footnote {
    display: none;
  }

  .battle-shell {
    padding: 6px;
    border-radius: 16px;
  }

  .battle-context {
    display: none;
  }

  .battle-kicker {
    font-size: 7.5px;
  }

  .battle-round {
    padding: 3px 7px;
    font-size: 8px;
  }

  .battle-field {
    gap: 6px;
    padding: 8px;
  }

  .battle-enemy-card {
    padding: 7px 8px;
    gap: 7px;
  }

  .battle-enemy-avatar {
    width: 34px;
    height: 34px;
  }

  .battle-enemy-avatar svg {
    width: 30px;
  }

  .battle-name-line strong {
    font-size: 11.5px;
  }

  .battle-enemy-sub {
    font-size: 8px;
  }

  .battle-tag {
    padding: 1px 5px;
    font-size: 7px;
  }

  .battle-arena {
    height: 118px;
    padding: 0 7px;
  }

  .battle-fighter--player img {
    height: 94px;
  }

  .diplococcus-art {
    width: min(145px, 100%);
    max-height: 120px;
  }

  .battle-message-box {
    padding: 7px 10px 8px;
  }

  .battle-message-label {
    font-size: 6.5px;
  }

  .battle-message {
    font-size: 12px;
  }

  .battle-player-card {
    padding: 7px 9px;
  }

  .battle-player-card .battle-name-line strong {
    font-size: 11.5px;
  }

  .battle-effect-banner {
    width: calc(100% - 16px);
    padding: 8px 10px;
    gap: 8px;
  }

  .battle-effect-mark {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .battle-effect-copy strong {
    font-size: 14.5px;
  }

  .battle-effect-copy > span {
    font-size: 8.5px;
  }

  .battle-actions {
    padding: 9px;
  }

  .battle-actions-head h3 {
    font-size: 18px;
  }

  .battle-command-hint {
    font-size: 8.5px;
  }

  .antibiotic-name {
    font-size: 9.5px;
  }

  .antibiotic-iconframe {
    width: 28px;
    height: 28px;
  }

  .antibiotic-iconframe .pill-icon {
    --pw: 20px;
  }

  .antibiotic-status {
    font-size: 6.5px;
  }

  .battle-wait-copy strong {
    font-size: 11px;
  }

  .battle-wait-copy span {
    font-size: 8px;
  }

  .battle-disclaimer {
    display: none;
  }

  .battle-result-title {
    font-size: 24px;
  }
  .drug-card {
    padding: 22px 16px 20px;
  }

  .status-chip {
    top: 14px;
    right: 14px;
  }

  .drug-portrait {
    width: 108px;
    height: 108px;
    margin-bottom: 17px;
  }

  .pill-icon--hero {
    --pw: 84px;
  }

  .profile-row {
    grid-template-columns: 20px 82px minmax(0, 1fr);
    gap: 8px;
  }

  .literature-title {
    font-size: 23px;
  }

  .drug-footnote {
    max-width: 110px;
  }
}

@media (max-height: 520px) {
  .found-card {
    padding: 18px 24px 16px;
  }

  .found-portrait {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
  }

  .pill-icon--found {
    --pw: 50px;
  }

  .found-title {
    font-size: 22px;
  }

  .found-name {
    font-size: 12px;
  }

  .found-text {
    margin-top: 9px;
    font-size: 11px;
  }

  .found-view {
    margin-top: 10px;
  }

  .found-footnote {
    display: none;
  }

  .name-card {
    padding: 20px 24px 18px;
  }

  .name-portrait {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
  }

  .name-portrait img {
    height: 50px;
  }

  .name-title {
    font-size: 25px;
  }

  .name-sub {
    margin-top: 6px;
    font-size: 11px;
  }

  .name-form {
    margin-top: 10px;
  }

  .name-field {
    padding: 8px 12px;
  }

  .name-submit {
    margin-top: 10px;
  }

  .name-footnote {
    margin-top: 9px;
  }

  .drug-shell {
    max-height: calc(100dvh - 20px);
    gap: 9px;
  }

  .drug-card {
    padding: 20px 24px 18px;
  }

  .drug-portrait {
    width: 94px;
    height: 94px;
    margin-bottom: 13px;
  }

  .pill-icon--hero {
    --pw: 74px;
  }

  .portrait-ring {
    inset: -7px;
  }

  .status-chip {
    top: 16px;
    right: 18px;
  }

  .drug-title {
    font-size: 27px;
  }

  .drug-description {
    margin-top: 9px;
  }

  .card-divider {
    margin: 13px 0 3px;
  }

  .profile-row {
    padding: 7px 0;
  }

  .literature-title {
    font-size: 23px;
  }

  .pubmed-results {
    min-height: 80px;
  }

  .pubmed-item {
    padding: 8px 0;
  }

  .drug-actions {
    padding: 0;
  }

  .drug-footnote {
    font-size: 9px;
  }

  .completion-card {
    max-height: calc(100dvh - 20px);
    padding: 18px 24px 15px;
    border-radius: 18px;
  }

  .completion-emblem {
    width: 58px;
    height: 58px;
    margin-bottom: 9px;
    font-size: 26px;
  }

  .completion-title {
    font-size: 32px;
  }

  .completion-text {
    margin-top: 7px;
    font-size: 11.5px;
  }

  .completion-stats {
    margin-top: 13px;
  }

  .completion-stat {
    padding: 8px 5px;
  }

  .completion-actions {
    margin-top: 13px;
  }

  .completion-footnote {
    margin-top: 9px;
  }
}

@media (max-height: 520px) and (min-width: 761px) {
  .battle-shell {
    max-height: calc(100dvh - 16px);
    padding: 8px;
    border-radius: 16px;
  }

  .battle-top {
    padding-bottom: 6px;
  }

  .battle-context {
    display: none;
  }

  .battle-layout {
    grid-template-columns: minmax(0, 1fr) 276px;
    gap: 8px;
  }

  .battle-field {
    display: block;
    min-height: 330px;
    padding: 0;
  }

  .battle-enemy-card {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    width: min(300px, calc(100% - 20px));
    padding: 8px 10px;
    gap: 8px;
  }

  .battle-enemy-avatar {
    width: 38px;
    height: 38px;
  }

  .battle-enemy-avatar svg {
    width: 34px;
  }

  .battle-name-line strong {
    font-size: 12.5px;
  }

  .battle-name-line > span {
    font-size: 8.5px;
  }

  .battle-enemy-sub {
    margin-bottom: 5px;
    font-size: 8.5px;
  }

  .battle-tag {
    padding: 1px 6px;
    font-size: 7.5px;
  }

  .battle-hp-value {
    font-size: 8px;
  }

  .battle-arena {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    padding: 60px 24px 112px;
  }

  .battle-fighter--player img {
    height: 140px;
  }

  .diplococcus-art {
    width: 210px;
    max-height: 190px;
  }

  .battle-bottom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    width: auto;
    gap: 8px;
  }

  .battle-message-box {
    flex: 1;
    width: auto;
    padding: 8px 12px;
  }

  .battle-message-label {
    font-size: 7px;
  }

  .battle-message {
    font-size: 13px;
  }

  .battle-player-card {
    flex: 0 0 214px;
    width: auto;
    padding: 8px 10px;
  }

  .battle-player-card .battle-name-line strong {
    font-size: 12.5px;
  }

  .battle-effect-banner {
    width: min(340px, calc(100% - 24px));
    padding: 9px 12px;
    gap: 9px;
  }

  .battle-effect-mark {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .battle-effect-copy strong {
    font-size: 17px;
  }

  .battle-effect-copy > span {
    font-size: 9px;
  }

  .battle-actions {
    padding: 10px;
  }

  .battle-actions-head h3 {
    font-size: 18px;
  }

  .battle-action-status {
    padding: 3px 7px;
    font-size: 8px;
  }

  .battle-command-hint {
    display: none;
  }

  .battle-antibiotics {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .antibiotic-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 8px;
  }

  .antibiotic-iconframe {
    width: 32px;
    height: 32px;
  }

  .antibiotic-iconframe .pill-icon {
    --pw: 22px;
  }

  .antibiotic-info {
    width: auto;
    text-align: left;
  }

  .antibiotic-name {
    font-size: 11.5px;
    white-space: nowrap;
  }

  .antibiotic-class {
    display: block;
    font-size: 9px;
  }

  .antibiotic-meta {
    flex-direction: row;
    align-items: center;
    margin-top: 2px;
  }

  .battle-wait {
    padding: 6px 8px;
    gap: 8px;
  }

  .battle-wait-icon {
    width: 30px;
    height: 30px;
  }

  .battle-wait-copy strong {
    font-size: 10.5px;
  }

  .battle-wait-copy span {
    font-size: 8px;
  }

  .battle-disclaimer {
    display: none;
  }

  .battle-result-card {
    padding: 18px;
  }

  .battle-result-title {
    font-size: 24px;
  }
}
@media (pointer: coarse) and (max-height: 520px) {
  .encounter {
    bottom: 152px;
    width: min(560px, calc(100% - 32px));
  }
}

@media (max-width: 760px) {
  .consent-shell {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .start-hero {
    height: 150px;
  }

  .start-hero-halo {
    top: -28px;
    width: 232px;
    height: 232px;
  }

  .start-hero img {
    height: 242px;
    margin-top: 8px;
  }

  .start-title {
    margin-top: 6px;
    font-size: 33px;
  }

  .start-sub {
    max-width: 302px;
    margin-top: 9px;
    font-size: 12.5px;
  }

  .start-actions {
    gap: 8px;
    margin-top: 20px;
  }

  .start-play {
    min-height: 48px;
    font-size: 13.5px;
  }

  .start-secondary {
    min-height: 44px;
    font-size: 11px;
  }

  .start-support {
    min-height: 42px;
    font-size: 11px;
  }

  .start-record {
    margin-top: 16px;
  }

  .consent-card {
    padding: 24px 20px 20px;
    border-radius: 20px;
  }

  .consent-title {
    font-size: 26px;
  }

  .consent-text {
    font-size: 11.5px;
  }

  .consent-detail p {
    font-size: 10px;
  }

  .levels-shell {
    max-height: calc(100dvh - 24px);
  }

  .levels-panel {
    padding: 18px 14px 18px;
    border-radius: 20px;
  }

  .levels-head {
    gap: 9px;
  }

  .levels-title {
    font-size: 22px;
  }

  .levels-count {
    display: none;
  }

  .level-path {
    gap: 11px;
    padding: 18px 0 14px;
  }

  .level-path::before {
    left: 17px;
  }

  .level-node {
    width: calc(100% - 32px);
    margin-left: 32px;
    padding: 10px 11px;
    gap: 9px;
  }

  .level-node:nth-child(odd),
  .level-node:nth-child(even) {
    align-self: stretch;
  }

  .level-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .level-icon svg {
    width: 19px;
    height: 19px;
  }

  .level-name {
    font-size: 11.5px;
    white-space: normal;
  }

  .level-focus {
    font-size: 9.5px;
  }

  .level-status {
    font-size: 6.5px;
    padding: 2px 5px;
  }

  .free-play {
    gap: 10px;
    padding: 11px 12px;
  }

  .free-play-icon {
    width: 38px;
    height: 38px;
  }

  .free-play-copy strong {
    font-size: 12px;
  }

  .free-play-copy span {
    font-size: 9.5px;
  }

  .free-mode-shell,
  .menu-modal-shell {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .free-mode-card,
  .menu-modal-card {
    padding: 24px 20px 20px;
    border-radius: 20px;
  }

  .free-mode-title,
  .menu-modal-title {
    font-size: 24px;
  }

  .free-mode-sub {
    font-size: 11px;
  }

  .free-mode-option {
    padding: 11px;
  }

  .free-mode-option-icon {
    width: 38px;
    height: 38px;
  }

  .menu-modal-body {
    font-size: 11px;
  }

  .battle-top {
    flex-wrap: wrap;
  }

  .battle-free-hud {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
  }

  .battle-free-mode,
  .battle-free-chip {
    font-size: 7.5px;
    padding: 3px 7px;
  }

  .battle-command-hint {
    display: none;
  }
}

@media (max-width: 380px) {
  .start-hero {
    height: 134px;
  }

  .start-hero-halo {
    top: -24px;
    width: 208px;
    height: 208px;
  }

  .start-hero img {
    height: 218px;
    margin-top: 6px;
  }

  .start-title {
    font-size: 29px;
  }

  .start-sub {
    font-size: 12px;
  }

  .start-actions {
    margin-top: 17px;
  }

  .start-secondary {
    gap: 5px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  .start-secondary svg {
    width: 14px;
    height: 14px;
  }

  .consent-title {
    font-size: 24px;
  }

  .levels-title {
    font-size: 20px;
  }

  .levels-panel {
    padding: 16px 11px 16px;
  }

  .level-node {
    width: calc(100% - 28px);
    margin-left: 28px;
    padding: 9px;
  }

  .level-path::before {
    left: 15px;
  }

  .level-icon {
    width: 32px;
    height: 32px;
  }

  .level-name {
    font-size: 11px;
  }

  .level-focus {
    font-size: 9px;
  }

  .free-mode-card,
  .menu-modal-card,
  .consent-card {
    padding: 20px 16px 18px;
  }

  .free-mode-title,
  .menu-modal-title {
    font-size: 22px;
  }
}

@media (max-height: 520px) {
  .consent-shell,
  .free-mode-shell,
  .menu-modal-shell {
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
  }

  .overlay--start {
    padding: 10px 22px;
  }

  .start-hero {
    height: 120px;
  }

  .start-hero-halo {
    top: -22px;
    width: 196px;
    height: 196px;
  }

  .start-hero img {
    height: 196px;
    margin-top: 4px;
  }

  .start-title {
    margin-top: 4px;
    font-size: 27px;
  }

  .start-sub {
    max-width: 292px;
    margin-top: 7px;
    font-size: 11.5px;
    line-height: 1.5;
  }

  .start-actions {
    margin-top: 14px;
    gap: 7px;
  }

  .start-play {
    min-height: 42px;
  }

  .start-secondary {
    min-height: 38px;
  }

  .start-support {
    min-height: 36px;
  }

  .start-record {
    margin-top: 12px;
    padding-top: 10px;
  }

  .consent-card,
  .free-mode-card,
  .menu-modal-card {
    padding: 20px 24px 18px;
  }

  .consent-title,
  .free-mode-title,
  .menu-modal-title {
    font-size: 24px;
  }

  .consent-text {
    font-size: 11px;
  }

  .consent-more {
    margin-top: 9px;
  }

  .consent-continue,
  .menu-modal-close {
    margin-top: 12px;
  }

  .free-mode-options {
    margin-top: 12px;
  }

  .free-mode-option {
    padding: 8px 10px;
  }

  .free-mode-option-icon {
    width: 34px;
    height: 34px;
  }

  .levels-panel {
    padding: 16px 22px 16px;
  }

  .level-path {
    gap: 9px;
    padding: 14px 0 10px;
  }

  .level-node {
    padding: 9px 11px;
  }

  .free-play {
    padding: 9px 12px;
  }

  .battle-free-hud {
    margin-left: 0;
  }
}
@media (max-height: 520px) {
  .intro {
    top: max(8px, env(safe-area-inset-top));
    width: min(620px, calc(100% - 280px));
  }

  .intro-kicker {
    margin-bottom: 4px;
    font-size: 8px;
    letter-spacing: 0.24em;
  }

  .intro-title {
    font-size: clamp(18px, 2.6vw, 24px);
    line-height: 1.1;
  }

  .intro-sub,
  .intro-guide {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #joystick:not(.used) .joy-base {
    animation: none;
  }

  #game {
    transition-duration: 0.4s;
  }

  .intro,
  .intro-guide-arrow,
  .encounter,
  .name-shell,
  .found-shell,
  .start-shell,
  .consent-shell,
  .free-mode-shell,
  .menu-modal-shell,
  .levels-panel,
  .level-node,
  .free-play,
  .drug-shell,
  .drug-cards,
  .drug-card,
  .battle-shell,
  .battle-flash,
  .battle-fighter,
  .battle-damage,
  .battle-beam,
  .battle-impact,
  .battle-effect-banner,
  .battle-round,
  .antibiotic-card,
  .battle-wait,
  .diplococcus-art,
  .hp-fill,
  .completion-card,
  .completion-sparkles span,
  .encounter-dot,
  .inv-item.is-new .inv-slot,
  .pubmed-skeleton span {
    animation-duration: 0.01ms !important;
    transition-duration: 0.05ms !important;
  }
}


/* ---------- Levelkarte: heller, gewundener Weg ---------- */

.overlay--levels {
  --levels-ink: #17212b;
  --levels-muted: #718096;
  --levels-line: #dce3e9;
  --levels-outline: #cbd8e2;
  --levels-outline-hover: #a8bfd1;
  --levels-accent: #477da8;
  --levels-surface: #ffffff;
  --levels-tonal: #eaf1f7;

  align-items: flex-start;
  overflow: hidden;
  padding: clamp(12px, 2.4vw, 24px);
}

.overlay--levels .overlay-scrim {
  background:
    radial-gradient(ellipse 70% 46% at 50% -8%, #eaf2f9 0%, rgba(234, 242, 249, 0) 72%),
    radial-gradient(ellipse 50% 44% at 4% 106%, rgba(219, 233, 243, 0.55), transparent 70%),
    radial-gradient(ellipse 44% 40% at 98% 84%, rgba(226, 238, 246, 0.5), transparent 72%),
    #f8fafc;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay--levels .levels-shell {
  width: min(1000px, 100%);
  height: calc(100dvh - clamp(24px, 4.8vw, 48px));
  max-height: none;
  gap: 0;
}

/* Kopfzeile */

.levels-map-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 12px;
  flex: 0 0 auto;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--levels-line);
}

.overlay--levels .levels-back {
  grid-column: 1;
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--levels-outline);
  border-radius: 50%;
  background: var(--levels-surface);
  color: #3d5266;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.overlay--levels .levels-back:hover {
  border-color: var(--levels-outline-hover);
  background: #f4f8fb;
  color: #2c4152;
  transform: none;
}

.overlay--levels .levels-back:focus-visible {
  outline: 2px solid #8ab6d6;
  outline-offset: 3px;
}

.overlay--levels .levels-back svg {
  display: block;
  width: 20px;
  height: 20px;
}

.levels-map-heading {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0;
  text-align: center;
}

.levels-map-heading .card-eyebrow {
  margin: 0;
  color: #7d92a6;
  font-size: 8.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.overlay--levels .levels-title {
  margin: 5px 0 6px;
  color: var(--levels-ink);
  font-family: var(--sans);
  font-size: clamp(27px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-shadow: none;
}

.overlay--levels .levels-count {
  display: block;
  margin-left: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--levels-muted);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Karte */

.levels-map-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 125, 168, 0.3) transparent;
}

.levels-map-wrap::-webkit-scrollbar {
  width: 5px;
}

.levels-map-wrap::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(71, 125, 168, 0.28);
}

.levels-map-canvas {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding: 46px 0 72px;
}

.level-trail {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.level-trail path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-trail-line {
  stroke: #a6bfd2;
  stroke-width: 3;
  stroke-dasharray: 9 11;
}

.overlay--levels .level-path {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 34px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.overlay--levels .level-path::before {
  display: none;
}

/* Knoten */

.overlay--levels .level-node {
  --weave: 0px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  align-items: center;
  align-self: stretch;
  gap: 12px;
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: var(--levels-ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.overlay--levels .level-node:nth-child(odd) {
  --weave: -48px;
}

.overlay--levels .level-node:nth-child(even) {
  --weave: 48px;
}

.overlay--levels .level-node:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.overlay--levels .level-icon {
  position: relative;
  grid-column: 2;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--levels-accent);
  color: #ffffff;
  box-shadow:
    0 0 0 4px #ffffff,
    0 8px 20px rgba(23, 33, 43, 0.12);
  translate: var(--weave) 0;
  transform: none;
  transition: transform 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
}

.overlay--levels .level-node:hover .level-icon {
  background: #3f7098;
  box-shadow:
    0 0 0 4px #ffffff,
    0 12px 26px rgba(23, 33, 43, 0.16);
  transform: scale(1.045);
}

.overlay--levels .level-index {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.overlay--levels .level-node--tutorial .level-index {
  font-size: 26px;
  letter-spacing: 0;
}

.overlay--levels .level-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  grid-column: 3;
  justify-self: start;
  width: 100%;
  min-width: 0;
  max-width: 268px;
  text-align: left;
}

.overlay--levels .level-node:nth-child(even) .level-copy {
  grid-column: 1;
  justify-self: end;
  align-items: flex-end;
  text-align: right;
}

.overlay--levels .level-node-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.overlay--levels .level-node:nth-child(even) .level-node-top {
  align-items: flex-end;
}

.overlay--levels .level-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.overlay--levels .level-node:nth-child(even) .level-head {
  flex-direction: row-reverse;
}

.overlay--levels .level-glyph {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  color: var(--levels-accent);
  opacity: 0.9;
}

.overlay--levels .level-glyph svg {
  display: block;
  width: 15px;
  height: 15px;
}

.overlay--levels .level-number {
  color: #8096a8;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.overlay--levels .level-name {
  overflow: visible;
  color: var(--levels-ink);
  font-family: var(--sans);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.012em;
  text-overflow: clip;
  white-space: normal;
  text-shadow: none;
}

.overlay--levels .level-focus {
  max-width: 250px;
  margin-top: 0;
  color: var(--levels-muted);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.005em;
}

.overlay--levels .level-node:hover .level-name {
  color: #355b78;
}

.overlay--levels .level-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.overlay--levels .level-node:focus-visible {
  outline: none;
}

.overlay--levels .level-node:focus-visible .level-icon {
  outline: 2px solid #8ab6d6;
  outline-offset: 4px;
}

/* Abgeschlossen und als Nächstes dran */

.overlay--levels .level-node--completed .level-icon {
  background: #41769f;
}

.overlay--levels .level-node--completed .level-icon::after {
  content: "★";
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #ecdfc2;
  border-radius: 50%;
  background: #ffffff;
  color: #c9a24a;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(23, 33, 43, 0.14);
}

.overlay--levels .level-node--next .level-icon {
  box-shadow:
    0 0 0 4px #ffffff,
    0 0 0 10px rgba(71, 125, 168, 0.13),
    0 10px 24px rgba(23, 33, 43, 0.14);
}

.overlay--levels .level-node--next .level-icon::before {
  content: "\2193";
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--levels-accent);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(23, 33, 43, 0.16);
  animation: level-next-bob 1.9s ease-in-out infinite;
}

.overlay--levels .level-node--next .level-focus {
  color: #4a7290;
}

@keyframes level-next-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* Freies Spiel als eigenes Extra am Ende des Weges */

.overlay--levels .level-icon--free {
  border-radius: 18px;
  background: var(--levels-accent);
  color: #ffffff;
}

.overlay--levels .level-free-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}

.overlay--levels .level-free-icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

.overlay--levels .level-node--free .level-number {
  color: var(--levels-accent);
}

.overlay--levels .level-node--free .level-focus {
  color: var(--levels-muted);
}

/* Kompakt: schmale Geräte */

@media (max-width: 760px) {
  .overlay--levels {
    padding: 10px;
  }

  .overlay--levels .levels-shell {
    height: calc(100dvh - 20px);
  }

  .levels-map-head {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    padding-bottom: 12px;
  }

  .overlay--levels .levels-back {
    width: 40px;
    height: 40px;
  }

  .overlay--levels .levels-back svg {
    width: 18px;
    height: 18px;
  }

  .overlay--levels .levels-title {
    margin: 3px 0 4px;
    font-size: clamp(24px, 7.6vw, 30px);
  }

  .overlay--levels .levels-count {
    font-size: 8px;
  }

  .levels-map-canvas {
    padding: 32px 0 56px;
  }

  .overlay--levels .level-path {
    gap: 20px;
  }

  .overlay--levels .level-node {
    --weave: 0px;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 14px;
    min-height: 78px;
    padding-left: 0;
  }

  .overlay--levels .level-node:nth-child(even) {
    padding-left: 26px;
  }

  .overlay--levels .level-icon {
    grid-column: 1;
    width: 62px;
    height: 62px;
    box-shadow:
      0 0 0 3px #ffffff,
      0 6px 16px rgba(23, 33, 43, 0.12);
    translate: 0 0;
  }

  .overlay--levels .level-node:hover .level-icon {
    transform: scale(1.04);
  }

  .overlay--levels .level-index {
    font-size: 24px;
  }

  .overlay--levels .level-node--tutorial .level-index {
    font-size: 21px;
  }

  .overlay--levels .level-copy,
  .overlay--levels .level-node:nth-child(even) .level-copy {
    grid-column: 2;
    justify-self: stretch;
    align-items: flex-start;
    max-width: none;
    text-align: left;
  }

  .overlay--levels .level-node:nth-child(even) .level-node-top {
    align-items: flex-start;
  }

  .overlay--levels .level-node:nth-child(even) .level-head {
    flex-direction: row;
  }

  .overlay--levels .level-name {
    font-size: 14px;
  }

  .overlay--levels .level-focus {
    max-width: none;
    font-size: 10.5px;
  }

  .overlay--levels .level-number {
    font-size: 8px;
  }

  .overlay--levels .level-glyph {
    width: 14px;
    height: 14px;
  }

  .overlay--levels .level-glyph svg {
    width: 14px;
    height: 14px;
  }

  .level-trail-line {
    stroke-width: 2.6;
    stroke-dasharray: 8 10;
  }

  .overlay--levels .level-icon--free {
    border-radius: 15px;
  }

  .overlay--levels .level-free-icon,
  .overlay--levels .level-free-icon svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 380px) {
  .overlay--levels .level-node {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
  }

  .overlay--levels .level-node:nth-child(even) {
    padding-left: 20px;
  }

  .overlay--levels .level-icon {
    width: 58px;
    height: 58px;
  }

  .overlay--levels .level-icon--free {
    border-radius: 14px;
  }

  .overlay--levels .level-free-icon,
  .overlay--levels .level-free-icon svg {
    width: 24px;
    height: 24px;
  }

  .overlay--levels .level-index {
    font-size: 22px;
  }

  .overlay--levels .level-node--tutorial .level-index {
    font-size: 19px;
  }

  .overlay--levels .level-name {
    font-size: 13.5px;
  }

  .overlay--levels .level-focus {
    font-size: 10px;
  }

  .overlay--levels .levels-title {
    font-size: 23px;
  }
}

/* Kompakt: flache Fenster */

@media (max-height: 520px) and (min-width: 761px) {
  .overlay--levels {
    padding: 8px 16px;
  }

  .overlay--levels .levels-shell {
    height: calc(100dvh - 16px);
  }

  .levels-map-head {
    padding-bottom: 8px;
  }

  .overlay--levels .levels-back {
    width: 38px;
    height: 38px;
  }

  .overlay--levels .levels-back svg {
    width: 18px;
    height: 18px;
  }

  .overlay--levels .levels-title {
    margin: 2px 0 3px;
    font-size: 26px;
  }

  .levels-map-heading .card-eyebrow {
    font-size: 7.5px;
  }

  .overlay--levels .levels-count {
    display: none;
  }

  .levels-map-canvas {
    padding: 26px 0 44px;
  }

  .overlay--levels .level-path {
    gap: 18px;
  }

  .overlay--levels .level-node {
    grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
    gap: 18px;
    min-height: 70px;
  }

  .overlay--levels .level-icon {
    width: 62px;
    height: 62px;
  }

  .overlay--levels .level-index {
    font-size: 23px;
  }

  .overlay--levels .level-name {
    font-size: 13px;
  }

  .overlay--levels .level-focus {
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay--levels .level-node--next .level-icon::before {
    animation: none;
  }
}

/* ---------- Karten-Ladehinweis ---------- */
.map-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 240;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 22px;
  border: 1px solid rgba(154, 187, 174, 0.18);
  border-radius: 999px;
  background: rgba(5, 11, 9, 0.92);
  color: #dce8df;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.map-loading[hidden] { display: none; }
.map-loading-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(203, 228, 216, 0.22);
  border-top-color: #b7d8c3;
  border-radius: 50%;
  animation: map-loading-spin 0.8s linear infinite;
}
@keyframes map-loading-spin { to { transform: rotate(360deg); } }

/* ---------- Paper-Fund ---------- */
.overlay--article { z-index: 112; }
.overlay--article .overlay-scrim {
  background: rgba(2, 5, 4, 0.82);
  backdrop-filter: blur(9px) saturate(0.84);
  -webkit-backdrop-filter: blur(9px) saturate(0.84);
}
.article-shell {
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.overlay.is-open .article-shell { opacity: 1; transform: translateY(0) scale(1); }
.article-card {
  width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 27px 30px 22px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3), 0 3px 8px rgba(0, 0, 0, 0.08);
}
.article-portrait {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 34%, #fbfdff 0%, #edf3f8 68%, #e3ecf3 100%);
  color: #547a92;
  box-shadow: inset 0 0 0 1px rgba(107, 138, 166, 0.08), 0 14px 26px rgba(82, 111, 136, 0.12);
}
.article-portrait svg { width: 42px; height: 42px; }
.article-card .card-eyebrow { margin-bottom: 7px; text-align: center; }
.article-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.article-meta {
  margin: 8px 0 0;
  color: #60788a;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}
.article-loading {
  margin: 14px 0 0;
  color: #8a99a4;
  font-size: 12px;
  line-height: 1.55;
}
.article-abstract {
  max-height: 240px;
  margin: 14px 0 0;
  padding: 14px 15px;
  overflow-y: auto;
  border-radius: 14px;
  background: #f1f5f7;
  color: #465a68;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: left;
}
.article-note {
  margin: 11px 0 0;
  color: #94a1ab;
  font-size: 10.5px;
  line-height: 1.5;
}
.article-collect { width: 100%; margin-top: 16px; }
.article-link {
  display: inline-block;
  margin-top: 12px;
  color: #4d7c99;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}
.article-link:hover { text-decoration: underline; }
.article-link[hidden] { display: none; }

/* ---------- R�ckzug ---------- */
.battle-retreat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(122, 145, 158, 0.28);
  border-radius: 12px;
  background: transparent;
  color: #526775;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.battle-retreat:hover:not(:disabled) { background: rgba(79, 105, 120, 0.07); border-color: rgba(90, 120, 138, 0.42); }
.battle-retreat:disabled { opacity: 0.4; cursor: default; }
.battle-retreat-sub { color: #8d9ba5; font-size: 10px; font-weight: 500; line-height: 1.35; }

.completion-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 560px) {
  .article-card { padding: 22px 20px 18px; }
  .article-title { font-size: 18px; }
  .article-abstract { max-height: 200px; font-size: 12px; }
  .article-portrait { width: 74px; height: 74px; }
  .article-portrait svg { width: 34px; height: 34px; }
  .completion-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .completion-stat:nth-child(3) { border-left: 0; border-top: 1px solid #e7ecee; }
  .completion-stat:nth-child(4) { border-top: 1px solid #e7ecee; }
}

/* ---------- Paper-Bonus-Toast ---------- */
.paper-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 270;
  padding: 11px 18px;
  border: 1px solid rgba(154, 203, 186, 0.24);
  border-radius: 999px;
  background: rgba(8, 22, 18, 0.92);
  color: #d7efe2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.2, 0.85, 0.25, 1);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.paper-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.paper-toast[hidden] { display: none; }
@media (max-width: 560px) {
  .paper-toast { bottom: 120px; font-size: 11px; }
}

/* ---------- Level verlassen ---------- */
.level-exit {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border: 1px solid rgba(174, 197, 185, 0.22);
  border-radius: 999px;
  background: rgba(7, 14, 12, 0.72);
  color: #c7d9cf;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.level-exit:hover { background: rgba(18, 32, 26, 0.9); border-color: rgba(174, 213, 190, 0.4); }
.level-exit[hidden] { display: none; }
.level-exit-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(205, 225, 213, 0.13);
  font-size: 13px;
  line-height: 1;
}

/* ---------- HUD Freies Spiel ---------- */
.free-run-hud {
  position: fixed;
  top: 53px;
  right: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(161, 194, 178, 0.18);
  border-radius: 12px;
  background: rgba(6, 13, 11, 0.76);
  color: #c9ded2;
  font-size: 10px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}
.free-run-hud[hidden] { display: none; }
.free-run-mode { color: #e4c48d; font-weight: 700; text-transform: uppercase; font-size: 9px; letter-spacing: 0.1em; }
.free-run-time { color: #f1ead7; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; }
.free-run-chip { color: #b9cec2; padding-left: 8px; border-left: 1px solid rgba(180, 207, 191, 0.16); }

/* ---------- Freies-Spiel-Ergebnis ---------- */
.overlay--free-result { z-index: 150; }
.overlay--free-result .overlay-scrim { background: rgba(2, 5, 4, 0.82); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.free-result-shell { width: min(440px, 100%); opacity: 0; transform: translateY(14px) scale(0.985); transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1); }
.overlay.is-open .free-result-shell { opacity: 1; transform: translateY(0) scale(1); }
.free-result-card {
  width: 100%;
  padding: 30px 32px 24px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%);
  color: #253540;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3), 0 3px 8px rgba(0, 0, 0, 0.08);
}
.free-result-card .card-eyebrow { text-align: center; margin-bottom: 8px; }
.free-result-title { margin: 0; color: #1f2e38; font-family: var(--sans); font-size: 27px; font-weight: 700; letter-spacing: -0.02em; }
.free-result-text { margin: 12px 0 0; color: #73838e; font-size: 12.5px; line-height: 1.65; }
.free-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.free-result-actions .btn-primary, .free-result-actions .btn-ghost { flex: 1; }

/* ---------- Verlassen-Dialog ---------- */
.overlay--exit { z-index: 160; }
.overlay--exit .overlay-scrim { background: rgba(2, 5, 4, 0.78); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.exit-shell { width: min(390px, 100%); opacity: 0; transform: translateY(12px) scale(0.985); transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.85, 0.25, 1); }
.overlay.is-open .exit-shell { opacity: 1; transform: translateY(0) scale(1); }
.exit-card { width: 100%; padding: 28px 30px 22px; border: 1px solid rgba(31, 44, 54, 0.06); border-radius: 24px; background: linear-gradient(180deg, #fdfdfb 0%, #f9faf8 100%); color: #253540; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.exit-card .card-eyebrow { text-align: center; margin-bottom: 7px; }
.exit-title { margin: 0; color: #1f2e38; font-family: var(--sans); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.exit-text { margin: 11px 0 0; color: #7c8b97; font-size: 12.5px; line-height: 1.65; }
.exit-actions { display: flex; gap: 9px; margin-top: 19px; }
.exit-actions .btn-primary, .exit-actions .btn-ghost { flex: 1; }

@media (max-width: 560px) {
  .level-exit { top: 10px; right: 10px; font-size: 9.5px; padding: 6px 9px 6px 7px; }
  .free-run-hud { top: 44px; right: 10px; gap: 6px; padding: 7px 9px; font-size: 9px; }
  .free-run-time { font-size: 11px; }
  .free-run-chip { padding-left: 6px; }
  .free-result-card, .exit-card { padding: 24px 20px 20px; }
  .free-result-actions, .exit-actions { flex-direction: column; }
}

/* ============================================================
   Zusätzliche Charaktere, Sprechblase & Wissensdatenbank
   ============================================================ */

.overlay--character {
  z-index: 115;
}

.overlay--character .overlay-scrim {
  background: rgba(2, 5, 4, 0.80);
  backdrop-filter: blur(9px) saturate(0.84);
  -webkit-backdrop-filter: blur(9px) saturate(0.84);
}

.character-shell {
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.overlay.is-open .character-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.character-card {
  width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px 26px 20px;
  border: 1px solid rgba(31, 44, 54, 0.06);
  border-radius: 24px;
  background: linear-gradient(180deg, #fdfdfb 0%, #f8faf8 100%);
  color: #253540;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.character-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.character-portrait {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(circle at 44% 32%, #fbfcfe 0%, #edf3f8 68%, #e3ecf3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 138, 166, 0.08),
    0 16px 28px rgba(82, 111, 136, 0.12);
}

.character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1.08);
  filter: drop-shadow(0 8px 10px rgba(31, 54, 70, 0.14));
}

.character-heading {
  min-width: 0;
}

.character-heading .card-eyebrow {
  margin-bottom: 6px;
}

.character-title {
  margin: 0;
  color: #1e2c36;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.character-role {
  margin: 5px 0 0;
  color: #7c8b97;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.character-dialogue-view {
  margin-top: 18px;
}

.character-bubble {
  position: relative;
  padding: 18px 20px;
  border-radius: 6px 18px 18px 18px;
  background: #eef4f7;
  color: #354b59;
  font-size: 13.5px;
  line-height: 1.65;
}

.character-bubble::before {
  content: "";
  position: absolute;
  left: 24px;
  top: -7px;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: #eef4f7;
  transform: rotate(45deg);
}

.character-bubble p {
  position: relative;
  margin: 0;
}

.character-reward {
  margin: 13px 0 0;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(82, 116, 94, 0.10);
  color: #365c45;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

.character-reward[data-tone="item"] {
  background: rgba(190, 151, 78, 0.13);
  color: #755726;
}

.character-reward[data-tone="heal"] {
  background: rgba(62, 131, 116, 0.12);
  color: #2d6357;
}

.character-reward[data-tone="homeopathy"] {
  background: rgba(139, 164, 145, 0.15);
  color: #4c6252;
  box-shadow: inset 0 0 0 1px rgba(112, 142, 120, 0.16);
}

.character-reward[data-tone="success"] {
  background: rgba(62, 131, 88, 0.13);
  color: #2f6142;
}

.character-reward[data-tone="muted"] {
  background: rgba(86, 105, 118, 0.09);
  color: #667a87;
}

.character-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.character-actions .btn-primary {
  min-width: 118px;
}

.character-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid rgba(48, 78, 94, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: #3c5a6b;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.character-secondary[hidden] {
  display: none;
}

.character-secondary:hover {
  border-color: rgba(48, 78, 94, 0.28);
  background: #f1f7fa;
  transform: translateY(-1px);
}

.character-secondary:focus-visible {
  outline: 2px solid rgba(99, 157, 184, 0.72);
  outline-offset: 3px;
}

.character-footnote {
  margin: 12px 0 0;
  color: #a6b2ba;
  font-size: 8.5px;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

/* ---------- Wissensdatenbank ---------- */

.knowledge-view {
  margin-top: 16px;
}

.knowledge-head {
  margin-bottom: 12px;
}

.knowledge-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6d8998;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.knowledge-back:hover {
  color: #315a70;
}

.knowledge-back:focus-visible {
  outline: 2px solid rgba(99, 157, 184, 0.72);
  outline-offset: 3px;
  border-radius: 4px;
}

.knowledge-title {
  margin: 12px 0 0;
  color: #1f303a;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.knowledge-sub {
  margin: 5px 0 0;
  color: #7e8f9b;
  font-size: 11.5px;
  line-height: 1.55;
}

.knowledge-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(48, 78, 94, 0.12);
  border-radius: 13px;
  background: #f2f6f8;
}

.knowledge-search:focus-within {
  border-color: rgba(91, 150, 178, 0.45);
  background: #f7fbfd;
  box-shadow: 0 0 0 3px rgba(91, 150, 178, 0.08);
}

.knowledge-search-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #8ca3b0;
}

.knowledge-search-icon svg {
  width: 17px;
  height: 17px;
}

.knowledge-search-input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2d4351;
  font-family: var(--sans);
  font-size: 12.5px;
}

.knowledge-search-input::placeholder {
  color: #9aadb8;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  margin-top: 13px;
  min-height: 250px;
}

.knowledge-list-wrap {
  min-width: 0;
}

.knowledge-count {
  margin: 0 0 7px;
  color: #9aabb5;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 132, 148, 0.38) transparent;
}

.knowledge-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #2d4351;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.knowledge-item:hover {
  background: #eef4f7;
}

.knowledge-item.is-active {
  background: #e5eff4;
  box-shadow: inset 3px 0 0 #5f91aa;
}

.knowledge-item:focus-visible {
  outline: 2px solid rgba(99, 157, 184, 0.6);
  outline-offset: 1px;
}

.knowledge-item-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110, 140, 155, 0.08);
}

.knowledge-item-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.knowledge-item-copy strong {
  overflow: hidden;
  color: #2d4351;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-item-copy span {
  overflow: hidden;
  color: #93a4ae;
  font-size: 8.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-item-arrow {
  margin-left: auto;
  color: #a9bac3;
  font-size: 17px;
  line-height: 1;
}

.knowledge-empty {
  margin: 0;
  padding: 12px 10px;
  color: #8c9ca6;
  font-size: 11px;
  line-height: 1.55;
}

.knowledge-detail {
  min-width: 0;
  max-height: 330px;
  overflow-y: auto;
  padding: 15px;
  border-radius: 16px;
  background: #f1f5f7;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 132, 148, 0.38) transparent;
}

.knowledge-placeholder {
  margin: 8px 0;
  color: #8c9ca6;
  font-size: 11.5px;
  line-height: 1.55;
}

.knowledge-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.knowledge-detail-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(110, 140, 155, 0.10);
}

.knowledge-detail-copy {
  min-width: 0;
}

.knowledge-detail-title {
  margin: 0;
  color: #1f303a;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.knowledge-detail-meta {
  margin: 3px 0 0;
  color: #8799a4;
  font-size: 10px;
  line-height: 1.4;
}

.knowledge-detail-description {
  margin: 10px 0 0;
  color: #637985;
  font-size: 11.5px;
  line-height: 1.55;
}

.knowledge-section {
  margin-top: 13px;
}

.knowledge-section-title {
  margin: 0 0 6px;
  color: #6d8491;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.knowledge-section-title--good {
  color: #3f7654;
}

.knowledge-section-title--partial {
  color: #9a6b23;
}

.knowledge-section-title--none {
  color: #9a4b44;
}

.knowledge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.knowledge-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.3;
}

.knowledge-chip--good {
  background: #e1f0e6;
  color: #2f6a45;
}

.knowledge-chip--partial {
  background: #fbf0d9;
  color: #8b6120;
}

.knowledge-chip--none {
  background: #f7e3e1;
  color: #8e3e37;
}

.knowledge-note {
  margin: 13px 0 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(191, 157, 91, 0.12);
  color: #765a2c;
  font-size: 10px;
  line-height: 1.5;
}

.knowledge-detail-credit {
  margin: 12px 0 0;
  color: #a0afb8;
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.knowledge-credit {
  margin: 13px 0 0;
  color: #a0afb8;
  font-size: 8.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.knowledge-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ---------- Globuli: eigenes Item ---------- */

.globuli-icon {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.globuli-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 16px;
  height: 24px;
  border: 1.4px solid rgba(105, 133, 115, 0.62);
  border-radius: 3px 3px 8px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(211, 230, 216, 0.18));
  box-shadow: inset 0 0 7px rgba(255, 255, 255, 0.65);
}

.globuli-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 16px;
  height: 4px;
  border-radius: 2px;
  background: #7c9183;
}

.globuli-icon span {
  position: absolute;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbfdf9;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}

.globuli-icon span:nth-child(1) {
  left: 12px;
  top: 12px;
}

.globuli-icon span:nth-child(2) {
  left: 17px;
  top: 15px;
}

.globuli-icon span:nth-child(3) {
  left: 13px;
  top: 20px;
}

.inv-item--homeopathy .inv-slot {
  border-style: dashed;
  border-color: rgba(158, 188, 168, 0.44);
  background:
    radial-gradient(circle at 40% 30%, rgba(190, 220, 200, 0.13), transparent 65%),
    rgba(8, 13, 10, 0.76);
}

.inv-item--homeopathy .inv-name {
  color: rgba(214, 231, 218, 0.58);
}

.inv-note {
  max-width: 62px;
  overflow: hidden;
  color: rgba(184, 211, 192, 0.46);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.antibiotic-card--homeopathy {
  border-style: dashed;
  border-color: #d8e4dc;
  background: #f7faf7;
}

.antibiotic-card--homeopathy .antibiotic-iconframe {
  border-style: dashed;
  border-color: #d3e1d7;
  background:
    radial-gradient(circle at 36% 26%, rgba(190, 220, 200, 0.34), transparent 70%),
    #f1f7f2;
}

.antibiotic-card--homeopathy .antibiotic-status {
  color: #6f8778;
}

.antibiotic-card.is-reacting[data-effect="placebo"] {
  border-color: #b9cfc0;
  box-shadow: 0 0 0 3px rgba(111, 143, 120, 0.10);
}

.battle-effect-banner.is-placebo {
  --effect-color: #5f7a68;
  border-color: #d9e7dd;
}

.battle-effect-banner.is-placebo .battle-effect-mark {
  background: #eef5f0;
}

@media (max-width: 760px) {
  .character-shell {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .character-card {
    max-height: calc(100dvh - 20px);
    padding: 18px 18px 16px;
    border-radius: 20px;
  }

  .character-top {
    gap: 12px;
  }

  .character-portrait {
    width: 84px;
    height: 84px;
    border-radius: 18px;
  }

  .character-title {
    font-size: 22px;
  }

  .character-bubble {
    padding: 15px 16px;
    font-size: 12.5px;
    line-height: 1.6;
  }

  .character-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .character-actions .btn-primary,
  .character-secondary {
    width: 100%;
  }

  .knowledge-title {
    font-size: 20px;
  }

  .knowledge-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .knowledge-list {
    max-height: 210px;
  }

  .knowledge-detail {
    max-height: none;
  }

  .knowledge-actions .btn-primary {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .character-card {
    padding: 14px 14px 12px;
  }

  .character-portrait {
    width: 68px;
    height: 68px;
    border-radius: 15px;
  }

  .character-title {
    font-size: 19px;
  }

  .character-bubble {
    font-size: 11.5px;
  }
}

@media (max-height: 520px) {
  .character-card {
    padding: 14px 18px 12px;
  }

  .character-portrait {
    width: 66px;
    height: 66px;
  }

  .character-bubble {
    padding: 12px 14px;
    font-size: 11.5px;
  }

  .character-dialogue-view {
    margin-top: 10px;
  }

  .knowledge-layout {
    min-height: 180px;
  }
}
