:root {
    --bg: #10161d;
    --bg-soft: #151e27;
    --card: rgba(24, 34, 44, 0.94);
    --card-strong: #202c38;
    --border: rgba(255, 255, 255, 0.09);
    --text: #eef3f7;
    --muted: #a9b5c0;
    --orange: #f7931e;
    --orange-dark: #c96908;
    --danger: #e05757;
    --success: #44c67a;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); color: var(--text); }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 0%, rgba(247, 147, 30, 0.14), transparent 33rem),
        linear-gradient(135deg, #0e141b 0%, #111b25 54%, #0c1117 100%);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.app-shell { width: min(1500px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 20px 0; position: sticky; top: 0; z-index: 20;
    background: linear-gradient(180deg, rgba(16, 22, 29, 0.96), rgba(16, 22, 29, 0.72));
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 0.02em; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    color: #141c22; background: linear-gradient(135deg, #ffb35c, var(--orange)); box-shadow: 0 0 24px rgba(247, 147, 30, 0.28);
}
.topnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topnav a:not(.btn) { color: var(--muted); padding: 10px 12px; border-radius: 12px; }
.topnav a:not(.btn):hover { color: var(--text); background: rgba(255,255,255,0.05); }

.page { padding: 26px 0 80px; }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px;
}
.alert-card { max-width: 760px; margin: 80px auto; }
.hero-section { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 28px; align-items: center; min-height: 68vh; }
.hero-copy h1, .page-heading h1 { font-size: clamp(2.2rem, 5vw, 5.5rem); line-height: 0.95; margin: 8px 0 18px; letter-spacing: -0.06em; }
.hero-copy .lead { color: var(--muted); font-size: 1.18rem; max-width: 760px; line-height: 1.7; }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; font-size: 0.78rem; }
.action-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn {
    border: 0; border-radius: 13px; padding: 10px 15px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; gap: 8px; font-weight: 800; transition: 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-large { padding: 14px 20px; }
.btn-primary { background: linear-gradient(135deg, #ffad54, var(--orange)); color: #111820; }
.btn-secondary { background: rgba(247, 147, 30, 0.14); color: #ffd0a1; border: 1px solid rgba(247, 147, 30, 0.26); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); }
.btn-danger { background: rgba(224, 87, 87, 0.15); color: #ffb6b6; border: 1px solid rgba(224, 87, 87, 0.28); }
.btn-disabled { background: rgba(255,255,255,0.07); color: var(--muted); cursor: not-allowed; }
.full-width { width: 100%; }
.timeline-list { color: var(--muted); line-height: 2; padding-left: 22px; }

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 28px));
    pointer-events: none;
}
.toast {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 11px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(20, 28, 36, 0.97);
    box-shadow: 0 18px 45px rgba(0,0,0,0.42);
    padding: 12px 12px;
    transform: translateX(18px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
    overflow: hidden;
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast.is-hiding { transform: translateX(18px); opacity: 0; }
.toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--orange);
}
.toast p { margin: 0; color: var(--text); font-weight: 850; line-height: 1.35; }
.toast-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--orange); box-shadow: 0 0 16px rgba(247,147,30,0.55); }
.toast-close { border: 0; background: rgba(255,255,255,0.07); color: var(--muted); width: 26px; height: 26px; border-radius: 9px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.toast-close:hover { color: var(--text); background: rgba(255,255,255,0.12); }
.toast-success { border-color: rgba(68,198,122,0.35); }
.toast-success::before, .toast-success .toast-dot { background: var(--success); box-shadow: 0 0 16px rgba(68,198,122,0.55); }
.toast-error { border-color: rgba(224,87,87,0.42); }
.toast-error::before, .toast-error .toast-dot { background: var(--danger); box-shadow: 0 0 16px rgba(224,87,87,0.55); }
.toast-warning { border-color: rgba(247,147,30,0.46); }
.toast-info { border-color: rgba(255,255,255,0.14); }

kbd {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
    color: #ffd0a1;
    font-weight: 900;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.35);
}


.flash-message {
    margin: -8px 0 18px;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 800;
}
.flash-success { border-color: rgba(68, 198, 122, 0.34); background: rgba(68, 198, 122, 0.12); color: #bff6d4; }
.flash-error { border-color: rgba(224, 87, 87, 0.34); background: rgba(224, 87, 87, 0.12); color: #ffc4c4; }
.inventory-help { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.inventory-inline-message {
    min-height: 22px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}
.inventory-inline-message[data-type="info"] { color: #ffd0a1; }
.inventory-inline-message[data-type="error"] { color: #ffc4c4; }

.page-heading { margin-bottom: 26px; }
.page-heading p { color: var(--muted); max-width: 850px; line-height: 1.6; }
.shop-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.shop-heading h1 { font-size: clamp(2rem, 4vw, 4rem); }

.menu-grid, .hero-grid, .result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.result-grid { grid-template-columns: 1fr 1fr; }
.menu-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
    min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
}
.menu-card.primary { background: linear-gradient(135deg, rgba(247,147,30,0.24), rgba(255,255,255,0.06)); border-color: rgba(247,147,30,0.35); }
.menu-card span { font-weight: 900; font-size: 1.35rem; }
.menu-card small, .muted { color: var(--muted); }
.split-card { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.hero-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hero-choice { display: flex; flex-direction: column; gap: 12px; }
.hero-choice p { color: var(--muted); line-height: 1.55; }
.hero-avatar, .profile-avatar-fallback {
    width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 1.45rem;
    background: rgba(247,147,30,0.14); color: #ffd0a1; border: 1px solid rgba(247,147,30,0.25);
}
.stat-pills, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-pills span, .tag-cloud span, .mini-item {
    padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); font-size: 0.82rem; border: 1px solid var(--border);
}
.passive-box { padding: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 14px; }
.passive-box small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.tag-line { font-size: 0.9rem; }

.shop-layout { display: grid; grid-template-columns: 330px minmax(430px, 1fr) 330px; gap: 18px; align-items: start; }
.build-layout { grid-template-columns: minmax(430px, 1fr) 360px; }
.shop-list { display: grid; gap: 12px; }
.shop-item { border: 1px solid var(--border); border-radius: 15px; padding: 14px; background: rgba(255,255,255,0.035); display: grid; gap: 10px; }
.shop-item.is-bought { opacity: 0.55; }
.shop-item-head, .panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-item p { margin: 0; color: var(--muted); }
.shop-item small { color: var(--muted); line-height: 1.4; }
.rarity-text { font-weight: 900; font-size: 0.78rem; }
.rarity-common {
    --aib-rarity-color: #c7cdd3;
    --aib-rarity-rgb: 199, 205, 211;
    --aib-rarity-bg: rgba(199, 205, 211, 0.10);
    --aib-rarity-border: rgba(199, 205, 211, 0.34);
    border-color: var(--aib-rarity-border);
}
.rarity-uncommon {
    --aib-rarity-color: #64df86;
    --aib-rarity-rgb: 100, 223, 134;
    --aib-rarity-bg: rgba(100, 223, 134, 0.11);
    --aib-rarity-border: rgba(100, 223, 134, 0.52);
    border-color: var(--aib-rarity-border);
}
.rarity-rare {
    --aib-rarity-color: #58a6ff;
    --aib-rarity-rgb: 88, 166, 255;
    --aib-rarity-bg: rgba(88, 166, 255, 0.11);
    --aib-rarity-border: rgba(88, 166, 255, 0.56);
    border-color: var(--aib-rarity-border);
}
.rarity-epic {
    --aib-rarity-color: #b66cff;
    --aib-rarity-rgb: 182, 108, 255;
    --aib-rarity-bg: rgba(182, 108, 255, 0.11);
    --aib-rarity-border: rgba(182, 108, 255, 0.58);
    border-color: var(--aib-rarity-border);
}
.rarity-legendary {
    --aib-rarity-color: #ffb13b;
    --aib-rarity-rgb: 255, 177, 59;
    --aib-rarity-bg: rgba(255, 177, 59, 0.13);
    --aib-rarity-border: rgba(255, 177, 59, 0.72);
    border-color: var(--aib-rarity-border);
    box-shadow: 0 0 24px rgba(247, 147, 30, 0.14);
}

.inventory-grid-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 6px;
}
.inventory-grid {
    --slot-size: 48px;
    display: grid;
    grid-template-columns: repeat(var(--grid-w), var(--slot-size));
    grid-template-rows: repeat(var(--grid-h), var(--slot-size));
    gap: 3px;
    width: max-content;
    position: relative;
    touch-action: none;
}
.grid-cell {
    z-index: 1;
    border: 1px dashed rgba(255,255,255,0.04);
    border-radius: 7px;
    background: rgba(0,0,0,0.10);
    opacity: 0.34;
    transition: 120ms ease;
}
.grid-cell.is-unlocked {
    opacity: 1;
    border-color: rgba(247,147,30,0.24);
    background: linear-gradient(135deg, rgba(247,147,30,0.10), rgba(255,255,255,0.035));
}
.grid-cell.is-starter-cell { border-color: rgba(247,147,30,0.30); }
.grid-cell.is-bag-cell { background: linear-gradient(135deg, rgba(125,82,43,0.32), rgba(247,147,30,0.13)); border-color: rgba(247,147,30,0.38); }
.grid-cell:hover { border-color: rgba(247,147,30,0.48); background: rgba(247,147,30,0.08); opacity: 1; }
.grid-cell.is-preview-valid { border-color: rgba(68,198,122,0.78); background: rgba(68,198,122,0.18); opacity: 1; }
.grid-cell.is-preview-invalid { border-color: rgba(224,87,87,0.78); background: rgba(224,87,87,0.16); opacity: 1; }
.grid-cell.is-preview-shape { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.10), 0 0 18px rgba(0,0,0,0.20); }
.inventory-item-cell {
    z-index: 4;
    padding: 4px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.045));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    overflow: hidden;
    min-width: 0;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: transform 130ms ease, box-shadow 130ms ease, opacity 130ms ease, border-color 130ms ease;
}
.inventory-item-cell.is-fill-cell {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035));
}
.inventory-item-cell.is-fill-cell::after { content: ''; width: 12px; height: 12px; border-radius: 5px; background: rgba(255,255,255,0.10); }
.inventory-item-cell.is-bag-item {
    z-index: 2;
    background: linear-gradient(135deg, rgba(114,76,39,0.78), rgba(247,147,30,0.22));
    border-color: rgba(247,147,30,0.30);
}
.inventory-item-cell:active { cursor: grabbing; }
.inventory-item-cell.is-selected { outline: 2px solid rgba(247,147,30,0.72); box-shadow: 0 0 0 4px rgba(247,147,30,0.13), 0 14px 32px rgba(0,0,0,0.25); }
.inventory-item-cell.is-dragging { z-index: 8; opacity: 0.58; transform: scale(0.985); }
.inventory-item-cell.is-rotation-preview { outline-color: rgba(255,208,161,0.85); }
.inventory-item-cell[data-draggable="1"]:hover { transform: translateY(-1px); }
.inventory-item-cell strong { font-size: 0.64rem; line-height: 1.05; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.inventory-item-cell small { color: var(--muted); font-size: 0.55rem; line-height: 1.1; }
.item-icon { width: 19px; height: 19px; border-radius: 7px; display: grid; place-items: center; background: rgba(247,147,30,0.16); color: #ffd0a1; font-weight: 900; font-size: 0.74rem; }
.item-sell-form { margin-top: 2px; }
.link-button { background: none; border: 0; padding: 0; color: #ffd0a1; cursor: pointer; font-weight: 800; font-size: 0.78rem; }

.stats-list { display: grid; gap: 10px; margin: 0; }
.stats-list.wide { grid-template-columns: 1fr 1fr; }
.stats-list div { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; gap: 10px; }
.stats-list dt { color: var(--muted); }
.stats-list dd { margin: 0; font-weight: 900; }
.synergy-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.synergy-list li { background: rgba(247,147,30,0.10); border: 1px solid rgba(247,147,30,0.20); border-radius: 12px; padding: 10px; }
.synergy-list small { display: block; color: var(--muted); margin-top: 4px; }
.spaced-form { margin-top: 18px; }

.success-card { margin-bottom: 18px; border-color: rgba(68,198,122,0.35); background: rgba(68,198,122,0.12); }
.battle-log-card { margin-top: 18px; }
.battle-log { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; max-height: 540px; overflow: auto; }
.battle-log.is-collapsed { max-height: 0; overflow: hidden; margin: 0; }
.battle-log li { display: grid; grid-template-columns: 90px 90px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.035); border: 1px solid var(--border); }
.battle-log p { margin: 0; color: var(--muted); }
.log-attack { border-color: rgba(247,147,30,0.24) !important; }
.log-heal { border-color: rgba(68,198,122,0.24) !important; }
.log-debuff { border-color: rgba(224,87,87,0.24) !important; }
.bottom-actions { margin-top: 18px; }

.table-card { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; padding: 15px 16px; border-bottom: 1px solid var(--border); }
th { color: #ffd0a1; background: rgba(247,147,30,0.08); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.08em; }
td { color: var(--text); }
td a { color: #ffd0a1; font-weight: 800; }
.profile-card { text-align: center; }
.profile-card img { width: 110px; height: 110px; object-fit: cover; border-radius: 28px; border: 2px solid rgba(247,147,30,0.25); }
.profile-avatar-fallback { width: 110px; height: 110px; margin: 0 auto; border-radius: 28px; font-size: 2.5rem; }
.item-list-inline { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1250px) {
    .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shop-layout, .build-layout { grid-template-columns: 1fr; }
    .shop-panel, .stats-panel { order: initial; }
}
@media (max-width: 860px) {
    .app-shell { width: min(100% - 20px, 1500px); }
    .topbar, .shop-heading, .split-card { align-items: flex-start; flex-direction: column; }
    .hero-section, .menu-grid, .hero-grid, .result-grid { grid-template-columns: 1fr; }
    .inventory-grid { --slot-size: 46px; gap: 3px; }
    .inventory-item-cell { padding: 3px; }
    .inventory-item-cell small { display: none; }
    .stats-list.wide { grid-template-columns: 1fr; }
    .battle-log li { grid-template-columns: 1fr; gap: 4px; }
}


.battle-heading h1 { font-size: clamp(2rem, 4vw, 4rem); }
.battle-stage {
    display: grid;
    grid-template-columns: minmax(290px, 0.95fr) minmax(360px, 1.05fr) minmax(290px, 0.95fr);
    gap: 18px;
    align-items: start;
}
.battle-actor { position: relative; overflow: hidden; }
.battle-actor::after {
    content: "";
    position: absolute;
    inset: auto 18px 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(247,147,30,0.45), transparent);
    opacity: 0;
    transition: opacity 160ms ease;
}
.battle-actor.is-active {
    border-color: rgba(247,147,30,0.38);
    box-shadow: 0 0 0 1px rgba(247,147,30,0.12), var(--shadow);
}
.battle-actor.is-active::after { opacity: 1; }
.battle-actor.is-hit { animation: actor-hit 220ms ease; }
.battle-actor.is-healed { animation: actor-healed 280ms ease; }
@keyframes actor-hit {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-4px); }
    65% { transform: translateX(4px); }
}
@keyframes actor-healed {
    0%, 100% { transform: translateY(0); }
    45% { transform: translateY(-3px); }
}
.battle-actor-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.battle-actor-head h2 { margin: 2px 0 4px; }
.battle-actor-head span { color: var(--muted); }
.battle-hp-number { white-space: nowrap; color: #ffd0a1; }
.battle-hp-bar, .battle-progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 14px;
}
.battle-hp-bar span, .battle-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, rgba(68,198,122,0.95), rgba(247,147,30,0.85));
    transition: width 260ms ease;
}
.battle-progress { height: 8px; margin: 16px 0; }
.battle-progress span { background: linear-gradient(90deg, var(--orange), #ffd0a1); }
.battle-board .inventory-grid { --slot-size: 34px; }
.battle-board .inventory-item-cell { padding: 3px; gap: 1px; cursor: default; }
.battle-board .inventory-item-cell strong { font-size: 0.50rem; }
.battle-board .inventory-item-cell small, .battle-board .item-sell-form, .battle-board .item-icon { display: none; }
.battle-board .item-icon { width: 18px; height: 18px; border-radius: 6px; font-size: 0.72rem; }
.npc-board-placeholder {
    min-height: 260px;
    border: 1px dashed rgba(255,255,255,0.14);
    border-radius: 14px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    background: rgba(0,0,0,0.13);
}
.npc-board-placeholder strong { color: var(--text); font-size: 1.15rem; }
.battle-feed-card { min-height: 500px; }
.battle-tick-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(247,147,30,0.22);
    background: rgba(247,147,30,0.09);
    border-radius: 15px;
    padding: 12px 14px;
}
.battle-tick-box span { color: var(--muted); font-weight: 800; }
.battle-tick-box strong { font-size: 1.55rem; color: #ffd0a1; }
.battle-current-action {
    margin-top: 14px;
    min-height: 96px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 16px;
    padding: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.45;
}
.battle-current-action.is-attack { border-color: rgba(247,147,30,0.34); background: rgba(247,147,30,0.10); }
.battle-current-action.is-heal { border-color: rgba(68,198,122,0.30); background: rgba(68,198,122,0.10); }
.battle-current-action.is-debuff { border-color: rgba(224,87,87,0.30); background: rgba(224,87,87,0.10); }
.battle-replay-log {
    max-height: 285px;
    scroll-behavior: smooth;
}
.battle-replay-log li { grid-template-columns: 78px 78px 1fr; }
.battle-replay-log li.is-current {
    border-color: rgba(247,147,30,0.42) !important;
    background: rgba(247,147,30,0.08);
}
.battle-log-full { margin-top: 18px; }
.summary-modal[hidden] { display: none; }
.summary-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 24px;
}
.summary-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 10, 0.72);
}
.summary-dialog {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
}
.summary-modal.is-open .summary-dialog { transform: translateY(0) scale(1); opacity: 1; }
.summary-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.summary-dialog-head h2 { margin: 4px 0 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.summary-close {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}
.summary-result {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
}
.summary-result strong { font-size: 1.18rem; }
.summary-result span { color: var(--muted); }
.summary-result-success { border-color: rgba(68,198,122,0.35); background: rgba(68,198,122,0.10); }
.summary-result-danger { border-color: rgba(224,87,87,0.35); background: rgba(224,87,87,0.10); }
.summary-result-warning { border-color: rgba(247,147,30,0.35); background: rgba(247,147,30,0.10); }
.summary-grid article {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(0,0,0,0.12);
}
.summary-actions { margin-top: 18px; justify-content: flex-end; }

@media (max-width: 1180px) {
    .battle-stage { grid-template-columns: 1fr; }
    .battle-board .inventory-grid { --slot-size: 46px; }
}

.life-display {
    display: grid;
    gap: 9px;
    border: 1px solid rgba(247,147,30,0.24);
    background: rgba(247,147,30,0.08);
    border-radius: 15px;
    padding: 12px;
    margin: 0 0 14px;
}
.life-display-compact {
    max-width: 420px;
    margin-top: 10px;
    margin-bottom: 0;
    padding: 10px;
}
.life-display-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 850;
}
.life-display-head strong { color: #ffd0a1; font-size: 1.05rem; }
.life-pips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
    gap: 6px;
}
.life-pip {
    min-width: 18px;
    height: 18px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.055);
    position: relative;
    overflow: hidden;
}
.life-pip::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 4px;
    background: transparent;
}
.life-pip.is-active {
    border-color: rgba(247,147,30,0.62);
    background: rgba(247,147,30,0.22);
    box-shadow: 0 0 14px rgba(247,147,30,0.18);
}
.life-pip.is-active::after { background: linear-gradient(135deg, #ffb35c, var(--orange)); }
.life-pip.is-empty {
    border-color: rgba(224,87,87,0.25);
    background: rgba(224,87,87,0.08);
}
.life-overflow {
    min-height: 18px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    font-size: 0.76rem;
    font-weight: 900;
}
.life-display p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.life-display.is-dead {
    border-color: rgba(224,87,87,0.42);
    background: rgba(224,87,87,0.12);
}
.life-display.is-dead .life-display-head strong { color: #ffc4c4; }
.danger-card {
    margin-bottom: 18px;
    border-color: rgba(224,87,87,0.38);
    background: rgba(224,87,87,0.12);
}
.danger-card h2 { margin-top: 0; }
.battle-heading-side {
    display: grid;
    gap: 12px;
    justify-items: end;
    min-width: min(100%, 360px);
}
.battle-heading-side .life-display { width: 100%; }
.active-run-card > div { min-width: 0; }

@media (max-width: 860px) {
    .battle-heading-side { justify-items: stretch; width: 100%; }
    .life-pips { grid-template-columns: repeat(10, minmax(14px, 1fr)); }
}

.inventory-item-cell.is-base-bag {
    z-index: 2;
    background: linear-gradient(135deg, rgba(94,64,35,0.82), rgba(247,147,30,0.16));
    border-color: rgba(247,147,30,0.28);
}
.inventory-item-cell.is-base-bag strong::after {
    content: ' (Basis)';
    color: var(--muted);
    font-weight: 700;
}

/* Phase 6.2: Taschen klarer als Container-Layer darstellen */
.inventory-grid {
    isolation: isolate;
}
.inventory-item-cell.is-bag-item {
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(247,147,30,0.18), rgba(122,80,42,0.20)),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 6px, rgba(0,0,0,0.04) 6px 12px);
    border-color: rgba(247,147,30,0.54);
    border-style: solid;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.20);
}
.inventory-item-cell.is-bag-item.is-fill-cell::after,
.inventory-item-cell.is-bag-item .item-cell-fill {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(247,147,30,0.25);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.inventory-item-cell.is-bag-item .bag-cell-mark {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(247,147,30,0.34);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
}
.inventory-item-cell.is-normal-item {
    z-index: 5;
    background:
        linear-gradient(135deg, rgba(20,28,34,0.96), rgba(33,45,54,0.92)),
        linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
    border-color: rgba(255,255,255,0.20);
    box-shadow: 0 10px 22px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.inventory-item-cell.is-normal-item.is-fill-cell {
    background: linear-gradient(135deg, rgba(23,33,41,0.94), rgba(16,24,31,0.90));
}
.inventory-item-cell.is-normal-item.is-fill-cell::after {
    background: rgba(255,255,255,0.16);
}
.inventory-item-cell.is-drop-denied,
.bag-grip.is-drop-denied {
    animation: aibDropDenied 260ms ease both;
}
@keyframes aibDropDenied {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    55% { transform: translateX(4px); }
    80% { transform: translateX(-2px); }
}
.bag-grip {
    z-index: 14;
    align-self: start;
    justify-self: start;
    transform: translate(-8px, -13px);
    max-width: calc(100% + 18px);
    min-width: 142px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 999px;
    border: 1px solid rgba(247,147,30,0.62);
    background: linear-gradient(135deg, rgba(47,35,24,0.98), rgba(111,69,31,0.96));
    box-shadow: 0 10px 24px rgba(0,0,0,0.32), 0 0 0 2px rgba(247,147,30,0.08);
    cursor: grab;
    user-select: none;
    touch-action: none;
    overflow: visible;
}
.bag-grip:active { cursor: grabbing; }
.bag-grip.is-selected,
.bag-grip:focus-visible {
    outline: 2px solid rgba(255,208,161,0.92);
    outline-offset: 2px;
}
.bag-grip.is-dragging {
    opacity: 0.68;
    transform: translate(-8px, -13px) scale(0.98);
}
.bag-grip-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #24160a;
    background: #f7931e;
    font-weight: 950;
    line-height: 1;
}
.bag-grip-text {
    min-width: 0;
    display: grid;
    line-height: 1.05;
}
.bag-grip-text strong {
    color: var(--text);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bag-grip-text small {
    color: #ffd0a1;
    font-size: 0.58rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bag-sell-form {
    margin: 0 0 0 2px;
    display: flex;
}
.bag-sell-button {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(224,87,87,0.78);
    font-weight: 900;
    cursor: pointer;
}
.bag-sell-button:hover { background: rgba(224,87,87,0.98); }
.item-bag-bonus {
    color: #ffd0a1 !important;
    border-radius: 999px;
    padding: 1px 5px;
    background: rgba(247,147,30,0.10);
    border: 1px solid rgba(247,147,30,0.18);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grid-cell.is-locked {
    background: rgba(0,0,0,0.12);
    border-color: rgba(255,255,255,0.025);
}
.grid-cell.is-bag-cell {
    background: linear-gradient(135deg, rgba(247,147,30,0.09), rgba(125,82,43,0.18));
    border-color: rgba(247,147,30,0.28);
}
@media (max-width: 680px) {
    .bag-grip { min-width: 116px; max-width: 160px; padding: 4px 6px; }
    .bag-grip-text strong { font-size: 0.64rem; }
    .bag-grip-text small { display: none; }
}

/* Battle-/Share-Boards sollen durch Taschen-Griffe nicht voll wirken. */
.battle-board .bag-grip,
.build-share-board .bag-grip {
    min-width: 86px;
    max-width: 116px;
    padding: 3px 5px;
    transform: translate(-5px, -9px);
}
.battle-board .bag-grip-icon,
.build-share-board .bag-grip-icon {
    width: 17px;
    height: 17px;
    font-size: 0.65rem;
}
.battle-board .bag-grip-text small,
.build-share-board .bag-grip-text small {
    display: none;
}
.battle-board .bag-grip-text strong,
.build-share-board .bag-grip-text strong {
    font-size: 0.54rem;
}


/* Phase 6.3: globale Tooltips fuer Items und Taschen */
.aib-tooltip-popover[hidden] { display: none; }
.aib-tooltip-popover {
    position: fixed;
    z-index: 5000;
    width: min(320px, calc(100vw - 24px));
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid rgba(247,147,30,0.34);
    background: linear-gradient(135deg, rgba(13,20,26,0.98), rgba(28,38,46,0.98));
    box-shadow: 0 22px 50px rgba(0,0,0,0.46), 0 0 0 1px rgba(255,255,255,0.04) inset;
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}
.aib-tooltip-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.aib-tooltip-popover > strong {
    display: block;
    margin-bottom: 9px;
    color: #ffd0a1;
    font-size: 0.98rem;
    line-height: 1.2;
}
.aib-tooltip-popover dl {
    margin: 0;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 7px 10px;
}
.aib-tooltip-popover dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}
.aib-tooltip-popover dd {
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.35;
}

/* Ergebnis-Karten und vollstaendiger Log erscheinen erst nach dem Replay. */
.battle-outcome-card.is-revealed,
.battle-log-full.is-revealed {
    animation: aibRevealAfterBattle 180ms ease both;
}
@keyframes aibRevealAfterBattle {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Phase 7: Fullscreen-PC-Game-Layout ohne Browser-/Panel-Scroll */
html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}
body {
    height: 100dvh;
}
.app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding: 0 28px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.topbar {
    flex: 0 0 80px;
    height: 80px;
    padding: 0;
    position: relative;
    top: auto;
    z-index: 50;
    background: linear-gradient(180deg, rgba(16, 22, 29, 0.99), rgba(16, 22, 29, 0.88));
}
.brand-mark { width: 42px; height: 42px; }
.page {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 104px);
    padding: 18px 0 0;
    overflow: hidden;
}
.page > .game-screen,
.page > .hero-section,
.page > .menu-grid,
.page > .hero-grid,
.page > .result-grid,
.page > .table-card,
.page > .build-layout {
    min-height: 0;
}
.game-screen {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    overflow: hidden;
}
.card {
    min-height: 0;
    overflow: hidden;
}
.page-heading {
    margin: 0 0 16px;
}
.game-screen .page-heading {
    margin: 0;
}
.page-heading h1,
.hero-copy h1 {
    margin: 6px 0 10px;
}
.page-heading p {
    margin-top: 0;
    margin-bottom: 0;
}
.shop-heading h1,
.battle-heading h1 {
    font-size: clamp(2.1rem, 3.4vw, 4.6rem);
    line-height: 0.95;
}
.shop-heading .btn-large,
.battle-heading .btn-large {
    min-width: 168px;
}

/* Shop als fester Game-Screen */
.shop-layout {
    height: 100%;
    min-height: 0;
    align-items: stretch;
    grid-template-columns: minmax(280px, 22vw) minmax(560px, 1fr) minmax(270px, 22vw);
    gap: 18px;
    overflow: hidden;
}
.shop-panel,
.inventory-panel,
.stats-panel {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.shop-panel h2,
.inventory-panel h2,
.stats-panel h2 {
    margin: 0 0 12px;
}
.shop-list {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    overflow: hidden;
}
.shop-item {
    min-height: 0;
    padding: 10px 12px;
    gap: 7px;
    align-content: center;
}
.shop-item-head strong {
    font-size: 0.94rem;
    line-height: 1.15;
}
.shop-item p,
.shop-item small {
    font-size: 0.82rem;
    line-height: 1.25;
}
.shop-item .btn {
    min-height: 34px;
    padding: 8px 10px;
}
.inventory-help {
    flex: 0 0 auto;
    margin-bottom: 10px;
    font-size: 0.94rem;
}
.inventory-grid-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    max-width: 100%;
    overflow: visible;
    padding: 0;
}
.inventory-panel .inventory-grid {
    --slot-size: clamp(38px, min(4.5vw, 6.1vh), 52px);
}
.stats-panel {
    gap: 10px;
}
.stats-list {
    gap: 8px;
}
.stats-list div {
    padding: 8px 10px;
    min-height: 36px;
}
.stats-panel .life-display {
    flex: 0 0 auto;
    margin-bottom: 4px;
}
.stats-panel h3 {
    margin: 2px 0 0;
    font-size: 1rem;
}
.synergy-list {
    flex: 1 1 auto;
    min-height: 0;
    gap: 7px;
    overflow: hidden;
}
.synergy-list li {
    padding: 8px;
}
.spaced-form {
    flex: 0 0 auto;
    margin-top: auto;
}

/* Battle als fester Game-Screen */
.battle-screen {
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.battle-heading {
    align-items: center;
}
.battle-heading p {
    max-width: 680px;
    font-size: 0.95rem;
}
.battle-heading-side {
    gap: 9px;
}
.battle-heading-side .life-display {
    margin: 0;
}
.battle-stage {
    height: 100%;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
    grid-template-columns: minmax(300px, 0.92fr) minmax(380px, 1fr) minmax(300px, 0.92fr);
}
.battle-actor,
.battle-feed-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.battle-board {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: visible;
}
.battle-board .inventory-grid-scroll {
    width: 100%;
    height: 100%;
}
.battle-board .inventory-grid {
    --slot-size: clamp(25px, min(2.35vw, 4.2vh), 38px);
}
.battle-feed-card {
    min-height: 0;
}
.battle-current-action {
    flex: 0 0 auto;
    min-height: 92px;
    margin-top: 12px;
    padding: 14px;
}
.battle-replay-log {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    align-content: end;
}
.battle-replay-log li:nth-last-child(n+8):not([hidden]) {
    display: none;
}
.battle-log-full {
    flex: 0 0 auto;
    margin-top: 0;
    max-height: 156px;
    display: flex;
    flex-direction: column;
}
.battle-log-full .battle-log {
    max-height: none;
    overflow: hidden;
    min-height: 0;
    gap: 6px;
}
.battle-log-full .battle-log li:nth-child(n+5) {
    display: none;
}
.battle-log li {
    padding: 8px 10px;
}
.summary-dialog {
    max-height: calc(100dvh - 48px);
    overflow: hidden;
}

/* Start, Helden, Profil und Scoreboard ebenfalls wie feste PC-Spielseiten */
.hero-section {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.menu-grid {
    height: calc(100% - 116px);
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}
.menu-card {
    min-height: 0;
}
.active-run-card {
    margin-top: 14px;
    max-height: 190px;
}
.hero-grid {
    height: calc(100% - 150px);
    min-height: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
}
.hero-choice {
    min-height: 0;
    gap: 9px;
    padding: 16px;
}
.hero-choice h2,
.hero-choice p {
    margin: 0;
}
.hero-choice p {
    font-size: 0.9rem;
    line-height: 1.35;
}
.passive-box {
    padding: 9px;
}
.table-card {
    height: calc(100% - 150px);
    min-height: 0;
}
.responsive-table {
    height: 100%;
    overflow: hidden;
}
table {
    min-width: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}
th,
td {
    padding: 11px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-grid {
    height: calc(100% - 130px);
    min-height: 0;
    overflow: hidden;
}
.result-grid > .card {
    height: 100%;
}

/* Keine Browser-/Panel-Scrollbars auf Desktop */
.battle-log,
.responsive-table,
.inventory-grid-scroll,
.summary-dialog {
    scrollbar-width: none;
}
.battle-log::-webkit-scrollbar,
.responsive-table::-webkit-scrollbar,
.inventory-grid-scroll::-webkit-scrollbar,
.summary-dialog::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@media (max-width: 1180px) {
    .shop-layout {
        grid-template-columns: 260px minmax(430px, 1fr) 260px;
    }
    .battle-stage {
        grid-template-columns: minmax(260px, 0.9fr) minmax(330px, 1fr) minmax(260px, 0.9fr);
    }
    .hero-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 980px), (max-height: 680px) {
    html, body { overflow: hidden; }
    .app-shell { padding: 0 16px 16px; }
    .topbar { height: 64px; flex-basis: 64px; }
    .brand span:last-child { display: none; }
    .page { height: calc(100dvh - 80px); padding-top: 12px; }
    .shop-layout { grid-template-columns: 220px minmax(360px, 1fr) 220px; gap: 10px; }
    .card { padding: 14px; }
    .shop-heading h1, .battle-heading h1 { font-size: 2rem; }
    .shop-item p, .shop-item small { font-size: 0.74rem; }
    .inventory-panel .inventory-grid { --slot-size: clamp(32px, min(4vw, 5.7vh), 42px); }
    .stats-list div { min-height: 30px; padding: 6px 8px; }
    .battle-board .inventory-grid { --slot-size: clamp(22px, min(2.2vw, 3.7vh), 32px); }
    .battle-current-action { min-height: 72px; font-size: 0.94rem; }
    .battle-replay-log li:nth-last-child(n+6):not([hidden]) { display: none; }
}

/* Phase 7.1: klarere Drag-/Rotation-Vorschau und robustere Fullscreen-Auflösung */
.shop-layout,
.shop-layout > * {
    min-width: 0;
}
.shop-layout {
    grid-template-columns: clamp(220px, 20vw, 320px) minmax(0, 1fr) clamp(220px, 20vw, 320px);
}
.shop-screen .page-heading,
.shop-heading > div {
    min-width: 0;
}
.shop-heading h1 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shop-panel,
.inventory-panel,
.stats-panel {
    min-width: 0;
}
.shop-panel {
    position: relative;
    z-index: 2;
}
.shop-list {
    grid-template-rows: repeat(auto-fit, minmax(74px, 1fr));
}
.shop-item {
    overflow: hidden;
}
.shop-item-head {
    min-width: 0;
}
.shop-item-head strong,
.shop-item p,
.shop-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shop-item-head strong,
.shop-item p,
.shop-item small {
    white-space: nowrap;
}
.shop-item .btn {
    white-space: nowrap;
}

.inventory-grid {
    overflow: visible;
}
.inventory-grid.has-preview .inventory-item-cell.is-selected,
.inventory-grid.has-preview .bag-grip.is-selected {
    filter: saturate(0.75) brightness(0.9);
}
.inventory-grid.has-preview .inventory-item-cell.is-dragging,
.inventory-grid.has-preview .bag-grip.is-dragging {
    opacity: 0.42;
}
.placement-ghost-cell {
    z-index: 34;
    pointer-events: none;
    border-radius: 9px;
    border: 2px solid rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.13);
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.28),
        inset 0 0 0 2px rgba(255,255,255,0.08),
        0 12px 26px rgba(0,0,0,0.36);
    animation: aibGhostPulse 780ms ease-in-out infinite alternate;
}
.placement-ghost-cell.is-valid {
    border-color: rgba(68,198,122,0.95);
    background: rgba(68,198,122,0.32);
    box-shadow:
        0 0 0 2px rgba(3,8,5,0.30),
        inset 0 0 0 2px rgba(215,255,229,0.18),
        0 0 24px rgba(68,198,122,0.34);
}
.placement-ghost-cell.is-invalid {
    border-color: rgba(224,87,87,0.98);
    background: rgba(224,87,87,0.31);
    box-shadow:
        0 0 0 2px rgba(12,3,3,0.30),
        inset 0 0 0 2px rgba(255,220,220,0.16),
        0 0 24px rgba(224,87,87,0.32);
}
.placement-ghost-cell.is-origin::after {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 5px;
    border: 2px solid rgba(255,255,255,0.55);
}
.placement-ghost-label {
    z-index: 38;
    pointer-events: none;
    align-self: start;
    justify-self: start;
    transform: translate(-4px, -26px);
    max-width: 152px;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.20);
    background: rgba(10,15,20,0.94);
    color: var(--text);
    box-shadow: 0 10px 28px rgba(0,0,0,0.38);
    font-size: 0.64rem;
    font-weight: 950;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.placement-ghost-label.is-valid {
    border-color: rgba(68,198,122,0.58);
    color: #c9f8da;
}
.placement-ghost-label.is-invalid {
    border-color: rgba(224,87,87,0.62);
    color: #ffc8c8;
}
.inventory-item-cell.is-rotation-preview,
.bag-grip.is-rotation-preview {
    outline: 2px solid rgba(255,208,161,0.96);
    outline-offset: 2px;
}
.inventory-item-cell.is-rotation-preview::before,
.bag-grip.is-rotation-preview::before {
    content: 'R';
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 45;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--orange);
    color: #141c22;
    border: 2px solid rgba(20,28,34,0.95);
    box-shadow: 0 8px 18px rgba(0,0,0,0.34);
    font-size: 0.72rem;
    font-weight: 950;
}
.bag-grip.is-rotation-preview::before {
    top: -10px;
    right: -10px;
}
@keyframes aibGhostPulse {
    from { transform: scale(0.96); }
    to { transform: scale(1); }
}

@media (max-width: 1180px) {
    .shop-layout {
        grid-template-columns: clamp(190px, 20vw, 250px) minmax(0, 1fr) clamp(190px, 20vw, 250px);
        gap: 12px;
    }
}
@media (max-width: 980px), (max-height: 680px) {
    .shop-layout {
        grid-template-columns: clamp(165px, 19vw, 220px) minmax(0, 1fr) clamp(165px, 19vw, 220px);
        gap: 9px;
    }
    .shop-panel h2,
    .inventory-panel h2,
    .stats-panel h2 {
        font-size: 1.2rem;
    }
    .shop-list {
        grid-template-rows: repeat(auto-fit, minmax(58px, 1fr));
        gap: 7px;
    }
    .shop-item {
        padding: 7px 8px;
        gap: 4px;
    }
    .shop-item small {
        display: none;
    }
    .placement-ghost-label {
        transform: translate(-4px, -22px);
        max-width: 126px;
        font-size: 0.58rem;
        padding: 3px 6px;
    }
}
@media (max-height: 760px) {
    .shop-list {
        grid-template-rows: repeat(auto-fit, minmax(64px, 1fr));
    }
    .shop-item small {
        display: none;
    }
    .shop-item p {
        font-size: 0.76rem;
    }
}
.inventory-item-cell,
.bag-grip,
.placement-ghost-cell {
    position: relative;
}

/* Phase 7.2: Shop-Tooltips und saubereres Hover-Verhalten */
.shop-item[data-aib-tooltip="1"] {
    cursor: help;
}
.shop-item[data-aib-tooltip="1"] form,
.shop-item[data-aib-tooltip="1"] button {
    cursor: auto;
}
.shop-item[data-aib-tooltip="1"]:focus-visible {
    outline: 2px solid rgba(247,147,30,0.75);
    outline-offset: 3px;
}
.inventory-grid.is-moving .inventory-item-cell,
.inventory-grid.is-moving .bag-grip {
    cursor: grabbing;
}

/* Crafting / Kombinieren */
.inventory-panel {
    gap: 8px;
}
.inventory-panel .inventory-grid-scroll {
    flex: 1 1 auto;
}
.crafting-board {
    flex: 0 0 clamp(132px, 18vh, 178px);
    min-height: 116px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 10px;
    overflow: hidden;
}
.crafting-board-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.crafting-board-head h2 {
    margin: 0 0 2px;
    font-size: 1.15rem;
}
.crafting-board-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.25;
    max-width: 760px;
}
.crafting-board-head span {
    flex: 0 0 auto;
    color: #ffd0a1;
    font-size: 0.78rem;
    font-weight: 900;
    border: 1px solid rgba(247,147,30,0.22);
    background: rgba(247,147,30,0.08);
    border-radius: 999px;
    padding: 5px 8px;
}
.crafting-recipes {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(48px, 1fr);
    gap: 7px;
    overflow: hidden;
}
.craft-recipe {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255,255,255,0.04);
    padding: 7px 8px;
    cursor: help;
}
.craft-recipe.is-craftable {
    border-color: rgba(68,198,122,0.35);
    background: linear-gradient(135deg, rgba(68,198,122,0.10), rgba(247,147,30,0.05));
}
.craft-recipe.is-locked {
    opacity: 0.68;
}
.craft-recipe:focus-visible {
    outline: 2px solid rgba(247,147,30,0.72);
    outline-offset: 2px;
}
.craft-recipe-main,
.craft-recipe-side {
    min-width: 0;
}
.craft-recipe-main {
    display: grid;
    gap: 2px;
}
.craft-recipe-main strong,
.craft-recipe-main small,
.craft-recipe-side span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.craft-recipe-main strong {
    font-size: 0.86rem;
    color: var(--text);
}
.craft-recipe-main small,
.craft-recipe-side span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.15;
}
.craft-recipe-side {
    display: grid;
    justify-items: end;
    gap: 4px;
}
.craft-recipe .btn {
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 10px;
    font-size: 0.74rem;
}
.craft-recipe form,
.stash-item form {
    margin: 0;
}
.stash-panel {
    flex: 0 0 auto;
    display: grid;
    gap: 7px;
    border: 1px solid rgba(247,147,30,0.18);
    background: rgba(247,147,30,0.055);
    border-radius: 14px;
    padding: 9px;
    overflow: hidden;
}
.stash-panel h3 {
    margin: 0;
}
.stash-list {
    display: grid;
    gap: 6px;
    overflow: hidden;
}
.stash-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0,0,0,0.13);
    padding: 7px;
    cursor: help;
}
.stash-item strong,
.stash-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stash-item strong {
    font-size: 0.84rem;
}
.stash-item small {
    color: var(--muted);
    font-size: 0.72rem;
}
.stash-item .btn {
    min-height: 26px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 0.72rem;
}

@media (max-height: 760px) {
    .crafting-board {
        flex-basis: 124px;
        padding-top: 7px;
    }
    .crafting-board-head p { display: none; }
    .crafting-recipes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(42px, 1fr);
        gap: 5px;
    }
    .craft-recipe {
        padding: 5px 6px;
        gap: 5px;
    }
    .craft-recipe-side span,
    .craft-recipe-main small {
        display: none;
    }
}

@media (max-width: 1180px) {
    .crafting-recipes {
        grid-template-columns: 1fr;
    }
}

/* Phase 9: Storage + Werkbank */
.storage-board {
    margin-top: clamp(10px, 1.2vh, 16px);
    border: 1px solid rgba(255, 157, 35, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 157, 35, 0.08), rgba(8, 13, 18, 0.28)),
        rgba(10, 17, 23, 0.55);
    padding: clamp(10px, 1.2vh, 14px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.storage-board.is-dragging-storage,
.storage-board:has(.storage-item-card.is-dragging) {
    border-color: rgba(255, 157, 35, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 157, 35, 0.18), 0 18px 55px rgba(255, 157, 35, 0.08);
}

.storage-board-head,
.crafting-board-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.storage-board-head h2,
.crafting-board-head h2 {
    margin: 0;
}

.storage-board-head p,
.crafting-board-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: clamp(0.76rem, 0.85vw, 0.9rem);
    line-height: 1.35;
}

.storage-board-head > span,
.crafting-board-head > span {
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}

.storage-bin {
    min-height: clamp(78px, 10vh, 116px);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 16px;
    border: 1px dashed rgba(255, 157, 35, 0.35);
    background:
        linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.35)),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 18px);
    padding: 10px;
    position: relative;
}

.storage-bin::before {
    content: "STORAGE";
    position: absolute;
    right: 12px;
    bottom: 8px;
    color: rgba(255,255,255,0.08);
    font-weight: 900;
    letter-spacing: 0.18em;
    pointer-events: none;
}

.storage-bin.is-empty {
    align-items: center;
    justify-content: center;
}

.storage-item-card {
    width: clamp(104px, 7.4vw, 142px);
    min-height: 64px;
    display: grid;
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto;
    gap: 3px 8px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 157, 35, 0.34);
    background: rgba(19, 29, 38, 0.92);
    box-shadow: 0 11px 25px rgba(0,0,0,0.22);
    cursor: grab;
    user-select: none;
    animation: aibStorageDrop 420ms cubic-bezier(.2,.9,.25,1.25) both;
    transform-origin: 50% 100%;
}

.storage-item-card:nth-child(3n) { animation-delay: 35ms; }
.storage-item-card:nth-child(4n) { animation-delay: 70ms; }

.storage-item-card:active,
.storage-item-card.is-dragging {
    cursor: grabbing;
}

.storage-item-card.is-dragging {
    opacity: 0.45;
    transform: scale(0.96);
}

.storage-item-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.storage-item-card small {
    display: block;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
}

.storage-item-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 157, 35, 0.16);
    color: var(--accent);
    font-weight: 900;
    grid-row: 1 / span 2;
}

.storage-sell-form {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 2px;
}

.workbench-panel {
    border: 1px solid rgba(255, 157, 35, 0.22);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 157, 35, 0.055);
}

.workbench-panel h3 {
    margin-top: 0;
}

.workbench-list {
    display: grid;
    gap: 8px;
}

.workbench-job {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(10, 17, 23, 0.62);
    border: 1px solid rgba(255,255,255,0.07);
}

.workbench-job strong {
    display: block;
    font-size: 0.82rem;
}

.workbench-job small {
    color: var(--text-muted);
}

.workbench-job > span {
    color: var(--accent);
    font-weight: 900;
    white-space: nowrap;
}

.craft-recipe-side span {
    white-space: nowrap;
}

@keyframes aibStorageDrop {
    0% { opacity: 0; transform: translateY(-54px) rotate(-7deg) scale(0.92); }
    70% { opacity: 1; transform: translateY(5px) rotate(2deg) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}

@media (max-height: 820px) {
    .storage-bin { min-height: 70px; }
    .storage-item-card { min-height: 56px; padding: 7px; }
    .storage-board { padding: 9px; }
}
.inventory-panel .storage-board {
    flex: 0 0 clamp(118px, 16vh, 158px);
    min-height: 102px;
    overflow: hidden;
}
.inventory-panel .storage-bin {
    flex-wrap: nowrap;
}

/* Phase 9.1: ausfahrbares Storage-/Werkbank-/Rezepte-Dock */
.inventory-panel {
    position: relative;
    overflow: hidden;
    padding-bottom: 58px;
}
.inventory-panel .inventory-grid-scroll {
    padding-bottom: 28px;
}
.inventory-dock {
    position: absolute;
    left: clamp(12px, 1.2vw, 20px);
    right: clamp(12px, 1.2vw, 20px);
    bottom: clamp(10px, 1.2vh, 16px);
    z-index: 72;
    display: grid;
    grid-template-rows: auto auto;
    gap: 8px;
    pointer-events: auto;
}
.dock-tabbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px;
    border: 1px solid rgba(247,147,30,0.22);
    border-radius: 18px;
    background: rgba(8, 13, 18, 0.88);
    box-shadow: 0 16px 40px rgba(0,0,0,0.38), inset 0 0 0 1px rgba(255,255,255,0.035);
    backdrop-filter: none;
}
.dock-tab,
.dock-collapse {
    border: 0;
    min-height: 34px;
    border-radius: 13px;
    padding: 8px 11px;
    color: var(--text);
    background: rgba(255,255,255,0.055);
    cursor: pointer;
    font-weight: 900;
    transition: 150ms ease;
}
.dock-tab {
    flex: 0 1 150px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.dock-tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dock-tab strong {
    min-width: 25px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #141c22;
    background: var(--orange);
    font-size: 0.72rem;
}
.dock-tab:hover,
.dock-collapse:hover {
    transform: translateY(-1px);
    background: rgba(247,147,30,0.12);
}
.dock-tab.is-active {
    color: #141c22;
    background: linear-gradient(135deg, #ffbd72, var(--orange));
    box-shadow: 0 12px 28px rgba(247,147,30,0.2);
}
.dock-tab.is-active strong {
    color: #ffd9aa;
    background: rgba(20,28,34,0.92);
}
.dock-collapse {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--muted);
}
.inventory-dock:not(.is-open) .dock-collapse {
    display: none;
}
.dock-panels {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.22);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.09), rgba(8,13,18,0.94)),
        rgba(12, 18, 25, 0.96);
    box-shadow: 0 26px 68px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.03);
    transform: translateY(16px);
    transition: max-height 220ms ease, opacity 160ms ease, transform 220ms ease;
}
.inventory-dock.is-open .dock-panels {
    max-height: clamp(158px, 25vh, 250px);
    opacity: 1;
    transform: translateY(0);
}
.dock-panel {
    height: clamp(158px, 25vh, 250px);
    min-height: 0;
    padding: clamp(10px, 1.1vh, 14px);
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}
.dock-panel[hidden] {
    display: none !important;
}
.dock-panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}
.dock-panel-head h2 {
    margin: 0 0 2px;
    font-size: 1.05rem;
}
.dock-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
    max-width: 860px;
}
.dock-panel-head > span {
    flex: 0 0 auto;
    color: #ffd0a1;
    font-size: 0.76rem;
    font-weight: 950;
    border: 1px solid rgba(247,147,30,0.24);
    background: rgba(247,147,30,0.08);
    border-radius: 999px;
    padding: 5px 8px;
    white-space: nowrap;
}
.inventory-dock .storage-board {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}
.inventory-dock .storage-board.is-dragging-storage,
.inventory-dock .storage-board:has(.storage-item-card.is-dragging) {
    border: 0;
    box-shadow: none;
}
.inventory-dock .storage-bin {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    align-items: flex-end;
    align-content: flex-end;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    overflow: hidden;
    padding: 8px;
    border-radius: 16px;
}
.inventory-dock .storage-bin.is-empty {
    align-items: center;
    justify-content: center;
}
.inventory-dock .storage-item-card {
    width: clamp(104px, 8.2vw, 136px);
    min-height: 56px;
    padding: 7px;
    grid-template-columns: 24px minmax(0, 1fr);
}
.inventory-dock .storage-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
}
.inventory-dock .storage-item-card strong {
    font-size: 0.74rem;
}
.inventory-dock .storage-item-card small {
    font-size: 0.64rem;
}
.inventory-dock .storage-sell-form {
    margin-top: 0;
}
.inventory-dock .link-button {
    font-size: 0.68rem;
}
.workbench-dock-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    grid-auto-rows: minmax(58px, 1fr);
    gap: 8px;
    overflow: hidden;
}
.workbench-job-card {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(8, 13, 18, 0.56);
}
.workbench-job-card strong,
.workbench-job-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workbench-job-card strong {
    font-size: 0.86rem;
}
.workbench-job-card small {
    color: var(--muted);
    font-size: 0.72rem;
}
.workbench-job-card > span {
    flex: 0 0 auto;
    color: var(--orange);
    font-weight: 950;
    white-space: nowrap;
}
.dock-empty {
    align-self: center;
    justify-self: center;
    grid-column: 1 / -1;
    margin: 0;
}
.dock-recipes {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(46px, 1fr);
    gap: 7px;
    overflow: hidden;
}
.dock-recipes .craft-recipe {
    padding: 6px 7px;
    gap: 6px;
}
.dock-recipes .craft-recipe-main strong {
    font-size: 0.78rem;
}
.dock-recipes .craft-recipe-main small,
.dock-recipes .craft-recipe-side span {
    font-size: 0.64rem;
}
.dock-recipes .craft-recipe .btn {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.68rem;
}
.inventory-dock.is-drop-target .dock-tabbar,
.inventory-dock.is-drop-target .dock-panels {
    border-color: rgba(68,198,122,0.7);
    box-shadow: 0 0 0 1px rgba(68,198,122,0.22), 0 22px 60px rgba(68,198,122,0.08);
}

@media (max-width: 1280px) {
    .dock-recipes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dock-panel-head p { max-width: 620px; }
}
@media (max-width: 1080px), (max-height: 730px) {
    .inventory-panel { padding-bottom: 52px; }
    .inventory-dock { left: 10px; right: 10px; bottom: 10px; gap: 6px; }
    .dock-tabbar { padding: 5px; gap: 6px; }
    .dock-tab, .dock-collapse { min-height: 30px; padding: 6px 8px; font-size: 0.78rem; }
    .dock-tab { flex-basis: 112px; }
    .dock-panel-head p { display: none; }
    .inventory-dock.is-open .dock-panels { max-height: clamp(132px, 23vh, 198px); }
    .dock-panel { height: clamp(132px, 23vh, 198px); padding: 9px; }
    .dock-recipes { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(40px, 1fr); gap: 5px; }
    .dock-recipes .craft-recipe-main small,
    .dock-recipes .craft-recipe-side span { display: none; }
    .inventory-dock .storage-item-card { min-height: 50px; }
}

/* Phase 10: Nachbarschafts-Buffs / visuelle Anziehung */
.inventory-item-cell.has-adjacency-source .item-icon::after,
.storage-item-card.has-adjacency-source .storage-item-icon::after {
    content: '';
}
.inventory-item-cell.has-adjacency-source.is-main-cell::after {
    content: '↔';
    position: absolute;
    right: -7px;
    bottom: -7px;
    z-index: 12;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #141c22;
    background: #6ee7b7;
    border: 2px solid rgba(12,18,24,0.95);
    font-size: 0.68rem;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(0,0,0,0.35), 0 0 18px rgba(110,231,183,0.36);
}
.inventory-item-cell.has-adjacency-buff {
    box-shadow: 0 10px 22px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(110,231,183,0.15);
}
.item-adjacency-badge {
    color: #b8ffe0 !important;
    border-radius: 999px;
    padding: 1px 5px;
    background: rgba(68,198,122,0.12);
    border: 1px solid rgba(110,231,183,0.24);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inventory-item-cell.is-adjacency-source,
.inventory-item-cell.is-adjacency-provider {
    z-index: 30;
    outline: 2px solid rgba(110,231,183,0.78);
    outline-offset: 2px;
    filter: brightness(1.12) saturate(1.15);
}
.inventory-item-cell.is-adjacency-target {
    z-index: 31;
    border-color: rgba(110,231,183,0.95) !important;
    box-shadow:
        0 0 0 2px rgba(110,231,183,0.26),
        0 0 26px rgba(110,231,183,0.34),
        inset 0 0 0 1px rgba(255,255,255,0.08) !important;
    animation: aibAdjacencyPulse 760ms ease-in-out infinite alternate;
}
.inventory-item-cell.is-adjacency-magnet {
    animation: aibAdjacencyMagnet 640ms ease-in-out infinite alternate;
}
.adjacency-link-line {
    position: absolute;
    height: 3px;
    z-index: 29;
    pointer-events: none;
    transform-origin: 0 50%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(110,231,183,0.08), rgba(110,231,183,0.86), rgba(247,147,30,0.86));
    box-shadow: 0 0 16px rgba(110,231,183,0.42), 0 0 28px rgba(247,147,30,0.18);
    opacity: 0.92;
}
.adjacency-link-line::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 50%;
    width: 9px;
    height: 9px;
    transform: translateY(-50%) rotate(45deg);
    border-top: 3px solid rgba(247,147,30,0.95);
    border-right: 3px solid rgba(247,147,30,0.95);
}
.adjacency-link-label {
    position: absolute;
    z-index: 39;
    pointer-events: none;
    transform: translate(-50%, -50%);
    padding: 3px 6px;
    border-radius: 999px;
    border: 1px solid rgba(110,231,183,0.36);
    color: #ccffe5;
    background: rgba(7,13,18,0.94);
    box-shadow: 0 10px 24px rgba(0,0,0,0.36);
    font-size: 0.58rem;
    font-weight: 950;
    white-space: nowrap;
}
.placement-ghost-label[data-has-links="1"],
.inventory-grid[data-adjacency-preview-count] .placement-ghost-label.is-valid {
    border-color: rgba(110,231,183,0.76);
    color: #ccffe5;
}
@keyframes aibAdjacencyPulse {
    from { transform: scale(0.98); }
    to { transform: scale(1.035); }
}
@keyframes aibAdjacencyMagnet {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-2px) scale(1.04); }
}
.battle-board .adjacency-link-line,
.battle-board .adjacency-link-label,
.build-share-board .adjacency-link-line,
.build-share-board .adjacency-link-label {
    display: none;
}

/* Phase 12: Shop direkt ins Inventar ziehen */
.shop-item[data-draggable="1"] {
    cursor: grab;
    user-select: none;
}
.shop-item[data-draggable="1"]:active,
.shop-item.is-dragging {
    cursor: grabbing;
}
.shop-item.is-dragging {
    opacity: 0.5;
    transform: scale(0.985);
    box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.38), 0 18px 32px rgba(0,0,0,0.28);
}
.shop-item[data-draggable="1"]::after {
    content: "ziehen";
    justify-self: start;
    width: fit-content;
    margin-top: -2px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.78);
    background: rgba(247,147,30,0.18);
    border: 1px solid rgba(247,147,30,0.26);
    pointer-events: none;
}
.shop-item.is-bought::after {
    content: none;
}
.shop-item[data-draggable="1"] form,
.shop-item[data-draggable="1"] button {
    user-select: auto;
}

/* Phase 13: Shop-Rotation und Locks */
.shop-item.is-locked {
    border-color: rgba(247, 147, 30, 0.62) !important;
    background: linear-gradient(135deg, rgba(247,147,30,0.14), rgba(255,255,255,0.035));
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.12), 0 0 18px rgba(247,147,30,0.09);
}
.shop-lock-badge {
    width: fit-content;
    margin-top: -3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    color: #19130b;
    background: linear-gradient(135deg, #ffd39f, var(--orange));
    border: 1px solid rgba(255, 208, 161, 0.5);
}
.shop-item-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
}
.shop-item-actions form {
    min-width: 0;
    margin: 0;
}
.shop-item-actions .btn {
    width: 100%;
}
.shop-lock-btn {
    min-width: 74px;
    background: rgba(255,255,255,0.07);
    color: #dfe8ef;
    border: 1px solid rgba(255,255,255,0.12);
}
.shop-lock-btn.is-on {
    color: #141c22;
    background: linear-gradient(135deg, #ffc27d, var(--orange));
    border-color: rgba(247,147,30,0.62);
    box-shadow: 0 0 18px rgba(247,147,30,0.2);
}
.shop-item.is-locked[data-draggable="1"]::after {
    content: "locked";
    background: rgba(247,147,30,0.3);
    border-color: rgba(247,147,30,0.55);
    color: #ffe1bd;
}
.shop-panel > h2::after {
    content: "  · jede Runde neu, Lock bleibt";
    display: inline;
    margin-left: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
}
@media (max-height: 760px) {
    .shop-lock-badge { display: none; }
    .shop-item-actions { gap: 5px; }
    .shop-lock-btn { min-width: 58px; }
}

/* Phase 14.2: Battle-Replay darf nur schrittweise Log-Zeilen anzeigen. */
.battle-screen [hidden],
.summary-modal[hidden],
[data-summary-reveal][hidden],
.battle-replay-log li[hidden] {
    display: none !important;
}

/* Vollständiger Log lebt jetzt erst in der Summary. */
.summary-log-details {
    margin-top: 16px;
    border: 1px solid rgba(247,147,30,0.26);
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    overflow: hidden;
}
.summary-log-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    font-weight: 900;
    color: var(--text);
}
.summary-log-details summary::-webkit-details-marker { display: none; }
.summary-log-details summary::after {
    content: 'öffnen';
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.summary-log-details[open] summary::after { content: 'schließen'; }
.summary-log-details summary strong {
    color: var(--muted);
    font-size: 0.82rem;
    margin-left: auto;
}
.summary-full-log {
    margin: 0;
    padding: 0 12px 12px;
    max-height: min(42vh, 420px);
    overflow: auto;
    gap: 6px;
}
.summary-full-log li {
    grid-template-columns: 74px 78px 1fr;
    padding: 8px 10px;
    font-size: 0.88rem;
}
.summary-dialog {
    overflow: auto;
}

/* Phase 15 Admin */
.admin-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 0 0 8px;
    flex-wrap: wrap;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(18, 29, 39, .8);
    color: var(--text-muted, #c8d2dd);
    text-decoration: none;
    font-weight: 800;
}

.admin-tab.is-active,
.admin-tab:hover {
    color: #101820;
    background: var(--accent, #ff9f2e);
    border-color: transparent;
}

.admin-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.admin-header-row h1 {
    margin: 0;
}

.admin-header-row p {
    margin: 6px 0 0;
    color: var(--text-muted, #c8d2dd);
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
}

.admin-stat {
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,159,46,.12), rgba(17,28,38,.9));
    border-radius: 16px;
    padding: 14px 16px;
}

.admin-stat span {
    display: block;
    color: var(--text-muted, #c8d2dd);
    font-size: 13px;
    font-weight: 800;
}

.admin-stat strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1;
}

.admin-card {
    min-height: 0;
    overflow: hidden;
}

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

.admin-card h2,
.admin-card-head h2 {
    margin: 0 0 12px;
}

.admin-card-head h2 {
    margin-bottom: 0;
}

.admin-table-wrap {
    overflow: auto;
    max-height: min(58vh, 620px);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
}

.admin-table-wrap.compact {
    max-height: 52vh;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(13, 23, 32, .98);
    color: var(--text-muted, #c8d2dd);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-table td code,
.admin-warning code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0,0,0,.28);
    color: #ffd7a6;
}

.admin-result {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
    background: rgba(255,255,255,.08);
}

.admin-result-win { color: #8ff0a4; }
.admin-result-loss { color: #ff8f8f; }
.admin-result-draw { color: #ffe08a; }

.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 0;
}

.admin-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
}

.admin-log-line {
    display: grid;
    grid-template-columns: 90px 120px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.admin-log-line span {
    color: var(--accent, #ff9f2e);
    font-weight: 900;
}

.admin-log-line p {
    margin: 0;
    color: var(--text-muted, #c8d2dd);
}

.admin-warning {
    border: 1px solid rgba(255, 100, 100, .4);
    background: rgba(255, 85, 85, .12);
    color: #ffd0d0;
    padding: 12px 14px;
    border-radius: 14px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    max-height: calc(100vh - 220px);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.admin-json-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-muted, #c8d2dd);
    font-weight: 800;
}

.admin-form label small {
    font-weight: 600;
    color: rgba(200,210,221,.72);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(8, 16, 24, .8);
    color: var(--text, #f4f7fb);
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.admin-form textarea {
    resize: vertical;
    min-height: 96px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.admin-check {
    flex-direction: row !important;
    align-items: center;
}

.admin-check input {
    width: auto;
}

.admin-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

@media (max-width: 1200px) {
    .admin-stat-grid,
    .admin-form-grid,
    .admin-json-grid,
    .admin-two-col {
        grid-template-columns: 1fr;
    }

    .admin-header-row {
        flex-direction: column;
    }
}

/* Phase 15.1: Admin editor fields */
.admin-form-wide {
    max-height: calc(100vh - 190px);
    padding: 20px;
}

.admin-form-block {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(8, 16, 24, .34);
    border-radius: 18px;
    padding: 16px;
}

.admin-form-block h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.admin-help {
    margin: -2px 0 12px;
    color: var(--text-muted, #c8d2dd);
    font-size: 13px;
    line-height: 1.45;
}

.admin-two-column {
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
    gap: 14px;
    align-items: start;
}

.admin-form .admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    gap: 10px;
}

.admin-size-row {
    display: grid;
    grid-template-columns: 90px 90px auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.admin-subblock {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.admin-shape-editor {
    display: grid;
    grid-template-columns: repeat(10, 28px);
    gap: 5px;
    align-items: center;
    padding: 12px;
    width: max-content;
    max-width: 100%;
    overflow: auto;
    border-radius: 16px;
    border: 1px dashed rgba(255, 159, 46, .34);
    background:
        linear-gradient(135deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0 / 18px 18px,
        rgba(0,0,0,.18);
}

.admin-shape-cell {
    width: 28px;
    height: 28px;
    display: block !important;
    cursor: pointer;
}

.admin-shape-cell input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-shape-cell span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.045);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.admin-shape-cell:hover span {
    transform: translateY(-1px);
    border-color: rgba(255,159,46,.58);
}

.admin-shape-cell input:checked + span {
    border-color: rgba(255,159,46,.95);
    background: linear-gradient(180deg, rgba(255,159,46,.65), rgba(164,93,19,.62));
    box-shadow: 0 0 12px rgba(255,159,46,.22), inset 0 0 0 1px rgba(255,255,255,.18);
}

@media (max-width: 1200px) {
    .admin-two-column,
    .admin-size-row,
    .admin-form .admin-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Phase: Concept Landing Page - echte HTML/CSS-Umsetzung mit separaten Assets */
body.landing-page {
    --landing-bg: #07090c;
    --landing-panel: rgba(12, 14, 16, 0.88);
    --landing-panel-strong: rgba(18, 21, 23, 0.94);
    --landing-steel: #242a2d;
    --landing-steel-light: #485056;
    --landing-line: rgba(255, 124, 12, 0.42);
    --landing-orange: #f7931e;
    --landing-orange-soft: #ffb04a;
    --landing-text: #e8ded1;
    --landing-muted: #bcb2a6;
    --landing-dark: #060708;
    min-height: 100vh;
    overflow-x: hidden;
    isolation: isolate;
    font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--landing-text);
    background: var(--landing-bg);
}

body.landing-page::after {
    content: "";
    position: fixed;
    inset: -2.5vh -2.5vw;
    z-index: -3;
    pointer-events: none;
    background: url('../img/landing/bg_wasteland_hero.webp') center top / cover no-repeat;
    transform: translate3d(0, 0, 0) scale(1.035);
    transform-origin: center center;
    animation: landingBgDrift 34s ease-in-out infinite alternate;
    will-change: transform, filter;
}

body.landing-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.36) 55%, rgba(0, 0, 0, 0.78) 100%),
        radial-gradient(circle at 48% 43%, rgba(247, 92, 14, 0.22), transparent 29rem),
        linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 23%, rgba(0, 0, 0, 0.16) 74%, rgba(0, 0, 0, 0.66) 100%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px);
    mix-blend-mode: normal;
}

@keyframes landingBgDrift {
    0% {
        transform: translate3d(-0.8vw, -0.35vh, 0) scale(1.035);
        filter: brightness(0.98) contrast(1.02);
    }
    50% {
        transform: translate3d(0.45vw, 0.15vh, 0) scale(1.045);
        filter: brightness(1.04) contrast(1.04);
    }
    100% {
        transform: translate3d(0.9vw, -0.15vh, 0) scale(1.04);
        filter: brightness(1.00) contrast(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.landing-page::after { animation: none; }
}

.landing-page .app-shell {
    width: min(1760px, calc(100% - 22px));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-page .page {
    flex: 1;
    padding: 20px 0 110px;
}

.topbar-landing {
    min-height: 104px;
    margin-top: 8px;
    padding: 0 32px 0 34px;
    gap: clamp(18px, 2.2vw, 38px);
    border: 0;
    border-radius: 0;
    background: url('../img/landing/panel_header_strip.webp') center / 100% 100% no-repeat;
    position: sticky;
    top: 8px;
    z-index: 60;
    overflow: visible;
}

.topbar-landing::before,
.topbar-landing::after {
    display: none;
}

.brand-landing {
    position: relative;
    z-index: 2;
    min-width: clamp(420px, 30vw, 530px);
    gap: 22px;
    color: #f1e9dc;
    text-shadow: 0 2px 0 rgba(0,0,0,0.8);
}

.brand-logo-img {
    width: clamp(145px, 9.4vw, 176px);
    height: auto;
    display: block;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.70));
}

.brand-landing span:last-child {
    font-size: clamp(1.05rem, 1.45vw, 1.45rem);
    line-height: 1;
    letter-spacing: 0.04em;
    font-weight: 500;
    white-space: nowrap;
}

.topnav-landing {
    position: relative;
    z-index: 2;
    flex: 1;
    justify-content: flex-end;
    gap: clamp(13px, 1.1vw, 22px);
}

.topnav-landing a:not(.btn) {
    position: relative;
    padding: 30px 2px 27px;
    border-radius: 0;
    color: rgba(232,222,209,0.78);
    font-size: clamp(0.94rem, 1.02vw, 1.16rem);
    letter-spacing: 0.02em;
    background: transparent;
    white-space: nowrap;
}

.topnav-landing a:not(.btn):hover,
.topnav-landing a:not(.btn).is-active {
    color: var(--landing-orange-soft);
    background: transparent;
}

.topnav-landing a:not(.btn).is-active::after,
.topnav-landing a:not(.btn):hover::after {
    content: "";
    position: absolute;
    left: -7px;
    right: -7px;
    bottom: 19px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--landing-orange), transparent);
    box-shadow: 0 0 14px rgba(247,147,30,0.64);
}

.topnav-landing .landing-login-btn {
    position: relative;
    min-height: 48px;
    margin-left: clamp(14px, 1.3vw, 26px);
    padding: 0 28px;
    border: 1px solid rgba(247,147,30,0.72);
    border-radius: 0;
    color: var(--landing-orange-soft);
    background:
        linear-gradient(180deg, rgba(21,20,18,0.78), rgba(9,8,8,0.90)),
        url('../img/landing/button_login_blank.webp') center / 100% 100% no-repeat;
    box-shadow: inset 0 0 0 2px rgba(247,147,30,0.12), 0 0 26px rgba(247,147,30,0.16);
    font-family: "Share Tech Mono", monospace;
    text-transform: none;
    white-space: nowrap;
}

.landing-home {
    position: relative;
    min-height: calc(100vh - 132px);
}

.landing-home__decor {
    position: fixed;
    z-index: -1;
    pointer-events: none;
    opacity: 0.28;
    filter: drop-shadow(0 30px 35px rgba(0,0,0,0.65));
    background-repeat: no-repeat;
    background-size: contain;
}

.landing-home__decor-left {
    left: -62px;
    bottom: -38px;
    width: min(24vw, 340px);
    height: 58vh;
    background-image: url('../img/landing/decor_scaffold_left.webp');
    background-position: left bottom;
}

.landing-home__decor-right {
    right: -70px;
    bottom: -30px;
    width: min(28vw, 430px);
    height: 62vh;
    background-image: url('../img/landing/decor_scaffold_right.webp');
    background-position: right bottom;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(390px, 0.74fr);
    gap: clamp(44px, 5vw, 88px);
    align-items: center;
    width: min(1508px, 100%);
    min-height: clamp(470px, 49vh, 560px);
    margin: 0 auto;
    padding: clamp(34px, 5.5vw, 72px) clamp(16px, 3.4vw, 52px) 14px;
}

.landing-hero__copy {
    max-width: 760px;
    padding-top: 12px;
}

.landing-eyebrow {
    margin: 0 0 12px;
    color: var(--landing-orange-soft);
    font-size: clamp(1rem, 1.2vw, 1.35rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 0 14px rgba(247,147,30,0.55), 0 3px 0 rgba(0,0,0,0.9);
}

.landing-title {
    margin: 0 0 18px;
    font-family: "Pixelify Sans", "Share Tech Mono", monospace;
    text-transform: uppercase;
    line-height: 0.86;
    letter-spacing: 0.025em;
    text-shadow:
        0 4px 0 rgba(0,0,0,0.78),
        0 0 28px rgba(247,147,30,0.18);
}

.landing-title span {
    display: block;
    color: #f4e8d6;
    font-size: clamp(5.6rem, 11.2vw, 10.6rem);
    font-weight: 700;
    -webkit-text-stroke: 1px rgba(40,25,12,0.35);
    filter: drop-shadow(0 8px 0 rgba(0,0,0,0.60));
}

.landing-title small {
    display: block;
    margin-top: 6px;
    color: var(--landing-orange);
    font-size: clamp(2.65rem, 4.75vw, 5.05rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 3px 0 #4a1e04, 0 0 18px rgba(247,147,30,0.34);
}

.landing-lead {
    max-width: 720px;
    margin: 0 0 34px;
    color: rgba(239,229,213,0.86);
    font-size: clamp(1.2rem, 1.45vw, 1.55rem);
    line-height: 1.55;
    text-shadow: 0 2px 0 rgba(0,0,0,0.76);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(34px, 3vw, 56px);
    align-items: center;
}

.landing-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-width: min(320px, 100%);
    min-height: 74px;
    padding: 0 34px;
    color: #f5eadc;
    font-family: "Share Tech Mono", monospace;
    font-size: clamp(1.05rem, 1.2vw, 1.34rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    text-shadow: 0 2px 0 rgba(0,0,0,0.8);
    transition: transform 150ms ease, filter 150ms ease;
}

.landing-btn::before {
    content: "";
    position: absolute;
    inset: -10px -18px;
    z-index: -1;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.45));
}

.landing-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.09);
}

.landing-btn-primary::before { background-image: url('../img/landing/button_primary_blank.webp'); }
.landing-btn-secondary::before { background-image: url('../img/landing/button_secondary_blank.webp'); opacity: 0.98; }
.landing-btn-icon { font-size: 1.24em; color: #fff4e5; }

.metal-panel {
    position: relative;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.07), transparent 21rem),
        linear-gradient(135deg, rgba(21,24,26,0.94), rgba(7,8,9,0.92));
    box-shadow:
        inset 0 0 0 2px rgba(0,0,0,0.55),
        inset 0 0 0 3px rgba(255,255,255,0.026),
        0 25px 70px rgba(0,0,0,0.48);
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}

.metal-panel::before {
    content: "";
    position: absolute;
    inset: 9px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.06);
    border-top-color: rgba(255,255,255,0.14);
    border-bottom-color: rgba(247,147,30,0.18);
    clip-path: inherit;
}

.metal-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background:
        repeating-linear-gradient(90deg, transparent 0 36px, rgba(255,255,255,0.025) 36px 37px),
        repeating-linear-gradient(0deg, transparent 0 19px, rgba(255,255,255,0.018) 19px 20px);
}

.landing-loop {
    max-width: 520px;
    justify-self: center;
    padding: 24px 28px 28px;
}

.landing-panel-title {
    position: relative;
    z-index: 1;
    margin: 0 0 17px;
    padding-left: 22px;
    color: var(--landing-orange-soft);
    font-family: "Share Tech Mono", monospace;
    font-size: clamp(1.35rem, 1.7vw, 1.82rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 0 16px rgba(247,147,30,0.28);
}

.landing-panel-title::after {
    content: "";
    display: inline-block;
    width: 130px;
    height: 13px;
    margin-left: 17px;
    opacity: 0.32;
    background: repeating-linear-gradient(115deg, rgba(255,255,255,0.58) 0 8px, transparent 8px 18px);
    transform: translateY(1px);
}

.landing-loop-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-loop-list li {
    display: grid;
    grid-template-columns: 42px 42px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    color: rgba(236,226,213,0.92);
    font-size: clamp(1rem, 1.25vw, 1.32rem);
}

.landing-loop-list li:last-child { border-bottom: 0; }

.landing-loop-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--landing-orange);
    border: 1px solid rgba(247,147,30,0.66);
    background: rgba(0,0,0,0.27);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.42), 0 0 16px rgba(247,147,30,0.14);
    font-size: 1.32rem;
    font-weight: 800;
}

.landing-loop-list img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,0.75));
}

.landing-feature-panel {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 22px;
    width: min(1508px, 100%);
    margin: 18px auto 18px;
    padding: 22px 26px;
}

.landing-feature-intro {
    position: relative;
    z-index: 1;
    padding: 10px 18px 6px 10px;
    border-right: 1px dashed rgba(255,255,255,0.15);
}

.landing-feature-intro h2,
.landing-mini-panel h2 {
    margin: 0 0 22px;
    color: var(--landing-orange-soft);
    font-size: clamp(1.05rem, 1.25vw, 1.3rem);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.landing-feature-intro p {
    margin: 0 0 10px;
    color: rgba(232,222,209,0.86);
    font-size: 1.04rem;
    line-height: 1.25;
}

.landing-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
}

.landing-feature-card {
    min-height: 160px;
    padding: 0 20px;
    text-align: center;
    border-right: 1px dashed rgba(255,255,255,0.13);
}

.landing-feature-card:last-child { border-right: 0; }

.landing-feature-card img {
    width: 66px;
    height: 58px;
    object-fit: contain;
    margin: 0 auto 8px;
    filter: drop-shadow(0 8px 13px rgba(0,0,0,0.74));
}

.landing-feature-card h3 {
    margin: 0 0 8px;
    color: var(--landing-orange);
    font-size: clamp(0.9rem, 1.06vw, 1.15rem);
    line-height: 1.12;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 14px rgba(247,147,30,0.20);
}

.landing-feature-card p {
    margin: 0;
    color: rgba(232,222,209,0.82);
    font-size: clamp(0.95rem, 1.05vw, 1.08rem);
    line-height: 1.35;
}

.landing-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: min(1508px, 100%);
    margin: 18px auto 0;
}

.landing-mini-panel {
    padding: 22px 24px 24px;
}

.landing-mini-panel p,
.landing-about p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(232,222,209,0.78);
    line-height: 1.55;
}

.metal-strip {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.28fr 1.2fr;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    padding: 10px 32px;
    border: 0;
    background: url('../img/landing/panel_footer_strip.webp') center / 100% 100% no-repeat;
    box-shadow: 0 16px 36px rgba(0,0,0,0.38);
}

.landing-statusbar {
    position: fixed;
    left: 50%;
    bottom: 10px;
    z-index: 55;
    width: min(1760px, calc(100vw - 22px));
    margin: 0;
    transform: translateX(-50%);
}

.landing-statusbar span,
.landing-statusbar a {
    color: rgba(232,222,209,0.84);
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    white-space: nowrap;
}

.landing-statusbar span:not(:last-child),
.landing-statusbar a:not(:last-child) {
    border-right: 1px dashed rgba(255,255,255,0.14);
}

.landing-statusbar a {
    color: var(--landing-orange-soft);
    font-weight: 800;
    text-align: center;
}

.landing-statusbar i {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid rgba(247,147,30,0.7);
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px rgba(0,0,0,0.65), 0 0 12px rgba(247,147,30,0.45);
    vertical-align: -1px;
}

.landing-about {
    width: min(1508px, 100%);
    margin: 18px auto 0;
    text-align: center;
    opacity: 0.86;
}

@media (max-width: 1480px) {
    .brand-landing { min-width: clamp(320px, 28vw, 440px); gap: 16px; }
    .brand-logo-img { width: 138px; }
    .brand-landing span:last-child { font-size: 1.08rem; }
    .topnav-landing { gap: 12px; }
    .topnav-landing a:not(.btn) { font-size: 0.96rem; }
    .topnav-landing .landing-login-btn { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 1340px) {
    .topbar-landing { align-items: center; min-height: auto; padding: 16px 22px 18px; flex-wrap: wrap; }
    .brand-landing { min-width: 280px; }
    .brand-logo-img { width: 132px; }
    .topnav-landing { justify-content: center; gap: 12px; }
    .topnav-landing a:not(.btn) { padding-top: 12px; padding-bottom: 10px; }
    .topnav-landing a:not(.btn).is-active::after,
    .topnav-landing a:not(.btn):hover::after { bottom: 3px; }
    .landing-hero { grid-template-columns: 1fr; padding-left: 26px; padding-right: 26px; }
    .landing-loop { width: min(620px, 100%); max-width: 620px; justify-self: start; }
    .landing-feature-panel { grid-template-columns: 1fr; }
    .landing-feature-intro { border-right: 0; border-bottom: 1px dashed rgba(255,255,255,0.15); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
    .landing-feature-intro h2 { width: 100%; margin-bottom: 4px; }
    .landing-feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
    .landing-feature-card:nth-child(3n) { border-right: 0; }
    .metal-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    body.landing-page::after { animation: none; inset: 0; transform: none; }
    .landing-page .app-shell { width: min(100% - 16px, 760px); }
    .topbar-landing { position: relative; top: 0; flex-direction: column; background-size: cover; }
    .brand-landing { min-width: 0; width: 100%; justify-content: center; }
    .brand-landing span:last-child { display: none; }
    .brand-logo-img { width: 150px; }
    .topnav-landing { justify-content: center; width: 100%; gap: 10px; }
    .topnav-landing a:not(.btn) { font-size: 0.98rem; padding: 8px 4px; }
    .topnav-landing .landing-login-btn { width: 100%; margin-left: 0; }
    .landing-page .page { padding-top: 18px; padding-bottom: 170px; }
    .landing-hero { min-height: 0; padding: 34px 10px 16px; }
    .landing-title span { font-size: clamp(4.4rem, 23vw, 7.5rem); }
    .landing-title small { font-size: clamp(2.15rem, 11vw, 3.4rem); }
    .landing-actions { gap: 24px; }
    .landing-btn { width: 100%; min-height: 64px; }
    .landing-loop { padding: 20px 18px; }
    .landing-loop-list li { grid-template-columns: 38px 38px 1fr; font-size: 1rem; }
    .landing-feature-panel { padding: 18px 14px; }
    .landing-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing-feature-card { border-right: 0; padding: 0 12px; }
    .landing-info-grid { grid-template-columns: 1fr; }
    .metal-strip { grid-template-columns: 1fr; gap: 8px; text-align: center; min-height: 128px; background-size: cover; }
    .landing-statusbar { bottom: 8px; width: min(100vw - 16px, 760px); }
    .landing-statusbar span:not(:last-child), .landing-statusbar a:not(:last-child) { border-right: 0; }
    .landing-home__decor { display: none; }
}

@media (max-width: 520px) {
    .topnav-landing a[href="#roadmap"],
    .topnav-landing a[href="#faq"],
    .topnav-landing a[href="#about"] { display: none; }
    .landing-feature-grid { grid-template-columns: 1fr; }
    .landing-feature-card { min-height: auto; padding: 8px 12px 18px; }
}


/* Final Landing Polish: zentrierter Aufbau + echte Loop-Background-Layer */
body.landing-page {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #050608;
}

body.landing-page::after {
    inset: 0;
    z-index: -10;
    background: url('../img/landing/bg_wasteland_hero.webp') center center / cover no-repeat;
    transform: none;
    animation: none;
    filter: brightness(0.9) contrast(1.06);
}

body.landing-page::before {
    display: none;
}

.landing-page .app-shell {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.landing-page .page {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 112px);
    padding: 10px 0 98px;
    overflow: visible;
}

.topbar-landing {
    width: min(1780px, calc(100vw - 26px));
    min-height: 96px;
    margin: 8px auto 0;
    padding: 0 clamp(24px, 2.4vw, 38px);
    background-size: 100% 100%;
}

.landing-home {
    width: 100%;
    min-height: calc(100dvh - 210px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 0;
}

.landing-home__decor {
    display: none !important;
}

.landing-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    contain: layout paint;
}

.landing-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.72) 100%),
        radial-gradient(circle at 50% 45%, rgba(255, 107, 18, 0.20), transparent 34rem),
        linear-gradient(90deg, rgba(0, 0, 0, 0.54) 0%, rgba(0, 0, 0, 0.08) 24%, rgba(0, 0, 0, 0.08) 76%, rgba(0, 0, 0, 0.56) 100%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 4px);
}

.landing-scene__layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    will-change: transform, opacity, filter, background-position;
}

.landing-scene__edges {
    z-index: 1;
    background-image: url('../img/landing/decor_foreground_edges.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.26;
    filter: drop-shadow(0 28px 32px rgba(0,0,0,0.62));
}

.landing-scene__clouds {
    z-index: 2;
    inset: -4vh -8vw auto -8vw;
    height: min(74vh, 820px);
    background-image: url('../img/landing/bg_clouds_loop.webp');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: 3344px auto;
    opacity: 0.30;
    mix-blend-mode: screen;
    animation: landingCloudLoop 110s linear infinite;
}

.landing-scene__smoke {
    z-index: 3;
    inset: auto -4vw -4vh -4vw;
    height: min(72vh, 760px);
    background-image: url('../img/landing/bg_smoke_loop.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.145;
    mix-blend-mode: screen;
    transform-origin: center bottom;
    animation: landingSmokeLoop 18s ease-in-out infinite;
}

.landing-scene__embers {
    z-index: 4;
    inset: -2vh -2vw;
    background-image: url('../img/landing/bg_embers_loop.webp'), url('../img/landing/bg_embers_loop.webp');
    background-position: 0 0, 43vw 20vh;
    background-size: 1672px auto, 1220px auto;
    background-repeat: repeat;
    opacity: 0.58;
    mix-blend-mode: screen;
    animation: landingEmberLoop 15s linear infinite;
}

.landing-scene__fireglow {
    z-index: 5;
    opacity: 0.72;
    mix-blend-mode: screen;
    background:
        radial-gradient(circle at 22% 79%, rgba(255, 132, 20, 0.30), rgba(255, 67, 0, 0.11) 3.2rem, transparent 8rem),
        radial-gradient(circle at 74% 76%, rgba(255, 122, 14, 0.34), rgba(255, 70, 0, 0.13) 4rem, transparent 10rem),
        radial-gradient(circle at 81% 66%, rgba(255, 147, 36, 0.28), rgba(255, 83, 0, 0.10) 3.5rem, transparent 9rem),
        radial-gradient(circle at 57% 82%, rgba(255, 106, 18, 0.20), transparent 7rem);
    animation: landingFireFlicker 3.8s steps(7, end) infinite;
}

.landing-hero,
.landing-feature-panel,
.landing-info-grid,
.landing-about {
    position: relative;
    z-index: 10;
}

.landing-hero,
.landing-feature-panel,
.landing-info-grid,
.landing-about {
    width: min(1508px, calc(100vw - 92px));
}

.landing-hero {
    min-height: clamp(430px, 47vh, 560px);
    padding-top: clamp(26px, 4.6vw, 58px);
    padding-bottom: 14px;
}

.landing-actions {
    gap: clamp(42px, 3.8vw, 68px);
}

.landing-statusbar {
    width: min(1780px, calc(100vw - 26px));
}

@keyframes landingCloudLoop {
    0% { background-position: 0 0; opacity: 0.27; }
    50% { opacity: 0.34; }
    100% { background-position: -3344px 0; opacity: 0.27; }
}

@keyframes landingSmokeLoop {
    0%, 100% { transform: translate3d(-0.4vw, 1.2vh, 0) scale(1.03); opacity: 0.125; filter: blur(0px) brightness(0.95); }
    45% { transform: translate3d(0.55vw, -0.7vh, 0) scale(1.055); opacity: 0.19; filter: blur(0.5px) brightness(1.05); }
    70% { transform: translate3d(0.25vw, -1.15vh, 0) scale(1.045); opacity: 0.155; filter: blur(0.25px) brightness(1.00); }
}

@keyframes landingEmberLoop {
    0% { transform: translate3d(0, 1.4vh, 0); background-position: 0 0, 43vw 20vh; opacity: 0.46; }
    50% { opacity: 0.70; }
    100% { transform: translate3d(0.4vw, -2.8vh, 0); background-position: 0 -260px, 43vw -120px; opacity: 0.46; }
}

@keyframes landingFireFlicker {
    0%, 100% { opacity: 0.62; filter: brightness(0.92) saturate(1.02); }
    16% { opacity: 0.86; filter: brightness(1.18) saturate(1.22); }
    31% { opacity: 0.68; filter: brightness(0.98) saturate(1.08); }
    47% { opacity: 0.94; filter: brightness(1.25) saturate(1.30); }
    66% { opacity: 0.72; filter: brightness(1.03) saturate(1.12); }
    83% { opacity: 0.88; filter: brightness(1.16) saturate(1.24); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-scene__clouds,
    .landing-scene__smoke,
    .landing-scene__embers,
    .landing-scene__fireglow {
        animation: none !important;
    }
}

@media (max-width: 1480px) {
    .landing-hero,
    .landing-feature-panel,
    .landing-info-grid,
    .landing-about {
        width: min(1280px, calc(100vw - 52px));
    }
}

@media (max-width: 1340px) {
    .landing-loop { justify-self: center; }
    .landing-scene__edges { opacity: 0.16; }
}

@media (max-width: 860px) {
    .landing-page .page { padding-bottom: 170px; }
    .topbar-landing { width: min(100vw - 16px, 760px); }
    .landing-hero,
    .landing-feature-panel,
    .landing-info-grid,
    .landing-about {
        width: min(100vw - 18px, 760px);
    }
    .landing-scene__edges { display: none; }
    .landing-scene__clouds { opacity: 0.20; animation: none; }
    .landing-scene__smoke { opacity: 0.10; }
    .landing-scene__embers { opacity: 0.35; }
    .landing-statusbar { width: min(100vw - 16px, 760px); }
}

/* Final Fix: Landing bleibt eine feste Concept-Höhe, Navigation springt nicht nach unten */
body.landing-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.landing-page .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.landing-page .page {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 0 0 86px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.topbar-landing {
    flex: 0 0 auto;
}

.landing-home {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    justify-content: center;
    padding: clamp(4px, 0.8vh, 10px) 0 clamp(6px, 1vh, 12px);
}

.landing-hero {
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.66fr);
    gap: clamp(36px, 4.2vw, 76px);
    min-height: 0;
    padding-top: clamp(6px, 1.2vh, 18px);
    padding-bottom: clamp(4px, 0.8vh, 10px);
}

.landing-hero__copy {
    padding-top: 0;
}

.landing-eyebrow {
    margin-bottom: clamp(7px, 0.9vh, 12px);
}

.landing-title {
    margin-bottom: clamp(10px, 1.2vh, 18px);
}

.landing-title span {
    font-size: clamp(4.6rem, min(9.2vw, 14.5vh), 9.8rem);
}

.landing-title small {
    font-size: clamp(2.3rem, min(4.35vw, 7.1vh), 4.6rem);
}

.landing-lead {
    margin-bottom: clamp(18px, 2.3vh, 30px);
    font-size: clamp(1.05rem, min(1.32vw, 2.2vh), 1.42rem);
}

.landing-actions {
    gap: clamp(38px, 3.6vw, 64px);
}

.landing-btn {
    min-height: clamp(58px, 7.2vh, 72px);
    min-width: clamp(260px, 16.5vw, 320px);
}

.landing-loop {
    max-width: 500px;
    padding: clamp(18px, 2.4vh, 24px) clamp(22px, 1.8vw, 28px);
}

.landing-loop-list li {
    min-height: clamp(50px, 6.25vh, 64px);
    font-size: clamp(0.93rem, min(1.12vw, 1.9vh), 1.22rem);
}

.landing-feature-panel {
    flex: 0 0 auto;
    margin: clamp(6px, 1vh, 14px) auto 0;
    padding: clamp(14px, 1.8vh, 21px) clamp(18px, 1.6vw, 26px);
}

.landing-feature-card {
    min-height: clamp(118px, 15vh, 156px);
    padding-left: clamp(11px, 1vw, 20px);
    padding-right: clamp(11px, 1vw, 20px);
}

.landing-feature-card img {
    width: clamp(48px, 3.4vw, 66px);
    height: clamp(42px, 3vw, 58px);
    margin-bottom: clamp(4px, 0.7vh, 8px);
}

.landing-feature-card p,
.landing-feature-intro p {
    font-size: clamp(0.84rem, min(0.95vw, 1.65vh), 1.04rem);
}

/* Die Zusatzboxen waren der Grund, warum Ankerlinks nach unten springen konnten. */
.landing-info-grid,
.landing-about {
    display: none;
}

.landing-statusbar {
    min-height: clamp(52px, 6.8vh, 68px);
    bottom: 8px;
}

@media (max-height: 790px) and (min-width: 861px) {
    .topbar-landing {
        min-height: 82px;
        margin-top: 6px;
    }

    .brand-logo-img {
        width: clamp(120px, 7.8vw, 148px);
    }

    .topnav-landing a:not(.btn) {
        padding-top: 22px;
        padding-bottom: 21px;
    }

    .topnav-landing a:not(.btn).is-active::after,
    .topnav-landing a:not(.btn):hover::after {
        bottom: 13px;
    }

    .topnav-landing .landing-login-btn {
        min-height: 42px;
    }

    .landing-page .page {
        padding-bottom: 70px;
    }

    .landing-title span {
        font-size: clamp(4.35rem, min(8.3vw, 13vh), 8.9rem);
    }

    .landing-title small {
        font-size: clamp(2.15rem, min(4vw, 6.2vh), 4.1rem);
    }

    .landing-loop-list li {
        min-height: 48px;
    }

    .landing-feature-panel {
        grid-template-columns: 220px 1fr;
    }

    .landing-feature-card {
        min-height: 112px;
    }

    .landing-feature-card img {
        width: 48px;
        height: 42px;
    }
}

@media (max-width: 1340px) {
    body.landing-page {
        overflow-y: auto;
    }

    .landing-page .app-shell,
    .landing-page .page,
    .landing-home {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .landing-page .page {
        display: block;
        padding-bottom: 154px;
    }

    .landing-info-grid,
    .landing-about {
        display: grid;
    }

    .landing-about {
        display: block;
    }
}

/* =========================================================
   Wasteland start menu + hero select
   ========================================================= */
body.wasteland-page-shell {
    background:
        linear-gradient(180deg, rgba(6, 8, 11, 0.96), rgba(9, 11, 15, 0.94)),
        #090b0f;
    color: #f0e6d8;
    font-family: "Share Tech Mono", monospace;
}

.app-shell-wasteland {
    width: min(1760px, calc(100% - 24px));
    margin: 0 auto;
}

.page-wasteland {
    padding: 8px 0 26px;
}

.topbar-wasteland {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 16px;
    min-height: 84px;
    border: 1px solid rgba(214, 143, 58, 0.25);
    background:
        linear-gradient(180deg, rgba(10, 13, 17, 0.95), rgba(10, 13, 17, 0.78)),
        #0a0d11;
}

.brand-wasteland {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f7efe1;
}

.brand-logo-img {
    width: 104px;
    height: auto;
    display: block;
}

.topnav-wasteland {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topnav-wasteland a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: rgba(237, 230, 214, 0.78);
    font-weight: 700;
    border-radius: 12px;
    transition: color 140ms ease, transform 140ms ease;
}

.topnav-wasteland a:hover,
.topnav-wasteland a.is-active {
    color: #f79b23;
}

.topnav-wasteland a.is-active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(247,147,30,0.4), #f79b23, rgba(247,147,30,0.35));
    box-shadow: 0 0 16px rgba(247,147,30,0.4);
}

.topbar-wasteland__actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.wasteland-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
    padding: 8px 14px 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.28);
    color: #f1e7d7;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.wasteland-user-pill__avatar {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid rgba(247,147,30,0.28);
    background: rgba(255,255,255,0.04);
}

.wasteland-user-pill__avatar--fallback {
    display: inline-grid;
    place-items: center;
    font-size: 1.05rem;
    color: #f79b23;
}

.wasteland-user-pill__name {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 1.02rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-user-pill:hover {
    color: #f79b23;
    border-color: rgba(247,147,30,0.36);
}

.wasteland-view {
    position: relative;
    min-height: calc(100vh - 130px);
    padding: 26px 18px 0;
    overflow: hidden;
}

.wasteland-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.wasteland-scene__bg,
.wasteland-scene__clouds,
.wasteland-scene__smoke,
.wasteland-scene__embers,
.wasteland-scene__edges {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}

.wasteland-scene__bg {
    background-image:
        linear-gradient(180deg, rgba(4,5,8,0.28) 0%, rgba(5,5,7,0.32) 30%, rgba(5,5,7,0.64) 100%),
        url('../img/landing/bg_wasteland_hero.webp');
    opacity: 0.96;
    transform: scale(1.01);
}

.wasteland-scene__clouds {
    background-image: url('../img/landing/bg_clouds_loop.webp');
    opacity: 0.18;
    mix-blend-mode: screen;
    animation: wastelandClouds 44s linear infinite;
}

.wasteland-scene__smoke {
    background-image: url('../img/landing/bg_smoke_loop.webp');
    opacity: 0.16;
    mix-blend-mode: screen;
    animation: wastelandSmoke 26s linear infinite;
}

.wasteland-scene__embers {
    background-image: url('../img/landing/bg_embers_loop.webp');
    opacity: 0.26;
    background-size: contain;
    animation: wastelandEmbers 18s linear infinite;
}

.wasteland-scene__edges {
    background-image: url('../img/landing/decor_foreground_edges.webp');
    background-size: 100% 100%;
    background-position: center center;
    opacity: 0.96;
}

@keyframes wastelandClouds {
    0% { transform: translateX(-3%) translateY(0); }
    50% { transform: translateX(3%) translateY(1%); }
    100% { transform: translateX(-3%) translateY(0); }
}

@keyframes wastelandSmoke {
    0% { transform: translate3d(-2%, 0.5%, 0); }
    50% { transform: translate3d(2%, -0.5%, 0); }
    100% { transform: translate3d(-2%, 0.5%, 0); }
}

@keyframes wastelandEmbers {
    0% { transform: translateY(0); opacity: 0.22; }
    50% { transform: translateY(-1.5%); opacity: 0.32; }
    100% { transform: translateY(0); opacity: 0.22; }
}

.wasteland-intro,
.wasteland-action-grid,
.wasteland-dashboard-grid,
.wasteland-hero-grid,
.wasteland-bottom-strip {
    position: relative;
    z-index: 1;
}

.wasteland-intro {
    max-width: 720px;
    margin: 8px 0 24px 70px;
}

.wasteland-intro--compact {
    max-width: 900px;
    margin-bottom: 18px;
}

.wasteland-eyebrow {
    margin: 0 0 10px;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1.18rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wasteland-title {
    margin: 0 0 10px;
    font-family: "Pixelify Sans", sans-serif;
    color: #eadcc7;
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 0.88;
    text-transform: uppercase;
    text-shadow: 0 3px 0 rgba(0,0,0,0.55), 0 10px 30px rgba(0,0,0,0.35);
}

.wasteland-title--heroes {
    font-size: clamp(3.2rem, 6vw, 5.7rem);
}

.wasteland-subtitle {
    margin: 0;
    max-width: 760px;
    color: rgba(237,230,214,0.92);
    font-size: 1.2rem;
    line-height: 1.45;
}

.wasteland-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 22px;
}

.wasteland-action-card {
    position: relative;
    min-height: 220px;
    padding: 28px 28px 26px;
    background: linear-gradient(180deg, rgba(11,13,18,0.95), rgba(8,9,14,0.92));
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: flex-start;
    overflow: hidden;
}

.wasteland-action-card::before,
.wasteland-run-panel::before,
.wasteland-side-card::before,
.wasteland-hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 20px rgba(255,255,255,0.02);
}

.wasteland-action-card--primary {
    background: radial-gradient(circle at 20% 20%, rgba(247,147,30,0.18), transparent 46%), linear-gradient(180deg, rgba(58,30,8,0.95), rgba(22,13,8,0.94));
    border-color: rgba(247,147,30,0.42);
    box-shadow: 0 24px 48px rgba(0,0,0,0.28), 0 0 35px rgba(247,147,30,0.14);
}

.wasteland-action-card.is-locked {
    opacity: 0.78;
}

.wasteland-action-card__icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: #d6912e;
    border-radius: 10px;
    border: 1px solid rgba(247,147,30,0.26);
    background: rgba(255,255,255,0.02);
}

.wasteland-action-card__icon--portrait {
    overflow: hidden;
    padding: 0;
}

.wasteland-action-card__icon--portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.wasteland-action-card strong {
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    font-size: 1.45rem;
    color: #f3e9da;
}

.wasteland-action-card small {
    color: rgba(237,230,214,0.78);
    line-height: 1.45;
    font-size: 1rem;
}

.wasteland-action-card__arrow {
    margin-top: auto;
    align-self: flex-end;
    color: #d6912e;
    font-size: 1.55rem;
}

.wasteland-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(360px, 0.95fr);
    gap: 18px;
    align-items: start;
}

.wasteland-run-panel,
.wasteland-side-card,
.wasteland-hero-card {
    position: relative;
    background: linear-gradient(180deg, rgba(11,13,18,0.95), rgba(8,9,14,0.92));
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.28);
}

.wasteland-panel-heading h2,
.wasteland-side-card h3,
.wasteland-hero-card h2 {
    margin: 0;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wasteland-panel-heading {
    margin-bottom: 14px;
}

.wasteland-run-overview {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wasteland-run-hero {
    display: flex;
    gap: 18px;
    align-items: center;
    min-width: 0;
}

.wasteland-run-hero__portrait {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(247,147,30,0.18);
}

.wasteland-run-hero__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.wasteland-run-hero__meta {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.wasteland-run-hero__name {
    font-family: "Pixelify Sans", sans-serif;
    font-size: 2rem;
    text-transform: uppercase;
    color: #f79b23;
}

.wasteland-run-hero__level {
    font-size: 1rem;
    color: rgba(237,230,214,0.88);
}

.wasteland-progress {
    display: grid;
    gap: 6px;
    max-width: 270px;
}

.wasteland-progress__bar {
    display: block;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.wasteland-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f1731b, #f79b23);
    box-shadow: 0 0 14px rgba(247,147,30,0.38);
}

.wasteland-progress__label {
    color: rgba(237,230,214,0.72);
    font-size: 0.96rem;
}

.wasteland-run-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 16px;
    flex: 1 1 auto;
}

.wasteland-run-stats div {
    display: grid;
    gap: 8px;
    padding-left: 18px;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.wasteland-run-stats span {
    color: rgba(237,230,214,0.76);
    font-size: 0.98rem;
    text-transform: uppercase;
}

.wasteland-run-stats strong {
    font-size: 1.8rem;
    color: #f2e7d7;
    font-family: "Pixelify Sans", sans-serif;
    letter-spacing: 0.03em;
}

.wasteland-run-footer {
    margin-top: 18px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.wasteland-lives-block {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.wasteland-lives-block__label {
    font-size: 1.12rem;
    color: #f0e6d8;
    text-transform: uppercase;
}

.wasteland-lives-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wasteland-life-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.wasteland-life-icon.is-filled {
    color: #ffb45d;
    background: radial-gradient(circle at 50% 35%, rgba(255,178,89,0.36), rgba(76,27,4,0.9));
    border-color: rgba(247,147,30,0.34);
    box-shadow: 0 0 14px rgba(247,147,30,0.18);
}

.wasteland-danger-btn,
.wasteland-primary-btn,
.wasteland-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 22px;
    border-radius: 6px;
    border: 1px solid rgba(247,147,30,0.35);
    background: linear-gradient(180deg, rgba(59,32,9,0.94), rgba(28,16,9,0.96));
    color: #f79b23;
    cursor: pointer;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.wasteland-danger-btn {
    border-color: rgba(241,104,37,0.35);
    color: #ff7a2a;
}

.wasteland-primary-btn:hover,
.wasteland-danger-btn:hover,
.wasteland-hero-btn:hover {
    transform: translateY(-1px);
}

.wasteland-empty-run {
    display: flex;
    align-items: center;
    gap: 22px;
}

.wasteland-empty-run img {
    width: 150px;
    height: 180px;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    border: 1px solid rgba(247,147,30,0.18);
}

.wasteland-empty-run strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.35rem;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
}

.wasteland-empty-run p,
.wasteland-side-card p,
.wasteland-hero-card__copy p,
.wasteland-passive-box p,
.wasteland-synergy-line {
    margin: 0;
    color: rgba(237,230,214,0.84);
    line-height: 1.45;
}

.wasteland-side-panels {
    display: grid;
    gap: 14px;
}

.wasteland-side-card {
    padding: 18px 18px 20px;
    min-height: 120px;
}

.wasteland-side-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #f79b23;
}

.wasteland-round-badge {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #f0e6d8;
    font-weight: 700;
}

.wasteland-class-coin {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #d2912b;
    font-size: 2rem;
    border: 2px solid rgba(210,145,43,0.42);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 0 18px rgba(210,145,43,0.18);
}

.wasteland-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 8px;
}

.wasteland-hero-card {
    padding: 18px 18px 16px;
    overflow: hidden;
}

.wasteland-hero-card__crest {
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 2.3rem;
    opacity: 0.18;
}

.wasteland-hero-card__top {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: start;
}

.wasteland-hero-card__portrait {
    height: 210px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.wasteland-hero-card__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.wasteland-hero-card__copy {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.wasteland-hero-card h2 {
    font-size: 2rem;
}

.wasteland-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 14px;
}

.wasteland-stat-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.18);
    font-size: 0.95rem;
    color: #ede6d6;
}

.wasteland-passive-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.wasteland-passive-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.18);
    color: #f0e6d8;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.wasteland-passive-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.wasteland-synergy-line {
    margin: 14px 0 12px;
    font-weight: 700;
}

.wasteland-hero-form {
    margin-top: auto;
}

.wasteland-hero-btn {
    width: 100%;
}

.theme-orange .wasteland-hero-card__copy h2,
.theme-orange .wasteland-synergy-line,
.theme-orange .wasteland-side-card__header,
.theme-orange .wasteland-hero-card__crest { color: #f79b23; }
.theme-orange .wasteland-hero-btn { color: #f79b23; border-color: rgba(247,147,30,0.35); }

.theme-green .wasteland-hero-card__copy h2,
.theme-green .wasteland-synergy-line,
.theme-green .wasteland-hero-card__crest { color: #9aca67; }
.theme-green .wasteland-hero-btn { color: #9aca67; border-color: rgba(154,202,103,0.35); background: linear-gradient(180deg, rgba(24,43,16,0.92), rgba(13,24,11,0.96)); }

.theme-purple .wasteland-hero-card__copy h2,
.theme-purple .wasteland-synergy-line,
.theme-purple .wasteland-hero-card__crest { color: #ae6dff; }
.theme-purple .wasteland-hero-btn { color: #c69bff; border-color: rgba(174,109,255,0.35); background: linear-gradient(180deg, rgba(37,18,54,0.92), rgba(20,11,31,0.96)); }

.theme-blue .wasteland-hero-card__copy h2,
.theme-blue .wasteland-synergy-line,
.theme-blue .wasteland-hero-card__crest { color: #65a9ff; }
.theme-blue .wasteland-hero-btn { color: #8fbfff; border-color: rgba(101,169,255,0.35); background: linear-gradient(180deg, rgba(17,34,56,0.92), rgba(11,19,30,0.96)); }

.theme-gold .wasteland-hero-card__copy h2,
.theme-gold .wasteland-synergy-line,
.theme-gold .wasteland-hero-card__crest { color: #c9c34b; }
.theme-gold .wasteland-hero-btn { color: #d8d26b; border-color: rgba(201,195,75,0.35); background: linear-gradient(180deg, rgba(45,43,18,0.92), rgba(24,23,11,0.96)); }

.wasteland-bottom-strip {
    margin-top: 18px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

@media (max-width: 1440px) {
    .wasteland-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wasteland-dashboard-grid { grid-template-columns: 1fr; }
    .wasteland-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .topbar-wasteland {
        flex-wrap: wrap;
        justify-content: center;
    }
    .wasteland-intro { margin-left: 0; }
    .wasteland-run-overview { flex-direction: column; }
    .wasteland-run-stats { width: 100%; }
    .wasteland-hero-card__top { grid-template-columns: 1fr; }
    .wasteland-hero-card__portrait { height: 230px; }
}

@media (max-width: 760px) {
    .app-shell-wasteland { width: calc(100% - 10px); }
    .page-wasteland { padding-top: 6px; }
    .wasteland-view { padding: 18px 10px 0; }
    .brand-logo-img { width: 86px; }
    .topnav-wasteland { flex-wrap: wrap; justify-content: center; }
    .topnav-wasteland a { padding: 10px 12px; }
    .wasteland-user-pill { min-width: 0; width: 100%; }
    .wasteland-action-grid,
    .wasteland-hero-grid { grid-template-columns: 1fr; }
    .wasteland-run-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wasteland-run-stats div { padding-left: 12px; }
    .wasteland-run-footer { flex-direction: column; align-items: stretch; }
    .wasteland-lives-block { justify-content: center; }
    .wasteland-empty-run { flex-direction: column; text-align: center; }
    .wasteland-title { font-size: clamp(3rem, 14vw, 4.6rem); }
    .wasteland-title--heroes { font-size: clamp(2.6rem, 12vw, 4rem); }
}

/* =========================================================
   Wasteland follow-up fixes
   ========================================================= */
.wasteland-view {
    min-height: calc(100vh - 106px);
    display: flex;
    flex-direction: column;
}

.wasteland-scene {
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
}

.wasteland-scene__bg {
    transform: none;
    background-position: center top;
}

.wasteland-scene__edges {
    opacity: 0.42;
}

.wasteland-startmenu .wasteland-dashboard-grid,
.wasteland-hero-select .wasteland-hero-grid {
    flex: 1 1 auto;
}

.wasteland-bottom-strip {
    margin-top: auto;
    width: 100%;
}

.wasteland-hero-select {
    gap: 10px;
}

.wasteland-hero-select .wasteland-intro {
    margin-bottom: 12px;
}

.wasteland-hero-select .wasteland-hero-grid {
    gap: 14px;
}

.wasteland-hero-select .wasteland-hero-card {
    padding: 14px 14px 12px;
}

.wasteland-hero-select .wasteland-hero-card__top {
    grid-template-columns: 132px 1fr;
    gap: 14px;
}

.wasteland-hero-select .wasteland-hero-card__portrait {
    height: 170px;
}

.wasteland-hero-select .wasteland-hero-card h2 {
    font-size: 1.72rem;
    line-height: 0.95;
}

.wasteland-hero-select .wasteland-hero-card__copy {
    gap: 7px;
}

.wasteland-hero-select .wasteland-hero-card__copy p,
.wasteland-hero-select .wasteland-passive-box p,
.wasteland-hero-select .wasteland-synergy-line {
    font-size: 0.92rem;
    line-height: 1.32;
}

.wasteland-hero-select .wasteland-stat-row {
    gap: 6px;
    margin: 10px 0;
}

.wasteland-hero-select .wasteland-stat-row span {
    padding: 5px 8px;
    font-size: 0.82rem;
}

.wasteland-hero-select .wasteland-passive-box {
    padding: 10px 12px;
    gap: 10px;
}

.wasteland-hero-select .wasteland-passive-badge {
    min-width: 70px;
    height: 30px;
    font-size: 0.82rem;
}

.wasteland-hero-select .wasteland-passive-box strong {
    font-size: 1.02rem;
    margin-bottom: 3px;
}

.wasteland-hero-select .wasteland-synergy-line {
    margin: 10px 0 8px;
}

.wasteland-hero-select .wasteland-hero-btn {
    min-height: 44px;
    font-size: 0.98rem;
}

.wasteland-startmenu .wasteland-action-grid {
    margin-bottom: 16px;
}

.wasteland-startmenu .wasteland-run-panel,
.wasteland-startmenu .wasteland-side-card {
    backdrop-filter: none;
}

@media (max-width: 1600px) {
    .wasteland-hero-select .wasteland-hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .wasteland-scene {
        width: 100%;
        left: 0;
        transform: none;
    }
    .wasteland-hero-select .wasteland-hero-card__top {
        grid-template-columns: 1fr;
    }
    .wasteland-hero-select .wasteland-hero-card__portrait {
        height: 210px;
    }
}

/* =========================================================
   Fullscreen wasteland background
   ========================================================= */
body.wasteland-page-shell {
    position: relative;
    overflow-x: hidden;
}

body.wasteland-page-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -20;
    background:
        linear-gradient(180deg, rgba(4,5,8,0.40) 0%, rgba(5,5,7,0.32) 28%, rgba(5,5,7,0.62) 100%),
        url('../img/landing/bg_wasteland_hero.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}

body.wasteland-page-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -19;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 70%, rgba(247,147,30,0.12), transparent 28%),
        linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.22));
}

.wasteland-scene__bg {
    background-image: none;
}

/* =========================================================
   Wasteland action hover polish
   ========================================================= */
.wasteland-action-card {
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.wasteland-action-card:hover {
    transform: translateY(-2px);
    background: radial-gradient(circle at 20% 20%, rgba(247,147,30,0.18), transparent 46%), linear-gradient(180deg, rgba(58,30,8,0.95), rgba(22,13,8,0.94));
    border-color: rgba(247,147,30,0.42);
    box-shadow: 0 24px 48px rgba(0,0,0,0.28), 0 0 35px rgba(247,147,30,0.14);
}

.wasteland-action-card:hover .wasteland-action-card__icon,
.wasteland-action-card:hover .wasteland-action-card__arrow,
.wasteland-action-card:hover strong {
    color: #f79b23;
    border-color: rgba(247,147,30,0.34);
}

.wasteland-action-card:hover small {
    color: rgba(247, 232, 210, 0.88);
}

/* =========================================================
   Unified style pass: landing + start menu + hero select
   ========================================================= */
.topbar-wasteland {
    min-height: 104px;
    margin-top: 8px;
    padding: 0 32px 0 34px;
    gap: clamp(18px, 2.2vw, 38px);
    border: 0;
    border-radius: 0;
    background: url('../img/landing/panel_header_strip.webp') center / 100% 100% no-repeat;
    top: 8px;
    overflow: visible;
}

.brand-wasteland {
    position: relative;
    z-index: 2;
    min-width: clamp(420px, 30vw, 530px);
    gap: 22px;
    color: #f1e9dc;
    text-shadow: 0 2px 0 rgba(0,0,0,0.8);
}

.topnav-wasteland {
    position: relative;
    z-index: 2;
    flex: 1;
    justify-content: center;
    gap: clamp(13px, 1.1vw, 22px);
}

.topnav-wasteland a {
    position: relative;
    padding: 30px 2px 27px;
    border-radius: 0;
    color: rgba(232,222,209,0.78);
    font-size: clamp(0.94rem, 1.02vw, 1.16rem);
    letter-spacing: 0.02em;
    background: transparent;
    white-space: nowrap;
}

.topnav-wasteland a:hover,
.topnav-wasteland a.is-active {
    color: #f0a642;
    background: transparent;
}

.topnav-wasteland a.is-active::after,
.topnav-wasteland a:hover::after {
    content: "";
    position: absolute;
    left: -7px;
    right: -7px;
    bottom: 19px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #f7931e, transparent);
    box-shadow: 0 0 14px rgba(247,147,30,0.64);
}

.topbar-wasteland__actions {
    position: relative;
    z-index: 2;
}

.wasteland-user-pill {
    border-radius: 0;
    border: 1px solid rgba(247,147,30,0.28);
    background: linear-gradient(180deg, rgba(21,20,18,0.78), rgba(9,8,8,0.90));
    box-shadow: inset 0 0 0 2px rgba(247,147,30,0.08), 0 0 18px rgba(0,0,0,0.2);
}

.wasteland-action-card,
.wasteland-run-panel,
.wasteland-side-card,
.wasteland-hero-card {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.07), transparent 21rem),
        linear-gradient(135deg, rgba(21,24,26,0.94), rgba(7,8,9,0.92));
    box-shadow:
        inset 0 0 0 2px rgba(0,0,0,0.55),
        inset 0 0 0 3px rgba(255,255,255,0.026),
        0 25px 70px rgba(0,0,0,0.42);
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}

.wasteland-action-card::before,
.wasteland-run-panel::before,
.wasteland-side-card::before,
.wasteland-hero-card::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(255,255,255,0.06);
    border-top-color: rgba(255,255,255,0.14);
    border-bottom-color: rgba(247,147,30,0.18);
    clip-path: inherit;
    box-shadow: none;
}

.wasteland-action-card::after,
.wasteland-run-panel::after,
.wasteland-side-card::after,
.wasteland-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.32;
    background:
        repeating-linear-gradient(90deg, transparent 0 36px, rgba(255,255,255,0.025) 36px 37px),
        repeating-linear-gradient(0deg, transparent 0 19px, rgba(255,255,255,0.018) 19px 20px);
}

.wasteland-action-card > *,
.wasteland-run-panel > *,
.wasteland-side-card > *,
.wasteland-hero-card > * {
    position: relative;
    z-index: 1;
}

.wasteland-action-card--primary,
.wasteland-action-card:hover {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.14), transparent 21rem),
        linear-gradient(135deg, rgba(52,30,14,0.96), rgba(18,11,8,0.94));
}

.wasteland-action-card strong,
.wasteland-panel-heading h2,
.wasteland-side-card h3,
.wasteland-hero-card h2,
.wasteland-run-hero__name {
    text-shadow: 0 0 14px rgba(247,147,30,0.16);
}

.wasteland-panel-heading h2,
.wasteland-side-card h3 {
    color: #f0a642;
}

.wasteland-intro {
    margin-top: 18px;
}

.wasteland-eyebrow {
    color: #f0a642;
    text-shadow: 0 0 14px rgba(247,147,30,0.18);
}

.wasteland-title {
    color: #eadcc7;
}

.wasteland-subtitle,
.wasteland-action-card small,
.wasteland-empty-run p,
.wasteland-side-card p,
.wasteland-hero-card__copy p,
.wasteland-passive-box p,
.wasteland-synergy-line,
.wasteland-progress__label,
.wasteland-run-stats span {
    color: rgba(232,222,209,0.82);
}

.wasteland-passive-box,
.wasteland-stat-row span,
.wasteland-round-badge,
.wasteland-user-pill {
    background: rgba(0,0,0,0.22);
}

.wasteland-bottom-strip {
    width: min(1760px, calc(100vw - 22px));
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 1340px) {
    .topbar-wasteland {
        align-items: center;
        min-height: auto;
        padding: 16px 22px 18px;
        flex-wrap: wrap;
    }
    .brand-wasteland { min-width: 280px; }
    .topnav-wasteland { justify-content: center; gap: 12px; }
    .topnav-wasteland a { padding-top: 12px; padding-bottom: 10px; }
    .topnav-wasteland a.is-active::after,
    .topnav-wasteland a:hover::after { bottom: 3px; }
}

@media (max-width: 860px) {
    .topbar-wasteland {
        position: relative;
        top: 0;
        flex-direction: column;
        background-size: cover;
    }
    .brand-wasteland {
        min-width: 0;
        width: 100%;
        justify-content: center;
    }
    .topnav-wasteland {
        justify-content: center;
        width: 100%;
        gap: 10px;
    }
    .topnav-wasteland a {
        font-size: 0.98rem;
        padding: 8px 4px;
    }
}

/* =========================================================
   Clean rework: identical landing background on start menu + classes
   ========================================================= */
body.wasteland-page-shell::before {
    background: url('../img/landing/bg_wasteland_hero.webp') center center / cover no-repeat;
    opacity: 1;
}

body.wasteland-page-shell::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.18));
}

.page-wasteland,
.wasteland-view {
    overflow: visible;
}

.wasteland-view {
    padding-bottom: 20px;
}

.wasteland-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    left: 0;
    width: 100%;
    transform: none;
}

.wasteland-scene__bg {
    display: none;
}

.wasteland-scene__edges {
    z-index: 1;
    background-image: url('../img/landing/decor_foreground_edges.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.20;
}

.wasteland-scene__clouds {
    z-index: 2;
    inset: -4vh -8vw auto -8vw;
    height: min(74vh, 820px);
    background-image: url('../img/landing/bg_clouds_loop.webp');
    background-position: center top;
    background-size: cover;
    opacity: 0.20;
    mix-blend-mode: screen;
    animation: landingClouds 40s linear infinite;
}

.wasteland-scene__smoke {
    z-index: 3;
    inset: auto -4vw -4vh -4vw;
    height: min(72vh, 760px);
    background-image: url('../img/landing/bg_smoke_loop.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.13;
    mix-blend-mode: screen;
    animation: landingSmoke 24s linear infinite;
}

.wasteland-scene__embers {
    z-index: 4;
    inset: -2vh -2vw;
    background-image: url('../img/landing/bg_embers_loop.webp'), url('../img/landing/bg_embers_loop.webp');
    background-position: 0 0, 43vw 20vh;
    background-size: 52vw auto, 52vw auto;
    background-repeat: repeat;
    opacity: 0.28;
    animation: landingEmbers 14s linear infinite;
}

.wasteland-bottom-strip {
    margin-top: 18px;
    position: relative;
    width: min(1760px, calc(100vw - 22px));
    left: 50%;
    transform: translateX(-50%);
}

/* Klassen-Seite: alles auswählbar, nichts abschneiden */
.wasteland-hero-select {
    min-height: auto;
}

.wasteland-hero-select .wasteland-hero-grid {
    margin-bottom: 12px;
    align-items: start;
}

.wasteland-hero-select .wasteland-hero-card {
    min-height: 0;
    padding: 12px 12px 10px;
}

.wasteland-hero-select .wasteland-hero-card__top {
    grid-template-columns: 112px 1fr;
    gap: 12px;
}

.wasteland-hero-select .wasteland-hero-card__portrait {
    height: 138px;
}

.wasteland-hero-select .wasteland-hero-card h2 {
    font-size: 1.35rem;
}

.wasteland-hero-select .wasteland-hero-card__copy p,
.wasteland-hero-select .wasteland-passive-box p,
.wasteland-hero-select .wasteland-synergy-line {
    font-size: 0.84rem;
    line-height: 1.24;
}

.wasteland-hero-select .wasteland-stat-row {
    margin: 8px 0;
    gap: 5px;
}

.wasteland-hero-select .wasteland-stat-row span {
    padding: 4px 7px;
    font-size: 0.74rem;
}

.wasteland-hero-select .wasteland-passive-box {
    padding: 8px 10px;
    gap: 8px;
}

.wasteland-hero-select .wasteland-passive-badge {
    min-width: 62px;
    height: 26px;
    font-size: 0.74rem;
}

.wasteland-hero-select .wasteland-passive-box strong {
    font-size: 0.92rem;
}

.wasteland-hero-select .wasteland-synergy-line {
    margin: 8px 0 7px;
}

.wasteland-hero-select .wasteland-hero-btn {
    min-height: 38px;
    font-size: 0.86rem;
    padding: 0 10px;
}

/* störende Card-Crest-Icons entfernen */
.wasteland-hero-card__crest,
.theme-green .wasteland-hero-card__crest {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .wasteland-scene__clouds,
    .wasteland-scene__smoke,
    .wasteland-scene__embers {
        animation: none !important;
    }
}

@media (max-width: 1600px) {
    .wasteland-hero-select .wasteland-hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .wasteland-scene__edges { display: none; }
    .wasteland-scene__clouds { opacity: 0.20; animation: none; }
    .wasteland-scene__smoke { opacity: 0.10; }
    .wasteland-scene__embers { opacity: 0.35; }
    .wasteland-hero-select .wasteland-hero-grid {
        grid-template-columns: 1fr;
    }
    .wasteland-hero-select .wasteland-hero-card__top {
        grid-template-columns: 1fr;
    }
    .wasteland-hero-select .wasteland-hero-card__portrait {
        height: 190px;
    }
}

/* =========================================================
   Final background fix: use the same animated landing scene on wasteland pages
   ========================================================= */
body.wasteland-page-shell {
    background: #050608 url('../img/landing/bg_wasteland_hero.webp') center center / cover fixed no-repeat !important;
}

body.wasteland-page-shell::before,
body.wasteland-page-shell::after {
    display: none !important;
}

.wasteland-view {
    isolation: isolate;
}

.wasteland-scene {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0 !important;
    transform: none !important;
    pointer-events: none;
    overflow: hidden;
}

.wasteland-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    background:
        radial-gradient(circle at 50% 44%, rgba(247,147,30,0.12), transparent 28%),
        linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.25));
    pointer-events: none;
}

.wasteland-scene__bg {
    display: block !important;
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../img/landing/bg_wasteland_hero.webp') !important;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    opacity: 1;
}

.wasteland-scene__edges {
    z-index: 1;
    background-image: url('../img/landing/decor_foreground_edges.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.22;
}

.wasteland-scene__clouds {
    z-index: 2;
    inset: -4vh -8vw auto -8vw;
    height: min(74vh, 820px);
    background-image: url('../img/landing/bg_clouds_loop.webp');
    background-position: center top;
    background-size: cover;
    opacity: 0.20;
    mix-blend-mode: screen;
    animation: landingClouds 40s linear infinite;
}

.wasteland-scene__smoke {
    z-index: 3;
    inset: auto -4vw -4vh -4vw;
    height: min(72vh, 760px);
    background-image: url('../img/landing/bg_smoke_loop.webp');
    background-position: center bottom;
    background-size: cover;
    opacity: 0.13;
    mix-blend-mode: screen;
    animation: landingSmoke 24s linear infinite;
}

.wasteland-scene__embers {
    z-index: 4;
    inset: -2vh -2vw;
    background-image: url('../img/landing/bg_embers_loop.webp'), url('../img/landing/bg_embers_loop.webp');
    background-position: 0 0, 43vw 20vh;
    background-size: 52vw auto, 52vw auto;
    background-repeat: repeat;
    opacity: 0.30;
    animation: landingEmbers 14s linear infinite;
}

.wasteland-intro,
.wasteland-action-grid,
.wasteland-dashboard-grid,
.wasteland-hero-grid,
.wasteland-bottom-strip {
    position: relative;
    z-index: 2;
}

/* Startmenü: Klassen-Münze entfernen */
.wasteland-startmenu .wasteland-class-coin {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .wasteland-scene__clouds,
    .wasteland-scene__smoke,
    .wasteland-scene__embers {
        animation: none !important;
    }
}

/* =========================================================
   Final polish: landing-equivalent animation + spacing fixes
   ========================================================= */
.wasteland-scene__clouds,
.wasteland-scene__smoke,
.wasteland-scene__embers,
.wasteland-scene__fireglow {
    will-change: transform, opacity, background-position, filter;
}

.wasteland-scene__clouds {
    inset: -4vh -8vw auto -8vw !important;
    height: min(74vh, 820px) !important;
    background-image: url('../img/landing/bg_clouds_loop.webp') !important;
    background-repeat: repeat-x !important;
    background-position: 0 0 !important;
    background-size: 3344px auto !important;
    opacity: 0.30 !important;
    mix-blend-mode: screen;
    animation: landingCloudLoop 110s linear infinite !important;
}

.wasteland-scene__smoke {
    inset: auto -4vw -4vh -4vw !important;
    height: min(72vh, 760px) !important;
    background-image: url('../img/landing/bg_smoke_loop.webp') !important;
    background-position: center bottom !important;
    background-size: cover !important;
    opacity: 0.145 !important;
    mix-blend-mode: screen;
    transform-origin: center bottom;
    animation: landingSmokeLoop 18s ease-in-out infinite !important;
}

.wasteland-scene__embers {
    inset: -2vh -2vw !important;
    background-image: url('../img/landing/bg_embers_loop.webp'), url('../img/landing/bg_embers_loop.webp') !important;
    background-position: 0 0, 43vw 20vh !important;
    background-size: 1672px auto, 1220px auto !important;
    background-repeat: repeat !important;
    opacity: 0.58 !important;
    mix-blend-mode: screen;
    animation: landingEmberLoop 15s linear infinite !important;
}

.wasteland-scene__fireglow {
    position: absolute;
    inset: 0;
    z-index: 5;
    opacity: 0.72;
    mix-blend-mode: screen;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 79%, rgba(255, 132, 20, 0.30), rgba(255, 67, 0, 0.11) 3.2rem, transparent 8rem),
        radial-gradient(circle at 74% 76%, rgba(255, 122, 14, 0.34), rgba(255, 70, 0, 0.13) 4rem, transparent 10rem),
        radial-gradient(circle at 81% 66%, rgba(255, 147, 36, 0.28), rgba(255, 83, 0, 0.10) 3.5rem, transparent 9rem),
        radial-gradient(circle at 57% 82%, rgba(255, 106, 18, 0.20), transparent 7rem);
    animation: landingFireFlicker 3.8s steps(7, end) infinite !important;
}

.wasteland-startmenu .wasteland-run-panel {
    padding: 18px 22px 18px;
}

.wasteland-startmenu .wasteland-panel-heading {
    margin-bottom: 16px;
}

.wasteland-startmenu .wasteland-run-overview {
    padding: 4px 4px 18px;
}

.wasteland-startmenu .wasteland-run-footer {
    padding: 12px 4px 0;
}

.wasteland-startmenu .wasteland-action-card.is-locked {
    opacity: 1;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.07), transparent 21rem),
        linear-gradient(135deg, rgba(21,24,26,0.94), rgba(7,8,9,0.92));
}

.wasteland-startmenu .wasteland-action-card.is-locked:hover {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.14), transparent 21rem),
        linear-gradient(135deg, rgba(52,30,14,0.96), rgba(18,11,8,0.94));
}

.wasteland-startmenu .wasteland-action-card.is-locked small {
    color: rgba(232,222,209,0.76);
}

@media (prefers-reduced-motion: reduce) {
    .wasteland-scene__clouds,
    .wasteland-scene__smoke,
    .wasteland-scene__embers,
    .wasteland-scene__fireglow {
        animation: none !important;
    }
}

/* =========================================================
   Phase: Shared landing chrome + one animated background
   ========================================================= */
body.aib-immersive-page {
    --aib-orange: #f7931e;
    --aib-orange-soft: #ffb04a;
    --aib-text: #e8ded1;
    --aib-muted: #bcb2a6;
    background: #050608;
    color: var(--aib-text);
    font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow: hidden;
    isolation: isolate;
}

body.aib-immersive-page::before,
body.aib-immersive-page::after,
body.landing-page::before,
body.landing-page::after,
body.wasteland-page-shell::before,
body.wasteland-page-shell::after {
    display: none !important;
}

.aib-animated-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #050608;
    contain: layout paint;
}

.aib-animated-background__layer,
.aib-animated-background__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.aib-animated-background__base {
    z-index: 0;
    background: url('../img/landing/bg_wasteland_hero.webp') center center / cover no-repeat;
    filter: brightness(0.9) contrast(1.06);
}

.aib-animated-background__edges {
    z-index: 1;
    background: url('../img/landing/decor_foreground_edges.webp') center bottom / cover no-repeat;
    opacity: 0.26;
    filter: drop-shadow(0 28px 32px rgba(0,0,0,0.62));
}

.aib-animated-background__clouds {
    z-index: 2;
    inset: -4vh -8vw auto -8vw;
    height: min(74vh, 820px);
    background-image: url('../img/landing/bg_clouds_loop.webp');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: 3344px auto;
    opacity: 0.30;
    mix-blend-mode: screen;
    will-change: background-position, opacity;
    animation: landingCloudLoop 110s linear infinite;
}

.aib-animated-background__smoke {
    z-index: 3;
    inset: auto -4vw -4vh -4vw;
    height: min(72vh, 760px);
    background: url('../img/landing/bg_smoke_loop.webp') center bottom / cover no-repeat;
    opacity: 0.145;
    mix-blend-mode: screen;
    transform-origin: center bottom;
    will-change: transform, opacity, filter;
    animation: landingSmokeLoop 18s ease-in-out infinite;
}

.aib-animated-background__embers {
    z-index: 4;
    inset: -2vh -2vw;
    background-image: url('../img/landing/bg_embers_loop.webp'), url('../img/landing/bg_embers_loop.webp');
    background-position: 0 0, 43vw 20vh;
    background-size: 1672px auto, 1220px auto;
    background-repeat: repeat;
    opacity: 0.58;
    mix-blend-mode: screen;
    will-change: transform, background-position, opacity;
    animation: landingEmberLoop 15s linear infinite;
}

.aib-animated-background__fireglow {
    z-index: 5;
    opacity: 0.72;
    mix-blend-mode: screen;
    background:
        radial-gradient(circle at 22% 79%, rgba(255, 132, 20, 0.30), rgba(255, 67, 0, 0.11) 3.2rem, transparent 8rem),
        radial-gradient(circle at 74% 76%, rgba(255, 122, 14, 0.34), rgba(255, 70, 0, 0.13) 4rem, transparent 10rem),
        radial-gradient(circle at 81% 66%, rgba(255, 147, 36, 0.28), rgba(255, 83, 0, 0.10) 3.5rem, transparent 9rem),
        radial-gradient(circle at 57% 82%, rgba(255, 106, 18, 0.20), transparent 7rem);
    will-change: opacity, filter;
    animation: landingFireFlicker 3.8s steps(7, end) infinite;
}

.aib-animated-background__overlay {
    z-index: 8;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.72) 100%),
        radial-gradient(circle at 50% 45%, rgba(255, 107, 18, 0.20), transparent 34rem),
        linear-gradient(90deg, rgba(0, 0, 0, 0.54) 0%, rgba(0, 0, 0, 0.08) 24%, rgba(0, 0, 0, 0.08) 76%, rgba(0, 0, 0, 0.56) 100%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 4px);
}

body.aib-immersive-page .landing-scene,
body.aib-immersive-page .wasteland-scene {
    display: none !important;
}

body.aib-immersive-page .aib-site-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.aib-immersive-page .aib-site-main {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    width: 100%;
    padding: 0 0 86px;
    overflow: hidden;
}

body.aib-immersive-page .aib-site-header {
    flex: 0 0 auto;
    width: min(1780px, calc(100vw - 26px));
    min-height: 96px;
    margin: 8px auto 0;
    padding: 0 clamp(58px, 4.8vw, 92px) 0 clamp(24px, 2.4vw, 38px);
    gap: clamp(18px, 2.2vw, 38px);
    border: 0;
    border-radius: 0;
    background: url('../img/landing/panel_header_strip.webp') center / 100% 100% no-repeat;
    position: relative;
    top: auto;
    z-index: 80;
    overflow: visible;
}

body.aib-immersive-page .aib-site-brand {
    position: relative;
    z-index: 2;
    min-width: clamp(420px, 30vw, 530px);
    gap: 22px;
    color: #f1e9dc;
    text-shadow: 0 2px 0 rgba(0,0,0,0.8);
}

body.aib-immersive-page .aib-site-brand .brand-logo-img,
body.aib-immersive-page .brand-logo-img {
    width: clamp(145px, 9.4vw, 176px);
    height: auto;
    display: block;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.70));
}

body.aib-immersive-page .aib-site-brand span:last-child {
    font-size: clamp(1.05rem, 1.45vw, 1.45rem);
    line-height: 1;
    letter-spacing: 0.04em;
    font-weight: 500;
    white-space: nowrap;
}

body.aib-immersive-page .aib-site-nav {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: clamp(13px, 1.1vw, 22px);
    min-width: 0;
}

body.aib-immersive-page.wasteland-page-shell .aib-site-nav {
    justify-content: center;
}

body.aib-immersive-page .aib-site-nav a:not(.btn) {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 30px 2px 27px;
    border-radius: 0;
    color: rgba(232,222,209,0.78);
    font-size: clamp(0.94rem, 1.02vw, 1.16rem);
    letter-spacing: 0.02em;
    background: transparent;
    white-space: nowrap;
}

body.aib-immersive-page .aib-site-nav a:not(.btn):hover,
body.aib-immersive-page .aib-site-nav a:not(.btn).is-active {
    color: var(--aib-orange-soft);
    background: transparent;
}

body.aib-immersive-page .aib-site-nav a:not(.btn).is-active::after,
body.aib-immersive-page .aib-site-nav a:not(.btn):hover::after {
    content: "";
    position: absolute;
    left: -7px;
    right: -7px;
    bottom: 19px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--aib-orange), transparent);
    box-shadow: 0 0 14px rgba(247,147,30,0.64);
}

.aib-site-actions {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

body.aib-immersive-page .landing-login-btn {
    position: relative;
    min-height: 48px;
    margin-left: clamp(14px, 1.3vw, 26px);
    padding: 0 28px;
    border: 1px solid rgba(247,147,30,0.72);
    border-radius: 0;
    color: var(--aib-orange-soft);
    background:
        linear-gradient(180deg, rgba(21,20,18,0.78), rgba(9,8,8,0.90)),
        url('../img/landing/button_login_blank.webp') center / 100% 100% no-repeat;
    box-shadow: inset 0 0 0 2px rgba(247,147,30,0.12), 0 0 26px rgba(247,147,30,0.16);
    font-family: "Share Tech Mono", monospace;
    white-space: nowrap;
}

body.aib-immersive-page .wasteland-user-pill {
    min-height: 54px;
    min-width: clamp(210px, 18vw, 260px);
    border-radius: 0;
    border: 1px solid rgba(247,147,30,0.28);
    background: linear-gradient(180deg, rgba(21,20,18,0.78), rgba(9,8,8,0.90));
    box-shadow: inset 0 0 0 2px rgba(247,147,30,0.08), 0 0 18px rgba(0,0,0,0.2);
}

body.aib-immersive-page .aib-site-footer {
    position: fixed;
    left: 50%;
    bottom: 8px;
    z-index: 90;
    width: min(1780px, calc(100vw - 26px));
    margin: 0;
    transform: translateX(-50%);
}

body.aib-immersive-page .aib-site-footer span,
body.aib-immersive-page .aib-site-footer a {
    color: rgba(232,222,209,0.84);
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    white-space: nowrap;
}

body.aib-immersive-page .aib-site-footer a {
    color: var(--aib-orange-soft);
    font-weight: 800;
    text-align: center;
}

body.aib-immersive-page .landing-home {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    justify-content: center;
    padding: clamp(4px, 0.8vh, 10px) 0 clamp(6px, 1vh, 12px);
}

body.aib-immersive-page.wasteland-page-shell .page-wasteland {
    width: min(1780px, calc(100vw - 26px));
    margin: 0 auto;
}

body.aib-immersive-page.wasteland-page-shell .wasteland-view {
    min-height: calc(100dvh - 190px);
    padding: clamp(18px, 2.4vh, 30px) clamp(18px, 1.9vw, 32px) 0;
    overflow: visible;
}

body.aib-immersive-page.wasteland-page-shell .wasteland-intro {
    margin-top: clamp(10px, 1.8vh, 20px);
}

body.aib-immersive-page .page-heading,
body.aib-immersive-page .card,
body.aib-immersive-page .table-card,
body.aib-immersive-page .result-grid {
    position: relative;
    z-index: 2;
}

body.wasteland-page-profile .result-grid,
body.wasteland-page-scoreboard .table-card {
    width: min(1508px, calc(100vw - 92px));
    margin-left: auto;
    margin-right: auto;
}

body.wasteland-page-profile .page-heading,
body.wasteland-page-scoreboard .page-heading {
    width: min(1508px, calc(100vw - 92px));
    margin: clamp(24px, 3vh, 42px) auto 18px;
}

@media (prefers-reduced-motion: reduce) {
    .aib-animated-background__clouds,
    .aib-animated-background__smoke,
    .aib-animated-background__embers,
    .aib-animated-background__fireglow {
        animation: none !important;
    }
}

@media (max-height: 790px) and (min-width: 861px) {
    body.aib-immersive-page .aib-site-header {
        min-height: 82px;
        margin-top: 6px;
    }

    body.aib-immersive-page .aib-site-brand .brand-logo-img,
    body.aib-immersive-page .brand-logo-img {
        width: clamp(120px, 7.8vw, 148px);
    }

    body.aib-immersive-page .aib-site-nav a:not(.btn) {
        padding-top: 22px;
        padding-bottom: 21px;
    }

    body.aib-immersive-page .aib-site-nav a:not(.btn).is-active::after,
    body.aib-immersive-page .aib-site-nav a:not(.btn):hover::after {
        bottom: 13px;
    }

    body.aib-immersive-page .landing-login-btn {
        min-height: 42px;
    }

    body.aib-immersive-page .aib-site-main {
        padding-bottom: 70px;
    }
}

@media (max-width: 1340px) {
    body.aib-immersive-page {
        overflow-y: auto;
    }

    body.aib-immersive-page .aib-site-shell,
    body.aib-immersive-page .aib-site-main,
    body.aib-immersive-page .landing-home,
    body.aib-immersive-page.wasteland-page-shell .wasteland-view {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    body.aib-immersive-page .aib-site-main {
        display: block;
        padding-bottom: 154px;
    }

    body.aib-immersive-page .aib-site-header {
        align-items: center;
        min-height: auto;
        padding: 16px 22px 18px;
        flex-wrap: wrap;
    }

    body.aib-immersive-page .aib-site-brand {
        min-width: 280px;
    }

    body.aib-immersive-page .aib-site-nav,
    body.aib-immersive-page.wasteland-page-shell .aib-site-nav {
        justify-content: center;
        gap: 12px;
    }

    body.aib-immersive-page .aib-site-nav a:not(.btn) {
        padding-top: 12px;
        padding-bottom: 10px;
    }

    body.aib-immersive-page .aib-site-nav a:not(.btn).is-active::after,
    body.aib-immersive-page .aib-site-nav a:not(.btn):hover::after {
        bottom: 3px;
    }
}

@media (max-width: 860px) {
    body.aib-immersive-page .aib-site-shell,
    body.aib-immersive-page .aib-site-main,
    body.aib-immersive-page .landing-home,
    body.aib-immersive-page.wasteland-page-shell .wasteland-view {
        min-height: auto;
    }

    body.aib-immersive-page .aib-site-header {
        width: min(100vw - 16px, 760px);
        position: relative;
        top: 0;
        flex-direction: column;
        background-size: cover;
    }

    body.aib-immersive-page .aib-site-brand {
        min-width: 0;
        width: 100%;
        justify-content: center;
    }

    body.aib-immersive-page .aib-site-brand span:last-child {
        display: none;
    }

    body.aib-immersive-page .aib-site-brand .brand-logo-img,
    body.aib-immersive-page .brand-logo-img {
        width: 150px;
    }

    body.aib-immersive-page .aib-site-nav {
        justify-content: center;
        width: 100%;
        gap: 10px;
    }

    body.aib-immersive-page .aib-site-nav a:not(.btn) {
        font-size: 0.98rem;
        padding: 8px 4px;
    }

    body.aib-immersive-page .landing-login-btn,
    body.aib-immersive-page .aib-site-actions,
    body.aib-immersive-page .wasteland-user-pill {
        width: 100%;
        margin-left: 0;
    }

    .aib-animated-background__edges {
        display: none;
    }

    .aib-animated-background__clouds {
        opacity: 0.20;
        animation: none;
    }

    .aib-animated-background__smoke {
        opacity: 0.10;
    }

    .aib-animated-background__embers {
        opacity: 0.35;
    }

    body.aib-immersive-page .aib-site-footer {
        width: min(100vw - 16px, 760px);
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
        min-height: 128px;
        background-size: cover;
    }

    body.aib-immersive-page .aib-site-footer span:not(:last-child),
    body.aib-immersive-page .aib-site-footer a:not(:last-child) {
        border-right: 0;
    }

    body.wasteland-page-profile .result-grid,
    body.wasteland-page-scoreboard .table-card,
    body.wasteland-page-profile .page-heading,
    body.wasteland-page-scoreboard .page-heading {
        width: min(100vw - 18px, 760px);
    }
}

/* =========================================================
   Wasteland Scoreboard / Profile pages
   ========================================================= */
.wasteland-scoreboard-view,
.wasteland-profile-view {
    gap: 16px;
}

.wasteland-scoreboard-headline {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.9fr);
    gap: 26px;
    align-items: start;
}

.wasteland-scoreboard-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 14px 18px;
    min-height: 126px;
}

.wasteland-scoreboard-meta__item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 6px 18px;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.wasteland-scoreboard-meta__item:last-child { border-right: 0; }
.wasteland-scoreboard-meta__item span {
    color: rgba(232,222,209,0.74);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-scoreboard-meta__item strong {
    color: #f2e6d3;
    font-size: 1.38rem;
    line-height: 1.1;
}

.wasteland-scoreboard-meta__item--accent strong { color: #f79b23; }

.wasteland-scoreboard-panel {
    padding: 20px 18px 18px;
}

.wasteland-scoreboard-toolbar {
    display: flex;
    align-items: end;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wasteland-scoreboard-toolbar__group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 260px;
}

.wasteland-scoreboard-toolbar__group--right {
    margin-left: auto;
    min-width: 300px;
}

.wasteland-field-label {
    color: rgba(232,222,209,0.82);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wasteland-select-wrap {
    position: relative;
}

.wasteland-select-wrap select {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(255,255,255,0.10);
    background: linear-gradient(180deg, rgba(11,14,20,0.95), rgba(7,8,12,0.92));
    color: #efe2cf;
    min-height: 52px;
    padding: 0 48px 0 18px;
    border-radius: 4px;
    font-size: 1rem;
}

.wasteland-select-wrap i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #f79b23;
    pointer-events: none;
}

.wasteland-scoreboard-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
}

.wasteland-scoreboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1080px;
}

.wasteland-scoreboard-table thead th {
    padding: 16px 14px;
    text-align: left;
    font-size: 0.92rem;
    color: rgba(232,222,209,0.76);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wasteland-scoreboard-table tbody td {
    padding: 14px;
    color: #efe4d5;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
}

.wasteland-scoreboard-table tbody tr:hover,
.wasteland-scoreboard-table tbody tr.is-current-user {
    background: rgba(247,147,30,0.08);
}

.wasteland-rank-cell,
.wasteland-player-cell,
.wasteland-class-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wasteland-rank-cell { font-weight: 800; min-width: 54px; }
.wasteland-rank-cell.is-podium i { color: #f79b23; }
.wasteland-player-cell__badge { color: #a970ff; }

.wasteland-class-cell__portrait {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.24);
    flex: 0 0 auto;
}

.wasteland-class-cell__portrait img,
.wasteland-profile-identity__avatar img,
.wasteland-profile-run__hero img,
.wasteland-build-card__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wasteland-scoreboard-table td.is-highlight {
    color: #f79b23;
    font-weight: 800;
    font-size: 1.22rem;
}

.wasteland-mini-btn,
.wasteland-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 4px;
    border: 1px solid rgba(247,147,30,0.34);
    background: linear-gradient(180deg, rgba(58,32,12,0.92), rgba(19,11,8,0.96));
    color: #f3ad47;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.wasteland-mini-btn:hover,
.wasteland-page-btn:hover {
    color: #ffd29b;
    border-color: rgba(247,147,30,0.56);
}

.wasteland-mini-btn.is-disabled,
.wasteland-page-btn.is-disabled,
.wasteland-mini-badge.is-muted {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.wasteland-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.wasteland-empty-state-cell {
    text-align: center;
    color: rgba(232,222,209,0.68);
    padding: 28px 18px !important;
}

.wasteland-scoreboard-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.wasteland-scoreboard-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: rgba(232,222,209,0.82);
}

.wasteland-scoreboard-summary strong { color: #f79b23; }

.wasteland-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.wasteland-page-btn {
    min-width: 42px;
    padding-inline: 14px;
}

.wasteland-page-btn.is-active {
    color: #1b120b;
    background: linear-gradient(180deg, #f79b23, #c56f12);
}

.wasteland-profile-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.4fr);
    gap: 18px;
    position: relative;
    z-index: 1;
}

.wasteland-profile-left,
.wasteland-profile-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wasteland-profile-identity,
.wasteland-profile-stats,
.wasteland-profile-run,
.wasteland-profile-builds {
    padding: 18px;
}

.wasteland-profile-identity__top {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 16px;
    align-items: center;
}

.wasteland-profile-identity__avatar {
    height: 220px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.wasteland-profile-identity__copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wasteland-profile-identity__copy h2,
.wasteland-profile-run__hero-copy h3,
.wasteland-build-card h3 {
    margin: 0;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wasteland-profile-identity__copy h2 { font-size: 2.3rem; }
.wasteland-profile-identity__handle,
.wasteland-build-card p,
.wasteland-profile-run__hero-copy p {
    margin: 0;
    color: #efe2cf;
}

.wasteland-profile-identity__tagline {
    margin: 18px 0 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(232,222,209,0.82);
}

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

.wasteland-stat-card {
    padding: 16px 16px 14px;
    border-radius: 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wasteland-stat-card span,
.wasteland-profile-run__stats span,
.wasteland-build-card__footer span,
.wasteland-panel-hint {
    color: rgba(232,222,209,0.74);
}

.wasteland-stat-card strong {
    color: #f79b23;
    font-size: 1.9rem;
    line-height: 1;
}

.wasteland-stat-card small { color: rgba(232,222,209,0.78); }

.wasteland-panel-heading--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wasteland-profile-run__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(250px, 0.85fr);
    gap: 18px;
}

.wasteland-profile-run__summary {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    align-items: start;
}

.wasteland-profile-run__hero {
    height: 176px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.24);
}

.wasteland-profile-progress {
    margin: 14px 0 16px;
}

.wasteland-profile-progress__bar {
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.06);
}

.wasteland-profile-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f7931e, #ffbe67);
    box-shadow: 0 0 18px rgba(247,147,30,0.24);
}

.wasteland-profile-progress small {
    display: inline-block;
    margin-top: 8px;
    color: rgba(232,222,209,0.75);
}

.wasteland-item-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wasteland-item-chip-row.is-compact {
    gap: 8px;
}

.wasteland-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    max-width: 100%;
}

.wasteland-item-chip__icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-grid;
    place-items: center;
    background: rgba(247,147,30,0.14);
    color: #f79b23;
    flex: 0 0 auto;
}

.wasteland-item-chip__name {
    color: #efe2cf;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.wasteland-empty-inline {
    color: rgba(232,222,209,0.64);
}

.wasteland-profile-run__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.wasteland-profile-run__stats div {
    padding: 12px 14px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wasteland-profile-run__stats strong {
    color: #f79b23;
    font-size: 1.35rem;
}

.wasteland-profile-run__footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.wasteland-profile-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    color: rgba(232,222,209,0.8);
}

.wasteland-profile-builds__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.wasteland-build-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}

.wasteland-build-card__head {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 12px;
}

.wasteland-build-card__portrait {
    height: 112px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.24);
}

.wasteland-build-card__meta,
.wasteland-build-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.wasteland-build-card__meta strong { color: #f79b23; }

@media (max-width: 1600px) {
    .wasteland-scoreboard-headline,
    .wasteland-profile-grid,
    .wasteland-profile-run__layout,
    .wasteland-profile-builds__grid {
        grid-template-columns: 1fr;
    }

    .wasteland-scoreboard-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .wasteland-scoreboard-toolbar,
    .wasteland-scoreboard-footer,
    .wasteland-panel-heading--between {
        flex-direction: column;
        align-items: stretch;
    }

    .wasteland-scoreboard-toolbar__group,
    .wasteland-scoreboard-toolbar__group--right {
        min-width: 0;
        width: 100%;
        margin-left: 0;
    }

    .wasteland-profile-identity__top,
    .wasteland-profile-run__summary,
    .wasteland-build-card__head {
        grid-template-columns: 1fr;
    }

    .wasteland-profile-identity__avatar,
    .wasteland-profile-run__hero,
    .wasteland-build-card__portrait {
        max-width: 240px;
    }
}

@media (max-width: 760px) {
    .wasteland-scoreboard-meta,
    .wasteland-profile-stats__grid,
    .wasteland-profile-run__stats {
        grid-template-columns: 1fr;
    }

    .wasteland-scoreboard-meta__item {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding-inline: 4px;
    }

    .wasteland-scoreboard-meta__item:last-child {
        border-bottom: 0;
    }
}

/* =========================================================
   Hotfix phase 16: scoreboard/profile height + social/build UI
   ========================================================= */
body.wasteland-page-profile,
body.wasteland-page-scoreboard,
body.wasteland-page-profile-edit,
body.wasteland-page-build {
    overflow-y: auto;
}

body.wasteland-page-profile .aib-site-main,
body.wasteland-page-scoreboard .aib-site-main,
body.wasteland-page-profile-edit .aib-site-main,
body.wasteland-page-build .aib-site-main {
    padding-bottom: 110px;
}

body.wasteland-page-profile .wasteland-view,
body.wasteland-page-scoreboard .wasteland-view,
body.wasteland-page-profile-edit .wasteland-view,
body.wasteland-page-build .wasteland-view {
    min-height: auto !important;
    padding-bottom: 24px !important;
}

.wasteland-profile-view .wasteland-intro,
.wasteland-scoreboard-view .wasteland-intro,
.wasteland-profile-edit-view .wasteland-intro,
.wasteland-build-view .wasteland-intro {
    margin-bottom: 14px;
}

.wasteland-profile-view .wasteland-title,
.wasteland-scoreboard-view .wasteland-title,
.wasteland-profile-edit-view .wasteland-title,
.wasteland-build-view .wasteland-title {
    font-size: clamp(3.3rem, 5.2vw, 5.8rem);
}

.wasteland-profile-grid,
.wasteland-scoreboard-panel,
.wasteland-build-layout,
.wasteland-build-meta,
.wasteland-build-items-panel,
.wasteland-profile-edit-panel {
    position: relative;
    z-index: 2;
}

.wasteland-profile-grid {
    align-items: start;
}

.wasteland-profile-builds {
    max-height: none;
    overflow: visible;
}

.wasteland-profile-builds__grid {
    align-items: stretch;
}

.wasteland-build-card {
    min-height: 0;
}

.wasteland-build-card .wasteland-item-chip__name,
.wasteland-profile-run .wasteland-item-chip__name {
    max-width: 112px;
}

.wasteland-item-chip__icon img,
.item-icon img,
.storage-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.wasteland-item-chip__icon:has(img),
.item-icon:has(img),
.storage-item-icon:has(img) {
    background: rgba(0,0,0,0.22);
    padding: 0;
    overflow: hidden;
}

.wasteland-scoreboard-panel {
    margin-top: -2px;
}

.wasteland-scoreboard-table tbody tr:nth-child(1) {
    background: linear-gradient(90deg, rgba(247,147,30,0.15), rgba(247,147,30,0.035));
}

.wasteland-scoreboard-table tbody tr:nth-child(2),
.wasteland-scoreboard-table tbody tr:nth-child(3) {
    background: rgba(247,147,30,0.055);
}

.wasteland-profile-edit-panel {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.wasteland-profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wasteland-profile-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wasteland-profile-edit-form label span {
    color: #f79b23;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-profile-edit-form input,
.wasteland-profile-edit-form textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.10);
    background: linear-gradient(180deg, rgba(11,14,20,0.95), rgba(7,8,12,0.92));
    color: #efe2cf;
    border-radius: 4px;
    padding: 14px 16px;
    font: inherit;
    resize: vertical;
}

.wasteland-profile-edit-form small {
    color: rgba(232,222,209,0.66);
}

.wasteland-profile-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.wasteland-build-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(360px, 1.2fr);
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.wasteland-build-meta > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px;
}

.wasteland-build-meta span {
    color: rgba(232,222,209,0.74);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wasteland-build-meta strong {
    color: #f79b23;
    font-size: 1.32rem;
}

.wasteland-build-meta__actions {
    flex-direction: row !important;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.wasteland-build-meta__actions form {
    margin: 0;
}

.wasteland-build-items-panel {
    margin-top: 16px;
    padding: 18px;
}

.wasteland-build-items-panel h2 {
    margin-top: 0;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
}

.wasteland-build-layout .inventory-panel,
.wasteland-build-layout .stats-panel {
    padding: 18px;
}

@media (min-width: 1601px) and (max-height: 980px) {
    .wasteland-profile-identity__avatar { height: 170px; }
    .wasteland-profile-identity__top { grid-template-columns: 160px 1fr; }
    .wasteland-profile-identity__copy h2 { font-size: 1.85rem; }
    .wasteland-profile-identity__tagline { margin: 12px 0 12px; padding-top: 12px; }
    .wasteland-stat-card { padding: 11px 12px; }
    .wasteland-stat-card strong { font-size: 1.45rem; }
    .wasteland-profile-run__hero { height: 132px; }
    .wasteland-profile-run__summary { grid-template-columns: 120px 1fr; }
    .wasteland-profile-run__stats div { padding: 9px 11px; }
    .wasteland-build-card { padding: 10px; gap: 10px; }
    .wasteland-build-card__portrait { height: 88px; }
    .wasteland-build-card__head { grid-template-columns: 76px 1fr; }
    .wasteland-item-chip { padding: 6px 8px; }
    .wasteland-item-chip__icon { width: 24px; height: 24px; }
}

@media (max-width: 1200px) {
    .wasteland-build-meta {
        grid-template-columns: 1fr 1fr;
    }
    .wasteland-build-meta__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .wasteland-build-meta {
        grid-template-columns: 1fr;
    }
    .wasteland-profile-edit-actions,
    .wasteland-build-meta__actions {
        flex-direction: column !important;
        align-items: stretch;
    }
}

/* =========================================================
   Wasteland Scoreboard canonical layout
   ========================================================= */
body.wasteland-page-scoreboard {
    overflow-x: hidden;
}

body.wasteland-page-scoreboard .page-wasteland {
    width: min(1780px, calc(100vw - 26px));
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-view {
    width: 100%;
    max-width: none;
    min-height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(14px, 2vh, 24px) 0 24px !important;
    margin: 0;
    overflow: visible;
    box-sizing: border-box;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-intro,
body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-scoreboard-panel {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-intro {
    margin-top: clamp(8px, 1.4vh, 18px);
    margin-bottom: 10px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-title {
    font-size: clamp(3.1rem, 4.9vw, 5.15rem);
    line-height: 0.9;
    margin-bottom: 8px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-subtitle {
    max-width: 560px;
    font-size: 1.05rem;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-headline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(560px, 640px);
    align-items: end;
    gap: 24px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-meta {
    justify-self: end;
    width: 100%;
    max-width: 640px;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 16%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.06), transparent 16rem),
        linear-gradient(135deg, rgba(20,22,28,0.96), rgba(10,11,14,0.96));
}

body.wasteland-page-scoreboard .wasteland-scoreboard-meta__item {
    min-height: 84px;
    padding: 4px 14px;
    gap: 6px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-meta__item span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.79rem;
    line-height: 1.2;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-meta__item strong {
    font-size: 1.06rem;
    line-height: 1.16;
    letter-spacing: 0.02em;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-panel {
    margin-top: 0;
    padding: 16px 14px 14px;
    overflow: visible;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(360px, 1fr) minmax(240px, 300px);
    align-items: end;
    gap: 14px;
    margin-bottom: 12px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group,
body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--search,
body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--right {
    min-width: 0;
    width: 100%;
    margin-left: 0;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--search {
    grid-column: 2;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--right {
    grid-column: 3;
}

body.wasteland-page-scoreboard .wasteland-field-label {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}

.wasteland-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wasteland-search-wrap > i:first-child {
    position: absolute;
    left: 15px;
    z-index: 2;
    color: rgba(247,147,30,0.82);
    pointer-events: none;
}

.wasteland-search-wrap input {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(11,14,20,0.95), rgba(7,8,12,0.92));
    color: #efe2cf;
    padding: 0 46px 0 44px;
    font: inherit;
    outline: none;
}

.wasteland-search-wrap input:focus,
.wasteland-select-wrap select:focus {
    border-color: rgba(247,147,30,0.45);
    box-shadow: 0 0 0 2px rgba(247,147,30,0.10);
}

.wasteland-search-wrap a {
    position: absolute;
    right: 12px;
    z-index: 2;
    color: rgba(232,222,209,0.78);
    text-decoration: none;
}

.wasteland-search-wrap a:hover {
    color: #f79b23;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    box-sizing: border-box;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-table {
    width: 100%;
    min-width: 1120px;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-table thead th {
    font-size: 0.82rem;
    padding: 14px 12px;
    white-space: nowrap;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-table tbody td {
    padding: 12px;
    font-size: 0.97rem;
    white-space: nowrap;
}

body.wasteland-page-scoreboard .wasteland-rank-cell {
    min-width: 0;
    gap: 7px;
}

body.wasteland-page-scoreboard .wasteland-rank-cell i,
body.wasteland-page-scoreboard .wasteland-rank-cell span,
body.wasteland-page-scoreboard .wasteland-scoreboard-table td.is-highlight,
body.wasteland-page-scoreboard .wasteland-scoreboard-summary strong {
    color: #f79b23;
}

body.wasteland-page-scoreboard .wasteland-class-cell__portrait {
    width: 36px;
    height: 36px;
}

body.wasteland-page-scoreboard .wasteland-mini-btn,
body.wasteland-page-scoreboard .wasteland-page-btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.94rem;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-footer {
    max-width: 100%;
    margin-top: 12px;
    gap: 12px;
    align-items: center;
    overflow: visible;
}

body.wasteland-page-scoreboard .wasteland-scoreboard-summary {
    flex: 1 1 auto;
    gap: 14px;
    font-size: 1rem;
}

body.wasteland-page-scoreboard .wasteland-pagination {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 1320px) {
    body.wasteland-page-scoreboard .page-wasteland {
        width: calc(100vw - 28px);
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-headline {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-meta {
        justify-self: start;
        width: min(760px, 100%);
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--search,
    body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar__group--right {
        grid-column: auto;
    }
}

@media (max-width: 860px) {
    body.wasteland-page-scoreboard .page-wasteland {
        width: calc(100vw - 16px);
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-meta {
        grid-template-columns: 1fr 1fr;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-footer {
        flex-direction: column;
        align-items: stretch;
    }

    body.wasteland-page-scoreboard .wasteland-pagination {
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* =========================================================
   Wasteland Shop / Inventory Run screen
   ========================================================= */
body.wasteland-page-shop .aib-site-main {
    overflow: hidden;
}

.wasteland-shop-view {
    position: relative;
    z-index: 2;
    width: min(1780px, calc(100vw - 42px));
    height: calc(100dvh - 196px);
    min-height: 760px;
    margin: 0 auto;
    padding: 14px 0 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}

.wasteland-shop-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 22px;
    align-items: end;
}

.wasteland-title--shop {
    margin: 0 0 8px;
    font-size: clamp(2.45rem, 3.6vw, 4.15rem);
    line-height: 0.9;
}

.wasteland-title--shop span {
    color: #f79b23;
    font-size: 0.72em;
    vertical-align: middle;
}

.wasteland-shop-subline {
    margin: 0;
    color: rgba(232,222,209,0.78);
    font-size: 1.06rem;
}

.wasteland-shop-subline strong { color: #f79b23; }

.wasteland-next-round-box {
    min-height: 82px;
    padding: 12px 14px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 7px;
    border: 1px solid rgba(247,147,30,0.26);
    background: linear-gradient(180deg, rgba(20,22,28,0.94), rgba(8,9,12,0.94));
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.45), 0 16px 38px rgba(0,0,0,0.34);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.wasteland-next-round-box span {
    color: rgba(232,222,209,0.65);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wasteland-next-round-box button {
    border: 0;
    background: transparent;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    cursor: pointer;
}

.wasteland-shop-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1fr) minmax(430px, 0.82fr);
    gap: 14px;
    align-items: stretch;
}

.wasteland-shop-panel,
.wasteland-inventory-panel,
.wasteland-storage-panel,
.wasteland-status-panel,
.wasteland-recipes-panel {
    min-width: 0;
    padding: 14px;
    overflow: hidden;
}

.wasteland-shop-panel,
.wasteland-shop-center,
.wasteland-shop-right {
    min-height: 0;
}

.wasteland-shop-center,
.wasteland-shop-right {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(190px, 0.38fr);
    gap: 10px;
}

.wasteland-shop-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.025), transparent 16%),
        radial-gradient(circle at 50% 20%, rgba(247,147,30,0.12), transparent 18rem),
        linear-gradient(135deg, rgba(22,24,28,0.96), rgba(8,9,12,0.95));
}

.wasteland-shop-panel__header,
.wasteland-panel-heading,
.wasteland-panel-heading--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wasteland-shop-panel__header h2,
.wasteland-panel-heading h2 {
    margin: 0;
    color: #f1e6d7;
    font-size: 1.22rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wasteland-shop-panel__header p {
    margin: 3px 0 0;
    color: rgba(232,222,209,0.62);
}

.wasteland-shop-panel__header strong,
.wasteland-panel-heading > span,
.wasteland-panel-actions span {
    color: #f1e6d7;
    font-weight: 900;
}

.wasteland-reroll-bar {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 10px;
}

.wasteland-reroll-bar button {
    min-height: 36px;
    border-radius: 3px;
    border: 1px solid rgba(247,147,30,0.22);
    color: rgba(232,222,209,0.7);
    background: rgba(0,0,0,0.35);
    padding: 0 14px;
    font-weight: 800;
    text-transform: uppercase;
}

.wasteland-reroll-bar span { color: #f79b23; }

.wasteland-shop-list {
    min-height: 0;
    overflow-y: auto;
    padding: 2px 6px 4px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
}

.wasteland-shop-list::-webkit-scrollbar,
.wasteland-storage-bin::-webkit-scrollbar,
.wasteland-recipe-grid::-webkit-scrollbar { width: 8px; height: 8px; }
.wasteland-shop-list::-webkit-scrollbar-thumb,
.wasteland-storage-bin::-webkit-scrollbar-thumb,
.wasteland-recipe-grid::-webkit-scrollbar-thumb { background: rgba(247,147,30,0.32); border-radius: 999px; }

.wasteland-shop-item {
    position: relative;
    min-height: 170px;
    display: grid;
    grid-template-rows: auto 70px minmax(34px, auto) auto;
    gap: 6px;
    padding: 9px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.42)),
        radial-gradient(circle at 50% 20%, rgba(255,255,255,0.06), transparent 5rem),
        rgba(14,16,19,0.90);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 12px 26px rgba(0,0,0,0.24);
    cursor: grab;
}

.wasteland-shop-item.is-bought { opacity: 0.5; cursor: default; }
.wasteland-shop-item.is-locked { box-shadow: inset 0 0 0 1px rgba(247,147,30,0.24), 0 12px 26px rgba(0,0,0,0.24); }

.wasteland-shop-item,
.wasteland-storage-card,
.inventory-item-cell,
.mini-item {
    --aib-rarity-color: #d9d1c4;
    --aib-rarity-rgb: 217, 209, 196;
    --aib-rarity-bg: rgba(217, 209, 196, 0.08);
    --aib-rarity-border: rgba(217, 209, 196, 0.18);
}

.wasteland-shop-item.rarity-common,
.wasteland-storage-card.rarity-common,
.inventory-item-cell.rarity-common,
.mini-item.rarity-common,
.wasteland-shop-item[class*="rarity-gew"],
.wasteland-storage-card[class*="rarity-gew"],
.inventory-item-cell[class*="rarity-gew"],
.mini-item[class*="rarity-gew"] {
    --aib-rarity-color: #c7cdd3;
    --aib-rarity-rgb: 199, 205, 211;
    --aib-rarity-bg: rgba(199, 205, 211, 0.10);
    --aib-rarity-border: rgba(199, 205, 211, 0.34);
}

.wasteland-shop-item.rarity-uncommon,
.wasteland-storage-card.rarity-uncommon,
.inventory-item-cell.rarity-uncommon,
.mini-item.rarity-uncommon,
.wasteland-shop-item[class*="rarity-unge"],
.wasteland-storage-card[class*="rarity-unge"],
.inventory-item-cell[class*="rarity-unge"],
.mini-item[class*="rarity-unge"] {
    --aib-rarity-color: #64df86;
    --aib-rarity-rgb: 100, 223, 134;
    --aib-rarity-bg: rgba(100, 223, 134, 0.11);
    --aib-rarity-border: rgba(100, 223, 134, 0.52);
}

.wasteland-shop-item.rarity-rare,
.wasteland-storage-card.rarity-rare,
.inventory-item-cell.rarity-rare,
.mini-item.rarity-rare,
.wasteland-shop-item[class*="rarity-selten"],
.wasteland-storage-card[class*="rarity-selten"],
.inventory-item-cell[class*="rarity-selten"],
.mini-item[class*="rarity-selten"] {
    --aib-rarity-color: #58a6ff;
    --aib-rarity-rgb: 88, 166, 255;
    --aib-rarity-bg: rgba(88, 166, 255, 0.11);
    --aib-rarity-border: rgba(88, 166, 255, 0.56);
}

.wasteland-shop-item.rarity-epic,
.wasteland-storage-card.rarity-epic,
.inventory-item-cell.rarity-epic,
.mini-item.rarity-epic,
.wasteland-shop-item[class*="rarity-episch"],
.wasteland-storage-card[class*="rarity-episch"],
.inventory-item-cell[class*="rarity-episch"],
.mini-item[class*="rarity-episch"] {
    --aib-rarity-color: #b66cff;
    --aib-rarity-rgb: 182, 108, 255;
    --aib-rarity-bg: rgba(182, 108, 255, 0.11);
    --aib-rarity-border: rgba(182, 108, 255, 0.58);
}

.wasteland-shop-item.rarity-legendary,
.wasteland-storage-card.rarity-legendary,
.inventory-item-cell.rarity-legendary,
.mini-item.rarity-legendary,
.wasteland-shop-item[class*="rarity-legend"],
.wasteland-storage-card[class*="rarity-legend"],
.inventory-item-cell[class*="rarity-legend"],
.mini-item[class*="rarity-legend"] {
    --aib-rarity-color: #ffb13b;
    --aib-rarity-rgb: 255, 177, 59;
    --aib-rarity-bg: rgba(255, 177, 59, 0.13);
    --aib-rarity-border: rgba(255, 177, 59, 0.72);
}

.wasteland-shop-item {
    border-color: var(--aib-rarity-border);
}

.wasteland-shop-item::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: 6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(var(--aib-rarity-rgb), 0.80), transparent);
    opacity: 0.82;
    pointer-events: none;
}

.wasteland-shop-item__rarity {
    justify-self: start;
    padding: 2px 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(var(--aib-rarity-rgb), 0.20), rgba(0,0,0,0.52));
    border: 1px solid var(--aib-rarity-border);
    color: var(--aib-rarity-color);
    text-shadow: 0 0 8px rgba(var(--aib-rarity-rgb), 0.28);
    font-size: 0.58rem;
    font-weight: 900;
    text-transform: uppercase;
}

.wasteland-shop-item__image {
    display: grid;
    place-items: center;
    min-height: 70px;
}

.wasteland-shop-item__image img {
    max-width: 66px;
    max-height: 66px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45)) drop-shadow(0 0 8px rgba(var(--aib-rarity-rgb), 0.10));
}

.wasteland-shop-item__image span {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #f79b23;
    background: rgba(247,147,30,0.10);
    border: 1px solid rgba(247,147,30,0.18);
    font-size: 1.6rem;
}

.wasteland-shop-item__body strong {
    display: block;
    color: #f5eadc;
    font-size: 0.94rem;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-shop-item__body small {
    display: -webkit-box;
    margin-top: 4px;
    color: rgba(232,222,209,0.66);
    font-size: 0.70rem;
    line-height: 1.22;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wasteland-shop-item__footer {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: space-between;
}

.wasteland-shop-item__footer > span {
    color: #f79b23;
    font-weight: 900;
    white-space: nowrap;
}

.wasteland-shop-item__footer form { margin: 0; }

.wasteland-buy-btn,
.wasteland-lock-btn {
    min-height: 30px;
    border-radius: 3px;
    border: 1px solid rgba(247,147,30,0.26);
    color: #f79b23;
    background: rgba(0,0,0,0.24);
    font-weight: 800;
    cursor: pointer;
    padding: 0 8px;
}

.wasteland-lock-btn { width: 32px; padding: 0; }
.wasteland-lock-btn.is-on { background: rgba(247,147,30,0.22); }

.wasteland-panel-tip {
    margin: 10px 0 0;
    color: rgba(232,222,209,0.62);
    font-size: 0.86rem;
}

.wasteland-inventory-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding-bottom: 14px !important;
}

.wasteland-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wasteland-inventory-panel .inventory-grid-scroll {
    min-height: 0;
    height: 100%;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: auto;
}

.wasteland-inventory-panel .inventory-grid {
    --slot-size: clamp(37px, min(2.7vw, 5.3vh), 54px);
    gap: 4px;
    padding: 0;
}

.wasteland-inventory-panel .grid-cell {
    border-radius: 2px;
    border-style: solid;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 10px),
        rgba(0,0,0,0.32);
    opacity: 0.74;
}

.wasteland-inventory-panel .grid-cell.is-unlocked,
.wasteland-inventory-panel .grid-cell.is-bag-cell {
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 10px),
        rgba(22,23,25,0.70);
    border-color: rgba(247,147,30,0.25);
}

.wasteland-inventory-panel .inventory-item-cell {
    border-radius: 3px;
    border-width: 1px;
    background: linear-gradient(180deg, rgba(35,36,39,0.96), rgba(13,14,16,0.96));
}

.wasteland-inventory-panel .inventory-item-cell strong,
.wasteland-inventory-panel .inventory-item-cell small,
.wasteland-inventory-panel .bag-grip-text {
    display: none;
}

.wasteland-inventory-panel .item-icon {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    font-size: 1.1rem;
}

.wasteland-inventory-panel .bag-grip {
    border-radius: 4px;
    opacity: 0.85;
}

.wasteland-storage-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
}

.wasteland-storage-workbench {
    display: grid;
    gap: 6px;
}

.wasteland-workbench-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.22);
    color: rgba(232,222,209,0.76);
    font-size: 0.83rem;
}

.wasteland-workbench-row strong { color: #c888ff; }
.wasteland-workbench-row span { color: #f79b23; }
.wasteland-workbench-row.is-locked { justify-content: flex-start; color: rgba(232,222,209,0.48); }

.wasteland-storage-board,
.wasteland-storage-bin {
    min-height: 0;
    height: 100%;
}

.wasteland-storage-board {
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.wasteland-storage-bin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    align-content: start;
    align-items: stretch;
    gap: 7px;
    overflow-y: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.wasteland-storage-bin::before { display: none; }

.wasteland-storage-card {
    width: auto !important;
    min-height: 54px;
    border-radius: 4px;
    padding: 7px;
    background: rgba(13,15,18,0.82);
    border-color: rgba(255,255,255,0.08);
    box-shadow: none;
}

.wasteland-status-panel {
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
}

.wasteland-status-hero {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 14px;
    align-items: start;
}

.wasteland-status-portrait {
    height: 108px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.22);
}

.wasteland-status-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wasteland-status-hero h3 {
    margin: 4px 0 2px;
    color: #f79b23;
    text-transform: uppercase;
    font-size: 1.04rem;
}

.wasteland-status-hero p,
.wasteland-status-hero small {
    margin: 0;
    color: rgba(232,222,209,0.72);
}

.wasteland-status-progress {
    height: 12px;
    margin: 10px 0 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.wasteland-status-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f7931e, #ffbc68);
}

.wasteland-status-statgrid,
.wasteland-run-statgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.wasteland-status-statgrid div,
.wasteland-run-statgrid div {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.wasteland-status-statgrid span,
.wasteland-run-statgrid span {
    color: rgba(232,222,209,0.72);
}

.wasteland-status-statgrid strong,
.wasteland-run-statgrid strong {
    color: #efe2cf;
}

.wasteland-run-statgrid strong { color: #f79b23; }

.wasteland-synergy-panel {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wasteland-synergy-panel h3 {
    margin: 0;
    color: #f79b23;
    text-transform: uppercase;
    font-size: 1rem;
}

.wasteland-synergy-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.20);
}

.wasteland-synergy-row > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    color: #f79b23;
    background: rgba(247,147,30,0.10);
}

.wasteland-synergy-row strong {
    display: block;
    color: #f79b23;
    text-transform: uppercase;
    font-size: 0.88rem;
}

.wasteland-synergy-row small {
    display: block;
    color: rgba(232,222,209,0.72);
    line-height: 1.25;
}

.wasteland-recipes-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.wasteland-recipe-grid {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.wasteland-recipe-card {
    min-height: 136px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(12,14,17,0.82);
}

.wasteland-recipe-card__top {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 9px;
    align-items: center;
}

.wasteland-recipe-card__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(247,147,30,0.10);
    color: #f79b23;
    border: 1px solid rgba(247,147,30,0.18);
}

.wasteland-recipe-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wasteland-recipe-card strong {
    display: block;
    color: #bfe6d4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-recipe-card small,
.wasteland-recipe-card p {
    color: rgba(232,222,209,0.68);
    font-size: 0.76rem;
    line-height: 1.25;
}

.wasteland-recipe-card p {
    margin: 0;
    overflow: hidden;
}

.wasteland-recipe-card form { margin: 0; }

@media (max-width: 1500px) {
    .wasteland-shop-view {
        width: calc(100vw - 24px);
    }

    .wasteland-shop-layout {
        grid-template-columns: minmax(340px, 0.78fr) minmax(500px, 1fr) minmax(360px, 0.76fr);
    }

    .wasteland-shop-list,
    .wasteland-recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    body.wasteland-page-shop .aib-site-main { overflow: auto; }
    .wasteland-shop-view {
        height: auto;
        min-height: 0;
        padding-bottom: 110px;
    }
    .wasteland-shop-layout,
    .wasteland-shop-topline {
        grid-template-columns: 1fr;
    }
    .wasteland-shop-center,
    .wasteland-shop-right {
        grid-template-rows: auto auto;
    }
}

/* =========================================================
   Phase 17.1 Shop polish: tooltip, slots, recipes, lock states
   ========================================================= */
body.wasteland-page-shop .aib-tooltip-popover {
    width: min(440px, calc(100vw - 28px));
    padding: 0;
    border-radius: 0;
    border: 1px solid rgba(247,147,30,0.46);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.12), transparent 16rem),
        linear-gradient(135deg, rgba(24,25,29,0.98), rgba(7,8,11,0.985));
    box-shadow:
        inset 0 0 0 2px rgba(0,0,0,0.62),
        inset 0 0 0 3px rgba(255,255,255,0.032),
        0 26px 70px rgba(0,0,0,0.62),
        0 0 30px rgba(247,147,30,0.12);
    color: #efe2cf;
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
    overflow: hidden;
}

body.wasteland-page-shop .aib-tooltip-popover::before {
    content: "";
    position: absolute;
    inset: 8px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.07);
    border-top-color: rgba(255,255,255,0.16);
    border-bottom-color: rgba(247,147,30,0.22);
    clip-path: inherit;
}

body.wasteland-page-shop .aib-tooltip-popover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.25;
    background:
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(255,255,255,0.025) 34px 35px),
        repeating-linear-gradient(0deg, transparent 0 18px, rgba(255,255,255,0.018) 18px 19px);
}

body.wasteland-page-shop .aib-tooltip-popover > strong {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 14px 16px 11px;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(247,147,30,0.22);
    background: linear-gradient(90deg, rgba(247,147,30,0.12), transparent 72%);
}

body.wasteland-page-shop .aib-tooltip-popover dl {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0;
    padding: 8px 14px 14px;
}

body.wasteland-page-shop .aib-tooltip-popover dt,
body.wasteland-page-shop .aib-tooltip-popover dd {
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.055);
}

body.wasteland-page-shop .aib-tooltip-popover dt {
    color: rgba(232,222,209,0.64);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.wasteland-page-shop .aib-tooltip-popover dd {
    color: #efe2cf;
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.wasteland-page-shop .aib-tooltip-popover dt:last-of-type,
body.wasteland-page-shop .aib-tooltip-popover dd:last-of-type {
    border-bottom: 0;
}

.wasteland-next-round-box {
    min-width: 240px;
}

.wasteland-next-round-box button {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}

.wasteland-shop-list {
    gap: 12px;
}

.wasteland-shop-item {
    min-width: 0;
    min-height: 178px;
    grid-template-rows: auto 70px minmax(42px, auto) auto;
}

.wasteland-shop-item__body,
.wasteland-shop-item__footer {
    min-width: 0;
}

.wasteland-shop-item__body strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    hyphens: auto;
    min-height: 2.05em;
}

.wasteland-shop-item__footer {
    display: grid;
    grid-template-columns: minmax(42px, 1fr) auto auto;
    gap: 6px;
    align-items: center;
}

.wasteland-shop-item__footer > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-buy-btn,
.wasteland-lock-btn {
    min-height: 34px;
}

.wasteland-buy-btn {
    padding: 0 10px;
    white-space: nowrap;
}

.wasteland-lock-btn {
    width: 34px;
    flex: 0 0 34px;
}

.wasteland-lock-btn.is-off {
    color: rgba(247,147,30,0.72);
    background: rgba(0,0,0,0.18);
}

.wasteland-lock-btn.is-on {
    color: #ffbd6a;
    background: rgba(247,147,30,0.23);
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.18), 0 0 18px rgba(247,147,30,0.08);
}

.wasteland-inventory-panel .inventory-grid {
    --slot-size: clamp(38px, min(2.65vw, 5.2vh), 54px);
    gap: 3px;
    background:
        radial-gradient(circle at 50% 50%, rgba(247,147,30,0.08), transparent 28rem),
        rgba(0,0,0,0.12);
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
}

.wasteland-inventory-panel .grid-cell {
    border: 0;
    opacity: 1;
    background: url('../img/ui/slot_locked.webp') center / 100% 100% no-repeat;
    box-shadow: none;
}

.wasteland-inventory-panel .grid-cell.is-unlocked {
    background: url('../img/ui/slot_empty.webp') center / 100% 100% no-repeat;
}

.wasteland-inventory-panel .grid-cell.is-bag-cell,
.wasteland-inventory-panel .grid-cell.is-starter-cell {
    background: url('../img/ui/slot_unlocked.webp') center / 100% 100% no-repeat;
}

.wasteland-inventory-panel .grid-cell.is-target-valid {
    outline: 2px solid rgba(247,147,30,0.88);
    outline-offset: -2px;
    filter: brightness(1.18);
}

.wasteland-inventory-panel .grid-cell.is-target-invalid {
    outline: 2px solid rgba(255,72,72,0.82);
    outline-offset: -2px;
}

.wasteland-inventory-panel .inventory-item-cell {
    border: 1px solid rgba(247,147,30,0.20);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18)),
        linear-gradient(135deg, rgba(42,39,33,0.98), rgba(15,15,16,0.98));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035), 0 6px 12px rgba(0,0,0,0.25);
}

.wasteland-inventory-panel .inventory-item-cell.is-fill-cell {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.16)),
        linear-gradient(135deg, rgba(36,34,30,0.94), rgba(13,13,15,0.94));
}

.wasteland-inventory-panel .bag-grip {
    border: 1px solid rgba(247,147,30,0.30);
    background: linear-gradient(180deg, rgba(45,31,20,0.82), rgba(13,10,8,0.82));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035), 0 6px 16px rgba(0,0,0,0.25);
}

.wasteland-recipes-panel {
    min-height: 0;
}

.wasteland-recipe-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    overflow-y: auto;
    padding-right: 4px;
}

.wasteland-recipe-card {
    min-height: 0;
    grid-template-rows: auto auto;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 9px 10px;
}

.wasteland-recipe-card__top {
    grid-template-columns: 44px minmax(0, 1fr);
    min-width: 0;
}

.wasteland-recipe-card__icon {
    width: 40px;
    height: 40px;
}

.wasteland-recipe-card strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-recipe-card small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-recipe-card p {
    grid-column: 1 / -1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.wasteland-recipe-card form {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.wasteland-recipe-card .wasteland-mini-btn {
    min-height: 34px;
    padding: 0 12px;
}

@media (max-width: 1500px) {
    .wasteland-shop-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wasteland-shop-layout {
        grid-template-columns: minmax(360px, 0.86fr) minmax(500px, 1fr) minmax(390px, 0.82fr);
    }
}

@media (max-width: 1180px) {
    .wasteland-recipe-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* =========================================================
   Phase 17.2 Shop cards, recipes and AJAX polish
   ========================================================= */
body.is-shop-ajax-loading .shop-screen {
    pointer-events: none;
}

body.is-shop-ajax-loading .shop-screen::after {
    content: "";
    position: fixed;
    right: 22px;
    bottom: 98px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(247,147,30,0.28);
    border-top-color: rgba(247,147,30,0.95);
    z-index: 200;
    animation: aibAjaxSpin 0.8s linear infinite;
}

@keyframes aibAjaxSpin { to { transform: rotate(360deg); } }

.wasteland-shop-item {
    min-height: 154px;
    grid-template-rows: auto 62px minmax(34px, auto) auto;
    gap: 5px;
    padding: 9px 9px 10px;
}

.wasteland-shop-item__price {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 3px;
    border: 1px solid rgba(247,147,30,0.24);
    background: rgba(0,0,0,0.42);
    color: #f79b23;
    font-weight: 900;
    font-size: 0.82rem;
    line-height: 1;
    z-index: 2;
}

.wasteland-shop-item__image {
    min-height: 62px;
}

.wasteland-shop-item__image img {
    max-width: 58px;
    max-height: 58px;
}

.wasteland-shop-item__image span {
    width: 50px;
    height: 50px;
    font-size: 1.38rem;
}

.wasteland-shop-item__body {
    display: flex;
    align-items: center;
    min-height: 34px;
}

.wasteland-shop-item__body strong {
    min-height: 0;
    line-height: 1.05;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.wasteland-shop-item__body small {
    display: none !important;
}

.wasteland-shop-item__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 7px;
    align-items: center;
}

.wasteland-shop-item__footer form:first-of-type {
    min-width: 0;
}

.wasteland-shop-item__footer .wasteland-buy-btn,
.wasteland-shop-item__footer .btn-disabled {
    width: 100%;
}

.wasteland-lock-btn {
    width: 36px;
    min-height: 36px;
}

.wasteland-lock-btn.is-off i::before {
    content: "\f3c1";
}

.wasteland-lock-btn.is-on i::before {
    content: "\f023";
}

.wasteland-recipe-grid {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 7px;
}

.wasteland-recipe-card {
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 10px;
}

.wasteland-recipe-card__top {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
}

.wasteland-recipe-card__icon {
    width: 38px;
    height: 38px;
}

.wasteland-recipe-card strong {
    max-width: 100%;
    font-size: 0.98rem;
}

.wasteland-recipe-card small {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-recipe-card p {
    display: none !important;
}

.wasteland-recipe-card form {
    grid-column: 2;
    grid-row: 1;
}

.wasteland-recipe-card .wasteland-mini-btn {
    min-height: 36px;
    padding: 0 14px;
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .wasteland-shop-item {
        min-height: 150px;
    }
}

.wasteland-shop-item.shop-item[data-draggable="1"]::after {
    content: none !important;
}

.wasteland-shop-item.is-bought .wasteland-shop-item__footer {
    grid-template-columns: 1fr;
}

/* =========================================================
   Phase 17.3 - Inventar: belegte Slots klarer sichtbar
   ========================================================= */
.wasteland-inventory-panel .inventory-grid {
    --occupied-slot-glow: rgba(247,147,30,0.45);
    --occupied-slot-border: rgba(255,181,86,0.72);
}

.wasteland-inventory-panel .grid-cell.is-unlocked:not(.is-bag-cell):not(.is-starter-cell) {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.18)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 9px),
        rgba(12,13,15,0.72);
    border-color: rgba(255,255,255,0.105);
    opacity: 0.88;
}

.wasteland-inventory-panel .grid-cell.is-bag-cell,
.wasteland-inventory-panel .grid-cell.is-starter-cell {
    background:
        radial-gradient(circle at center, rgba(247,147,30,0.18), transparent 54%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 9px),
        rgba(25,18,12,0.76);
    border-color: rgba(247,147,30,0.34);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.38);
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item {
    border: 2px solid var(--occupied-slot-border);
    background:
        linear-gradient(180deg, rgba(255,198,108,0.16), rgba(247,147,30,0.055)),
        url('../img/ui/slot_occupied.webp') center / 100% 100% no-repeat,
        linear-gradient(135deg, rgba(31,24,18,0.98), rgba(13,14,16,0.98));
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.72),
        inset 0 0 16px rgba(247,147,30,0.16),
        0 0 0 1px rgba(0,0,0,0.78),
        0 0 16px rgba(247,147,30,0.18),
        0 10px 24px rgba(0,0,0,0.34);
    opacity: 1;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.is-main-cell {
    z-index: 7;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.is-fill-cell {
    border-color: rgba(255,181,86,0.52);
    background:
        linear-gradient(180deg, rgba(255,198,108,0.10), rgba(247,147,30,0.045)),
        url('../img/ui/slot_occupied.webp') center / 100% 100% no-repeat,
        linear-gradient(135deg, rgba(26,21,17,0.95), rgba(11,12,14,0.96));
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.68),
        inset 0 0 14px rgba(247,147,30,0.10),
        0 0 0 1px rgba(0,0,0,0.76);
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.is-fill-cell::after,
.wasteland-inventory-panel .inventory-item-cell.is-normal-item .item-cell-fill {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255,190,98,0.34);
    border: 1px solid rgba(255,218,158,0.38);
    box-shadow: 0 0 12px rgba(247,147,30,0.30);
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item .item-icon {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    margin: 4px;
    border: 1px solid rgba(255,218,158,0.34);
    background: rgba(0,0,0,0.28);
    box-shadow: inset 0 0 10px rgba(247,147,30,0.12);
}

.wasteland-inventory-panel .inventory-item-cell.is-bag-item {
    border-color: rgba(247,147,30,0.30);
    background:
        radial-gradient(circle at center, rgba(247,147,30,0.20), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 9px),
        rgba(36,24,14,0.58);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.52);
}

.wasteland-inventory-panel .inventory-item-cell.is-bag-item.is-fill-cell::after,
.wasteland-inventory-panel .inventory-item-cell.is-bag-item .item-cell-fill,
.wasteland-inventory-panel .inventory-item-cell.is-bag-item .bag-cell-mark {
    width: 10px;
    height: 10px;
    background: rgba(247,147,30,0.42);
    border: 1px solid rgba(255,209,149,0.18);
    box-shadow: 0 0 8px rgba(247,147,30,0.18);
}

.wasteland-inventory-panel .inventory-item-cell.is-selected,
.wasteland-inventory-panel .inventory-item-cell.is-dragging {
    border-color: rgba(102,242,168,0.86);
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.72),
        0 0 0 2px rgba(102,242,168,0.24),
        0 0 22px rgba(102,242,168,0.30),
        0 14px 28px rgba(0,0,0,0.38);
}

/* =========================================================
   Phase 17.4 Shop interaction polish
   ========================================================= */
.wasteland-panel-actions {
    gap: 12px;
}

.wasteland-reroll-bar button:not(:disabled) {
    cursor: pointer;
    color: #f7ad45;
    border-color: rgba(247,147,30,0.38);
}

.wasteland-reroll-bar button:not(:disabled):hover {
    color: #ffd49d;
    border-color: rgba(247,147,30,0.68);
    box-shadow: 0 0 18px rgba(247,147,30,0.12);
}

.wasteland-shop-sell-zone {
    margin-top: auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px dashed rgba(247,147,30,0.34);
    background: linear-gradient(180deg, rgba(247,147,30,0.055), rgba(0,0,0,0.18));
    color: rgba(232,222,209,0.78);
}

.wasteland-shop-sell-zone i {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(247,147,30,0.28);
    color: #f79b23;
    background: rgba(247,147,30,0.08);
}

.wasteland-shop-sell-zone strong,
.wasteland-shop-sell-zone span {
    display: block;
    line-height: 1.15;
}

.wasteland-shop-sell-zone strong {
    color: #f79b23;
    font-size: 1.02rem;
    text-transform: uppercase;
}

.wasteland-shop-sell-zone span {
    margin-top: 4px;
    font-size: 0.9rem;
    color: rgba(232,222,209,0.65);
}

body.is-sell-drop-target .wasteland-shop-sell-zone {
    border-color: rgba(247,147,30,0.88);
    background: linear-gradient(180deg, rgba(247,147,30,0.18), rgba(50,28,10,0.34));
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.22), 0 0 24px rgba(247,147,30,0.20);
}

.wasteland-shop-item__footer .btn-disabled,
.wasteland-shop-item.is-bought .btn-disabled {
    border-radius: 0 !important;
    min-height: 38px;
}

.wasteland-inventory-panel .inventory-item-cell.is-item-hover,
.wasteland-inventory-panel .bag-grip.is-item-hover {
    transform: translateY(-3px);
    z-index: 14;
    filter: brightness(1.13);
    box-shadow: 0 0 0 1px rgba(247,147,30,0.42), 0 10px 24px rgba(0,0,0,0.42), 0 0 16px rgba(247,147,30,0.16);
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.is-fill-cell.is-item-hover {
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.54), 0 8px 18px rgba(0,0,0,0.38), 0 0 12px rgba(247,147,30,0.14);
}

.wasteland-inventory-panel .inventory-item-cell.is-bag-item.is-item-hover {
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.34), 0 8px 18px rgba(0,0,0,0.30);
}

.wasteland-inventory-panel .item-sell-form,
.wasteland-inventory-panel .bag-sell-form,
.wasteland-inventory-panel .bag-sell-button {
    display: none !important;
}

.wasteland-storage-card .storage-sell-form {
    margin-left: auto;
}

.wasteland-storage-card .storage-sell-form .link-button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(247,147,30,0.26);
    color: #f79b23;
    background: rgba(247,147,30,0.05);
}

.wasteland-shop-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

/* =========================================================
   Drag z-index fix: floating preview above shop/status/storage
   ========================================================= */
body.is-shop-dragging {
    cursor: grabbing;
    user-select: none;
}

body.is-shop-dragging .aib-site-header,
body.is-shop-dragging .aib-site-footer,
body.is-shop-dragging .shop-screen,
body.is-shop-dragging .shop-panel,
body.is-shop-dragging .wasteland-shop-panel,
body.is-shop-dragging .wasteland-inventory-panel,
body.is-shop-dragging .wasteland-status-panel,
body.is-shop-dragging .wasteland-storage-panel,
body.is-shop-dragging .wasteland-recipes-panel {
    overflow: visible;
}

.aib-drag-preview {
    --drag-preview-cell: 38px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483000;
    pointer-events: none;
    display: grid;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(247,147,30,0.72);
    background:
        linear-gradient(180deg, rgba(33,30,24,0.96), rgba(8,9,11,0.94));
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.64),
        0 18px 48px rgba(0,0,0,0.60),
        0 0 28px rgba(247,147,30,0.34);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
    will-change: transform;
}

.aib-drag-preview__label {
    max-width: calc(var(--drag-preview-w) * var(--drag-preview-cell));
    color: #f7a33a;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 0 rgba(0,0,0,0.72);
}

.aib-drag-preview__shape {
    display: grid;
    gap: 4px;
}

.aib-drag-preview__cell {
    width: var(--drag-preview-cell);
    height: var(--drag-preview-cell);
    border: 1px solid rgba(247,147,30,0.86);
    background:
        linear-gradient(135deg, rgba(247,147,30,0.34), rgba(33,34,37,0.92));
    box-shadow:
        inset 0 0 0 1px rgba(255,231,192,0.10),
        0 0 14px rgba(247,147,30,0.24);
}

.aib-drag-preview.is-bag .aib-drag-preview__cell {
    border-color: rgba(102,242,168,0.78);
    background:
        repeating-linear-gradient(135deg, rgba(102,242,168,0.13) 0 2px, transparent 2px 8px),
        linear-gradient(135deg, rgba(102,242,168,0.22), rgba(30,36,33,0.95));
    box-shadow:
        inset 0 0 0 1px rgba(207,255,224,0.10),
        0 0 14px rgba(102,242,168,0.24);
}

.aib-drag-preview__cell.is-origin::after {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    margin: 12px auto 0;
    border-radius: 2px;
    background: rgba(255,231,192,0.78);
    box-shadow: 0 0 12px rgba(247,147,30,0.34);
}

.wasteland-inventory-panel .inventory-item-cell.is-dragging,
.wasteland-inventory-panel .bag-grip.is-dragging,
.wasteland-storage-panel .storage-item-card.is-dragging,
.wasteland-shop-item.is-dragging {
    z-index: 9999 !important;
}

/* =========================================================
   Drag preview mouse-anchor refinement
   ========================================================= */
.aib-drag-preview {
    transform: translate3d(-50%, -50%, 0);
}

body.is-shop-dragging,
body.is-shop-dragging * {
    cursor: grabbing !important;
}

/* =========================================================
   Bag move handle: no wide overlap over inventory slots
   ========================================================= */
.wasteland-inventory-panel .bag-grip {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translate(-13px, -13px) !important;
    pointer-events: none;
    overflow: visible !important;
    z-index: 18;
}

.wasteland-inventory-panel .bag-grip .bag-grip-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(247,147,30,0.72);
    background: linear-gradient(180deg, #f7931e, #c86f12);
    color: #23170d;
    box-shadow: 0 8px 18px rgba(0,0,0,0.42), 0 0 16px rgba(247,147,30,0.26);
    pointer-events: auto;
    cursor: grab;
}

.wasteland-inventory-panel .bag-grip .bag-grip-text {
    display: none !important;
}

.wasteland-inventory-panel .bag-grip:hover,
.wasteland-inventory-panel .bag-grip.is-item-hover {
    transform: translate(-13px, -13px) !important;
    filter: none !important;
    box-shadow: none !important;
}

.wasteland-inventory-panel .bag-grip:hover .bag-grip-icon,
.wasteland-inventory-panel .bag-grip.is-item-hover .bag-grip-icon,
.wasteland-inventory-panel .bag-grip.is-selected .bag-grip-icon,
.wasteland-inventory-panel .bag-grip:focus-visible .bag-grip-icon {
    border-color: rgba(255,208,161,0.96);
    box-shadow: 0 10px 24px rgba(0,0,0,0.46), 0 0 0 3px rgba(247,147,30,0.16), 0 0 20px rgba(247,147,30,0.36);
}

.wasteland-inventory-panel .bag-grip.is-dragging {
    transform: translate(-13px, -13px) scale(0.96) !important;
    opacity: 0.82;
}

.wasteland-inventory-panel .bag-grip.is-selected,
.wasteland-inventory-panel .bag-grip:focus-visible {
    outline: 0 !important;
}

/* =========================================================
   Phase 18: Wasteland Battle Replay
   ========================================================= */
.wasteland-page-battle .aib-site-main {
    padding-bottom: 78px;
}

.wasteland-battle-view {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    width: min(1780px, calc(100vw - 56px));
    margin: 0 auto;
    overflow: hidden;
}

.wasteland-battle-topline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    min-height: 126px;
    padding-top: 6px;
}

.wasteland-battle-titleblock {
    min-width: 0;
}

.wasteland-title--battle {
    font-size: clamp(3rem, 4.7vw, 5.4rem);
    line-height: 0.88;
    margin-bottom: 8px;
    white-space: nowrap;
}

.wasteland-title--battle span {
    color: #f79b23;
    text-shadow: none;
}

.wasteland-battle-subline {
    margin: 0;
    color: rgba(232,222,209,0.82);
    font-size: 1.08rem;
}

.wasteland-battle-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding-bottom: 8px;
    flex: 0 0 auto;
}

.wasteland-battle-stage {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(520px, 1.35fr) minmax(360px, 0.88fr);
    gap: 18px;
    align-items: stretch;
    overflow: hidden;
}

.wasteland-battle-actor,
.wasteland-battle-feed-card {
    min-height: 0;
    height: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wasteland-battle-actor {
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

.wasteland-battle-actor.is-active {
    border-color: rgba(247,147,30,0.56);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.56), inset 0 0 0 3px rgba(247,147,30,0.08), 0 0 36px rgba(247,147,30,0.16);
}

.wasteland-battle-actor.is-hit {
    animation: wastelandBattleHit 220ms ease;
    filter: brightness(1.18) saturate(1.12);
}

.wasteland-battle-actor.is-healed {
    animation: wastelandBattleHeal 320ms ease;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.56), 0 0 36px rgba(112,204,97,0.16);
}

@keyframes wastelandBattleHit {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-5px); }
    62% { transform: translateX(5px); }
}

@keyframes wastelandBattleHeal {
    0%, 100% { transform: translateY(0); }
    45% { transform: translateY(-4px); }
}

.wasteland-battle-hero {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 2px 0 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-portrait {
    width: 106px;
    height: 106px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.26);
    background: rgba(0,0,0,0.32);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.wasteland-battle-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wasteland-battle-hero-copy h3 {
    margin: 0 0 3px;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    font-size: 1.35rem;
    line-height: 1;
}

.wasteland-battle-hero-copy p,
.wasteland-battle-hero-copy small {
    margin: 0;
    color: rgba(232,222,209,0.82);
}

.wasteland-battle-hpbar {
    height: 14px;
    margin: 12px 0 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.wasteland-battle-hpbar span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f7931e, #ffbe67);
    box-shadow: 0 0 18px rgba(247,147,30,0.26);
    transition: width 260ms ease;
}

.wasteland-battle-statgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-statgrid div {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.wasteland-battle-statgrid div:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.06);
}

.wasteland-battle-statgrid span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(232,222,209,0.72);
    font-size: 0.9rem;
}

.wasteland-battle-statgrid strong {
    color: #f0e5d4;
    font-weight: 800;
}

.wasteland-battle-statgrid .fa-heart { color: #d9624a; }
.wasteland-battle-statgrid .fa-kit-medical { color: #8fc96a; }
.wasteland-battle-statgrid .fa-biohazard { color: #b96eff; }
.wasteland-battle-statgrid .fa-bolt { color: #f4c05f; }

.wasteland-battle-board {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 14px 0;
    overflow: hidden;
}

.wasteland-battle-board .inventory-grid-scroll {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: visible;
}

.wasteland-battle-board .inventory-grid {
    --slot-size: clamp(31px, min(2.35vw, 4.25vh), 45px);
    gap: 3px;
}

.wasteland-battle-board .inventory-item-cell {
    cursor: default;
}

.wasteland-battle-board .inventory-item-cell small,
.wasteland-battle-board .item-sell-form,
.wasteland-battle-board .bag-grip,
.wasteland-battle-board .inventory-item-cell .item-icon {
    display: none !important;
}

.wasteland-battle-synergy-panel {
    flex: 0 0 auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-synergy-panel h3 {
    margin: 0 0 10px;
    color: #f79b23;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wasteland-battle-synergy-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 7px 8px;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.025);
}

.wasteland-battle-synergy-row > span {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    color: #f79b23;
    background: rgba(247,147,30,0.12);
}

.wasteland-battle-synergy-row strong {
    display: block;
    color: #f79b23;
    font-size: 0.88rem;
    text-transform: uppercase;
}

.wasteland-battle-synergy-row small {
    color: rgba(232,222,209,0.72);
    line-height: 1.25;
}

.wasteland-battle-feed-status {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 170px;
    gap: 14px;
    align-items: stretch;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-feed-status > div {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.wasteland-battle-feed-status span {
    color: rgba(232,222,209,0.66);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-battle-feed-status strong {
    color: #f79b23;
    font-size: 1.15rem;
}

.wasteland-battle-current-action {
    text-align: center;
    color: #e9ded0;
    font-weight: 800;
    line-height: 1.35;
    padding: 8px 12px;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-current-action.is-attack { color: #f79b23; }
.wasteland-battle-current-action.is-heal { color: #8fc96a; }
.wasteland-battle-current-action.is-debuff { color: #d9624a; }

.wasteland-battle-progress {
    width: 100%;
    height: 13px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}

.wasteland-battle-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f7931e, #ffbe67);
    transition: width 260ms ease;
}

.wasteland-battle-log {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 12px 0 0;
    list-style: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0;
}

.wasteland-battle-log li {
    display: grid;
    grid-template-columns: 46px 34px minmax(0, 1fr) 120px;
    gap: 10px;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: rgba(232,222,209,0.82);
}

.wasteland-battle-log li[hidden] {
    display: none !important;
}

.wasteland-battle-log li.is-current {
    background: rgba(247,147,30,0.08);
    box-shadow: inset 3px 0 0 #f7931e;
}

.wasteland-log-tick {
    color: #f0e4d5;
    font-weight: 800;
}

.wasteland-log-icon {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    color: #f79b23;
    background: rgba(247,147,30,0.10);
}

.wasteland-battle-log p {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wasteland-battle-log strong {
    justify-self: end;
    color: #f0e4d5;
    font-size: 0.9rem;
    white-space: nowrap;
}

.wasteland-battle-log .log-damage strong,
.wasteland-battle-log .log-attack strong,
.wasteland-battle-log .log-item strong { color: #d9624a; }
.wasteland-battle-log .log-heal strong { color: #8fc96a; }

.wasteland-battle-notice {
    width: min(1780px, calc(100vw - 56px));
    margin: 0 auto;
    padding: 14px 18px;
    z-index: 3;
}

.wasteland-battle-notice h2,
.wasteland-battle-notice p {
    margin: 0;
}

.wasteland-summary-modal {
    z-index: 1200;
}

.wasteland-summary-modal .summary-modal-backdrop {
    background: rgba(2, 4, 7, 0.52);
    backdrop-filter: none;
}

.wasteland-summary-dialog {
    width: min(680px, calc(100vw - 40px));
    max-height: calc(100dvh - 76px);
    padding: 20px;
    overflow: hidden;
}

.wasteland-summary-dialog .summary-dialog-head {
    margin-bottom: 12px;
}

.wasteland-summary-dialog h2 {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
}

.wasteland-summary-winner {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    margin-bottom: 12px;
}

.wasteland-summary-winner > span {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    color: #f79b23;
    font-size: 1.45rem;
    background: rgba(247,147,30,0.12);
}

.wasteland-summary-winner small,
.wasteland-summary-winner em,
.wasteland-summary-grid span {
    color: rgba(232,222,209,0.68);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-summary-winner strong {
    display: block;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 2.05rem;
    line-height: 1;
    text-transform: uppercase;
}

.wasteland-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
}

.wasteland-summary-grid > div {
    min-height: 88px;
    padding: 12px;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
}

.wasteland-summary-grid > div:nth-child(4n) {
    border-right: 0;
}

.wasteland-summary-grid strong {
    display: block;
    color: #f79b23;
    font-size: 1.55rem;
    margin-top: 6px;
}

.wasteland-summary-grid small {
    color: rgba(232,222,209,0.72);
    line-height: 1.3;
}

.wasteland-summary-grid .wasteland-battle-synergy-row {
    margin-top: 8px;
    grid-template-columns: 28px 1fr;
    min-height: 34px;
    padding: 4px;
    background: transparent;
}

.wasteland-summary-grid .wasteland-battle-synergy-row > span {
    width: 24px;
    height: 24px;
}

.wasteland-summary-dialog .summary-log-details {
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
}

.wasteland-summary-dialog .summary-log-details summary {
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #f79b23;
    font-weight: 800;
}

.wasteland-summary-dialog .summary-full-log {
    max-height: 190px;
    overflow: auto;
    padding: 0 12px 12px;
}

.wasteland-summary-dialog .summary-full-log li {
    grid-template-columns: 78px 120px 1fr;
}

.wasteland-summary-dialog .summary-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.wasteland-summary-primary {
    background: linear-gradient(180deg, #e9871a, #ad5f10);
    color: #fff4e8;
    border-color: rgba(255,190,103,0.72);
}

@media (max-width: 1500px) {
    .wasteland-battle-view { width: calc(100vw - 28px); }
    .wasteland-battle-stage {
        grid-template-columns: minmax(310px, 0.84fr) minmax(450px, 1.14fr) minmax(310px, 0.84fr);
        gap: 12px;
    }
    .wasteland-battle-actor,
    .wasteland-battle-feed-card { padding: 14px; }
    .wasteland-battle-board .inventory-grid { --slot-size: clamp(28px, min(2.15vw, 4vh), 39px); }
    .wasteland-battle-feed-status { grid-template-columns: 125px 1fr 145px; gap: 10px; }
}

@media (max-width: 1180px) {
    .wasteland-battle-view {
        overflow: auto;
        height: auto;
        min-height: 100%;
    }
    .wasteland-battle-stage {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .wasteland-battle-actor,
    .wasteland-battle-feed-card {
        min-height: 540px;
    }
    .wasteland-title--battle { white-space: normal; }
}

/* =========================================================
   Phase 18.1: Battle log / summary polish
   ========================================================= */
.wasteland-battle-owner {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 2px !important;
    color: rgba(232,222,209,0.76) !important;
    font-size: 0.88rem;
    line-height: 1.2;
}

.wasteland-battle-owner i {
    color: #9b5cff;
    font-size: 0.98rem;
}

.wasteland-battle-owner.is-npc {
    color: rgba(247,147,30,0.82) !important;
}

.wasteland-battle-log {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 12px 8px 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(247,147,30,0.45) rgba(255,255,255,0.05);
}

.wasteland-battle-log::-webkit-scrollbar { width: 8px; }
.wasteland-battle-log::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.wasteland-battle-log::-webkit-scrollbar-thumb { background: rgba(247,147,30,0.45); }

.wasteland-battle-log li[data-replay-log-row]:not([hidden]) {
    display: grid !important;
}

.wasteland-battle-log li {
    grid-template-columns: 44px 32px minmax(0, 1fr) minmax(92px, auto);
    min-height: 40px;
    background: rgba(255,255,255,0.018);
    border-left: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
}

.wasteland-battle-log li.is-current {
    background: linear-gradient(90deg, rgba(247,147,30,0.13), rgba(247,147,30,0.035));
    border-color: rgba(247,147,30,0.24);
}

.wasteland-battle-log p {
    white-space: normal;
    line-height: 1.28;
}

.wasteland-log-icon {
    border: 1px solid rgba(247,147,30,0.18);
}

.wasteland-summary-dialog {
    width: min(760px, calc(100vw - 40px));
    overflow: auto;
}

.wasteland-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wasteland-summary-grid > div:nth-child(4n) {
    border-right: 1px solid rgba(255,255,255,0.08);
}

.wasteland-summary-grid > div:nth-child(3n) {
    border-right: 0;
}

.wasteland-summary-grid > div:first-child {
    grid-column: span 1;
}

.wasteland-summary-grid.summary-result-danger > div {
    background: rgba(91,26,23,0.22);
}

.wasteland-summary-grid.summary-result-success > div {
    background: rgba(34,72,30,0.16);
}

.wasteland-summary-actions {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.wasteland-summary-actions .wasteland-summary-primary {
    width: 100%;
    min-height: 48px;
    font-size: 1.03rem;
}

.wasteland-summary-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wasteland-summary-secondary-actions form,
.wasteland-summary-secondary-actions .wasteland-mini-btn,
.wasteland-summary-secondary-actions button {
    width: 100%;
}

.wasteland-summary-secondary-actions .wasteland-mini-btn {
    min-height: 44px;
}

@media (max-width: 760px) {
    .wasteland-summary-grid,
    .wasteland-summary-secondary-actions {
        grid-template-columns: 1fr;
    }
    .wasteland-summary-grid > div,
    .wasteland-summary-grid > div:nth-child(3n),
    .wasteland-summary-grid > div:nth-child(4n) {
        border-right: 0;
    }
}

/* =========================================================
   Phase 18 polish: Battle log uses full middle panel height
   ========================================================= */
.wasteland-battle-feed-card {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
}

.wasteland-battle-feed-status {
    min-height: 74px;
}

.wasteland-battle-log.battle-replay-log {
    flex: none !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    padding: 14px 10px 14px 0 !important;
    margin: 0 !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.018), transparent 22%),
        repeating-linear-gradient(0deg, transparent 0 37px, rgba(255,255,255,0.018) 37px 38px);
}

.wasteland-battle-log.battle-replay-log li[data-replay-log-row]:not([hidden]) {
    display: grid !important;
}

.wasteland-battle-log.battle-replay-log li:nth-last-child(n+8):not([hidden]) {
    display: grid !important;
}

.wasteland-battle-log.battle-replay-log li {
    flex: 0 0 auto;
}

@media (max-width: 1220px) {
    .wasteland-battle-feed-card {
        min-height: 620px;
    }
}


/* =========================================================
   Phase 18.2: Battle-Replay Log wirklich vollständig anzeigen
   ========================================================= */
.wasteland-battle-log.battle-replay-log li:nth-last-child(n+6):not([hidden]),
.wasteland-battle-log.battle-replay-log li:nth-last-child(n+8):not([hidden]),
.battle-screen .wasteland-battle-log.battle-replay-log li:nth-last-child(n+6):not([hidden]),
.battle-screen .wasteland-battle-log.battle-replay-log li:nth-last-child(n+8):not([hidden]) {
    display: grid !important;
}

.wasteland-battle-log.battle-replay-log {
    overflow-y: auto !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
}

/* =========================================================
   Phase 19 item art pass
   ========================================================= */
.inventory-grid {
    --slot-gap: 3px;
    gap: var(--slot-gap);
}

.wasteland-inventory-panel .inventory-grid {
    --slot-gap: 3px;
    gap: var(--slot-gap);
}

.inventory-item-cell {
    position: relative;
}

.inventory-item-cell.has-item-art,
.inventory-item-cell.has-item-art.is-main-cell {
    overflow: visible;
}

.inventory-item-cell .item-art {
    display: none;
}

.inventory-item-cell.has-item-art.is-main-cell .item-art {
    display: block;
    position: absolute;
    left: 4px;
    top: 4px;
    width: calc((var(--slot-size) * var(--item-span-w)) + (var(--slot-gap) * (var(--item-span-w) - 1)) - 8px);
    height: calc((var(--slot-size) * var(--item-span-h)) + (var(--slot-gap) * (var(--item-span-h) - 1)) - 8px);
    z-index: 9;
    pointer-events: none;
}

.inventory-item-cell.has-item-art.is-main-cell .item-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.42));
}

.inventory-item-cell.has-item-art .item-icon.is-fallback-only {
    display: none;
}

.wasteland-inventory-panel .inventory-item-cell.has-item-art.is-main-cell {
    background: transparent;
}

.wasteland-inventory-panel .inventory-item-cell.has-item-art.is-fill-cell {
    background:
        linear-gradient(180deg, rgba(255,198,108,0.04), rgba(247,147,30,0.02)),
        url('../img/ui/slot_occupied.webp') center / 100% 100% no-repeat,
        linear-gradient(135deg, rgba(26,21,17,0.72), rgba(11,12,14,0.72));
}

.wasteland-inventory-panel .inventory-item-cell.has-item-art .item-cell-fill {
    display: none;
}

.wasteland-inventory-panel .inventory-item-cell.has-item-art.is-main-cell .item-icon,
.wasteland-battle-board .inventory-item-cell.has-item-art.is-main-cell .item-icon {
    display: none;
}

.wasteland-battle-board .inventory-item-cell.has-item-art.is-main-cell {
    background: transparent;
}

.wasteland-battle-board .inventory-item-cell.has-item-art .item-cell-fill {
    display: none;
}

.wasteland-battle-board .inventory-item-cell.has-item-art.is-fill-cell {
    background:
        linear-gradient(180deg, rgba(255,198,108,0.04), rgba(247,147,30,0.02)),
        url('../img/ui/slot_occupied.webp') center / 100% 100% no-repeat,
        linear-gradient(135deg, rgba(26,21,17,0.72), rgba(11,12,14,0.72));
}

/* =========================================================
   Phase 20: ruhigere Slots + Click-to-place statt Maus-Ghost
   ========================================================= */
.wasteland-inventory-panel .inventory-grid,
.wasteland-battle-board .inventory-grid,
.build-share-board .inventory-grid {
    --slot-gap: 3px;
    gap: var(--slot-gap) !important;
    padding: 0 !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0)),
        rgba(5, 6, 7, 0.18);
}

.wasteland-inventory-panel .grid-cell,
.wasteland-battle-board .grid-cell,
.build-share-board .grid-cell {
    border-radius: 1px !important;
    border: 1px solid rgba(247,147,30,0.055) !important;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 8px),
        rgba(8, 7, 6, 0.34) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.wasteland-inventory-panel .grid-cell.is-locked,
.wasteland-battle-board .grid-cell.is-locked,
.build-share-board .grid-cell.is-locked {
    border-color: rgba(255,255,255,0.025) !important;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 8px),
        rgba(0,0,0,0.22) !important;
    opacity: 0.55 !important;
}

.wasteland-inventory-panel .grid-cell.is-unlocked,
.wasteland-inventory-panel .grid-cell.is-bag-cell,
.wasteland-battle-board .grid-cell.is-unlocked,
.wasteland-battle-board .grid-cell.is-bag-cell,
.build-share-board .grid-cell.is-unlocked,
.build-share-board .grid-cell.is-bag-cell {
    border-color: rgba(247,147,30,0.085) !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.035), rgba(247,147,30,0.012)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 8px),
        rgba(12, 10, 8, 0.42) !important;
}

.wasteland-inventory-panel .grid-cell.is-starter-cell,
.wasteland-battle-board .grid-cell.is-starter-cell,
.build-share-board .grid-cell.is-starter-cell {
    border-color: rgba(247,147,30,0.12) !important;
}

.wasteland-inventory-panel .grid-cell:hover {
    border-color: rgba(247,147,30,0.34) !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.11), rgba(247,147,30,0.025)),
        rgba(16, 11, 6, 0.55) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item,
.wasteland-battle-board .inventory-item-cell.is-composite-item,
.build-share-board .inventory-item-cell.is-composite-item {
    z-index: 9;
    min-width: 0;
    min-height: 0;
    display: grid !important;
    place-items: center;
    padding: 3px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.20) !important;
    background:
        radial-gradient(circle at 35% 22%, rgba(247,147,30,0.10), transparent 38%),
        linear-gradient(180deg, rgba(22,19,15,0.54), rgba(8,9,10,0.50)) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,224,178,0.035),
        0 8px 18px rgba(0,0,0,0.30) !important;
    overflow: visible !important;
    cursor: pointer;
    touch-action: manipulation;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.inventory-item-cell.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-main-cell.is-composite-item .item-art {
    display: block !important;
    position: absolute !important;
    inset: 2px !important;
    width: auto !important;
    height: auto !important;
    z-index: 12 !important;
    pointer-events: none;
}

.inventory-item-cell.is-composite-item .item-art img,
.inventory-item-cell.has-item-art.is-composite-item .item-art img,
.inventory-item-cell.has-item-art.is-main-cell.is-composite-item .item-art img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.58)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item .item-icon,
.build-share-board .inventory-item-cell.is-composite-item .item-icon {
    width: min(100%, 46px) !important;
    height: min(100%, 46px) !important;
    border-radius: 4px !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art .item-icon,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item strong,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item small,
.wasteland-battle-board .inventory-item-cell.is-composite-item strong,
.wasteland-battle-board .inventory-item-cell.is-composite-item small,
.build-share-board .inventory-item-cell.is-composite-item strong,
.build-share-board .inventory-item-cell.is-composite-item small {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item:hover,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-selected,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item:focus-visible {
    z-index: 24;
    filter: brightness(1.12) saturate(1.08);
    outline: 2px solid rgba(247,147,30,0.62) !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(247,147,30,0.10), 0 13px 30px rgba(0,0,0,0.42) !important;
}

.inventory-grid.is-click-place-mode .inventory-item-cell,
.inventory-grid.is-click-place-mode .bag-grip,
.storage-item-card[data-draggable="1"],
.shop-item[data-draggable="1"],
.wasteland-shop-item[data-draggable="1"] {
    cursor: pointer !important;
}

.inventory-grid.is-click-place-mode.is-moving .inventory-item-cell,
.inventory-grid.is-click-place-mode.is-moving .bag-grip {
    cursor: pointer !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-dragging,
.wasteland-inventory-panel .bag-grip.is-dragging,
.wasteland-storage-panel .storage-item-card.is-dragging,
.wasteland-shop-item.is-dragging {
    opacity: 1 !important;
    transform: none !important;
}

.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview {
    display: none !important;
}

.placement-ghost-cell {
    border-radius: 2px !important;
    border-width: 1px !important;
    animation: none !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07), 0 0 16px rgba(0,0,0,0.28) !important;
}

.placement-ghost-cell.is-valid {
    border-color: rgba(124,251,91,0.78) !important;
    background: rgba(124,251,91,0.16) !important;
}

.placement-ghost-cell.is-invalid {
    border-color: rgba(231,111,81,0.86) !important;
    background: rgba(231,111,81,0.14) !important;
}

.placement-ghost-cell.is-origin::after {
    display: none !important;
}

.placement-ghost-label {
    transform: translate(-3px, -22px) !important;
    border-radius: 3px !important;
    background: rgba(8,9,11,0.96) !important;
}

.wasteland-inventory-panel .bag-grip {
    z-index: 30 !important;
}

.wasteland-inventory-panel .bag-grip .bag-grip-icon::before {
    content: "↕";
}

.wasteland-inventory-panel .bag-grip .bag-grip-icon {
    font-size: 0 !important;
}

.wasteland-inventory-panel .bag-grip .bag-grip-icon::before {
    font-size: 0.82rem !important;
    line-height: 1;
}

/* =========================================================
   Phase 21: Drag & Drop zurück + sichtbare Item-Rotation
   ========================================================= */
.inventory-grid.is-click-place-mode .inventory-item-cell[data-draggable="1"],
.inventory-grid.is-click-place-mode .bag-grip[data-draggable="1"],
.storage-item-card[data-draggable="1"],
.shop-item[data-draggable="1"],
.wasteland-shop-item[data-draggable="1"] {
    cursor: grab !important;
    touch-action: none !important;
}

.inventory-grid.is-click-place-mode .inventory-item-cell[data-draggable="1"]:active,
.inventory-grid.is-click-place-mode .bag-grip[data-draggable="1"]:active,
.storage-item-card[data-draggable="1"]:active,
.shop-item[data-draggable="1"]:active,
.wasteland-shop-item[data-draggable="1"]:active,
.inventory-grid.is-moving .inventory-item-cell[data-draggable="1"],
.inventory-grid.is-moving .bag-grip[data-draggable="1"] {
    cursor: grabbing !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-dragging,
.wasteland-inventory-panel .bag-grip.is-dragging {
    z-index: 40 !important;
    opacity: 0.72 !important;
    filter: brightness(1.12) saturate(1.08) !important;
    outline: 2px solid rgba(247,147,30,0.64) !important;
    outline-offset: 1px;
}

.inventory-item-cell.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-main-cell.is-composite-item .item-art {
    display: grid !important;
    place-items: center !important;
    overflow: visible !important;
}

.inventory-item-cell.is-composite-item .item-art img,
.inventory-item-cell.has-item-art.is-composite-item .item-art img,
.inventory-item-cell.has-item-art.is-main-cell.is-composite-item .item-art img {
    transform-origin: center center !important;
    transform: rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
    transition: transform 120ms ease, width 120ms ease, height 120ms ease, filter 120ms ease !important;
}

.inventory-item-cell.is-composite-item[data-rotation="1"] .item-art img,
.inventory-item-cell.is-composite-item[data-rotation="3"] .item-art img,
.inventory-item-cell.is-composite-item[data-visual-rotation="1"] .item-art img,
.inventory-item-cell.is-composite-item[data-visual-rotation="3"] .item-art img {
    width: calc(100% * var(--item-span-h, 1) / var(--item-span-w, 1)) !important;
    height: calc(100% * var(--item-span-w, 1) / var(--item-span-h, 1)) !important;
    max-width: none !important;
    max-height: none !important;
}

.inventory-item-cell.is-composite-item[data-rotation="0"] .item-art img,
.inventory-item-cell.is-composite-item[data-rotation="2"] .item-art img,
.inventory-item-cell.is-composite-item[data-visual-rotation="0"] .item-art img,
.inventory-item-cell.is-composite-item[data-visual-rotation="2"] .item-art img {
    width: 100% !important;
    height: 100% !important;
}

.inventory-item-cell.is-composite-item.is-rotation-preview .item-art img {
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.58)) drop-shadow(0 0 10px rgba(247,147,30,0.34)) !important;
}

.storage-item-card[data-visual-rotation] .storage-item-icon img,
.wasteland-shop-item[data-visual-rotation] .wasteland-shop-item__image img {
    transform-origin: center center !important;
    transform: rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
    transition: transform 120ms ease, filter 120ms ease !important;
}

.storage-item-card.is-rotation-preview .storage-item-icon img,
.wasteland-shop-item.is-rotation-preview .wasteland-shop-item__image img {
    filter: drop-shadow(0 0 10px rgba(247,147,30,0.38)) !important;
}

/* =========================================================
   Phase 22: Saubere Drag-Vorschau außerhalb des Grids + echte Rotations-Ghost-Art
   ========================================================= */
.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview {
    display: block !important;
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    opacity: 0.96 !important;
    filter: drop-shadow(0 18px 24px rgba(0,0,0,0.62)) !important;
    transform: translateZ(0) !important;
}

.aib-drag-preview__cells {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    gap: 3px !important;
    z-index: 1 !important;
}

.aib-drag-preview__cell {
    display: block !important;
    border: 1px solid rgba(247,147,30,0.64) !important;
    border-radius: 4px !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.20), rgba(247,147,30,0.07)),
        rgba(11, 9, 7, 0.62) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,224,178,0.08),
        0 0 14px rgba(247,147,30,0.15) !important;
}

.aib-drag-preview__art,
.placement-ghost-art {
    display: grid !important;
    place-items: center !important;
    overflow: visible !important;
    pointer-events: none !important;
}

.aib-drag-preview__art {
    position: absolute !important;
    inset: 1px !important;
    z-index: 3 !important;
}

.aib-drag-preview__art img,
.placement-ghost-art img {
    display: block !important;
    object-fit: contain !important;
    transform-origin: center center !important;
    transform: rotate(calc(var(--aib-preview-rotation, 0) * 90deg)) !important;
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.60)) !important;
    transition: transform 90ms ease, width 90ms ease, height 90ms ease, filter 90ms ease !important;
}

.aib-drag-preview[data-rotation="0"] .aib-drag-preview__art img,
.aib-drag-preview[data-rotation="2"] .aib-drag-preview__art img,
.placement-ghost-art[style*="--aib-preview-rotation: 0"] img,
.placement-ghost-art[style*="--aib-preview-rotation: 2"] img {
    width: 100% !important;
    height: 100% !important;
}

.aib-drag-preview[data-rotation="1"] .aib-drag-preview__art img,
.aib-drag-preview[data-rotation="3"] .aib-drag-preview__art img,
.placement-ghost-art[style*="--aib-preview-rotation: 1"] img,
.placement-ghost-art[style*="--aib-preview-rotation: 3"] img {
    width: calc(100% * var(--aib-preview-span-h, 1) / var(--aib-preview-span-w, 1)) !important;
    height: calc(100% * var(--aib-preview-span-w, 1) / var(--aib-preview-span-h, 1)) !important;
    max-width: none !important;
    max-height: none !important;
}

.aib-drag-preview__art span,
.placement-ghost-art span {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 5px !important;
    border: 1px solid rgba(247,147,30,0.55) !important;
    background: rgba(247,147,30,0.16) !important;
    color: #ffd0a1 !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
}

.aib-drag-preview__name {
    position: absolute !important;
    left: 50% !important;
    bottom: -24px !important;
    transform: translateX(-50%) !important;
    max-width: 140px !important;
    padding: 3px 7px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.42) !important;
    background: rgba(8,9,11,0.94) !important;
    color: #ffd0a1 !important;
    font-size: 0.58rem !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

.placement-ghost-art {
    z-index: 22 !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    margin: 1px !important;
    border-radius: 5px !important;
    opacity: 0.88 !important;
    background: rgba(8, 9, 11, 0.12) !important;
}

.placement-ghost-art.is-valid {
    outline: 1px solid rgba(124,251,91,0.58) !important;
    box-shadow: inset 0 0 0 1px rgba(124,251,91,0.08), 0 0 18px rgba(124,251,91,0.16) !important;
}

.placement-ghost-art.is-invalid {
    outline: 1px solid rgba(231,111,81,0.62) !important;
    box-shadow: inset 0 0 0 1px rgba(231,111,81,0.08), 0 0 18px rgba(231,111,81,0.14) !important;
}

.placement-ghost-art.is-invalid img,
.aib-drag-preview.is-invalid img {
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.60)) grayscale(0.25) saturate(0.85) !important;
}

.placement-ghost-label {
    z-index: 35 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-rotation-preview:not([data-visual-rotation]) .item-art img {
    transform: rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-grid.is-moving .inventory-item-cell.is-dragging.has-item-art {
    opacity: 0.38 !important;
}

/* =========================================================
   Phase 23: Drag/Rotation Full Rework - clean single ghost
   ========================================================= */
.placement-ghost-art,
.placement-ghost-label {
    display: none !important;
}

.wasteland-inventory-panel .grid-cell.is-preview-valid,
.wasteland-inventory-panel .grid-cell.is-preview-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-shape {
    position: relative !important;
    z-index: 18 !important;
}

.placement-ghost-cell {
    z-index: 20 !important;
    pointer-events: none !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    background: rgba(255,255,255,0.025) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.045), 0 0 10px rgba(0,0,0,0.28) !important;
}

.placement-ghost-cell.is-valid {
    border-color: rgba(124,251,91,0.72) !important;
    background: rgba(124,251,91,0.115) !important;
    box-shadow: inset 0 0 0 1px rgba(124,251,91,0.12), 0 0 14px rgba(124,251,91,0.12) !important;
}

.placement-ghost-cell.is-invalid {
    border-color: rgba(231,111,81,0.78) !important;
    background: rgba(231,111,81,0.105) !important;
    box-shadow: inset 0 0 0 1px rgba(231,111,81,0.12), 0 0 14px rgba(231,111,81,0.10) !important;
}

.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview {
    display: block !important;
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    border-radius: 7px !important;
    opacity: 0.94 !important;
    transform: translateZ(0) !important;
    filter: drop-shadow(0 18px 24px rgba(0,0,0,0.62)) !important;
}

.aib-drag-preview__frame {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    gap: var(--slot-gap, 3px) !important;
    z-index: 1 !important;
}

.aib-drag-preview__cell {
    display: block !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.48) !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.13), rgba(247,147,30,0.045)),
        rgba(7, 7, 8, 0.58) !important;
    box-shadow: inset 0 0 0 1px rgba(255,224,178,0.055) !important;
}

.aib-drag-preview__art {
    position: absolute !important;
    inset: 2px !important;
    display: grid !important;
    place-items: center !important;
    overflow: visible !important;
    z-index: 3 !important;
    pointer-events: none !important;
}

.aib-drag-preview__art img {
    display: block !important;
    object-fit: contain !important;
    transform-origin: center center !important;
    transform: rotate(calc(var(--aib-preview-rotation, 0) * 90deg)) !important;
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.68)) !important;
    transition: transform 80ms ease, width 80ms ease, height 80ms ease !important;
}

.aib-drag-preview[data-rotation="0"] .aib-drag-preview__art img,
.aib-drag-preview[data-rotation="2"] .aib-drag-preview__art img {
    width: 100% !important;
    height: 100% !important;
}

.aib-drag-preview[data-rotation="1"] .aib-drag-preview__art img,
.aib-drag-preview[data-rotation="3"] .aib-drag-preview__art img {
    width: calc(100% * var(--aib-preview-span-h, 1) / var(--aib-preview-span-w, 1)) !important;
    height: calc(100% * var(--aib-preview-span-w, 1) / var(--aib-preview-span-h, 1)) !important;
    max-width: none !important;
    max-height: none !important;
}

.aib-drag-preview__art span {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 5px !important;
    border: 1px solid rgba(247,147,30,0.55) !important;
    background: rgba(247,147,30,0.13) !important;
    color: #ffd0a1 !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
}

.aib-drag-preview__name,
.aib-drag-preview__label,
.aib-drag-preview__shape,
.aib-drag-preview__cells {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-dragging,
.wasteland-inventory-panel .bag-grip.is-dragging {
    opacity: 0.32 !important;
    filter: grayscale(0.15) brightness(0.85) !important;
    transform: none !important;
}

.wasteland-storage-board.is-drop-target,
.inventory-dock.is-drop-target .dock-panels,
.inventory-dock.is-drop-target .dock-tabbar {
    border-color: rgba(124,251,91,0.72) !important;
    box-shadow: inset 0 0 0 1px rgba(124,251,91,0.16), 0 0 22px rgba(124,251,91,0.12) !important;
}

.wasteland-storage-board.is-drop-target::after {
    content: 'IN STORAGE ABLEGEN';
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 8;
    padding: 4px 7px;
    border-radius: 4px;
    border: 1px solid rgba(124,251,91,0.42);
    background: rgba(5, 13, 8, 0.88);
    color: #b9ff9e;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    pointer-events: none;
}

body.is-sell-drop-target .wasteland-shop-sell-zone {
    border-color: rgba(247,147,30,0.86) !important;
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.15), 0 0 22px rgba(247,147,30,0.18) !important;
    transform: translateY(-1px) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-rotation-preview {
    outline: 2px solid rgba(247,147,30,0.66) !important;
    outline-offset: 1px !important;
}
.wasteland-storage-board {
    position: relative !important;
}

/* =========================================================
   Phase 24: Drag als reine Item-Grafik + sichere Item-Bounds
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item,
.wasteland-battle-board .inventory-item-cell.is-composite-item,
.build-share-board .inventory-item-cell.is-composite-item {
    overflow: hidden !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art {
    border-color: rgba(247,147,30,0.32) !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.055), rgba(247,147,30,0.018)),
        rgba(8, 8, 9, 0.28) !important;
    box-shadow: inset 0 0 0 1px rgba(255,224,178,0.035) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art .item-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art .item-art,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art .item-art {
    inset: 4px !important;
    overflow: hidden !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 4px !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art .item-art img {
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform-origin: center center !important;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.58)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="0"] .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="2"] .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="0"] .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="2"] .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="0"] .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="2"] .item-art img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="1"] .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="3"] .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="1"] .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="3"] .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="1"] .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="3"] .item-art img {
    width: calc(100% * var(--item-span-h, 1) / var(--item-span-w, 1)) !important;
    height: calc(100% * var(--item-span-w, 1) / var(--item-span-h, 1)) !important;
    max-width: none !important;
    max-height: none !important;
    transform: rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-rotation-preview.has-item-art .item-art img {
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.58)) !important;
}

.aib-drag-preview.is-art-only,
body.is-shop-dragging .aib-drag-preview.is-art-only {
    display: block !important;
    position: fixed !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 0.96 !important;
    transform: translateZ(0) scale(1.02) !important;
    filter: drop-shadow(0 16px 18px rgba(0,0,0,0.70)) !important;
    overflow: visible !important;
}

.aib-drag-preview.is-art-only .aib-drag-preview__frame,
.aib-drag-preview.is-art-only .aib-drag-preview__cell,
.aib-drag-preview.is-art-only .aib-drag-preview__cells,
.aib-drag-preview.is-art-only .aib-drag-preview__name,
.aib-drag-preview.is-art-only .aib-drag-preview__label,
.aib-drag-preview.is-art-only .aib-drag-preview__shape {
    display: none !important;
}

.aib-drag-preview.is-art-only .aib-drag-preview__art {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.aib-drag-preview.is-art-only .aib-drag-preview__art img {
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform-origin: center center !important;
    filter: drop-shadow(0 9px 12px rgba(0,0,0,0.68)) !important;
}

.aib-drag-preview.is-art-only[data-rotation="0"] .aib-drag-preview__art img,
.aib-drag-preview.is-art-only[data-rotation="2"] .aib-drag-preview__art img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: rotate(calc(var(--aib-preview-rotation, 0) * 90deg)) !important;
}

.aib-drag-preview.is-art-only[data-rotation="1"] .aib-drag-preview__art img,
.aib-drag-preview.is-art-only[data-rotation="3"] .aib-drag-preview__art img {
    width: calc(100% * var(--aib-preview-span-h, 1) / var(--aib-preview-span-w, 1)) !important;
    height: calc(100% * var(--aib-preview-span-w, 1) / var(--aib-preview-span-h, 1)) !important;
    max-width: none !important;
    max-height: none !important;
    transform: rotate(calc(var(--aib-preview-rotation, 0) * 90deg)) !important;
}

.aib-drag-preview.is-art-only .aib-drag-preview__art span {
    width: 42px !important;
    height: 42px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 8px !important;
    border: 1px solid rgba(247,147,30,0.42) !important;
    background: rgba(12, 10, 8, 0.78) !important;
    color: #ffd0a1 !important;
    font-weight: 950 !important;
}

.wasteland-inventory-panel .placement-ghost-cell {
    z-index: 30 !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.48) !important;
    background: rgba(247,147,30,0.055) !important;
    box-shadow: inset 0 0 0 1px rgba(255,224,178,0.035) !important;
    animation: none !important;
}

.wasteland-inventory-panel .placement-ghost-cell.is-valid,
.wasteland-inventory-panel .grid-cell.is-preview-valid {
    border-color: rgba(124,251,91,0.68) !important;
    background: rgba(124,251,91,0.09) !important;
    box-shadow: inset 0 0 0 1px rgba(124,251,91,0.10) !important;
}

.wasteland-inventory-panel .placement-ghost-cell.is-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-invalid {
    border-color: rgba(231,111,81,0.72) !important;
    background: rgba(231,111,81,0.09) !important;
    box-shadow: inset 0 0 0 1px rgba(231,111,81,0.10) !important;
}

.wasteland-inventory-panel .inventory-grid.is-moving .inventory-item-cell.is-dragging.has-item-art {
    opacity: 0.22 !important;
    filter: grayscale(0.25) brightness(0.75) !important;
}


/* =========================================================
   Phase 25: Rotierte Item-Grafik im Inventarrahmen sauber zentrieren
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art .item-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art .item-art,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art .item-art {
    position: absolute !important;
    inset: 4px !important;
    display: block !important;
    overflow: hidden !important;
    border-radius: 4px !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-item-art .item-art img {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform-origin: center center !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.58)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="0"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="2"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-visual-rotation="0"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-visual-rotation="2"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="0"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="2"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-visual-rotation="0"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-visual-rotation="2"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="0"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="2"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-visual-rotation="0"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-visual-rotation="2"].has-item-art .item-art img {
    width: 100% !important;
    height: 100% !important;
    transform: translate(-50%, -50%) rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="1"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-rotation="3"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-visual-rotation="1"].has-item-art .item-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item[data-visual-rotation="3"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="1"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-rotation="3"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-visual-rotation="1"].has-item-art .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item[data-visual-rotation="3"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="1"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-rotation="3"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-visual-rotation="1"].has-item-art .item-art img,
.build-share-board .inventory-item-cell.is-composite-item[data-visual-rotation="3"].has-item-art .item-art img {
    width: calc(100% * var(--item-span-h, 1) / var(--item-span-w, 1)) !important;
    height: calc(100% * var(--item-span-w, 1) / var(--item-span-h, 1)) !important;
    transform: translate(-50%, -50%) rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.toast-stack,
.toast {
    display: none !important;
}


/* =========================================================
   Shape display rework:
   Composite item containers span their bounding box for layout,
   but only the real occupied cells render a frame/background.
   This keeps L-/T-/cross-shaped items visually correct.
   ========================================================= */

.wasteland-inventory-panel .inventory-item-cell.is-composite-item,
.wasteland-battle-board .inventory-item-cell.is-composite-item,
.build-share-board .inventory-item-cell.is-composite-item {
    display: grid !important;
    grid-template-columns: repeat(var(--item-span-w, 1), minmax(0, 1fr)) !important;
    grid-template-rows: repeat(var(--item-span-h, 1), minmax(0, 1fr)) !important;
    gap: var(--grid-gap, 2px) !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item::before,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item::after,
.wasteland-battle-board .inventory-item-cell.is-composite-item::before,
.wasteland-battle-board .inventory-item-cell.is-composite-item::after,
.build-share-board .inventory-item-cell.is-composite-item::before,
.build-share-board .inventory-item-cell.is-composite-item::after {
    display: none !important;
}

.inventory-item-cell.is-composite-item .item-shape-cell {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.46) !important;
    background:
        linear-gradient(135deg, rgba(247,147,30,0.08), rgba(247,147,30,0.018)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px),
        rgba(8, 8, 9, 0.28) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,224,178,0.045),
        0 0 0 1px rgba(0,0,0,0.38) !important;
    pointer-events: none !important;
}

.inventory-item-cell.is-composite-item.is-selected .item-shape-cell,
.inventory-item-cell.is-composite-item:hover .item-shape-cell,
.inventory-item-cell.is-composite-item:focus-visible .item-shape-cell {
    border-color: rgba(247,147,30,0.92) !important;
    background:
        linear-gradient(135deg, rgba(247,147,30,0.18), rgba(247,147,30,0.04)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 5px),
        rgba(16, 12, 8, 0.40) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,224,178,0.08),
        0 0 14px rgba(247,147,30,0.18) !important;
}

.inventory-item-cell.is-composite-item.is-dragging .item-shape-cell {
    opacity: 0.34 !important;
    filter: grayscale(0.25) brightness(0.78) !important;
}

.inventory-item-cell.is-composite-item.has-adjacency-buff .item-shape-cell {
    border-color: rgba(124,251,91,0.64) !important;
    box-shadow:
        inset 0 0 0 1px rgba(124,251,91,0.08),
        0 0 14px rgba(124,251,91,0.14) !important;
}

.inventory-item-cell.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-composite-item .item-art,
.inventory-item-cell.has-item-art.is-main-cell.is-composite-item .item-art {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    z-index: 4 !important;
    inset: 4px !important;
    pointer-events: none !important;
}

.inventory-item-cell.is-composite-item .item-icon,
.inventory-item-cell.is-composite-item strong,
.inventory-item-cell.is-composite-item small {
    z-index: 5 !important;
    pointer-events: none !important;
}

/* Keep empty cells inside the bounding box visually empty. */
.inventory-item-cell.is-composite-item:not(.has-item-art) .item-icon {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    align-self: center !important;
    justify-self: center !important;
}

/* Toasts stay disabled. */
.toast-stack,
.toast {
    display: none !important;
}


/* =========================================================
   Irregular item shape display like reference mock:
   no full 2x2 parent block, only occupied L/T/etc cells are framed,
   and the artwork is clipped to the real shape contour.
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape {
    display: grid !important;
    grid-template-columns: repeat(var(--item-span-w, 1), minmax(0, 1fr)) !important;
    grid-template-rows: repeat(var(--item-span-h, 1), minmax(0, 1fr)) !important;
    gap: var(--grid-gap, 3px) !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: relative !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape::after,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape::after,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape::after {
    display: none !important;
    content: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 100% !important;
    min-height: 100% !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    position: relative !important;
    z-index: 1 !important;
    border: 2px solid rgba(255,176,74,0.82) !important;
    border-radius: 8px !important;
    background:
        linear-gradient(180deg, rgba(255,198,108,0.10), rgba(247,147,30,0.04)),
        linear-gradient(135deg, rgba(31,24,18,0.96), rgba(13,14,16,0.96)) !important;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.66),
        inset 0 0 12px rgba(247,147,30,0.10),
        0 0 0 1px rgba(0,0,0,0.58) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-art,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-art {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    position: absolute !important;
    inset: 4px !important;
    z-index: 4 !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-art img,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-art img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape small,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape small,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape small {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:hover .item-shape-cell,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-selected .item-shape-cell,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:focus-visible .item-shape-cell {
    border-color: rgba(102,242,168,0.88) !important;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.68),
        0 0 0 2px rgba(102,242,168,0.16),
        0 0 14px rgba(102,242,168,0.20) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-rotation-preview .item-shape-cell {
    border-color: rgba(255,208,161,0.96) !important;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.68),
        0 0 0 2px rgba(255,208,161,0.14),
        0 0 14px rgba(247,147,30,0.20) !important;
}


/* =========================================================
   SVG shape renderer rework for irregular items
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape {
    display: block !important;
    position: relative !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape::after,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape::after,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape::before,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape::after {
    display: none !important;
    content: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-cell {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
    display: block !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--fill,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--fill,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--fill {
    fill: rgba(20, 16, 12, 0.94) !important;
    stroke: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__image {
    transform-box: fill-box;
    transform-origin: center center;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke {
    fill: transparent !important;
    stroke: rgba(255, 176, 74, 0.92) !important;
    stroke-width: 0.08 !important;
    vector-effect: non-scaling-stroke;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:hover .item-shape-svg__cell--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-selected .item-shape-svg__cell--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:focus-visible .item-shape-svg__cell--stroke {
    stroke: rgba(102,242,168,0.92) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-rotation-preview .item-shape-svg__cell--stroke {
    stroke: rgba(255,208,161,0.98) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape small,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape small,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape strong,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape small {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* Stronger visible outline for SVG irregular items */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke,
.build-share-board .inventory-item-cell.is-composite-item.is-irregular-shape .item-shape-svg__cell--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 0.10 !important;
    vector-effect: non-scaling-stroke !important;
    paint-order: stroke fill markers;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:hover .item-shape-svg__cell--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-selected .item-shape-svg__cell--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape:focus-visible .item-shape-svg__cell--stroke {
    stroke: #66f2a8 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.is-irregular-shape.is-rotation-preview .item-shape-svg__cell--stroke {
    stroke: #ffd0a1 !important;
}

/* =========================================================
   Final inventory shape-outline renderer
   - one SVG outline per real item shape (1x1, 2x1, L, T, cross, etc.)
   - artwork is clipped to the occupied cells only
   - no rectangular parent outline around irregular items
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg {
    display: block !important;
    position: relative !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg:hover,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg:hover {
    outline: 0 !important;
    box-shadow: none !important;
    filter: brightness(1.08) saturate(1.06);
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg::before,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg::after,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg::before,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg::after,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg::before,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg::after {
    display: none !important;
    content: none !important;
}

.inventory-item-cell.is-composite-item.has-shape-svg .item-shape-cell,
.inventory-item-cell.is-composite-item.has-shape-svg .item-art {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
    display: block !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill {
    fill: rgba(14, 12, 10, 0.70) !important;
    stroke: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image {
    transform-box: fill-box !important;
    transform-origin: center center !important;
    filter: drop-shadow(0 9px 13px rgba(0,0,0,0.58)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 0.085 !important;
    vector-effect: non-scaling-stroke !important;
    stroke-linejoin: round !important;
    stroke-linecap: round !important;
    paint-order: stroke fill markers !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible .item-shape-svg__path--stroke {
    stroke: #66f2a8 !important;
    stroke-width: 0.10 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    stroke: #ffd0a1 !important;
    stroke-width: 0.10 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-dragging,
.wasteland-inventory-panel .inventory-grid.is-moving .inventory-item-cell.is-composite-item.has-shape-svg.is-dragging {
    opacity: 0.34 !important;
    filter: grayscale(0.20) brightness(0.78) !important;
    outline: 0 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke {
    stroke: rgba(124,251,91,0.92) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-icon,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art strong,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art small,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art strong,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art small,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art strong,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art small {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon {
    position: absolute !important;
    inset: 6px !important;
    z-index: 4 !important;
    display: grid !important;
    place-items: center !important;
    pointer-events: none !important;
}


/* =========================================================
   Hotfix: sichtbare orangene Shape-Outline im Inventar
   - SVG-Stroke ist bewusst auf 1px gesetzt, damit 1x1, 2x1, L-Formen
     und weitere Shapes dezent, aber weiterhin korrekt sichtbar bleiben.

   Hotfix: SVG-Artwork rotiert jetzt in Gegenrichtung zur Shape-Rotation.
   Die Shape/Slot-Logik bleibt unverändert, nur das Bild wird visuell korrigiert.
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 1px !important;
    vector-effect: non-scaling-stroke !important;
    stroke-linejoin: round !important;
    stroke-linecap: round !important;
    paint-order: stroke fill markers !important;
    filter: drop-shadow(0 0 2px rgba(247,165,59,0.92)) drop-shadow(0 0 6px rgba(247,147,30,0.38)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible .item-shape-svg__path--stroke {
    stroke: #ffb64f !important;
    stroke-width: 1px !important;
    filter: drop-shadow(0 0 3px rgba(255,182,79,0.96)) drop-shadow(0 0 9px rgba(247,147,30,0.46)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    stroke: #ffd0a1 !important;
    stroke-width: 1px !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-adjacency-buff .item-shape-svg__path--stroke {
    stroke: #f7a53b !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke {
    stroke-width: 1px !important;
}

/* Drag-Performance: Preview wird per GPU-Transform bewegt statt per left/top Layout-Reflow. */
.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview {
    left: 0 !important;
    top: 0 !important;
    will-change: transform !important;
    contain: layout paint style !important;
    pointer-events: none !important;
}

.inventory-grid.is-moving .placement-ghost-cell,
.inventory-grid.is-moving .grid-cell.is-preview-shape,
.inventory-grid.is-moving .adjacency-link-line,
.inventory-grid.is-moving .adjacency-link-label {
    transition: none !important;
    animation: none !important;
}

/* =========================================================
   Finaler Drag-Fix: Preview folgt wieder exakt der Maus.
   Wichtig: ältere Regeln setzen transform mit !important; JS schreibt
   deshalb den GPU-Transform ebenfalls als !important.
   ========================================================= */
.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview,
.aib-drag-preview.is-art-only,
body.is-shop-dragging .aib-drag-preview.is-art-only {
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    pointer-events: none !important;
    will-change: transform !important;
    contain: layout paint style !important;
    transition: none !important;
}

.aib-drag-preview .aib-drag-preview__art,
.aib-drag-preview .aib-drag-preview__art img,
.aib-drag-preview.is-art-only .aib-drag-preview__art,
.aib-drag-preview.is-art-only .aib-drag-preview__art img {
    transition: none !important;
    animation: none !important;
}

.inventory-grid.is-moving .placement-ghost-cell,
.inventory-grid.is-moving .grid-cell.is-preview-valid,
.inventory-grid.is-moving .grid-cell.is-preview-invalid,
.inventory-grid.is-moving .grid-cell.is-preview-shape {
    transition: none !important;
    animation: none !important;
}

/* =========================================================
   Phase 26: Clean shape renderer + instant drag/drop feedback
   - keine SVG-/Filter-Glows mehr auf der Shape oder dem Item-Bild
   - Hover/Selected bleibt orange statt grün und verändert die Clip-Form nicht
   - Drag-/Placement-Ghost rendert ohne Schatten/Animation für schnelle Reaktion
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg {
    shape-rendering: crispEdges !important;
    overflow: visible !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image {
    filter: none !important;
    opacity: 1 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill {
    fill: rgba(12, 10, 8, 0.42) !important;
    stroke: none !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 1px !important;
    vector-effect: non-scaling-stroke !important;
    stroke-linejoin: round !important;
    stroke-linecap: round !important;
    paint-order: stroke fill markers !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    stroke: #ffb64f !important;
}

.wasteland-inventory-panel .inventory-grid.has-preview .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-grid.is-moving .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke {
    stroke: #f7a53b !important;
}

.wasteland-inventory-panel .placement-ghost-cell,
.wasteland-inventory-panel .placement-ghost-cell.is-valid,
.wasteland-inventory-panel .placement-ghost-cell.is-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-valid,
.wasteland-inventory-panel .grid-cell.is-preview-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-shape {
    box-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
}

.wasteland-inventory-panel .placement-ghost-cell {
    border: 1px solid rgba(247,165,59,0.76) !important;
    background: rgba(247,147,30,0.045) !important;
}

.wasteland-inventory-panel .placement-ghost-cell.is-valid,
.wasteland-inventory-panel .grid-cell.is-preview-valid {
    border-color: rgba(124,251,91,0.74) !important;
    background: rgba(124,251,91,0.075) !important;
}

.wasteland-inventory-panel .placement-ghost-cell.is-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-invalid {
    border-color: rgba(231,111,81,0.78) !important;
    background: rgba(231,111,81,0.075) !important;
}

.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview,
.aib-drag-preview.is-art-only,
body.is-shop-dragging .aib-drag-preview.is-art-only,
.aib-drag-preview .aib-drag-preview__art img,
.aib-drag-preview.is-art-only .aib-drag-preview__art img {
    filter: none !important;
    box-shadow: none !important;
    transition: none !important;
    animation: none !important;
}

body.is-shop-ajax-loading .shop-screen::after {
    display: none !important;
}


/* =========================================================
   Phase 27: Shape clip/border finalisierung
   - SVG-Bildrotation läuft über SVG-transform statt CSS-transform
   - ClipPath besteht aus echten belegten Zellen
   - Orange 1px Outline wird als innenliegende Kantenlinie gerendert,
     damit oben/links nichts mehr abgeschnitten wird
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover {
    transform: none !important;
    z-index: 24;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg {
    overflow: visible !important;
    shape-rendering: crispEdges !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__clip-rects rect,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__clip-rects rect,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__clip-rects rect {
    shape-rendering: crispEdges !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image {
    filter: none !important;
    opacity: 1 !important;
    image-rendering: auto !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill {
    fill: rgba(12, 10, 8, 0.42) !important;
    stroke: none !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 1px !important;
    vector-effect: non-scaling-stroke !important;
    stroke-linejoin: miter !important;
    stroke-linecap: square !important;
    paint-order: stroke fill markers !important;
    filter: none !important;
}

.wasteland-inventory-panel .placement-ghost-cell,
.wasteland-inventory-panel .placement-ghost-cell.is-valid,
.wasteland-inventory-panel .placement-ghost-cell.is-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-valid,
.wasteland-inventory-panel .grid-cell.is-preview-invalid,
.wasteland-inventory-panel .grid-cell.is-preview-shape,
.aib-drag-preview,
body.is-shop-dragging .aib-drag-preview,
.aib-drag-preview.is-art-only,
body.is-shop-dragging .aib-drag-preview.is-art-only {
    filter: none !important;
    box-shadow: none !important;
    transition: none !important;
    animation: none !important;
}

/* =========================================================
   Phase 28: Shape SVG border/art final fix
   - artwork is clipped by the final shape group, not by the image itself
   - outer shape path is used for the 1px border so no L-edge disappears
   - padded SVG viewport keeps top/left stroke visible
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg {
    overflow: visible !important;
    shape-rendering: geometricPrecision !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art {
    pointer-events: none !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__image {
    clip-path: none !important;
    filter: none !important;
    opacity: 1 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-selected .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-item-hover .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:focus-visible .item-shape-svg__path--stroke,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.is-rotation-preview .item-shape-svg__path--stroke {
    fill: none !important;
    stroke: #f7a53b !important;
    stroke-opacity: 1 !important;
    stroke-width: 1px !important;
    vector-effect: non-scaling-stroke !important;
    stroke-linejoin: miter !important;
    stroke-linecap: square !important;
    filter: none !important;
}


/* =========================================================
   Final hotfix: SVG-Shape artwork asset fallback
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg:not(.has-item-art) .item-icon {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-shape-svg__image,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-shape-svg__image,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg.has-item-art .item-shape-svg__image {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}


/* =========================================================
   Final hotfix: render item art as clipped HTML layer, SVG as border only
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2 !important;
    display: block !important;
    overflow: hidden !important;
    pointer-events: none !important;
    background:
        linear-gradient(135deg, rgba(247,147,30,0.08), rgba(247,147,30,0.018)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px),
        rgba(8, 8, 9, 0.36) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-art img {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    transform-origin: center center !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="0"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="2"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-visual-rotation="0"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-visual-rotation="2"] .item-shape-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="0"] .item-shape-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="2"] .item-shape-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="0"] .item-shape-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="2"] .item-shape-art img {
    width: 100% !important;
    height: 100% !important;
    transform: translate(-50%, -50%) rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="1"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="3"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-visual-rotation="1"] .item-shape-art img,
.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg[data-visual-rotation="3"] .item-shape-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="1"] .item-shape-art img,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="3"] .item-shape-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="1"] .item-shape-art img,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg[data-rotation="3"] .item-shape-art img {
    width: calc(100% * var(--item-span-h, 1) / var(--item-span-w, 1)) !important;
    height: calc(100% * var(--item-span-w, 1) / var(--item-span-h, 1)) !important;
    transform: translate(-50%, -50%) rotate(calc(var(--aib-item-rotation, 0) * 90deg)) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg {
    z-index: 3 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__art {
    display: none !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.wasteland-battle-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill,
.build-share-board .inventory-item-cell.is-composite-item.has-shape-svg .item-shape-svg__path--fill {
    fill: transparent !important;
}

/* =========================================================
   Phase 18.9: Shop right panel scroll + next-round button offset
   ========================================================= */
body.wasteland-page-shop .wasteland-shop-topline {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 250px);
    padding-right: 18px;
}

body.wasteland-page-shop .wasteland-next-round-box {
    width: 250px;
    min-width: 250px;
    justify-self: end;
    margin-right: 0;
}

body.wasteland-page-shop .wasteland-synergy-panel {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

body.wasteland-page-shop .wasteland-synergy-panel h3 {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0 0 6px;
    background: linear-gradient(180deg, rgba(13, 15, 18, 0.96), rgba(13, 15, 18, 0.86));
}

body.wasteland-page-shop .wasteland-synergy-panel::-webkit-scrollbar {
    width: 7px;
}

body.wasteland-page-shop .wasteland-synergy-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.045);
}

body.wasteland-page-shop .wasteland-synergy-panel::-webkit-scrollbar-thumb {
    background: rgba(247,147,30,0.48);
    border-radius: 999px;
}

@media (max-width: 1180px) {
    body.wasteland-page-shop .wasteland-shop-topline {
        padding-right: 0;
    }

    body.wasteland-page-shop .wasteland-next-round-box {
        width: min(100%, 310px);
        min-width: 0;
        justify-self: start;
    }

    body.wasteland-page-shop .wasteland-synergy-panel {
        max-height: 280px;
    }
}

/* =========================================================
   Phase 18.10: Storage card rework
   - verhindert Button/Text-Überlagerung
   - größere Item-Zeilen statt gequetschter Mini-Karten
   - sauberer Icon-, Text- und Button-Bereich
   ========================================================= */
body.wasteland-page-shop .wasteland-storage-board {
    min-height: 0;
    overflow: hidden;
}

body.wasteland-page-shop .wasteland-storage-bin {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
    gap: 8px !important;
    padding: 1px 6px 2px 1px !important;
    align-content: start !important;
    align-items: start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable;
}

body.wasteland-page-shop .wasteland-storage-bin.is-empty {
    display: grid !important;
    place-items: center !important;
    min-height: 92px;
    padding: 12px !important;
    border: 1px dashed rgba(247,147,30,0.20);
    background: rgba(0,0,0,0.18);
}

body.wasteland-page-shop .wasteland-storage-bin.is-empty .muted {
    margin: 0;
    color: rgba(232,222,209,0.55);
}

body.wasteland-page-shop .wasteland-storage-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 10px !important;
    border: 1px solid rgba(247,147,30,0.16) !important;
    border-radius: 4px !important;
    background:
        linear-gradient(90deg, rgba(247,147,30,0.075), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.16)),
        rgba(9, 10, 12, 0.88) !important;
    box-shadow: inset 0 0 0 1px rgba(255,224,178,0.025) !important;
    overflow: hidden !important;
}

body.wasteland-page-shop .wasteland-storage-card:hover,
body.wasteland-page-shop .wasteland-storage-card.is-selected,
body.wasteland-page-shop .wasteland-storage-card.is-item-hover {
    border-color: rgba(247,147,30,0.46) !important;
    background:
        linear-gradient(90deg, rgba(247,147,30,0.12), transparent 45%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)),
        rgba(11, 12, 14, 0.94) !important;
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.08) !important;
    transform: none !important;
}

body.wasteland-page-shop .wasteland-storage-card .storage-item-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 4px !important;
    border: 1px solid rgba(247,147,30,0.22) !important;
    background:
        radial-gradient(circle at 50% 40%, rgba(255,255,255,0.08), transparent 70%),
        rgba(0,0,0,0.32) !important;
    overflow: hidden !important;
}

body.wasteland-page-shop .wasteland-storage-card .storage-item-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    filter: none !important;
}

body.wasteland-page-shop .wasteland-storage-card > div {
    min-width: 0 !important;
    display: grid !important;
    gap: 2px !important;
    align-content: center !important;
}

body.wasteland-page-shop .wasteland-storage-card strong {
    display: block !important;
    max-width: 100% !important;
    color: #f1e6d7 !important;
    font-size: 0.82rem !important;
    line-height: 1.15 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.wasteland-page-shop .wasteland-storage-card small {
    display: block !important;
    color: rgba(232,222,209,0.58) !important;
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.wasteland-page-shop .wasteland-storage-card .storage-sell-form {
    margin: 0 !important;
    align-self: center !important;
    justify-self: end !important;
    min-width: max-content !important;
}

body.wasteland-page-shop .wasteland-storage-card .storage-sell-form .link-button {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 12px !important;
    border-radius: 2px !important;
    border: 1px solid rgba(247,147,30,0.48) !important;
    background:
        linear-gradient(180deg, rgba(247,147,30,0.16), rgba(247,147,30,0.055)),
        rgba(32, 17, 6, 0.82) !important;
    color: #ffb64f !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
}

body.wasteland-page-shop .wasteland-storage-card .storage-sell-form .link-button:hover {
    border-color: rgba(255,182,79,0.82) !important;
    background: rgba(247,147,30,0.18) !important;
    color: #ffd0a1 !important;
}

@media (max-width: 980px) {
    body.wasteland-page-shop .wasteland-storage-bin {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    body.wasteland-page-shop .wasteland-storage-card {
        grid-template-columns: 38px minmax(0, 1fr) !important;
    }

    body.wasteland-page-shop .wasteland-storage-card .storage-item-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }

    body.wasteland-page-shop .wasteland-storage-card .storage-sell-form {
        grid-column: 1 / -1;
        justify-self: stretch !important;
    }

    body.wasteland-page-shop .wasteland-storage-card .storage-sell-form .link-button {
        width: 100% !important;
    }
}

/* =========================================================
   Profile dropdown + profile/build management + admin theme
   ========================================================= */
.wasteland-user-menu {
    position: relative;
    display: inline-flex;
    z-index: 80;
}

.wasteland-user-menu summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.wasteland-user-menu summary::-webkit-details-marker {
    display: none;
}

.wasteland-user-pill__chevron {
    transition: transform 160ms ease, color 160ms ease;
}

.wasteland-user-menu[open] .wasteland-user-pill {
    color: #f79b23;
    border-color: rgba(247,147,30,0.48);
    box-shadow: inset 0 0 0 1px rgba(247,147,30,0.12), 0 12px 28px rgba(0,0,0,0.42);
}

.wasteland-user-menu[open] .wasteland-user-pill__chevron {
    transform: rotate(180deg);
}

.wasteland-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 28px));
    padding: 8px;
    border: 1px solid rgba(247,147,30,0.34);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(25,24,22,0.98), rgba(8,10,13,0.98));
    box-shadow: 0 22px 42px rgba(0,0,0,0.62), inset 0 0 0 1px rgba(255,255,255,0.035);
}

.wasteland-user-dropdown::before {
    content: "";
    position: absolute;
    right: 22px;
    top: -6px;
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    border-left: 1px solid rgba(247,147,30,0.34);
    border-top: 1px solid rgba(247,147,30,0.34);
    background: rgba(25,24,22,0.98);
}

.wasteland-user-dropdown a {
    position: relative;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 12px;
    color: #e8ded1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.wasteland-user-dropdown a i {
    color: #f79b23;
    text-align: center;
}

.wasteland-user-dropdown a:hover,
.wasteland-user-dropdown a:focus-visible {
    color: #fff0d8;
    border-color: rgba(247,147,30,0.32);
    background: linear-gradient(90deg, rgba(247,147,30,0.18), rgba(247,147,30,0.035));
    outline: none;
}

.wasteland-user-dropdown a.wasteland-user-dropdown__logout {
    margin-top: 6px;
    border-top-color: rgba(247,147,30,0.14);
}

.wasteland-user-dropdown a.wasteland-user-dropdown__logout i {
    color: #ffb35b;
}

.wasteland-copy-btn {
    min-width: 150px;
}

.wasteland-copy-btn.is-copied {
    color: #10130f !important;
    background: linear-gradient(180deg, #98ff6f, #57c93f) !important;
    border-color: rgba(152,255,111,0.78) !important;
}

.wasteland-mini-btn--danger {
    border-color: rgba(231,84,62,0.55) !important;
    color: #ffd0c8 !important;
    background: linear-gradient(180deg, rgba(122,35,24,0.8), rgba(42,10,8,0.72)) !important;
}

.wasteland-mini-btn--danger:hover {
    color: #fff !important;
    border-color: rgba(255,116,92,0.82) !important;
    box-shadow: 0 0 18px rgba(231,84,62,0.25);
}

.wasteland-profile-edit-layout {
    position: relative;
    z-index: 2;
    width: min(1480px, calc(100vw - 64px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(520px, 1fr);
    gap: 18px;
    align-items: start;
}

.wasteland-profile-edit-layout .wasteland-profile-edit-panel {
    width: auto;
    margin: 0;
}

.wasteland-profile-edit-panel .wasteland-panel-heading,
.wasteland-profile-build-manager .wasteland-panel-heading {
    margin-bottom: 16px;
}

.wasteland-profile-visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(232,222,209,0.82);
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.wasteland-profile-visibility-badge.is-public {
    color: #b9ff9f;
    border-color: rgba(124,251,91,0.34);
    background: rgba(124,251,91,0.075);
}

.wasteland-profile-visibility-badge.is-private {
    color: #ffd18b;
    border-color: rgba(247,147,30,0.38);
    background: rgba(247,147,30,0.095);
}

.wasteland-profile-identity__copy .wasteland-profile-visibility-badge {
    margin-top: 10px;
}

.wasteland-toggle-row {
    display: grid !important;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 14px !important;
    padding: 14px;
    border: 1px solid rgba(247,147,30,0.18);
    background: rgba(0,0,0,0.22);
    border-radius: 6px;
}

.wasteland-toggle-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wasteland-toggle-row__switch {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.24);
}

.wasteland-toggle-row__switch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9a958d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.55);
    transition: transform 160ms ease, background 160ms ease;
}

.wasteland-toggle-row input:checked + .wasteland-toggle-row__switch {
    border-color: rgba(247,147,30,0.52);
    background: rgba(247,147,30,0.22);
}

.wasteland-toggle-row input:checked + .wasteland-toggle-row__switch::after {
    transform: translateX(22px);
    background: #f79b23;
}

.wasteland-toggle-row__copy {
    display: flex !important;
    flex-direction: column;
    gap: 4px !important;
}

.wasteland-toggle-row__copy strong {
    color: #f79b23;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-profile-build-manager {
    padding: 24px;
    min-width: 0;
}

.wasteland-profile-build-manager__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(58vh, 620px);
    overflow: auto;
    padding-right: 4px;
}

.wasteland-profile-build-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.22));
}

.wasteland-profile-build-row.is-active {
    border-color: rgba(124,251,91,0.24);
}

.wasteland-profile-build-row.is-inactive {
    opacity: 0.82;
    border-color: rgba(255,255,255,0.07);
}

.wasteland-profile-build-row__main {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.wasteland-profile-build-row__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 4px;
    border: 1px solid rgba(247,147,30,0.28);
    background: rgba(247,147,30,0.09);
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wasteland-profile-build-row.is-active .wasteland-profile-build-row__status {
    color: #b9ff9f;
    border-color: rgba(124,251,91,0.34);
    background: rgba(124,251,91,0.08);
}

.wasteland-profile-build-row h3 {
    margin: 0 0 4px;
    color: #fff1dc;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-profile-build-row p,
.wasteland-profile-build-row small {
    display: block;
    margin: 0;
    color: rgba(232,222,209,0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-profile-build-row code {
    color: #f79b23;
    background: rgba(0,0,0,0.24);
    padding: 1px 5px;
    border-radius: 3px;
}

.wasteland-profile-build-row__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wasteland-profile-build-row__actions form {
    margin: 0;
}

body.wasteland-page-admin {
    overflow-y: auto;
}

body.wasteland-page-admin .aib-site-main {
    padding-bottom: 110px;
}

body.wasteland-page-admin .admin-page {
    position: relative;
    z-index: 2;
    width: min(1760px, calc(100vw - 56px));
    margin: 0 auto;
    padding: 22px 0 32px;
}

body.wasteland-page-admin .section-kicker {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

body.wasteland-page-admin .admin-header-row {
    padding: 18px 20px;
    border: 1px solid rgba(247,147,30,0.18);
    background: linear-gradient(180deg, rgba(18,18,18,0.82), rgba(5,7,10,0.72));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 18px 40px rgba(0,0,0,0.28);
    border-radius: 8px;
}

body.wasteland-page-admin .admin-header-row h1,
body.wasteland-page-admin .admin-card h2,
body.wasteland-page-admin .admin-card-head h2,
body.wasteland-page-admin .admin-form-block h2 {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

body.wasteland-page-admin .admin-tabs {
    position: relative;
    z-index: 2;
    width: min(1760px, calc(100vw - 56px));
    margin: 0 auto 12px;
    padding: 10px;
    border: 1px solid rgba(247,147,30,0.16);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(12,14,16,0.86), rgba(3,4,6,0.72));
}

body.wasteland-page-admin .admin-tab {
    min-height: 42px;
    border-radius: 4px;
    border-color: rgba(247,147,30,0.16);
    background: rgba(0,0,0,0.24);
    color: rgba(232,222,209,0.78);
    font-family: "Pixelify Sans", sans-serif;
    letter-spacing: 0.05em;
}

body.wasteland-page-admin .admin-tab.is-active,
body.wasteland-page-admin .admin-tab:hover {
    color: #130d06;
    background: linear-gradient(180deg, #ffae34, #c26c12);
    border-color: rgba(255,184,73,0.8);
}

body.wasteland-page-admin .admin-stat,
body.wasteland-page-admin .admin-card,
body.wasteland-page-admin .admin-form {
    border: 1px solid rgba(247,147,30,0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(20,20,20,0.86), rgba(5,7,10,0.76));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

body.wasteland-page-admin .admin-stat strong {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
}

body.wasteland-page-admin .admin-table-wrap {
    border-radius: 6px;
    border-color: rgba(247,147,30,0.18);
    background: rgba(0,0,0,0.22);
}

body.wasteland-page-admin .admin-table th {
    background: rgba(13,12,10,0.98);
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
}

body.wasteland-page-admin .admin-table td {
    border-bottom-color: rgba(247,147,30,0.08);
    color: rgba(239,226,207,0.88);
}

body.wasteland-page-admin .admin-table tbody tr:hover {
    background: rgba(247,147,30,0.055);
}

body.wasteland-page-admin .admin-form-block {
    border-radius: 6px;
    border-color: rgba(247,147,30,0.14);
    background: rgba(0,0,0,0.18);
}

body.wasteland-page-admin .admin-form label {
    color: rgba(232,222,209,0.78);
}

body.wasteland-page-admin .admin-form input,
body.wasteland-page-admin .admin-form select,
body.wasteland-page-admin .admin-form textarea {
    border-radius: 4px;
    border-color: rgba(247,147,30,0.2);
    background: linear-gradient(180deg, rgba(10,10,11,0.95), rgba(4,5,7,0.92));
    color: #efe2cf;
}

body.wasteland-page-admin .admin-form input:focus,
body.wasteland-page-admin .admin-form select:focus,
body.wasteland-page-admin .admin-form textarea:focus {
    border-color: rgba(247,147,30,0.55);
    box-shadow: 0 0 0 2px rgba(247,147,30,0.10);
}

body.wasteland-page-admin .admin-log-line {
    border-radius: 6px;
    border-color: rgba(247,147,30,0.14);
    background: rgba(0,0,0,0.22);
}

@media (max-width: 1180px) {
    .wasteland-profile-edit-layout {
        grid-template-columns: 1fr;
        width: min(920px, calc(100vw - 32px));
    }

    .wasteland-profile-build-row {
        grid-template-columns: 1fr;
    }

    .wasteland-profile-build-row__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .wasteland-user-menu,
    .wasteland-user-pill {
        width: 100%;
    }

    .wasteland-user-dropdown {
        left: 0;
        right: auto;
    }

    .wasteland-profile-build-row__main {
        grid-template-columns: 1fr;
    }

    .wasteland-profile-build-row__actions,
    .wasteland-profile-build-row__actions form,
    .wasteland-profile-build-row__actions .wasteland-mini-btn {
        width: 100%;
    }
}

.wasteland-toggle-row__switch,
.wasteland-toggle-row__copy {
    color: inherit !important;
    font-weight: initial !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* =========================================================
   Audio/language settings + admin polish
   ========================================================= */
.wasteland-language-switch {
    position: relative;
    display: inline-grid;
    grid-template-columns: 20px minmax(46px, auto) 14px;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 0 10px;
    border: 1px solid rgba(247,147,30,0.22);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(22,20,18,0.92), rgba(7,8,10,0.88));
    color: #f79b23;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.wasteland-language-switch select {
    appearance: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: #efe2cf;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 0 2px;
}

.wasteland-language-switch select option {
    background: #101010;
    color: #efe2cf;
}

.wasteland-language-switch:hover,
.wasteland-language-switch:focus-within {
    border-color: rgba(247,147,30,0.55);
    box-shadow: 0 0 16px rgba(247,147,30,0.12), inset 0 0 0 1px rgba(247,147,30,0.08);
}

.wasteland-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.wasteland-profile-setting {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(247,147,30,0.16);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.20));
}

.wasteland-profile-setting > span {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-volume-control {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
    min-height: 50px;
}

.wasteland-volume-control i,
.wasteland-volume-control output {
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
}

.wasteland-volume-control output {
    text-align: right;
}

.wasteland-volume-control input[type="range"] {
    appearance: none;
    height: 8px;
    padding: 0;
    border: 1px solid rgba(247,147,30,0.18);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(247,147,30,0.82), rgba(247,147,30,0.32));
    cursor: pointer;
}

.wasteland-volume-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255,220,160,0.8);
    background: linear-gradient(180deg, #ffae34, #c36b12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}

.wasteland-volume-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255,220,160,0.8);
    background: linear-gradient(180deg, #ffae34, #c36b12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}

.wasteland-profile-language-wrap select {
    width: 100%;
}

body.wasteland-page-admin .admin-page::before {
    content: "";
    position: absolute;
    inset: 10px -12px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(247,147,30,0.55), transparent);
    pointer-events: none;
}

body.wasteland-page-admin .admin-card,
body.wasteland-page-admin .admin-header-row,
body.wasteland-page-admin .admin-tabs {
    backdrop-filter: none;
}

body.wasteland-page-admin .admin-stat-grid {
    align-items: stretch;
}

body.wasteland-page-admin .admin-stat {
    position: relative;
    overflow: hidden;
    min-height: 94px;
}

body.wasteland-page-admin .admin-stat::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -24px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247,147,30,0.16), transparent 70%);
    pointer-events: none;
}

body.wasteland-page-admin .btn,
body.wasteland-page-admin .btn-small {
    border-radius: 4px;
    font-family: "Pixelify Sans", sans-serif;
    letter-spacing: 0.045em;
}

@media (max-width: 980px) {
    .wasteland-settings-grid {
        grid-template-columns: 1fr;
    }

    .wasteland-language-switch {
        min-height: 42px;
    }
}

/* Legal pages + consent banner */
.wasteland-legal-view {
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
}

.wasteland-legal-panel {
    padding: 24px;
}

.wasteland-legal-content {
    color: rgba(245, 237, 216, .9);
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.65;
}

.wasteland-legal-content h1,
.wasteland-legal-content h2 {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    color: var(--wl-orange, #f7a21b);
    letter-spacing: .04em;
    margin: 22px 0 10px;
}

.wasteland-legal-content h1:first-child {
    margin-top: 0;
}

.wasteland-legal-content p {
    margin: 0 0 16px;
    max-width: 92ch;
}

.wasteland-legal-note,
.wasteland-legal-actions {
    margin-top: 22px;
    border-top: 1px solid rgba(247, 162, 27, .2);
    padding-top: 16px;
}

.wasteland-legal-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(245, 237, 216, .68);
    font-size: .92rem;
}

.aib-legal-footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.aib-legal-footer-links a,
.aib-legal-footer-links button {
    color: rgba(245, 237, 216, .72);
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.aib-legal-footer-links a:hover,
.aib-legal-footer-links button:hover {
    color: var(--wl-orange, #f7a21b);
}

.aib-consent-banner {
    position: fixed;
    inset: auto 18px 18px auto;
    z-index: 12000;
    max-width: min(680px, calc(100vw - 36px));
}

.aib-consent-banner[hidden] {
    display: none !important;
}

.aib-consent-banner__panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    padding: 18px;
    border-color: rgba(247, 162, 27, .55);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

.aib-consent-banner__copy strong {
    display: block;
    color: var(--wl-orange, #f7a21b);
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.aib-consent-banner__copy p,
.aib-consent-banner__copy small {
    color: rgba(245, 237, 216, .78);
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.45;
}

.aib-consent-options {
    display: grid;
    gap: 8px;
}

.aib-consent-options label {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 2px 8px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(247, 162, 27, .24);
    background: rgba(0, 0, 0, .22);
}

.aib-consent-options small {
    grid-column: 2;
    color: rgba(245, 237, 216, .55);
    font-size: .78rem;
}

.aib-consent-banner__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-legal-page .admin-header-row {
    align-items: flex-start;
}

.admin-legal-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.admin-legal-editor-grid label {
    display: grid;
    gap: 8px;
}

.admin-legal-editor-grid textarea {
    min-height: 520px;
    resize: vertical;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.45;
}

.admin-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .aib-consent-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .aib-consent-banner__panel,
    .admin-legal-editor-grid {
        grid-template-columns: 1fr;
    }

    .wasteland-legal-view {
        width: min(100%, calc(100vw - 24px));
    }
}

/* =========================================================
   Footer polish: legal links + status row
   ========================================================= */
body.aib-immersive-page .aib-site-footer.aib-footer-panel,
.aib-site-footer.aib-footer-panel {
    display: block;
    grid-template-columns: 1fr !important;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    isolation: isolate;
}

.aib-footer-panel::before {
    content: '';
    position: absolute;
    inset: 8px 22px auto 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(247, 147, 30, 0.42), rgba(255, 214, 126, 0.22), transparent);
    pointer-events: none;
}

.aib-footer-panel::after {
    content: '';
    position: absolute;
    right: clamp(42px, 5vw, 96px);
    bottom: 16px;
    width: clamp(48px, 5vw, 92px);
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(247, 147, 30, 0.95), rgba(255, 116, 20, 0.65), transparent);
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.45), 0 0 34px rgba(255, 100, 10, 0.18);
    pointer-events: none;
}

.aib-footer-panel__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(7px, 0.9vh, 10px);
    min-width: 0;
    padding: clamp(13px, 1.4vh, 16px) clamp(28px, 2.4vw, 44px) clamp(15px, 1.5vh, 18px);
}

.aib-footer-status {
    display: grid;
    grid-template-columns: minmax(240px, 1.1fr) minmax(250px, 1fr) minmax(320px, 1.12fr) minmax(250px, 1fr);
    align-items: center;
    gap: clamp(10px, 1vw, 18px);
    min-width: 0;
}

body.aib-immersive-page .aib-footer-status__item,
.aib-footer-status__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 28px;
    padding: 0 clamp(10px, 1vw, 18px);
    color: rgba(232, 222, 209, 0.84);
    font-size: clamp(0.88rem, 0.95vw, 1.05rem);
    line-height: 1.1;
    letter-spacing: 0.055em;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px dashed rgba(255, 255, 255, 0.13);
}

body.aib-immersive-page .aib-footer-status__item--brand,
.aib-footer-status__item--brand {
    justify-content: flex-start;
    padding-left: 0;
}

body.aib-immersive-page .aib-footer-status__item--community,
.aib-footer-status__item--community {
    justify-content: flex-end;
    padding-right: 0;
    border-right: 0;
    color: var(--aib-orange-soft, #ffb04a);
    font-weight: 800;
    text-shadow: 0 0 14px rgba(247, 147, 30, 0.18);
}

body.aib-immersive-page .aib-footer-status__item--community:hover,
.aib-footer-status__item--community:hover {
    color: #ffd17a;
    text-shadow: 0 0 18px rgba(247, 147, 30, 0.42);
}

.aib-footer-dot {
    flex: 0 0 auto;
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    border: 1px solid rgba(247, 147, 30, 0.78);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 181, 68, 0.95) 0 22%, rgba(10, 10, 10, 0.9) 24% 100%);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.70), 0 0 12px rgba(247, 147, 30, 0.50);
}

.aib-footer-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.2vw, 20px);
    min-width: 0;
    padding-top: clamp(7px, 0.9vh, 10px);
    border-top: 1px solid rgba(247, 147, 30, 0.16);
}

.aib-footer-legal__label {
    flex: 0 0 auto;
    color: rgba(247, 147, 30, 0.95);
    font-family: 'Pixelify Sans', 'Share Tech Mono', monospace;
    font-size: clamp(0.82rem, 0.85vw, 0.96rem);
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(247, 147, 30, 0.16);
}

.aib-footer-legal__label::before,
.aib-footer-legal__label::after {
    content: '—';
    color: rgba(247, 147, 30, 0.35);
    margin: 0 8px 0 0;
}

.aib-footer-legal__label::after {
    margin: 0 0 0 8px;
}

.aib-footer-panel .aib-legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
}

body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links a,
body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links button,
.aib-footer-panel .aib-legal-footer-links a,
.aib-footer-panel .aib-legal-footer-links button {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(247, 147, 30, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(0, 0, 0, 0.12));
    color: rgba(232, 222, 209, 0.74);
    font-family: 'Share Tech Mono', ui-monospace, monospace;
    font-size: clamp(0.78rem, 0.78vw, 0.90rem);
    letter-spacing: 0.045em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links a:hover,
body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links button:hover,
.aib-footer-panel .aib-legal-footer-links a:hover,
.aib-footer-panel .aib-legal-footer-links button:hover {
    color: var(--aib-orange-soft, #ffb04a);
    border-color: rgba(247, 147, 30, 0.42);
    background: linear-gradient(180deg, rgba(247, 147, 30, 0.11), rgba(0, 0, 0, 0.18));
    transform: translateY(-1px);
}

body.aib-immersive-page .aib-site-main {
    padding-bottom: clamp(118px, 12vh, 148px);
}

body.wasteland-page-shop .aib-site-main,
body.wasteland-page-battle .aib-site-main {
    padding-bottom: clamp(104px, 10vh, 132px);
}

@media (max-width: 1420px) {
    .aib-footer-status {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.aib-immersive-page .aib-footer-status__item,
    .aib-footer-status__item {
        justify-content: flex-start;
    }

    body.aib-immersive-page .aib-footer-status__item:nth-child(2n),
    .aib-footer-status__item:nth-child(2n) {
        justify-content: flex-end;
        border-right: 0;
    }

    .aib-footer-legal {
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 860px) {
    body.aib-immersive-page .aib-site-footer.aib-footer-panel,
    .aib-site-footer.aib-footer-panel {
        width: min(100vw - 16px, 760px);
        min-height: 0;
        background-size: 100% 100%;
    }

    .aib-footer-panel__inner {
        padding: 15px 18px 17px;
    }

    .aib-footer-status {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    body.aib-immersive-page .aib-footer-status__item,
    body.aib-immersive-page .aib-footer-status__item:nth-child(2n),
    .aib-footer-status__item,
    .aib-footer-status__item:nth-child(2n) {
        justify-content: center;
        min-height: 24px;
        padding: 0;
        border-right: 0;
        font-size: 0.84rem;
    }

    .aib-footer-legal__label {
        display: none;
    }

    .aib-footer-panel .aib-legal-footer-links {
        gap: 6px;
    }

    .aib-footer-panel .aib-legal-footer-links a,
    .aib-footer-panel .aib-legal-footer-links button {
        min-height: 26px;
        padding-inline: 8px;
        font-size: 0.76rem;
    }

    body.aib-immersive-page .aib-site-main {
        padding-bottom: 230px;
    }
}


/* =========================================================
   Header cleanup + legal-page scrolling
   ========================================================= */
body.aib-immersive-page .aib-site-actions {
    margin-left: auto;
}

body.aib-immersive-page .aib-site-header:not(:has(.aib-site-nav)) {
    justify-content: space-between;
}

body.wasteland-page-legal.aib-immersive-page {
    overflow-x: hidden;
    overflow-y: auto;
}

body.wasteland-page-legal.aib-immersive-page .aib-site-shell,
body.wasteland-page-legal.aib-immersive-page .aib-site-main {
    height: auto;
    min-height: 0;
    overflow: visible;
}

body.wasteland-page-legal.aib-immersive-page .aib-site-shell {
    min-height: 100dvh;
}

body.wasteland-page-legal.aib-immersive-page .aib-site-main {
    display: block;
    padding-bottom: clamp(170px, 18vh, 240px);
}

body.wasteland-page-legal .wasteland-view,
body.wasteland-page-legal .wasteland-legal-view {
    min-height: auto !important;
    height: auto;
    overflow: visible !important;
}

body.wasteland-page-legal .wasteland-legal-view {
    width: min(1180px, calc(100vw - 72px));
    padding-bottom: clamp(26px, 4vh, 54px) !important;
}

body.wasteland-page-legal .wasteland-legal-panel,
body.wasteland-page-legal .wasteland-legal-content {
    max-height: none;
    overflow: visible;
}

@media (max-width: 900px) {
    body.wasteland-page-legal .wasteland-legal-view {
        width: min(100%, calc(100vw - 24px));
    }
}

/* =========================================================
   Profile/shared-build rework, account deletion, battle tooltips
   ========================================================= */
.wasteland-profile-builds--compact {
    max-height: min(38vh, 430px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wasteland-profile-builds--compact .wasteland-panel-heading {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.wasteland-profile-builds__grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow: auto;
    padding-right: 4px;
    align-content: start;
}

.wasteland-build-card--compact {
    gap: 9px;
    padding: 10px;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.22)),
        radial-gradient(circle at 10% 0%, rgba(247,147,30,0.10), transparent 9rem);
    border-color: rgba(247,147,30,0.17);
}

.wasteland-build-card--compact .wasteland-build-card__head {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.wasteland-build-card--compact .wasteland-build-card__portrait {
    width: 64px;
    height: 74px;
}

.wasteland-build-card__copy {
    min-width: 0;
}

.wasteland-build-card--compact h3 {
    font-size: 1.08rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-build-card--compact p {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-build-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.wasteland-build-card__stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    color: rgba(232,222,209,0.76);
    font-size: 0.78rem;
}

.wasteland-build-card--compact .wasteland-build-card__items {
    max-height: 72px;
    overflow: hidden;
}

.wasteland-build-card--compact .wasteland-item-chip {
    padding: 5px 7px;
    gap: 6px;
}

.wasteland-build-card--compact .wasteland-item-chip__icon {
    width: 22px;
    height: 22px;
}

.wasteland-build-card--compact .wasteland-item-chip__name {
    max-width: 92px;
    font-size: 0.78rem;
}

.wasteland-build-card--compact .wasteland-build-card__meta {
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.055);
}

.wasteland-build-card--compact .wasteland-build-card__meta strong {
    font-size: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wasteland-build-card__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.wasteland-build-card__actions .wasteland-mini-btn {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.82rem;
}

.wasteland-profile-empty--compact {
    min-height: 160px;
    grid-column: 1 / -1;
}

.wasteland-account-danger-zone {
    grid-column: 1 / -1;
    padding: 22px 24px;
    border-color: rgba(231,76,60,0.32) !important;
    background:
        linear-gradient(180deg, rgba(76,12,8,0.34), rgba(0,0,0,0.36)),
        linear-gradient(135deg, rgba(20,20,20,0.86), rgba(5,7,10,0.78)) !important;
}

.wasteland-account-danger-zone h2 {
    color: #ff8a64;
}

.wasteland-account-danger-zone p {
    margin: 0 0 16px;
    color: rgba(232,222,209,0.76);
    line-height: 1.55;
}

.wasteland-account-delete-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wasteland-toggle-row--danger {
    border-color: rgba(231,76,60,0.32) !important;
    background: rgba(231,76,60,0.08) !important;
}

.wasteland-toggle-row--danger input:checked + .wasteland-toggle-row__switch {
    border-color: rgba(231,76,60,0.72);
    background: rgba(231,76,60,0.28);
}

.wasteland-toggle-row--danger input:checked + .wasteland-toggle-row__switch::after {
    background: #ff6b4a;
}

.wasteland-mini-btn--danger {
    border-color: rgba(231,76,60,0.52) !important;
    background: linear-gradient(180deg, rgba(120,30,22,0.78), rgba(60,10,8,0.78)) !important;
    color: #ffd6cc !important;
}

.wasteland-mini-btn--danger:hover {
    border-color: rgba(255,118,86,0.9) !important;
    color: #fff1ec !important;
}

/* Redesigned public shared build page */
.wasteland-build-view--reworked {
    width: min(1560px, calc(100vw - 96px));
}

.wasteland-build-view--reworked .wasteland-title {
    font-size: clamp(3.1rem, 4.7vw, 5.3rem);
}

.wasteland-build-hero-intro {
    margin-bottom: 12px !important;
}

.wasteland-build-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(360px, 1.2fr);
    gap: 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.wasteland-build-toolbar > div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.075);
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}

.wasteland-build-toolbar span {
    display: block;
    margin-bottom: 5px;
    color: rgba(232,222,209,0.66);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wasteland-build-toolbar strong {
    display: block;
    color: #f79b23;
    font-size: 1.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wasteland-build-toolbar__actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end;
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
}

.wasteland-build-toolbar__actions form {
    margin: 0;
}

.wasteland-build-redesign-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.8fr) minmax(520px, 1.2fr);
    gap: 16px;
    align-items: start;
}

.wasteland-build-inventory-card,
.wasteland-build-overview-card,
.wasteland-build-items-panel--compact {
    position: relative;
    z-index: 2;
    padding: 16px;
}

.wasteland-build-inventory-frame {
    max-height: min(62vh, 620px);
    overflow: auto;
    padding: 8px 0 0;
}

.wasteland-build-view--reworked .inventory-panel {
    min-width: 0;
}

.wasteland-build-overview-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wasteland-build-overview-hero {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.075);
}

.wasteland-build-overview-hero__portrait {
    width: 104px;
    height: 126px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(247,147,30,0.26);
    background: rgba(0,0,0,0.26);
}

.wasteland-build-overview-hero__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wasteland-build-overview-hero span,
.wasteland-build-overview-hero p {
    color: rgba(232,222,209,0.68);
}

.wasteland-build-overview-hero h2 {
    margin: 4px 0;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.wasteland-build-statgrid div {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.075);
    background: rgba(255,255,255,0.035);
}

.wasteland-build-statgrid span {
    display: block;
    margin-bottom: 5px;
    color: rgba(232,222,209,0.66);
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.wasteland-build-statgrid strong {
    color: #f79b23;
    font-size: 1.45rem;
}

.wasteland-build-synergies h3 {
    margin: 0 0 10px;
    color: #efe2cf;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
}

.wasteland-build-synergy-list {
    display: grid;
    gap: 9px;
}

.wasteland-build-synergy-list article {
    padding: 12px 14px;
    border-radius: 5px;
    border: 1px solid rgba(247,147,30,0.24);
    background: linear-gradient(90deg, rgba(247,147,30,0.13), rgba(0,0,0,0.18));
}

.wasteland-build-synergy-list strong {
    display: block;
    color: #f79b23;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wasteland-build-synergy-list small {
    color: rgba(232,222,209,0.76);
}

.wasteland-build-items-panel--compact {
    margin-top: 14px;
}

.wasteland-build-items-panel--compact .item-list-inline {
    max-height: 118px;
    overflow: auto;
}

/* Battle/build tooltips use the same metal tooltip design as shop/inventory. */
body.wasteland-page-battle .aib-tooltip-popover,
body.wasteland-page-build .aib-tooltip-popover {
    width: min(440px, calc(100vw - 28px));
    padding: 0;
    border-radius: 0;
    border: 1px solid rgba(247,147,30,0.46);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 18%),
        radial-gradient(circle at 12% 8%, rgba(247,147,30,0.12), transparent 16rem),
        linear-gradient(135deg, rgba(24,25,29,0.98), rgba(7,8,11,0.985));
    box-shadow:
        inset 0 0 0 2px rgba(0,0,0,0.62),
        inset 0 0 0 3px rgba(255,255,255,0.032),
        0 26px 70px rgba(0,0,0,0.62),
        0 0 30px rgba(247,147,30,0.12);
    color: #efe2cf;
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
    overflow: hidden;
}

body.wasteland-page-battle .aib-tooltip-popover::before,
body.wasteland-page-build .aib-tooltip-popover::before {
    content: "";
    position: absolute;
    inset: 8px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.07);
    border-top-color: rgba(255,255,255,0.16);
    border-bottom-color: rgba(247,147,30,0.22);
    clip-path: inherit;
}

body.wasteland-page-battle .aib-tooltip-popover::after,
body.wasteland-page-build .aib-tooltip-popover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.25;
    background:
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(255,255,255,0.025) 34px 35px),
        repeating-linear-gradient(0deg, transparent 0 18px, rgba(255,255,255,0.018) 18px 19px);
}

body.wasteland-page-battle .aib-tooltip-popover > strong,
body.wasteland-page-build .aib-tooltip-popover > strong {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 14px 16px 11px;
    color: #f79b23;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(247,147,30,0.22);
    background: linear-gradient(90deg, rgba(247,147,30,0.12), transparent 72%);
}

body.wasteland-page-battle .aib-tooltip-popover dl,
body.wasteland-page-build .aib-tooltip-popover dl {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0;
    padding: 8px 14px 14px;
}

body.wasteland-page-battle .aib-tooltip-popover dt,
body.wasteland-page-battle .aib-tooltip-popover dd,
body.wasteland-page-build .aib-tooltip-popover dt,
body.wasteland-page-build .aib-tooltip-popover dd {
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.055);
}

body.wasteland-page-battle .aib-tooltip-popover dt,
body.wasteland-page-build .aib-tooltip-popover dt {
    color: rgba(232,222,209,0.64);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.wasteland-page-battle .aib-tooltip-popover dd,
body.wasteland-page-build .aib-tooltip-popover dd {
    color: #efe2cf;
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.wasteland-page-battle .aib-tooltip-popover dt:last-of-type,
body.wasteland-page-battle .aib-tooltip-popover dd:last-of-type,
body.wasteland-page-build .aib-tooltip-popover dt:last-of-type,
body.wasteland-page-build .aib-tooltip-popover dd:last-of-type {
    border-bottom: 0;
}

@media (max-width: 1500px) {
    .wasteland-profile-builds__grid--compact {
        grid-template-columns: 1fr;
    }

    .wasteland-profile-builds--compact {
        max-height: min(48vh, 520px);
    }
}

@media (max-width: 1200px) {
    .wasteland-build-toolbar,
    .wasteland-build-redesign-grid {
        grid-template-columns: 1fr;
    }

    .wasteland-build-toolbar__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .wasteland-build-view--reworked {
        width: min(100%, calc(100vw - 24px));
    }

    .wasteland-build-toolbar,
    .wasteland-build-statgrid {
        grid-template-columns: 1fr;
    }

    .wasteland-build-overview-hero {
        grid-template-columns: 1fr;
    }

    .wasteland-build-card--compact .wasteland-build-card__head {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .wasteland-build-card--compact .wasteland-build-card__portrait {
        width: 56px;
        height: 64px;
    }
}

/* =========================================================
   Hotfix phase 18: profile delete visibility + full width shared build
   ========================================================= */
body.wasteland-page-profile-edit,
body.wasteland-page-build {
    overflow-y: auto !important;
}

body.wasteland-page-profile-edit .aib-site-main {
    padding-bottom: clamp(260px, 28vh, 380px) !important;
}

body.wasteland-page-profile-edit .wasteland-view,
body.wasteland-page-profile-edit .wasteland-profile-edit-view {
    overflow: visible !important;
    padding-bottom: clamp(190px, 22vh, 300px) !important;
}

body.wasteland-page-profile-edit .wasteland-profile-edit-layout {
    margin-bottom: clamp(120px, 16vh, 220px);
}

body.wasteland-page-profile-edit .wasteland-account-danger-zone {
    margin-bottom: clamp(120px, 16vh, 220px);
}

body.wasteland-page-profile-edit .wasteland-profile-build-manager__list {
    max-height: min(50vh, 560px);
}

body.wasteland-page-build .page-wasteland {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.wasteland-page-build .wasteland-view,
body.wasteland-page-build .wasteland-build-view--reworked {
    width: min(1760px, calc(100vw - 64px)) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-self: center;
}

body.wasteland-page-build .wasteland-build-toolbar {
    width: 100%;
    grid-template-columns: repeat(3, minmax(170px, 1fr)) minmax(430px, 1.15fr);
}

body.wasteland-page-build .wasteland-build-redesign-grid {
    width: 100%;
    grid-template-columns: minmax(500px, 0.95fr) minmax(650px, 1.35fr);
    gap: 18px;
}

body.wasteland-page-build .wasteland-build-inventory-card,
body.wasteland-page-build .wasteland-build-overview-card,
body.wasteland-page-build .wasteland-build-items-panel--compact {
    width: 100%;
    min-width: 0;
}

body.wasteland-page-build .wasteland-build-items-panel--compact {
    margin-bottom: clamp(120px, 14vh, 210px);
}

@media (max-width: 1260px) {
    body.wasteland-page-build .wasteland-build-toolbar,
    body.wasteland-page-build .wasteland-build-redesign-grid {
        grid-template-columns: 1fr;
    }

    body.wasteland-page-build .wasteland-build-toolbar__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 860px) {
    body.wasteland-page-profile-edit .aib-site-main {
        padding-bottom: 250px !important;
    }

    body.wasteland-page-build .wasteland-view,
    body.wasteland-page-build .wasteland-build-view--reworked {
        width: min(100%, calc(100vw - 24px)) !important;
    }
}


/* =========================================================
   Hotfix: one-line legal footer only
   ========================================================= */
body.aib-immersive-page .aib-site-footer.aib-footer-panel.aib-footer-panel--legal-only,
.aib-site-footer.aib-footer-panel.aib-footer-panel--legal-only {
    min-height: 58px;
    height: auto;
    padding: 0;
    overflow: hidden;
}

.aib-footer-panel--legal-only::before {
    inset: 8px 28px auto 28px;
}

.aib-footer-panel--legal-only::after {
    bottom: 10px;
    height: 4px;
}

.aib-footer-panel--legal-only .aib-footer-panel__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 10px clamp(28px, 2.4vw, 44px) 11px;
}

.aib-footer-panel--legal-only .aib-footer-status {
    display: none !important;
}

.aib-footer-panel--legal-only .aib-footer-legal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.1vw, 18px);
    width: 100%;
    min-width: 0;
    padding: 0;
    border-top: 0;
}

.aib-footer-panel--legal-only .aib-footer-legal__label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 2px;
    line-height: 1;
}

.aib-footer-panel--legal-only .aib-footer-panel .aib-legal-footer-links,
.aib-footer-panel--legal-only .aib-legal-footer-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
}

body.aib-immersive-page .aib-footer-panel--legal-only .aib-legal-footer-links a,
body.aib-immersive-page .aib-footer-panel--legal-only .aib-legal-footer-links button,
.aib-footer-panel--legal-only .aib-legal-footer-links a,
.aib-footer-panel--legal-only .aib-legal-footer-links button {
    min-height: 26px;
    padding: 4px 11px;
    font-size: clamp(0.76rem, 0.74vw, 0.88rem);
}

body.aib-immersive-page .aib-site-main {
    padding-bottom: clamp(82px, 8vh, 104px);
}

body.wasteland-page-shop .aib-site-main,
body.wasteland-page-battle .aib-site-main {
    padding-bottom: clamp(78px, 7.5vh, 98px);
}

body.wasteland-page-profile-edit .aib-site-main,
body.wasteland-page-legal .aib-site-main {
    padding-bottom: clamp(92px, 9vh, 116px);
}

@media (max-width: 860px) {
    body.aib-immersive-page .aib-site-footer.aib-footer-panel.aib-footer-panel--legal-only,
    .aib-site-footer.aib-footer-panel.aib-footer-panel--legal-only {
        min-height: 64px;
        width: min(100vw - 16px, 760px);
    }

    .aib-footer-panel--legal-only .aib-footer-panel__inner {
        min-height: 64px;
        padding: 12px 16px 13px;
    }

    .aib-footer-panel--legal-only .aib-footer-legal {
        gap: 8px;
    }

    .aib-footer-panel--legal-only .aib-footer-legal__label {
        display: none;
    }

    .aib-footer-panel--legal-only .aib-legal-footer-links {
        flex-wrap: wrap;
        gap: 6px;
    }

    .aib-footer-panel--legal-only .aib-legal-footer-links a,
    .aib-footer-panel--legal-only .aib-legal-footer-links button {
        min-height: 24px;
        padding: 3px 8px;
        font-size: 0.74rem;
    }

    body.aib-immersive-page .aib-site-main,
    body.wasteland-page-profile-edit .aib-site-main,
    body.wasteland-page-legal .aib-site-main {
        padding-bottom: 98px;
    }
}

/* =========================================================
   Hotfix: profile delete modal
   ========================================================= */
.wasteland-profile-edit-actions--primary {
    align-items: center;
}

.wasteland-profile-edit-actions--primary .wasteland-profile-delete-trigger {
    margin-left: 2px;
}

.wasteland-modal {
    width: min(620px, calc(100vw - 36px));
    max-width: 620px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #efe2cf;
    overflow: visible;
    z-index: 9999;
}

.wasteland-modal::backdrop {
    background:
        radial-gradient(circle at 50% 35%, rgba(247,147,30,0.18), transparent 28rem),
        rgba(0,0,0,0.72);
    backdrop-filter: none;
}

.wasteland-modal[open] {
    display: grid;
    place-items: center;
}

.wasteland-modal__backdrop-close {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.wasteland-modal__backdrop-close button {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    cursor: default;
}

.wasteland-modal__panel {
    position: relative;
    z-index: 2;
    width: min(620px, calc(100vw - 36px));
    padding: 22px;
    border-color: rgba(231,76,60,0.38);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.045),
        0 28px 80px rgba(0,0,0,0.72),
        0 0 0 1px rgba(231,76,60,0.18);
}

.wasteland-modal__panel h2 {
    color: #ffb36a;
}

.wasteland-modal__close {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(247,147,30,0.32);
    border-radius: 4px;
    background: rgba(0,0,0,0.38);
    color: #efe2cf;
    cursor: pointer;
}

.wasteland-modal__close:hover {
    color: #f79b23;
    border-color: rgba(247,147,30,0.62);
}

.wasteland-modal__warning {
    margin: 16px 0;
    padding: 14px 15px;
    border: 1px solid rgba(231,76,60,0.30);
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(231,76,60,0.16), rgba(0,0,0,0.22));
    color: rgba(255,235,220,0.86);
    line-height: 1.55;
}

.wasteland-modal .wasteland-account-delete-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wasteland-modal__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wasteland-mini-btn--danger,
button.wasteland-mini-btn--danger {
    border-color: rgba(231,76,60,0.62) !important;
    background: linear-gradient(180deg, rgba(111,27,22,0.92), rgba(61,10,8,0.96)) !important;
    color: #ffe0d7 !important;
}

.wasteland-mini-btn--danger:hover,
button.wasteland-mini-btn--danger:hover {
    border-color: rgba(255,126,93,0.88) !important;
    color: #fff4ee !important;
    filter: brightness(1.08);
}

@media (max-width: 760px) {
    .wasteland-modal__actions,
    .wasteland-profile-edit-actions--primary {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================================================
   Hotfix: remove lower header shadow
   ========================================================= */

.admin-brand-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    min-height: 74px;
    padding: 12px 18px;
    border: 1px solid rgba(124, 251, 91, 0.25);
    background: rgba(0, 0, 0, 0.24);
    border-radius: 14px;
}

.admin-brand-preview img {
    max-width: 240px;
    max-height: 64px;
    object-fit: contain;
}

.admin-language-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-language-search input {
    min-width: min(360px, 72vw);
}

.admin-language-table-wrap {
    max-height: 70vh;
    overflow: auto;
}

.admin-language-table th:first-child,
.admin-language-table th:nth-child(2),
.admin-language-table td:first-child,
.admin-language-table td:nth-child(2) {
    width: 24%;
}

.admin-language-table textarea {
    width: 100%;
    min-height: 54px;
    resize: vertical;
}

.admin-language-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* =========================================================
   Hotfix: restore compact start-menu layout after legal/footer update
   ========================================================= */
body.wasteland-page-start.aib-immersive-page .aib-site-main {
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: clamp(96px, 10vh, 128px);
}

body.wasteland-page-start.aib-immersive-page.wasteland-page-shell .wasteland-view,
body.wasteland-page-start .wasteland-startmenu {
    min-height: auto;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-dashboard-grid {
    flex: 0 0 auto !important;
    align-items: start;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel {
    min-height: 0 !important;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-run-footer {
    align-items: flex-start;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-lives-block {
    align-items: flex-start;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-lives-icons {
    max-width: 280px;
}

@media (max-width: 1440px) {
    body.wasteland-page-start .wasteland-startmenu .wasteland-dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    body.wasteland-page-start .wasteland-startmenu .wasteland-side-panels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    body.wasteland-page-start .wasteland-startmenu .wasteland-side-panels {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Hotfix v6: keep start-menu lives in one horizontal row
   ========================================================= */
body.wasteland-page-start .wasteland-startmenu .wasteland-run-footer {
    align-items: center;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-lives-block {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 14px;
    min-width: 0;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-lives-icons {
    width: auto !important;
    max-width: none !important;
    min-width: max-content;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
}

body.wasteland-page-start .wasteland-startmenu .wasteland-life-icon {
    flex: 0 0 34px;
}

@media (max-width: 760px) {
    body.wasteland-page-start .wasteland-startmenu .wasteland-run-footer {
        align-items: stretch;
    }

    body.wasteland-page-start .wasteland-startmenu .wasteland-lives-block {
        flex-wrap: wrap !important;
    }

    body.wasteland-page-start .wasteland-startmenu .wasteland-lives-icons {
        min-width: 0;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}


/* =========================================================
   Hotfix v7: force active-run lives to stay horizontal
   ========================================================= */
.wasteland-run-panel .wasteland-run-footer .aib-start-lives-inline,
body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel .wasteland-run-footer .aib-start-lives-inline {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: auto !important;
    max-width: none !important;
}

.wasteland-run-panel .aib-start-lives-inline .wasteland-lives-icons,
body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel .aib-start-lives-inline .wasteland-lives-icons {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
    max-width: none !important;
    min-width: max-content !important;
    writing-mode: horizontal-tb !important;
}

.wasteland-run-panel .aib-start-lives-inline .wasteland-life-icon,
body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel .aib-start-lives-inline .wasteland-life-icon {
    display: inline-grid !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
}

@media (max-width: 760px) {
    .wasteland-run-panel .wasteland-run-footer .aib-start-lives-inline,
    body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel .wasteland-run-footer .aib-start-lives-inline {
        flex-wrap: wrap !important;
    }

    .wasteland-run-panel .aib-start-lives-inline .wasteland-lives-icons,
    body.wasteland-page-start .wasteland-startmenu .wasteland-run-panel .aib-start-lives-inline .wasteland-lives-icons {
        min-width: 0 !important;
        overflow-x: auto !important;
    }
}

/* =========================================================
   Phase 23: Admin language editor hotfix
   ========================================================= */
body.wasteland-page-admin-language.aib-immersive-page {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.wasteland-page-admin-language.aib-immersive-page .aib-site-shell,
body.wasteland-page-admin-language.aib-immersive-page .aib-site-main {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

body.wasteland-page-admin-language.aib-immersive-page .aib-site-main {
    display: block !important;
    padding-bottom: clamp(130px, 14vh, 190px) !important;
}

body.wasteland-page-admin-language .admin-page {
    min-height: auto !important;
    overflow: visible !important;
}

body.wasteland-page-admin-language .admin-language-form {
    max-height: none !important;
    overflow: visible !important;
}

body.wasteland-page-admin-language .admin-language-table-wrap {
    max-height: min(58vh, 640px) !important;
    overflow: auto !important;
}

body.wasteland-page-admin-language .admin-form-actions-sticky {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(247,147,30,0.28);
    border-radius: 12px;
    background: rgba(8, 8, 8, 0.94);
    box-shadow: 0 -14px 30px rgba(0,0,0,0.34);
}

body.wasteland-page-admin-language .admin-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   Phase 24: Admin controls, dark form restore, Discord footer
   ========================================================= */
body.wasteland-page-admin input,
body.wasteland-page-admin select,
body.wasteland-page-admin textarea,
body.wasteland-page-admin .admin-language-search input,
body.wasteland-page-admin .admin-language-table textarea,
body.wasteland-page-admin input[type="search"],
body.wasteland-page-admin input[type="text"],
body.wasteland-page-admin input[type="number"],
body.wasteland-page-admin input[type="url"],
body.wasteland-page-admin input[type="file"] {
    border: 1px solid rgba(247, 147, 30, 0.26) !important;
    border-radius: 5px !important;
    background: linear-gradient(180deg, rgba(9, 9, 10, 0.98), rgba(2, 3, 5, 0.96)) !important;
    color: #efe2cf !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025) !important;
    accent-color: #f79b23;
}

body.wasteland-page-admin input::placeholder,
body.wasteland-page-admin textarea::placeholder {
    color: rgba(239, 226, 207, 0.46) !important;
}

body.wasteland-page-admin input[type="file"]::file-selector-button {
    margin-right: 10px;
    border: 1px solid rgba(247, 147, 30, 0.36);
    border-radius: 4px;
    background: linear-gradient(180deg, #ffae34, #c26c12);
    color: #140d06;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
    padding: 7px 12px;
    cursor: pointer;
}

body.wasteland-page-admin .admin-form-block,
body.wasteland-page-admin .admin-card {
    background: linear-gradient(180deg, rgba(14, 16, 18, 0.91), rgba(4, 6, 8, 0.86)) !important;
}

body.wasteland-page-admin .admin-language-table td,
body.wasteland-page-admin .admin-language-table th {
    vertical-align: top;
}

body.wasteland-page-admin .admin-language-table textarea {
    min-height: 62px;
    font-size: 13px;
}

.btn-danger,
body.wasteland-page-admin .btn-danger {
    color: #ffe8df !important;
    border-color: rgba(231, 111, 81, 0.72) !important;
    background: linear-gradient(180deg, rgba(231, 111, 81, 0.88), rgba(104, 23, 15, 0.92)) !important;
    box-shadow: 0 10px 24px rgba(231, 111, 81, 0.16), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.btn-danger:hover,
body.wasteland-page-admin .btn-danger:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-danger:disabled,
body.wasteland-page-admin .btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.admin-header-row-danger {
    border-color: rgba(231,111,81,0.34) !important;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.12);
}

.admin-status-pill--ok {
    color: #9ff29f;
    background: rgba(81, 190, 92, 0.12);
    border-color: rgba(81, 190, 92, 0.34);
}

.admin-status-pill--danger {
    color: #ffb5a0;
    background: rgba(231, 111, 81, 0.14);
    border-color: rgba(231, 111, 81, 0.45);
}

.admin-muted-text,
.admin-help {
    color: rgba(239, 226, 207, 0.68);
}

.is-muted-row {
    opacity: 0.72;
}

.admin-inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-inline-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: min(440px, 100%);
    color: rgba(239, 226, 207, 0.72);
    font-weight: 900;
}

.admin-player-control-card,
.admin-danger-zone {
    margin: 16px 0;
}

.admin-ban-reason {
    color: rgba(239, 226, 207, 0.82);
}

.admin-season-grid {
    align-items: stretch;
}

.admin-stat-grid-compact {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.admin-season-reset-form {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.aib-footer-panel--legal-only .aib-footer-panel__inner {
    gap: 10px;
}

.aib-footer-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    border: 1px solid rgba(247, 147, 30, 0.28);
    border-radius: 3px;
    color: #f79b23;
    background: rgba(0,0,0,0.32);
    text-decoration: none;
    line-height: 1;
}

.aib-footer-discord:hover {
    color: #111;
    background: linear-gradient(180deg, #ffae34, #c26c12);
    border-color: rgba(255, 184, 73, 0.78);
}

.aib-footer-discord i {
    font-size: 17px;
}

@media (max-width: 960px) {
    .admin-stat-grid-compact {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

@media (max-width: 640px) {
    .admin-stat-grid-compact {
        grid-template-columns: 1fr;
    }

    .admin-inline-form {
        align-items: stretch;
    }
}

body.wasteland-page-admin .admin-stat-grid:not(.admin-stat-grid-compact) {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* =========================================================
   Hotfix v10: Admin language editor JS-safe localization + dark style
   ========================================================= */
body.wasteland-page-admin-language .admin-language-form,
body.wasteland-page-admin-language .admin-form-block,
body.wasteland-page-admin-language .admin-card {
    background: linear-gradient(180deg, rgba(16, 10, 6, 0.93), rgba(3, 3, 4, 0.90)) !important;
    border-color: rgba(247, 147, 30, 0.22) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 18px 42px rgba(0,0,0,0.30) !important;
}

body.wasteland-page-admin-language .admin-language-table-wrap,
body.wasteland-page-admin-language .admin-table-wrap {
    background: rgba(3, 3, 4, 0.78) !important;
    border-color: rgba(247, 147, 30, 0.24) !important;
}

body.wasteland-page-admin-language .admin-language-table th {
    background: linear-gradient(180deg, rgba(18, 11, 5, 0.98), rgba(5, 5, 6, 0.98)) !important;
    color: #f79b23 !important;
}

body.wasteland-page-admin-language .admin-language-table td {
    background: rgba(0, 0, 0, 0.22) !important;
    border-bottom-color: rgba(247, 147, 30, 0.09) !important;
}

body.wasteland-page-admin-language input,
body.wasteland-page-admin-language select,
body.wasteland-page-admin-language textarea,
body.wasteland-page-admin-language .admin-language-search input,
body.wasteland-page-admin-language .admin-language-table textarea,
body.wasteland-page-admin-language input[type="search"],
body.wasteland-page-admin-language input[type="text"],
body.wasteland-page-admin-language input[type="number"],
body.wasteland-page-admin-language input[type="url"] {
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
    background: linear-gradient(180deg, rgba(8, 7, 7, 0.98), rgba(1, 1, 2, 0.98)) !important;
    color: #f4e7d6 !important;
    caret-color: #f79b23 !important;
}

body.wasteland-page-admin-language input:-webkit-autofill,
body.wasteland-page-admin-language textarea:-webkit-autofill {
    -webkit-text-fill-color: #f4e7d6 !important;
    box-shadow: 0 0 0 1000px #050506 inset !important;
}

body.wasteland-page-admin-language .admin-brand-preview {
    border-color: rgba(247, 147, 30, 0.28) !important;
    background: rgba(0, 0, 0, 0.34) !important;
}

body.wasteland-page-admin-language .admin-form-actions-sticky {
    background: linear-gradient(180deg, rgba(16, 10, 6, 0.97), rgba(2, 2, 3, 0.97)) !important;
    border-color: rgba(247, 147, 30, 0.36) !important;
}

/* =========================================================
   Hotfix v11: dynamic landing name + Discord button in header
   ========================================================= */
.wasteland-header-discord {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    border: 1px solid rgba(247, 147, 30, 0.28);
    border-radius: 4px;
    color: #f79b23;
    background: linear-gradient(180deg, rgba(22,20,18,0.92), rgba(7,8,10,0.88));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
    text-decoration: none;
    line-height: 1;
}

.wasteland-header-discord::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(247, 147, 30, 0.08);
    pointer-events: none;
}

.wasteland-header-discord:hover,
.wasteland-header-discord:focus-visible {
    color: #111;
    border-color: rgba(255, 184, 73, 0.78);
    background: linear-gradient(180deg, #ffae34, #c26c12);
    box-shadow: 0 0 16px rgba(247,147,30,0.14), inset 0 0 0 1px rgba(255,255,255,0.12);
}

.wasteland-header-discord i {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
}

@media (max-width: 980px) {
    .wasteland-header-discord {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
    }
}

/* =========================================================
   Hotfix v12: landing eyebrow setting, white title, header Discord
   ========================================================= */
body.aib-immersive-page .landing-title span,
body.aib-immersive-page .landing-title small {
    color: #fff7ea !important;
    -webkit-text-stroke: 1px rgba(34, 22, 12, 0.34);
    text-shadow:
        0 4px 0 rgba(0, 0, 0, 0.82),
        0 0 22px rgba(255, 246, 230, 0.12) !important;
}

body.aib-immersive-page .landing-eyebrow {
    color: var(--aib-orange-soft);
}

body.aib-immersive-page .aib-site-actions {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
}

body.aib-immersive-page .wasteland-header-discord {
    display: inline-flex !important;
    order: 0;
}

body.aib-immersive-page .wasteland-language-switch {
    order: 1;
}

body.aib-immersive-page .wasteland-user-menu {
    order: 2;
}

body.aib-immersive-page .wasteland-header-discord.is-disabled {
    opacity: 0.72;
    cursor: default;
}

body.aib-immersive-page .wasteland-header-discord.is-disabled:hover,
body.aib-immersive-page .wasteland-header-discord.is-disabled:focus-visible {
    color: #f79b23;
    border-color: rgba(247, 147, 30, 0.28);
    background: linear-gradient(180deg, rgba(22,20,18,0.92), rgba(7,8,10,0.88));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

body.landing-page .aib-site-header {
    display: flex !important;
    visibility: visible !important;
}

@media (max-width: 860px) {
    body.aib-immersive-page .aib-site-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* =========================================================
   Responsive desktop compact mode for 1080p displays
   Keeps the immersive UI usable without browser zoom.
   ========================================================= */
@media (min-width: 1180px) and (max-height: 1120px) {
    body.aib-immersive-page .aib-site-header {
        width: min(1780px, calc(100vw - 44px)) !important;
        min-height: clamp(72px, 7.8vh, 86px) !important;
        margin-top: 5px !important;
        padding: 0 clamp(46px, 4vw, 70px) 0 clamp(18px, 1.8vw, 30px) !important;
        gap: clamp(12px, 1.4vw, 24px) !important;
    }

    body.aib-immersive-page .aib-site-brand {
        min-width: clamp(320px, 24vw, 440px) !important;
        gap: clamp(12px, 1.2vw, 18px) !important;
    }

    body.aib-immersive-page .aib-site-brand .brand-logo-img,
    body.aib-immersive-page .brand-logo-img {
        width: clamp(116px, 7.6vw, 146px) !important;
    }

    body.aib-immersive-page .aib-site-brand span:last-child {
        font-size: clamp(0.95rem, 1.05vw, 1.15rem) !important;
    }

    body.aib-immersive-page .aib-site-actions {
        gap: 7px !important;
    }

    body.aib-immersive-page .wasteland-header-discord {
        width: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    body.aib-immersive-page .wasteland-header-discord i {
        font-size: 1.06rem !important;
    }

    body.aib-immersive-page .wasteland-language-switch {
        min-height: 42px !important;
        grid-template-columns: 18px minmax(40px, auto) 12px !important;
        padding: 0 9px !important;
    }

    body.aib-immersive-page .wasteland-language-switch select {
        font-size: 0.9rem !important;
    }

    body.aib-immersive-page .wasteland-user-pill {
        min-height: 46px !important;
        min-width: clamp(190px, 15.5vw, 230px) !important;
        padding: 5px 10px 5px 7px !important;
        gap: 9px !important;
    }

    body.aib-immersive-page .wasteland-user-pill__avatar {
        width: 42px !important;
        height: 42px !important;
    }

    body.aib-immersive-page .wasteland-user-pill__name {
        font-size: 0.92rem !important;
    }

    body.aib-immersive-page .wasteland-user-dropdown a {
        min-height: 36px !important;
        font-size: 0.92rem !important;
    }

    body.aib-immersive-page .aib-site-main {
        padding-bottom: clamp(74px, 7.8vh, 92px) !important;
    }

    body.wasteland-page-shop .aib-site-main,
    body.wasteland-page-battle .aib-site-main {
        padding-bottom: clamp(66px, 7vh, 86px) !important;
    }

    body.aib-immersive-page .aib-site-footer.aib-footer-panel,
    .aib-site-footer.aib-footer-panel {
        width: min(1780px, calc(100vw - 44px)) !important;
        bottom: 5px !important;
    }

    .aib-footer-panel__inner {
        padding: 8px clamp(24px, 2vw, 36px) 9px !important;
        gap: 4px !important;
    }

    .aib-footer-legal {
        gap: 10px !important;
        padding-top: 3px !important;
    }

    .aib-footer-legal__label {
        font-size: 0.74rem !important;
    }

    body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links a,
    body.aib-immersive-page .aib-footer-panel .aib-legal-footer-links button,
    .aib-footer-panel .aib-legal-footer-links a,
    .aib-footer-panel .aib-legal-footer-links button {
        min-height: 22px !important;
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
    }

    .aib-footer-panel::before {
        inset: 5px 22px auto 22px !important;
    }

    .aib-footer-panel::after {
        bottom: 9px !important;
        height: 4px !important;
    }

    body.aib-immersive-page.wasteland-page-shell .page-wasteland {
        width: min(1760px, calc(100vw - 42px)) !important;
    }

    body.aib-immersive-page.wasteland-page-shell .wasteland-view {
        min-height: calc(100dvh - 150px) !important;
        padding: clamp(8px, 1.25vh, 14px) clamp(16px, 1.6vw, 28px) 0 !important;
    }

    .wasteland-intro,
    body.aib-immersive-page.wasteland-page-shell .wasteland-intro {
        margin-top: clamp(4px, 0.8vh, 8px) !important;
        margin-bottom: clamp(8px, 1.1vh, 12px) !important;
    }

    .wasteland-title {
        font-size: clamp(3rem, min(5.6vw, 7.4vh), 5.2rem) !important;
    }

    .wasteland-title--heroes {
        font-size: clamp(2.7rem, min(4.8vw, 6.2vh), 4.4rem) !important;
    }

    .wasteland-subtitle {
        font-size: clamp(0.95rem, 1vw, 1.08rem) !important;
        line-height: 1.34 !important;
    }

    .wasteland-eyebrow {
        font-size: 1.02rem !important;
        margin-bottom: 6px !important;
    }

    .wasteland-action-grid {
        gap: 12px !important;
        margin-bottom: 12px !important;
    }

    .wasteland-action-card {
        min-height: 162px !important;
        padding: 18px 20px 16px !important;
        gap: 10px !important;
    }

    .wasteland-action-card__icon {
        width: 54px !important;
        height: 54px !important;
        font-size: 1.5rem !important;
    }

    .wasteland-action-card strong {
        font-size: 1.18rem !important;
    }

    .wasteland-action-card small {
        font-size: 0.88rem !important;
        line-height: 1.32 !important;
    }

    .wasteland-dashboard-grid {
        grid-template-columns: minmax(0, 2fr) minmax(330px, 0.85fr) !important;
        gap: 12px !important;
    }

    .wasteland-startmenu .wasteland-run-panel {
        padding: 14px 16px !important;
    }

    .wasteland-startmenu .wasteland-panel-heading {
        margin-bottom: 10px !important;
    }

    .wasteland-startmenu .wasteland-run-overview {
        gap: 16px !important;
        padding: 2px 2px 12px !important;
    }

    .wasteland-run-hero {
        gap: 12px !important;
    }

    .wasteland-run-hero__portrait {
        width: 104px !important;
        height: 104px !important;
    }

    .wasteland-run-hero__name {
        font-size: 1.55rem !important;
    }

    .wasteland-run-stats {
        gap: 10px !important;
    }

    .wasteland-run-stats div {
        gap: 4px !important;
        padding-left: 12px !important;
    }

    .wasteland-run-stats span {
        font-size: 0.84rem !important;
    }

    .wasteland-run-stats strong {
        font-size: 1.35rem !important;
    }

    .wasteland-startmenu .wasteland-run-footer {
        margin-top: 10px !important;
        padding: 8px 2px 0 !important;
    }

    .wasteland-side-panels {
        gap: 10px !important;
    }

    .wasteland-side-card {
        min-height: 92px !important;
        padding: 13px 15px 14px !important;
    }

    .wasteland-side-card__header {
        margin-bottom: 6px !important;
    }

    .wasteland-side-card p {
        font-size: 0.88rem !important;
        line-height: 1.32 !important;
    }

    .wasteland-hero-select .wasteland-hero-grid {
        gap: 12px !important;
    }

    .wasteland-hero-select .wasteland-hero-card {
        padding: 11px 12px 10px !important;
    }

    .wasteland-hero-select .wasteland-hero-card__top {
        grid-template-columns: 112px 1fr !important;
        gap: 11px !important;
    }

    .wasteland-hero-select .wasteland-hero-card__portrait {
        height: 132px !important;
    }

    .wasteland-hero-select .wasteland-hero-card h2 {
        font-size: 1.42rem !important;
    }

    .wasteland-hero-select .wasteland-hero-card__copy p,
    .wasteland-hero-select .wasteland-passive-box p,
    .wasteland-hero-select .wasteland-synergy-line {
        font-size: 0.82rem !important;
        line-height: 1.24 !important;
    }

    .wasteland-hero-select .wasteland-stat-row {
        margin: 7px 0 !important;
        gap: 5px !important;
    }

    .wasteland-hero-select .wasteland-stat-row span {
        padding: 4px 7px !important;
        font-size: 0.76rem !important;
    }

    .wasteland-hero-select .wasteland-passive-box {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .wasteland-hero-select .wasteland-passive-badge {
        min-width: 62px !important;
        height: 26px !important;
        font-size: 0.74rem !important;
    }

    .wasteland-hero-select .wasteland-passive-box strong {
        font-size: 0.92rem !important;
    }

    .wasteland-hero-select .wasteland-synergy-line {
        margin: 7px 0 6px !important;
    }

    .wasteland-hero-select .wasteland-hero-btn {
        min-height: 36px !important;
        font-size: 0.86rem !important;
    }

    .wasteland-scoreboard-view,
    .wasteland-profile-view {
        gap: 10px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-view {
        padding-top: 8px !important;
        gap: 8px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-view .wasteland-title,
    .wasteland-profile-view .wasteland-title,
    .wasteland-profile-edit-view .wasteland-title,
    .wasteland-build-view .wasteland-title {
        font-size: clamp(2.75rem, min(4.2vw, 6vh), 4.35rem) !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-headline {
        grid-template-columns: minmax(0, 1fr) minmax(520px, 600px) !important;
        gap: 18px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-meta__item {
        min-height: 66px !important;
        padding: 3px 10px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-panel {
        padding: 12px 12px 10px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-toolbar {
        gap: 10px !important;
        margin-bottom: 8px !important;
    }

    body.wasteland-page-scoreboard .wasteland-search-wrap input {
        min-height: 42px !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-table thead th {
        padding: 10px 10px !important;
        font-size: 0.76rem !important;
    }

    body.wasteland-page-scoreboard .wasteland-scoreboard-table tbody td {
        padding: 9px 10px !important;
        font-size: 0.9rem !important;
    }

    body.wasteland-page-scoreboard .wasteland-class-cell__portrait {
        width: 30px !important;
        height: 30px !important;
    }

    .wasteland-shop-view {
        height: calc(100dvh - 166px) !important;
        min-height: 0 !important;
        padding-top: 8px !important;
        gap: 8px !important;
    }

    .wasteland-shop-topline {
        grid-template-columns: minmax(0, 1fr) 190px !important;
        gap: 12px !important;
    }

    .wasteland-title--shop {
        font-size: clamp(2rem, min(3vw, 5vh), 3.25rem) !important;
    }

    .wasteland-shop-subline {
        font-size: 0.92rem !important;
    }

    .wasteland-next-round-box {
        min-height: 62px !important;
        padding: 8px 10px !important;
    }

    .wasteland-next-round-box button {
        font-size: 1.15rem !important;
    }

    .wasteland-shop-layout {
        grid-template-columns: minmax(360px, 0.88fr) minmax(480px, 1fr) minmax(360px, 0.82fr) !important;
        gap: 10px !important;
    }

    .wasteland-shop-panel,
    .wasteland-inventory-panel,
    .wasteland-storage-panel,
    .wasteland-status-panel,
    .wasteland-recipes-panel {
        padding: 10px !important;
    }

    .wasteland-shop-center,
    .wasteland-shop-right {
        grid-template-rows: minmax(0, 1fr) minmax(150px, 0.33fr) !important;
        gap: 8px !important;
    }

    .wasteland-shop-panel__header h2,
    .wasteland-panel-heading h2 {
        font-size: 1.02rem !important;
    }

    .wasteland-shop-panel__header p,
    .wasteland-panel-tip {
        font-size: 0.78rem !important;
    }

    .wasteland-reroll-bar {
        margin: 6px 0 7px !important;
    }

    .wasteland-reroll-bar button {
        min-height: 30px !important;
        font-size: 0.82rem !important;
    }

    .wasteland-shop-list {
        gap: 7px !important;
    }

    .wasteland-shop-item {
        min-height: 136px !important;
        grid-template-rows: auto 52px minmax(28px, auto) auto !important;
        gap: 4px !important;
        padding: 7px !important;
    }

    .wasteland-shop-item__image {
        min-height: 52px !important;
    }

    .wasteland-shop-item__image img {
        max-width: 50px !important;
        max-height: 50px !important;
    }

    .wasteland-shop-item__body strong {
        font-size: 0.82rem !important;
    }

    .wasteland-shop-item__body small {
        font-size: 0.64rem !important;
        line-height: 1.15 !important;
    }

    .wasteland-buy-btn,
    .wasteland-lock-btn {
        min-height: 26px !important;
        font-size: 0.78rem !important;
    }

    .wasteland-lock-btn {
        width: 28px !important;
    }

    .wasteland-inventory-panel {
        gap: 7px !important;
        padding-bottom: 10px !important;
    }

    .wasteland-inventory-panel .inventory-grid {
        --slot-size: clamp(32px, min(2.3vw, 4.2vh), 45px) !important;
        gap: 3px !important;
    }

    .wasteland-storage-bin,
    .wasteland-recipe-grid {
        gap: 7px !important;
    }

    .wasteland-storage-card,
    .wasteland-recipe-card {
        padding: 8px !important;
    }

    .wasteland-storage-card strong,
    .wasteland-recipe-card strong {
        font-size: 0.84rem !important;
    }

    .wasteland-page-battle .aib-site-main {
        overflow: hidden !important;
    }

    .wasteland-battle-view {
        width: min(1760px, calc(100vw - 42px)) !important;
        height: calc(100dvh - 166px) !important;
        min-height: 0 !important;
        padding-top: 8px !important;
        gap: 8px !important;
    }

    .wasteland-battle-topline {
        gap: 12px !important;
    }

    .wasteland-title--battle {
        font-size: clamp(2rem, min(3vw, 5vh), 3.25rem) !important;
    }

    .wasteland-battle-subline {
        font-size: 0.92rem !important;
    }

    .wasteland-battle-stage {
        gap: 10px !important;
        grid-template-columns: minmax(320px, 0.82fr) minmax(430px, 1fr) minmax(320px, 0.82fr) !important;
    }

    .wasteland-battle-actor,
    .wasteland-battle-feed-card {
        padding: 12px !important;
    }

    .wasteland-battle-portrait {
        width: 84px !important;
        height: 84px !important;
    }

    .wasteland-battle-hero {
        gap: 10px !important;
        padding-bottom: 10px !important;
    }

    .wasteland-battle-hero-copy h3 {
        font-size: 1.28rem !important;
    }

    .wasteland-battle-statgrid {
        padding: 7px 0 !important;
    }

    .wasteland-battle-statgrid div {
        min-height: 25px !important;
        padding: 4px 7px !important;
    }

    .wasteland-battle-board {
        padding: 8px 0 !important;
    }

    .wasteland-battle-board .inventory-grid {
        --slot-size: clamp(27px, min(2.1vw, 3.65vh), 38px) !important;
        gap: 2px !important;
    }

    .wasteland-battle-feed-status {
        grid-template-columns: 125px minmax(0, 1fr) 145px !important;
        gap: 10px !important;
        padding-bottom: 10px !important;
    }

    .wasteland-battle-feed-status > div {
        min-height: 48px !important;
    }

    .wasteland-battle-log {
        padding-top: 8px !important;
    }

    .wasteland-battle-log li {
        min-height: 31px !important;
        padding: 6px 8px !important;
        grid-template-columns: 40px 30px minmax(0, 1fr) 104px !important;
        gap: 8px !important;
    }

    .wasteland-log-icon {
        width: 22px !important;
        height: 22px !important;
    }
}


/* =========================================================
   Tooltip + Battle Summary compact polish
   ========================================================= */
.aib-tooltip-popover {
    max-height: var(--aib-tooltip-max-height, calc(100dvh - 24px));
}

.aib-tooltip-popover dl {
    min-height: 0;
    max-height: calc(var(--aib-tooltip-max-height, 420px) - 58px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(247,147,30,0.55) rgba(0,0,0,0.32);
}

.aib-tooltip-popover dl::-webkit-scrollbar {
    width: 7px;
}

.aib-tooltip-popover dl::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.32);
}

.aib-tooltip-popover dl::-webkit-scrollbar-thumb {
    background: rgba(247,147,30,0.55);
}

body.wasteland-page-shop .aib-tooltip-popover,
body.wasteland-page-battle .aib-tooltip-popover,
body.wasteland-page-build .aib-tooltip-popover {
    width: min(390px, calc(100vw - 28px));
}

body.wasteland-page-shop .aib-tooltip-popover dl,
body.wasteland-page-battle .aib-tooltip-popover dl,
body.wasteland-page-build .aib-tooltip-popover dl {
    grid-template-columns: 96px minmax(0, 1fr);
    max-height: calc(var(--aib-tooltip-max-height, 420px) - 58px);
}

.wasteland-summary-synergy-cell {
    min-height: 88px;
}

.wasteland-summary-synergies-compact {
    margin-top: 8px;
    display: grid;
    gap: 7px;
}

.wasteland-summary-synergies-count {
    display: inline-flex;
    width: fit-content;
    padding: 3px 7px;
    border: 1px solid rgba(247,147,30,0.28);
    background: rgba(247,147,30,0.1);
    color: #f79b23;
    font-size: 0.76rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wasteland-summary-synergy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 52px;
    overflow: hidden;
}

.wasteland-summary-synergy-chips span {
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.045);
    color: rgba(239,226,207,0.92);
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-summary-synergy-more {
    margin-top: 1px;
}

.wasteland-summary-synergy-more summary {
    width: fit-content;
    cursor: pointer;
    color: #f79b23;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    list-style: none;
}

.wasteland-summary-synergy-more summary::-webkit-details-marker {
    display: none;
}

.wasteland-summary-synergy-more summary::after {
    content: " anzeigen";
    color: rgba(232,222,209,0.58);
}

.wasteland-summary-synergy-more[open] summary::after {
    content: " ausblenden";
}

.wasteland-summary-synergy-chips--more {
    margin-top: 7px;
    max-height: 96px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(247,147,30,0.55) rgba(0,0,0,0.28);
}

.wasteland-summary-synergy-chips--more::-webkit-scrollbar {
    width: 7px;
}

.wasteland-summary-synergy-chips--more::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.28);
}

.wasteland-summary-synergy-chips--more::-webkit-scrollbar-thumb {
    background: rgba(247,147,30,0.55);
}

@media (max-height: 920px) and (min-width: 900px) {
    body.wasteland-page-shop .aib-tooltip-popover,
    body.wasteland-page-battle .aib-tooltip-popover,
    body.wasteland-page-build .aib-tooltip-popover {
        width: min(360px, calc(100vw - 24px));
    }

    body.wasteland-page-shop .aib-tooltip-popover > strong,
    body.wasteland-page-battle .aib-tooltip-popover > strong,
    body.wasteland-page-build .aib-tooltip-popover > strong {
        padding: 10px 13px 8px;
        font-size: 1.02rem;
    }

    body.wasteland-page-shop .aib-tooltip-popover dl,
    body.wasteland-page-battle .aib-tooltip-popover dl,
    body.wasteland-page-build .aib-tooltip-popover dl {
        grid-template-columns: 84px minmax(0, 1fr);
        padding: 6px 12px 11px;
    }

    body.wasteland-page-shop .aib-tooltip-popover dt,
    body.wasteland-page-shop .aib-tooltip-popover dd,
    body.wasteland-page-battle .aib-tooltip-popover dt,
    body.wasteland-page-battle .aib-tooltip-popover dd,
    body.wasteland-page-build .aib-tooltip-popover dt,
    body.wasteland-page-build .aib-tooltip-popover dd {
        padding: 6px 0;
        font-size: 0.72rem;
        line-height: 1.25;
    }

    body.wasteland-page-shop .aib-tooltip-popover dd,
    body.wasteland-page-battle .aib-tooltip-popover dd,
    body.wasteland-page-build .aib-tooltip-popover dd {
        font-size: 0.78rem;
    }
}

/* =========================================================
   Phase 26: Blueprints, compact battle notice and EN/DE polish
   ========================================================= */
.wasteland-battle-view {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.wasteland-battle-notice[hidden] {
    display: none !important;
}

.wasteland-battle-notice {
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 14px;
    line-height: 1.15;
}

.wasteland-battle-notice h2 {
    color: #f79b23;
    font-size: clamp(0.9rem, 1.15vw, 1.15rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.wasteland-battle-notice p {
    color: rgba(232,222,209,0.78);
    font-size: clamp(0.72rem, 0.9vw, 0.9rem);
    text-align: right;
}

html[lang="en"] .wasteland-summary-synergy-more summary::after {
    content: " show";
}

html[lang="en"] .wasteland-summary-synergy-more[open] summary::after {
    content: " hide";
}

.shop-item[data-draggable="0"][data-blueprint-recipe-key]:not([data-blueprint-recipe-key=""]) {
    cursor: pointer;
}

.shop-item[data-blueprint-recipe-key]:not([data-blueprint-recipe-key=""]) .wasteland-shop-item__image {
    background: radial-gradient(circle at 50% 30%, rgba(70,112,148,0.26), rgba(4,8,12,0.66));
}

@media (max-height: 920px) and (min-width: 900px) {
    .wasteland-battle-view {
        grid-template-rows: auto auto minmax(0, 1fr) !important;
    }

    .wasteland-battle-notice {
        padding: 6px 10px !important;
        gap: 10px !important;
    }

    .wasteland-battle-notice h2 {
        font-size: 0.82rem !important;
    }

    .wasteland-battle-notice p {
        font-size: 0.68rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.wasteland-battle-notice-stack {
    min-height: 0;
    display: grid;
    gap: 8px;
}

.wasteland-battle-stage {
    grid-row: 3;
}

/* Phase 27: readable routes + build code lookup */
.wasteland-build-lookup-view {
    min-height: calc(100dvh - 140px);
    display: grid;
    align-content: start;
    gap: 24px;
}

.wasteland-build-code-panel {
    width: min(840px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 24px;
    display: grid;
    gap: 22px;
}

.wasteland-build-code-result {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(247, 147, 30, 0.28);
    background: rgba(247, 147, 30, 0.08);
}

.wasteland-build-code-result span,
.wasteland-build-code-form .wasteland-panel-hint {
    color: rgba(240, 230, 216, 0.72);
}

.wasteland-build-code-result strong {
    font-family: 'Press Start 2P', monospace;
    color: #f7a12b;
    letter-spacing: 0.08em;
}

.wasteland-build-code-form {
    display: grid;
    gap: 10px;
}

.wasteland-build-code-inputrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.wasteland-build-code-inputrow input {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.35);
    color: #f3eadc;
    padding: 0 14px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wasteland-battle-notice {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 14px;
}

.wasteland-battle-notice h2 {
    font-size: clamp(0.88rem, 1.4vw, 1.05rem);
    line-height: 1.15;
}

.wasteland-battle-notice p {
    font-size: clamp(0.72rem, 1.1vw, 0.88rem);
    line-height: 1.35;
}

@media (max-width: 900px) {
    .wasteland-build-code-result,
    .wasteland-build-code-inputrow,
    .wasteland-battle-notice {
        grid-template-columns: 1fr;
    }
}

.wasteland-inline-form {
    display: inline-flex;
    margin: 0;
}

/* =========================================================
   Hotfix phase 28: immersive pages scroll naturally, footer sits after content
   ========================================================= */
html.wasteland-html,
html.wasteland-html body.wasteland-page-shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

html.wasteland-html body.wasteland-page-shell {
    display: flex !important;
    flex-direction: column !important;
    scrollbar-gutter: stable;
}

html.wasteland-html body.wasteland-page-shell::-webkit-scrollbar,
html.wasteland-html::-webkit-scrollbar {
    width: 12px;
}

html.wasteland-html body.wasteland-page-shell::-webkit-scrollbar-track,
html.wasteland-html::-webkit-scrollbar-track {
    background: rgba(5, 7, 9, 0.92);
    border-left: 1px solid rgba(247, 147, 30, 0.12);
}

html.wasteland-html body.wasteland-page-shell::-webkit-scrollbar-thumb,
html.wasteland-html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(247,147,30,0.72), rgba(128,66,14,0.86));
    border: 3px solid rgba(5, 7, 9, 0.92);
    border-radius: 999px;
}

html.wasteland-html body.wasteland-page-shell .app-shell,
html.wasteland-html body.wasteland-page-shell .aib-site-shell,
html.wasteland-html body.wasteland-page-shell .app-shell-wasteland {
    flex: 1 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

html.wasteland-html body.wasteland-page-shell .aib-site-main,
html.wasteland-html body.wasteland-page-shell .page,
html.wasteland-html body.wasteland-page-shell .page-wasteland {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

html.wasteland-html body.wasteland-page-shell .wasteland-view {
    min-height: auto !important;
    overflow: visible !important;
    padding-bottom: clamp(22px, 3vh, 40px) !important;
}

html.wasteland-html body.wasteland-page-shell .aib-site-footer,
html.wasteland-html body.wasteland-page-shell .landing-statusbar.aib-site-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 40 !important;
    flex: 0 0 auto !important;
    width: min(1760px, calc(100vw - 22px)) !important;
    margin: 10px auto 10px !important;
    transform: none !important;
}

html.wasteland-html body.wasteland-page-shell .aib-footer-panel__inner {
    min-width: 0;
}

body.wasteland-page-profile .aib-site-main,
body.wasteland-page-scoreboard .aib-site-main,
body.wasteland-page-profile-edit .aib-site-main,
body.wasteland-page-build .aib-site-main {
    padding-bottom: 24px !important;
}

body.wasteland-page-profile .wasteland-profile-builds,
body.wasteland-page-profile .wasteland-profile-builds__grid,
body.wasteland-page-profile-edit .wasteland-profile-build-manager__list {
    overflow: visible !important;
    max-height: none !important;
}


.wasteland-storage-card {
    border-color: var(--aib-rarity-border) !important;
    box-shadow: inset 3px 0 0 rgba(var(--aib-rarity-rgb), 0.42), inset 0 0 0 1px rgba(var(--aib-rarity-rgb), 0.055);
}

.wasteland-storage-card small,
.mini-item[class*="rarity-"] {
    color: var(--aib-rarity-color) !important;
}

.inventory-item-cell.rarity-common,
.inventory-item-cell[class*="rarity-gew"],
.inventory-item-cell.rarity-uncommon,
.inventory-item-cell[class*="rarity-unge"],
.inventory-item-cell.rarity-rare,
.inventory-item-cell[class*="rarity-selten"],
.inventory-item-cell.rarity-epic,
.inventory-item-cell[class*="rarity-episch"],
.inventory-item-cell.rarity-legendary,
.inventory-item-cell[class*="rarity-legend"] {
    border-color: var(--aib-rarity-border) !important;
}

/* =========================================================
   Hotfix phase 29: Battle summary reopen + compact synergy accordions
   ========================================================= */
.wasteland-battle-actions .wasteland-mini-btn.is-summary-ready {
    border-color: rgba(255,190,103,0.82);
    background: linear-gradient(180deg, rgba(247,147,30,0.24), rgba(92,47,12,0.58));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 0 18px rgba(247,147,30,0.16);
}

.wasteland-battle-synergy-panel.wasteland-battle-synergy-collapse {
    flex: 0 0 auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.wasteland-battle-synergy-panel.wasteland-battle-synergy-collapse[open] {
    flex: 0 0 auto;
}

.wasteland-battle-synergy-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(247,147,30,0.24);
    background: linear-gradient(90deg, rgba(247,147,30,0.11), rgba(255,255,255,0.018));
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.wasteland-battle-synergy-summary::-webkit-details-marker {
    display: none;
}

.wasteland-battle-synergy-summary:hover,
.wasteland-battle-synergy-panel[open] .wasteland-battle-synergy-summary {
    border-color: rgba(247,147,30,0.52);
    background: linear-gradient(90deg, rgba(247,147,30,0.18), rgba(255,255,255,0.028));
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.36);
}

.wasteland-battle-synergy-summary > span {
    min-width: 0;
    color: #f79b23;
    font-size: 1rem;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wasteland-battle-synergy-summary > small {
    color: rgba(232,222,209,0.68);
    font-size: 0.78rem;
    white-space: nowrap;
}

.wasteland-battle-synergy-summary > .fa-chevron-down {
    color: #f79b23;
    font-size: 0.82rem;
    transition: transform 180ms ease;
}

.wasteland-battle-synergy-panel[open] .wasteland-battle-synergy-summary > .fa-chevron-down {
    transform: rotate(180deg);
}

.wasteland-battle-synergy-content {
    max-height: min(245px, 24vh);
    overflow-y: auto;
    padding-top: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(247,147,30,0.42) rgba(255,255,255,0.05);
    animation: wastelandSynergyOpen 170ms ease both;
}

.wasteland-battle-synergy-content::-webkit-scrollbar { width: 8px; }
.wasteland-battle-synergy-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.wasteland-battle-synergy-content::-webkit-scrollbar-thumb { background: rgba(247,147,30,0.42); }

@keyframes wastelandSynergyOpen {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.wasteland-battle-synergy-panel:not([open]) .wasteland-battle-synergy-content {
    display: none;
}

@media (max-height: 920px) and (min-width: 900px) {
    .wasteland-battle-synergy-panel.wasteland-battle-synergy-collapse {
        padding-top: 8px;
    }

    .wasteland-battle-synergy-summary {
        min-height: 36px;
        padding: 6px 9px;
    }

    .wasteland-battle-synergy-summary > span {
        font-size: 0.88rem;
    }

    .wasteland-battle-synergy-summary > small {
        font-size: 0.68rem;
    }

    .wasteland-battle-synergy-content {
        max-height: min(180px, 20vh);
    }

    .wasteland-battle-board {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}



/* =========================================================
   Hotfix phase 30: Desktop battle log stays inside the panel
   ========================================================= */
@media (min-width: 1181px) and (min-height: 1000px) {
    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell,
    html.wasteland-html body.wasteland-page-battle {
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .app-shell,
    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .aib-site-shell,
    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .app-shell-wasteland {
        flex: 1 1 auto !important;
        height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .aib-site-main,
    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .page,
    html.wasteland-html body.wasteland-page-battle.wasteland-page-shell .page-wasteland {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding-bottom: clamp(12px, 1.4vh, 22px) !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-view {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-stage {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        align-items: stretch !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-actor,
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-feed-card {
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-feed-card {
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-log.battle-replay-log {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-board {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    html.wasteland-html body.wasteland-page-battle .aib-site-footer,
    html.wasteland-html body.wasteland-page-battle .landing-statusbar.aib-site-footer {
        display: none !important;
    }
}

@media (min-width: 1181px) and (min-height: 1000px) and (max-height: 1320px) {
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-topline {
        min-height: clamp(88px, 10vh, 126px) !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-title--battle {
        font-size: clamp(2.45rem, 3.65vw, 4.6rem) !important;
    }
}


/* =========================================================
   Hotfix phase 31: Battle layout row fix for tall desktop screens
   =========================================================
   The empty notice row was still part of the grid on large screens.
   This caused a visible vertical gap and pushed the replay log downward.
*/
body.wasteland-page-battle .wasteland-battle-view {
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 1.1vh, 14px) !important;
}

body.wasteland-page-battle .wasteland-battle-topline {
    min-height: 0 !important;
    padding-top: clamp(4px, 0.8vh, 10px) !important;
}

body.wasteland-page-battle .wasteland-battle-notice-stack {
    display: none !important;
}

body.wasteland-page-battle .wasteland-battle-stage {
    grid-row: auto !important;
    min-height: 0 !important;
}

body.wasteland-page-battle .wasteland-battle-view:has(.wasteland-battle-notice-stack .wasteland-battle-notice:not([hidden])) {
    grid-template-rows: auto auto minmax(0, 1fr) !important;
}

body.wasteland-page-battle .wasteland-battle-view:has(.wasteland-battle-notice-stack .wasteland-battle-notice:not([hidden])) .wasteland-battle-notice-stack {
    display: grid !important;
}

body.wasteland-page-battle .wasteland-battle-view:has(.wasteland-battle-notice-stack .wasteland-battle-notice:not([hidden])) .wasteland-battle-stage {
    grid-row: 3 !important;
}

@media (min-width: 1181px) and (min-height: 1000px) {
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-view {
        height: 100% !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        align-content: stretch !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-topline {
        flex: 0 0 auto !important;
        min-height: 0 !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-title--battle {
        font-size: clamp(2.65rem, 3.25vw, 4.25rem) !important;
        line-height: 0.9 !important;
        margin-bottom: 6px !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-stage {
        height: 100% !important;
        max-height: 100% !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-feed-card {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
    }

    html.wasteland-html body.wasteland-page-battle .wasteland-battle-log.battle-replay-log {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
}

@media (min-width: 1181px) and (min-height: 1000px) and (max-height: 1320px) {
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-topline {
        min-height: 0 !important;
    }
}


/* =========================================================
   Hotfix phase 32: Rucksack-Items zeigen Seltenheit als Hintergrund
   ========================================================= */
.wasteland-inventory-panel .inventory-item-cell.is-normal-item,
.wasteland-battle-board .inventory-item-cell.is-normal-item,
.build-share-board .inventory-item-cell.is-normal-item {
    background:
        radial-gradient(circle at 50% 38%, rgba(var(--aib-rarity-rgb), 0.22), rgba(var(--aib-rarity-rgb), 0.10) 46%, rgba(8, 9, 10, 0.70) 100%),
        linear-gradient(180deg, rgba(35,36,39,0.96), rgba(13,14,16,0.96)) !important;
    border-color: var(--aib-rarity-border) !important;
    box-shadow:
        inset 0 0 0 1px rgba(var(--aib-rarity-rgb), 0.16),
        inset 0 0 20px rgba(var(--aib-rarity-rgb), 0.12),
        0 0 14px rgba(var(--aib-rarity-rgb), 0.08) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item::after,
.wasteland-battle-board .inventory-item-cell.is-normal-item::after,
.build-share-board .inventory-item-cell.is-normal-item::after {
    content: "";
    position: absolute;
    inset: 2px;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(var(--aib-rarity-rgb), 0.32), transparent 34%),
        linear-gradient(315deg, rgba(var(--aib-rarity-rgb), 0.18), transparent 42%);
    mix-blend-mode: screen;
    opacity: 0.42;
    z-index: 1;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.is-main-cell::before,
.wasteland-battle-board .inventory-item-cell.is-normal-item.is-main-cell::before,
.build-share-board .inventory-item-cell.is-normal-item.is-main-cell::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: min(22px, 28%);
    height: 3px;
    border-radius: 999px;
    background: var(--aib-rarity-color);
    box-shadow: 0 0 10px rgba(var(--aib-rarity-rgb), 0.62);
    z-index: 9;
    pointer-events: none;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--fill,
.wasteland-battle-board .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--fill,
.build-share-board .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--fill {
    fill: rgba(var(--aib-rarity-rgb), 0.18) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--stroke,
.wasteland-battle-board .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--stroke,
.build-share-board .inventory-item-cell.is-normal-item.has-shape-svg .item-shape-svg__path--stroke {
    stroke: var(--aib-rarity-color) !important;
    stroke-opacity: 0.96 !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.has-item-art .item-shape-art,
.wasteland-battle-board .inventory-item-cell.is-normal-item.has-item-art .item-shape-art,
.build-share-board .inventory-item-cell.is-normal-item.has-item-art .item-shape-art {
    background:
        radial-gradient(circle at 50% 42%, rgba(var(--aib-rarity-rgb), 0.28), rgba(var(--aib-rarity-rgb), 0.10) 48%, rgba(0,0,0,0.34) 100%) !important;
}

.wasteland-inventory-panel .inventory-item-cell.is-normal-item.rarity-legendary,
.wasteland-battle-board .inventory-item-cell.is-normal-item.rarity-legendary,
.build-share-board .inventory-item-cell.is-normal-item.rarity-legendary,
.wasteland-inventory-panel .inventory-item-cell.is-normal-item[class*="rarity-legend"],
.wasteland-battle-board .inventory-item-cell.is-normal-item[class*="rarity-legend"],
.build-share-board .inventory-item-cell.is-normal-item[class*="rarity-legend"] {
    box-shadow:
        inset 0 0 0 1px rgba(var(--aib-rarity-rgb), 0.28),
        inset 0 0 24px rgba(var(--aib-rarity-rgb), 0.20),
        0 0 22px rgba(var(--aib-rarity-rgb), 0.18) !important;
}


/* =========================================================
   Hotfix phase 33: Battle-Rucksack bleibt bei 1440p im Panel
   ========================================================= */
body.wasteland-page-battle .wasteland-battle-board {
    min-width: 0 !important;
}

body.wasteland-page-battle .wasteland-battle-board .inventory-grid-scroll {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    place-items: center !important;
}

body.wasteland-page-battle .wasteland-battle-board .inventory-grid {
    --slot-gap: 2px !important;
    --slot-size: clamp(25px, min(1.55vw, 2.55vh), 34px) !important;
    gap: var(--slot-gap) !important;
    max-width: 100% !important;
}

@media (min-width: 1181px) and (min-height: 1000px) {
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-board .inventory-grid {
        --slot-size: clamp(25px, min(1.48vw, 2.42vh), 33px) !important;
        --slot-gap: 2px !important;
    }
}

@media (min-width: 2200px) and (min-height: 1200px) {
    html.wasteland-html body.wasteland-page-battle .wasteland-battle-board .inventory-grid {
        --slot-size: clamp(28px, min(1.36vw, 2.30vh), 35px) !important;
    }
}

@media (max-width: 1400px) {
    body.wasteland-page-battle .wasteland-battle-board .inventory-grid {
        --slot-size: clamp(23px, min(2vw, 3.1vh), 31px) !important;
    }
}


/* =========================================================
   Hotfix phase 34: Endless-unlock decision modal
   ========================================================= */
.wasteland-summary-dialog.is-endless-unlock {
    border-color: rgba(255, 190, 103, 0.55) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.04),
        0 0 36px rgba(247,147,30,0.18),
        0 28px 80px rgba(0,0,0,0.54) !important;
}

.wasteland-summary-dialog.is-endless-unlock .summary-dialog-head h2 {
    color: #ffbe67;
    text-shadow: 0 0 20px rgba(247,147,30,0.26);
}

.wasteland-endless-unlock-callout {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin: 12px 0 14px;
    padding: 14px;
    border: 1px solid rgba(247,147,30,0.38);
    background:
        radial-gradient(circle at 12% 22%, rgba(247,147,30,0.20), transparent 34%),
        linear-gradient(90deg, rgba(247,147,30,0.16), rgba(255,255,255,0.025));
}

.wasteland-endless-unlock-callout > span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: #ffbe67;
    border: 1px solid rgba(247,147,30,0.42);
    background: rgba(247,147,30,0.13);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.38), 0 0 18px rgba(247,147,30,0.16);
    font-size: 1.35rem;
}

.wasteland-endless-unlock-callout strong {
    display: block;
    color: #ffbe67;
    font-family: "Pixelify Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    font-size: 1.14rem;
    line-height: 1.05;
    margin-bottom: 5px;
}

.wasteland-endless-unlock-callout p,
.wasteland-endless-decision p {
    margin: 0;
    color: rgba(232,222,209,0.82);
    line-height: 1.42;
}

.wasteland-endless-decision {
    display: grid;
    gap: 12px;
}

.wasteland-endless-decision__actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) !important;
}

.wasteland-endless-decision__actions form,
.wasteland-endless-decision__actions button,
.wasteland-endless-decision__actions a {
    width: 100%;
}

.wasteland-endless-decision__actions .wasteland-summary-primary {
    min-height: 50px;
}

@media (max-width: 760px) {
    .wasteland-endless-unlock-callout {
        grid-template-columns: 1fr;
    }

    .wasteland-endless-unlock-callout > span {
        width: 46px;
        height: 46px;
    }

    .wasteland-endless-decision__actions {
        grid-template-columns: 1fr !important;
    }
}
