/* DryFairy — Unterschlupf & Boten Styles */
/* Ausgelagert aus universe-views.css */

/* ═══════════════════════════════════════════════
   Unterschlupf View — Ameisenbau-Querschnitt
   ═══════════════════════════════════════════════ */

.sf-ho { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ── Toolbar ── */
.sf-ho-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--sf-bg-card);
    border-bottom: 1px solid var(--sf-border);
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}
.sf-ho-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--sf-text);
    white-space: nowrap;
}
.sf-ho-title-icon { font-size: 22px; }
.sf-ho-toolbar-btns { display: flex; gap: 4px; flex: 1; }
.sf-ho-tbtn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--sf-border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--sf-text);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sf-ho-tbtn:hover { background: rgba(222,167,38,0.08); border-color: var(--sf-accent); color: var(--sf-accent); }

/* ── Toolbar-Nav (rechts: Username, Settings, Logout) ── */
.sf-ho-toolbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}
.sf-ho-nav-btn {
    background: none;
    border: none;
    color: var(--sf-text-dim, #8a7850);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    font-size: 13px;
    text-decoration: none;
    position: relative;
}
.sf-ho-nav-btn:hover {
    color: var(--sf-accent);
    background: rgba(222,167,38,0.1);
}
.sf-ho-nav-btn .sf-notif-badge {
    position: absolute;
    top: -3px; right: -3px;
    font-size: 8px;
    min-width: 13px; height: 13px; line-height: 13px;
    padding: 0 3px;
    border-radius: 7px;
    background: #e53935;
    color: #fff;
    text-align: center;
}
.sf-ho-nav-user {
    font-size: 11px;
    color: var(--sf-text-dim, #8a7850);
    cursor: pointer;
    padding: 2px 6px;
    white-space: nowrap;
    transition: color 0.2s;
}
.sf-ho-nav-user:hover { color: var(--sf-accent); }
.sf-ho-nav-ver { font-size: 9px; opacity: 0.6; margin-left: 3px; }
.sf-ho-nav-logout {
    color: var(--sf-red, #e53935) !important;
    font-size: 11px;
    font-weight: bold;
    opacity: 0.5;
}
.sf-ho-nav-logout:hover { opacity: 1; background: rgba(229,57,53,0.1) !important; }

/* ── Ressourcen-Leiste (Toolbar) ── */
.sf-ho-resbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: center;
    padding: 0 12px;
}
.sf-ho-rb-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--sf-text-dim);
    white-space: nowrap;
}
.sf-ho-rb-val {
    font-weight: 600;
    color: var(--sf-text);
    font-size: 13px;
}
.sf-ho-rb-rate {
    font-size: 10px;
    color: #66bb6a;
    opacity: 0.8;
}

/* ── Body (Scene + Sidebar) ── */
.sf-ho-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Scene (cross-section) ── */
.sf-ho-scene {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

/* ── Sky Wrapper — Sky extends behind surface buildings ── */
.sf-ho-sky-wrap {
    position: relative;
    flex-shrink: 0;
}

/* ── Sky — Fills entire wrapper as background ── */
.sf-ho-sky {
    position: absolute;
    inset: 0;
    overflow: hidden;
    transition: background 60s linear;
    z-index: 0;
    pointer-events: none;
}

/* Sterne-Layer (unter Wolken) */
.sf-ho-stars {
    position: absolute;
    inset: 0;
    transition: opacity 60s linear;
}
.sf-ho-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: sf-star-twinkle 3s ease-in-out infinite alternate;
}
.sf-ho-star:nth-child(odd) { animation-delay: -1.5s; }
.sf-ho-star.sf-star-bright {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 4px 1px rgba(200, 220, 255, 0.6);
}
@keyframes sf-star-twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Himmelskörper (Sonne/Mond) */
.sf-ho-celestial {
    position: absolute;
    font-size: 28px;
    transition: left 60s linear, bottom 60s linear, filter 60s linear, opacity 60s linear;
    z-index: 3;
    line-height: 1;
    pointer-events: none;
}
.sf-ho-celestial.sf-sun {
    filter: drop-shadow(0 0 14px rgba(255, 200, 50, 0.6)) drop-shadow(0 0 30px rgba(255, 160, 30, 0.2));
}
.sf-ho-celestial.sf-moon {
    filter: drop-shadow(0 0 10px rgba(180, 200, 255, 0.5)) drop-shadow(0 0 25px rgba(140, 170, 255, 0.15));
    font-size: 22px;
}

/* Wolken */
.sf-ho-cloud {
    position: absolute;
    color: #fff;
    z-index: 4;
    pointer-events: none;
    will-change: transform;
}

/* Horizont-Glühen */
.sf-ho-horizon-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    transition: background 60s linear;
    pointer-events: none;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════
   SURFACE AREA — Sauberes Design
   - Zellen 350px, overflow:hidden, Bilder füllen Zelle komplett
   - object-fit:contain skaliert automatisch
   - Erd-Gradient (::after) über dem Bild-Fuß = "steht auf Boden"
   - Ground-Strip: reine Trennlinie, überlappt NICHTS
   ══════════════════════════════════════════════════════ */

/* Ground strip — Grasnarbe zwischen Oberfläche und Untergrund */
.sf-ho-ground {
    height: 68px;
    margin-top: -68px;
    background: linear-gradient(180deg, #6a9a40 0%, #5a7a38 8%, #4a6a2e 25%, #3d5525 45%, #3a4020 65%, #3a2c1c 100%);
    flex-shrink: 0;
    pointer-events: none;
    position: relative;
    z-index: 0;
    border-top: 3px solid #7ab048;
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.25);
}

/* ── Underground Grid ── */
.sf-ho-grid {
    display: grid;
    gap: 3px;
    padding: 3px;
    background: #3a2c1c;
    flex: 1;
}

/* ── Underground Cell ── */
.sf-hc {
    aspect-ratio: 1;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 80px;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

/* ── Surface Grid ── */
.sf-ho-surface-grid {
    display: grid;
    gap: 3px;
    padding: 10px 3px 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* ── Surface Cell — 350px hoch, overflow:hidden ── */
.sf-hc-surface {
    --depth-bg: transparent;
    --depth-rock: transparent;
    --depth-dug: transparent;
    aspect-ratio: auto !important;
    min-height: 350px !important;
    overflow: hidden !important;
    /* Surface IMMER transparent — keine transition die Schwarz flasht */
    background: transparent !important;
    transition: none !important;
}
.sf-hc-surface:hover {
    background: transparent !important;
    background-color: transparent !important;
}
.sf-hc-surface.sf-hc-dug {
    background: transparent !important;
    box-shadow: none;
    border: none;
}
.sf-hc-surface.sf-hc-empty {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}
.sf-hc-surface.sf-hc-empty:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 2px rgba(61, 220, 132, 0.25);
}
.sf-hc-surface.sf-hc-empty .sf-hc-empty-icon {
    color: rgba(255, 255, 255, 0.15);
    font-size: 20px;
}
.sf-hc-surface.sf-hc-empty:hover .sf-hc-empty-icon {
    color: rgba(61, 220, 132, 0.6);
}

/* Gebäude auf Surface: Erd-Gradient am Fuß */
.sf-hc-surface.sf-hc-bld {
    background: transparent;
}
.sf-hc-surface.sf-hc-bld::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(58,74,40,0.5) 50%, #3a4a28 100%);
    z-index: 2;
    pointer-events: none;
}
/* Surface-Hover: ALLES transparent, kein box-shadow, kein z-index-Wechsel */
.sf-hc-surface.sf-hc-bld:hover,
.sf-hc-surface.sf-hc-dug:hover {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    z-index: auto !important;
}
.sf-hc-surface.sf-hc-bld:hover .sf-hc-bld-img {
    filter: drop-shadow(0 0 8px rgba(222,167,38,0.35)) drop-shadow(0 3px 10px rgba(0,0,0,0.45));
}

/* ── Surface Building Images ── */
.sf-hc-surface-img {
    overflow: hidden !important;
}
.sf-hc-bld-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
    transition: transform 0.2s, filter 0.2s;
}
.sf-hc-surface-img:hover .sf-hc-bld-img {
    transform: scale(1.03);
    transform-origin: bottom center;
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.45));
}
.sf-hc-bld-img-wip {
    opacity: 0.45;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)) grayscale(0.6);
}

/* Surface: Text-Overlays verstecken */
.sf-hc-surface-img .sf-hc-name,
.sf-hc-surface-img .sf-hc-prod,
.sf-hc-surface-img .sf-hc-lvl,
.sf-hc-surface-img .sf-hc-icon { display: none; }

/* Surface Ernte-Indikator */
.sf-hc-surface-harvest {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 100, 20, 0.9);
    color: #c8e6a0;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(100, 200, 50, 0.4);
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: sf-harvest-pulse 2s ease-in-out infinite;
}
@keyframes sf-harvest-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 2px 12px rgba(100, 200, 50, 0.5), 0 0 20px rgba(100, 200, 50, 0.2); }
}

/* Ernte-Animation (kurzer Flash beim Klick-Ernten) */
.sf-hc-harvesting {
    animation: sf-hc-harvest-flash 0.6s ease-out;
    pointer-events: none;
}
@keyframes sf-hc-harvest-flash {
    0%   { transform: scale(1);    filter: brightness(1);   }
    30%  { transform: scale(1.08); filter: brightness(1.5); box-shadow: 0 0 24px rgba(100, 200, 50, 0.6); }
    100% { transform: scale(1);    filter: brightness(1);   }
}

/* Ernte-Floater ("+X" schwebt nach oben) */
.sf-hc-harvest-float {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    font-weight: 900;
    font-family: 'Cinzel', serif;
    color: #3ddc84;
    text-shadow: 0 0 8px rgba(61,220,132,0.6), 0 2px 6px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 20;
    animation: sf-hc-float-up 1.5s ease-out forwards;
}
@keyframes sf-hc-float-up {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.2); }
    30%  { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.8); }
}

/* Depth colors — Deutlich getrennt: Rock=sehr dunkel, Dug=heller */
.sf-hc-d0 { --depth-bg: #3a3020; --depth-rock: #1a1610; --depth-dug: #4a3c28; }
.sf-hc-d1 { --depth-bg: #342a1e; --depth-rock: #16120e; --depth-dug: #443828; }
.sf-hc-d2 { --depth-bg: #2a2218; --depth-rock: #12100c; --depth-dug: #3a3020; }
.sf-hc-d3 { --depth-bg: #241e16; --depth-rock: #0e0c0a; --depth-dug: #342a1e; }

/* Locked rock — sehr dunkel, klar "noch Erde" */
.sf-hc-rock {
    background: var(--depth-rock);
    cursor: default;
    opacity: 0.5;
    border: 1px solid rgba(0,0,0,0.3);
}

/* Diggable — deutlich erkennbar mit gestricheltem Rand + Icon */
.sf-hc-candig {
    background: var(--depth-rock);
    border: 2px dashed rgba(222,167,38,0.4);
    opacity: 0.9;
    cursor: pointer;
    padding: 4px;
}
.sf-hc-candig:hover {
    opacity: 1;
    border-color: #DEA726;
    background: color-mix(in srgb, var(--depth-rock) 70%, #DEA726);
    box-shadow: 0 0 8px rgba(222,167,38,0.3);
}
.sf-hc-dig-icon {
    font-size: 22px;
    opacity: 0.6;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: opacity 0.2s, transform 0.2s;
}
.sf-hc-candig:hover .sf-hc-dig-icon {
    opacity: 1;
    transform: rotate(-15deg) scale(1.1);
}
.sf-hc-dig-cost {
    font-size: 13px;
    color: #DEA726;
    font-weight: 700;
    opacity: 0.8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.sf-hc-candig:hover .sf-hc-dig-cost { opacity: 1; color: #fff; }
.sf-hc-cant-afford {
    opacity: 0.45;
    border-color: rgba(255,100,100,0.3);
}
.sf-hc-cant-afford .sf-hc-dig-cost {
    color: #ff6b6b;
}
.sf-hc-cant-afford:hover {
    border-color: #ff6b6b;
    box-shadow: none;
}

/* Dug (empty room) — deutlich heller als Rock, klar als "Raum" erkennbar */
.sf-hc-dug {
    background: var(--depth-dug);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15), inset 0 -1px 3px rgba(0,0,0,0.08);
    border: 1px solid rgba(222,167,38,0.08);
}

/* Empty room — einladend, "hier bauen" */
.sf-hc-empty {
    cursor: pointer;
    padding: 4px;
}
.sf-hc-empty-icon {
    font-size: 28px;
    color: rgba(222,167,38,0.25);
    font-weight: 300;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    transition: color 0.2s, transform 0.2s;
}
.sf-hc-empty:not(.sf-hc-surface):hover .sf-hc-empty-icon { color: var(--sf-accent); font-weight: 700; transform: scale(1.15); }
.sf-hc-empty:not(.sf-hc-surface):hover { box-shadow: inset 0 0 0 2px rgba(222,167,38,0.4); }

/* Building cell */
.sf-hc-bld {
    cursor: pointer;
}
.sf-hc-bld:not(.sf-hc-surface):hover {
    box-shadow: inset 0 0 0 2px var(--sf-accent), 0 0 12px rgba(222,167,38,0.2);
    z-index: 2;
}
.sf-hc-bld:hover .sf-hc-icon .gg-icon {
    transform: scale(1.06);
    transition: transform 0.2s;
}

/* Icon — füllt den gesamten oberen Bereich */
.sf-hc-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
}

/* Level-Badge — oben rechts */
.sf-hc-lvl {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 10px;
    font-weight: 700;
    color: #d8c8a0;
    background: rgba(0,0,0,0.65);
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1.2;
    letter-spacing: 0.3px;
    z-index: 3;
}

/* Name — Overlay-Balken am unteren Rand */
.sf-hc-name {
    font-size: 10px;
    font-weight: 600;
    color: #f0e8d0;
    line-height: 1;
    width: 100%;
    padding: 3px 4px;
    background: rgba(0,0,0,0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Produktions-Info — unter dem Namen im Overlay */
.sf-hc-prod {
    font-size: 11px;
    color: var(--sf-green);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    padding: 2px 4px 3px;
    background: rgba(0,0,0,0.45);
    flex-shrink: 0;
}

/* Manaquelle special glow */
.sf-hc-mana:not(.sf-hc-surface) {
    background: linear-gradient(135deg, #2a1e30, #342640, #2a1e30) !important;
}
.sf-hc-mana {
    box-shadow: 0 0 16px rgba(156, 39, 176, 0.25);
    animation: sf-hc-mana-pulse 3s ease-in-out infinite;
}
.sf-hc-mana.sf-hc-surface {
    background: transparent !important;
}
@keyframes sf-hc-mana-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(156, 39, 176, 0.2); }
    50% { box-shadow: 0 0 28px rgba(156, 39, 176, 0.4); }
}

/* Building in progress */
.sf-hc-wip { opacity: 0.8; }
.sf-hc-prog {
    position: absolute;
    bottom: 2px; left: 4px; right: 4px;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    overflow: hidden;
}
.sf-hc-prog-bar {
    height: 100%;
    background: linear-gradient(90deg, #f0c040, #e0a020);
    border-radius: 2px;
    transition: width 1s linear;
}

/* Selected cell */
.sf-hc-sel {
    box-shadow: inset 0 0 0 3px var(--sf-accent) !important;
    z-index: 3;
}

/* ── Kategorie-Farben — Dunkel (underground only) ── */
.sf-hc-cat-cultivation.sf-hc-dug:not(.sf-hc-surface) { background: linear-gradient(135deg, #1e3020, #243828) !important; }
.sf-hc-cat-production.sf-hc-dug:not(.sf-hc-surface) { background: linear-gradient(135deg, #1a2430, #1e2a38) !important; }
.sf-hc-cat-brewing.sf-hc-dug:not(.sf-hc-surface) { background: linear-gradient(135deg, #2a1e30, #302438) !important; }
.sf-hc-cat-military.sf-hc-dug:not(.sf-hc-surface) { background: linear-gradient(135deg, #301e1a, #382420) !important; }
.sf-hc-cat-infrastructure.sf-hc-dug:not(.sf-hc-mana):not(.sf-hc-surface) { background: linear-gradient(135deg, #2a2a2a, #303030) !important; }

/* ── Produktions-Partikel ── */
.sf-hc-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
}
.sf-hc-particles span {
    position: absolute;
    bottom: 20%;
    font-size: 8px;
    opacity: 0;
    color: rgba(100, 100, 100, 0.5);
    animation: sf-particle-rise 3s ease-out infinite;
}
.sf-hc-particles span:nth-child(1) { left: 25%; animation-delay: 0s; }
.sf-hc-particles span:nth-child(2) { left: 50%; animation-delay: 1s; }
.sf-hc-particles span:nth-child(3) { left: 75%; animation-delay: 2s; }
@keyframes sf-particle-rise {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* ── Blasen (Glasmacherei) ── */
.sf-hc-bubbles span {
    color: rgba(100, 180, 255, 0.4);
    font-size: 6px;
    animation: sf-bubble-rise 4s ease-out infinite;
}
@keyframes sf-bubble-rise {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    30% { opacity: 0.7; transform: translateY(-10px) scale(1); }
    100% { opacity: 0; transform: translateY(-35px) scale(0.3); }
}

/* ── Brauerei Dampf ── */
.sf-hc-brewing { position: relative; }
.sf-hc-steam {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
}
.sf-hc-steam span {
    position: absolute;
    bottom: 30%;
    font-size: 10px;
    opacity: 0;
    color: rgba(156, 39, 176, 0.25);
    animation: sf-steam-rise 3.5s ease-out infinite;
}
.sf-hc-steam span:nth-child(1) { left: 20%; animation-delay: 0s; }
.sf-hc-steam span:nth-child(2) { left: 45%; animation-delay: 1.2s; }
.sf-hc-steam span:nth-child(3) { left: 70%; animation-delay: 2.4s; }
@keyframes sf-steam-rise {
    0% { opacity: 0; transform: translateY(0) scaleX(1); }
    25% { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-25px) scaleX(2); }
}

/* ── Cultivation Wachstumsbalken ── */
.sf-hc-grow-bar {
    position: absolute;
    bottom: 3px; left: 6px; right: 6px;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.sf-hc-grow-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
    border-radius: 2px;
    transition: width 2s ease;
}

/* ── Erntereif Puls ── */
.sf-hc-harvest {
    animation: sf-harvest-pulse 2s ease-in-out infinite;
}
@keyframes sf-harvest-pulse {
    0%, 100% { box-shadow: inset 0 0 8px rgba(124, 179, 66, 0.1); }
    50% { box-shadow: inset 0 0 14px rgba(124, 179, 66, 0.25), 0 0 8px rgba(124, 179, 66, 0.1); }
}

/* ═══════════════════════════════════════════════
   Vollbild-Grafiken & Info-Schildchen
   Gebäude-Zellen mit GIF/PNG Hintergrund
   und 9-slice Pixel-Art Info-Badge
   ═══════════════════════════════════════════════ */

/* ── Vollbild-Hintergrundbild (GIF/PNG) ── */
.sf-hc-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 0;
    image-rendering: pixelated;
}

/* Bau-Zustand: entsättigt + halbtransparent */
.sf-hc-wip .sf-hc-bg {
    filter: grayscale(0.5) brightness(0.7);
    opacity: 0.75;
}

/* Idle-Zustand: leicht abgedunkelt */
.sf-hc-idle .sf-hc-bg {
    filter: brightness(0.65) saturate(0.7);
}

/* Produzierend: volle Pracht */
.sf-hc-producing .sf-hc-bg {
    filter: brightness(1.05);
}

/* Erntereif: dezentes Leuchten auf dem Bild */
.sf-hc-harvest .sf-hc-bg {
    filter: brightness(1.1);
}

/* ── Info-Schildchen (unten rechts) ── */
/* Kompaktes Holz-Schildchen — wie ein Namensschild an der Tür */
.sf-hc-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: 4;
    /* Einheitliche feste Größe für ALLE Schildchen */
    width: 56%;
    height: 52px;
    box-sizing: border-box;
    /* 9-slice Holz-Board — warmes braunes Schildchen */
    border: 10px solid transparent;
    border-image: url('img/gui/basic_view/board/board_01.png') 10 fill / 10px stretch;
    border-radius: 0;
    image-rendering: pixelated;
    /* Layout — Inhalt immer unten bündig */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1px;
    padding: 1px 3px 2px;
    pointer-events: none;
    overflow: hidden;
}

/* Kategorie-Akzentlinie links */
.sf-hc-badge::before {
    content: '';
    position: absolute;
    top: 2px;
    left: -4px;
    bottom: 2px;
    width: 3px;
    background: var(--badge-cat-color, #8a7850);
    z-index: 5;
    border-radius: 1px;
}

/* Schildchen: Name */
.sf-hc-badge-name {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--sf-text-bright, #f0e8d8);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Schildchen: Info-Zeile (Level + Produktion) */
.sf-hc-badge-info {
    font-size: 9px;
    color: var(--sf-text, #d8c8a8);
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.sf-hc-badge-info .gg-icon {
    width: 12px !important;
    height: 12px !important;
}

/* Schildchen: Level */
.sf-hc-badge-lvl {
    font-weight: 700;
    color: var(--sf-accent, #DEA726);
    font-size: 9px;
}

/* Schildchen: Produktionswert */
.sf-hc-badge-val {
    color: var(--sf-green, #3ddc84);
    font-weight: 600;
    font-size: 9px;
}

/* Schildchen: Zusatz-Info-Zeile */
.sf-hc-badge-extra {
    font-size: 8px;
    color: var(--sf-text-dim, #8a7850);
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Schildchen-Varianten je Zustand ── */

/* Im Bau: Fortschrittsbalken im Schildchen */
.sf-hc-badge-prog {
    height: 3px;
    background: rgba(0,0,0,0.3);
    border-radius: 1px;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
}
.sf-hc-badge-prog-bar {
    height: 100%;
    background: linear-gradient(90deg, #DEA726, #f0c040);
    border-radius: 1px;
    transition: width 1s linear;
}

/* Idle: Status in Orange */
.sf-hc-badge-status {
    color: #e0a030;
    font-size: 9px;
    font-weight: 600;
    opacity: 0.9;
}

/* ── Badge-Varianten für alle Zellzustände ── */

/* Erdreich (gesperrt) — dezent, gedämpft */
.sf-hc-badge-state-rock {
    opacity: 0.55;
}
.sf-hc-badge-state-rock .sf-hc-badge-name {
    font-size: 9px;
    color: #a09080;
}

/* Schutt (freischaltbar) — aktiver, Kosten sichtbar */
.sf-hc-badge-state-rubble {
    opacity: 0.85;
}
.sf-hc-badge-state-rubble .sf-hc-badge-name {
    font-size: 9px;
    color: #c8b898;
}

/* Freigeräumt (leer, baubar) — einladend */
.sf-hc-badge-state-cleared {
    opacity: 0.7;
}
.sf-hc-badge-state-cleared .sf-hc-badge-name {
    font-size: 9px;
    color: #a0c880;
}

/* Blockiert — violett-Thema */
.sf-hc-badge-state-blocked {
    opacity: 0.7;
}
.sf-hc-badge-state-blocked .sf-hc-badge-name {
    font-size: 9px;
    color: #c090d0;
}

/* Idle-Icon oben rechts */
.sf-hc-idle-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 16px;
    z-index: 4;
    opacity: 0.7;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    animation: sf-idle-bob 3s ease-in-out infinite;
}
@keyframes sf-idle-bob {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-3px); opacity: 0.9; }
}

/* ── Ernte-Badge (oben rechts, bei erntbaren Mengen) ── */
.sf-hc-harvest-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 5;
    padding: 2px 6px;
    border: 4px solid transparent;
    border-image: url('img/gui/shop/frame/frame_02.png') 4 fill / 4px stretch;
    image-rendering: pixelated;
    border-radius: 0;
    font-size: 11px;
    font-weight: 700;
    color: #c8e6a0;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    animation: sf-harvest-badge-pulse 2s ease-in-out infinite;
    pointer-events: none;
}
.sf-hc-harvest-badge .gg-icon {
    width: 14px !important;
    height: 14px !important;
}
@keyframes sf-harvest-badge-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3) drop-shadow(0 0 4px rgba(100, 200, 50, 0.4)); }
}

/* ── Kategorie-Farben für Badge-Akzent ── */
.sf-hc-cat-cultivation  { --badge-cat-color: #43a047; }
.sf-hc-cat-production   { --badge-cat-color: #2196f3; }
.sf-hc-cat-brewing      { --badge-cat-color: #9c27b0; }
.sf-hc-cat-military     { --badge-cat-color: #e53935; }
.sf-hc-cat-infrastructure { --badge-cat-color: #8a7850; }

/* ── Zelle MIT Vollbild-Grafik: Emoji/Icon verstecken ── */
.sf-hc-has-bg .sf-hc-icon { display: none; }
.sf-hc-has-bg .sf-hc-name { display: none; }
.sf-hc-has-bg .sf-hc-prod { display: none; }
.sf-hc-has-bg .sf-hc-lvl  { display: none; }
.sf-hc-has-bg .sf-hc-grow-bar { display: none; }
.sf-hc-has-bg .sf-hc-particles { display: none; }
.sf-hc-has-bg .sf-hc-bubbles { display: none; }
.sf-hc-has-bg .sf-hc-steam { display: none; }

/* Aber alte Elemente weiterhin zeigen, wenn KEIN Hintergrundbild da ist (Fallback) */

/* ── Sidebar ── */
.sf-ho-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sf-bg-card);
    border-left: 1px solid var(--sf-border);
    overflow-y: auto;
    padding: 0;
}
.sf-ho-sb-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--sf-border);
    position: sticky;
    top: 0;
    background: var(--sf-bg-card);
    z-index: 2;
}
.sf-ho-sb-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--sf-text);
    margin: 0;
}
.sf-ho-sb-stat {
    font-size: 11px;
    color: var(--sf-text-dim);
    margin-top: 2px;
}
.sf-ho-sb-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sf-ho-sb-title {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sf-text-dim);
    margin-bottom: 8px;
    font-weight: 700;
}
.sf-ho-sb-empty {
    text-align: center;
    padding: 16px;
    color: var(--sf-text-dim);
    font-size: 12px;
    font-style: italic;
}
.sf-ho-sb-warn {
    padding: 8px 16px;
    background: rgba(222,167,38,0.08);
    border-left: 3px solid var(--sf-gold);
    font-size: 12px;
    color: var(--sf-gold);
}
.sf-ho-sb-hint {
    padding: 10px 16px;
    margin-top: 8px;
    background: rgba(222,167,38,0.04);
    border-left: 3px solid var(--sf-text-dim);
    font-size: 12px;
    color: var(--sf-text-dim);
    line-height: 1.5;
}

/* Back button */
.sf-ho-back {
    background: none;
    border: none;
    color: var(--sf-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    margin-bottom: 4px;
    font-family: inherit;
}
.sf-ho-back:hover { text-decoration: underline; }

/* ── Resource rows ── */
.sf-ho-res-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
}
.sf-ho-res-icon { width: 18px; text-align: center; }
.sf-ho-res-name { flex: 1; color: var(--sf-text-dim); font-size: 11px; }
.sf-ho-res-val { font-weight: 700; color: var(--sf-text); min-width: 30px; text-align: right; }
.sf-ho-res-rate { font-size: 10px; color: var(--sf-green); font-weight: 600; min-width: 45px; text-align: right; }

/* ── Build queue ── */
.sf-ho-queue {
    padding: 8px 16px;
    background: rgba(222,167,38,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sf-ho-queue-title { font-size: 11px; font-weight: 700; color: var(--sf-gold); margin-bottom: 4px; }
.sf-ho-queue-item { font-size: 12px; color: var(--sf-text); }

/* ── Building list ── */
.sf-ho-cat-head {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sf-text-dim);
    padding: 8px 0 4px;
    font-weight: 700;
}
.sf-ho-bld-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 12px;
}
.sf-ho-bld-row:hover { background: rgba(222,167,38,0.06); }
.sf-ho-bld-icon { font-size: 16px; }
.sf-ho-bld-name { flex: 1; color: var(--sf-text); font-weight: 500; }
.sf-ho-bld-lvl { font-size: 10px; color: var(--sf-text-dim); font-weight: 600; }

/* ── Build Menu Items ── */
.sf-ho-build-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    margin-bottom: 6px;
    background: var(--sf-bg-card);
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.sf-ho-build-item:hover:not(.disabled) {
    border-color: var(--sf-accent);
    box-shadow: 0 2px 8px rgba(222,167,38,0.1);
}
.sf-ho-build-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.sf-ho-build-item.no-afford {
    opacity: 0.7;
}
.sf-ho-build-icon { font-size: 24px; flex-shrink: 0; padding-top: 2px; }
.sf-ho-build-info { flex: 1; min-width: 0; }
.sf-ho-build-name { font-weight: 700; font-size: 12px; color: var(--sf-text); margin-bottom: 2px; }
.sf-ho-build-desc { font-size: 10px; color: var(--sf-text-dim); line-height: 1.3; margin-bottom: 3px; }
.sf-ho-build-cost { font-size: 10px; color: var(--sf-gold); font-weight: 600; }
.sf-ho-build-reason { font-size: 10px; color: #e74c3c; margin-top: 2px; font-style: italic; }

/* ── Confirm / Details ── */
.sf-ho-det-desc { font-size: 12px; color: var(--sf-text-dim); line-height: 1.4; margin-bottom: 10px; }
.sf-ho-det-prod { font-size: 12px; color: var(--sf-text); margin-bottom: 8px; }
.sf-ho-det-prod-live {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
}
.sf-ho-prod-header {
    font-size: 13px;
    color: var(--sf-text);
    margin-bottom: 8px;
}
.sf-ho-prod-header strong {
    color: var(--sf-text-bright);
}
.sf-ho-prod-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.sf-ho-prod-bar {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
}
.sf-ho-prod-fill {
    height: 100%;
    border-radius: 5px;
    box-shadow: 0 0 8px currentColor;
    min-width: 2px;
}
.sf-ho-prod-timer {
    font-size: 13px;
    font-family: var(--sf-font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--sf-text-bright);
    min-width: 3.5em;
    text-align: right;
    font-weight: 600;
}
.sf-ho-prod-info {
    font-size: 11px;
    color: var(--sf-text-dim);
}
.sf-ho-prod-info span {
    color: var(--sf-accent);
    font-weight: 600;
    font-family: var(--sf-font-mono);
}
.sf-ho-det-maxlvl { font-size: 12px; color: var(--sf-green); font-weight: 600; text-align: center; padding: 8px; }
/* Cultivation: Kein Upgrade — Anbau-Tipps */
.sf-ho-det-cultivation-info {
    font-size: 13px;
    color: var(--sf-text-dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}
.sf-ho-det-cultivation-info strong { color: var(--sf-green); }
.sf-ho-cult-hint {
    font-size: 11px;
    color: var(--sf-accent);
    margin-top: 4px;
    line-height: 1.4;
    opacity: 0.85;
}
/* Cultivation: Inventar-Anzeige */
.sf-ho-inventory-line {
    font-size: 13px;
    color: var(--sf-text);
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    margin-bottom: 8px;
}
.sf-ho-inventory-line strong {
    color: var(--sf-accent);
    font-family: var(--sf-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Cultivation: Gesamtfortschritt (Ernte-Balken) */
.sf-ho-grow-summary {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sf-ho-grow-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--sf-text);
    margin-bottom: 4px;
}
.sf-ho-grow-hint {
    font-size: 11px;
    color: var(--sf-text-dim);
    font-style: italic;
}
.sf-ho-det-grow-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0;
}
.sf-ho-det-grow-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.5s;
    box-shadow: 0 0 6px rgba(76,175,80,0.4);
}

.sf-ho-confirm-cost { margin-bottom: 8px; }
.sf-ho-cost-line {
    font-size: 12px;
    padding: 3px 0;
    color: var(--sf-text);
    display: flex;
    justify-content: space-between;
}
.sf-ho-cost-line span { color: var(--sf-text-dim); font-size: 11px; }
.sf-ho-cost-miss { color: var(--sf-red, #c03020); }
.sf-ho-cost-miss span { color: var(--sf-red, #c03020); }
.sf-ho-confirm-time { font-size: 11px; color: var(--sf-text-dim); margin-bottom: 12px; }

.sf-ho-syn-item {
    font-size: 11px;
    color: var(--sf-green);
    padding: 3px 0;
}

.sf-ho-confirm-btns { padding: 12px 16px; }
.sf-ho-btn-build {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, rgba(222,167,38,0.12), rgba(222,167,38,0.06));
    border: 2px solid var(--sf-accent);
    border-radius: 8px;
    color: var(--sf-accent);
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.sf-ho-btn-build:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(222,167,38,0.2), rgba(222,167,38,0.1));
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(222,167,38,0.15);
}
.sf-ho-btn-build:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sf-ho-btn-harvest {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--sf-green);
    border-radius: 6px;
    color: var(--sf-green);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.sf-ho-btn-harvest:hover { background: rgba(76, 175, 80, 0.2); }

.sf-ho-btn-special {
    width: 100%;
    padding: 10px;
    background: rgba(156, 39, 176, 0.08);
    border: 1px solid var(--sf-accent);
    border-radius: 8px;
    color: var(--sf-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.sf-ho-btn-special:hover { background: rgba(156, 39, 176, 0.15); }

/* ── Overlay (Boten) ── */
.sf-ho-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sf-ho-overlay-box {
    background: var(--sf-bg-card);
    border: 1px solid var(--sf-border);
    border-radius: 12px;
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sf-ho-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--sf-border);
}
.sf-ho-overlay-head h3 {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    margin: 0;
}
.sf-ho-overlay-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--sf-text-dim);
    padding: 4px;
}
.sf-ho-overlay-stat {
    padding: 8px 18px;
    font-size: 12px;
    color: var(--sf-text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sf-ho-overlay-list {
    padding: 12px 18px;
    overflow-y: auto;
    flex: 1;
}
/* ═══════════════════════════════════════════════
   Botenwesen — Redesign (v0.67)
   ═══════════════════════════════════════════════ */
.sf-bo-box {
    max-height: 85vh;
    overflow-y: auto;
    width: 380px;
    max-width: 95vw;
}

/* Status-Leiste */
.sf-bo-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--sf-border);
}
.sf-bo-status-slots {
    font-size: 13px;
    color: var(--sf-text-dim);
}
.sf-bo-status-num {
    font-weight: 700;
    font-size: 16px;
    color: #d4a020;
}
.sf-bo-status-types {
    display: flex;
    gap: 6px;
}
.sf-bo-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}
.sf-bo-badge-pigeon { border-color: rgba(212,160,32,0.3); color: #d4a020; }
.sf-bo-badge-goblin { border-color: rgba(80,180,80,0.3); color: #6bbd6b; }

/* Sektionen */
.sf-bo-section {
    padding: 0 14px 10px;
}
.sf-bo-section-head {
    padding: 10px 4px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sf-text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 6px;
}
.sf-bo-section-done { color: #6bbd6b; }

/* Boten-Item (aktiv + abholen) */
.sf-bo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--sf-border);
}
.sf-bo-item-icon { font-size: 16px; flex-shrink: 0; }
.sf-bo-item-info { flex: 1; min-width: 0; }
.sf-bo-item-task { font-weight: 500; font-size: 12px; }
.sf-bo-item-dest { font-size: 10px; opacity: 0.5; }
.sf-bo-item-timer {
    font-size: 10px;
    color: var(--sf-text-dim);
    white-space: nowrap;
    opacity: 0.7;
}

/* Abholbereit */
.sf-bo-item-done {
    background: rgba(80,180,80,0.06);
    border-color: rgba(80,180,80,0.2);
}
.sf-bo-collect-btn {
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(80,180,80,0.15);
    border: 1px solid rgba(80,180,80,0.4);
    border-radius: 5px;
    color: #6bbd6b;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.sf-bo-collect-btn:hover {
    background: rgba(80,180,80,0.3);
    border-color: #6bbd6b;
}
.sf-bo-collect-btn:disabled { opacity: 0.5; cursor: wait; }

/* Provinz-Gruppen */
.sf-bo-prov {
    margin-bottom: 8px;
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.01);
}
.sf-bo-prov-head {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sf-bo-prov-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
}

/* Einzelne Aktion */
.sf-bo-action {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    font-size: 11px;
    background: rgba(212,160,32,0.06);
    border: 1px solid rgba(212,160,32,0.2);
    border-radius: 5px;
    color: var(--sf-text, #e8e0d0);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.sf-bo-action:hover {
    background: rgba(212,160,32,0.15);
    border-color: rgba(212,160,32,0.5);
}
.sf-bo-action:disabled { opacity: 0.4; cursor: not-allowed; }
.sf-bo-action-locked { opacity: 0.3; }
.sf-bo-action-icon { font-size: 13px; }
.sf-bo-action-name { font-weight: 500; }
.sf-bo-action-cost {
    font-size: 10px;
    opacity: 0.5;
    margin-left: 2px;
}

/* Hinweis-Text */
.sf-bo-hint {
    padding: 12px 18px;
    font-size: 12px;
    color: var(--sf-text-dim);
    text-align: center;
    opacity: 0.7;
}

/* Kein Gebäude: Unlock-Karten */
.sf-bo-empty {
    padding: 16px;
    text-align: center;
}
.sf-bo-empty-icon { font-size: 32px; margin-bottom: 6px; }
.sf-bo-empty-text strong { font-size: 14px; display: block; margin-bottom: 4px; }
.sf-bo-empty-text p { font-size: 12px; opacity: 0.6; margin: 0 0 12px; }
.sf-bo-unlock-cards {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.sf-bo-unlock-card {
    flex: 1;
    max-width: 170px;
    padding: 10px;
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    text-align: left;
}
.sf-bo-unlock-head {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
.sf-bo-unlock-head span {
    font-weight: 400;
    font-size: 9px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 1px;
}
.sf-bo-unlock-body {
    font-size: 10px;
    opacity: 0.6;
    line-height: 1.5;
    margin-bottom: 6px;
}
.sf-bo-unlock-cost {
    font-size: 10px;
    color: #d4a020;
    opacity: 0.8;
}

/* ── Responsive ── */
@media (max-width: 800px) {
    .sf-ho-body { flex-direction: column; }
    .sf-ho-sidebar { width: 100%; max-height: 300px; border-left: none; border-top: 1px solid var(--sf-border); }
    .sf-hc { min-height: 56px; }
    .sf-hc-icon { font-size: 22px; }
    .sf-hc-name { font-size: 7px; }
    .sf-ho-resbar { gap: 8px; font-size: 11px; }
}
@media (max-width: 500px) {
    .sf-ho-toolbar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .sf-ho-resbar { flex-wrap: wrap; gap: 6px 10px; justify-content: flex-start; }
    .sf-hc { min-height: 48px; }
    .sf-hc-icon { font-size: 18px; }
    .sf-hc-lvl { font-size: 8px; }
}

/* ═══════════════════════════════════════════════
   Auto-Produktion (Brauerei-Rezept-Zuweisung)
   ═══════════════════════════════════════════════ */

.sf-ho-assigned {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(26, 138, 64, 0.08);
    border: 1px solid rgba(26, 138, 64, 0.2);
    border-radius: 6px;
    margin-bottom: 8px;
}
.sf-ho-assigned-icon { font-size: 22px; }
.sf-ho-assigned-name {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: var(--sf-text);
    font-weight: 600;
}
.sf-ho-assigned-info {
    font-size: 11px;
    color: var(--sf-text-dim);
    line-height: 1.5;
    margin-bottom: 8px;
}
.sf-ho-brew-progress {
    margin: 8px 0;
}
.sf-ho-brew-idle {
    font-size: 11px;
    color: var(--sf-text-dim);
    padding: 6px 0;
    font-style: italic;
}
.sf-ho-btn-recipe {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 4px;
    border: 1px solid var(--sf-border);
    border-radius: 5px;
    background: var(--sf-bg);
    color: var(--sf-text);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.sf-ho-btn-recipe:hover { background: var(--sf-bg-card); }
.sf-ho-btn-stop { color: #c03020; border-color: rgba(192, 48, 32, 0.3); }
.sf-ho-btn-stop:hover { background: rgba(192, 48, 32, 0.08); }

/* Recipe overlay */
.sf-ho-recipe-box { max-width: 360px; }
.sf-ho-recipe-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}
.sf-ho-recipe-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--sf-border);
    transition: background 0.15s;
}
.sf-ho-recipe-item:hover { background: rgba(222, 167, 38, 0.06); }
.sf-ho-recipe-active {
    background: rgba(26, 138, 64, 0.08);
    border-left: 3px solid rgba(26, 138, 64, 0.5);
}
.sf-ho-recipe-icon { font-size: 20px; flex-shrink: 0; }
.sf-ho-recipe-info { flex: 1; }
.sf-ho-recipe-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-text);
}
.sf-ho-recipe-brewed {
    font-size: 10px;
    color: var(--sf-text-dim);
}
.sf-ho-recipe-check {
    color: var(--sf-green);
    font-size: 16px;
    font-weight: bold;
}

/* ═══════════════════════════════════════════════
   Manabrunnen-Intro (cinematic Overlay)
   ═══════════════════════════════════════════════ */

.sf-intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.6s ease;
    pointer-events: none;
}
.sf-intro-overlay.sf-intro-visible {
    background: rgba(0, 0, 0, 0.85);
    pointer-events: auto;
}
.sf-intro-overlay.sf-intro-fadeout {
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}

.sf-intro-scene {
    position: relative;
    width: min(540px, 92vw);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}
.sf-intro-visible .sf-intro-scene {
    transform: translateY(0);
    opacity: 1;
}
.sf-intro-fadeout .sf-intro-scene {
    transform: translateY(-20px);
    opacity: 0;
}

/* Vignette effect behind */
.sf-intro-vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

/* Mana glow pulse */
.sf-intro-mana-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156, 39, 176, 0.6), rgba(138, 32, 144, 0.3), transparent 70%);
    animation: sf-intro-glow 3s ease-in-out infinite;
    opacity: 0.3;
    pointer-events: none;
}
@keyframes sf-intro-glow {
    0%, 100% { transform: translateX(-50%) scale(1); filter: brightness(1); }
    50% { transform: translateX(-50%) scale(1.15); filter: brightness(1.3); }
}

/* Dialog box */
.sf-intro-dialog {
    display: flex;
    gap: 16px;
    background: linear-gradient(145deg, rgba(30, 15, 40, 0.95), rgba(20, 10, 30, 0.98));
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Portrait */
.sf-intro-portrait {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(138, 32, 144, 0.15);
    border: 2px solid rgba(138, 32, 144, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 0 16px rgba(138, 32, 144, 0.2);
}

/* Content */
.sf-intro-content {
    flex: 1;
    min-height: 80px;
}
.sf-intro-npc-name {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.sf-intro-text {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(230, 220, 240, 0.9);
    min-height: 60px;
}
.sf-intro-text b {
    color: #d4a0ff;
    font-weight: 600;
}
.sf-intro-text i {
    color: rgba(200, 180, 220, 0.8);
}
.sf-intro-text-done {
    cursor: default;
}

/* Controls */
.sf-intro-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0 4px;
}
.sf-intro-dots {
    display: flex;
    gap: 8px;
}
.sf-intro-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(156, 39, 176, 0.2);
    border: 1px solid rgba(156, 39, 176, 0.3);
    transition: all 0.3s ease;
}
.sf-intro-dot.active {
    background: rgba(156, 39, 176, 0.7);
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.4);
    transform: scale(1.2);
}
.sf-intro-dot.seen {
    background: rgba(156, 39, 176, 0.45);
}
.sf-intro-next {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    padding: 8px 24px;
    border: 1px solid rgba(156, 39, 176, 0.4);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(138, 32, 144, 0.2), rgba(100, 20, 110, 0.3));
    color: #d4a0ff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sf-intro-next:hover {
    background: linear-gradient(135deg, rgba(138, 32, 144, 0.35), rgba(100, 20, 110, 0.45));
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.25);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 500px) {
    .sf-intro-dialog { flex-direction: column; align-items: center; text-align: center; padding: 16px; }
    .sf-intro-portrait { width: 52px; height: 52px; font-size: 28px; }
    .sf-intro-text { font-size: 13px; }
    .sf-intro-next { font-size: 13px; padding: 6px 18px; }
}

/* ═══════════════════════════════════════════════
   Razzia-System (Raid Warning Bar)
   ═══════════════════════════════════════════════ */

.sf-ho-raid-bar {
    display: none;
}
.sf-ho-raid-bar.sf-ho-raid-active,
.sf-ho-raid-bar.sf-ho-raid-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 0;
    animation: raidPulse 2s ease-in-out infinite;
    font-size: 13px;
    position: relative;
    z-index: 10;
}
.sf-ho-raid-bar.sf-ho-raid-active {
    background: linear-gradient(90deg, rgba(183, 28, 28, 0.85), rgba(230, 74, 25, 0.75));
    border-bottom: 2px solid rgba(255, 87, 34, 0.6);
    color: #fff;
}
.sf-ho-raid-bar.sf-ho-raid-result[data-result="defended"] {
    background: linear-gradient(90deg, rgba(27, 94, 32, 0.8), rgba(56, 142, 60, 0.7));
    border-bottom: 2px solid rgba(76, 175, 80, 0.5);
    color: #e8f5e9;
    animation: none;
}
.sf-ho-raid-bar.sf-ho-raid-result[data-result="breached"] {
    background: linear-gradient(90deg, rgba(130, 20, 20, 0.85), rgba(100, 30, 30, 0.75));
    border-bottom: 2px solid rgba(200, 50, 50, 0.5);
    color: #ffcdd2;
    animation: none;
}
.sf-ho-raid-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.sf-ho-raid-info {
    flex: 1;
    min-width: 0;
}
.sf-ho-raid-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}
.sf-ho-raid-detail {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}
.sf-ho-raid-countdown {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 8px rgba(255, 100, 0, 0.5);
    flex-shrink: 0;
}
.sf-ho-raid-dismiss {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: inherit;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sf-ho-raid-dismiss:hover {
    background: rgba(255,255,255,0.3);
}

@keyframes raidPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 0, 0, 0.2); }
    50% { box-shadow: 0 0 18px rgba(255, 60, 0, 0.4); }
}

/* Verteidigung in Sidebar */
.sf-ho-defense-stats {
    padding: 8px 0;
}
.sf-ho-def-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
    color: var(--sf-text-dim);
}
.sf-ho-def-row span:last-child {
    font-weight: 600;
    color: var(--sf-red);
}
.sf-ho-def-total {
    display: flex;
    justify-content: space-between;
    padding: 5px 0 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-weight: 700;
    font-size: 13px;
    color: var(--sf-text);
}
.sf-ho-def-total span:last-child {
    color: var(--sf-red);
}

/* Grid: Raid flash on approaching raid */
.sf-ho-raid-active ~ .sf-ho-body .sf-ho-grid .sf-hc-cat-military {
    animation: militaryGlow 1.5s ease-in-out infinite;
}
@keyframes militaryGlow {
    0%, 100% { box-shadow: inset 0 0 6px rgba(229, 57, 53, 0.2); }
    50% { box-shadow: inset 0 0 14px rgba(229, 57, 53, 0.5); }
}


/* ═══════════════════════════════════════════════
   Spalten-Blockierung (Wurzeln/Schacht)
   Subtile Darstellung: verschmilzt mit dem Erdreich
   ═══════════════════════════════════════════════ */
.sf-hc-blocked {
    cursor: default !important;
    position: relative;
    overflow: hidden;
    /* Kein eigener Background — erbt die Tiefenfarbe der normalen Erd-Zellen */
}
.sf-hc-blocked .sf-hc-block-icon {
    font-size: 14px;
    opacity: 0.18;
    text-align: center;
    line-height: 1;
    position: relative;
    z-index: 1;
}
.sf-hc-blocked .sf-hc-block-label {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.15;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════
   Lager-Button & Overlay
   ═══════════════════════════════════════════════ */
.sf-ho-lager-btn {
    background: rgba(212, 160, 32, 0.12) !important;
    border-color: rgba(212, 160, 32, 0.4) !important;
    color: #d4a020 !important;
    font-weight: 600;
}
.sf-ho-lager-btn:hover {
    background: rgba(212, 160, 32, 0.22) !important;
    border-color: #d4a020 !important;
}

.sf-lager-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    animation: sf-lager-fade-in 0.2s ease;
}
@keyframes sf-lager-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sf-lager-panel {
    background: var(--sf-bg-card, #2a2520);
    border: 1px solid var(--sf-border, #3d352d);
    border-radius: 14px;
    width: 340px;
    max-width: 92vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    animation: sf-lager-slide-in 0.25s ease;
}
@keyframes sf-lager-slide-in {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.sf-lager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sf-border, #3d352d);
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--sf-accent, #d4a020);
}
.sf-lager-close {
    background: none;
    border: none;
    color: var(--sf-text-dim, #999);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}
.sf-lager-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--sf-text, #fff);
}
.sf-lager-body {
    overflow-y: auto;
    padding: 8px 16px 16px;
}
.sf-lager-section {
    margin-bottom: 12px;
}
.sf-lager-section:last-child {
    margin-bottom: 0;
}
.sf-lager-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sf-text-dim, #999);
    padding: 4px 0 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 6px;
}
.sf-lager-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sf-lager-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.sf-lager-item:hover {
    background: rgba(255,255,255,0.07);
}
.sf-lager-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 14px;
}
.sf-lager-name {
    flex: 1;
    font-size: 13px;
    color: var(--sf-text, #e8e0d4);
}
.sf-lager-val {
    font-weight: 700;
    font-size: 14px;
    color: var(--sf-text, #fff);
    min-width: 30px;
    text-align: right;
}
.sf-lager-rate {
    font-size: 10px;
    color: #66bb6a;
    opacity: 0.9;
    min-width: 40px;
    text-align: right;
}
.sf-lager-empty {
    text-align: center;
    color: var(--sf-text-dim, #777);
    padding: 24px;
    font-style: italic;
}

@media (max-width: 500px) {
    .sf-lager-panel { width: 95vw; }
    .sf-lager-overlay { padding-top: 60px; }
}


/* ═══════════════════════════════════════════════
   Gesperrte Schichten + Grabung
   ═══════════════════════════════════════════════ */
.sf-hc-locked {
    cursor: default !important;
    position: relative;
    background: repeating-linear-gradient(
        135deg,
        var(--depth-rock, #1a1510),
        var(--depth-rock, #1a1510) 6px,
        rgba(255,255,255,0.03) 6px,
        rgba(255,255,255,0.03) 7px
    ) !important;
    opacity: 0.65;
}
.sf-hc-locked .sf-hc-lock-icon {
    font-size: 18px;
    text-align: center;
    margin-top: 4px;
}
.sf-hc-locked .sf-hc-lock-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.sf-hc-excavate-btn {
    display: block;
    margin: 4px auto 0;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 600;
    background: rgba(212, 160, 32, 0.2);
    border: 1px solid rgba(212, 160, 32, 0.5);
    border-radius: 6px;
    color: #d4a020;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.sf-hc-excavate-btn:hover {
    background: rgba(212, 160, 32, 0.35);
    border-color: #d4a020;
    transform: scale(1.05);
}
.sf-hc-excavate-btn:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

/* ── Toolbar locked state ── */
.sf-ho-tbtn.sf-nav-locked {
    background: rgba(60, 50, 40, 0.3);
    border-color: rgba(100, 90, 70, 0.3);
}
.sf-nav-btn.sf-nav-locked {
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════
   Grab-Animation & Sand-Dialog
   ═══════════════════════════════════════════════ */

/* Grab-Fortschrittsbalken in der Zelle */
.sf-ho-digging {
    pointer-events: none;
    position: relative;
}
.sf-ho-dig-progress {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(30, 25, 18, 0.7);
    border-radius: 8px;
    z-index: 2;
}
.sf-ho-dig-progress span {
    font-size: 22px;
    animation: sf-dig-shake 0.3s infinite alternate;
}
.sf-ho-dig-bar {
    position: absolute; bottom: 4px; left: 8px; right: 8px;
    height: 4px; border-radius: 2px;
    background: var(--sf-accent, #DEA726);
    transform-origin: left;
    animation: sf-dig-fill linear forwards;
}
@keyframes sf-dig-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes sf-dig-shake {
    from { transform: rotate(-8deg); }
    to   { transform: rotate(8deg); }
}

/* Sand-Dialog Overlay */
.sf-sand-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.sf-sand-overlay.visible { opacity: 1; }
.sf-sand-box {
    background: linear-gradient(160deg, #3a2e1e, #2a2018);
    border: 2px solid var(--sf-accent, #DEA726);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 420px; width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 60px rgba(222,167,38,0.15);
    transform: scale(0.9); transition: transform 0.3s ease;
}
.sf-sand-overlay.visible .sf-sand-box { transform: scale(1); }
.sf-sand-icon { font-size: 48px; margin-bottom: 8px; }
.sf-sand-title {
    font-family: var(--ff-display, 'Cinzel', serif);
    font-size: 20px; font-weight: 700;
    color: var(--sf-accent, #DEA726);
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 12px;
}
.sf-sand-amount {
    font-size: 28px; font-weight: 700;
    color: #c2a66b;
    margin-bottom: 14px;
}
.sf-sand-text {
    color: #c8bfa8; font-size: 14px; line-height: 1.6;
    margin-bottom: 16px;
}
.sf-sand-hint {
    background: rgba(222,167,38,0.12);
    border: 1px solid rgba(222,167,38,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #DEA726; font-size: 13px;
    margin-bottom: 16px;
}
.sf-sand-ok {
    background: var(--sf-accent, #DEA726);
    color: #1a1610; border: none;
    border-radius: 8px; padding: 10px 32px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background 0.2s;
}
.sf-sand-ok:hover { background: #e6b830; }
