:root { --hp-height: 38px; }
.hp-hud {
    box-sizing: border-box;
    position: sticky;
    top: var(--game-guest-height, 0px);
    z-index: 79;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    height: var(--hp-height);
    padding: 2px 9px;
    background: #111b2b;
    border-bottom: 1px solid #435376;
    color: #eef4ff;
    font: 600 12px/1.2 system-ui, Tahoma, sans-serif;
}
.hp-hud .hp-open, .hp-dialog button, .hp-dialog a {
    cursor: pointer;
    min-width: 42px;
    border: 1px solid #506082;
    border-radius: 8px;
    color: #f4f7ff;
    background: #23334d;
    font: inherit;
    text-decoration: none;
}
.hp-hud .hp-open {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    gap: 8px;
    padding: 2px 8px;
}
.hp-symbols { display: flex; gap: 1px; direction: ltr; font-size: 18px; line-height: 1; }
.hp-symbols > span { color: #67768d; }
.hp-symbols .is-full { color: #ff7089; }
.hp-symbols .is-half {
    background: linear-gradient(90deg, #ff7089 50%, #67768d 50%);
    color: #ff7089;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#hp-count, #hp-countdown, #hp-dialog-clock { font-variant-numeric: tabular-nums; }
#hp-countdown { color: #d9e4f9; white-space: nowrap; }
.hp-hud[hidden], .hp-dialog [hidden] { display: none !important; }
.hp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.hp-hud .hp-open:focus-visible, .hp-dialog button:focus-visible, .hp-dialog a:focus-visible {
    outline: 2px solid #ffd19a;
    outline-offset: 2px;
}
.hp-dialog {
    box-sizing: border-box;
    width: min(430px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100svh - 16px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 19px;
    border: 1px solid #667997;
    border-radius: 18px;
    background: #162540;
    color: #f0f5ff;
    text-align: start;
    font: 600 15px/1.55 system-ui, Tahoma, sans-serif;
}
.hp-dialog::backdrop { background: #060d19c9; }
.hp-dialog h2 { margin: 0 0 6px; color: #ffe1e7; font-size: 1.38rem; }
.hp-dialog p { margin: 5px 0; }
#hp-dialog-clock { font-size: 1.6rem; font-weight: 800; text-align: center; color: #ffc1cc; }
#hp-error { color: #ffcb95; }
.hp-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.hp-dialog button, .hp-dialog a { min-height: 44px; padding: 8px 11px; display: inline-flex; align-items: center; }
.hp-dialog .hp-primary { background: #ffabbc; color: #331b2a; border-color: #ffabbc; }
.hp-dialog button:disabled { opacity: .55; cursor: wait; }
@media (orientation: landscape) and (max-height: 500px) {
    .hp-dialog { width: min(680px, calc(100vw - 24px)); padding: 12px 16px; font-size: 14px; }
    .hp-dialog h2 { font-size: 1.15rem; }
    #hp-dialog-clock { font-size: 1.3rem; }
    .hp-buttons { margin-top: 8px; }
}
html:has(.hp-hud) #traffic {
    height: calc(100svh - var(--game-guest-height, 0px) - var(--hp-height));
}
:fullscreen .hp-hud { top: 0; }
@media (max-width: 350px) {
    .hp-symbols { font-size: 15px; }
    .hp-hud { gap: 6px; }
}

