/* RC Tech Village — legacy patch styles.
   Extracted from the tail <style id="patch-*"> blocks of index.html, IN ORDER.
   Loaded AFTER app.css so they keep winning by cascade order (as before).
   TODO: gradually dissolve these into the themed base styles. */

/* ===== patch-v5-18-4-hud-stabilization-rebuilt ===== */
/* v5.18.4 rebuilt — minimal HUD/Lobby stabilization on top of user's v5.18.3 files. */
#center-view-hub,
#center-view-hub .center-page-card,
#center-view-hub .center-page-body,
#center-hub-body,
#center-hub-tabs,
.lobby-news-card,
.lobby-news-grid,
.lobby-news-item,
.shop-tab,
.friends-search input {
    pointer-events: auto;
}

.lobby-news-item,
.community-news-row,
.content-feed-item {
    will-change: auto;
    backface-visibility: hidden;
}

.lobby-news-item:hover {
    transform: none !important;
    border-color: rgba(0,242,255,0.28);
    background: rgba(0,242,255,0.05);
}

.reward-claim-all.ui-action-button {
    min-width: auto;
    min-height: 30px;
    padding: 7px 11px;
    border-radius: 999px;
    border-color: rgba(0,242,255,0.32);
    background: rgba(0,242,255,0.07);
    color: var(--neon);
    box-shadow: inset 0 0 10px rgba(0,242,255,0.08);
}

.reward-claim-all.ui-action-button:hover {
    background: var(--neon);
    color: #001014;
    box-shadow: 0 0 14px rgba(0,242,255,0.32);
}

.reward-trailing-icon {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(190,120,255,0.52));
}

/* ===== patch-v5-18-5-news-loop-fix ===== */
/* v5.18.5 — News stabilization: stop hover flicker and keep rows/buttons clickable. */
#center-content-host[data-center-mode="news"] #center-view-hub,
#center-content-host[data-center-mode="lobby_sections"] #center-view-hub,
#center-hub-body .community-news-shell,
#center-hub-body .community-news-stream,
#center-hub-body .community-news-row,
#center-hub-body .community-news-row summary,
#center-hub-body .filter-chip,
#center-hub-body #news-search-input {
    pointer-events: auto !important;
}

.community-news-row,
.community-news-row summary,
.lobby-news-item {
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
}

.community-news-row:hover,
.content-feed-item:hover,
.lobby-news-item:hover {
    transform: none !important;
}

/* ===== patch-v3-7-1-hotfix ===== */
/* Patch v3.7.1 — HUD state strip + action + mobile transfer hotfix */
.hud-top-instruments {
    width: min(470px, calc(100vw - 500px)) !important;
    padding-inline: 18px !important;
}
.hud-state-strip {
    top: 74px !important;
    gap: 11px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: min(470px, calc(100vw - 70px)) !important;
}
.hud-state-pill {
    min-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 0.7px !important;
    text-shadow: 0 0 10px rgba(0,0,0,.45) !important;
}
.hud-state-pill.ok {
    color: #8ffcff !important;
    text-shadow: 0 0 10px rgba(0,242,255,.55), 0 0 18px rgba(0,242,255,.22) !important;
}
.hud-state-pill.warn {
    color: #ffc4d0 !important;
    text-shadow: 0 0 10px rgba(255,80,140,.42), 0 0 18px rgba(255,80,140,.18) !important;
}
.hud-state-pill.bad {
    color: #ff8ea7 !important;
    text-shadow: 0 0 11px rgba(255,80,120,.56), 0 0 18px rgba(255,80,120,.24) !important;
}
.hud-state-pill.idle {
    color: rgba(214,232,239,.72) !important;
    text-shadow: 0 0 8px rgba(0,242,255,.12) !important;
}
.hud-system-btn.context-pulse {
    background: radial-gradient(circle at 50% 15%, rgba(0,242,255,0.34), rgba(0,242,255,0.13) 58%, rgba(255,255,255,0.035)) !important;
    border-color: rgba(0,242,255,0.92) !important;
    color: #ffffff !important;
    box-shadow: 0 0 24px rgba(0,242,255,0.42), 0 0 12px rgba(0,242,255,0.28), inset 0 0 18px rgba(0,242,255,0.12) !important;
    text-shadow: 0 0 10px rgba(0,242,255,0.55) !important;
}
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #hud-view .hud-system-dock.expanded .hud-transfer-btn {
        display: inline-flex !important;
        order: 4 !important;
    }
    #hud-view .hud-system-dock.expanded .track-pool-btn[data-effect="water"] {
        display: none !important;
    }
}

/* ===== patch-v3-7-2-mobile-transfer-hotfix ===== */
/* Patch v3.7.2 — force TRANSFER into mobile +MORE, hide WATERFALL slot. */
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    /* The older mobile rule hides all primary buttons except CRUISE/ACTION.
       Transfer has no data-system attribute, so it needs a stronger explicit override. */
    #hud-view #hud-system-dock.hud-system-dock.expanded #hud-function-row-primary.primary #transfer-control-btn.hud-transfer-btn.hud-system-btn,
    #hud-view #hud-system-dock.hud-system-dock.expanded #transfer-control-btn.hud-transfer-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        order: 4 !important;
        min-width: 0 !important;
        width: auto !important;
        grid-column: auto !important;
        pointer-events: auto !important;
    }

    /* We free a mobile slot by hiding the WATER effect. The real data-effect is waterfall, not water. */
    #hud-view #hud-system-dock.hud-system-dock.expanded #hud-function-row-secondary.secondary .track-pool-btn[data-effect="waterfall"],
    #hud-view #hud-system-dock.hud-system-dock.expanded .track-pool-btn[data-effect="waterfall"] {
        display: none !important;
        visibility: hidden !important;
    }

    #hud-view #transfer-control-btn {
        font-size: 9px !important;
        letter-spacing: .7px !important;
    }
}

/* ===== patch-v3-7-9-hud-state-strip-bottom-fix ===== */
/* Patch v3.7.9 — HUD state strip bottom alignment */
.hud-top-instruments {
    padding-bottom: 30px !important;
}
.hud-state-strip {
    top: auto !important;
    z-index: 34 !important;
}
.hud-state-pill {
    font-size: 8px !important;
}
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #hud-view .hud-top-instruments.hide-on-mobile {
        padding-bottom: 26px !important;
    }
}

/* ===== patch-v3-7-10-compass-frame-restore ===== */
/* Patch v3.7.10 — restore compact compass frame without empty bottom space. */
.hud-top-instruments {
    padding-bottom: 8px !important;
    min-height: 0 !important;
}
#hud-view .hud-top-instruments.hide-on-mobile {
    padding-bottom: 8px !important;
}
.hud-state-strip {
    top: auto !important;
    bottom: auto !important;
}

/* ===== patch-v5-14-1-missions-ui-bugfix ===== */
/* Patch v5.14.1 — Missions UI/HUD bugfix before Admin Mission Tools. */
.menu-item-with-badge,
.shop-tab {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.menu-item-with-badge { width: 100%; }
.mission-menu-badge {
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.16);
    border: 1px solid rgba(255, 215, 0, 0.38);
    color: #ffe28a;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.3px;
    line-height: 1;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.12);
}
.mission-menu-badge[hidden] { display: none !important; }

#hud-mission-card.mission-collapsed .hud-mission-body,
#hud-mission-card.mission-collapsed .hud-mission-panel {
    display: none !important;
}
#hud-mission-card.mission-collapsed {
    background: rgba(3, 10, 15, 0.28);
}
#hud-mission-card .hud-mission-header {
    min-height: 34px;
}
#hud-mission-card .hud-mission-status-dot {
    margin-left: auto;
}
.hud-mission-mini-btn.hud-select-btn {
    border-color: rgba(0, 242, 255, 0.24) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #d8eef5 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03) !important;
}
.hud-mission-mini-btn.hud-select-btn:hover {
    background: rgba(0,242,255,0.10) !important;
    border-color: rgba(0,242,255,0.48) !important;
    color: white !important;
}

#hud-view #joy-left { bottom: 165px !important; }
#hud-view #joy-right { bottom: 165px !important; }
#hud-view .hud-xp-panel { top: 116px !important; }
#hud-view .hud-pilot-name { top: 154px !important; }
#hud-view [data-system="horn"] { order: 4 !important; }
#hud-view .hud-transfer-btn { order: 9 !important; }
#hud-view [data-system="map"] { order: 10 !important; }

@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(2px + env(safe-area-inset-bottom)) !important;
    }
    #hud-view .hud-xp-panel,
    #hud-view .hud-pilot-name {
        display: none !important;
    }
}

/* ===== patch-v5-14-3-hud-reward-microfix ===== */
/* Patch v5.14.3 — HUD button order, joystick clearance, claimed reward check placement. */
#hud-view #cruise-control-btn { order: 1 !important; }
#hud-view [data-system="horn"] { order: 2 !important; }
#hud-view [data-system="lights_combo"] { order: 3 !important; }
#hud-view [data-system="hazard"] { order: 4 !important; }
#hud-view [data-system="context_action"] { order: 5 !important; }

/* Lower the virtual joysticks by roughly 110px versus the previous default to clear chat/voice controls. */
#hud-view #joy-left,
#hud-view #joy-right {
    bottom: 54px !important;
}

.reward-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}
.reward-title-row .reward-name {
    min-width: 0;
    flex: 1 1 auto;
}
.reward-claimed-check {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(35, 209, 107, 0.52));
}
.reward-card.claimed-reward-card .reward-meta {
    padding-right: 34px;
}

@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    /* On compact layouts push the sticks partially below the visual safe zone so they stop crossing HUD Missions/chat. */
    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(-78px + env(safe-area-inset-bottom)) !important;
    }
}

/* ===== patch-v5-14-4-achievement-joystick-polish ===== */
/* Patch v5.14.4 — achievement claim CTA visibility + joystick lift. */
#hud-view #joy-left,
#hud-view #joy-right {
    bottom: 84px !important;
}

.achievement-card.reward-ready .achievement-claim-reward,
.achievement-claim-reward {
    align-self: flex-start;
    margin-top: 4px;
    border: none !important;
    background: linear-gradient(90deg, rgba(255,215,0,0.95), rgba(255,0,127,0.92)) !important;
    color: #000 !important;
    box-shadow: 0 10px 24px rgba(255, 0, 127, 0.14), 0 0 16px rgba(255, 215, 0, 0.12) !important;
}

.achievement-card.reward-ready .achievement-claim-reward:hover,
.achievement-claim-reward:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 0, 127, 0.18), 0 0 20px rgba(255, 215, 0, 0.18) !important;
}

@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(-48px + env(safe-area-inset-bottom)) !important;
    }
}

/* ===== patch-v5-14-5-notification-joystick-polish ===== */
/* Patch v5.14.5 — notification OPEN routing + joystick lift. */
#hud-view #joy-left,
#hud-view #joy-right {
    bottom: 109px !important;
}

@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(-23px + env(safe-area-inset-bottom)) !important;
    }
}

