/* iArbre — jouabilité HUD (drop-in css/style.css ou lien séparé) */

#iarbre-play-hud {
    position: fixed;
    top: 72px;
    left: 12px;
    right: auto;
    transform: none;
    z-index: 902;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: flex-start;
    pointer-events: auto;
    width: max-content;
    max-width: min(360px, calc(100vw - 24px));
    margin: 0;
}

.play-hud-btn,
.play-filter button,
#explore-coach button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.35);
    background: rgba(8, 14, 22, 0.88);
    color: #e8f4f2;
    font-size: 0.85rem;
    cursor: pointer;
}

.play-hud-btn-primary,
.play-filter button.is-active {
    background: #0E6B6E;
    border-color: #2DD4BF;
}

.play-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tree-label[data-featured="1"],
.tree-label[data-featured="1"].is-lod-hidden,
.tree-label[data-featured="1"].is-occluded,
.tree-label.tree-trunk,
.tree-label.tree-branch-label:not(.tree-subbranch):not(.theme-dynamic) {
    opacity: 0.95 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.tree-label[data-featured="1"] {
    outline: 1px solid rgba(45, 212, 191, 0.45);
}

.tree-label-popover {
    min-width: 220px;
    max-width: 280px;
    padding: 10px;
    background: rgba(8, 14, 22, 0.94);
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 10px;
    z-index: 40;
}

.tree-pop-summary {
    margin: 0 0 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #c5d0dc;
}

.tree-pop-btn {
    min-height: 44px;
    width: 100%;
    margin: 4px 0;
}

#explore-coach {
    max-width: 360px;
    padding: 12px 14px;
    top: 80px !important;
    bottom: auto !important;
    left: auto !important;
    right: 12px !important;
    transform: none !important;
}

.coach-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.timeline-ticks {
    position: relative;
    display: block;
    min-height: 1.1em;
}

.timeline-ticks span {
    position: absolute;
    top: 0;
    white-space: nowrap;
}

.timeline-ticks span:nth-child(1) {
    left: 0;
}

.timeline-ticks span:nth-child(3) {
    right: 0;
}

#iarbre-play-toast {
    position: fixed;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    z-index: 8000;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(8, 14, 22, 0.94);
    border: 1px solid rgba(45, 212, 191, 0.45);
    color: #e8f4f2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#iarbre-play-toast.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#iarbre-play-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 320px;
}

.play-hist-btn {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
}

#iarbre-mine-empty {
    max-width: 280px;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #c5d0dc;
}

.journey-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.tree-pop-summary strong {
    display: block;
    margin-bottom: 4px;
    color: #e8f4f2;
}

@media (max-width: 640px) {
    #iarbre-play-hud {
        top: auto;
        bottom: 118px;
        left: 8px;
        max-width: calc(100vw - 88px);
    }

    #explore-coach {
        top: auto !important;
        right: 8px !important;
        bottom: 168px !important;
        max-width: min(320px, calc(100vw - 16px));
    }
}
