/* ==========================================================================
   Brauereistatus / Baustelle – TEMPORÄRER BEREICH
   Nach Abschluss der Bauarbeiten vollständig entfernbar.
   Die Entfernungsanleitung steht oben in js/baustelle.js.
   Eigenständig: nur lokale Mittel, keine externen Ressourcen.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reiter in der Navigation
   -------------------------------------------------------------------------- */

.baustelle-badge {
    display: inline-block;
    margin-left: 2px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    color: #d9a655;
    background-color: rgba(18, 18, 18, 0.75);
    border-radius: 3px;
}

/* Vierter Reiter: die Mobil-Navigation muss dafür etwas enger werden.
   Steht bewusst hier – mit dieser Datei verschwindet auch die Anpassung. */
@media (max-width: 768px) {
    /* Bei vier Reitern kann eine Beschriftung zweizeilig werden. Oberkanten
       ausrichten, damit die Symbole trotzdem auf einer Linie sitzen. */
    .mobile-nav-buttons {
        align-items: flex-start;
    }

    .mobile-nav-button {
        padding: 0.4rem 0.2rem;
        gap: 0.35rem;
    }

    .mobile-nav-button svg {
        width: 21px;
        height: 21px;
    }

    .mobile-nav-button span {
        font-size: 0.65rem;
        line-height: 1.2;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Modal-Rahmen
   -------------------------------------------------------------------------- */

.baustelle-modal .modal-content {
    max-width: 880px;
}

.baustelle-intro {
    margin-bottom: 1.8rem;
    text-align: center;
    line-height: 1.6;
    color: rgba(245, 245, 245, 0.8);
}

/* --------------------------------------------------------------------------
   Raster der Brauereibereiche
   -------------------------------------------------------------------------- */

.baustelle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.baustelle-station {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 0.8rem 1rem;
    background-color: rgba(245, 245, 245, 0.03);
    border: 1px solid rgba(217, 166, 85, 0.2);
    border-radius: 8px;
    transition: background-color 0.5s, border-color 0.5s;
}

.baustelle-station.is-active {
    background-color: rgba(217, 166, 85, 0.07);
    border-color: rgba(217, 166, 85, 0.45);
}

/* Bühne für das jeweilige Anlagenmotiv */
.baustelle-stage {
    position: relative;
    width: 100%;
    height: 104px;
    margin-bottom: 0.9rem;
    overflow: hidden; /* hält Dampf und Flocken innerhalb der Bühne */
    transition: filter 0.7s ease, opacity 0.7s ease;
}

/* Ausgegraut, solange der Meilenstein nicht erreicht ist –
   und die Animationen stehen still. */
.baustelle-station:not(.is-active) .baustelle-stage {
    filter: grayscale(1) brightness(0.5);
    opacity: 0.4;
}

.baustelle-station:not(.is-active) .baustelle-stage *,
.baustelle-station:not(.is-active) .baustelle-stage *::before,
.baustelle-station:not(.is-active) .baustelle-stage *::after {
    animation-play-state: paused !important;
}

.baustelle-station-name {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(245, 245, 245, 0.9);
    text-align: center;
}

.baustelle-station-mark {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 1px;
    color: rgba(245, 245, 245, 0.45);
    transition: color 0.5s;
}

.baustelle-station.is-active .baustelle-station-mark {
    color: #d9a655;
}

/* gemeinsame Grundlage aller Motive */
.bs {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
}

.bs span {
    position: absolute;
}

/* --- 1. Sudhaus: Kessel mit aufsteigendem Dampf ------------------------- */

.bs-kessel-body {
    left: 50%;
    bottom: 6px;
    width: 68px;
    height: 52px;
    margin-left: -34px;
    background: linear-gradient(to right, #b9822f, #e0b166 45%, #b9822f);
    border-radius: 6px 6px 20px 20px;
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25);
}

.bs-kessel-lid {
    left: 50%;
    bottom: 56px;
    width: 78px;
    height: 11px;
    margin-left: -39px;
    background: linear-gradient(to bottom, #e0b166, #b9822f);
    border-radius: 6px 6px 3px 3px;
}

.bs-kessel-pipe {
    left: 50%;
    bottom: 66px;
    width: 9px;
    height: 16px;
    margin-left: -4px;
    background: #b9822f;
    border-radius: 2px;
}

.bs-steam {
    left: 50%;
    bottom: 78px;
    width: 11px;
    height: 11px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: bs-steam 3s ease-out infinite;
}

.bs-steam:nth-of-type(1) { margin-left: -14px; animation-delay: 0s; }
.bs-steam:nth-of-type(2) { margin-left: -4px;  animation-delay: 1s; }
.bs-steam:nth-of-type(3) { margin-left: 5px;   animation-delay: 2s; }

/* Steigt nur bis zur Bühnenoberkante und ist dort bereits ausgeblendet */
@keyframes bs-steam {
    0%   { transform: translateY(0) scale(0.5); opacity: 0; }
    30%  { opacity: 0.5; }
    100% { transform: translateY(-22px) scale(1.6); opacity: 0; }
}

/* --- 2. Gärkeller: Zylinderkonischer Tank mit Gärröhrchen ---------------- */

.bs-tank {
    left: 50%;
    bottom: 26px;
    width: 52px;
    height: 44px;
    margin-left: -26px;
    overflow: hidden;
    background: linear-gradient(to right, #b9822f, #e0b166 45%, #b9822f);
    border-radius: 5px 5px 0 0;
}

.bs-cone {
    left: 50%;
    bottom: 6px;
    width: 0;
    height: 0;
    margin-left: -26px;
    border-left: 26px solid transparent;
    border-right: 26px solid transparent;
    border-top: 20px solid #c08e3a;
}

.bs-airlock {
    left: 50%;
    bottom: 70px;
    width: 8px;
    height: 14px;
    margin-left: -4px;
    background: rgba(245, 245, 245, 0.55);
    border-radius: 3px;
    animation: bs-airlock 2.2s ease-in-out infinite;
}

@keyframes bs-airlock {
    0%, 70%, 100% { transform: scaleY(1); }
    80%           { transform: scaleY(1.25); }
}

.bs-bubble {
    bottom: 2px;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    animation: bs-bubble 2.4s ease-in infinite;
}

.bs-bubble:nth-of-type(1) { left: 22%; animation-delay: 0.2s; }
.bs-bubble:nth-of-type(2) { left: 48%; animation-delay: 1.1s; }
.bs-bubble:nth-of-type(3) { left: 72%; animation-delay: 0.7s; }

@keyframes bs-bubble {
    0%   { transform: translateY(0) scale(0.6); opacity: 0; }
    20%  { opacity: 0.8; }
    100% { transform: translateY(-40px) scale(1); opacity: 0; }
}

/* --- 3. Lagerkeller: drei Tanks mit schwankendem Pegel ------------------- */

.bs-lagertank {
    bottom: 10px;
    width: 26px;
    height: 66px;
    overflow: hidden;
    background: rgba(245, 245, 245, 0.08);
    border: 1px solid rgba(217, 166, 85, 0.5);
    border-radius: 5px 5px 8px 8px;
}

.bs-lagertank:nth-of-type(1) { left: 50%; margin-left: -48px; }
.bs-lagertank:nth-of-type(2) { left: 50%; margin-left: -13px; }
.bs-lagertank:nth-of-type(3) { left: 50%; margin-left: 22px; }

.bs-lagertank::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70%;
    background: linear-gradient(to bottom, #e0b166, #b9822f);
    animation: bs-level 4s ease-in-out infinite;
}

.bs-lagertank:nth-of-type(2)::after { height: 55%; animation-delay: 1.3s; }
.bs-lagertank:nth-of-type(3)::after { height: 78%; animation-delay: 2.6s; }

@keyframes bs-level {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(3px); }
}

/* --- 4. Kühlzellen: Kammer mit Frostschimmer und Flocken ----------------- */

.bs-kuehlbox {
    left: 50%;
    bottom: 10px;
    z-index: 0;
    width: 76px;
    height: 62px;
    margin-left: -38px;
    background: linear-gradient(to bottom, rgba(200, 225, 245, 0.22), rgba(150, 190, 220, 0.1));
    border: 1px solid rgba(200, 230, 250, 0.45);
    border-radius: 5px;
    animation: bs-frost 3.4s ease-in-out infinite;
}

/* Tür */
.bs-kuehlbox::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 12px;
    width: 30px;
    border: 1px solid rgba(200, 230, 250, 0.4);
    border-radius: 3px;
}

/* Griff */
.bs-kuehlbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 36px;
    width: 3px;
    height: 12px;
    margin-top: -6px;
    background: rgba(200, 230, 250, 0.65);
    border-radius: 2px;
}

@keyframes bs-frost {
    0%, 100% { box-shadow: inset 0 0 12px rgba(200, 235, 255, 0.15); }
    50%      { box-shadow: inset 0 0 22px rgba(200, 235, 255, 0.45); }
}

/* z-index über der Kammer, damit die Flocken sichtbar davor herunterrieseln */
.bs-flake {
    top: 4px;
    z-index: 1;
    width: 4px;
    height: 4px;
    background: rgba(220, 240, 255, 0.9);
    border-radius: 50%;
    animation: bs-flake 4s linear infinite;
}

.bs-flake:nth-of-type(1) { left: 30%; animation-delay: 0s; }
.bs-flake:nth-of-type(2) { left: 45%; animation-delay: 1.3s; }
.bs-flake:nth-of-type(3) { left: 60%; animation-delay: 2.1s; }
.bs-flake:nth-of-type(4) { left: 70%; animation-delay: 3.2s; }

@keyframes bs-flake {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    15%  { opacity: 0.9; }
    100% { transform: translateY(58px) translateX(-7px); opacity: 0; }
}

/* --- 5. Abfüllung: Flaschen auf dem Band -------------------------------- */

.bs-belt {
    left: 50%;
    bottom: 14px;
    width: 108px;
    height: 8px;
    margin-left: -54px;
    background-color: rgba(245, 245, 245, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.bs-belt::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 200%;
    height: 3px;
    background: repeating-linear-gradient(to right,
        rgba(217, 166, 85, 0.8) 0 6px,
        transparent 6px 14px);
    animation: bs-belt 1.1s linear infinite;
}

@keyframes bs-belt {
    from { transform: translateX(0); }
    to   { transform: translateX(-14px); }
}

/* Am linken Bandanfang verankert und per transform darüber geführt. Mit
   left-Prozenten säßen die Flaschen je nach Spaltenbreite neben dem Band. */
.bs-bottle {
    left: 50%;
    bottom: 22px;
    width: 12px;
    height: 30px;
    margin-left: -52px;
    background: linear-gradient(to bottom, #b9822f 0 8px, #e0b166 8px);
    border-radius: 4px 4px 3px 3px;
    animation: bs-bottle 3.6s linear infinite;
}

.bs-bottle:nth-of-type(1) { animation-delay: 0s; }
.bs-bottle:nth-of-type(2) { animation-delay: 1.2s; }
.bs-bottle:nth-of-type(3) { animation-delay: 2.4s; }

@keyframes bs-bottle {
    0%   { transform: translateX(0); opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { transform: translateX(92px); opacity: 0; }
}

/* --- 6. Schankraum: Zapfhahn mit fallendem Tropfen ---------------------- */

.bs-tap {
    left: 50%;
    bottom: 74px;
    width: 34px;
    height: 10px;
    margin-left: -26px;
    background: linear-gradient(to bottom, #e0b166, #b9822f);
    border-radius: 3px;
}

.bs-tap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 8px;
    width: 9px;
    height: 14px;
    background: #b9822f;
    border-radius: 0 0 3px 3px;
}

/* Fällt aus dem Auslauf (62px) bis in das Glas hinein (Glasrand bei 52px).
   Steht im Markup vor dem Glas, damit es dahinter verschwindet. */
.bs-drop {
    left: 50%;
    bottom: 60px;
    width: 6px;
    height: 8px;
    margin-left: -3px;
    background: #e0b166;
    border-radius: 50% 50% 60% 60%;
    animation: bs-drop 1.6s ease-in infinite;
}

@keyframes bs-drop {
    0%   { transform: translateY(0); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translateY(16px); opacity: 0; }
}

.bs-glass {
    left: 50%;
    bottom: 12px;
    width: 34px;
    height: 40px;
    margin-left: -17px;
    overflow: hidden;
    background: rgba(245, 245, 245, 0.08);
    border: 1px solid rgba(217, 166, 85, 0.5);
    border-radius: 3px 3px 8px 8px;
}

.bs-glass::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62%;
    background: linear-gradient(to bottom, #e0b166, #b9822f);
    animation: bs-level 3s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Fortschrittsbalken mit Meilensteinen
   -------------------------------------------------------------------------- */

.baustelle-progress {
    padding-top: 1.6rem;
    border-top: 1px solid rgba(217, 166, 85, 0.3);
}

.baustelle-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.9rem;
}

.baustelle-progress-label {
    font-size: 0.95rem;
    color: rgba(245, 245, 245, 0.75);
}

.baustelle-progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #d9a655;
}

.baustelle-track {
    position: relative;
    height: 10px;
    background-color: rgba(245, 245, 245, 0.1);
    border-radius: 5px;
}

.baustelle-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to right, #b9822f, #d9a655);
    border-radius: 5px;
}

/* Meilensteinmarken – aus den Bereichen erzeugt, siehe js/baustelle.js */
.baustelle-tick {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background-color: #2a2a2a;
    border: 2px solid rgba(245, 245, 245, 0.3);
    border-radius: 50%;
    transition: background-color 0.4s, border-color 0.4s, transform 0.4s;
}

.baustelle-tick.is-reached {
    background-color: #d9a655;
    border-color: #f0c584;
    transform: scale(1.15);
}

.baustelle-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: rgba(245, 245, 245, 0.45);
}

/* --------------------------------------------------------------------------
   Kleingedrucktes
   -------------------------------------------------------------------------- */

.baustelle-note {
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(245, 245, 245, 0.08);
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.7;
    text-align: center;
    color: rgba(245, 245, 245, 0.42);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 780px) {
    .baustelle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
    }
}

@media (max-width: 460px) {
    .baustelle-grid {
        grid-template-columns: 1fr;
    }

    .baustelle-progress-value {
        font-size: 1.3rem;
    }
}

/* --------------------------------------------------------------------------
   Barrierefreiheit
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .baustelle-stage *,
    .baustelle-stage *::before,
    .baustelle-stage *::after {
        animation: none !important;
    }
}
