/* =========================================
   HIGHER OR LOWER - CSS
   ========================================= */

.container-hl {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

/* =========================================
   1. TIMER & PROGRESS
   ========================================= */
.hl-top-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center children on desktop */
}

.hl-timer-container {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 auto 12px;
    /* Center horizontally + bottom margin */
    padding: 0 4px;
    width: 100%;
    max-width: 500px;
    /* Don't let it stretch across entire screen */
}

.hl-timer-bar-wrap {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #8d6e63;
}

.hl-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ffb300, #ff6f00);
    border-radius: 6px;
    transition: width 0.1s linear, background 0.3s;
}

.hl-timer-bar.hl-timer-bar-warning {
    background: linear-gradient(90deg, #e53935, #b71c1c);
}

.hl-timer-display {
    font-family: 'Pirata One', cursive;
    font-size: 1.4rem;
    color: #3e2723;
    min-width: 50px;
    text-align: right;
}

.hl-timer-display.hl-timer-warning {
    color: #c62828;
    animation: hl-pulse-warning 1.5s ease-in-out infinite;
}

.hl-timer-bar-ended {
    background-color: #c62828;
    box-shadow: 0 0 10px rgba(198, 40, 40, 0.5);
}

.hl-timer-display.hl-timer-ended {
    color: #c62828;
}

@keyframes hl-pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* =========================================
   2. PROGRESS
   ========================================= */
.hl-progress-container {
    text-align: center;
    font-family: 'Pirata One', cursive;
    font-size: 1.3rem;
    color: #3e2723;
    margin-bottom: 18px;
    background: rgba(255, 248, 225, 0.7);
    padding: 6px 20px;
    border-radius: 50px;
    border: 2px solid #8d6e63;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    /* Automatically centered by parent hl-top-header's align-items: center */
}

.hl-progress-step {
    font-size: 1.6rem;
    color: #e65100;
}

/* =========================================
   3. CARDS LAYOUT
   ========================================= */
.hl-cards-area {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.hl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

/* =========================================
   4. POSTER (mirrors wanted.css exactly)
   ========================================= */
.hl-poster {
    position: relative;
    width: 280px;
    max-width: 100%;
    user-select: none;
    transition: transform 0.3s ease;
}

.hl-card-a .hl-poster:hover {
    transform: scale(1.02);
}

.hl-poster-bg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

/* Photo area — identical proportions to wanted.css */
.hl-photo-area {
    position: absolute;
    top: 23%;
    left: 11.5%;
    width: 77%;
    height: 41%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd5c0;
}

.hl-char-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* Name area */
.hl-name-area {
    position: absolute;
    bottom: 18%;
    left: 10%;
    width: 80%;
    height: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hl-name-text {
    font-family: 'Pirata One', cursive;
    font-size: 1.5rem;
    color: #3e2723;
    text-transform: uppercase;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.15);
    letter-spacing: 2px;
    white-space: normal;
    text-align: center;
    line-height: 0.9;
    width: 95%;
}

/* Bounty area — Card A always visible, Card B revealed on guess */
.hl-bounty-area {
    position: absolute;
    bottom: 11%;
    left: 10%;
    width: 80%;
    height: 8%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hl-bounty-area.hidden {
    display: none;
}

.hl-bounty-text {
    font-family: 'Pirata One', cursive;
    font-size: 1.4rem;
    color: #3e2723;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.15);
    letter-spacing: 2px;
    white-space: nowrap;
}

/* "???" bounty hidden */
.hl-bounty-hidden {
    position: absolute;
    bottom: 11%;
    left: 10%;
    width: 80%;
    height: 8%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Pirata One', cursive;
    font-size: 1.6rem;
    color: #3e2723;
    letter-spacing: 3px;
}

.hl-bounty-hidden.hidden {
    display: none;
}

/* =========================================
   5. VS DIVIDER
   ========================================= */
.hl-vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
}

.hl-vs-text {
    font-family: 'Pirata One', cursive;
    font-size: 2rem;
    color: #ffb300;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(62, 39, 35, 0.85);
    border: 3px solid #8d6e63;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   6. HIGHER / LOWER BUTTONS
   ========================================= */
.hl-card-b {
    width: 280px;
}

.hl-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.hl-btn {
    font-family: 'Pirata One', cursive;
    font-size: 1.2rem;
    padding: 10px 20px;
    border: 2px solid;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    min-width: 110px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.hl-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.hl-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hl-btn-higher {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    border-color: #66bb6a;
}

.hl-btn-lower {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: #fff;
    border-color: #ef9a9a;
}

/* =========================================
   7. FLASH ANIMATIONS
   ========================================= */
@keyframes hl-flash-correct {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.8);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(46, 125, 50, 0);
        background: rgba(46, 125, 50, 0.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
    }
}

@keyframes hl-flash-wrong {
    0% {
        box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.8);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(198, 40, 40, 0);
        background: rgba(198, 40, 40, 0.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(198, 40, 40, 0);
    }
}

.hl-flash-correct {
    animation: hl-flash-correct 0.7s ease forwards;
    border-radius: 8px;
}

.hl-flash-wrong {
    animation: hl-flash-wrong 1s ease forwards;
    border-radius: 8px;
}

/* =========================================
   8. RESPONSIVE
   ========================================= */
@media (max-width: 640px) {
    .hl-top-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 12px;
        width: 100%;
    }

    .hl-timer-container {
        margin-bottom: 0;
        flex: 1;
        /* Timer takes only remaining space */
        min-width: 0;
        /* Prevent it from pushing progress off-screen */
    }

    .hl-progress-container {
        margin-bottom: 0;
        position: relative;
        left: auto;
        transform: none;
        font-size: 1rem;
        padding: 4px 10px;
        flex: 0 0 auto;
        /* Do NOT grow, do NOT shrink, auto width */
        white-space: nowrap;
        /* Prevent text wrapping */
    }

    .hl-cards-area {
        flex-direction: column;
        align-items: center;
        gap: 0;
        /* Reduced gap */
        margin-bottom: 12px;
    }

    .hl-vs-divider {
        margin: 2px 0;
    }

    .hl-card-b {
        width: 100%;
        max-width: 320px;
    }

    .hl-buttons {
        width: 100%;
        justify-content: center;
    }

    .hl-poster {
        width: 195px;
    }

    .hl-vs-text {
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
    }

    .hl-name-text {
        font-size: 0.85rem;
    }

    .hl-bounty-text {
        font-size: 0.85rem;
    }

    .hl-bounty-hidden {
        font-size: 1rem;
    }

    .hl-btn {
        font-size: 1rem;
        padding: 8px 16px;
        min-width: 90px;
    }

    .hl-timer-display {
        font-size: 1rem;
    }

    .hl-progress-container {
        font-size: 1rem;
        padding: 2px 12px;
        margin-bottom: 6px;
    }

    .hl-progress-step {
        font-size: 1.2rem;
    }

    .hl-timer-container {
        margin-bottom: 6px;
    }
}

@media (max-width: 380px) {
    .hl-poster {
        width: 200px;
    }
}