:root {
  --bg: #14110e;
  --panel: #1d1914;
  --ink: #f0e6d2;
  --muted: #b3a48a;
  --gold: #d2ae66;
  --line: #3d3429;
  --hp: #b4453a;
  --mana: #3d6ea8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% 0%, #2b2218, transparent),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
}

.frame {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.attack {
  width: 100%;
  margin: 12px 0 4px;
  background: #8f3b2e;
  border-color: #a85a4c;
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  padding: 14px;
}

.world-map {
  position: relative;
  height: 460px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 40% 28% at 72% 70%, #3a3428 0%, transparent 70%),
    radial-gradient(ellipse 35% 40% at 16% 46%, #1a2a18 0%, transparent 65%),
    radial-gradient(ellipse 30% 24% at 42% 80%, #2a3028 0%, transparent 60%),
    radial-gradient(circle at 20% 88%, #3a3420, transparent 42%),
    linear-gradient(#24301c 0%, #1c2218 38%, #2a2418 70%, #1a1814 100%);
}

.world-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.world-hero-stats {
  min-width: 0;
}

.world-hero .bars {
  margin: 8px 0 0;
}

.world-hero-equip {
  display: contents;
}

.world-hero-equip-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.world-hero-equip .equip {
  margin: 0;
  padding: 6px 8px;
}

.world-hero-button {
  padding: 6px 8px;
  gap: 6px;
  min-height: 60px;
  align-content: center;
}

.world-hero-button img {
  width: 40px;
  height: 40px;
}

.world-hero-button span {
  font-size: 0.8rem;
}

.qty-buy {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty-buy input {
  width: 4.5rem;
  padding: 6px 8px;
}

.world-map.plane-heaven {
  background:
    radial-gradient(ellipse 50% 30% at 50% 38%, #4a5870 0%, transparent 70%),
    linear-gradient(#3a4a62, #1a2438 55%, #121820);
}

.world-map.land-heimat,
.world-map.land-dunkel {
  height: auto;
  aspect-ratio: 1024 / 447;
  width: 100%;
  background-color: #1a1814;
}

.world-map.land-nachtinsel,
.world-map.land-ost {
  height: auto;
  aspect-ratio: 1024 / 559;
  width: 100%;
  background-color: #0c0810;
}

.world-map.land-nachtinsel {
  background: url("img/maps/nachtinsel.png") center / 100% 100% no-repeat;
}

.world-map.land-heimat {
  background: url("img/maps/heimat.png") center / 100% 100% no-repeat;
  background-color: #1a1814;
}

.world-map.land-dunkel {
  background: url("img/maps/dunkel.jpg") center / 100% 100% no-repeat;
  background-color: #120e14;
}

.world-map.land-ost {
  background: url("img/maps/solheim.jpg") center / 100% 100% no-repeat;
  background-color: #0c1818;
}

.world-map.land-hell,
.world-map.land-heaven,
.world-map.land-void {
  height: auto;
  aspect-ratio: 1536 / 1024;
  width: 100%;
}

.world-map.land-hell {
  background: url("img/maps/holle.jpg") center / 100% 100% no-repeat;
  background-color: #140808;
}

.world-map.land-heaven {
  background: url("img/maps/himmel.jpg") center / 100% 100% no-repeat;
  background-color: #1a2438;
}

.world-map.land-void {
  background: url("img/maps/void.png") center / 100% 100% no-repeat;
  background-color: #05060a;
}

.city-scene,
.nachtkrone-map {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background-color: #120c12;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.nachtkrone-map {
  aspect-ratio: 1024 / 559;
}

.nachtkrone-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: transparent;
  box-shadow: none;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nachtkrone-spot .city-spot-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 35%, #4dabf7 0%, #1971c2 55%, #0d386b 100%);
  border: 2px solid #d0ebff;
  box-shadow: 0 0 8px rgba(25, 113, 194, 0.85), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.nachtkrone-spot:hover .city-spot-dot,
.nachtkrone-spot:focus-visible .city-spot-dot {
  box-shadow: 0 0 16px rgba(80, 180, 255, 1), 0 0 24px rgba(120, 200, 255, 0.7);
  transform: scale(1.25);
}

.nachtkrone-spot.tatahorn:hover .city-spot-dot,
.nachtkrone-spot.tatahorn:focus-visible .city-spot-dot {
  transform: translateX(-50%) scale(1.25);
}

.nachtkrone-spot:hover,
.nachtkrone-spot:focus-visible {
  border-color: rgba(210, 174, 102, 0.85);
  background: rgba(210, 174, 102, 0.12);
  box-shadow: 0 0 0 2px rgba(210, 174, 102, 0.25);
}

.nachtkrone-spot.king:hover,
.nachtkrone-spot.king:focus-visible {
  border-color: rgba(180, 50, 50, 0.9);
  background: rgba(140, 20, 30, 0.18);
}

.nachtkrone-spot.punisher:hover,
.nachtkrone-spot.punisher:focus-visible {
  border-color: rgba(180, 180, 190, 0.85);
}

.nachtkrone-spot.empty {
  outline: 1px dashed rgba(210, 174, 102, 0.35);
}

.nachtkrone-spot.tatahorn {
  z-index: 6;
  overflow: visible;
  outline: none;
  background: transparent;
}

.nachtkrone-spot.tatahorn .city-spot-dot {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  z-index: 2;
}

.nachtkrone-spot.tatahorn .tatahorn-sprite {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.75));
}

.nachtkrone-spot.tatahorn .nachtkrone-tip {
  opacity: 1;
  bottom: auto;
  top: 0;
  transform: translate(-50%, -108%);
  left: 50%;
  padding: 2px 6px;
  font-size: 11px;
  color: #f3e2b0;
  border: 1px solid rgba(210, 174, 102, 0.65);
  background: rgba(28, 20, 10, 0.9);
}

.nachtkrone-spot.tatahorn:hover .tatahorn-sprite,
.nachtkrone-spot.tatahorn:focus-visible .tatahorn-sprite {
  filter: drop-shadow(0 0 6px rgba(240, 196, 90, 0.7)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.75));
}

.tatahorn-shop {
  display: block;
  width: min(280px, 42%);
  height: auto;
  margin: 0 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.world-map .map-pin.tatahorn-here .pin-dot {
  box-shadow: 0 0 0 3px #f0d48a, 0 0 14px rgba(240, 196, 90, 0.95), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.nachtkrone-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(20, 16, 12, 0.92);
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
}

.nachtkrone-spot:hover .nachtkrone-tip,
.nachtkrone-spot:focus-visible .nachtkrone-tip {
  opacity: 1;
}

.map-roads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.map-roads line {
  stroke: rgba(210, 174, 102, 0.45);
  stroke-width: 0.7;
  stroke-linecap: round;
}

.world-map.plane-heaven .map-roads line {
  stroke: rgba(180, 200, 230, 0.4);
}

.world-map.plane-hell .map-roads line {
  stroke: rgba(200, 90, 50, 0.4);
}

/* ==========================================================================
   Map Pins (Dot System)
   - Rot (Red): Dungeons & Towers
   - Grün (Green): Städte, Burgen & Throne
   - Gelb (Yellow): Minen
   - Blau (Blue): Restliche Orte (Felder, Pässe, Wälder, Wildnis, Wege)
   ========================================================================== */

.world-map .map-pin .map-art-label {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  max-width: 9.5em;
  padding: 0 2px;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  color: #2c2418;
  text-shadow:
    0 0 3px #f3e6c8,
    0 1px 0 #efe4cc,
    1px 0 0 #efe4cc,
    -1px 0 0 #efe4cc;
}

.world-map.land-dunkel .map-pin .map-art-label {
  color: #f0e2c4;
  text-shadow:
    0 1px 2px #0a0806,
    0 0 5px #1a120c,
    1px 0 0 #1a120c,
    -1px 0 0 #1a120c;
}

.world-map .map-pin {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.world-map .map-pin .pin-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
}

/* 1. Dungeons -> ROT */
.world-map .map-pin.kind-dungeon .pin-dot,
.world-map .map-pin.kind-tower .pin-dot {
  background: radial-gradient(circle at 35% 35%, #ff6b6b 0%, #e03131 55%, #8f0e1b 100%);
  border: 2px solid #ffc9c9;
  box-shadow: 0 0 8px rgba(224, 49, 49, 0.85), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.world-map .map-pin.kind-dungeon:hover .pin-dot,
.world-map .map-pin.kind-dungeon:focus-visible .pin-dot,
.world-map .map-pin.kind-tower:hover .pin-dot,
.world-map .map-pin.kind-tower:focus-visible .pin-dot {
  box-shadow: 0 0 16px rgba(255, 60, 60, 1), 0 0 28px rgba(255, 100, 100, 0.75);
  transform: scale(1.35);
}

/* 2. Städte -> GRÜN */
.world-map .map-pin.kind-city .pin-dot,
.world-map .map-pin.kind-castle .pin-dot,
.world-map .map-pin.kind-throne .pin-dot {
  background: radial-gradient(circle at 35% 35%, #51cf66 0%, #2f9e44 55%, #145523 100%);
  border: 2px solid #b2f2bb;
  box-shadow: 0 0 8px rgba(47, 158, 68, 0.85), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.world-map .map-pin.kind-city:hover .pin-dot,
.world-map .map-pin.kind-city:focus-visible .pin-dot,
.world-map .map-pin.kind-castle:hover .pin-dot,
.world-map .map-pin.kind-castle:focus-visible .pin-dot,
.world-map .map-pin.kind-throne:hover .pin-dot,
.world-map .map-pin.kind-throne:focus-visible .pin-dot {
  box-shadow: 0 0 16px rgba(50, 230, 80, 1), 0 0 28px rgba(120, 255, 150, 0.75);
  transform: scale(1.35);
}

/* 3. Minen -> GELB */
.world-map .map-pin.kind-mine .pin-dot {
  background: radial-gradient(circle at 35% 35%, #ffd43b 0%, #f08c00 55%, #8f4700 100%);
  border: 2px solid #fff3bf;
  box-shadow: 0 0 8px rgba(240, 140, 0, 0.85), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.world-map .map-pin.kind-mine:hover .pin-dot,
.world-map .map-pin.kind-mine:focus-visible .pin-dot {
  box-shadow: 0 0 16px rgba(255, 200, 20, 1), 0 0 28px rgba(255, 235, 100, 0.75);
  transform: scale(1.35);
}

/* 4. Restliche Pins -> BLAU (Felder, Pässe, Wälder, Wildnis, Wege, etc.) */
.world-map .map-pin .pin-dot,
.world-map .map-pin.kind-field .pin-dot,
.world-map .map-pin.kind-pass .pin-dot,
.world-map .map-pin.kind-woods .pin-dot,
.world-map .map-pin.kind-wild .pin-dot,
.world-map .map-pin.kind-way .pin-dot {
  background: radial-gradient(circle at 35% 35%, #4dabf7 0%, #1971c2 55%, #0d386b 100%);
  border: 2px solid #d0ebff;
  box-shadow: 0 0 8px rgba(25, 113, 194, 0.85), 0 2px 5px rgba(0, 0, 0, 0.7);
}

.world-map .map-pin:hover .pin-dot,
.world-map .map-pin:focus-visible .pin-dot {
  box-shadow: 0 0 16px rgba(50, 160, 255, 1), 0 0 28px rgba(120, 210, 255, 0.75);
  transform: scale(1.35);
}

/* Aktueller Standort (Here) */
.world-map .map-pin.here {
  z-index: 12;
}

.world-map .map-pin.here .pin-dot {
  transform: scale(1.25);
  box-shadow: 0 0 12px #fff, 0 0 22px rgba(255, 255, 255, 0.85);
}

.world-map .map-pin.here::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  pointer-events: none;
  animation: pin-pulse-ring 1.9s cubic-bezier(0.2, 0, 0.35, 1) infinite;
}

@keyframes pin-pulse-ring {
  0% {
    width: 18px;
    height: 18px;
    opacity: 1;
    box-shadow: 0 0 6px #fff;
  }
  100% {
    width: 48px;
    height: 48px;
    opacity: 0;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
  }
}

/* Nebel / Unerkundet (Fog) */
.world-map .map-pin.fog {
  opacity: 0.45;
  filter: saturate(0.55);
}

.world-map .map-pin.fog:hover,
.world-map .map-pin.fog:focus-visible {
  opacity: 0.95;
  filter: saturate(1);
}

/* Tooltip bei Hover / Fokus */
.world-map .map-pin .pin-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(16, 12, 20, 0.95);
  border: 1px solid rgba(244, 208, 104, 0.7);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff6dc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.18s;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 6px;
}

.world-map .map-pin .pin-tooltip .pin-tooltip-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.world-map .map-pin .pin-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(16, 12, 20, 0.95);
}

.world-map .map-pin:hover .pin-tooltip,
.world-map .map-pin:focus-visible .pin-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.world-map.plane-void:not(.land-void) {
  background:
    linear-gradient(160deg, rgba(200, 220, 230, 0.12), transparent 40%),
    linear-gradient(#12161c, #0a0c10);
  box-shadow: inset 0 0 80px rgba(180, 210, 230, 0.12);
}

.void-shard {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  padding: 8px 14px;
  border: 1px solid rgba(200, 220, 240, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfe4f2;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.caller-note {
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: #221c16;
  color: var(--ink);
  font-style: italic;
  line-height: 1.5;
}

.map-pin.kind-field,
.map-pin.kind-throne {
  background: #1a2228;
}

.create-name-box {
  position: relative;
  z-index: 30;
  max-width: 360px;
  margin: 12px 0 8px;
  display: grid;
  gap: 6px;
}

#create-name {
  position: relative;
  z-index: 31;
  pointer-events: auto;
  width: 100%;
  min-height: 44px;
}

.map-you {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -130%);
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1410;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #1a1410;
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}

.play-nav {
  display: flex;
  gap: 8px;
}

.magic-panel {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}

.magic-panel .field {
  max-width: none;
}

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

.portrait-wrap {
  display: inline-flex;
}

img.portrait,
.portrait-wrap img.portrait {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1a1612;
}

img.portrait-sm {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

img.thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #1a1612;
}

.slot-hero,
.item-line,
.fight-pics {
  display: flex;
  gap: 12px;
  align-items: center;
}

.item-line {
  align-items: flex-start;
  flex: 1;
}

.compare {
  margin-top: 6px;
  font-size: 0.82rem;
}

.compare-head {
  color: var(--muted);
  margin-bottom: 4px;
}

.compare-head em {
  font-style: normal;
  font-weight: 700;
  margin-right: 6px;
}

.compare.besser .compare-head em {
  color: #8fdb8f;
}

.compare.schwächer .compare-head em {
  color: #e08a8a;
}

.compare.gemischt .compare-head em {
  color: #e0c56a;
}

.compare ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.compare li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.compare li.up b {
  color: #8fdb8f;
}

.compare li.down b {
  color: #e08a8a;
}

.compare li.even b {
  color: var(--muted);
}

.fight-pics {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.fight-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fight-vitals {
  width: 176px;
  display: grid;
  gap: 6px;
}

.fight-vitals > div {
  display: grid;
  gap: 2px;
}

.fight-vitals span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fight-vitals b {
  font-size: 0.75rem;
  font-weight: 600;
}

.fight-vitals .bar {
  height: 8px;
}

.fight-pics .portrait,
.fight-pics img.portrait {
  width: 176px;
  height: 176px;
}

.monster-frame {
  position: relative;
  padding: 7px;
  border: 5px solid;
  border-radius: 10px;
  background: #120f0c;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 0 0 2px #0a0806;
}

.monster-frame img.portrait {
  display: block;
  border: 0;
  border-radius: 4px;
}

.monster-frame.frame-grau {
  border-color: #8d8a84;
  background: linear-gradient(#4a4742, #2a2825);
}

.monster-frame.frame-gruen {
  border-color: #4e9a5a;
  background: linear-gradient(#1e4a28, #122016);
}

.monster-frame.frame-blau {
  border-color: #4a7ec8;
  background: linear-gradient(#1b3358, #101824);
}

.monster-frame.frame-lila {
  border-color: #8a4ec8;
  background: linear-gradient(#3a1b58, #1a1024);
}

.monster-frame.frame-orange {
  border-color: #e08a28;
  background: linear-gradient(#5a3510, #24180c);
}

.monster-frame.frame-rot {
  border-color: #c43a32;
  background: linear-gradient(#5a1614, #240c0c);
}

.monster-frame.frame-schwarz {
  border-color: #111;
  background: linear-gradient(#2a2a2a, #080808);
  box-shadow:
    inset 0 0 0 2px #c9a227,
    0 0 0 2px #111,
    0 0 14px rgba(201, 162, 39, 0.35);
}

.monster-frame.frame-zackig {
  border-radius: 0;
  padding: 12px;
  clip-path: polygon(
    0% 10%,
    5% 0%,
    10% 10%,
    15% 0%,
    20% 10%,
    25% 0%,
    30% 10%,
    35% 0%,
    40% 10%,
    45% 0%,
    50% 10%,
    55% 0%,
    60% 10%,
    65% 0%,
    70% 10%,
    75% 0%,
    80% 10%,
    85% 0%,
    90% 10%,
    95% 0%,
    100% 10%,
    90% 15%,
    100% 20%,
    90% 25%,
    100% 30%,
    90% 35%,
    100% 40%,
    90% 45%,
    100% 50%,
    90% 55%,
    100% 60%,
    90% 65%,
    100% 70%,
    90% 75%,
    100% 80%,
    90% 85%,
    100% 90%,
    95% 100%,
    90% 90%,
    85% 100%,
    80% 90%,
    75% 100%,
    70% 90%,
    65% 100%,
    60% 90%,
    55% 100%,
    50% 90%,
    45% 100%,
    40% 90%,
    35% 100%,
    30% 90%,
    25% 100%,
    20% 90%,
    15% 100%,
    10% 90%,
    5% 100%,
    0% 90%,
    10% 85%,
    0% 80%,
    10% 75%,
    0% 70%,
    10% 65%,
    0% 60%,
    10% 55%,
    0% 50%,
    10% 45%,
    0% 40%,
    10% 35%,
    0% 30%,
    10% 25%,
    0% 20%,
    10% 15%
  );
}

.monster-frame.frame-zackig img.portrait {
  border-radius: 0;
}

.frame-crown {
  display: none;
}

.monster-frame.has-crown {
  margin-top: 22px;
}

.monster-frame.has-crown .frame-crown {
  display: block;
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  width: 86px;
  height: 22px;
  background:
    linear-gradient(#d8b84a, #8a6a18);
  clip-path: polygon(
    0% 100%,
    0% 55%,
    12% 70%,
    26% 10%,
    40% 70%,
    50% 0%,
    60% 70%,
    74% 10%,
    88% 70%,
    100% 55%,
    100% 100%
  );
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.monster-frame.has-crown::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -6px;
  height: 8px;
  background: linear-gradient(#111, #3a3a3a);
  border: 2px solid #c9a227;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  pointer-events: none;
}

.equip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.log {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.combat-layout {
  display: grid;
  grid-template-columns: minmax(200px, 30%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dung-log {
  margin: 0;
  max-height: min(72vh, 680px);
}

.attack-pick {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 4px 0 8px;
}

.attack-pick .field {
  margin: 0;
}

.attack-pick select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.attack-hint {
  margin: 0;
  min-height: 1.35em;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink);
}

.fight-act {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
  margin: 8px 0 4px;
}

.fight-act .attack {
  margin: 0;
}

.fight-caption {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  max-width: 200px;
}

@media (max-width: 820px) {
  .combat-layout {
    grid-template-columns: 1fr;
  }

  .dung-log {
    max-height: 220px;
  }
}

.log li,
.bag li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #241e18;
}

.mat-use-hints {
  font-size: 0.78em;
  opacity: 0.7;
  margin-top: 2px;
}

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

.nav-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-icon img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.sheet-books {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sheet-book {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 8px 12px;
  background: #241e18;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
}

.sheet-book img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.sheet-book span {
  font-size: 0.85rem;
  color: var(--gold);
}

.sheet-book:hover {
  border-color: var(--gold);
}

.book-pop-card {
  width: min(560px, 100%);
  text-align: left;
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
}

.book-pop-card .book-pop-list {
  overflow: auto;
  max-height: min(52vh, 480px);
  margin: 0 0 16px;
}

.book-pop-card button {
  align-self: center;
}

#book-pop-list .recipe-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.gold-badge,
.nav-marks {
  display: inline-flex;
  align-items: center;
  background: #241e18;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.mast h1,
h2,
h3,
.eyebrow {
  font-family: Georgia, "Times New Roman", serif;
}

.mast h1 {
  margin: 0;
  letter-spacing: 0.04em;
}

.sheet-head strong {
  color: var(--gold);
  font-size: 1.05rem;
}

.head-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.world-clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--muted, #b8a88a);
  font-size: 0.92rem;
}

.dung-stats-head {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dung-stats-head p {
  margin: 0;
}

.level-up-banner {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: linear-gradient(180deg, #3a2e1c, #241c12);
  color: var(--ink);
  cursor: pointer;
  animation: level-up-pop 0.45s ease-out;
}

.level-up-banner strong {
  display: block;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.level-up-banner span {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.level-up-banner small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

@keyframes level-up-pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.bug-report-btn {
  background: rgba(220, 50, 50, 0.8);
  color: white;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.bug-report-btn:hover {
  background: rgba(220, 50, 50, 1);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
  color: var(--fg);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  color: var(--fg);
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-light);
  color: var(--fg);
  font-family: inherit;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.form-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.form-actions button.secondary {
  background: var(--muted);
  color: var(--bg);
}

.form-actions button[type="submit"] {
  background: var(--gold);
  color: var(--bg);
}

.form-actions button:hover {
  opacity: 0.8;
}

.success {
  color: #4CAF50;
  text-align: center;
  font-weight: bold;
}

.admin-panel {
  max-width: 800px;
  max-height: 90vh;
}

.admin-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-stats span {
  font-weight: bold;
  color: var(--gold);
}

#bug-list {
  max-height: 60vh;
  overflow-y: auto;
}

.bug-report-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(18, 12, 8, 0.3);
}

.bug-report-item.status-new {
  border-left: 4px solid #ff6b6b;
}

.bug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bug-reporter {
  font-weight: bold;
  color: var(--gold);
}

.bug-timestamp {
  font-size: 0.8rem;
  color: var(--muted);
}

.bug-description {
  color: var(--fg);
  margin: 8px 0;
  line-height: 1.4;
}

.bug-expected {
  color: var(--muted);
  font-style: italic;
  margin: 8px 0;
}

.bug-meta {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.bug-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(220, 50, 50, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2100;
  animation: slideIn 0.3s ease-out;
}

.bug-notification button {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.hidden {
  display: none !important;
}

.lead,
.muted {
  color: var(--muted);
}

.book-page {
  white-space: pre-wrap;
}

h2 {
  margin: 0 0 8px;
}

h3 {
  margin: 18px 0 8px;
  color: var(--gold);
  font-size: 1rem;
}

.slot-grid,
.picks,
.preview,
.sheet-grid,
.equip-grid,
.rings {
  display: grid;
  gap: 10px;
}

.slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.cloud-box {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.cloud-in {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cloud-in p,
.cloud-box p {
  margin: 0;
}

#cloud-status-note {
  width: 100%;
  margin: 0;
}

.cloud-pop-card {
  text-align: left;
}

.cloud-pop-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cloud-pop-form input[type="text"],
.cloud-pop-form input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #2a231c;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.cloud-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cloud-pop-form .row {
  margin-top: 4px;
}

.cloud-pop-form #cloud-guest {
  width: 100%;
  min-width: 0;
}

.slot-card,
.panel,
.pick,
.equip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.slot-card p,
.pick span {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #2a231c;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
}

button:hover:not(:disabled) {
  border-color: var(--gold);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.ghost {
  background: transparent;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.picks {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pick {
  text-align: left;
  border-radius: 12px;
}

.pick.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.pick strong,
.pick span {
  display: block;
}

.field {
  display: grid;
  gap: 6px;
  max-width: 360px;
}

input {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #241e18;
  color: var(--ink);
}

.preview {
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.kv,
.plain,
.skills,
.bag {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.kv li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.kv.tall li {
  grid-template-columns: 140px auto 1fr auto;
  align-items: center;
}

.kv.tall li .attr-plus {
  justify-self: end;
  min-width: 2rem;
  padding: 2px 8px;
  line-height: 1.2;
}

.kv small {
  color: var(--muted);
}

.error {
  color: #e08a7a;
  min-height: 1.2em;
}

.craft-ok {
  color: var(--gold);
  min-height: 1.2em;
  margin: 8px 0 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.panel-head h3 {
  margin: 0;
}

.page-flip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-flip button {
  min-width: 2.2em;
  padding: 4px 8px;
}

.bars {
  margin: 16px 0;
}

.bars > div {
  flex: 1;
  display: grid;
  grid-template-columns: 56px 1fr 90px;
  gap: 8px;
  align-items: center;
}

.bar {
  height: 10px;
  background: #2a241c;
  border-radius: 99px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
}

.hp i {
  background: var(--hp);
}

.mana i {
  background: var(--mana);
}

.sheet-grid {
  grid-template-columns: 1fr 1fr;
}

.span-2 {
  grid-column: span 2;
}

.equip-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.rings {
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, 1fr);
}

.equip {
  text-align: left;
}

.equip span,
.equip small {
  display: block;
  width: 100%;
  color: var(--gold);
  font-size: 0.75rem;
}

.equip small {
  color: var(--muted);
}

.skills li {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.skill-row {
  position: relative;
  cursor: help;
}

.skill-hover-tip {
  position: fixed;
  z-index: 80;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #16130f;
  border: 1px solid var(--gold);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
  white-space: pre-wrap;
  box-shadow: 0 10px 28px #000a;
  pointer-events: none;
}

.plain li.skill-row {
  position: relative;
  cursor: help;
}

.skills span,
.skills em {
  color: var(--muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tabs .active,
.tabs button.active {
  border-color: var(--gold);
}

.craft-parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
  margin: 12px 0;
}

.craft-filter {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.craft-filter input {
  font: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1c1813;
  color: var(--ink);
}

.craft-part-picks {
  display: grid;
  gap: 6px;
}

.craft-part,
.craft-preview {
  background: #241e18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
}

.craft-recipe-book {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.craft-recipe-book h4 {
  margin: 0 0 6px;
  color: var(--gold);
}

.craft-recipe-book .bag {
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
}

#recipe-book .recipe-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.recipe-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.craft-part {
  display: grid;
  gap: 8px;
}

.craft-part span {
  font-size: 0.85rem;
}

.craft-part button {
  text-align: left;
}

#screen-skills .tabs {
  margin: 8px 0 4px;
}

.inv-toolbar {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.inv-search-wrap {
  display: grid;
  gap: 4px;
  max-width: 28rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.inv-search-wrap input {
  font: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1c1813;
  color: var(--ink);
}

#inv-chips {
  margin: 0;
}

#skill-pool-line {
  max-width: 52rem;
}

.skill-learn-note {
  min-height: 1.45em;
  margin: 6px 0 0;
}

.craft-preview {
  margin-bottom: 12px;
}

select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1c1813;
  color: var(--ink);
  max-width: 100%;
  box-sizing: border-box;
}

.craft-part select,
.smelt-ings select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.smelt-row {
  align-items: center;
}

.smelt-row select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.smelt-ings {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.smelt-ings select {
  width: 100%;
}

.smelt-rule-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.92em;
}

.smelt-rule-list li.current {
  font-weight: 600;
}

.guild-board {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #12100c;
  border: 1px solid #3a3428;
  display: grid;
  gap: 10px;
}

.board-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #1a1712;
  border: 1px dashed #6a5a3a;
  display: grid;
  gap: 6px;
}

.board-card.active {
  border-style: solid;
  border-color: var(--gold);
}

.black-veil {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: #000;
}

.class-pop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 8, 6, 0.72);
}

.class-pop-card {
  width: min(420px, 100%);
  padding: 22px 24px 20px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: #1a1612;
  text-align: center;
}

.class-pop-card .eyebrow {
  margin-bottom: 8px;
}

.class-pop-card h2 {
  margin: 0 0 10px;
  color: var(--gold);
}

.class-pop-card .lead {
  margin: 0 0 18px;
}

.class-pop-card button {
  min-width: 140px;
}

.gate-pop-card {
  width: min(920px, 100%);
}

.gate-pop-art {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0 0 16px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
  background: #0c0a08;
  cursor: pointer;
}

.gate-pop-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: cover;
  object-position: center;
}

.death-pop-card {
  border-color: #8a3030;
}

.death-pop-card h2 {
  color: #e8b4b4;
}

.chest-pop-card {
  border-color: #c9a227;
}

.chest-loot {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  text-align: left;
}

.chest-loot li {
  padding: 6px 0;
  border-bottom: 1px solid #3a3228;
}

#dung-chest-row.hidden {
  display: none;
}

#dung-camp-row.hidden {
  display: none;
}

.debug-console {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 12px;
  background: #16130f;
  border: 1px solid var(--gold);
  box-shadow: 0 12px 40px #0008;
  display: grid;
  gap: 10px;
}

.debug-console select {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: #2a231c;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.debug-console.hidden {
  display: none;
}

.bookshelf {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  padding: 12px 8px 8px;
  min-height: 120px;
  background: linear-gradient(#3a2a1c, #2a1c12);
  border: 2px solid #5a4030;
  border-radius: 8px;
}

.book-spine {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 140px;
  max-width: 52px;
  padding: 10px 6px;
  font-size: 0.78rem;
  line-height: 1.15;
  background: #6b2a22;
  color: #f3e6c8;
  border: 1px solid #8a5044;
  cursor: pointer;
}

.book-spine:nth-child(2n) {
  background: #2a3a5a;
  border-color: #4a6080;
}

.book-spine:nth-child(3n) {
  background: #3d4a28;
  border-color: #5a6a40;
}

.book-spine.read {
  opacity: 0.72;
  box-shadow: inset 0 0 0 2px #c9a227;
}

.mine-floor {
  position: relative;
  min-height: 420px;
  border-radius: 12px;
  padding: 14px;
  overflow: hidden;
  background-color: #1a120c;
  background-image: url("img/mines/stollen.jpg");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.mine-floor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 6, 4, 0.12), rgba(8, 6, 4, 0.38));
}

.mine-floor > * {
  position: relative;
  z-index: 1;
}

.mine-haul {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(18, 12, 8, 0.55);
}

.mine-haul strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.mine-haul p {
  margin: 0;
}

.vein-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8% 10%;
  align-content: center;
  padding: 24px 4% 40px;
  min-height: 380px;
}

.vein-card {
  position: relative;
  isolation: isolate;
  z-index: 1;
  width: 176px;
  height: 176px;
  max-width: 42vw;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
  color: #f0e4c8;
}

.vein-card .vein-art {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.vein-card.vein-side-left {
  justify-self: start;
  transform: rotate(-4deg);
}

.vein-card.vein-side-right {
  justify-self: end;
  transform: rotate(5deg);
}

.vein-card:nth-child(3) { margin-top: 8%; }
.vein-card:nth-child(4) { margin-top: 14%; }

.vein-card .vein-label {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 1;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(12, 8, 6, 0.72);
  font-size: 0.78rem;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.vein-card:hover:not(:disabled) {
  filter: brightness(1.12);
}

.vein-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

@media (max-width: 800px) {
  .preview,
  .sheet-grid,
  .rings {
    grid-template-columns: 1fr;
  }

  .sheet-books {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .kv.tall li {
    grid-template-columns: 1fr auto auto;
  }
}

/* =========================================================
   Interaktive Schmiede & Stationen
   ========================================================= */

.schmiede-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: url("img/ui/schmiede.jpg") center / cover no-repeat;
  background-color: #1a1410;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.4);
  margin: 10px 0 16px;
}

.schmiede-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schmiede-spot:hover,
.schmiede-spot:focus-visible {
  border-color: rgba(210, 174, 102, 0.95);
  background: radial-gradient(circle, rgba(210, 174, 102, 0.24) 0%, rgba(210, 174, 102, 0.06) 70%, transparent 100%);
  box-shadow: 0 0 25px rgba(210, 174, 102, 0.45), inset 0 0 15px rgba(210, 174, 102, 0.25);
}

.schmiede-spot.active {
  border-color: rgba(240, 190, 80, 0.95);
  background: radial-gradient(circle, rgba(240, 190, 80, 0.28) 0%, rgba(240, 190, 80, 0.08) 70%, transparent 100%);
  box-shadow: 0 0 20px rgba(240, 190, 80, 0.5);
}

.schmiede-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(18, 14, 10, 0.9);
  border: 1px solid rgba(210, 174, 102, 0.75);
  border-radius: 20px;
  color: #f0e6d2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.schmiede-spot:hover .schmiede-badge,
.schmiede-spot:focus-visible .schmiede-badge,
.schmiede-spot.active .schmiede-badge {
  opacity: 1;
  transform: scale(1.08);
  border-color: #ffd700;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

.schmiede-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 12, 10, 0.95);
  border: 1px solid var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.schmiede-spot:hover .schmiede-tip,
.schmiede-spot:focus-visible .schmiede-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.schmiede-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.schmiede-tabs button {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(30, 24, 18, 0.85);
  color: var(--ink);
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.schmiede-tabs button:hover {
  border-color: var(--gold);
  background: rgba(48, 38, 28, 0.95);
}

.schmiede-tabs button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #14110e;
  box-shadow: 0 0 12px rgba(210, 174, 102, 0.4);
}

.station-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.station-panel h3 {
  margin-top: 0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.smelt-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0 12px;
  align-items: start;
}

.smelt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smelt-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.qty-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-picker input {
  width: 75px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #14110e;
  color: var(--ink);
}

.qty-picker button {
  padding: 8px 12px;
  min-width: 38px;
  font-weight: 700;
  border-radius: 8px;
}

.smelt-summary-box {
  background: rgba(14, 11, 8, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smelt-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.gear-station-card {
  background: rgba(20, 16, 12, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.gear-station-card:hover {
  border-color: rgba(210, 174, 102, 0.6);
}

.gear-station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gear-station-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.gear-station-loc {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(60, 50, 40, 0.6);
  color: var(--muted);
}

.durability-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(50, 40, 30, 0.8);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.durability-bar-fill {
  height: 100%;
  background: #3da856;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.durability-bar-fill.warn {
  background: #d2ae66;
}

.durability-bar-fill.danger {
  background: #b4453a;
}

.durability-bar-wrap.eternal {
  background: rgba(60, 50, 30, 0.8);
}

.durability-bar-fill.eternal {
  background: linear-gradient(90deg, #8a7a3d, #d9c273, #8a7a3d);
}

.bottom-right-controls {
  position: fixed;
  bottom: 6px;
  right: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 50;
}

.version-badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 12, 8, 0.7);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.item-detailed-stats {
  background: rgba(18, 12, 8, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-family: monospace;
  font-size: 0.9rem;
}

.item-detailed-stats div {
  margin: 2px 0;
  display: grid;
  grid-template-columns: 120px 80px 60px;
  gap: 12px;
  align-items: center;
}

.item-detailed-stats div span:nth-child(1) {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-detailed-stats div span:nth-child(2) {
  text-align: right;
  font-weight: bold;
}

.item-detailed-stats .compare-value {
  color: var(--gold);
  font-weight: bold;
  text-align: right;
}

.item-detailed-stats .compare-value:empty::after {
  content: "—";
  color: var(--muted);
  opacity: 0.5;
}

.mat-req-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(30, 24, 18, 0.9);
  border: 1px solid var(--line);
}

.mat-req-badge.ok {
  border-color: rgba(61, 168, 86, 0.5);
  color: #6ed686;
}

.mat-req-badge.missing {
  border-color: rgba(180, 69, 58, 0.5);
  color: #e57373;
}

.gear-action-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.gear-action-row button {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

.in-station-rename {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

