/* ==========================================================================
   THE HUNT — event popup (Star Scout style)
   All elements are injected by hunt.js. This file only styles them.
   Uses the CSS variables already defined in header.css (:root).
   ========================================================================== */

.hunt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1800;
}

.hunt-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hunt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.98);
    width: min(880px, 94vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark-6);
    border: 1px solid var(--prm-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
    z-index: 1801;
    overflow: hidden;
}

.hunt-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- Modal top strip: back button / title / currencies, mirrors the game's in-app header --- */
.hunt-modal-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.hunt-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-white);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.hunt-back-btn:hover {
    background: var(--primary-accent);
    color: #fff;
}

.hunt-modal-topbar-title {
    font-family: var(--prm-font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text-white);
    text-transform: uppercase;
    white-space: nowrap;
}

.hunt-modal-topbar-currencies {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.hunt-modal-topbar-currencies::-webkit-scrollbar {
    display: none;
}

.hunt-currency-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
}

.hunt-currency-chip i {
    font-size: 11px;
}

.hunt-currency-chip.gold i { color: var(--primary-accent-light); }
.hunt-currency-chip.gem i { color: #b06cf0; }

/* --- Scrollable body --- */
.hunt-body {
    padding: 18px 20px 0;
    overflow-y: auto;
}

.hunt-heading {
    margin-bottom: 16px;
}

.hunt-heading-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hunt-title {
    font-family: var(--prm-font);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-white);
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(235, 74, 87, 0.35);
}

.hunt-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-light);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hunt-info-btn:hover {
    color: var(--currency-blue);
    border-color: var(--currency-blue);
}

.hunt-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-medium);
    line-height: 1.5;
}

.hunt-subtitle .hunt-days {
    color: var(--secondary-accent);
    font-weight: 700;
}

.hunt-subtitle .hunt-token-note {
    color: var(--text-dark);
}

/* --- Three-panel layout: rewards | clues | target --- */
.hunt-panels {
    display: grid;
    grid-template-columns: 190px 1fr 210px;
    gap: 14px;
    align-items: stretch;
    padding-bottom: 20px;
}

.hunt-panel {
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- Left: Possible Rewards --- */
.hunt-rewards-panel {
    background: var(--bg-dark-5);
    border: 1px solid var(--prm-border);
}

.hunt-rewards-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-white);
    margin-bottom: 10px;
}

.hunt-rewards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex: 1;
}

.hunt-reward-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.hunt-reward-card.rarity-legendary {
    background: linear-gradient(160deg, rgba(255, 179, 71, 0.28), rgba(217, 164, 65, 0.08));
    border-color: rgba(255, 179, 71, 0.4);
}

.hunt-reward-card.rarity-epic {
    background: linear-gradient(160deg, rgba(176, 108, 240, 0.28), rgba(120, 70, 200, 0.08));
    border-color: rgba(176, 108, 240, 0.4);
}

.hunt-reward-card.rarity-rare {
    background: linear-gradient(160deg, rgba(76, 194, 255, 0.28), rgba(30, 155, 224, 0.08));
    border-color: rgba(76, 194, 255, 0.4);
}

.hunt-reward-card-icon {
    font-size: 18px;
    color: var(--text-white);
    opacity: 0.9;
}

.hunt-reward-card.locked .hunt-reward-card-icon {
    color: var(--text-dark);
    opacity: 0.6;
}

.hunt-reward-card-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: var(--text-medium);
}

.hunt-viewmore-btn {
    margin-top: 10px;
    width: 100%;
    padding: 9px 0;
    border-radius: 20px;
    background: transparent;
    border: 1px solid rgba(76, 194, 255, 0.45);
    color: var(--currency-blue);
    font-family: var(--prm-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hunt-viewmore-btn:hover {
    background: rgba(76, 194, 255, 0.1);
}

/* --- Center: Clues --- */
.hunt-clues-panel {
    background: linear-gradient(165deg, #3a1418, #250d10 60%, #1c0a0c);
    border: 1px solid rgba(235, 74, 87, 0.35);
    position: relative;
}

.hunt-clues-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hunt-clues-count {
    font-family: var(--prm-font);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text-white);
}

.hunt-clues-cost-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-white);
}

.hunt-clues-cost-pill i.hunt-coin-icon {
    color: var(--primary-accent-light);
    font-size: 11px;
}

.hunt-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--text-white);
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    margin-left: 2px;
}

.hunt-clues-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 1;
}

.hunt-clue-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: linear-gradient(160deg, #e7c98a, #b98f45);
    border: 1px solid rgba(255, 224, 160, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.hunt-clue-slot:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.hunt-clue-slot i {
    font-size: 22px;
    color: rgba(70, 45, 10, 0.75);
}

.hunt-clue-slot.revealed {
    background: linear-gradient(160deg, var(--secondary-accent), var(--secondary-accent-dark));
    border-color: rgba(53, 208, 127, 0.6);
}

.hunt-clue-slot.revealed i {
    color: rgba(14, 15, 22, 0.8);
}

.hunt-reveal-btn {
    margin-top: 12px;
    width: 100%;
    padding: 11px 0;
    border-radius: 22px;
    border: none;
    background: linear-gradient(135deg, var(--secondary-accent), var(--secondary-accent-dark));
    color: #0e0f16;
    font-family: var(--prm-font);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(53, 208, 127, 0.3);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.hunt-reveal-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* --- Right: Target player OVR range --- */
.hunt-target-panel {
    background: linear-gradient(165deg, #123338, #0d2226 60%, #0a1a1d);
    border: 1px solid rgba(76, 194, 255, 0.35);
    align-items: center;
    text-align: center;
}

.hunt-target-header {
    font-family: var(--prm-font);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text-white);
    margin-bottom: 12px;
}

.hunt-target-card {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 130px;
    border-radius: 12px;
    background: linear-gradient(165deg, #2c1f10, #171009);
    border: 1px solid rgba(255, 179, 71, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hunt-target-silhouette {
    font-size: 46px;
    color: rgba(255, 255, 255, 0.14);
}

.hunt-target-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-medium);
}

.hunt-target-buy-btn {
    margin-top: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 0;
    border-radius: 22px;
    border: none;
    background: linear-gradient(135deg, var(--secondary-accent), var(--secondary-accent-dark));
    color: #0e0f16;
    font-family: var(--prm-font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(53, 208, 127, 0.3);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.hunt-target-buy-btn i {
    color: var(--currency-blue);
}

.hunt-target-buy-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* --- Footer: refresh timer + refresh button --- */
.hunt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.hunt-footer-timer {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-medium);
}

.hunt-footer-timer i {
    color: var(--text-dark);
    font-size: 11px;
}

.hunt-footer-timer-value {
    color: var(--primary-accent);
    font-weight: 700;
}

.hunt-refresh-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    font-family: var(--prm-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.hunt-refresh-btn i {
    color: var(--primary-accent);
    font-size: 11px;
}

.hunt-refresh-btn:hover {
    border-color: rgba(235, 74, 87, 0.4);
}

/* --- Responsive: stack panels on narrow / mobile viewports --- */
@media (max-width: 720px) {
    .hunt-modal {
        width: 96vw;
        max-height: 92vh;
    }

    .hunt-panels {
        grid-template-columns: 1fr;
    }

    .hunt-rewards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hunt-rewards-panel,
    .hunt-clues-panel,
    .hunt-target-panel {
        min-height: unset;
    }

    .hunt-target-panel {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        align-items: center;
    }

    .hunt-target-card {
        width: 90px;
        flex: none;
        min-height: 90px;
    }

    .hunt-target-header {
        margin-bottom: 0;
    }

    .hunt-target-buy-btn {
        margin-top: 0;
        width: auto;
        flex: 1;
    }

    .hunt-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .hunt-refresh-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hunt-modal-topbar-title {
        font-size: 13px;
    }

    .hunt-title {
        font-size: 20px;
    }

    .hunt-rewards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}