/* ============================================================================
 * HIVE FORGE MMORPG - UI-Stylesheet
 * Ruhige Glas-Panels mit Messing-Linien, Inter für Bedientexte, Cinzel nur für
 * Überschriften. Alle Farben, Flächen & Abstände kommen aus den Tokens unten.
 * ============================================================================ */
:root {
    /* Flächen */
    --ui-bg: rgba(13, 15, 21, 0.84);
    --ui-bg-soft: rgba(13, 15, 21, 0.62);
    --ui-bg-solid: #12151c;
    --ui-bg-raised: #191d26;
    --ui-bg-hover: #222733;
    --ui-bg-inset: #0a0c11;
    --ui-scrim: rgba(5, 6, 10, 0.72);

    /* Linien */
    --ui-line: rgba(214, 180, 110, 0.2);
    --ui-line-strong: rgba(214, 180, 110, 0.48);
    --ui-line-neutral: rgba(255, 255, 255, 0.08);

    /* Text */
    --ui-text: #ece8df;
    --ui-text-dim: #b3ada0;
    --ui-text-muted: #9c978c;
    --ui-gold: #d9b56c;
    --ui-gold-bright: #f2d790;

    /* Spielwerte */
    --c-hp: #45b36b;
    --c-hp-enemy: #c9473f;
    --c-mana: #3d7ddb;
    --c-rage: #c8443c;
    --c-xp: #8e6be0;
    --c-swing: #d9b56c;
    --c-hbd: #4cc38a;
    --c-hive: #e5566e;
    --c-pool: #4fb3e8;
    --c-good: #4cc38a;
    --c-warn: #e0a84a;
    --c-bad: #e0645a;

    /* Form */
    --ui-radius: 10px;
    --ui-radius-sm: 7px;
    --ui-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --ui-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Cinzel', Georgia, serif;

    /* HUD-Raster: Breite der linken Einheitenfenster, des rechten HUDs & des Chats */
    --hud-left-w: 270px;
    --hud-right-w: 200px;
    --hud-chat-w: 345px;
    --hud-gap: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050811;
    color: var(--ui-text);
    font-family: var(--font-ui);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

/* Lucide-Icons aus dem Inline-Sprite (index.html) */
.ico {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.125em;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(214, 180, 110, 0.25);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 180, 110, 0.45);
}

::-webkit-scrollbar-track {
    background: transparent;
}

#game-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
    z-index: 1;
}

#game-viewport:active {
    cursor: grabbing;
}

#game-hud-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 2;
}

/* ============================================================================
 * GRUNDBAUSTEINE: Panel, Überschrift, Buttons, Formulare, Tabs, Karten
 * ============================================================================ */
.wow-frame {
    background: var(--ui-bg);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow), var(--ui-highlight);
    backdrop-filter: blur(10px) saturate(1.1);
}

.wow-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ui-gold-bright);
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.wow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(180deg, #262b36 0%, #1b1f28 100%);
    color: var(--ui-text);
    border: 1px solid var(--ui-line-neutral);
    border-top-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    padding: 8px 14px;
    border-radius: var(--ui-radius-sm);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}

.wow-btn:hover {
    background: linear-gradient(180deg, #2e3441 0%, #222733 100%);
    border-color: var(--ui-line-strong);
    color: #fff;
}

.wow-btn:active {
    transform: translateY(1px);
}

.wow-btn:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}

/* Tastaturbedienung der Fenster (#1590): Fokusrahmen für alle Bedienelemente in Fenstern –
   Schließen-Knopf, Taschenplätze, Eingabefelder und Links bekommen den goldenen Rahmen. */
.modal-backdrop :is(button, input, select, textarea, a[href], [tabindex]):focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

.wow-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.wow-btn.primary {
    background: linear-gradient(180deg, #e6c67f 0%, #bf9748 100%);
    border-color: #f3dca0;
    border-bottom-color: #8c6a2c;
    color: #1d1508;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wow-btn.primary:hover {
    background: linear-gradient(180deg, #f0d28f 0%, #cda457 100%);
    color: #120c03;
}

.wow-btn.hive {
    background: linear-gradient(180deg, #b8344c 0%, #8c2338 100%);
    border-color: rgba(255, 170, 185, 0.45);
    color: #fff4f6;
}

.wow-btn.hive:hover {
    background: linear-gradient(180deg, #cc3f59 0%, #9d2a41 100%);
    border-color: rgba(255, 190, 200, 0.7);
}

.wow-btn.voice-speaking {
    border-color: var(--c-good) !important;
    background: #1d5a3a !important;
    color: #e3fbee !important;
    box-shadow: 0 0 12px rgba(76, 195, 138, 0.6) !important;
}

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

/* Lange <option>-Texte dürfen Spalten nicht über den Fensterrand drücken */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

/* Alleinstehende Gruppen (Klasse, Start-Berufung) spannen die ganze Zeile */
.charcreate-grid .form-row > .form-group:only-child {
    grid-column: 1 / -1;
}

.form-group > select,
.form-group > input {
    width: 100%;
    min-width: 0;
}

.form-group label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ui-text-dim);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select {
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    color: var(--ui-text);
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    font-family: var(--font-ui);
    font-size: 13px;
    user-select: text;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: var(--ui-line-strong);
    box-shadow: 0 0 0 3px rgba(214, 180, 110, 0.15);
}

input[type="color"] {
    width: 100%;
    height: 34px;
    padding: 3px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    border-radius: var(--ui-radius-sm);
    cursor: pointer;
}

input[type="range"] {
    accent-color: var(--ui-gold);
    cursor: pointer;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.game-card {
    background: var(--ui-bg-raised);
    border: 1px solid var(--ui-line-neutral);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-highlight);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.game-card:hover {
    border-color: var(--ui-line);
    background: #1c212b;
}

.tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ui-line);
    margin-bottom: 12px;
}

.tabs-bar button,
.tabs-bar .tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 9px 14px;
    color: var(--ui-text-dim);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tabs-bar button:hover,
.tabs-bar .tab-btn:hover {
    color: var(--ui-text);
}

.tabs-bar button.active,
.tabs-bar .tab-btn.active {
    color: var(--ui-gold-bright);
    border-bottom-color: var(--ui-gold);
}

.tab-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-inset);
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-text-dim);
}

.rarity-common { color: #ffffff; }
.rarity-uncommon { color: #1eff00; }
.rarity-rare { color: #38bdf8; }
.rarity-epic { color: #c084fc; }
.rarity-legendary { color: #fb923c; }

.hidden {
    display: none !important;
}

/* Hinweis-Boxen (Lizenz gesperrt / freigeschaltet) */
.license-locked-box,
.license-unlocked-box {
    border-radius: var(--ui-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.license-locked-box {
    background: rgba(224, 168, 74, 0.08);
    border: 1px solid rgba(224, 168, 74, 0.35);
    box-shadow: inset 3px 0 0 var(--c-warn);
}

.license-compact {
    padding: 7px 8px 7px 14px;
}

.license-unlocked-box {
    background: rgba(76, 195, 138, 0.08);
    border: 1px solid rgba(76, 195, 138, 0.35);
    box-shadow: inset 3px 0 0 var(--c-good);
}

/* ============================================================================
 * HUD OBEN LINKS: Spieler- & Zielfenster
 * ============================================================================ */
#hud-unit-frames {
    position: fixed;
    top: var(--hud-gap);
    left: var(--hud-gap);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 20;
    pointer-events: auto;
}

/* Einheitenfenster im Stil von WoW Classic: rundes Portrait mit Stahlring links,
 * dahinter eine dunkle Metallplatte mit Namensband, Lebens- und Ressourcenleiste
 * direkt untereinander, Stufenkreis am unteren Rand des Portraits.
 * Keine Glas-Karte: .wow-frame-Optik wird hier bewusst zurückgenommen. */
.unit-frame {
    --uf-rim: linear-gradient(150deg, #d8cfb8 0%, #9c927c 16%, #5a534a 36%, #2c2925 50%, #6f685b 64%, #b3a992 82%, #4a443c 100%);
    --uf-plate: linear-gradient(180deg, #3a3733 0%, #26242a 45%, #18171c 100%);
    --uf-plate-line: #6a6157;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    min-width: 0;
    position: relative;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
}

#hud-target-frame.is-elite .unit-bars {
    border-color: var(--ui-gold);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(214, 180, 110, 0.35), 0 0 14px rgba(214, 180, 110, 0.3);
}

#hud-target-frame.is-elite .unit-portrait {
    background: linear-gradient(#0b0d12, #0b0d12) padding-box, linear-gradient(155deg, #f2d790 0%, #b08a3e 30%, #5a4318 55%, #e0c070 80%, #6b5020 100%) border-box;
}

#hud-target-frame.is-elite::after {
    content: attr(data-rank);
    position: absolute;
    top: -8px;
    right: 10px;
    z-index: 4;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--ui-gold);
    color: #1d1508;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Gruppen- & Raidfenster (js/party.js) */
/* Raid-Beute-Fenster (#1021): unter dem Raid-Rahmen, nur im Raid */
#hud-raid-loot {
    width: 236px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--ui-text);
}
#hud-raid-loot.hidden { display: none; }
#hud-raid-loot .rl-head { font-weight: 800; color: #fb923c; }
#hud-raid-loot .rl-lock { color: #cbd5e1; }
#hud-raid-loot .rl-chips { display: flex; gap: 4px; flex-wrap: wrap; }
#hud-raid-loot .rl-chip { padding: 1px 6px; border-radius: 8px; background: rgba(251, 146, 60, 0.14); color: #fed7aa; }
#hud-raid-loot .rl-chip.is-locked { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
#hud-raid-loot .rl-row { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; overflow: hidden; }
#hud-raid-loot .rl-boss { color: #94a3b8; flex: none; }
#hud-raid-loot .rl-who { color: #e2e8f0; font-weight: 700; flex: none; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
#hud-raid-loot .rl-item { overflow: hidden; text-overflow: ellipsis; }
#hud-raid-loot .rl-none, #hud-raid-loot .rl-empty { color: #94a3b8; }
body.mobile-mode #hud-raid-loot { display: none !important; }   /* Handy: Chronik + Raid-Fenster (Sperre mit Restzeit) */

#hud-party-frame {
    width: 236px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ui-text);
}

#hud-party-frame .party-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--ui-gold-bright);
}

#hud-party-frame .party-count {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--ui-text-dim);
    font-variant-numeric: tabular-nums;
}

#hud-party-frame .party-hint {
    color: var(--ui-text-muted);
    line-height: 1.35;
}

#hud-party-frame .party-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 46vh;
    overflow-y: auto;
}

#hud-party-frame .party-sub {
    margin-top: 3px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

#hud-party-frame .party-member {
    display: grid;
    grid-template-columns: 22px 1fr 72px;
    align-items: center;
    gap: 6px;
}

#hud-party-frame .party-member.is-self .party-name {
    color: var(--ui-gold-bright);
}

#hud-party-frame .party-member.is-away {
    opacity: 0.55;
}

#hud-party-frame .party-lvl {
    height: 16px;
    border-radius: 8px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 14px;
    color: var(--ui-gold);
    font-variant-numeric: tabular-nums;
}

#hud-party-frame .party-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#hud-party-frame .party-hp {
    height: 7px;
    border-radius: 4px;
    background: var(--ui-bg-inset);
    overflow: hidden;
}

#hud-party-frame .party-hp span {
    display: block;
    height: 100%;
    background: var(--c-hp);
    transition: width 0.25s ease;
}

#hud-party-frame .party-actions,
#hud-party-frame .party-invite-list,
#hud-party-frame .party-invite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#hud-party-frame .wow-btn {
    font-size: 10.5px;
    padding: 4px 8px;
}

#hud-party-frame .party-invite {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-line-strong);
    background: rgba(214, 180, 110, 0.08);
}

/* Portrait: Stahlring (Verlauf im Rahmen) um eine dunkle Scheibe; hängt vor der Platte */
.unit-portrait {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 5px solid transparent;
    background: radial-gradient(circle at 38% 32%, #2b3039 0%, #11141a 60%, #07080b 100%) padding-box, var(--uf-rim) border-box;
    box-shadow: 0 0 0 1px #0a0908, inset 0 0 0 1px rgba(0, 0, 0, 0.9), inset 0 2px 6px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--ui-gold-bright);
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    margin-right: -16px;
}

.unit-portrait .ico {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9));
}

/* Live gerendertes Heldenportrait (Canvas füllt die Scheibe; Schild-Symbol nur bis zum ersten Bild) */
.unit-portrait-render {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: none;
    z-index: 0;
}

.unit-portrait.has-render .unit-portrait-render {
    display: block;
}

.unit-portrait.has-render > .ico {
    display: none;
}

/* Innenschatten über dem Bild, damit die Scheibe weiter im Ring versenkt wirkt */
.unit-portrait.has-render::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.9), inset 0 3px 8px rgba(0, 0, 0, 0.7), inset 0 -2px 6px rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.unit-portrait .unit-level-badge {
    z-index: 2;
}

#hud-target-icon {
    color: #f0a39a;
}

/* Unverteilte Attribut-/Talentpunkte: grünes „+N“ oben links am Portrait, Klick öffnet das Talentfenster */
.unit-points-badge {
    position: absolute;
    top: -6px;
    left: -8px;
    z-index: 3;
    min-width: 24px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    border: 1px solid #0d3b24;
    background: linear-gradient(180deg, #4cc38a, #23875a);
    color: #fff;
    font: 700 11px/18px var(--font-ui);
    text-shadow: 0 1px 1px #0008;
    cursor: pointer;
    box-shadow: 0 0 0 2px #12151c, 0 0 6px rgba(76, 195, 138, 0.55);
}
/* Pulsieren über die Deckkraft eines Leuchtrings (#1567): box-shadow-Animation stylte am Handy jedes Bild den Knopf neu (Haupt-
   Thread), opacity läuft auf dem Compositor – gleiches Bild */
.unit-points-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 14px rgba(76, 195, 138, 0.95);
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    animation: pointsPulse 1.8s ease-in-out infinite;
}
.unit-points-badge.hidden { display: none; }
.unit-points-badge:hover { filter: brightness(1.15); }
@keyframes pointsPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .unit-points-badge::after { animation: none; } }

/* Stufenkreis unten rechts am Portrait, Goldzahl auf dunkler Scheibe (wie das Level-Medaillon in Classic) */
.unit-level-badge {
    position: absolute;
    bottom: -7px;
    right: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: radial-gradient(circle at 40% 35%, #2c2823 0%, #0e0d0b 80%) padding-box, var(--uf-rim) border-box;
    color: #ffd100;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #0a0908, 0 1px 3px rgba(0, 0, 0, 0.7);
    text-shadow: 0 1px 1px #000;
    font-variant-numeric: tabular-nums;
    z-index: 3;
}

/* Platte: Namensband + Leisten liegen bündig übereinander, linker Rand unter dem Portrait */
.unit-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 186px;
    max-width: 196px;
    border: 2px solid var(--uf-plate-line);
    border-radius: 5px 12px 12px 5px;
    background: var(--uf-plate);
    box-shadow: 0 0 0 1px #0a0908, inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.unit-bars > * {
    padding-left: 22px;
}

.unit-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: #ffd100;
    text-shadow: 0 1px 0 #000, 0 0 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.01em;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 3px 8px 2px 22px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.5) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.75);
    line-height: 1.25;
}

/* Zielfenster: Namensband färbt sich wie in Classic nach Gesinnung */
#hud-target-frame[data-reaction="hostile"] .unit-name {
    background: linear-gradient(180deg, rgba(150, 26, 20, 0.7) 0%, rgba(96, 14, 10, 0.75) 100%);
}

#hud-target-frame[data-reaction="friendly"] .unit-name {
    background: linear-gradient(180deg, rgba(26, 110, 46, 0.65) 0%, rgba(14, 70, 30, 0.75) 100%);
}

#hud-target-frame[data-reaction="player"] .unit-name {
    background: linear-gradient(180deg, rgba(20, 80, 140, 0.65) 0%, rgba(12, 50, 92, 0.75) 100%);
}

#hud-target-frame[data-reaction="neutral"] .unit-name {
    background: linear-gradient(180deg, rgba(150, 110, 10, 0.6) 0%, rgba(95, 68, 6, 0.7) 100%);
}

/* × im Namensband: Ziel abwählen (#818) */
.unit-clear {
    flex: none;
    align-self: center;
    width: 18px;
    height: 18px;
    margin: -2px -4px -2px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #e6e1d6;
    font: 700 14px/18px var(--font-ui, sans-serif);
    text-align: center;
    cursor: pointer;
    opacity: 0.75;
}

.unit-clear:hover,
.unit-clear:focus-visible {
    opacity: 1;
    background: rgba(160, 30, 24, 0.85);
    color: #fff;
}

body.touch-ui .unit-clear {
    width: 28px;
    height: 28px;
    margin: -6px -6px -6px 0;
    font-size: 18px;
    line-height: 28px;
}

#hud-player-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#hud-target-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#hud-target-sub {
    font-family: var(--font-ui);
    font-size: 10.5px !important;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

#hud-target-hint {
    font-size: 10px;
    color: var(--ui-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.unit-portrait-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fußzeile mit Angriff/Rüstung/GS – gibt es in Classic nicht, bleibt deshalb klein und dezent */
.unit-stats {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 8px 3px 22px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ui-text-dim);
    font-variant-numeric: tabular-nums;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 0, 0, 0.6);
}

#hud-gearscore {
    color: var(--ui-gold);
    font-weight: 600;
}

/* Leisten im Einheitenfenster: kantig, randlos, mit Classic-Farben (Grün/Blau/Rot/Gelb) */
#hud-unit-frames .unit-frame .bar-track {
    height: 14px;
    border: 0;
    border-radius: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.8);
    background: #0b0c10;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
    padding-left: 0;
}

#hud-unit-frames .unit-frame .bar-track + .bar-track {
    height: 12px;
}

#hud-unit-frames .unit-frame .bar-fill {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

#hud-unit-frames .unit-frame .bar-fill.hp,
#hud-unit-frames .unit-frame .bar-fill.enemy-hp {
    background: linear-gradient(180deg, #4ee64e 0%, #22c522 48%, #139313 100%);
}

#hud-unit-frames .unit-frame .bar-fill.mana {
    background: linear-gradient(180deg, #5d8cff 0%, #2456e6 48%, #1639a6 100%);
}

#hud-unit-frames .unit-frame .bar-fill.mana[data-resource="rage"] {
    background: linear-gradient(180deg, #ff5a4e 0%, #e0271c 48%, #9a1710 100%);
}

#hud-unit-frames .unit-frame .bar-fill.mana[data-resource="energy"] {
    background: linear-gradient(180deg, #fff27a 0%, #f2d823 48%, #b89d12 100%);
}

#hud-unit-frames .unit-frame .bar-label {
    left: 22px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 #000, 0 0 2px #000;
}

.bar-track {
    width: 100%;
    height: 14px;
    background: var(--ui-bg-inset);
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.bar-fill.hp {
    background: linear-gradient(180deg, #5cc681 0%, var(--c-hp) 55%, #2f8a50 100%);
}

.bar-fill.enemy-hp {
    background: linear-gradient(180deg, #db6158 0%, var(--c-hp-enemy) 55%, #973029 100%);
}

.bar-fill.mana {
    background: linear-gradient(180deg, #5a92e6 0%, var(--c-mana) 55%, #2a5fae 100%);
}

.bar-fill.mana[data-resource="rage"] {
    background: linear-gradient(180deg, #dc5a52 0%, var(--c-rage) 55%, #8f2a24 100%);
}

.bar-fill.mana[data-resource="energy"] {
    background: linear-gradient(180deg, #f2dc74 0%, #e0c34a 55%, #a88a1f 100%);
}

#rage-bar-track[data-kind="zeal"] #rage-bar-fill {
    background: linear-gradient(180deg, #f8e7a6 0%, #e8c55a 55%, #a7843f 100%);
}

#rage-bar-track[data-kind="combo"] #rage-bar-fill {
    background: linear-gradient(180deg, #f2dc74 0%, #e0c34a 55%, #a88a1f 100%);
}

#swing-timer-track.is-casting #swing-timer-fill {
    background: linear-gradient(180deg, #b9a3f5 0%, #8e6be0 55%, #5b3fb0 100%);
}

.bar-label {
    position: absolute;
    inset: 0;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * HUD OBEN MITTE: Wallet-Leiste & Phasen-Banner
 * Spalte zwischen linkem & rechtem HUD — umbrechen statt überlappen
 * ============================================================================ */
#hud-top-center {
    position: fixed;
    top: var(--hud-gap);
    left: var(--hud-left-w);
    right: var(--hud-right-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 20;
    pointer-events: none;
}

#hud-top-center > * {
    pointer-events: auto;
    max-width: 100%;
}

/* Event-/Wartungshinweise: wachsen als Zeile unter dem Lizenz-Banner, überdecken also nie die Geldleiste */
#hud-top-center > #hud-event-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}
#hud-event-pills:empty { display: none; }
.hud-event-pill {
    padding: 3px 14px;
    border-radius: 999px;
    font: 600 12px/1.6 Inter, system-ui, sans-serif;
    box-shadow: 0 2px 10px #0008;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hud-event-pill.is-maintenance { order: 0; }
.hud-event-pill.is-doublexp { order: 1; }
.hud-event-pill.is-halloween { order: 2; }
.hud-event-pill.is-doublexp { background: linear-gradient(135deg, #8a5a00, #b8860b); color: #fff8e0; }
.hud-event-pill.is-halloween { background: linear-gradient(135deg, #7c2d12, #c2410c); color: #ffe8cc; }
.hud-event-pill.is-maintenance { background: rgba(120, 72, 10, .88); border: 1px solid #f0b429; color: #ffe9b0; white-space: normal; text-align: center; }
.hud-event-pill.is-save-warning { background: rgba(120, 24, 24, .92); border: 1px solid #e46a6a; color: #ffe4e4; white-space: normal; text-align: center; }

#hud-hive-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 12px;
}

.currency-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.currency-pill .ico {
    font-size: 14px;
}

.currency-pill.gold .ico { color: #eab308; }
.currency-pill.hbd .ico { color: var(--c-hbd); }
.currency-pill.hive .ico { color: var(--c-hive); }
.currency-pill.pool .ico { color: var(--c-pool); }
.currency-pill.p2p .ico { color: var(--ui-text-dim); }

.currency-pill.pool,
.currency-pill.p2p {
    cursor: pointer;
}

.currency-pill.pool:hover,
.currency-pill.p2p:hover {
    background: rgba(255, 255, 255, 0.05);
}

.currency-pill.p2p.p2p-live {
    color: var(--c-good);
}

.currency-pill.p2p.p2p-live .ico {
    color: var(--c-good);
}

.hud-bar-divider {
    width: 1px;
    height: 18px;
    background: var(--ui-line);
    margin: 0 4px;
}

.hud-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ui-text-muted);
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hud-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ui-text);
}

.hud-icon-btn:focus-visible,
.action-slot:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}

.hud-icon-btn.primary {
    color: var(--ui-gold-bright);
}

.hud-icon-btn.voice-speaking {
    color: #e3fbee;
    background: rgba(76, 195, 138, 0.25);
    border-color: var(--c-good);
}

#btn-hive-login {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 8px;
    margin-left: 2px;
}

#btn-hive-login.is-live .ico {
    color: var(--c-good);
}

#hud-career-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 6px 14px;
    border-radius: 12px;
    width: min(560px, 100%);
}

.career-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.career-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: var(--ui-text-dim);
    min-width: 0;
}

.career-phase {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-gold);
}

#hud-career-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.career-progress {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

#hud-career-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--ui-gold) 0%, var(--ui-gold-bright) 100%);
    border-radius: 2px;
    transition: width 0.4s ease;
}

#hud-career-banner.is-complete #hud-career-progress-fill {
    background: var(--c-good);
}

#btn-hud-buy-license {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
}

/* Schlanke Geldleiste (#707, Nutzer: „UI muss minimalistischer werden, vor allem Hive-Wallet“): zugeklappt nur Gold (mit
   Lizenz-Fortschritt als Strich unter dem Betrag), Mitspieler (nur wenn jemand da ist), Mikro, Einstellungen, ▾ und das
   Konto-Symbol. ▾ bzw. ein Klick aufs Gold klappt HBD/HIVE/Spendenpool, Musik/Vollbild/Touch und das Lizenz-Banner auf
   (main.js `setWalletOpen`, gemerkt in localStorage). Ist die Lizenz bezahlbar, erscheint das Banner von selbst. */
#hud-gold-pill {
    position: relative;
    cursor: pointer;
}
#hud-gold-pill:hover {
    background: rgba(255, 255, 255, 0.05);
}
.gold-lic {
    display: none;
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 1px;
    height: 2px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.gold-lic > i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--ui-gold) 0%, var(--ui-gold-bright) 100%);
}
#hud-top-center.needs-license:not(.wallet-open) .gold-lic {
    display: block;
}
#btn-wallet-more .ico {
    transform: rotate(180deg);
    transition: transform 0.15s;
}
#hud-top-center.wallet-open #btn-wallet-more .ico {
    transform: none;
}
#hud-top-center:not(.wallet-open) .wallet-extra,
#hud-top-center:not(.wallet-open) #hud-p2p-pill:not(.p2p-live),
#hud-top-center:not(.wallet-open) #hud-career-banner:not(.is-ready) {
    display: none;
}
#hud-top-center:not(.wallet-open) #btn-hive-login {
    padding: 5px 7px;
}
#hud-top-center:not(.wallet-open) #btn-hive-login > span {
    display: none;
}
body.hud-edit #hud-top-center .wallet-extra {
    display: inline-flex;
}
body.hud-edit #hud-top-center #hud-career-banner {
    display: flex;
}
/* HIVE-Radar nur, wenn ein Schatz in der Zone liegt */
#hive-radar-status.is-empty {
    display: none;
}
/* Entscheidung #17: Gruppenfenster nur mit Gruppe, Einladung oder Mitspielern in der Nähe (party.js .is-solo); Event-Hinweise
   per × wegklickbar (main.js eventPill). HBD/HIVE zugeklappt nicht mehr – oben steht nur Gold (#797, Playtest #51) */
#hud-party-frame.is-solo {
    display: none;
}
body.hud-edit #hud-party-frame.is-solo {
    display: flex;
}
.hud-event-pill .hep-x {
    pointer-events: auto;
    margin-left: 8px;
    padding: 0 2px;
    border: 0;
    background: none;
    color: inherit;
    opacity: 0.7;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.hud-event-pill .hep-x:hover,
.hud-event-pill .hep-x:focus-visible {
    opacity: 1;
}
body.touch-ui .hud-event-pill .hep-x {
    min-width: 32px;
    min-height: 24px;
}

#world-announcement-banner {
    position: fixed;
    top: 112px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    max-width: min(760px, 92vw);
    pointer-events: none;
}
.wa-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 38px 11px 16px;
    font-size: 14px;
    line-height: 1.45;
    color: #fff4f6;
    background: linear-gradient(90deg, rgba(140, 35, 56, 0.96), rgba(150, 96, 30, 0.96));
    border: 1px solid rgba(242, 215, 144, 0.65);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow), 0 0 24px rgba(229, 86, 110, 0.35);
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.2s, transform 0.2s;
}
.wa-item:hover { border-color: rgba(242, 215, 144, 0.95); }
.wa-item.wa-out { opacity: 0; transform: translateY(-6px); }
.wa-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f2d790;
}
.wa-text { font-weight: 500; }
.wa-close {
    position: absolute;
    top: 7px;
    right: 11px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.75;
}
.wa-item:hover .wa-close { opacity: 1; }

/* ============================================================================
 * HUD RECHTS: Zone, Minimap, Radar & Quest-Tracker (im Fluss gestapelt)
 * ============================================================================ */
#hud-right-column {
    position: fixed;
    top: var(--hud-gap);
    right: var(--hud-gap);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 20;
    pointer-events: none;
}

#hud-right-column > * {
    pointer-events: auto;
}

#hud-minimap-wrap {
    position: relative;
    width: 176px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#zone-banner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px 7px;
    border-radius: var(--ui-radius);
    background: var(--ui-bg-soft);
    text-align: center;
}

.zone-name {
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ui-gold-bright);
    text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.85);
}

.zone-level {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-text-dim);
    text-shadow: 0 1px 2px #000;
}

#minimap-frame {
    position: relative;
    line-height: 0;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(160deg, rgba(242, 215, 144, 0.65), rgba(120, 92, 40, 0.65));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#minimap-frame::after {
    content: 'N';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    background: #12151c;
    border: 1px solid var(--ui-line-strong);
    text-align: center;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 9px;
    color: var(--ui-gold-bright);
    pointer-events: none;
}

#minimap-canvas {
    width: 152px;
    height: 152px;
    border-radius: 50%;
    border: 2px solid #0d1016;
    background: #09131c;
    display: block;
}

#hud-world-clock,
#hive-radar-status {
    width: auto;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-align: center;
    color: var(--ui-text-dim);
    background: var(--ui-bg-soft);
}

#hud-right-tracker {
    width: 265px;
    padding: 10px 12px;
    max-height: 44vh;
    overflow-y: auto;
    background: var(--ui-bg-soft);
}

#hud-right-tracker > .wow-title {
    font-family: var(--font-ui);
    font-size: 10.5px !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-gold);
    text-shadow: none;
}

#hud-merc-count {
    color: var(--c-good) !important;
    font-size: 10.5px !important;
}

.quest-item-hud {
    border-bottom: 1px solid var(--ui-line-neutral);
    padding: 6px 0;
    font-size: 12px;
}

.quest-item-hud:last-child {
    border-bottom: none;
}

#hud-right-tracker.is-empty {
    padding: 8px 12px;
}

#hud-right-tracker.is-empty > .wow-title {
    margin-bottom: 3px !important;
}

#hud-right-tracker.is-empty #hud-merc-count {
    display: none;
}

.quest-item-hud.quest-empty {
    padding: 0;
    color: var(--ui-text-dim);   /* #1508: Muted (#7d786d) lag bei Tag unter 3:1 auf dem Tracker */
    font-size: 11.5px;
}

/* ============================================================================
 * HUD UNTEN LINKS: Chronik & P2P-Chat (mit getrennten Reitern: Chat / Chronik / Alle)
 * ============================================================================ */
#hud-chat-log {
    position: fixed;
    bottom: var(--hud-gap);
    left: var(--hud-gap);
    width: var(--hud-chat-w);
    height: 184px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    z-index: 18;
    background: var(--ui-bg-soft);
}

#hud-chat-log > .wow-title,
#hud-chat-log > .wow-title.hud-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 10.5px !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-gold);
    text-shadow: none;
    margin-bottom: 5px !important;
    min-height: 24px;
}

.hud-chat-tabs {
    display: flex;
    gap: 3px;
    align-items: center;
}

.hud-chat-tab {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(214, 180, 110, 0.25);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.hud-chat-tab:hover {
    color: var(--ui-text);
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(214, 180, 110, 0.45);
}

.hud-chat-tab.active {
    color: var(--ui-gold-bright);
    background: rgba(214, 180, 110, 0.2);
    border-color: var(--ui-gold);
    box-shadow: 0 0 6px rgba(214, 180, 110, 0.3);
}

.hud-chat-unread-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    display: inline-block;
    animation: pulse-chat-dot 1.4s ease-in-out infinite;
}

.hud-chat-unread-dot.hidden {
    display: none !important;
}

@keyframes pulse-chat-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.6; }
}

#hud-chat-log > .wow-title > span:last-child,
.hud-chat-hint {
    color: var(--ui-text-muted) !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chat-messages {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: text;
}

.chat-pane {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--ui-text-dim);
    user-select: text;
}

.chat-pane.hidden {
    display: none !important;
}

.log-msg.system { color: #e3cf96; }
.log-msg.loot { color: #6fd08f; font-weight: 600; }
.log-msg.hive { color: #f08a9b; font-weight: 600; }
.log-msg.combat { color: #e8968e; }
.log-msg.craft { color: #b9a0ea; font-weight: 600; }
.log-msg.chat { color: #67e8f9; font-weight: 500; }
.log-msg.party { color: #86efac; font-weight: 500; }   /* Gruppenchat /g (#1500) */
.log-msg.world-donate {
    color: #fff4f6;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(184, 52, 76, 0.4), rgba(214, 180, 110, 0.18));
    border-left: 2px solid var(--ui-gold);
    padding: 3px 6px;
    border-radius: 4px;
}

#chat-input-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--ui-line-neutral);
}

#inp-chat-msg {
    flex: 1;
    min-width: 0;
    padding: 5px 9px;
    font-size: 12px;
}

#chat-input-row .wow-btn {
    padding: 4px 8px !important;
}

/* Emote-Menü (#70): Popover über dem Chat-Eingabefeld, 2-Spalten-Liste aller Gesten */
#emote-wrap { position: relative; }

#emote-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    background: var(--ui-panel, #0d1a2e);
    border: 1px solid var(--ui-line-neutral, #2a3a5a);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.55);
    white-space: nowrap;
}

#emote-menu.hidden { display: none; }

.emote-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    font-size: 12px;
    color: var(--ui-text, #e8ecff);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.emote-item:hover, .emote-item:focus-visible {
    background: rgba(212,168,0,.18);
    outline: none;
}

.emote-ico { font-size: 14px; }

/* ============================================================================
 * HUD UNTEN MITTE: Rohstoffe, Schwung-/Wut-Balken, XP & Aktionsleiste
 * ============================================================================ */
/* Das Dock spannt sich ohne transform über die Breite (Kinder zentriert): ein translateX(-50%) würde es zum
 * Containing Block für fixed-positionierte Kinder machen, und die HUD-Anordnung löst Leisten daraus heraus. */
#hud-action-dock {
    position: fixed;
    bottom: var(--hud-gap);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 22;
    pointer-events: none;
}

#hud-action-dock-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

/* Begleiterleiste (#1105, js/pets.js): Befehle wie in WoW über der Aktionsleiste – Angreifen, Folgen, Bleiben, Modus, Fähigkeit */
#hud-pet-bar {
    display: flex;
    gap: 4px;
    padding: 3px 5px;
    border-radius: 9px;
    background: var(--ui-bg-soft);
    pointer-events: auto;
}
#hud-pet-bar.hidden, #hud-pet-frame.hidden, #hud-pet-frame .hidden { display: none; }
.pet-cmd {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #5a534a;
    border-radius: 7px;
    background: linear-gradient(180deg, #34312d 0%, #1c1b20 100%);
    color: #f5f0e6;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.pet-cmd:hover:not(:disabled) { border-color: #d8cfb8; }
.pet-cmd.active { border-color: #ffd100; box-shadow: 0 0 0 1px #ffd10066 inset; }
.pet-cmd.autocast { box-shadow: 0 0 6px 1px #c084fcaa; border-color: #c084fc; }
.pet-cmd:disabled { opacity: 0.4; cursor: default; }
.pet-cmd .pet-key {
    position: absolute;
    right: 2px;
    bottom: 1px;
    font-size: 9px;
    color: #cbd5e1;
    opacity: 0.8;
}
#hud-pet-frame {
    --pet-q: #a3e635;
    min-width: 176px;
    max-width: 230px;
    padding: 5px 8px 6px;
    border: 1px solid #6a6157;
    border-left: 3px solid var(--pet-q);
    border-radius: 6px;
    background: linear-gradient(180deg, #3a3733 0%, #26242a 45%, #18171c 100%);
    color: #f5f0e6;
    font-size: 12px;
}
#hud-pet-frame .pet-name { color: var(--pet-q); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-pet-frame .pet-hp { position: relative; height: 12px; margin-top: 3px; background: #0b0a0d; border-radius: 2px; overflow: hidden; }
#hud-pet-frame .pet-hp-fill { height: 100%; background: linear-gradient(180deg, #2fd34f 0%, #12892a 100%); }
#hud-pet-frame .pet-hp-text { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 12px; text-shadow: 0 1px 1px #000; }
#hud-pet-frame .pet-meta { margin-top: 3px; font-size: 10.5px; color: #cbd5e1; white-space: nowrap; }
body.touch-ui .pet-cmd { width: 38px; height: 38px; }

#hud-resource-strip {
    display: flex;
    gap: 3px;
    padding: 4px;
    border-radius: 10px;
    background: var(--ui-bg-soft);
}

.res-badge {
    position: relative;
    width: 34px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 15px;
    cursor: help;
}

.res-badge:hover {
    background: rgba(255, 255, 255, 0.08);
}

.res-badge strong {
    position: absolute;
    right: 2px;
    bottom: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff !important;
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
    font-variant-numeric: tabular-nums;
}

.res-badge.empty {
    opacity: 0.35;
}
/* Entscheidung #21 (Nutzer): nur Rohstoffe zeigen, die man hat – ganz ohne verschwindet die Leiste; im HUD-Editiermodus
   bleiben alle Felder sichtbar, damit man die Leiste platzieren kann */
body:not(.hud-edit) .res-badge.empty {
    display: none;
}
body:not(.hud-edit) #hud-resource-strip:not(:has(.res-badge:not(.empty))) {
    display: none;
}

#swing-bar-row {
    display: flex;
    gap: 6px;
    width: 100%;
}
/* Entscheidung #22: nur im Kampf, beim Wirken oder mit Eifer/Wut/Kombopunkten (main.js .is-idle); im HUD-Editiermodus sichtbar */
body:not(.hud-edit) #swing-bar-row.is-idle {
    display: none;
}

#swing-timer-track,
#rage-bar-track {
    flex: 1;
    height: 14px;
    background: var(--ui-bg-inset);
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px var(--ui-line-neutral);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

#swing-timer-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #e9cc8a 0%, var(--c-swing) 55%, #a7843f 100%);
    transition: width 0.06s linear;
}

#rage-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #dc5a52 0%, var(--c-rage) 55%, #8f2a24 100%);
    transition: width 0.12s ease;
}

#swing-timer-label,
#rage-bar-label {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0 8px;
    line-height: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
    font-variant-numeric: tabular-nums;
}

#combo-counter {
    min-width: 74px;
    height: 14px;
    padding: 0 8px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--ui-gold);
    white-space: nowrap;
}

#combo-counter.combo-hot {
    border-color: var(--ui-gold-bright);
    color: var(--ui-gold-bright);
    box-shadow: 0 0 10px rgba(242, 215, 144, 0.45);
}

#xp-bar-track {
    width: 100%;
    height: 6px;
    background: var(--ui-bg-inset);
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px var(--ui-line-neutral);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

#xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6f4fc4 0%, var(--c-xp) 100%);
    width: 15%;
    box-shadow: 0 0 8px rgba(142, 107, 224, 0.6);
}

/* 10 dezente Abschnitts-Markierungen */
#xp-bar-track::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(0, 0, 0, 0.55) calc(10% - 1px), rgba(0, 0, 0, 0.55) 10%);
    pointer-events: none;
}

.action-bar-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border-radius: 14px;
}

.action-slot {
    width: 48px;
    height: 48px;
    background: linear-gradient(180deg, #1f242e 0%, #12151c 100%);
    border: 1px solid var(--ui-line-neutral);
    border-top-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ui-text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.08s;
}

.action-slot:hover {
    border-color: var(--ui-line-strong);
    background: linear-gradient(180deg, #272d39 0%, #181c25 100%);
}

.action-slot:active {
    transform: translateY(1px);
}

/* Klassen-Skills (Taste 1–7) */
.action-slot[data-slot] { color: #f2d790; }
.action-slot.is-talent { color: #f0877d; }
.action-slot.slot-menu { color: var(--ui-text-dim); }
.action-slot.slot-menu:hover { color: var(--ui-text); }

.action-slot.is-locked {
    color: var(--ui-text-muted);
    opacity: 0.5;
}

.action-slot .slot-lock {
    position: absolute;
    bottom: 3px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--ui-text-dim);
}

.action-slot.is-unaffordable .slot-icon {
    opacity: 0.4;
}

.action-slot.is-unaffordable {
    box-shadow: inset 0 0 14px rgba(61, 125, 219, 0.35);
}

.action-slot.is-active {
    border-color: var(--c-good);
    box-shadow: inset 0 0 12px rgba(76, 195, 138, 0.3), 0 0 10px rgba(76, 195, 138, 0.45);
}

.action-slot.auto-active {
    border-color: var(--c-bad);
    box-shadow: inset 0 0 12px rgba(224, 100, 90, 0.35), 0 0 10px rgba(224, 100, 90, 0.5);
}

.action-slot.rage-ready {
    border-color: var(--ui-gold-bright);
    box-shadow: inset 0 0 12px rgba(242, 215, 144, 0.3), 0 0 10px rgba(242, 215, 144, 0.45);
}

.action-slot.ult-locked {
    color: var(--ui-text-muted);
    opacity: 0.55;
}

.action-slot.ult-locked::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 10px;
    height: 10px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.action-slot.ult-ready {
    border-color: #f0877d;
    box-shadow: inset 0 0 12px rgba(240, 135, 125, 0.35), 0 0 14px rgba(240, 135, 125, 0.6);
    animation: ultPulse 1.2s ease-in-out infinite;
}

@keyframes ultPulse {
    0%, 100% { box-shadow: inset 0 0 12px rgba(240, 135, 125, 0.35), 0 0 8px rgba(240, 135, 125, 0.45); }
    50% { box-shadow: inset 0 0 14px rgba(240, 135, 125, 0.5), 0 0 18px rgba(240, 135, 125, 0.8); }
}

.action-slot.talent-points-available::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-good);
    box-shadow: 0 0 0 2px #12151c, 0 0 8px rgba(76, 195, 138, 0.8);
}

.slot-cd {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 10, 0.72);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.action-slot .slot-key {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ui-text-muted);
    line-height: 1;
}

/* Controller-Symbole (#795, padglyphs.js): Xbox-Farben, nur im Pad-Modus statt der Tastenziffer */
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 8px; font: 800 9px/1 Inter, system-ui, sans-serif; color: #0d1117; background: #9aa4b1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.pg-a { background: #3fb950; } .pg-b { background: #e5534b; } .pg-x { background: #4493f8; } .pg-y { background: #d4a72c; }
.pg-a, .pg-b, .pg-x, .pg-y { width: 15px; padding: 0; border-radius: 50%; }
.pg-ps-x, .pg-ps-o, .pg-ps-s, .pg-ps-t, .pg-ns { width: 15px; padding: 0; border-radius: 50%; background: #2b313b; font-size: 10px; }
.pg-ps-x { color: #7cb7ff; } .pg-ps-o { color: #ff6b6b; } .pg-ps-s { color: #f49ac2; } .pg-ps-t { color: #4cd3a7; }
.pg-ns { color: #e6e9ee; }
.pg-sh { border-radius: 4px; background: #c9d1d9; font-size: 8px; padding: 0 4px; }
.pg-dp, .pg-st, .pg-sys { border-radius: 4px; background: #c9d1d9; }
.action-slot .slot-pad { position: absolute; top: 2px; left: 3px; line-height: 1; display: none; }
body.pad-mode .action-slot .slot-pad { display: block; }
body.pad-mode .action-slot .slot-key:has(+ .slot-pad:not(:empty)) { display: none; }
/* Touch (#830): Tastenhinweise „I“/„Esc“ an den Menüknöpfen bedeuten am Handy nichts – das Symbol reicht */
body.touch-ui .action-slot.slot-menu .slot-key { display: none; }
/* LT/RT-Ebene: Kombinations-Symbole „LT + X“ kompakt; beim Halten des Triggers leuchten die Fähigkeiten der Ebene auf */
.pg-mod { font-size: 7.5px; padding: 0 3px; margin-right: 1px; background: #8b949e; }
.action-slot .slot-pad { display: none; white-space: nowrap; }
body.pad-mode.pad-lt .action-slot:has(.slot-pad .pg-mod) { box-shadow: 0 0 0 2px #f0b429, 0 0 12px rgba(240, 180, 41, 0.45); }
body.pad-mode.pad-lt .slot-pad .pg-mod { background: #f0b429; }

.action-slot .slot-icon {
    font-size: 22px;
    display: flex;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Prozedurale Zauber-Icons (js/spellicons.js): füllen den Slot, Taste/Abklingzeit/Schloss liegen darüber */
.spell-ico { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.action-slot .slot-icon:has(.spell-ico) { position: absolute; inset: 3px; z-index: 0; filter: none; border-radius: 6px; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
.action-slot .slot-icon:has(.spell-ico) ~ .slot-cd { z-index: 2; border-radius: 6px; inset: 3px; }

/* Kampfgefühl (Nutzer 2026-11-17): Abklingzeit als Uhr-Wischer, Druck-Rückmeldung im selben Bild, vorgemerkter Zauber, Bereit-Blitz */
@property --sweep { syntax: '<number>'; inherits: false; initial-value: 0; }
@keyframes slot-sweep { from { --sweep: 1; } to { --sweep: 0; } }
.action-slot .slot-sweep { position: absolute; inset: 3px; z-index: 1; border-radius: 6px; pointer-events: none;
    background: conic-gradient(transparent 0turn calc((1 - var(--sweep)) * 1turn), rgba(4, 6, 10, 0.7) 0); }
.action-slot .slot-cd { background: transparent; text-shadow: 0 0 3px #000, 0 1px 2px #000; font-size: 14px; }
.action-slot.is-pressed { transform: scale(0.92); filter: brightness(1.35); transition: transform 0.03s, filter 0.03s; }
.action-slot.is-queued { box-shadow: 0 0 0 2px #fde68a, 0 0 12px rgba(253, 230, 138, 0.75); }
@keyframes slot-ready { 0% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 18px rgba(253, 230, 138, 0.95); } 100% { box-shadow: 0 0 0 0 transparent, 0 0 0 transparent; } }
.action-slot.cd-ready { animation: slot-ready 0.45s ease-out; }

/* Wirkleiste über der Aktionsleiste (WoW-Stil); der Balken läuft als CSS-Animation (js: castBar in main.js) */
@keyframes cast-bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cast-bar-flash { 0% { filter: brightness(1.9); } 100% { filter: brightness(1); } }
.cast-bar { position: fixed; left: 50%; bottom: 168px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 6px;
    width: min(320px, 80vw); pointer-events: none; transition: opacity 0.22s ease; }
.cast-bar.is-hidden { opacity: 0; transition-duration: 0.35s; }
.cast-bar-icon { width: 30px; height: 30px; flex: none; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.6); }
.cast-bar:not(.has-icon) .cast-bar-icon { display: none; }
.cast-bar-track { position: relative; flex: 1; height: 20px; border-radius: 4px; overflow: hidden; background: rgba(8, 10, 16, 0.88);
    border: 1px solid rgba(255, 236, 179, 0.35); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65), inset 0 1px 3px rgba(0, 0, 0, 0.8); }
.cast-bar-fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); will-change: transform;
    background: linear-gradient(180deg, #ffe9a8 0%, #f5b83d 45%, #a8661a 100%); box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.35); }
.cast-bar-name, .cast-bar-time { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; white-space: nowrap; color: #fff;
    font: 600 11.5px/1 var(--font-ui, Inter, system-ui, sans-serif); text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.cast-bar-name { left: 8px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.cast-bar-time { right: 8px; font-variant-numeric: tabular-nums; }
.cast-bar.is-done .cast-bar-fill { background: linear-gradient(180deg, #fff7d6 0%, #fde68a 50%, #d4a72c 100%); animation: cast-bar-flash 0.28s ease-out; }
.cast-bar.is-done .cast-bar-track { border-color: rgba(255, 245, 200, 0.9); box-shadow: 0 0 16px rgba(253, 230, 138, 0.85), inset 0 1px 3px rgba(0, 0, 0, 0.8); }
.cast-bar.is-fail .cast-bar-fill { background: linear-gradient(180deg, #fca5a5 0%, #dc2626 55%, #7f1d1d 100%); }
.cast-bar.is-fail .cast-bar-track { border-color: rgba(248, 113, 113, 0.8); }
/* Handy/Touch: dort zeigt die Dock-Leiste das Wirken (#1817), keine zweite Leiste */
body.mobile-mode .cast-bar, body.touch-ui .cast-bar { display: none; }
.action-slot:has(.spell-ico) .slot-key { z-index: 1; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000; }
.action-slot:has(.spell-ico) .slot-lock { z-index: 1; color: #e6e9ee; text-shadow: 0 0 2px #000, 0 1px 2px #000; }
.action-slot:has(.spell-ico) .slot-pad { position: relative; z-index: 1; }
.action-slot.is-locked .spell-ico { filter: grayscale(1) brightness(0.5); }
.action-slot.is-unaffordable .spell-ico { filter: saturate(0.35) brightness(0.75); }
.buff-chip .spell-ico { border-radius: 5px; }
.buff-chip:has(.spell-ico) { padding: 0; overflow: hidden; }
.touch-act-btn .spell-ico { width: 64%; height: 64%; border-radius: 22%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.touch-act-btn.is-locked .spell-ico { filter: grayscale(1) brightness(0.5); }

.action-divider {
    width: 1px;
    height: 32px;
    background: var(--ui-line);
    margin: 0 4px;
}

/* ============================================================================
 * FENSTER (Atelier, Auktionshaus, Quests/Söldner, Hive, Talente)
 * ============================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--ui-scrim);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.modal-window {
    width: min(980px, 94vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #171b24 0%, var(--ui-bg-solid) 140px);
    border: 1px solid var(--ui-line);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), var(--ui-highlight);
    border-radius: 14px;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--ui-line);
}

.modal-header .wow-title {
    font-size: 17px !important;
}

.modal-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 19px !important;
}

.modal-title > .ico {
    align-self: center;
    font-size: 20px;
    color: var(--ui-gold);
}

.modal-title > span {
    font-family: var(--font-ui);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ui-text-muted);
    text-shadow: none;
}

/* Nachfrage-Hinweise im Auktionshaus & Atelier */
.demand-chip {
    margin-top: 6px;
    padding: 6px 9px;
    border-radius: var(--ui-radius-sm);
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--ui-text-muted);
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
}

.demand-chip strong {
    color: var(--ui-text-dim);
    font-weight: 600;
}

.demand-chip.is-active {
    color: #b9ecd0;
    background: rgba(76, 195, 138, 0.08);
    border-color: rgba(76, 195, 138, 0.35);
}

.demand-chip.is-active strong {
    color: var(--c-good);
}

.demand-chip.is-seeder {
    color: var(--ui-gold-bright);
    background: rgba(214, 180, 110, 0.08);
    border-color: rgba(214, 180, 110, 0.32);
}

.demand-chip.is-seeder strong {
    color: var(--ui-gold-bright);
}

/* Abschnitte & Überschriften in Fenstern einheitlich, unabhängig von alten Inline-Farben */
.modal-body .wow-title {
    font-family: var(--font-ui);
    font-size: 14px !important;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ui-text) !important;
    text-shadow: none;
}

.modal-body .wow-frame,
.modal-body .game-card {
    border-color: var(--ui-line-neutral) !important;
}

.modal-close-btn {
    background: transparent;
    color: var(--ui-text-dim);
    border: 1px solid var(--ui-line-neutral);
    border-radius: var(--ui-radius-sm);
    padding: 5px 10px;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--ui-line-strong);
    color: #fff;
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Abschnitte innerhalb der Fenster sind .wow-frame: dort ohne Glas & Schlagschatten */
.modal-body .wow-frame {
    background: var(--ui-bg-raised);
    backdrop-filter: none;
    box-shadow: var(--ui-highlight);
    border-color: var(--ui-line-neutral);
}

/* Einstellungen [O] */
.settings-window {
    width: min(640px, 94vw) !important;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ui-line-neutral);
    flex-wrap: wrap;
}

.settings-row:first-child {
    padding-top: 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.settings-label > .ico {
    font-size: 18px;
    color: var(--ui-gold);
}

.settings-label strong {
    display: block;
    font-weight: 600;
    color: var(--ui-text);
}

.settings-label span {
    display: block;
    font-size: 11.5px;
    color: var(--ui-text-muted);
}

.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 9px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
}

.segmented button {
    padding: 6px 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.segmented button:hover {
    color: var(--ui-text);
}

.segmented button.active {
    background: linear-gradient(180deg, #e6c67f 0%, #bf9748 100%);
    color: #1d1508;
}

.settings-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ui-text-muted);
}

#hud-fps {
    position: fixed;
    left: var(--hud-gap);
    bottom: calc(var(--hud-gap) + 184px);
    z-index: 21;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--ui-bg-soft);
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-text-dim);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Atelier */
.designer-window {
    width: min(1120px, 95vw) !important;
    max-height: 92vh !important;
}

.designer-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 20px;
}

.designer-equipped {
    width: 100%;
}

.designer-section-label {
    margin-bottom: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

.preview-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.designer-check {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 0.85rem;
    color: var(--ui-text-muted);
    cursor: pointer;
    user-select: none;
}

.designer-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ui-gold);
    cursor: pointer;
}

.designer-check:hover span {
    color: var(--ui-text);
}

#designer-preview-canvas {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: #070a10;
    cursor: ew-resize;
    width: 310px;
    height: 360px;
}

.controls-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Talente [N] */
.talent-tabbar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ui-line);
}

.talent-tab {
    position: relative;
    padding: 9px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--ui-text-dim);
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.talent-tab:hover {
    color: var(--ui-text);
}

.talent-tab.active {
    color: var(--ui-gold-bright);
    border-bottom-color: var(--ui-gold);
}

.talent-tab .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--c-good);
    color: #08140d;
    font-size: 10px;
    font-weight: 700;
}

.talent-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.talent-node:hover {
    border-color: var(--ui-line);
    background: #10131a;
}

.talent-node-icon {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-bg-raised);
    border: 1px solid var(--ui-line-neutral);
    border-radius: 8px;
    font-size: 18px;
}

.talent-node-rank {
    position: absolute;
    bottom: -6px;
    right: -6px;
    padding: 0 4px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
}

/* ============================================================================
 * LOGIN & CHARAKTERERSTELLUNG
 * ============================================================================ */
#screen-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(5, 7, 12, 0) 30%, rgba(5, 7, 12, 0.72) 100%),
        linear-gradient(180deg, rgba(5, 7, 12, 0.55) 0%, rgba(5, 7, 12, 0) 26%, rgba(5, 7, 12, 0) 58%, rgba(5, 7, 12, 0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

/* Während des Logins nur die live gerenderte Welt zeigen, das Spiel-HUD ausblenden */
body:has(#screen-auth-overlay:not(.hidden)) > :not(#screen-auth-overlay):not(#game-viewport):not(svg):not(script) {
    visibility: hidden;
}

#screen-auth-overlay .wow-frame {
    background: rgba(18, 21, 28, 0.92);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), var(--ui-highlight);
}

.login-screen {
    width: 100%;
    min-height: 100%;
    display: grid;
    grid-template-rows: 1fr auto auto auto;
    justify-items: center;
    align-items: center;
    gap: 22px;
    animation: login-in 0.9s ease-out both;
}

.login-screen.hidden {
    display: none;
}

@keyframes login-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.login-brand {
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.login-brand {
    position: relative;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: -40px -120px -30px;
    background: radial-gradient(ellipse at 50% 55%, rgba(5, 7, 12, 0.62) 0%, rgba(5, 7, 12, 0.35) 45%, rgba(5, 7, 12, 0) 72%);
    z-index: -1;
    pointer-events: none;
}

.login-emblem {
    width: 92px;
    height: 92px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(217, 181, 108, 0.25));
    margin-bottom: 6px;
}

.login-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ui-gold-bright);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.login-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(38px, 7vw, 76px);
    line-height: 1.02;
    letter-spacing: 0.02em;
    color: #f3e3b8;
    text-shadow: 0 2px 0 #3a2a10, 0 6px 26px rgba(0, 0, 0, 0.85);
}

.login-title span {
    display: block;
    font-size: 1.18em;
    background: linear-gradient(180deg, #fff1c8 0%, #e9c46f 45%, #b0812f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 0 #3a2a10) drop-shadow(0 8px 22px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 30px rgba(233, 196, 111, 0.28));
}

.login-subtitle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
}

.login-subtitle span {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(17px, 2.4vw, 24px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f3e3b8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.login-subtitle span::before,
.login-subtitle span::after {
    content: '';
    width: clamp(28px, 6vw, 70px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ui-gold));
}

.login-subtitle span::after {
    background: linear-gradient(90deg, var(--ui-gold), transparent);
}

.login-subtitle small {
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(236, 232, 223, 0.7);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.login-tagline {
    margin-top: 6px;
    max-width: min(640px, 90vw);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: #e6dcc6;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.login-panel {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 23, 31, 0.86) 0%, rgba(11, 13, 19, 0.9) 100%);
    border: 1px solid var(--ui-line-strong);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 241, 200, 0.08), 0 0 0 4px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px) saturate(1.15);
    position: relative;
}

.login-panel::before,
.login-panel::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--ui-gold);
    pointer-events: none;
}

.login-panel::before {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 6px;
}

.login-panel::after {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 6px;
}

.login-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.login-panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--ui-gold-bright);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ui-text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ui-line-neutral);
    white-space: nowrap;
}

.login-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ui-text-muted);
}

.login-badge[data-state="ok"] { color: #bff0d6; border-color: rgba(76, 195, 138, 0.4); }
.login-badge[data-state="ok"]::before { background: var(--c-good); box-shadow: 0 0 8px var(--c-good); }
.login-badge[data-state="demo"] { color: #f5dfae; border-color: rgba(224, 168, 74, 0.4); }
.login-badge[data-state="demo"]::before { background: var(--c-warn); }

.login-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

.login-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 12px;
    border-radius: 9px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input:focus-within {
    border-color: var(--ui-line-strong);
    box-shadow: 0 0 0 3px rgba(217, 181, 108, 0.14);
}

.login-at {
    color: var(--ui-gold);
    font-weight: 700;
    font-size: 15px;
}

.login-input input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 8px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--ui-text);
}

.login-wallet {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid var(--ui-line-neutral);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-text-dim);
    font: 600 11.5px var(--font-ui);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.login-wallet:hover {
    color: var(--ui-text);
    border-color: var(--ui-line-strong);
    background: rgba(255, 255, 255, 0.07);
}

.login-cta {
    margin-top: 6px;
    padding: 13px 16px;
    font-size: 14.5px;
    letter-spacing: 0.02em;
}

.login-guest {
    padding: 10px 14px;
    font-size: 13px;
}

.login-guest-msg {
    color: #fca5a5;
}

.login-free-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-free-form.hidden {
    display: none;
}

.login-free-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ui-border, rgba(255, 255, 255, 0.15));
    background: rgba(0, 0, 0, 0.35);
    color: var(--ui-text, #f1f5f9);
    font-size: 14px;
}

.login-free-row {
    display: flex;
    gap: 8px;
}

.login-free-row .wow-btn {
    flex: 1;
    padding: 9px 10px;
}

.login-demo {
    padding: 10px 14px;
    font-size: 12.5px;
    background: transparent;
    color: var(--ui-text-dim);
}

.login-note {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ui-text-muted);
    text-align: center;
}

.login-path {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: min(760px, 100%);
}

.login-path li {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 8px;
    align-items: center;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(10, 12, 17, 0.62);
    border: 1px solid var(--ui-line-neutral);
    backdrop-filter: blur(6px);
    counter-increment: path;
}

.login-path .ico {
    grid-row: span 2;
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 50%;
    color: var(--ui-gold-bright);
    background: rgba(217, 181, 108, 0.1);
    border: 1px solid var(--ui-line);
}

.login-path strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-text);
}

.login-path span {
    font-size: 10.5px;
    line-height: 1.35;
    color: var(--ui-text-dim);
}

.login-path b {
    color: var(--c-hbd);
    font-weight: 600;
}

.login-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: rgba(236, 232, 223, 0.6);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.login-footer strong {
    color: var(--ui-gold);
    font-weight: 600;
}

.login-realm {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.login-realm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ui-text-muted);
}

.login-realm-dot.online {
    background: var(--c-good);
    box-shadow: 0 0 8px var(--c-good);
    animation: realm-pulse 2.4s ease-in-out infinite;
}

.login-realm-dot.offline {
    background: var(--c-warn);
}

@keyframes realm-pulse {
    50% { opacity: 0.45; }
}

@media (max-width: 720px) {
    .login-path {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .login-footer {
        justify-content: center;
        text-align: center;
    }
}

@media (max-height: 720px) {
    .login-emblem { width: 64px; height: 64px; }
    .login-path { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login-screen, .login-realm-dot.online { animation: none; }
}

.charcreate-card {
    width: min(1320px, 96vw);
    max-height: 95vh;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    scroll-padding-bottom: 84px;   /* #918-Folge: Inhalte bleiben beim Hochscrollen über der klebenden Fußleiste */
}

.charcreate-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ui-line);
}

.charcreate-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--ui-text-dim);
}

.charcreate-meta strong {
    color: var(--ui-text);
    font-weight: 600;
}

.ui-callout {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    background: rgba(76, 195, 138, 0.07);
    border: 1px solid rgba(76, 195, 138, 0.3);
    box-shadow: inset 3px 0 0 var(--c-good);
    font-size: 12px;
    line-height: 1.5;
    color: var(--ui-text-dim);
}

.ui-callout > strong {
    color: var(--ui-text);
    font-weight: 600;
}

.ui-callout b,
.ui-callout div strong {
    color: var(--ui-text);
    font-weight: 600;
}

.charcreate-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.25fr);
    gap: 28px;
    align-items: start;
}

/* Vorschau bleibt beim Scrollen der Formularspalte im Blick */
.charcreate-grid .preview-column {
    position: sticky;
    top: 0;
    width: 100%;
}

#charcreate-preview-canvas {
    transition: opacity 0.26s ease;
}
#charcreate-preview-canvas.cc-swapping {
    opacity: 0;
}
/* Frisur-Kacheln in der Erstellung (#593): Mini-Vorschau statt nur Text, für Mädchen */
.cc-hair-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.cc-hair-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    max-width: 88px;
    background: #141b28;
    border: 1px solid #2a3446;
    border-radius: var(--ui-radius-sm, 8px);
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.cc-hair-tile:hover,
.cc-hair-tile.active {
    border-color: var(--ui-gold, #fde047);
}
.cc-hair-tile.active {
    box-shadow: 0 0 0 1px var(--ui-gold, #fde047);
}
.cc-hair-tile canvas {
    border-radius: 6px;
    background: #070a10;
}
/* Frisuren-Designer (#852): Regler unter der Frisurwahl, eingeklappt */
.cc-hairgen {
    margin-top: 8px;
    padding: 6px 10px 8px;
    background: #111827;
    border: 1px solid #2a3446;
    border-radius: var(--ui-radius-sm, 8px);
}
.cc-hairgen > summary {
    cursor: pointer;
    color: var(--ui-gold, #fde047);
    font-size: 13px;
    padding: 2px 0;
}
.cc-hg-grid {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.cc-hg-row {
    display: grid;
    grid-template-columns: 6.5em 1fr;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #cbd5e1;
}
.cc-hg-row[hidden] { display: none; }
.cc-hg-row input[type="range"] { width: 100%; min-height: 24px; accent-color: var(--ui-gold, #fde047); }
.cc-hg-row select { font-size: 12px; padding: 3px 6px; }
.cc-hg-check { grid-template-columns: auto 1fr; }
.cc-hg-check input { width: 18px; height: 18px; accent-color: var(--ui-gold, #fde047); }
.cc-hg-seed { display: inline-flex; align-items: center; gap: 8px; }
.cc-hg-seed output { min-width: 2.5em; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.cc-hg-seed button { min-width: 36px; min-height: 30px; padding: 2px 8px; }
.cc-hg-reset {
    margin-top: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 0;
}
body.touch-ui .cc-hg-row input[type="range"] { min-height: 32px; }
/* Vorschläge (#861): Grundform + Regler auf einen Klick */
.cc-hg-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.cc-hg-presets-label { width: 100%; font-size: 12px; color: #94a3b8; }
.cc-hg-preset {
    background: #141b28;
    color: #cbd5e1;
    border: 1px solid #2a3446;
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 11px;
    min-height: 30px;
    cursor: pointer;
}
.cc-hg-preset:hover { border-color: var(--ui-gold, #fde047); color: #f8fafc; }
.cc-hg-preset[hidden] { display: none; }

/* Halloween-Loginscreen (Nutzerwunsch): violett-orangefarbene Nacht, Kürbis, Fledermäuse – aktiv 27.10.–3.11. */
.login-screen.halloween {
    position: relative;
    background: radial-gradient(ellipse at 50% 30%, #2b1055 0%, #0a0618 70%);
}
.login-screen.halloween::before {
    content: '🎃';
    position: absolute;
    left: 6%;
    bottom: 8%;
    font-size: 64px;
    filter: drop-shadow(0 0 18px rgba(255, 140, 0, 0.55));
    animation: hwBob 3.4s ease-in-out infinite;
}
.login-screen.halloween::after {
    content: '🦇    🦇      🦇';
    position: absolute;
    top: 7%;
    left: 50%;
    font-size: 30px;
    letter-spacing: 24px;
    opacity: 0.85;
    animation: hwFly 9s linear infinite;
}
.login-screen.halloween .login-title span {
    color: #ff8c1a;
    text-shadow: 0 0 24px rgba(255, 140, 26, 0.6);
}
.login-screen.halloween .login-kicker {
    color: #c4b5fd;
}
.login-screen.halloween .login-panel {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.25), inset 0 0 30px rgba(255, 140, 0, 0.05);
}
.login-screen.halloween .login-panel-title::after {
    content: ' 🕯️';
}
.login-screen.halloween .login-tagline {
    color: #d8c7a8;
}
@keyframes hwBob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}
@keyframes hwFly {
    0% { transform: translateX(-60vw); }
    100% { transform: translateX(60vw); }
}
#charcreate-preview-canvas {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: #070a10;
    width: 100%;
    display: block;
    height: clamp(420px, calc(100vh - 232px), 900px);   /* Kopfzeile + Rand abziehen, sonst ragt die Bühne unten über das Fenster und schneidet die Füße ab */
    min-height: 420px;
    cursor: ew-resize;
    background: radial-gradient(ellipse at 50% 38%, #1d2a44 0%, #0b1020 62%, #05070d 100%);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 209, 0, 0.18);
}

/* Farbkacheln & Vorschau-Steuerung in Charaktererstellung */
.cc-color-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(10, 14, 24, 0.65);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    padding: 10px 12px;
}

.cc-color-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.cc-color-head label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-text);
    margin-bottom: 0;
}

.cc-color-input {
    width: 28px;
    height: 24px;
    padding: 0 2px;
    border: 1px solid var(--ui-line);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    vertical-align: middle;
}

.cc-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.cc-swatch {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 0;
    transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    position: relative;
}

.cc-swatch:hover {
    transform: scale(1.15);
    border-color: #ffd100;
    z-index: 2;
}

.cc-swatch.active {
    border-color: #ffd100;
    box-shadow: 0 0 0 2px rgba(255, 209, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.7);
    transform: scale(1.12);
}

.cc-swatch.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 2px #000;
}

.cc-swatch-sm .cc-swatch {
    width: 20px;
    height: 20px;
}

.cc-preview-actions {
    margin-top: 6px;
    margin-bottom: 6px;
    display: flex;
    justify-content: center;
}

.cc-pose-toggle {
    display: flex;
    width: 100%;
    background: rgba(10, 14, 24, 0.8);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    padding: 2px;
    gap: 2px;
}

.cc-pose-toggle button {
    flex: 1;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    color: var(--ui-text-dim);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.cc-pose-toggle button:hover {
    color: var(--ui-text);
    background: rgba(255, 255, 255, 0.08);
}

.cc-pose-toggle button.active {
    background: rgba(251, 191, 36, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cc-preview-controls {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.cc-random-btn { flex: 0 0 auto; padding: 0 14px; white-space: nowrap; }
/* Pose-Knöpfe liegen über der Bühne, damit die Figur die ganze Höhe nutzt */
.cc-stage { position: relative; }
.cc-preview-actions.cc-overlay { position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; }
.cc-preview-actions.cc-overlay .cc-pose-toggle { background: rgba(6, 9, 16, 0.72); backdrop-filter: blur(4px); }

.cc-view-toggle {
    display: flex;
    width: 100%;
    background: rgba(10, 14, 24, 0.8);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    padding: 2px;
    gap: 2px;
}

.cc-view-toggle button {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    color: var(--ui-text-dim);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.cc-view-toggle button:hover {
    color: var(--ui-text);
    background: rgba(255, 255, 255, 0.08);
}

.cc-view-toggle button.active {
    background: var(--ui-accent, #3b82f6);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ============================================================================
 * VIRTUELLER TOUCH-JOYSTICK & AKTIONSPAD (Pointer-Capture & Touch-Action)
 * ============================================================================ */
#touch-controls-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 61;   /* über .modal-backdrop (60): sonst landen Pad-/Joystick-Tipps am Fenster/Schirm (#983) */
}

/* Bei offenem Modal oder Spielmenü: Joystick und Aktionspad ausblenden (#1010). Der [E]-Knopf blieb über Fenstern zunächst
   sichtbar (#983: Tipp schließt das Fenster) – allein im Pad-Raster landete er aber mitten im Inhalt (hochkant auf der
   Wegstein-Liste, deren Zeilen Knöpfe sind: Tipp dort schloss statt zu reisen). Jedes Fenster hat sein eigenes ✕. */
body:has(.modal-backdrop:not(.hidden)) #touch-joystick-zone,
body:has(.modal-backdrop:not(.hidden)) #touch-action-pad,
body:has(#game-menu:not(.hidden)) #touch-joystick-zone,
body:has(#game-menu:not(.hidden)) #touch-action-pad {
    display: none !important;
}

#touch-joystick-zone {
    position: fixed;
    left: 24px;
    bottom: 214px;
    width: 128px;
    height: 128px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#touch-joystick-base {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: var(--ui-bg-soft);
    border: 1px solid var(--ui-line-strong);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle {
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.drag-handle.dragging {
    cursor: grabbing;
}

#touch-joystick-handle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e6c67f 0%, #bf9748 100%);
    border: 1px solid #f3dca0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
    color: #1d1508;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform: translate(0px, 0px);
    transition: box-shadow 0.12s;
}

#touch-joystick-handle:focus-visible {
    outline: 2px solid var(--ui-gold-bright);
    outline-offset: 2px;
}

#touch-joystick-handle.dragging {
    box-shadow: 0 0 16px rgba(242, 215, 144, 0.7);
}

#touch-action-pad {
    position: fixed;
    right: 20px;
    bottom: 200px;
    display: grid;
    grid-template-columns: repeat(4, 52px);
    gap: 8px;
    pointer-events: none;
}

/* Handy-Bedienung (#1705): Tastengröße (--touch-scale, 0,8–1,2) und Seite (Linkshänder = Joystick rechts, Pad links).
   Skaliert wird ab der Ecke, an der die Taste klebt; 1,2 überlappt auf dem schmalsten Handy noch nichts (geprüft). */
html { --touch-scale: 1; }
#touch-joystick-zone { transform: scale(var(--touch-scale)); transform-origin: left bottom; }
#touch-action-pad { transform: scale(var(--touch-scale)); transform-origin: right bottom; }
body.touch-lefthand #touch-joystick-zone { left: auto; right: 24px; transform-origin: right bottom; }
body.touch-lefthand #touch-action-pad { right: auto; left: 20px; transform-origin: left bottom; }
/* Schmales Hochformat: gleiche 12-px-Ränder wie links, sonst überlappen 1,2 und Aktionspad (397 px > 390 px) */
@media (max-width: 640px) {
    body.touch-lefthand #touch-joystick-zone { right: 12px; }
    body.touch-lefthand #touch-action-pad { left: 12px; }
}
body:not(.touch-ui) .settings-touch { display: none; }

.touch-act-btn {
    width: 52px;
    height: 52px;
    pointer-events: auto;
    border-radius: 50%;
    background: var(--ui-bg);
    border: 1px solid var(--ui-line-strong);
    color: var(--ui-gold-bright);
    font-size: 19px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1.05;
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.touch-act-btn small {
    font-size: 9px;
    color: var(--ui-text-dim);
    font-weight: 600;
}

.touch-act-btn.primary {
    background: linear-gradient(180deg, #e6c67f 0%, #bf9748 100%);
    border-color: #f3dca0;
    color: #1d1508;
}

.touch-act-btn.primary small {
    color: #3a2b10;
}

.touch-act-btn:active {
    transform: scale(0.93);
    filter: brightness(1.2);
}

/* Zusätzliche Fähigkeiten im Aktionspad (#970): etwas gedämpft, damit 1–5 die Hauptknöpfe bleiben */
.touch-act-btn[data-touch-slot] {
    font-size: 17px;
    border-color: rgba(242, 215, 144, 0.35);
}

/* Im Wasser wird „Sprung“ zu „Tauchen“ (gedrückt halten) */
.touch-act-btn.is-dive {
    color: #7dd3fc;
    border-color: rgba(125, 211, 252, 0.7);
}

/* ============================================================================
 * RESPONSIVE
 * ============================================================================ */
/* Unter 1500px passt die Aktionsleiste nicht mehr neben den Chat, wenn sie bildschirmzentriert ist:
   dann wird sie im freien Bereich rechts vom Chat zentriert */
@media (max-width: 1500px) {
    #hud-action-dock {
        left: calc(var(--hud-chat-w) + var(--hud-gap));
    }
}

@media (max-width: 1300px) {
    :root {
        --hud-chat-w: 300px;
    }
    .action-bar-row {
        gap: 4px;
        padding: 5px;
    }
    .action-slot {
        width: 42px;
        height: 42px;
    }
    .action-slot .slot-icon {
        font-size: 19px;
    }
    .action-divider {
        height: 28px;
        margin: 0 2px;
    }
    .res-badge {
        width: 30px;
        height: 28px;
        font-size: 14px;
    }
}

@media (max-width: 1150px) {
    .currency-pill {
        font-size: 11px;
        padding: 4px 7px;
    }
    #hud-right-tracker {
        width: 220px;
    }
}

@media (max-width: 900px) {
    .designer-grid,
    .charcreate-grid {
        grid-template-columns: 1fr;
    }
    /* Charaktererstellung (#461): auf schmalen Schirmen stand die Vorschau unter dem Formular und war beim
       Erstellen unsichtbar — jetzt liegt sie oben, das Formular folgt darunter. */
    .charcreate-grid > .preview-column {
        order: -1;
        position: static;
    }
    #charcreate-preview-canvas {
        height: min(52vh, 520px);
        min-height: 300px;
    }
    .cc-preview-controls .segmented,
    .cc-preview-actions .segmented {
        flex-wrap: wrap;
        justify-content: center;
    }
    :root {
        --hud-chat-w: 250px;
    }
    #hud-chat-log {
        height: 136px;
    }
    .hud-chat-hint {
        display: none;
    }
    #hud-right-tracker {
        display: none;
    }
    .action-bar-row {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 96vw;
    }
}

/* Handy (#481): Formularzeilen einspaltig — lange <option>-Texte lesbar;
   Lizenz-Hinweis im Atelier kompakter, damit die Vorschau nicht nach unten rutscht. */
@media (max-width: 640px) {
    .charcreate-grid .form-row {
        grid-template-columns: minmax(0, 1fr);
    }
    #designer-license-banner .notice {
        padding: 8px 10px;
        gap: 8px;
        font-size: 12px;
    }
}

/* Portal der Tiefen: Ebenenwahl */
/* Welten-Wegstein: Reisefenster mit Stufenbereich je Gebiet (main.js refreshWaystoneModal) */
.waystone-window {
    width: min(620px, 96vw) !important;
}
.waystone-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.waystone-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ws-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    text-align: left;
    color: var(--ui-text);
    background: var(--ui-bg-raised);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    box-shadow: var(--ui-highlight);
    cursor: pointer;
    font: inherit;
}
.ws-row:hover:not(:disabled) { background: var(--ui-bg-hover); border-color: var(--ui-line-strong); }
.ws-row:disabled { cursor: default; opacity: 0.75; }
.ws-icon { font-size: 22px; text-align: center; }
.ws-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-name { font-weight: 600; }
.ws-note { font-size: 12px; color: var(--ui-text-dim); line-height: 1.35; }
.ws-lv { font-size: 12px; color: var(--ui-gold); white-space: nowrap; }
.ws-go { font-size: 12px; font-weight: 600; color: var(--ui-gold-bright); white-space: nowrap; min-width: 4.5em; text-align: right; }
.ws-row.is-current { border-color: var(--ui-line-strong); }
.ws-row.is-current .ws-note { color: var(--ui-gold-bright); }
.ws-row.is-hard .ws-note { color: #f3c98a; }
.ws-row.is-deadly { border-color: rgba(224, 92, 74, 0.45); }
.ws-row.is-deadly .ws-note, .ws-row.is-deadly .ws-lv { color: #f08b78; }
.ws-row.is-armed { background: rgba(224, 92, 74, 0.12); border-color: rgba(224, 92, 74, 0.8); }
.ws-row.is-armed .ws-go { color: #ffb3a5; }
.waystone-hint { font-size: 12px; color: var(--ui-text-muted); }
/* Weltkarte im Reisefenster (#933, nur großer Kontinent): Karte links, Liste rechts; schmal untereinander */
.waystone-window.has-map { width: min(1060px, 96vw) !important; }
/* Umgebung / Kontinent (#959) über der Karte */
.wmap-wrap { min-width: 0; }
.wmap-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.wmap-tabs.hidden { display: none; }
.wmap-tabs .wow-btn { flex: 1; padding: 4px 8px; font-size: 12px; opacity: 0.7; }
.wmap-tabs .wow-btn.active { opacity: 1; border-color: #f2d790; color: #f8e7b0; }
.has-map .waystone-body { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); align-items: start; }
.has-map .waystone-list { max-height: min(460px, 62vh); overflow-y: auto; }
.has-map .waystone-hint { grid-column: 1 / -1; }
.waystone-map { width: 100%; max-width: 460px; aspect-ratio: 1; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-sm); background: #0b1a12; cursor: pointer; }
@media (max-width: 760px) {
    .has-map .waystone-body { grid-template-columns: minmax(0, 1fr); }
    .waystone-map { max-width: min(460px, 92vw); justify-self: center; }
    /* untereinander scrollt das ganze Fenster – mit eigener Listenhöhe lag der Hinweis über dem letzten Eintrag */
    .has-map .waystone-list { max-height: none; overflow: visible; }
}
@media (max-width: 520px) {
    .ws-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .ws-go { display: none; }
}
/* Handy quer (#959): Karte so groß wie die Höhe erlaubt, Liste daneben */
@media (max-height: 500px) {
    .has-map .waystone-body { grid-template-columns: auto minmax(0, 1fr); }
    .wmap-wrap { width: min(460px, calc(100vh - 150px)); }
    .waystone-map { max-width: 100%; }
    .has-map .waystone-list { max-height: calc(100vh - 120px); }
}

.dungeon-window {
    width: min(1000px, 96vw) !important;
}

.dungeon-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px;
}

.dungeon-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--ui-text-muted);
}

.dungeon-summary strong {
    color: var(--ui-gold-bright);
    font-weight: 600;
}

.dungeon-progress {
    flex: 1;
    max-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    overflow: hidden;
}

.dungeon-progress > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #bf9748, #f2d790);
}

.dungeon-grid {
    display: grid;
    grid-template-columns: 44px repeat(10, minmax(0, 1fr));
    gap: 4px;
}

.dg-row-label {
    display: flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ui-text-muted);
    font-variant-numeric: tabular-nums;
}

.dg-cell {
    position: relative;
    aspect-ratio: 1;
    min-height: 30px;
    border-radius: 6px;
    border: 1px solid var(--ui-line-neutral);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dg-accent) 26%, transparent), color-mix(in srgb, var(--dg-accent) 8%, transparent)),
        var(--ui-bg-inset);
    color: var(--ui-text);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.dg-cell:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--dg-accent) 70%, white 0%);
}

.dg-cell .ico {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 10px;
}

.dg-cell.is-cleared .ico {
    color: var(--c-good);
}

.dg-cell.is-locked {
    background: var(--ui-bg-inset);
    color: var(--ui-text-muted);
    opacity: 0.55;
}

.dg-cell.is-locked .ico {
    color: var(--ui-text-muted);
}

.dg-cell.is-next {
    border-color: var(--ui-gold);
    box-shadow: 0 0 0 1px rgba(217, 181, 108, 0.35), 0 0 12px rgba(217, 181, 108, 0.25);
}

.dg-cell.is-selected {
    border-color: var(--ui-gold-bright);
    box-shadow: 0 0 0 2px var(--ui-gold-bright);
}

.dg-cell.is-current::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-pool);
    box-shadow: 0 0 6px var(--c-pool);
}

.dungeon-legend {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--ui-text-muted);
}

.dungeon-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dg-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid var(--ui-line-neutral);
}

.dg-swatch.cleared { background: var(--c-good); }
.dg-swatch.open { background: var(--ui-gold); }
.dg-swatch.locked { background: var(--ui-bg-hover); }

.dungeon-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background:
        radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--dg-accent) 22%, transparent), transparent 70%),
        var(--ui-bg-raised);
    box-shadow: var(--ui-highlight);
}

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

.dg-emblem {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 22px;
    background: color-mix(in srgb, var(--dg-accent) 22%, var(--ui-bg-inset));
    border: 1px solid color-mix(in srgb, var(--dg-accent) 60%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--dg-accent) 30%, transparent);
}

.dg-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

.dg-name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--ui-gold-bright);
    line-height: 1.2;
}

.dg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dg-tag {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--ui-text-dim);
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
}

.dg-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dg-stat {
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
}

.dg-stat span {
    display: block;
    font-size: 10.5px;
    color: var(--ui-text-muted);
}

.dg-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ui-text);
}

.dg-section-title {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

.dg-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dg-foe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: var(--ui-radius-sm);
    font-size: 12px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
}

.dg-foe .ico {
    color: var(--c-bad);
}

.dg-foe.is-boss {
    color: var(--ui-gold-bright);
    border-color: rgba(217, 181, 108, 0.4);
}

.dg-foe.is-boss .ico {
    color: var(--ui-gold);
}

.dg-warning {
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    font-size: 12px;
    line-height: 1.45;
    color: #f3c98a;
    background: rgba(224, 168, 74, 0.08);
    border: 1px solid rgba(224, 168, 74, 0.32);
}

.dg-warning.is-locked {
    color: var(--ui-text-dim);
    background: var(--ui-bg-inset);
    border-color: var(--ui-line-neutral);
}

.dg-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.dg-actions .wow-btn {
    flex: 1;
    justify-content: center;
}

@media (max-width: 760px) {
    .dungeon-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Dungeon-Ebene bezwungen */
#dungeon-banner {
    position: fixed;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -8px);
    padding: 14px 30px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s;
    z-index: 40;
    border-radius: var(--ui-radius);
    background: linear-gradient(180deg, rgba(13, 15, 21, 0.9), rgba(13, 15, 21, 0.75));
    border: 1px solid var(--ui-line-strong);
    box-shadow: var(--ui-shadow);
}

#dungeon-banner.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

#dungeon-banner .dg-banner-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

#dungeon-banner .dg-banner-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--ui-gold-bright);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

#dungeon-banner .dg-banner-sub {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--ui-text-dim);
}

/* Update-Reload-Banner: prominente Anzeige beim Aufspielen eines neuen Spiel-Updates */
#game-update-banner {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translate(-50%, -10px);
    padding: 18px 36px;
    border-radius: 14px;
    text-align: center;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    background: linear-gradient(180deg, rgba(16, 21, 32, 0.96), rgba(10, 13, 20, 0.94));
    border: 1px solid rgba(217, 181, 108, 0.65);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(76, 195, 138, 0.3);
    min-width: 360px;
    max-width: 90vw;
}
#game-update-banner.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
#game-update-banner .gub-kicker {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ui-gold-bright, #f2d790);
    margin-bottom: 4px;
}
#game-update-banner .gub-title {
    font-family: var(--font-display, Georgia, serif);
    font-size: 22px;
    font-weight: 700;
    color: #4cc38a;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
#game-update-banner .gub-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--ui-text-dim, #b3ada0);
}
#game-update-banner .gub-bar-wrap {
    margin-top: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
}
#game-update-banner .gub-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d9b56c, #4cc38a);
    transition: width 2s linear;
}

/* ============================================================================
 * KLASSEN: Buffs, Spielmenü, Talentbäume, Klassenwahl
 * ============================================================================ */
#hud-buffs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 236px;
}

#hud-buffs:empty {
    display: none;
}

.buff-chip {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--ui-line-strong);
    background: var(--ui-bg);
    color: var(--ui-gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.buff-chip small {
    position: absolute;
    bottom: -3px;
    right: -3px;
    min-width: 14px;
    padding: 0 2px;
    border-radius: 4px;
    background: #0d1016;
    color: var(--ui-text);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#game-menu {
    position: fixed;
    right: var(--hud-gap);
    bottom: 120px;
    width: min(280px, calc(100vw - 32px));
    /* nie über den oberen Rand hinaus (#865: hochkant ragte „Pause“ im Statusblock aus dem Bild) – sonst scrollen */
    max-height: calc(100dvh - 128px);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 70;
}

#game-menu.hidden {
    display: none;
}

.game-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 6px;
    border-bottom: 1px solid var(--ui-line);
    margin-bottom: 4px;
    grid-column: 1 / -1;
}

.game-menu-header .game-menu-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--ui-gold-bright);
    padding: 0;
    border-bottom: 0;
    margin-bottom: 0;
}

.game-menu-close-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text-muted);
    font-size: 15px;
    line-height: 1;
    padding: 3px 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.game-menu-close-btn:hover,
.game-menu-close-btn:focus-visible {
    background: var(--ui-bg-hover);
    color: var(--ui-text);
    border-color: var(--ui-line);
    outline: none;
}

.game-menu-divider {
    height: 1px;
    background: var(--ui-line);
    margin: 4px 0;
    grid-column: 1 / -1;
}

.game-menu-group-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ui-text-muted);
    padding: 4px 6px 2px;
    font-weight: 700;
    grid-column: 1 / -1;
}

.game-menu-item {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ui-text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.game-menu-item:hover,
.game-menu-item:focus-visible {
    background: var(--ui-bg-hover);
    border-color: var(--ui-line);
    outline: none;
}

.game-menu-item .ico {
    color: var(--ui-gold);
    font-size: 17px;
}

.game-menu-item.has-points span::after {
    content: ' •';
    color: var(--c-good);
}

#game-menu kbd {
    font: inherit;
    font-size: 10.5px;
    color: var(--ui-text-muted);
    border: 1px solid var(--ui-line-neutral);
    border-radius: 4px;
    padding: 1px 5px;
}

.game-menu-hint {
    margin-top: 4px;
    padding: 6px 4px 0;
    border-top: 1px solid var(--ui-line);
    font-size: 11px;
    color: var(--ui-text-muted);
    line-height: 1.6;
}

/* Handy: Tastenkürzel (C, N, B …) und Tastenhinweise im Spielmenü sind ohne Tastatur wertlos */
body.touch-ui .game-menu-item kbd,
body.touch-ui .game-menu-hint {
    display: none;
}

.talent-trees {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.talent-tree {
    border: 1px solid var(--ui-line);
    border-top: 3px solid var(--tree-color);
    border-radius: var(--ui-radius);
    background: linear-gradient(180deg, color-mix(in srgb, var(--tree-color) 14%, transparent) 0%, var(--ui-bg-inset) 60%);
    padding: 10px;
}

.talent-tree-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.talent-tree-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ui-gold-bright);
}

.talent-tree-points {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #0d1016;
    border: 1px solid var(--tree-color);
    color: var(--ui-gold-bright);
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.talent-grid {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    grid-template-rows: repeat(7, 44px);
    gap: 10px 12px;
    justify-content: center;
}

.talent-cell {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid #3a4150;
    background: radial-gradient(circle at 35% 30%, #2a303c 0%, #0d1016 100%);
    color: var(--ui-text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.talent-cell.is-available {
    border-color: var(--c-good);
    color: var(--ui-text);
}

.talent-cell.is-partial {
    border-color: var(--c-good);
    color: #b7f0d0;
    box-shadow: 0 0 8px rgba(76, 195, 138, 0.35);
}

.talent-cell.is-maxed {
    border-color: var(--ui-gold-bright);
    color: var(--ui-gold-bright);
    box-shadow: 0 0 10px rgba(242, 215, 144, 0.4);
}

.talent-cell.is-locked {
    opacity: 0.45;
    filter: grayscale(0.7);
    cursor: default;
}

.talent-cell.is-capstone {
    border-radius: 50%;
}

.talent-cell-rank {
    position: absolute;
    right: -7px;
    bottom: -7px;
    padding: 0 4px;
    border-radius: 6px;
    background: #0d1016;
    border: 1px solid var(--ui-line-strong);
    color: var(--ui-gold-bright);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 14px;
    font-variant-numeric: tabular-nums;
}

.talent-arrow {
    justify-self: center;
    width: 4px;
    margin: -10px 0;
    background: #3a4150;
    border-radius: 2px;
}

.talent-arrow.is-met {
    background: var(--ui-gold);
}

.talent-footnote {
    margin-top: 10px;
    font-size: 11px;
    color: var(--ui-text-muted);
}

@media (max-width: 900px) {
    .talent-trees {
        grid-template-columns: 1fr;
    }
}

.cc-class-group {
    flex: 1 1 100%;
}

.cc-class-desc {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ui-text-dim);
}

#hud-party-frame .party-member {
    cursor: pointer;
    border-radius: 5px;
    padding: 1px 2px;
}

#hud-party-frame .party-member.is-selected {
    background: rgba(76, 195, 138, 0.14);
    box-shadow: inset 2px 0 0 var(--c-good);
}

/* Rollen + Raid-Rahmen (#1238): Symbol 🛡/✚/⚔ je Mitglied (eigenes per Klick wechselbar), Zähler im Kopf, Klassenfarbe als
   Streifen; im Raid Untergruppen nebeneinander als kompakte Kacheln */
#hud-party-frame .party-list .party-member {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px 2px 6px;
    box-shadow: inset 3px 0 0 var(--cls, transparent);
}
#hud-party-frame .party-list .party-member.is-selected {
    box-shadow: inset 3px 0 0 var(--c-good);
}
#hud-party-frame .party-member .party-lvl { flex: 0 0 22px; }
#hud-party-frame .party-member .party-name { flex: 1 1 auto; min-width: 0; }
#hud-party-frame .party-member .party-hp { flex: 0 0 64px; }
#hud-party-frame .party-role {
    flex: 0 0 14px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
}
#hud-party-frame .party-role.is-mine { cursor: pointer; border-radius: 3px; }
#hud-party-frame .party-role.is-mine:hover { background: rgba(255, 255, 255, 0.12); }
#hud-party-frame .role-tank { color: #60a5fa; }
#hud-party-frame .role-heal { color: #4ade80; }
#hud-party-frame .role-dps { color: #f87171; }
#hud-party-frame .party-roles {
    display: flex;
    gap: 10px;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}
#hud-party-frame:has(.party-list.is-raid) { width: 276px; }
#hud-party-frame .party-list.is-raid {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
}
#hud-party-frame .party-list.is-raid .party-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
#hud-party-frame .party-list.is-raid .party-sub { margin-top: 0; }
#hud-party-frame .party-list.is-raid .party-member {
    flex-wrap: wrap;
    row-gap: 2px;
    background: color-mix(in srgb, var(--cls, #94a3b8) 16%, transparent);
}
#hud-party-frame .party-list.is-raid .party-member.is-selected { background: rgba(76, 195, 138, 0.2); }
#hud-party-frame .party-list.is-raid .party-lvl { display: none; }
#hud-party-frame .party-list.is-raid .party-hp { flex: 1 0 100%; height: 5px; }
#hud-party-frame .party-hp.is-low span { background: #ef4444; }

/* Gilden- & Raid-Brett der Hauptstadt (#1269): Raid-Kasten über den Aufträgen */
#quest-raid-box {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(251, 146, 60, 0.45);
    border-radius: 6px;
    background: rgba(124, 45, 18, 0.22);
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
}
#quest-raid-box .qr-head { font-family: var(--font-display); font-weight: 700; color: #fdba74; }
#quest-raid-box .qr-head small { font-family: var(--font-ui); font-weight: 400; color: var(--ui-text-dim); margin-left: 6px; }
#quest-raid-box .qr-lock, #quest-raid-box .qr-hint { color: var(--ui-text-dim); }
#quest-raid-box .qr-warn { color: #fca5a5; }
#quest-raid-box .qr-chips { display: flex; flex-wrap: wrap; gap: 5px; }
#quest-raid-box .qr-chip { padding: 1px 7px; border-radius: 10px; background: rgba(74, 222, 128, 0.14); color: #bbf7d0; }
#quest-raid-box .qr-chip.is-locked { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }

/* Atelier: Tasche */
#designer-bag-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}
.bag-empty {
    font-size: 11px;
    color: var(--ui-text-muted);
    padding: 8px 10px;
    border: 1px dashed var(--ui-line-neutral);
    border-radius: var(--ui-radius-sm);
}
.bag-item {
    --mark: var(--ui-line-strong);
    padding: 8px 10px 8px 12px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    border-left: 3px solid var(--mark);
}
.bag-count { color: #ffd27a; font-weight: 700; margin-left: 4px; }
.bag-active { color: #86efac; font-size: 0.8em; margin-left: 4px; }
.bag-item-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bag-item-meta {
    font-size: 10.5px;
    color: var(--ui-text-muted);
    margin: 1px 0 5px;
}
.bag-nowear {
    color: var(--c-warn);
}
.bag-item-actions {
    display: flex;
    gap: 5px;
}
.bag-item-actions .wow-btn {
    flex: 1;
    padding: 4px 6px;
    font-size: 11px;
}
/* ============================================================================
 * KOMPAKTES HANDY-HUD (Hochformat < 640px Breite, Querformat < 500px Höhe)
 * Wallet, Quest-Tracker & Rohstoffleiste bleiben über die Menüs erreichbar
 * ============================================================================ */
@media (max-width: 640px), (max-height: 500px) {
    :root {
        --hud-gap: 8px;
    }
    #hud-top-center,
    #hud-right-tracker,
    #zone-banner,
    #hive-radar-status,
    #hud-world-clock,
    #hud-resource-strip {
        display: none !important;
    }
    .unit-frame {
        width: 196px;
    }
    .unit-portrait {
        width: 44px;
        height: 44px;
        border-width: 4px;
        margin-right: -12px;
    }
    .unit-portrait .ico {
        width: 18px;
        height: 18px;
    }
    .unit-level-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
        bottom: -6px;
        right: -7px;
    }
    .unit-bars {
        min-width: 0;
        max-width: none;
    }
    .unit-bars > *,
    .unit-name,
    .unit-stats {
        padding-left: 16px;
    }
    .unit-name {
        font-size: 12px;
    }
    #hud-unit-frames .unit-frame .bar-label {
        left: 16px;
    }
    #hud-unit-frames .unit-frame .bar-track {
        height: 12px;
    }
    #hud-unit-frames .unit-frame .bar-track + .bar-track {
        height: 10px;
    }
    #hud-party-frame {
        width: 196px;
        padding: 6px 8px;
    }
    #hud-party-frame:has(.party-list.is-raid) { width: 232px; }   /* Raid-Rahmen (#1238): zwei schmale Spalten */
    #hud-minimap-wrap {
        width: auto;
    }
    #minimap-canvas {
        width: 104px;
        height: 104px;
    }
    #hud-action-dock {
        left: var(--hud-gap);
        right: var(--hud-gap);
    }
    #hud-action-dock-inner {
        max-width: 100%;
    }
    #hud-chat-log {
        width: calc(100vw - 2 * var(--hud-gap));
        height: 96px;
        bottom: 104px;
        padding: 6px 8px;
    }
    #hud-chat-log > .wow-title > span:last-child {
        display: none;
    }
    /* Touch: das Aktionspad übernimmt die Skills, unten bleibt nur das Menü */
    body.touch-ui #action-bar .action-slot:not(.slot-menu),
    body.touch-ui #action-bar .action-divider {
        display: none;
    }
    body.touch-ui #hud-chat-log {
        bottom: 100px;
    }
    /* #2598: kbd-Tastenhinweise sind auf Touch-Geräten Ballast (keine Taste dahinter) */
    body.touch-ui #btn-open-bags kbd,
    body.touch-ui .game-menu-item kbd {
        display: none;
    }
    body.touch-ui #swing-bar-row,
    body.touch-ui #xp-bar-track {
        width: min(320px, calc(100vw - 2 * var(--hud-gap)));
    }
    #touch-action-pad {
        right: 12px;
        bottom: 204px;
        grid-template-columns: repeat(3, 50px);
        gap: 7px;
    }
    .touch-act-btn {
        width: 50px;
        height: 50px;
    }
    #touch-joystick-zone {
        left: 12px;
        bottom: 204px;
    }
}

@media (max-height: 500px) {
    #hud-unit-frames {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: calc(100vw - 140px);
    }
    /* Handy quer (#695): Chat nicht mehr ganz weg (sonst kein Schreiben/keine /bug-Meldung im Querformat), sondern als
       schmales Feld zwischen Joystick und Aktionspad über den Leisten – ohne Reiter, zwei Zeilen Verlauf + Eingabe */
    #hud-chat-log {
        left: 150px;
        right: auto;
        width: min(460px, calc(100vw - 390px));
        height: 84px;
        bottom: 84px;
        padding: 4px 8px;
    }
    #hud-chat-log > .wow-title.hud-chat-header {
        display: none;
    }
    /* Spielmenü passte quer nicht auf den Schirm (obere Einträge außerhalb, nicht antippbar): zweispaltig + scrollbar */
    #game-menu {
        top: 8px;
        bottom: 8px;
        width: min(560px, calc(100vw - 24px));
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-content: start;
    }
    #game-menu .game-menu-title,
    #game-menu .game-menu-hint {
        grid-column: 1 / -1;
    }
    #touch-joystick-zone {
        bottom: 12px;
    }
    body.touch-ui #swing-bar-row,
    body.touch-ui #xp-bar-track {
        width: min(300px, calc(100vw - 2 * 230px));
    }
    #touch-action-pad {
        bottom: 12px;
        grid-template-columns: repeat(4, 46px);
        gap: 6px;
    }
    .touch-act-btn {
        width: 46px;
        height: 46px;
    }
}

/* ============================================================================
 * HANDELSFENSTER: Kontorbuch-Zeilen & HBD-Münze
 * Auktionshaus, Questtafel, Söldner & Hive-Schrein nutzen dieselben Bausteine:
 * Zeile = Seitenstreifen (Seltenheit/Rohstofffarbe) · Name & Werte · Preis & Aktion
 * ============================================================================ */
.coin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
    font-size: 13px;
    color: var(--ui-gold-bright);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Geprägte Münze statt Text-Etikett */
.coin::before {
    content: '';
    width: 15px;
    height: 15px;
    border-radius: 50%;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 4px, rgba(80, 52, 14, 0.55) 4px 5px, transparent 5px),
        radial-gradient(circle at 35% 30%, #fbe9b0 0%, #d8ad57 45%, #8f6522 100%);
    box-shadow: 0 0 0 1px rgba(60, 40, 10, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
}
.coin small {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ui-text-muted);
    margin-left: -2px;
}

.ah-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--ui-line);
}
.ah-toolbar .tabs-bar {
    border-bottom: 0;
    margin-bottom: 0;
}
.ah-wallet {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px 9px;
    font-size: 12px;
    color: var(--ui-text-muted);
}
.ah-wallet .coin {
    font-size: 15px;
}
.ah-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pane-hint {
    font-size: 12.5px;
    color: var(--ui-text-dim);
    max-width: 70ch;
}

.ledger-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ledger-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ui-gold);
}
.ledger {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ui-line-neutral);
    border-radius: var(--ui-radius);
    background: rgba(10, 12, 17, 0.6);
    overflow: hidden;
}
.ledger-row {
    --mark: var(--ui-line-strong);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 10px 20px;
    border-top: 1px solid var(--ui-line-neutral);
}
.ledger-row:first-child {
    border-top: 0;
}
.ledger-row::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 2px;
    background: var(--mark);
}
.ledger-row:hover {
    background: rgba(255, 255, 255, 0.025);
}
.ledger-row.is-empty {
    opacity: 0.5;
}
.lr-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.lr-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ui-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lr-icon {
    margin-right: 7px;
}
.lr-count {
    margin-left: 4px;
    font-weight: 500;
    font-size: 12px;
    color: var(--ui-text-muted);
    font-variant-numeric: tabular-nums;
}
.lr-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-size: 11.5px;
    color: var(--ui-text-dim);
}
.lr-stats {
    display: inline-flex;
    gap: 10px;
    font-variant-numeric: tabular-nums;
}
.lr-stats > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.lr-stats .ico {
    font-size: 11px;
    color: var(--ui-text-muted);
}
.lr-stats .lr-gs {
    color: var(--ui-gold);
    font-weight: 600;
}
.lr-seller {
    color: var(--ui-text-muted);
}
.lr-demand {
    font-size: 11.5px;
    color: var(--c-good);
}
.lr-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.lr-side .wow-btn {
    padding: 6px 12px;
    font-size: 12px;
}
.lr-side .coin {
    min-width: 78px;
    justify-content: flex-end;
}
.lr-note {
    font-size: 11.5px;
    color: var(--ui-text-muted);
}
.price-field,
.qty-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.price-field input,
.qty-field input {
    width: 112px;
    padding: 5px 38px 5px 8px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.qty-field input {
    width: 76px;
    padding-right: 32px;
}
.price-field small,
.qty-field small {
    position: absolute;
    right: 8px;
    font-size: 10.5px;
    color: var(--ui-text-muted);
    pointer-events: none;
}
.ledger-empty {
    padding: 16px 20px;
    font-size: 12.5px;
    color: var(--ui-text-muted);
}

/* Hinweisleiste (Lizenz, Status) */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background: rgba(214, 180, 110, 0.06);
    font-size: 12.5px;
    color: var(--ui-text-dim);
}
.notice > .ico {
    font-size: 16px;
    color: var(--ui-gold);
}
.notice strong {
    color: var(--ui-text);
}
.notice-text {
    flex: 1;
    min-width: 0;
}
.notice-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.notice-of {
    color: var(--ui-text-muted);
    font-size: 11.5px;
}

/* Formular über einer Liste (Kaufgesuche, Questtafel) */
.order-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-raised);
}
.order-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11.5px;
    color: var(--ui-text-dim);
    flex: 1 1 130px;
    min-width: 0;
}
.order-form label:first-child {
    flex-grow: 2;
}
.order-form select,
.order-form input {
    width: 100%;
    min-width: 0;
}

@media (max-width: 640px) {
    .ledger-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
    .lr-side {
        justify-content: flex-start;
    }
    .notice {
        flex-wrap: wrap;
    }
}
#ah-license-banner:empty,
#designer-license-banner:empty {
    display: none;
}

.order-form .wide-field {
    flex: 3 1 260px;
}
.order-form .form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 100%;
}

.lr-stars {
    color: var(--ui-gold-bright);
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.lr-stars small {
    letter-spacing: 0;
    color: var(--ui-text-muted);
}
.lr-desc {
    font-size: 12px;
    color: var(--ui-text-dim);
}
.lr-quote {
    font-size: 11.5px;
    font-style: italic;
    color: var(--ui-text-dim);
}
.lr-quote span {
    font-style: normal;
    color: var(--ui-text-muted);
}
.lr-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: var(--c-good);
}
.lr-side select {
    padding: 5px 8px;
    font-size: 12px;
}
.ledger-row.is-stacked {
    grid-template-columns: minmax(0, 1fr);
}
.review-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.review-form select {
    color: var(--ui-gold-bright);
    padding: 5px 8px;
}
.review-form input {
    flex: 1 1 240px;
    padding: 5px 8px;
    font-size: 12.5px;
}
.review-form .wow-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Hive-Schrein */
.account-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-raised);
}
.account-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}
.account-mode {
    font-size: 12px;
    color: var(--ui-text-muted);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-warn);
}
.status-dot.is-on {
    background: var(--c-good);
    box-shadow: 0 0 8px var(--c-good);
}
.account-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.account-actions input {
    width: 170px;
}
.lr-owned {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--c-good);
}
.tx-log {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: rgba(10, 12, 17, 0.6);
    font-size: 11.5px;
    color: var(--ui-text-dim);
}

.tx-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.tx-tag {
    flex-shrink: 0;
    font-size: 10.5px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--ui-line-neutral);
    color: var(--ui-text-muted);
}
.tx-tag.is-live {
    color: var(--c-good);
    border-color: rgba(76, 195, 138, 0.4);
}

/* Atelier: Werte, Kosten & Inventar */
.designer-profile {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-raised);
}
.profile-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.profile-head .profile-hint {
    flex-basis: 100%;
    font-size: 12px;
    opacity: 0.75;
}
.profile-head {
    flex-wrap: wrap;
}
.profile-rarity {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}
.profile-head .lr-gs {
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-gold);
}
#designer-stats-preview .lr-stats {
    font-size: 12.5px;
    gap: 14px;
}
.cost-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cost-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-inset);
    color: var(--ui-text-dim);
}
.cost-chip b {
    font-variant-numeric: tabular-nums;
}
.cost-chip.is-ok b {
    color: var(--c-good);
}
.cost-chip.is-missing {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.45);
    color: #7c8594;
    opacity: 0.72;
}
.cost-chip.is-missing b {
    color: #94a3b8;
}
.wow-btn.is-unaffordable {
    opacity: 0.55;
    filter: grayscale(0.45);
}
.designer-inventory {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-line-neutral);
}
.designer-inventory .ledger-title {
    font-size: 14px;
}
.demand-chip .coin {
    font-size: 12px;
    margin-left: 4px;
}
@media (max-width: 760px) {
    .designer-inventory {
        grid-template-columns: minmax(0, 1fr);
    }
}
.modal-close-btn {
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .modal-header {
        padding: 12px 16px;
    }
    .modal-body {
        padding: 16px;
    }
}

/* NPC Dialog & Interaktions-Fenster */
/* NSC-Gespräch (#1360): ohne Unschärfe und nur unten abgedunkelt, Fenster unten – die Kamera rückt über die Schulter an den NSC
   heran (questmarkers.js), man sieht ihn beim Reden statt einer verschwommenen Fläche */
#modal-npc-dialog { backdrop-filter: none; background: linear-gradient(180deg, rgba(4, 6, 10, 0) 30%, rgba(4, 6, 10, 0.6) 100%); align-items: flex-end; padding-bottom: 3vh; }
#modal-npc-dialog .npc-dialog-window { max-height: 60vh; }
/* Breite Bildschirme und Handy quer: Fenster links wie ein klassisches Questfenster – unten mittig verdeckte es den NSC, die
   Kamera stellt ihn rechts neben den Helden (yaw + 0,38) */
@media (min-width: 900px), (orientation: landscape) and (min-width: 600px) {
    #modal-npc-dialog { justify-content: flex-start; align-items: center; padding: 0 0 0 max(12px, 2.5vw);
        background: linear-gradient(90deg, rgba(4, 6, 10, 0.55) 0%, rgba(4, 6, 10, 0) 45%); }
    #modal-npc-dialog .npc-dialog-window { width: min(480px, 40vw); max-height: 82vh; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) {
    #modal-npc-dialog .npc-dialog-window { width: min(420px, 50vw); max-height: 94vh; }
}
/* Handy (mobile-mode macht sonst jedes Fenster zum Vollbild-Blatt): hochkant unteres Blatt bis 58 % Höhe, quer Seitenleiste
   links – oben bzw. rechts bleibt der NSC sichtbar */
body.mobile-mode #modal-npc-dialog { align-items: flex-end; }
body.mobile-mode #modal-npc-dialog .npc-dialog-window { height: auto !important; max-height: 58dvh !important; border-radius: 14px 14px 0 0 !important; }
@media (orientation: landscape) {
    body.mobile-mode #modal-npc-dialog { align-items: stretch; justify-content: flex-start; }
    body.mobile-mode #modal-npc-dialog .npc-dialog-window { width: min(420px, 52vw) !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 14px 14px 0 !important; }
}

.npc-dialog-window {
    width: min(600px, 94vw);
    border-color: rgba(253, 224, 71, 0.4);
}
.npc-dialog-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.npc-header-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--ui-bg-inset, rgba(15, 23, 42, 0.6));
    border: 1px solid var(--ui-line-neutral, rgba(255, 255, 255, 0.1));
    border-radius: var(--ui-radius-sm, 8px);
}
.npc-avatar-badge {
    font-size: 30px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid var(--ui-gold, #fde047);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(253, 224, 71, 0.2);
}
.npc-meta h3 {
    margin: 0;
    font-size: 17px;
    color: var(--ui-gold, #fde047);
    font-family: var(--font-title, Cinzel, serif);
    letter-spacing: 0.5px;
}
.npc-guild-badge {
    font-size: 12px;
    color: #38bdf8;
    margin-top: 2px;
    font-weight: 500;
}
.npc-greeting-box {
    font-size: 13.5px;
    line-height: 1.6;
    color: #f1f5f9;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.75);
    border-left: 3px solid var(--ui-gold, #fde047);
    border-radius: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.npc-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.npc-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 15px;
    text-align: left;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: var(--ui-radius-sm, 8px);
    color: #f1f5f9;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.16s ease;
}
.npc-option-btn:hover {
    border-color: var(--ui-gold, #fde047);
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #fef08a;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.npc-option-btn .opt-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.npc-option-btn .opt-text {
    flex: 1;
    font-weight: 500;
}
.npc-option-btn .opt-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(250, 204, 21, 0.15);
    border: 1px solid rgba(250, 204, 21, 0.35);
    border-radius: 999px;
    color: #fde047;
    white-space: nowrap;
}
/* Freitext-Frage an den NPC (KI-NPC-Modus, #578): passt zu .npc-option-btn, Enter sendet */
.npc-ask-input {
    width: 100%;
    padding: 10px 14px;
    margin-top: 2px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border: 1px dashed #475569;
    border-radius: var(--ui-radius-sm, 8px);
    color: #f1f5f9;
    font-size: 13px;
    outline: none;
    transition: border-color 0.16s ease;
}
.npc-ask-input::placeholder {
    color: #64748b;
}
.npc-ask-input:focus {
    border-color: var(--ui-gold, #fde047);
}
.npc-ask-input:disabled {
    opacity: 0.5;
}

/* Charakterauswahl */
.charselect-card {
    width: min(760px, 96vw);
}
.charselect-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    margin-top: 14px;
}
.charselect-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.charselect-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.char-slot {
    --mark: var(--ui-line-strong);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px 12px 16px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    border-left: 3px solid var(--mark);
    background: var(--ui-bg-raised);
    color: var(--ui-text);
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
}
.char-slot:hover {
    border-color: var(--ui-line);
}
.char-slot:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}
.char-slot.is-selected {
    background: rgba(214, 180, 110, 0.1);
    border-color: var(--ui-line-strong);
}
/* Unlesbarer Spielstand (#896): Platz bleibt belegt, Hinweis statt Name */
.char-slot.is-broken {
    border-style: dashed;
    border-color: rgba(220, 120, 110, 0.6);
}
.char-slot.is-broken .char-slot-name {
    color: #e8a093;
}
.char-slot-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-gold-bright);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.char-slot-meta {
    font-size: 12px;
    color: var(--ui-text-dim);
    margin-top: 2px;
}
.char-slot-level {
    font-size: 20px;
    font-weight: 700;
    color: var(--ui-text);
    font-variant-numeric: tabular-nums;
}
.char-slot-level small {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ui-text-muted);
    text-align: right;
}
.char-slot-empty {
    padding: 12px 16px;
    border-radius: var(--ui-radius);
    border: 1px dashed var(--ui-line-neutral);
    font-size: 12.5px;
    color: var(--ui-text-muted);
}
.charselect-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}
.charselect-actions #btn-charselect-play {
    flex: 1;
    padding: 11px;
    font-size: 14px;
}
.wow-btn.danger-btn {
    border-color: rgba(224, 100, 90, 0.55);
    color: #f0a39a;
}
#charselect-preview-canvas {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: #070a10;
    width: 310px;
    height: 360px;
    max-width: 100%;
}
@media (max-width: 720px) {
    .charselect-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    #charselect-preview-canvas {
        height: 240px;
        width: 100%;
    }
}

/* ============================================================================
 * CHARAKTER & INVENTAR [C]: Puppe mit Ausrüstungsplätzen, Werte-Tafel, Taschenraster, Anprobe, Tooltip
 * ========================================================================== */
#hud-player-frame {
    cursor: pointer;
}
.character-window {
    width: min(1100px, 94vw);
    height: min(800px, 88vh);
}
.character-window .modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 12px;
}
.char-body .tabs-bar {
    flex-shrink: 0;
    margin-bottom: 0;
}
.char-body .tab-btn small {
    margin-left: 6px;
    font-size: 10.5px;
    color: var(--ui-text-muted);
}
.char-pane {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 18px;
}
.char-doll {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
}
.char-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.char-slots-left {
    grid-column: 1;
    grid-row: 1;
}
.char-slots-right {
    grid-column: 3;
    grid-row: 1;
}
.char-slots-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
}
.char-stage {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    min-height: 0;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background: #070a10;
    overflow: hidden;
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
}
.char-preview {
    position: relative;
    width: 100%;
    height: 100%;
}
.char-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.char-slot {
    --mark: rgba(255, 255, 255, 0.2);
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--ui-text-dim);
    font-family: var(--font-ui);
    cursor: pointer;
}
.char-slot-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    font-size: 27px;
    line-height: 1;
    border-radius: 9px;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--mark) 35%, #0a0c11) 0%, #0a0c11 80%);
    border: 2px solid color-mix(in srgb, var(--mark) 70%, transparent);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.char-slot:not(.is-filled) .char-slot-icon {
    border-style: dashed;
    opacity: 0.55;
    filter: grayscale(1);
}
.char-slot:hover .char-slot-icon {
    transform: translateY(-1px);
    border-color: var(--mark);
}
.char-slot.is-selected .char-slot-icon {
    box-shadow: 0 0 0 2px var(--ui-gold), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.char-slot.is-nowear .char-slot-icon {
    border-color: var(--c-warn);
}
.char-slot:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
    border-radius: 6px;
}
.char-slot-gs {
    position: absolute;
    right: 3px;
    bottom: 1px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ui-gold);
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.char-slot-label {
    max-width: 72px;
    font-size: 10px;
    color: var(--ui-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.char-slot.is-filled .char-slot-label {
    color: var(--ui-text-dim);
}
.char-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}
.char-stats,
.char-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-raised);
    flex-shrink: 0;
}
.cs-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cs-class {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
}
.cs-race {
    font-size: 11.5px;
    color: var(--ui-text-muted);
}
.cs-sub {
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}
.cs-sub small {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.cs-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cs-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0;
    font-size: 12px;
    color: var(--ui-text-dim);
    border-bottom: 1px dotted rgba(255, 255, 255, 0.07);
}
.cs-row strong {
    color: var(--ui-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cs-row strong small {
    margin-left: 5px;
    font-weight: 500;
    color: var(--ui-text-muted);
}
.cs-xp {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--ui-text-muted);
}
.cs-xp-track {
    height: 6px;
    border-radius: 3px;
    background: #0a0c11;
    border: 1px solid var(--ui-line-neutral);
    overflow: hidden;
}
.cs-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.cd-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.cd-icon {
    --mark: var(--ui-line-strong);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--mark) 35%, #0a0c11) 0%, #0a0c11 80%);
    border: 2px solid color-mix(in srgb, var(--mark) 70%, transparent);
}
.cd-name {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
}
.cd-kind {
    font-size: 11px;
    color: var(--ui-text-muted);
    line-height: 1.35;
}
.cd-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--ui-text-dim);
    font-variant-numeric: tabular-nums;
}
.cd-stats .ico {
    font-size: 11px;
    color: var(--ui-text-muted);
    margin-right: 3px;
}
.cd-stats .lr-gs {
    color: var(--ui-gold);
    font-weight: 600;
}
.cd-delta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 10px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.cd-up,
.tip-delta-up {
    color: var(--c-good);
}
.cd-down,
.tip-delta-down {
    color: #f87171;
}
.cd-same,
.tip-delta-same {
    color: var(--ui-text-muted);
}
.cd-meta {
    font-size: 11px;
    line-height: 1.45;
    color: var(--ui-text-muted);
}
.cd-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.cd-actions .wow-btn {
    padding: 7px 8px;
    font-size: 12px;
}
.cd-actions .span2 {
    grid-column: 1 / -1;
}
.cd-note {
    font-size: 11px;
    color: var(--c-warn);
}
.cd-empty {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ui-text-muted);
}
.cd-alt-title {
    margin-top: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}
.cd-alt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-inset);
}
.cd-alt-icon {
    --mark: var(--ui-line-strong);
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 16px;
    line-height: 1;
    border-radius: 6px;
    background: #0a0c11;
    border: 1px solid color-mix(in srgb, var(--mark) 70%, transparent);
}
.cd-alt-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.cd-alt-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cd-alt-meta {
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--ui-text-muted);
}
.cd-alt .wow-btn {
    padding: 5px 9px;
    font-size: 11px;
    flex-shrink: 0;
}
.bag-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.bag-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
#bag-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-gold);
}
.bag-head .wow-btn {
    padding: 6px 10px;
    font-size: 11.5px;
}
.bag-hint {
    margin: 0;
    flex-shrink: 0;
}
.bag-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, 56px);
    gap: 6px;
    align-content: start;
    justify-content: start;
    padding: 8px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: rgba(10, 12, 17, 0.6);
}
.bag-slot {
    --mark: var(--ui-line-neutral);
    position: relative;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 7px;
    background: #0a0c11;
    border: 2px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7);
    color: var(--ui-text);
    font-family: var(--font-ui);
}
.bag-slot.is-filled {
    cursor: pointer;
    border-color: color-mix(in srgb, var(--mark) 70%, transparent);
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--mark) 32%, #0a0c11) 0%, #0a0c11 80%);
    transition: transform 0.1s, border-color 0.15s;
}
.bag-slot.is-filled:hover {
    transform: translateY(-1px);
    border-color: var(--mark);
}
.bag-slot.is-selected {
    box-shadow: 0 0 0 2px var(--ui-gold), inset 0 0 0 1px rgba(0, 0, 0, 0.7);
}
.bag-slot.is-overflow {
    border-style: dashed;
    border-color: rgba(248, 113, 113, 0.5);
}
.bag-slot:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}
.bag-slot-icon {
    font-size: 24px;
    line-height: 1;
}
.bag-slot-gs {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ui-gold);
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.bag-slot-flag {
    position: absolute;
    left: 4px;
    top: 1px;
    font-size: 11px;
    font-weight: 800;
    color: var(--c-warn);
    text-shadow: 0 1px 2px #000;
}
.bag-stage {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 300px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background: #070a10;
    overflow: hidden;
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
}
#item-tip {
    position: fixed;
    z-index: 3000;
    width: 262px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ui-line-strong);
    background: rgba(8, 10, 16, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    font-family: var(--font-ui);
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ui-text-dim);
}
.tip-name {
    margin-bottom: 1px;
    font-size: 13px;
    font-weight: 700;
}
.tip-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.tip-muted {
    color: var(--ui-text-dim);   /* #1508: auf dunklem Tooltip-Grund unter 4,5:1 mit Muted */
}
.tip-stat {
    color: var(--ui-text);
    font-variant-numeric: tabular-nums;
}
.tip-warn {
    margin-top: 4px;
    color: var(--c-warn);
}
.tip-sep {
    height: 1px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.08);
}
/* Set-Info-Block im Tooltip + Detail (WoW-Stil) */
.tip-set-block,
.cd-set-block {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tip-set-name,
.cd-set-name {
    color: #f5c842;
    font-weight: 700;
    font-size: 11.5px;
    margin-bottom: 3px;
}
.tip-set-tier,
.cd-set-tier {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ui-text-muted);
    padding-left: 2px;
}
.tip-set-tier::before,
.cd-set-tier::before {
    content: '·';
    flex: none;
    color: var(--ui-text-muted);
}
.tip-set-tier.active,
.cd-set-tier.active {
    color: #4ade80;
}
.tip-set-tier.active::before,
.cd-set-tier.active::before {
    content: '✓';
    color: #4ade80;
}
.tip-set-count,
.cd-set-count {
    flex: none;
    font-weight: 700;
    min-width: 30px;
}
/* Handy quer (#695): das Fenster ist niedriger als Puppe + Plätze – Brust/Stiefel lagen abgeschnitten außerhalb. Scrollbar machen. */
@media (max-height: 500px) {
    .character-window {
        height: 96vh;
        max-height: 96vh;
    }
    .char-pane {
        overflow-y: auto;
    }
    .char-doll {
        flex: none;
    }
    /* Querformat (#1825): Werte-Zeilen wie „Kritische Treffer 26,0 % Fertigkeiten · Autoangriff 20 %“ dürfen umbrechen – der Zusatz steht eigene Zeile unter dem Wert. */
    .cs-row strong {
        white-space: normal;
        text-align: right;
    }
    .cs-row strong small {
        display: block;
        margin-left: 0;
    }
}
@media (max-width: 760px) {
    .character-window {
        height: min(920px, 92vh);
    }
    .char-pane {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    .char-doll {
        flex: none;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .char-stage {
        grid-column: 1;
        grid-row: 1;
        height: 300px;
    }
    .char-slots {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .char-slots-left {
        grid-column: 1;
        grid-row: 2;
    }
    .char-slots-right {
        grid-column: 1;
        grid-row: 3;
    }
    .char-slots-bottom {
        grid-row: 4;
    }
    .char-side {
        flex: none;
        overflow: visible;
    }
    .char-pane[data-char-pane="bag"] .char-side {
        order: -1;
    }
    .bag-main {
        flex: none;
    }
    .bag-grid {
        flex: none;
        overflow: visible;
        justify-content: center;
    }
    .bag-stage {
        aspect-ratio: 16 / 10;
        max-height: 260px;
    }
    #item-tip {
        display: none !important;
    }
}

/* ============================================================================
 * HIVE-SCHREIN: Kosmetik-Shop mit Kategorien, Kachel-Raster und 3D-Vorschau (js/cosmetic-preview.js)
 * Fenster hat feste Höhe, Kachel-Raster scrollt für sich; rechts Vorschau + Detailkarte.
 * ========================================================================== */
.hive-window {
    width: min(1120px, 94vw);
    height: min(800px, 88vh);
}
.hive-window .modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 12px;
}
.hive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.hive-toolbar .tabs-bar {
    margin-bottom: 0;
    border-bottom: 0;
}
.hive-wallet {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ui-text-dim);
}
.hive-wallet .hw-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.hive-wallet strong {
    color: var(--ui-text);
    font-variant-numeric: tabular-nums;
}
.hive-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}
.hive-pane[data-hive-pane="shop"] {
    overflow: hidden;
}
.mtx-shop {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}
.mtx-browse {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.mtx-hint {
    margin: 0;
    flex-shrink: 0;
}
.mtx-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.mtx-cat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--ui-bg-inset);
    border: 1px solid var(--ui-line-neutral);
    color: var(--ui-text-dim);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mtx-cat small {
    font-size: 10.5px;
    color: var(--ui-text-muted);
    font-variant-numeric: tabular-nums;
}
.mtx-cat:hover {
    color: var(--ui-text);
    border-color: var(--ui-line-strong);
}
.mtx-cat.active {
    color: var(--ui-gold-bright);
    border-color: var(--ui-gold);
    background: rgba(217, 181, 108, 0.1);
}
.mtx-cat.active small {
    color: var(--ui-gold);
}
.mtx-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    padding: 3px 8px 6px 3px;
}
.mtx-card {
    --mark: var(--ui-line-strong);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px 10px;
    border-radius: var(--ui-radius);
    border: 1px solid color-mix(in srgb, var(--mark) 45%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--mark) 13%, var(--ui-bg-raised)) 0%, var(--ui-bg-inset) 100%);
    color: var(--ui-text);
    font-family: var(--font-ui);
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.mtx-card:hover {
    transform: translateY(-2px);
    border-color: var(--mark);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.mtx-card.is-selected {
    border-color: var(--ui-gold);
    box-shadow: 0 0 0 1px var(--ui-gold), 0 8px 20px rgba(0, 0, 0, 0.35);
}
.mtx-card:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}
.mtx-card-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    font-size: 30px;
    line-height: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--mark) 40%, #0a0c11) 0%, #0a0c11 75%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 50%, transparent);
}
.mtx-card-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mtx-card-foot {
    font-size: 11px;
    color: var(--ui-text-dim);
    font-variant-numeric: tabular-nums;
}
.mtx-card-foot small {
    margin-left: 2px;
    font-size: 9.5px;
    color: var(--ui-text-muted);
}
.mtx-card.is-owned .mtx-card-foot {
    color: var(--c-good);
}
.mtx-card-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--ui-gold);
    color: #1d1508;
}
.mtx-inspect {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
}
.mtx-preview {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background: #070a10;
    overflow: hidden;
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
}
.mtx-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.mtx-preview-tag {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
    pointer-events: none;
    font-family: var(--font-ui);
    text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
.mtx-tag-title {
    font-size: 11px;
    font-style: italic;
    font-weight: 600;
}
.mtx-tag-title.is-glow {
    animation: mtxTitleGlow 1.6s ease-in-out infinite;
}
.mtx-tag-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
}
@keyframes mtxTitleGlow {
    0%, 100% { filter: drop-shadow(0 0 3px currentColor); }
    50% { filter: drop-shadow(0 0 9px currentColor); }
}
.mtx-preview-tools {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 6px;
}
.mtx-tool {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(10, 12, 17, 0.75);
    border: 1px solid var(--ui-line-neutral);
    color: var(--ui-text-dim);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.mtx-tool:hover {
    color: #fff;
    border-color: var(--ui-line-strong);
}
.mtx-tool.active {
    color: var(--ui-gold-bright);
    border-color: var(--ui-gold);
}
.mtx-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line-neutral);
    background: var(--ui-bg-raised);
}
.mtx-detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.mtx-detail-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}
.mtx-detail-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}
.mtx-detail-kind {
    font-size: 11px;
    color: var(--ui-text-muted);
}
.mtx-detail-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ui-text-dim);
}
.mtx-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.mtx-detail-actions .wow-btn {
    flex: 1;
}
.mtx-detail-note,
.mtx-detail-empty {
    font-size: 11px;
    line-height: 1.45;
    color: var(--ui-text-muted);
}
@media (max-width: 760px) {
    .hive-window {
        height: min(900px, 92vh);
    }
    .hive-pane[data-hive-pane="shop"] {
        overflow-y: auto;
    }
    .mtx-shop {
        flex: none;
        display: flex;
        flex-direction: column;
    }
    .mtx-browse {
        flex: none;
        min-height: auto;
    }
    .mtx-inspect {
        order: -1;
        flex: none;
        overflow: visible;
    }
    .mtx-preview {
        aspect-ratio: 16 / 10;
        max-height: 260px;
    }
    .mtx-grid {
        flex: none;
        overflow: visible;
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    }
}

/* Tastenbelegung & Controller (Einstellungen) */
.settings-keybinds-wrap summary { cursor: pointer; padding: 8px 0; color: var(--ui-text, #e5e7eb); }
.settings-keybinds-wrap summary span { color: var(--ui-text-dim, #94a3b8); font-size: 12px; margin-left: 6px; }
.kb-group { margin: 8px 0 4px; }
.kb-group-title { font-family: Cinzel, serif; color: #e8c27a; font-size: 13px; margin: 6px 0 4px; }
.kb-row { display: grid; grid-template-columns: 1fr 140px 150px; gap: 8px; align-items: center; padding: 3px 0; }
.kb-label { font-size: 13px; color: var(--ui-text, #e5e7eb); }
.kb-key, .kb-pad { font-size: 12px; padding: 4px 8px; min-height: 28px; }
.kb-wait { outline: 2px solid #e8c27a; animation: kbPulse 1s infinite; }
@keyframes kbPulse { 50% { opacity: 0.6; } }
.kb-pad-settings { grid-template-columns: 1fr auto auto; margin-top: 8px; }
.kb-check { font-size: 12px; color: var(--ui-text-dim, #94a3b8); display: flex; gap: 6px; align-items: center; }
@media (max-width: 640px) { .kb-row { grid-template-columns: 1fr 1fr; } .kb-row .kb-label { grid-column: 1 / -1; } }

/* ============================================================================
 * HUD-ANORDNUNG (Bearbeitungsmodus aus den Einstellungen, js/hudlayout.js)
 * Geister-Rahmen liegen über den echten Elementen und nehmen Ziehen/Mausrad/Eckgriff entgegen.
 * ========================================================================== */
.settings-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#hud-edit-layer {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
}

body.hud-edit #hud-edit-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 209, 0, 0.05) 1px, transparent 1px) 0 0 / 50px 50px,
        linear-gradient(90deg, rgba(255, 209, 0, 0.05) 1px, transparent 1px) 0 0 / 50px 50px;
}

.hud-edit-ghost {
    position: fixed;
    box-sizing: border-box;
    pointer-events: auto;
    touch-action: none;
    cursor: move;
    outline: 2px dashed rgba(255, 209, 0, 0.75);
    outline-offset: 2px;
    background: rgba(255, 209, 0, 0.06);
    border-radius: 6px;
    transition: background 0.12s;
}

.hud-edit-ghost:hover,
.hud-edit-ghost.dragging {
    background: rgba(255, 209, 0, 0.16);
}

.hud-edit-ghost.selected {
    outline: 2px solid #ffd100;
    box-shadow: 0 0 0 4px rgba(255, 209, 0, 0.2), 0 0 18px rgba(255, 209, 0, 0.35);
}

.hud-edit-ghost.custom {
    outline-color: rgba(74, 222, 128, 0.85);
}

.hud-edit-label {
    position: absolute;
    left: -2px;
    top: -2px;
    transform: translateY(-100%);
    padding: 2px 7px;
    border-radius: 5px 5px 5px 0;
    background: rgba(10, 9, 8, 0.92);
    border: 1px solid rgba(255, 209, 0, 0.6);
    color: #ffd100;
    font-family: var(--font-ui);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    pointer-events: none;
}

.hud-edit-ghost.custom .hud-edit-label {
    border-color: rgba(74, 222, 128, 0.7);
    color: #4ade80;
}

.hud-edit-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #ffd100;
    border: 2px solid #1a1407;
    box-shadow: 0 0 0 1px rgba(255, 209, 0, 0.6);
    cursor: nwse-resize;
    right: -8px;
    bottom: -8px;
}

.hud-edit-ghost[data-handle='left-bottom'] .hud-edit-handle { right: auto; left: -8px; bottom: -8px; cursor: nesw-resize; }
.hud-edit-ghost[data-handle='right-top'] .hud-edit-handle { bottom: auto; top: -8px; right: -8px; cursor: nesw-resize; }
.hud-edit-ghost[data-handle='left-top'] .hud-edit-handle { right: auto; bottom: auto; left: -8px; top: -8px; cursor: nwse-resize; }

#hud-edit-bar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(820px, calc(100vw - 32px));
    padding: 12px 16px;
    pointer-events: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--ui-bg-soft);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.hud-edit-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-gold-bright, #ffd100);
}

.hud-edit-hint {
    font-size: 11.5px;
    color: var(--ui-text-dim);
}

.hud-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.hud-edit-sel {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--ui-text);
    min-width: 150px;
}

.hud-edit-scale {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ui-text-dim);
}

.hud-edit-scale input[type='range'] {
    width: 140px;
    accent-color: #ffd100;
}

.hud-edit-scale output {
    min-width: 42px;
    font-variant-numeric: tabular-nums;
    color: var(--ui-text);
}

.hud-edit-snap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--ui-text-dim);
    cursor: pointer;
}

.hud-edit-snap input {
    accent-color: #ffd100;
}

#hud-edit-done {
    margin-left: auto;
}

/* Während der Anpassung: Hauptmenü-Kürzel und Spielfenster bleiben zu, Geister liegen über allem */
body.hud-edit .modal-backdrop {
    display: none !important;
}

/* Im Bearbeitungsmodus auch Elemente anfassbar, die das Spiel gerade ausblendet */
body.hud-edit #hud-target-frame.hidden {
    display: flex !important;
}

body.hud-edit #hud-fps.hidden {
    display: block !important;
}

/* ---------- Hinweis-Stapel (HiveToast) ----------
   Nutzerwunsch: Einblendungen bleiben stehen, bis man sie wegklickt, sind gut lesbar
   und bleiben auch lesbar, wenn mehrere gleichzeitig auflaufen. */
#hud-notices {
    position: fixed;
    /* unterhalb der Phasen-Leiste: die Hinweise bleiben stehen und duerfen sie nicht dauerhaft verdecken */
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 41;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    width: min(720px, 92vw);
    pointer-events: none;
}
#hud-notices:empty { display: none; }
.nt-item {
    position: relative;
    display: block;
    padding: 12px 40px 12px 16px;
    border-radius: var(--ui-radius);
    background: linear-gradient(180deg, rgba(16, 19, 26, 0.97), rgba(13, 15, 21, 0.93));
    border: 1px solid var(--ui-line-strong);
    border-left: 4px solid var(--nt-accent, #6ea8ff);
    box-shadow: var(--ui-shadow);
    color: #f3f6fb;
    cursor: pointer;
    pointer-events: auto;
    text-align: left;
    animation: nt-in 0.18s ease-out;
}
.nt-item:hover { border-color: var(--nt-accent, #6ea8ff); }
.nt-item .nt-kicker {
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nt-accent, #6ea8ff);
    margin-bottom: 2px;
}
.nt-item .nt-title { display: block; font-size: 16px; font-weight: 650; line-height: 1.3; }
.nt-item .nt-sub { display: block; font-size: 13.5px; line-height: 1.45; opacity: 0.85; margin-top: 3px; }
.nt-item .nt-close {
    position: absolute; top: 8px; right: 10px;
    font-size: 17px; line-height: 1; opacity: 0.55;
}
.nt-item:hover .nt-close { opacity: 1; }
.nt-item .nt-count {
    position: absolute; bottom: 8px; right: 12px;
    font-size: 11.5px; font-weight: 650; opacity: 0.8;
}
.nt-item.nt-out { animation: nt-out 0.18s ease-in forwards; }
.nt-info { --nt-accent: #6ea8ff; }
.nt-world { --nt-accent: #f2d790; }
.nt-gm { --nt-accent: #7ee0b0; }
.nt-warn { --nt-accent: #ffb347; }
.nt-all {
    align-self: center;
    pointer-events: auto;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 99px;
    background: rgba(13, 15, 21, 0.9);
    border: 1px solid var(--ui-line-strong);
    color: #cfd8e6;
}
.nt-all:hover { color: #fff; border-color: #6ea8ff; }
@keyframes nt-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes nt-out { to { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 640px) {
    #hud-notices { top: 128px; width: 94vw; gap: 6px; }
    .nt-item { padding: 10px 34px 10px 12px; }
    .nt-item .nt-title { font-size: 15px; }
    .nt-item .nt-sub { font-size: 12.5px; }
}

/* HBD-Handel vom Spielserver abgeschaltet: Verkaufen/Kaufgesuche ausblenden, nur der Markt bleibt zum Ansehen */
#modal-auction.ah-hbd-off [data-ah-tab="sell"],
#modal-auction.ah-hbd-off [data-ah-tab="orders"],
#modal-auction.ah-hbd-off [data-ah-pane="sell"],
#modal-auction.ah-hbd-off [data-ah-pane="orders"] { display: none !important; }

/* Atelier #459: Stil der Form (Klassisch/Cute/Badass), Set-Würfel und Set-Vorschlag, Kostenzeile */
.des-style-row[hidden], .designer-set[hidden] { display: none; }
.des-style-row { grid-template-columns: 1fr; }
.style-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.style-chip { flex: 1; min-width: 84px; padding: 7px 10px; border-radius: 999px; border: 1px solid #5b4a2a; background: #1d1810; color: #e8d9b5; cursor: pointer; font-size: 13px; }
.style-chip.is-on { background: #3a2a10; border-color: #d9a441; color: #ffe7a3; font-weight: 600; }
.style-chip:focus-visible { outline: 2px solid #ffd76a; outline-offset: 2px; }
.designer-set-row { display: flex; gap: 8px; width: 100%; align-items: stretch; }
.designer-set-row select { min-width: 150px; }
.designer-set { margin: 8px 0; padding: 10px; border: 1px solid #5b4a2a; border-radius: 8px; background: rgba(29, 24, 16, 0.6); }
.designer-set-head { font-size: 13px; color: #e8d9b5; margin-bottom: 6px; }
.designer-set-piece { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid rgba(91, 74, 42, 0.5); }
.designer-set-piece:first-of-type { border-top: 0; }
.designer-set-piece .set-name { font-size: 13px; color: #f4ead0; }
.designer-set-piece .set-meta { font-size: 11px; color: #bfae86; }
.cost-summary { font-size: 12px; margin: 4px 0 0; }
.cost-summary.is-ok { color: #86efac; }
.cost-summary.is-missing { color: #fca5a5; }

/* Handy (bis 640 px): Geldzeile und Lizenz-Leiste bleiben als kompakter Streifen sichtbar (#494).
   Die Quest-Tracker-Box und Zonenanzeigen bleiben ausgeblendet; die Tastenhinweise wurden schon in #491 entfernt. */
@media (max-width: 640px) {
    #hud-top-center {
        display: flex !important;
        top: 204px;
        left: 8px;
        right: 8px;
        align-items: stretch;
        gap: 4px;
    }
    #hud-hive-bar {
        justify-content: flex-start;
        gap: 4px;
        padding: 4px 6px;
    }
    #hud-hive-bar > :not(.currency-pill.gold):not(.currency-pill.hbd) {
        display: none !important;
    }
    #hud-hive-bar .currency-pill {
        font-size: 11px;
        padding: 2px 6px;
    }
    #hud-career-banner {
        width: 100%;
        padding: 4px 6px 4px 10px;
        gap: 8px;
    }
    #hud-career-banner .career-line {
        font-size: 11px;
        flex-wrap: wrap;
    }
    #hud-career-banner #hud-career-status-text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}

/* Handy: Quest-Tracker als kompakter Streifen unter dem Solo-Fenster, nur wenn etwas zu sehen ist (#494) */
@media (max-width: 640px) {
    #hud-right-tracker {
        display: block !important;
        position: fixed;
        top: 298px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 92px;
        padding: 6px 10px;
    }
    #hud-right-tracker.is-empty {
        display: none !important;
    }
    #hud-right-tracker .quest-item-hud {
        font-size: 11px;
    }
    /* Event-Hinweise: die Spalte oben ist hier fest bemessen (Tracker ab 298 px) – Hinweise darunter statt in der Spalte */
    #hud-top-center > #hud-event-pills {
        position: fixed;
        top: 396px;
        left: 8px;
        right: 8px;
        gap: 4px;
    }
    body:has(#hud-right-tracker.is-empty) #hud-top-center > #hud-event-pills { top: 298px; }
    .hud-event-pill { font-size: 11px; padding: 2px 10px; }
}

/* Sprachumschalter (i18n.js) auf dem Loginscreen */
.lang-switch { position: fixed; top: 14px; right: 16px; z-index: 5; display: flex; gap: 2px; background: rgba(10,12,18,0.7); border: 1px solid rgba(217,181,108,0.4); border-radius: 6px; padding: 2px; }
.lang-switch button { background: transparent; border: 0; color: #d9b56c; font: 700 11px/1 Inter, sans-serif; letter-spacing: 0.08em; padding: 6px 9px; border-radius: 4px; cursor: pointer; }
.lang-switch button.active { background: rgba(217,181,108,0.25); color: #fbe7b0; }

/* Große Schnellknöpfe Vollbild/Musik im Anmeldebild (#823, Nutzer: „ganz groß, relativ“): Schrift und Polster wachsen mit
 * dem Bildschirm (Brille 1280×720 ≈ 21 px, 3440×1440 = 34 px), oben links gegenüber der Sprachwahl */
.login-quick {
    position: fixed;
    top: 14px;
    left: 16px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    max-width: calc(100vw - 140px);
    font-size: clamp(15px, 1.1vw + 0.9vh, 34px);
}
.login-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    min-height: 2.6em;
    padding: 0.5em 1em;
    border-radius: 0.45em;
    border: 1px solid rgba(217, 181, 108, 0.55);
    background: rgba(10, 12, 18, 0.78);
    color: #fbe7b0;
    font: 700 1em/1.1 Inter, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.login-quick-btn .ico { width: 1.25em; height: 1.25em; }
.login-quick-btn:hover,
.login-quick-btn:focus-visible { background: rgba(58, 44, 12, 0.92); border-color: #f0b429; outline: none; box-shadow: 0 0 0 2px rgba(240, 180, 41, 0.5), 0 6px 18px rgba(0, 0, 0, 0.45); }
.login-quick-btn.is-on { border-color: #f0b429; }
.login-quick-btn.is-off { color: #9aa4b1; }
.login-quick-auto {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.35em 0.7em;
    border-radius: 0.4em;
    background: rgba(10, 12, 18, 0.6);
    color: #e6e1d6;
    font: 600 0.72em/1.2 Inter, system-ui, sans-serif;
    cursor: pointer;
}
.login-quick-auto input { width: 1.3em; height: 1.3em; accent-color: #d9b56c; margin: 0; }
.login-quick .hidden { display: none; }
.settings-check { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--ui-text, #e6e1d6); cursor: pointer; }
.settings-check input { width: 16px; height: 16px; accent-color: #d9b56c; margin: 0; }

/* Große Zeilen in den Einstellungen (Vollbild, Musik – devin #823): relativ zum Bildschirm */
.settings-row-lg { padding: clamp(14px, 0.6vw + 0.8vh, 26px) 0; }
.settings-row-lg .settings-label strong { font-size: clamp(15px, 0.6vw + 0.6vh, 22px); }
.settings-row-lg .settings-label span { font-size: clamp(12.5px, 0.4vw + 0.5vh, 17px); }
.settings-row-lg .segmented { gap: 4px; padding: 4px; }
.settings-row-lg .segmented button { padding: 0.65em 1.2em; font-size: clamp(14px, 0.55vw + 0.6vh, 22px); border-radius: 8px; min-height: 44px; }
/* Gesamt- und Effekt-Regler (#1838): Schieber mit Prozentanzeige, Daumen ≥ 32 px auf dem Handy */
.settings-slider { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; max-width: 360px; }
.settings-slider input[type="range"] { flex: 1; min-width: 0; min-height: 32px; accent-color: var(--ui-gold, #fde047); }
.settings-slider output { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ui-text-muted); }
body.touch-ui .settings-slider input[type="range"] { min-height: 40px; }

/* Kleine Handy-Screens (≤480 px breit oder ≤550 px hoch): Brand kompakt, kein Überlappen des Anmeldefelds (#548) */
@media (max-width: 480px), (max-height: 550px) {
    .login-screen { gap: 10px; align-content: start; padding-top: 10px; grid-template-rows: auto auto auto auto; }
    .login-emblem { width: 54px; height: 54px; margin-bottom: 2px; }
    .login-kicker { font-size: 8px; letter-spacing: 0.16em; }
    .login-title { font-size: clamp(30px, 11vw, 44px); }
    .login-subtitle span { font-size: clamp(12px, 4.2vw, 16px); letter-spacing: 0.1em; }
    .login-subtitle small { font-size: 10px; letter-spacing: 0.08em; }
    .login-tagline { font-size: 12px; max-width: 92vw; }
    .login-brand { gap: 3px; }
    .login-panel { width: min(94vw, 360px); padding: 14px 14px 12px; gap: 7px; }
    .login-quick { position: static; max-width: 94vw; justify-content: center; margin-top: 34px; }
}
/* Handy quer (#1329, Handy-Check itch-ZIP): bei ~390 px Höhe lag das Anmeldefeld komplett unter dem Bildrand (Alpha-Hinweis,
   Schnellknöpfe und Marke ~480 px) – man sah beim Öffnen nur Titel und Knöpfe. Zweispaltig: links Hinweis/Knöpfe/Titel, rechts das
   Anmeldefeld sofort sichtbar; Emblem, Kicker und Untertitel-Zeile entfallen dort. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) {
    .login-screen { grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); grid-template-rows: auto auto auto 1fr auto; column-gap: 18px; row-gap: 6px; align-items: start; align-content: start; padding: 8px 14px 4px; }
    #step-login-box > .dev-phase-box { grid-column: 1; grid-row: 1; margin: 0; max-width: none; padding: 4px 8px; font-size: 11px; line-height: 1.3; }
    #step-login-box > .dev-phase-copy { grid-column: 1; grid-row: 2; margin: 0; }
    #step-login-box > .login-quick { grid-column: 1; grid-row: 3; margin-top: 0; justify-content: flex-start; }
    #step-login-box > .login-brand { grid-column: 1; grid-row: 4; align-self: center; }
    #step-login-box > .login-panel { grid-column: 2; grid-row: 1 / span 5; width: 100%; align-self: start; }
    #step-login-box > .login-footer { grid-column: 1; grid-row: 5; }
    #step-login-box .login-emblem, #step-login-box .login-kicker, #step-login-box .login-tagline { display: none; }
    #step-login-box .login-title { font-size: 30px; }
    /* Sprachwahl sonst fest oben rechts über dem Kopf des Anmeldefelds → in die linke Spalte (über dem Titel) */
    #step-login-box .lang-switch { position: static; align-self: center; margin-bottom: 2px; }
    /* Charaktererstellung: einspaltig (≤ 900 px) begann die Formularspalte samt „Welt betreten“ erst unter der Vorschau, also unter
       dem Bildrand – zweispaltig: Vorschau links in Bildhöhe, rechts Formular mit der oben angehefteten Fußleiste */
    .charcreate-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 12px; }
    .charcreate-grid > .preview-column { order: 0; position: sticky; top: 0; }
    #charcreate-preview-canvas { height: calc(100vh - 170px); min-height: 170px; }
}
/* Touch (#1355): das HUD-Schloss (hudlayout.js, Lage als Inline-Stil oben mittig) lag im Querformat auf der Status-/Tutorial-Zeile
   und war mit 24×22 px schwer zu treffen – rechts unter die Minikarte, unter den ALPHA-Badge (devphase.js), etwas größer */
body.touch-ui #hud-lock-btn { left: auto !important; right: 8px !important; top: 134px !important; width: 44px !important; height: 44px !important; font-size: 18px !important; line-height: 42px !important; }

/* Handy-Tippziele (#1362, Audit 390×844 / 844×390): primäre Bedienelemente mindestens 44 px (Apple-/Google-Richtwert) – Tasche und
   Spielmenü waren 42, „⋯“ 30–36, Status-/Tutorial-Zeile 34, Talentpunkte 36×32, ✕ im Spielmenü 29×23 px */
/* HUD-Schloss (z-index 10001) und ALPHA-Badge lagen über dem Ladeschirm – während des Ladens aus */
body.hc-loading-on #hud-lock-btn, body.hc-loading-on #dev-phase-badge { visibility: hidden !important; }
/* offenes Fenster (Inventar, Auktionshaus, Reisen …): der Schloss-Knopf schwebte auf dem Handy über dem Inhalt (QA #1552) */
body:has(.modal-backdrop:not(.hidden)) #hud-lock-btn { visibility: hidden !important; }
body.touch-ui .action-slot.slot-menu { min-width: 46px; min-height: 46px; }
body.mobile-mode #touch-action-pad .touch-more-btn { height: 44px; }
body.touch-ui #hud-mobile-strip, body.touch-ui #hud-mobile-strip.is-tutorial { min-height: 44px !important; }
/* hochkant läuft die Status-/Tutorial-Zeile über die ganze Breite (top 122 px) – ALPHA-Badge und HUD-Schloss darunter statt neben
   die Minikarte (quer liegt die Zeile oben mittig, dort bleibt es bei 94/134 px). Badge per höherer Spezifität statt !important,
   damit eine im HUD-Layout gespeicherte Lage (Inline-Stil) weiter gewinnt */
@media (orientation: portrait) {
    html body.touch-ui #dev-phase-badge { top: 172px; }
    html body.touch-ui #dev-phase-pop { top: 212px; }
    body.touch-ui #hud-lock-btn { top: 214px !important; }
    /* Hinweis-Banner (Entdeckung, Willkommen …) enden links vom ALPHA-Badge und Schloss statt darunter durchzulaufen (#1493) */
    html body.touch-ui #hud-notices { left: 8px; transform: none; width: calc(100vw - 128px); }
}
body.touch-ui #hud-player-points { min-width: 44px; min-height: 44px; }
/* Handy (#1842): das „+N“ lag mit 44 px Kantenlänge über dem Stufenkreis unten rechts und deckte das Porträt. Im Handy-Modus
   ist das Element 44×44 und endet über dem Stufenkreis (Tippfläche bleibt 44 px); gezeichnet wird nur die grüne Plakette
   (30×26) in der Mitte. Desktop bleibt unverändert. */
body.mobile-mode #hud-player-points { left: -6px; top: -22px; background: none; border-color: transparent; box-shadow: none; }
body.mobile-mode #hud-player-points::before { content: ''; position: absolute; inset: 9px 7px; border-radius: 13px; background: linear-gradient(180deg, #4cc38a, #23875a); border: 1px solid #0d3b24; box-shadow: 0 0 0 2px #12151c, 0 0 6px rgba(76, 195, 138, 0.55); z-index: -1; }
body.touch-ui .game-menu-close-btn { min-width: 44px; min-height: 44px; }
body.touch-ui #dev-phase-badge { min-height: 36px; }

/* hochkant: Sprachwahl (fest oben rechts) liegt in derselben Höhe – Schnellknöpfe darunter */
@media (max-width: 480px) {
    .login-quick { margin-top: 74px; }
}
/* Mittlere Höhe bis ~800 px (#923 N5): die festen Schnellknöpfe links oben kollidierten mit dem
   zentrierten Emblem – im Fluss über der Marke bleibt alles frei (1280×720: Logo lag über dem
   Vollbild-Häkchen). */
@media (min-width: 481px) and (min-height: 551px) and (max-height: 800px) {
    .login-screen { gap: 12px; align-content: start; padding-top: 8px; grid-template-rows: auto auto auto auto; }
    .login-quick { position: static; max-width: 94vw; justify-content: center; margin-top: 4px; }
    .login-emblem { width: 64px; height: 64px; margin-bottom: 2px; }
}

/* Kurze Bildschirme (1280×720, #1786; #2591: bei 720/768 Höhe liefen Anmeldefeld und „Offline spielen“ unter den Rand):
   Titel einzeilig, Wegleiste und Fließtext-Zeilen entfallen, Feld kompakter – alles ohne Scrollen bedienbar */
@media (min-width: 721px) and (max-height: 800px) {
    .login-title { font-size: clamp(38px, 4.2vw, 52px); }
    .login-title span { display: inline; }
    .login-tagline, .login-subtitle small { display: none; }
    .login-path { display: none; }
    .login-emblem { width: 48px; height: 48px; }
    .login-screen { gap: 8px; }
    .login-brand { gap: 3px; }
    .login-panel { padding: 14px 18px 12px; gap: 7px; }
    .login-cta { padding: 10px 14px; margin-top: 2px; }
    #step-login-box > .dev-phase-box { padding: 4px 12px; font-size: 11.5px; line-height: 1.35; }
}
/* Sehr kurze Schirme (1024×600 u. ä.): Emblem entfällt ganz, Alpha-Hinweis nochmals schmaler, Fußzeile entfällt */
@media (min-width: 721px) and (max-height: 640px) {
    .login-emblem { display: none; }
    .login-footer { display: none; }
    #step-login-box > .dev-phase-box { font-size: 10.5px; padding: 3px 10px; }
}

/* ---- Halloween-Login (saisonal 24.10.–2.11., Klasse .halloween am body) ---- */
.halloween .login-screen::before {
    content: '🎃';
    position: fixed; left: 6%; bottom: 8%;
    font-size: 64px; z-index: 0; pointer-events: none;
    filter: drop-shadow(0 0 24px rgba(249, 115, 22, 0.55));
    animation: hw-sway 5s ease-in-out infinite;
}
.halloween .login-screen::after {
    content: '🕸️';
    position: fixed; right: 3%; top: 4%;
    font-size: 72px; z-index: 0; pointer-events: none; opacity: 0.85;
    /* der ältere Satz .login-screen.halloween::after (Fledermäuse) trifft dasselbe Pseudo-Element: ohne diese Zeile
       flog das Netz mit dessen hwFly-Animation quer über den Bildschirm, mit 24 px Buchstabenabstand und left: 50% */
    left: auto; letter-spacing: 0; animation: none;
}
/* Handy: der Kürbis lag unten über „Realm Goldhain · online …“, das Netz über dem Titel – beide klein in die freien
   oberen Ecken. Steht hinter beiden Halloween-Regelsätzen (.login-screen.halloween oben, .halloween .login-screen hier),
   die sich beim gleichen Pseudo-Element überlagern */
@media (max-width: 640px) {
    .halloween .login-screen::before, .login-screen.halloween::before { top: 6px; left: 8px; bottom: auto; font-size: 30px; }
    .halloween .login-screen::after { top: 66px; right: 6px; font-size: 32px; }   /* unter dem DE/EN-Schalter */
}
@keyframes hw-sway { 0%,100% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) } }
@keyframes hw-flit { 0%,100% { transform: translate(0,0) } 50% { transform: translate(10px,-8px) } }
@keyframes hw-flicker {
    0%, 100% { text-shadow: 0 0 14px rgba(249,115,22,.8), 0 0 40px rgba(249,115,22,.35) }
    45% { text-shadow: 0 0 18px rgba(249,115,22,.95), 0 0 55px rgba(249,115,22,.5) }
    50% { text-shadow: 0 0 8px rgba(249,115,22,.55), 0 0 28px rgba(249,115,22,.3) }
    55% { text-shadow: 0 0 18px rgba(249,115,22,.95), 0 0 55px rgba(249,115,22,.5) }
}
.halloween .login-brand::after {
    content: '🦇 🦇 🦇';
    position: absolute; top: -30px; left: 50%;
    transform: translateX(-50%);
    font-size: 26px; letter-spacing: 14px; white-space: nowrap;
    pointer-events: none; opacity: 0.9;
    animation: hw-flit 3.2s ease-in-out infinite;
}
.halloween .login-emblem {
    filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(249,115,22,.55));
}
.halloween .login-title {
    color: #f97316;
    animation: hw-flicker 4s ease-in-out infinite;
}
.halloween .login-kicker { color: #fdba74; }
.halloween .login-subtitle span { color: #fbbf24; }
.halloween .login-panel {
    background: linear-gradient(180deg, rgba(30,16,40,0.9) 0%, rgba(12,8,20,0.93) 100%);
    border-color: rgba(249,115,22,.45);
    box-shadow: 0 24px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(253,186,116,.15), 0 0 26px rgba(249,115,22,.18);
}
.halloween .login-panel::before,
.halloween .login-panel::after { border-color: #f97316; }
.halloween .login-panel-title { color: #fdba74; }

/* ---- KI-Begleiter-Status (#596): Panel rechts unten über dem Action-Dock ---- */
.companion-hud-panel {
    position: fixed; right: var(--hud-gap); bottom: calc(var(--hud-gap) + 96px);
    display: flex; align-items: center; gap: 8px;
    padding: 7px 11px; border-radius: 10px; z-index: 22;
    background: linear-gradient(180deg, rgba(20,23,31,.88), rgba(11,13,19,.92));
    border: 1px solid var(--ui-line-strong);
    box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,241,200,.07);
    font-size: 11px; color: var(--ui-text);
    animation: login-in .4s ease-out both;
}
.companion-hud-panel.hidden { display: none; }
.companion-hud-panel > span { font-size: 20px; filter: drop-shadow(0 0 6px rgba(249,168,38,.5)); }
.companion-hud-body { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.companion-hud-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.companion-hud-top b { font-weight: 700; }
.companion-hud-top span { color: var(--ui-text-dim); font-size: 10px; }
.companion-hud-hp { height: 6px; border-radius: 3px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.companion-hud-hp i { display: block; height: 100%; width: 100%; border-radius: 3px; background: linear-gradient(90deg,#4ade80,#22c55e); transition: width .2s ease; }
.companion-hud-panel.active { border-color: #fbbf24; box-shadow: 0 0 18px rgba(251,191,36,.55), 0 10px 30px rgba(0,0,0,.5); }

/* Handy/Touch (#695, 2026-10-28): Tippziele mindestens ~32 px hoch – Chat-Reiter, Sprachumschalter, Posen der
   Charaktererstellung, Punkte-Abzeichen und Gruppenknöpfe waren 20–27 px und auf dem Handy kaum zu treffen */
body.touch-ui .hud-chat-tab,
body.touch-ui .lang-switch button,
body.touch-ui .cc-pose-toggle button,
body.touch-ui #hud-party-frame .wow-btn,
body.touch-ui .order-form input,
body.touch-ui .order-form button {
    min-height: 32px;
}
body.touch-ui .unit-points-badge {
    min-width: 30px;
    min-height: 26px;
}

/* Handy hochkant aufgeräumt (#698, Nutzer #14): Gruppenfenster nur bei echter Gruppe/Einladung/Mitspielern in der Nähe
   (party.js .is-solo); Geld-, Lizenz- und Schwarzes-Brett-Streifen (#494) zu EINER Zeile #hud-mobile-strip eingeklappt,
   Antippen (body.hud-strip-open) zeigt sie wie bisher darunter. Vom Nutzer verschobene Elemente ([data-hud-custom],
   hudlayout.js) bleiben unangetastet; Desktop und Querformat ändern sich nicht. */
#hud-mobile-strip {
    display: none;
}
@media (max-width: 640px) and (orientation: portrait) {
    body.touch-ui {
        --hms-top: 206px;
    }
    body.touch-ui:has(#hud-party-frame.is-solo) {
        --hms-top: 122px;
    }
    body.touch-ui #hud-party-frame.is-solo {
        display: none;
    }
    body.touch-ui:not(:has(#screen-auth-overlay:not(.hidden))) #hud-mobile-strip {
        display: flex;
        position: fixed;
        top: var(--hms-top);
        left: 8px;
        right: 8px;
        z-index: 20;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 4px 10px;
        background: rgba(14, 20, 28, 0.84);
        border: 1px solid var(--ui-line-neutral, #3a4756);
        border-radius: 9px;
        color: var(--ui-text, #e6e9ee);
        font: 600 12px/1.25 var(--font-ui, Inter, sans-serif);
        text-align: left;
        cursor: pointer;
    }
    /* Playtest-Pille (unter der Minikarte, playtest.js) bleibt frei */
    body.touch-ui:has(#hud-playtest.on) #hud-mobile-strip {
        right: 172px;
    }
    #hud-mobile-strip .hms-gold {
        flex: none;
        color: #f0b429;
    }
    #hud-mobile-strip .hms-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #93c5fd;
    }
    #hud-mobile-strip .hms-chev {
        flex: none;
        color: #8a94a3;
    }
    body.touch-ui:not(.hud-strip-open) #hud-top-center:not([data-hud-custom]),
    body.touch-ui:not(.hud-strip-open) #hud-right-tracker:not([data-hud-custom]) {
        display: none !important;
    }
    body.touch-ui.hud-strip-open #hud-top-center:not([data-hud-custom]) {
        top: calc(var(--hms-top) + 40px);
    }
    body.touch-ui.hud-strip-open #hud-right-tracker:not([data-hud-custom]) {
        top: calc(var(--hms-top) + 132px);
    }
    body.touch-ui.hud-strip-open #hud-top-center > #hud-event-pills {
        top: calc(var(--hms-top) + 230px);
    }
    body.touch-ui.hud-strip-open:has(#hud-right-tracker.is-empty) #hud-top-center > #hud-event-pills {
        top: calc(var(--hms-top) + 132px);
    }
    /* Hinweise (Willkommen, Orte …) unter die Zeile statt darauf – sonst fingen sie die Taps ab, solange sie stehen */
    body.touch-ui #hud-notices {
        top: calc(var(--hms-top) + 42px);
    }
}

/* ===== Handy-Modus (#699, 2026-10-28): body.mobile-mode = Touch + Handygröße (main.js). Eigener schlanker Aufbau statt
   verkleinertem Desktop-HUD: Spielerleiste, Ziel, kleine Minikarte, Joystick, 6 Aktionsknöpfe, ☰ und 💬. Alles andere steht
   im ☰-Menü (Statusblock) oder öffnet als Blatt. Vom Nutzer verschobene Elemente ([data-hud-custom]) bleiben unberührt. ===== */
#hud-chat-fab,
.hud-chat-sheet-close,
.touch-more-btn,
.game-menu-status {
    display: none;
}
body.mobile-mode #hud-top-center:not([data-hud-custom]),
body.mobile-mode #hud-right-tracker:not([data-hud-custom]),
body.mobile-mode #hud-party-frame.is-solo,
body.mobile-mode #hud-buffs:not([data-hud-custom]),
body.mobile-mode #hud-fps,
body.mobile-mode #swing-bar-row:not([data-hud-custom]),
body.mobile-mode #xp-bar-track:not([data-hud-custom]),
body.mobile-mode #hud-playtest,
body.mobile-mode #zone-banner,
body.mobile-mode:not(.chat-open) #hud-chat-log:not([data-hud-custom]) {
    display: none !important;
}
/* Wirkleiste (Angeln, Schriftrollen …) auch im Handy-Modus: sonst gibt es beim Wirken keine Anzeige (#1817). Nur solange gewirkt wird,
   über dem Aktionspad (Hochformat) bzw. im Mittelstreifen (Querformat); Schwung-/Wutleiste im Kampf bleiben ausgeblendet */
body.mobile-mode #swing-bar-row.is-casting-row:not([data-hud-custom]) {
    display: flex !important;
    position: fixed;
    left: 50%;
    bottom: 266px;   /* Hochformat: über Aktionspad (Oberkante ~254 px) und Joystick */
    transform: translateX(-50%);
    width: min(300px, calc(100vw - 24px));
    z-index: 30;
    pointer-events: none;
}
@media (max-height: 500px) {   /* Querformat: Mittelstreifen über Kompass und Chat-Knopf */
    body.mobile-mode #swing-bar-row.is-casting-row:not([data-hud-custom]) { bottom: 112px; width: min(300px, calc(100vw - 480px)); }
}
body.mobile-mode #swing-bar-row.is-casting-row #rage-bar-track { display: none; }
/* Tutorial-Hinweis bleibt als schmale Zeile (Anfänger brauchen den nächsten Schritt), sonst steht alles im ☰-Menü */
body.mobile-mode #hud-mobile-strip {
    display: none !important;
}
body.mobile-mode:not(:has(#screen-auth-overlay:not(.hidden))) #hud-mobile-strip.is-tutorial {
    display: flex !important;
    position: fixed;
    top: 122px;
    left: 8px;
    right: 8px;
    z-index: 20;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 10px;
    background: rgba(14, 20, 28, 0.78);
    border: 1px solid var(--ui-line-neutral, #3a4756);
    border-radius: 9px;
    color: var(--ui-text, #e6e9ee);
    font: 600 12px/1.25 var(--font-ui, Inter, sans-serif);
    text-align: left;
}
body.mobile-mode #hud-mobile-strip .hms-gold {
    display: none;
}
/* Minikarte klein */
body.mobile-mode #hud-right-column:not([data-hud-custom]) {
    transform: scale(0.76);
    transform-origin: top right;
}
/* Hinweise (Willkommen, Orte …) schmal und unter Spielerleiste + Tutorial-Zeile (sonst fangen sie deren Taps ab) */
body.mobile-mode #hud-notices {
    top: 162px;
    width: min(420px, calc(100vw - 16px));
}
body.mobile-mode #hud-notices .nt-item {
    padding: 8px 12px;
}
body.mobile-mode #hud-notices .nt-title {
    font-size: 14px;
}
body.mobile-mode #hud-notices .nt-sub {
    font-size: 12px;
}
/* ☰ unten mittig, 💬 links daneben */
body.mobile-mode #hud-chat-fab {
    display: flex;
    position: fixed;
    bottom: 14px;
    left: calc(50% - 116px);
    width: 50px;
    height: 50px;
    z-index: 30;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 14px;
    background: rgba(14, 20, 28, 0.86);
    border: 1px solid var(--ui-line-neutral, #3a4756);
    color: inherit;
    cursor: pointer;
}
body.mobile-mode #hud-chat-fab.is-open {
    border-color: #f0b429;
}
body.mobile-mode #hud-chat-fab .fab-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f0b429;
    display: none;
}
body.mobile-mode #hud-chat-fab.has-unread .fab-dot {
    display: block;
}
/* Chat als Blatt von unten (über Joystick/Aktionspad, die währenddessen nicht gebraucht werden) */
body.mobile-mode.chat-open #hud-chat-log:not([data-hud-custom]) {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: auto !important;
    height: min(46dvh, 380px) !important;
    max-height: none;
    z-index: 70;
    border-radius: 14px 14px 0 0;
    padding: 10px 12px 12px !important;
    background: rgba(10, 14, 20, 0.96);
}
body.mobile-mode.chat-open #hud-chat-log > .wow-title.hud-chat-header {
    display: flex !important;
    padding-right: 48px;
}
body.mobile-mode.chat-open #hud-chat-log #chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
body.mobile-mode.chat-open .hud-chat-sheet-close {
    display: flex;
    position: absolute;
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 10px;
    background: #1c232d;
    border: 1px solid #3a4756;
    color: inherit;
}
body.mobile-mode.chat-open #hud-chat-fab {
    display: none;
}
body.mobile-mode #chat-input-row input,
body.mobile-mode #chat-input-row button {
    min-height: 44px;
}
/* Aktionspad: 1–4, E, Sprung; ⋯ blendet Ultimate [5] und Rolle ein */
body.mobile-mode #touch-action-pad {
    grid-template-columns: repeat(3, 54px);
    gap: 8px;
}
body.mobile-mode .touch-act-btn {
    width: 54px;
    height: 54px;
}
body.mobile-mode #touch-action-pad > [data-touch-action="attack"] { order: 1; }
body.mobile-mode #touch-action-pad > [data-touch-action="whirlwind"] { order: 2; }
body.mobile-mode #touch-action-pad > [data-touch-action="heal"] { order: 3; }
body.mobile-mode #touch-action-pad > [data-touch-action="charge"] { order: 4; }
body.mobile-mode #touch-action-pad > [data-touch-action="interact"] { order: 5; }
body.mobile-mode #touch-action-pad > [data-touch-action="jump"] { order: 6; }
body.mobile-mode #touch-action-pad > [data-touch-action="execute"] { order: 7; }
body.mobile-mode #touch-action-pad > [data-touch-action="dodge"] { order: 8; }
body.mobile-mode #touch-action-pad:not(.show-more) > [data-touch-action="execute"],
body.mobile-mode #touch-action-pad:not(.show-more) > [data-touch-action="dodge"],
body.mobile-mode #touch-action-pad:not(.show-more) > [data-touch-slot] {
    display: none;
}
/* Fähigkeiten 6–10 + Talent-Fähigkeit (#970): nur freigeschaltete, auf dem Handy hinter ⋯ nach Ultimate und Rolle */
body.mobile-mode #touch-action-pad > [data-touch-slot] { order: 10; }
body.mobile-mode .touch-more-btn {
    display: flex;
    order: 20;
    grid-column: 1 / -1;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(14, 20, 28, 0.7);
    border: 1px solid #3a4756;
    color: #c9d1db;
    font-size: 16px;
    pointer-events: auto;
}
@media (max-height: 500px) {
    body.mobile-mode #touch-action-pad {
        bottom: 10px;
        grid-template-columns: repeat(3, 50px);
        gap: 6px;
    }
    body.mobile-mode .touch-act-btn {
        width: 50px;
        height: 50px;
    }
    body.mobile-mode .touch-more-btn {
        height: 30px;
    }
    body.mobile-mode:not(:has(#screen-auth-overlay:not(.hidden))) #hud-mobile-strip.is-tutorial {
        top: 8px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: min(420px, calc(100vw - 460px));
    }
    body.mobile-mode #hud-notices {
        top: 52px;
    }
    body.mobile-mode.chat-open #hud-chat-log:not([data-hud-custom]) {
        left: 12% !important;
        right: 12% !important;
        height: 72dvh !important;
    }
}
/* Spielmenü: Statusblock oben, große Einträge */
body.mobile-mode .game-menu-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
    grid-column: 1 / -1;
}
body.mobile-mode .game-menu-status:empty {
    display: none;
}
body.mobile-mode .game-menu-status .gms-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
body.mobile-mode .game-menu-status .gms-gold {
    color: #f0b429;
    font-weight: 700;
    flex: none;
}
body.mobile-mode .game-menu-status .gms-step {
    color: #93c5fd;
    text-align: right;
    min-width: 0;
}
body.mobile-mode .game-menu-status .gms-event {
    color: #fdba74;
    font-size: 12px;
}
body.mobile-mode .game-menu-status .gms-region {
    color: #86efac;
    font-size: 12px;
}
body.mobile-mode .game-menu-status .wow-btn {
    min-height: 40px;
}
body.mobile-mode .game-menu-item {
    min-height: 44px;
}
/* Fenster als Vollbild-Blätter mit großen Tippflächen */
body.mobile-mode .modal-backdrop {
    padding: 0 !important;
    align-items: stretch;
}
body.mobile-mode .modal-window {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: 0 !important;
}
body.mobile-mode .modal-window .wow-btn,
body.mobile-mode .modal-window .tab-btn,
body.mobile-mode .modal-window [data-char-tab],
body.mobile-mode .modal-window [data-hive-tab],
body.mobile-mode .modal-window [data-ah-tab],
body.mobile-mode .modal-window input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.mobile-mode .modal-window select {
    min-height: 44px;
}
/* hochkant: Chat und Leisten sind weg – Joystick und Aktionspad rücken über die ☰/💬-Reihe */
@media (max-width: 640px) {
    body.mobile-mode #touch-joystick-zone {
        bottom: 88px;
    }
    body.mobile-mode #touch-action-pad {
        bottom: 88px;
    }
}
/* Handy-Modus: mit Ziel liegt das Zielfenster unter (hoch) bzw. neben (quer) der Spielerleiste – Tutorial-Zeile weicht aus */
body.mobile-mode:has(#hud-target-frame:not(.hidden)):not(:has(#screen-auth-overlay:not(.hidden))) #hud-mobile-strip.is-tutorial {
    top: 146px;
}
body.mobile-mode:has(#hud-target-frame:not(.hidden)) #hud-notices {
    top: 186px;
}
@media (max-height: 500px) {
    body.mobile-mode:has(#hud-target-frame:not(.hidden)):not(:has(#screen-auth-overlay:not(.hidden))) #hud-mobile-strip.is-tutorial {
        top: 8px;
        left: 420px;
        right: 100px;
        transform: none;
        max-width: none;
    }
    body.mobile-mode:has(#hud-target-frame:not(.hidden)) #hud-notices {
        top: 52px;
    }
}
/* Handy-Modus: Schließen-Knöpfe aller Fenster und Umschalter (Einstellungen u. a.) waren 27 px hoch */
body.mobile-mode .modal-close-btn,
body.mobile-mode [id^="btn-close-modal"],
body.mobile-mode .modal-backdrop .segmented > button {
    min-height: 44px;
    min-width: 44px;
}
/* Schmale Fenster (Handy): Hinweiszeilen mit Text + Seite (z. B. Lizenz im Atelier) – der Text schrumpfte auf ein Wort Breite,
   weil er unbegrenzt nachgeben durfte; jetzt rutscht die Seite (Gold, Knopf) darunter */
@media (max-width: 640px) {
    .notice-text {
        flex: 1 1 200px;
    }
    .notice-side {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
}
/* Handy-Modus: letzte kleine Tippziele (Punkte-Abzeichen an der Spielerleiste, „Zurück“ in der Charaktererstellung) */
body.mobile-mode .unit-points-badge {
    min-width: 36px;
    min-height: 32px;
}
body.mobile-mode #btn-back-to-login,
body.mobile-mode #btn-charselect-back {
    min-height: 40px;
}

/* Inventar-Fenster [I] (#813): unten rechts wie die WoW-Taschen, ohne Abdunkeln/Unschärfe – die Welt bleibt sichtbar und
   anklickbar; gleichzeitig mit dem Charakterfenster [C] offen (main.js MODAL_PAIR) */
#modal-bags.bags-backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none;
    align-items: flex-end; justify-content: flex-end; padding: 0 18px 96px 0; }
#modal-bags .bags-window { pointer-events: auto; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 140px); }
#modal-bags .bags-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; overflow: auto; }
#modal-bags .bag-consumables { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
#modal-bags .bag-consumables.hidden { display: none; }
#modal-bags .bag-cons-title { font-size: 12px; color: var(--ui-text-muted); }
#modal-bags .bag-cons { width: 44px; height: 44px; }
#modal-bags .bag-stage { min-height: 200px; }
#modal-bags #bags-gold { color: #ffd100; font-size: 13px; margin-left: 8px; }
.bag-slot.is-drop, .char-slot.is-drop { outline: 2px dashed #f0b429; outline-offset: -2px; }
.char-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.char-toolbar-hint { font-size: 11.5px; color: var(--ui-text-muted); }
.char-toolbar kbd { font-size: 10px; opacity: 0.75; margin-left: 4px; }
@media (max-width: 760px), (max-height: 500px) {
    #modal-bags.bags-backdrop { align-items: center; justify-content: center; padding: 8px; pointer-events: auto; background: var(--ui-scrim); }
    #modal-bags .bags-window { max-height: calc(100vh - 16px); display: flex; flex-direction: column; }
    #modal-bags .bags-body { overflow-y: auto; min-height: 0; }
    #modal-bags .bag-grid { max-height: none; overflow: visible; flex: none; }   /* Querformat 844×390 (#1820): flex:1 drückte das Raster auf 141 px, die dritte Reihe ragte aus dem Rahmen */
    #modal-bags .bag-main { flex: none; }
    #modal-bags .cd-empty { display: none; }
    #modal-bags .bags-body { grid-template-columns: 1fr; }
    #modal-bags .bag-stage { display: none; }
}
body.pair-open #modal-character { justify-content: flex-start; padding-left: 18px; }
body.pair-open #modal-bags .bags-window { width: min(560px, calc(100vw - 32px)); }
body.pair-open #modal-bags .bags-body { grid-template-columns: minmax(0, 1fr); }
body.pair-open #modal-bags .bag-stage { display: none; }
@media (max-width: 760px) { body.pair-open #modal-character { justify-content: center; padding-left: 0; } }

/* Ladescreen beim Welteintritt (#843): Overlay über dem Canvas, solange der Erstaufbau läuft.
   Streifen-Trick (Nutzer 01:40): unten bleiben 44 px der Welt sichtbar – sie zeichnet beim
   Vorwärmen sichtbar weiter, Rest-Ruckler laufen hinter dem Screen ab. */
#hc-loading { position: fixed; inset: 0 0 44px 0; z-index: 9000; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .35s ease; pointer-events: none; }
#hc-loading.on { opacity: 1; }
#hc-loading.off { opacity: 0; transition: opacity .55s ease; }
#hc-loading .hc-load-scene { position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 25%, #2c4a6e 0%, #16263c 45%, #0a1420 100%); }
#hc-loading .hc-load-photo { position: absolute; inset: 0; background-size: cover; background-position: center;
    opacity: 0; transition: opacity .8s ease; }
#hc-loading.has-img .hc-load-photo { opacity: 1; animation: hcLoadZoom 18s ease-in-out infinite alternate; }
#hc-loading .hc-load-shade { position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,10,16,.35) 0%, rgba(5,10,16,.15) 45%, rgba(5,10,16,.75) 100%); }
#hc-loading .hc-load-box { position: relative; text-align: center; padding: 0 24px; max-width: 560px; }
#hc-loading .hc-load-logo { font-family: 'Cinzel', 'Times New Roman', serif; font-size: clamp(2rem, 6vw, 3.4rem);
    color: #f3e6c8; text-shadow: 0 2px 18px rgba(0,0,0,.85), 0 0 44px rgba(255,190,90,.25); letter-spacing: .04em; }
#hc-loading .hc-load-sub { color: #c9a86b; font-size: .95rem; letter-spacing: .3em; text-transform: uppercase; margin-top: 6px; }
#hc-loading .hc-load-barwrap { margin: 30px auto 10px; height: 10px; border-radius: 5px; width: min(420px, 80vw);
    background: rgba(10,16,24,.78); border: 1px solid rgba(201,168,107,.45); overflow: hidden; }
#hc-loading .hc-load-bar { height: 100%; width: 0%; border-radius: 5px; transition: width .18s ease-out;
    background: linear-gradient(90deg, #b8862e, #f0c75e, #f7e3a1); }
#hc-loading .hc-load-status { color: #e8dcc0; font-size: .88rem; min-height: 1.2em; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#hc-loading .hc-load-tip { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(44px + 5vh); max-width: min(560px, 88vw);
    color: #d8cdb4; font-size: .84rem; font-style: italic; text-shadow: 0 1px 8px rgba(0,0,0,.9); }
@keyframes hcLoadZoom { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Barbier in Goldhain (#852 Etappe 4, #1113 Vorschau größer, js/barber.js): Kopf-/Ganzkörper-Vorschau links, Frisur/Farbe/Regler rechts */
.barber-window { width: min(980px, calc(100vw - 24px)); }
.barber-body { display: grid; grid-template-columns: minmax(380px, 480px) 1fr; gap: 20px; align-items: stretch; }
.barber-stage { position: relative; height: min(560px, 76vh); min-height: 440px; border-radius: var(--ui-radius-sm, 8px); overflow: hidden; background: #090f1d; border: 1px solid #2a3446; cursor: grab; touch-action: none; }
.barber-stage canvas { display: block; width: 100%; height: 100%; }
.barber-form { display: grid; gap: 8px; align-content: start; max-height: min(560px, 76vh); overflow-y: auto; padding-right: 4px; }
.barber-mode-toggle { display: flex; width: 100%; margin-bottom: 2px; }
.barber-mode-toggle button { flex: 1; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.barber-random-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
.barber-full-section { display: grid; gap: 8px; border-top: 1px solid var(--ui-line, #2a3446); padding-top: 8px; margin-top: 4px; }
.barber-full-section[hidden] { display: none; }
.barber-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.barber-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #1e293b; cursor: pointer; padding: 0; }
.barber-swatch.active { border-color: var(--ui-gold, #fde047); box-shadow: 0 0 0 1px var(--ui-gold, #fde047); }
.barber-swatches input[type="color"] { width: 32px; height: 26px; padding: 0; border: none; background: none; }
.barber-price { margin: 4px 0 0; color: var(--ui-gold, #fde047); font-size: 13px; }
.barber-msg { margin: 0; min-height: 1.2em; color: #fca5a5; font-size: 12px; }
.barber-actions { display: flex; gap: 8px; justify-content: flex-end; }
.barber-actions button { min-height: 36px; padding: 6px 14px; }
@media (max-width: 720px) {
    .barber-body { grid-template-columns: 1fr; }
    .barber-stage { height: min(340px, 46vh); min-height: 280px; }
    body.touch-ui .barber-swatch { width: 30px; height: 30px; }
}

/* #923: während der Ladebildschirm läuft, bleiben Chat-Zeile und Aktionsleiste (unterer 44-px-Streifen) versteckt */
body.hc-loading-on #chat-input-row,
body.hc-loading-on #hud-action-dock { opacity: 0; pointer-events: none; }

/* #918: Erstellen-Knopf bleibt beim Scrollen der Karte sichtbar (feste Fußleiste unten);
   #2591: durchgehend undurchsichtig – die Frisur-Kacheln schienen oben durch die halbtransparente Kante */
.charcreate-foot {
    position: sticky;
    bottom: 0;
    padding: 12px 0 4px;
    background: rgba(16, 20, 28, 0.98);
    border-top: 1px solid var(--ui-line);
    z-index: 3;
}

/* Kleiner Schirm: Fußleiste oben angepinnt statt unten – unten lag sie über dem Namensfeld */
@media (max-width: 640px), (max-height: 500px) {
    .charcreate-card { scroll-padding-top: 84px; scroll-padding-bottom: 0; }
    .charcreate-foot { order: -1; top: 0; bottom: auto; border-top: none; border-bottom: 1px solid var(--ui-line);
        background: rgba(16, 20, 28, 0.98); }
}

/* Chatfenster direkt verschieben/skalieren (#1069, hudlayout.js setupDirect): Titelzeile = Ziehgriff, Eckgriff zur Bildschirmmitte.
   Auf Handy/Touch (touch-ui, mobile-mode) und im „HUD anpassen“-Modus aus. */
.hud-resize-grip {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
    opacity: 0.45;
    transition: opacity 0.15s;
    background:
        linear-gradient(135deg, transparent 45%, var(--ui-gold, #d4a800) 45% 52%, transparent 52% 64%, var(--ui-gold, #d4a800) 64% 71%, transparent 71%);
}
.hud-resize-grip[data-corner="top-right"] { top: 0; right: 0; cursor: nesw-resize; transform: rotate(-90deg); }
.hud-resize-grip[data-corner="top-left"] { top: 0; left: 0; cursor: nwse-resize; transform: rotate(180deg); }
.hud-resize-grip[data-corner="bottom-right"] { bottom: 0; right: 0; cursor: nwse-resize; }
.hud-resize-grip[data-corner="bottom-left"] { bottom: 0; left: 0; cursor: nesw-resize; transform: rotate(90deg); }
#hud-chat-log:hover > .hud-resize-grip { opacity: 0.9; }
body:not(.touch-ui):not(.mobile-mode):not(.hud-edit) #hud-chat-log > .hud-chat-header { cursor: move; }
body:not(.touch-ui):not(.mobile-mode):not(.hud-edit) #hud-chat-log > .hud-chat-header button { cursor: pointer; }
body.touch-ui .hud-resize-grip, body.mobile-mode .hud-resize-grip, body.hud-edit .hud-resize-grip { display: none; }
body.hud-direct-drag, body.hud-direct-drag * { user-select: none !important; }

/* Tod als Geist neben der Leiche (#1077): Fenster mit „In Goldhain wiederbeleben“ und Wiederbelebungs-Angebot, bläulicher Rand */
#ghost-panel {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 58;
    width: min(400px, calc(100vw - 32px));
    padding: 14px 18px 12px;
    text-align: center;
    pointer-events: auto;
    border-color: rgba(147, 178, 230, 0.45);
}
#ghost-panel.hidden { display: none; }
/* Als Geist zählt nur das Todesfenster (QA #1524): stehende Hinweise (Ebenen-Banner, Sperr-Hinweise) lagen oben mittig darunter
   und überdeckten Text und Knöpfe – solange der Held Geist ist, ausgeblendet; danach sind sie wieder da */
body.player-ghost #hud-notices { display: none; }
.ghost-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: #cdddfb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.ghost-text { margin-top: 6px; color: var(--ui-text-dim); font-size: 0.86rem; line-height: 1.35; }
.ghost-offer {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(242, 215, 144, 0.4);
    border-radius: var(--ui-radius);
    color: var(--ui-gold-bright);
    font-size: 0.9rem;
}
.ghost-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.ghost-timer { margin-top: 8px; font-size: 0.78rem; color: var(--ui-text-muted); }
body.player-ghost::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(ellipse at center, rgba(120, 150, 200, 0) 48%, rgba(64, 88, 136, 0.42) 100%);
}

/* Schadensmesser (#1158, js/dmgmeter.js): unten rechts über der Aktionsleiste, erscheint erst mit dem ersten Treffer (Minimal-HUD);
   Kopf klappt ein/aus, [K] blendet ganz aus. Handy/Touch: links unter dem Spielerrahmen (rechts liegen die Touch-Knöpfe) */
.dmg-meter {
    position: fixed;
    right: 14px;
    bottom: 118px;
    width: 230px;
    z-index: 40;
    padding: 6px 8px 7px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: var(--ui-bg-soft);
    color: var(--ui-text);
    font: 12px/1.35 var(--font-ui, sans-serif);
    pointer-events: auto;
    user-select: none;
}
.dmg-meter.hidden { display: none; }
body.hud-edit #dmg-meter.hidden { display: block !important; opacity: 0.6; }
.dmg-meter .dm-head { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ui-gold); font-weight: 600; }
.dmg-meter .dm-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmg-meter .dm-time { color: var(--ui-text-dim); font-variant-numeric: tabular-nums; font-weight: 400; }
.dmg-meter .dm-reset { border: 0; background: none; color: var(--ui-text-muted); font-size: 13px; cursor: pointer; padding: 0 2px; }
.dmg-meter .dm-reset:hover { color: var(--ui-text); }
.dmg-meter .dm-rows { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.dmg-meter.collapsed .dm-rows { display: none; }
.dmg-meter .dm-row { position: relative; display: flex; justify-content: space-between; gap: 6px; padding: 2px 5px; border-radius: 4px; overflow: hidden; }
.dmg-meter .dm-row > i { position: absolute; inset: 0 auto 0 0; background: rgba(185, 28, 28, 0.38); z-index: 0; }
.dmg-meter .dm-row.self { cursor: pointer; }
.dmg-meter .dm-row.self > i { background: rgba(217, 181, 108, 0.36); }
.dmg-meter .dm-row > span { position: relative; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmg-meter .dm-v { font-variant-numeric: tabular-nums; }
.dmg-meter .dm-v small { color: var(--ui-text-dim); }
.dmg-meter .dm-detail { margin-top: 3px; padding: 4px 5px; border-top: 1px solid var(--ui-line-neutral); color: var(--ui-text-dim); font-size: 11px; }
.dmg-meter .dm-detail > div { display: flex; justify-content: space-between; gap: 6px; }
body.touch-ui .dmg-meter { right: auto; left: 8px; bottom: auto; top: 118px; width: 200px; }
@media (max-width: 640px) { .dmg-meter { right: auto; left: 8px; bottom: auto; top: 118px; width: 190px; } }
/* Handy hochkant (QA #1507): oben liegt bei 122 px der Tutorial-/Ziel-Streifen #hud-mobile-strip – der Messer verdeckte nach dem
   ersten Kampf „Schritt 6/6 …“. Darum links über dem Joystick, wo hochkant Platz ist. */
@media (max-width: 640px) and (orientation: portrait) { body.touch-ui .dmg-meter { top: auto; bottom: 222px; width: 170px; } }

/* Handy: Charakter-Vorschau-Knöpfe (Laufen/Drehen) auf Daumengröße (QA #1552: 30 px) */
body.touch-ui .mtx-tool { min-width: 44px; min-height: 44px; }

/* Lesbarkeit Handy (QA #1576): Mindestschrift 12 px in Inventar, Charakter und Auktionshaus (vorher 8,75–11,5 px) */
body.touch-ui .char-slot-label, body.touch-ui .char-slot-gs, body.touch-ui .char-toolbar-hint, body.touch-ui #char-bag-count, body.touch-ui .cs-race,
body.touch-ui .cs-sub, body.touch-ui .cs-sub small, body.touch-ui .cs-row strong small, body.touch-ui #modal-character small, body.touch-ui #btn-bag-sort,
body.touch-ui .lr-gs, body.touch-ui .lr-stats > span, body.touch-ui .notice-of, body.touch-ui #modal-auction small, body.touch-ui #modal-quests label span { font-size: 12px; }
