.station {
  position: fixed; inset: 0; z-index: 37; overflow: hidden; background: #000;
  touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: Georgia, 'Times New Roman', serif; color: #e8dcc4;
}
.k9-bild { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.station::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 72% 68% at 50% 48%, transparent 42%, rgba(0, 0, 0, 0.82) 100%);
}

.station::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.28; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0.9 -0.38'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23k)'/%3E%3C/svg%3E");
}
html:not(.handy) .k9-bild { filter: saturate(0.78) contrast(1.06); }
.k9-vorhang { position: absolute; inset: 0; z-index: 9; background: #000; opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
.station.zu .k9-vorhang { opacity: 1; }
.k9-laedt {
  position: absolute; z-index: 10; left: 50%; top: 50%; translate: -50% -50%; letter-spacing: 0.2em; font-size: 20px;
  color: rgba(232, 220, 196, 0.7); opacity: 0; transition: opacity 0.6s; pointer-events: none;
}
.station.zu:not(.wach) .k9-laedt { opacity: 1; }
.k9-licht { position: absolute; inset: 0; z-index: 10; background: #fff8e8; opacity: 0; transition: opacity 1.8s ease-in; pointer-events: none; }
.station.raus .k9-licht { opacity: 1; }

.k9-beute, .k9-zahlen { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.k9-schild {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  font: 600 12px/1 Georgia, serif; color: #e8e2d4; background: rgba(8, 6, 6, 0.78); border: 1px solid rgba(232, 220, 196, 0.22);
  border-radius: 2px; padding: 3px 6px;
}
.k9-schild:hover { background: rgba(40, 30, 20, 0.92); border-color: rgba(232, 220, 196, 0.6); }
.k9-schild.gold { color: #e8c45a; }
.k9-schild.trank-rot { color: #ff6a5a; }
.k9-schild.trank-blau { color: #7a9cff; }
.k9-zahl {
  position: absolute; left: 0; top: 0; font: 700 17px/1 Georgia, serif; color: #f0e6d0;
  text-shadow: 0 0 3px #000, 0 1px 2px #000; will-change: transform, opacity;
}
.k9-zahl.krit { color: #ffd23a; font-size: 22px; }
.k9-zahl.held { color: #ff4a3a; }

.k9-hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.k9-kugel {
  position: absolute; bottom: calc(var(--k9-unten, 40px) + 6px); width: 112px; height: 112px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1a1414, #050404 70%); border: 3px solid #5a4a32;
  box-shadow: 0 0 0 2px #1a140c, 0 4px 18px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(0, 0, 0, 0.9);
}
.k9-leben { left: 18px; }
.k9-mana { right: 18px; }
.k9-kugel i { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform 0.18s linear; }
.k9-leben i { background: radial-gradient(circle at 38% 30%, #ff5a4a, #a40c0c 45%, #4a0404 100%); }
.k9-mana i { background: radial-gradient(circle at 38% 30%, #6a8aff, #1426a8 45%, #050a40 100%); }
.k9-kugel::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.35), transparent 32%); }
.k9-kugel span { position: absolute; left: 0; right: 0; top: 50%; translate: 0 -50%; z-index: 1; text-align: center; font: 700 13px/1 Georgia, serif; color: #fff; text-shadow: 0 1px 3px #000; opacity: 0; transition: opacity 0.2s; }
.k9-kugel:hover span, .k9-hud.handy .k9-kugel span { opacity: 1; }
.k9-kugel { pointer-events: auto; }

.k9-mitte { position: absolute; left: 50%; bottom: calc(var(--k9-unten, 40px) + 6px); translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.k9-xp { position: relative; width: min(520px, 54vw); height: 7px; background: rgba(10, 8, 6, 0.85); border: 1px solid #5a4a32; }
.k9-xp i { position: absolute; inset: 0; background: linear-gradient(#e8c45a, #9a7420); transform-origin: 0 50%; transition: transform 0.25s; }
.k9-stufe { position: absolute; left: 50%; top: -17px; translate: -50% 0; font: 600 12px/1 Georgia, serif; color: #e8c45a; text-shadow: 0 1px 2px #000; }
.k9-leiste {
  display: flex; gap: 5px; align-items: center; padding: 5px 7px; pointer-events: auto;
  background: linear-gradient(#2a2218, #120e0a); border: 2px solid #5a4a32; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}
.k9-knopf {
  position: relative; width: 50px; height: 50px; padding: 7px; border: 1px solid #6a5a3e; border-radius: 3px; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #3a3024, #15110c); color: #e8dcc4;
}
.k9-knopf svg { width: 100%; height: 100%; display: block; }
.k9-knopf:hover { border-color: #c8a860; }
.k9-knopf.zu { filter: grayscale(1) brightness(0.45); }
.k9-knopf.mangel { color: #6a7aa8; }
.k9-knopf::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); transform-origin: 50% 100%; transform: scaleY(var(--abk, 0)); pointer-events: none; }
.k9-taste { position: absolute; left: 2px; top: 1px; font: 600 9px/1 system-ui, sans-serif; color: rgba(232, 220, 196, 0.75); }
.k9-abk { position: absolute; right: 3px; bottom: 2px; font: 700 12px/1 system-ui, sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.k9-fach {
  position: relative; width: 50px; height: 50px; border: 1px solid #6a5a3e; border-radius: 3px; background: #0c0a08; outline: none;
  font: 10px/1.2 Georgia, serif; color: rgba(232, 220, 196, 0.5);
}
.k9-fach::before { content: ''; position: absolute; inset: 9px; background-repeat: no-repeat; background-position: center; background-size: contain; opacity: 0.55; }
.k9-fach-waffe::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M6 26 L22 10 M19 7 l6 6 M8 21 l3 3' stroke='%23e8dcc4' stroke-width='2.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.k9-fach-ruestung::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M10 5 l6 3 6-3 5 5 -4 3 v14 h-14 v-14 l-4 -3z' stroke='%23e8dcc4' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }

.k9-tip {
  display: none; position: absolute; bottom: 58px; left: 50%; translate: -50% 0; width: 210px; padding: 7px 9px; text-align: center;
  font: 12px/1.35 Georgia, serif; color: #e8dcc4; background: rgba(8, 6, 4, 0.94); border: 1px solid #6a5a3e;
}
.k9-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.k9-fach:hover .k9-tip, .k9-fach:focus .k9-tip { display: block; }
.k9-fach:hover, .k9-fach:focus { box-shadow: 0 0 0 1px #c8a860; }

.k9-ziel { position: absolute; top: 14px; left: 50%; translate: -50% 0; text-align: center; opacity: 0; transition: opacity 0.15s; }
.k9-ziel.an { opacity: 1; }
.k9-ziel b { display: block; font: 700 14px/1 Georgia, serif; color: #e8dcc4; text-shadow: 0 1px 3px #000; margin-bottom: 4px; }
.k9-ziel i { display: block; width: 220px; height: 10px; background: #1a0606; border: 1px solid #6a4a32; }
.k9-ziel s { display: block; height: 100%; background: linear-gradient(#c81a10, #6a0606); transform-origin: 0 50%; text-decoration: none; }
.k9-ziel.k9-endgegner b { font-size: 18px; color: #e8c45a; }
.k9-ziel.k9-endgegner i { width: min(460px, 70vw); height: 14px; }

.k9-meldung {
  position: absolute; left: 50%; top: 22%; translate: -50% 0; max-width: min(640px, 86vw); text-align: center;
  font: italic 17px/1.35 Georgia, serif; color: #f0e4c8; text-shadow: 0 0 6px #000, 0 1px 3px #000; opacity: 0; transition: opacity 0.4s;
}
.k9-meldung.an { opacity: 1; }
.k9-gold { position: absolute; right: 150px; bottom: calc(var(--k9-unten, 40px) + 12px); font: 700 13px/1 Georgia, serif; color: #e8c45a; text-shadow: 0 1px 2px #000; }

.k9-hud.handy .k9-kugel { width: 74px; height: 74px; }
.k9-hud.handy .k9-leben { left: 10px; }
.k9-hud.handy .k9-mana { right: 10px; }
.k9-hud.handy .k9-xp { width: 46vw; }
.k9-hud.handy .k9-knopf, .k9-hud.handy .k9-fach { width: 46px; height: 46px; }
.k9-hud.handy .k9-fach { display: none; }
.k9-hud.handy .k9-gold { right: 96px; }
.k9-hud.handy .k9-meldung { font-size: 14px; top: 16%; }
.k9-hud.handy .k9-ziel { top: 8px; }
.k9-hud.handy .k9-schlag { display: none; }

.k9-knopf.neu { animation: k9-neu 1.4s ease-out 2; }
@keyframes k9-neu { 0% { box-shadow: 0 0 0 0 rgba(242, 214, 74, 0.9); } 100% { box-shadow: 0 0 0 12px rgba(242, 214, 74, 0); } }
.k9-inv {
  position: absolute; z-index: 6; right: 12px; top: 10px; width: 432px; max-height: calc(100% - var(--k9-unten, 40px) - 20px); overflow: auto;
  display: none; padding: 8px 15px 12px; color: #c8c0b0; font: 13px/1.3 Georgia, serif;
  background: radial-gradient(ellipse at 50% 0%, #2a2620, #12100d 70%), #12100d;
  border: 3px double #6e5a36; box-shadow: 0 0 0 1px #000, 0 10px 34px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(0, 0, 0, 0.8);
}
.k9-inv.an { display: block; }
.k9-inv-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.k9-inv-kopf b { font-size: 15px; letter-spacing: 0.22em; color: #c8a050; text-transform: uppercase; }
.k9-inv-zu { width: 30px; height: 30px; border: 1px solid #5a4a30; background: #0c0a08; color: #c8c0b0; cursor: pointer; font-size: 14px; }
.k9-inv-leib { position: relative; margin: 0 auto 8px; }
.k9-inv-fach {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(#070605, #14110d); border: 1px solid #3c3222; box-shadow: inset 0 0 10px #000, inset 0 0 0 1px var(--farbe, transparent);
  color: rgba(200, 192, 176, 0.13);
}
.k9-inv-fach i { flex: 1; width: 82%; display: flex; align-items: center; justify-content: center; }
.k9-inv-fach svg { width: 100%; height: 100%; max-height: 100%; }
.k9-inv-fach span { position: absolute; bottom: 2px; font: 9px/1 Georgia, serif; color: rgba(200, 192, 176, 0.35); pointer-events: none; }
.k9-inv-fach.voll span { display: none; }
.k9-inv-fach.voll { background: linear-gradient(#0e0c14, #18141e); }
.k9-inv-fach.passt { border-color: #5a8a4a; box-shadow: inset 0 0 12px rgba(90, 160, 70, 0.35); }
.k9-inv-fach:hover, .k9-inv-fach.gewaehlt { border-color: #a08a50; }
.k9-inv-werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px 6px; margin-bottom: 8px; font-size: 11px; color: rgba(200, 192, 176, 0.7); border-top: 1px solid #3c3222; border-bottom: 1px solid #3c3222; padding: 4px 0; }
.k9-inv-werte b { color: #e8e2d4; }
.k9-inv-werte small { color: rgba(200, 192, 176, 0.5); }
.k9-inv-sack {
  position: relative; margin: 0 auto; background-color: #080706; border: 1px solid #3c3222;
  background-image: linear-gradient(to right, rgba(110, 90, 54, 0.22) 1px, transparent 1px), linear-gradient(to bottom, rgba(110, 90, 54, 0.22) 1px, transparent 1px);
  background-size: 40px 40px;
}
.k9-inv-teil {
  position: absolute; padding: 3px; cursor: pointer; background: rgba(40, 52, 96, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex; align-items: center; justify-content: center;
}
.k9-inv-teil svg { width: 100%; height: 100%; }
.k9-inv-teil.schrott { background: rgba(60, 60, 60, 0.25); }
.k9-inv-teil.einzig { background: rgba(110, 80, 30, 0.28); }
.k9-inv-teil.selten { background: rgba(110, 100, 30, 0.22); }
.k9-inv-teil:hover, .k9-inv-teil.gewaehlt { box-shadow: inset 0 0 0 1px #c8a050; background-color: rgba(70, 80, 140, 0.35); }
.k9-inv-fuss { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12px; }
.k9-inv-gold { color: #e8c45a; }
.k9-inv-verkauf { padding: 5px 9px; border: 1px dashed #5a4a30; color: rgba(200, 192, 176, 0.45); cursor: default; }
.k9-inv.haelt .k9-inv-verkauf { border-color: #c8a050; color: #e8c45a; cursor: pointer; }
.k9-inv-hand { position: absolute; z-index: 8; left: 0; top: 0; pointer-events: none; padding: 3px; background: rgba(40, 52, 96, 0.35); display: none; }
.k9-inv-hand svg { width: 100%; height: 100%; }

.k9-inv-tip, .k9-inv-info {
  text-align: center; font: 13px/1.35 Georgia, serif; color: #e8e2d4;
}
.k9-inv-tip { position: absolute; z-index: 9; left: 0; top: 0; display: none; max-width: 300px; padding: 7px 12px; background: rgba(0, 0, 0, 0.9); pointer-events: none; }
.k9-inv-tip b, .k9-inv-info b { display: block; font-size: 14px; margin-bottom: 2px; }
.k9-inv-tip span, .k9-inv-info span { display: block; }
.k9-inv-tip .blau, .k9-inv-info .blau { color: #7a86ff; }
.k9-inv-tip small, .k9-inv-info small { display: block; color: rgba(200, 192, 176, 0.55); margin-top: 3px; font-size: 11px; }
.k9-inv-tip em, .k9-inv-info em { display: block; font-style: normal; margin-top: 3px; font-size: 12px; }
.k9-inv-tip .besser, .k9-inv-info .besser { color: #7ad86a; }
.k9-inv-tip .schlechter, .k9-inv-info .schlechter { color: #e86a5a; }
.k9-inv-info { margin-top: 8px; min-height: 0; }
.k9-inv:not(.handy) .k9-inv-info, .k9-inv:not(.handy) .k9-inv-tun { display: none; }
.k9-inv-tun { display: none; gap: 6px; margin-top: 8px; }
.k9-inv-tun.an { display: flex; }
.k9-inv-tun button { flex: 1; min-height: 44px; border: 1px solid #6e5a36; background: #1a1610; color: #e8e2d4; font: 600 13px Georgia, serif; cursor: pointer; }
.k9-inv-hilfe { margin-top: 6px; font-size: 10.5px; color: rgba(200, 192, 176, 0.42); text-align: center; }

.k9-inv.handy { left: 50%; right: auto; translate: -50% 0; top: 4px; width: min(760px, 98vw); max-height: calc(100% - 8px); padding: 6px 10px; }
.k9-inv.handy.an { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-content: start; }
.k9-inv.handy .k9-inv-kopf, .k9-inv.handy .k9-inv-hilfe { grid-column: 1 / -1; }
.k9-inv.handy .k9-inv-leib { grid-row: span 5; zoom: 0.68; }
.k9-inv.handy .k9-inv-sack { zoom: 0.73; margin: 0; }

.k9-inv-teil img, .k9-inv-fach img, .k9-inv-hand img {
  width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9));
}
.k9-inv-teil { padding: 2px; }
.k9-inv-fach i { position: absolute; inset: 4px; width: auto; }
.k9-inv-fach img.geist { filter: grayscale(1) brightness(0.55); opacity: 0.16; }
.k9-inv-fach.voll { background: radial-gradient(ellipse at 50% 45%, rgba(60, 54, 70, 0.55), #0b0a0e 75%); }
.k9-inv-fach.einzig, .k9-inv-teil.einzig { box-shadow: inset 0 0 16px rgba(200, 160, 80, 0.32), inset 0 0 0 1px rgba(200, 160, 80, 0.4); }
.k9-inv-hand { background: rgba(40, 52, 96, 0.28); }

.k9-inv {
  background: linear-gradient(rgba(8, 6, 5, 0.42), rgba(8, 6, 5, 0.7)), url('/kerker/k9bild/h-tafel.webp?v=1') center / cover, #12100d;
}
.k9-inv-sack { background-color: rgba(4, 3, 2, 0.82); }
.k9-inv-fach { background: linear-gradient(rgba(4, 3, 2, 0.88), rgba(14, 11, 8, 0.88)); }
.k9-inv-tip { border: 1px solid #3a3226; }

.k9-leiste { background: linear-gradient(rgba(10, 8, 6, 0.35), rgba(10, 8, 6, 0.65)), url('/kerker/k9bild/h-tafel.webp?v=1') center / cover; border-color: #6e5a36; }
.k9-knopf { padding: 0; overflow: hidden; background: #0a0806; }
.k9-knopf img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.k9-knopf .k9-taste { z-index: 1; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.k9-knopf .k9-abk { z-index: 1; }
.k9-knopf.mangel img { filter: saturate(0.3) brightness(0.6); }

.k9-kugel {
  overflow: visible; border: 0; border-radius: 50%; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.85);
  background: url('/kerker/k9bild/k-leer.webp?v=1') center / 100% 100% no-repeat;
}
.k9-kugel i { border-radius: 50%; transform: none; transition: clip-path 0.18s linear; clip-path: inset(calc((1 - var(--f, 1)) * 100%) 0 0 0); }
.k9-leben i { background: url('/kerker/k9bild/k-rot.webp?v=1') center / 100% 100% no-repeat; }
.k9-mana i { background: url('/kerker/k9bild/k-blau.webp?v=1') center / 100% 100% no-repeat; }
.k9-kugel::after { display: none; }
.k9-kugel::before {
  content: ''; position: absolute; inset: -17%; z-index: 1; pointer-events: none;
  background: url('/kerker/k9bild/h-ring.webp?v=1') center / 100% 100% no-repeat;
}
.k9-kugel span { z-index: 2; }
.k9-kugel { bottom: calc(var(--k9-unten, 40px) + 22px); }
.k9-hud.handy .k9-kugel { bottom: calc(var(--k9-unten, 40px) + 16px); }
.k9-leben { left: 30px; }
.k9-mana { right: 30px; }
.k9-gold { right: 168px; }
.k9-hud.handy .k9-leben { left: 18px; }
.k9-hud.handy .k9-mana { right: 18px; }
.k9-hud.handy .k9-gold { right: 112px; }

.station:not(.wach) .k9-vorhang { background: #000 url('/kerker/k9bild/h-laden.webp?v=1') center / cover no-repeat; }
.station:not(.wach) .k9-laedt { top: auto; bottom: 12%; translate: -50% 0; font-size: 24px; color: rgba(232, 220, 196, 0.85); text-shadow: 0 2px 8px #000; }
