/* ========================================= */
/* === ANIMACE: DŘEVĚNÝ BOOTLOADER === */
/* ========================================= */

/* Hlavní plátno přes celou obrazovku */
#wood-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #faf3e0; /* Vaše béžová */
    z-index: 9999; /* Musí být nad vším */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

/* Skrytí loaderu po načtení */
#wood-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-size: 2rem;
    font-weight: 800;
    color: #3e2723;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Kontejner pro trám */
.beam-container {
    width: 300px;
    height: 40px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: visible; /* Aby hoblík mohl přečuhovat */
}

/* 1. SUROVÝ TRÁM (Pozadí) */
.raw-beam {
    width: 100%; height: 100%;
    background-color: #5d4037; /* Tmavá kůra */
    /* Vytvoření textury kůry pomocí gradientu */
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.2) 10px, rgba(0,0,0,0.2) 20px);
    border-radius: 4px;
    position: absolute;
    top: 0; left: 0;
}

/* 2. OPRACOVANÝ TRÁM (Progress bar) */
.finished-beam {
    width: 0%; /* Začíná na 0 */
    height: 100%;
    background-color: #deb887; /* Světlé dřevo */
    /* Textura letokruhů */
    background-image: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    border-radius: 4px 0 0 4px;
    position: absolute;
    top: 0; left: 0;
    border-right: 2px solid #8d6e63; /* Řez */
    transition: width 0.1s linear; /* Plynulý pohyb */
}

/* NÁSTROJ (Hoblík) */
.planer-tool {
    position: absolute;
    right: -25px; /* Aby byl hoblík přesně na hraně řezu */
    top: -15px;
    width: 50px;
    height: 30px;
    z-index: 10;
}

/* Tělo hoblíku */
.planer-tool .body {
    width: 100%; height: 15px;
    background-color: #3e2723; /* Kov/Dřevo */
    border-radius: 5px;
    position: absolute;
    bottom: 0;
}

/* Madlo hoblíku */
.planer-tool .handle {
    width: 10px; height: 15px;
    background-color: #8d6e63;
    position: absolute;
    right: 10px; top: 0;
    border-radius: 5px 5px 0 0;
    transform: skewX(-10deg);
}

/* Text pod loaderem */
.loading-text {
    margin-top: 3rem;
    color: #8d6e63;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ANIMACE HOBLIN (Vylétávají z hoblíku) */
.shaving {
    position: absolute;
    bottom: 5px; left: 0;
    background-color: #deb887;
    width: 6px; height: 6px;
    border-radius: 50%;
    opacity: 0;
}

/* Pokud se lišta hýbe (přidáme třídu JS), spustíme animaci hoblin */
.finished-beam.working .shaving.s1 { animation: flyChips 0.5s infinite; }
.finished-beam.working .shaving.s2 { animation: flyChips 0.7s infinite 0.1s; }
.finished-beam.working .shaving.s3 { animation: flyChips 0.6s infinite 0.2s; }

@keyframes flyChips {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(-20px, -30px) rotate(180deg); opacity: 0; }
}