.hpm-game,
.hpm-game * {
    box-sizing: border-box;
}

.hpm-game {
    --hpm-bg: #0c1220;
    --hpm-panel: #151d2e;
    --hpm-panel-2: #1c2740;
    --hpm-text: #f6f7fb;
    --hpm-muted: #aab4ca;
    --hpm-danger: #ef5b67;
    --hpm-good: #58d68d;
    --hpm-blue: #69a7ff;
    --hpm-accent: #f5c542;
    width: 100%;
    max-width: 1480px;
    margin: 24px auto;
    color: var(--hpm-text);
    background: var(--hpm-bg);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.36);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
    position: relative;
    isolation: isolate;
    outline: none;
}

.hpm-game:focus-visible {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hpm-accent) 35%, transparent), 0 28px 80px rgba(0,0,0,.36);
}

.hpm-game button,
.hpm-game input,
.hpm-game select {
    font: inherit;
}

.hpm-loading {
    min-height: 360px;
    display: grid;
    place-items: center;
    color: var(--hpm-muted);
    background:
        radial-gradient(circle at 20% 0%, rgba(245,197,66,.13), transparent 36%),
        linear-gradient(180deg, #10182a, #0a0f1a);
}

.hpm-shell {
    min-height: 680px;
    background:
        radial-gradient(circle at 20% -10%, color-mix(in srgb, var(--hpm-accent) 15%, transparent), transparent 34%),
        linear-gradient(180deg, #10182a 0%, #0a101d 100%);
}

.hpm-topbar {
    min-height: 74px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.11);
    background: rgba(8,13,24,.88);
    backdrop-filter: blur(14px);
}

.hpm-brand {
    min-width: 0;
}

.hpm-kicker {
    color: var(--hpm-accent);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 900;
    font-size: 10px;
}

.hpm-brand h2 {
    margin: 1px 0 0;
    color: #fff;
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.05;
    letter-spacing: -.03em;
}

.hpm-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hpm-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 11px;
    padding: 10px 13px;
    color: #fff;
    background: rgba(255,255,255,.07);
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
    box-shadow: none;
    text-decoration: none;
}

.hpm-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.26);
}

.hpm-btn:active {
    transform: translateY(0);
}

.hpm-btn:focus-visible,
.hpm-choice:focus-visible,
.hpm-question:focus-visible,
.hpm-dpad button:focus-visible,
.hpm-interact-mobile:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--hpm-accent) 70%, white);
    outline-offset: 2px;
}

.hpm-btn-primary {
    color: #17130a;
    border-color: transparent;
    background: var(--hpm-accent);
}

.hpm-btn-primary:hover {
    background: color-mix(in srgb, var(--hpm-accent) 88%, white);
}

.hpm-btn-danger {
    background: rgba(239,91,103,.16);
    border-color: rgba(239,91,103,.38);
    color: #ffd6d9;
}

.hpm-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.hpm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 606px;
}

.hpm-stage-column {
    min-width: 0;
    position: relative;
    background: #0b111e;
}

.hpm-stage-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    max-height: calc(100vh - 180px);
    overflow: hidden;
    background: #111827;
    touch-action: none;
}

.hpm-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

.hpm-stage-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 90px rgba(0,0,0,.32);
}

.hpm-room-transition {
    position: absolute;
    inset: 0;
    z-index: 24;
    display: grid;
    place-items: center;
    background: #02040a;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.hpm-room-transition span {
    font-size: clamp(24px, 5vw, 56px);
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-shadow: 0 8px 30px rgba(0,0,0,.8);
    opacity: 0;
    transform: translateY(8px);
}

.hpm-room-transition.is-active {
    visibility: visible;
    animation: hpm-room-fade 980ms ease-in-out both;
}

.hpm-room-transition.is-active span {
    animation: hpm-room-title 980ms ease-in-out both;
}

@keyframes hpm-room-fade {
    0% { opacity: 0; }
    24% { opacity: 1; }
    76% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes hpm-room-title {
    0%, 22% { opacity: 0; transform: translateY(8px); }
    38%, 66% { opacity: 1; transform: translateY(0); }
    84%, 100% { opacity: 0; transform: translateY(-5px); }
}

.hpm-hud {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
}

.hpm-hud-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.hpm-pill {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(5,9,17,.78);
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(0,0,0,.24);
}

.hpm-pill strong {
    color: var(--hpm-accent);
}

.hpm-prompt {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    color: #fff;
    background: rgba(6,10,19,.9);
    backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 850;
    text-align: center;
    box-shadow: 0 10px 32px rgba(0,0,0,.34);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
}

.hpm-prompt.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

.hpm-sidebar {
    border-left: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(180deg, rgba(23,32,51,.98), rgba(12,18,31,.98));
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hpm-case-card {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.hpm-case-label {
    color: var(--hpm-accent);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.hpm-case-card h3 {
    margin: 5px 0 7px;
    color: #fff;
    font-size: 18px;
    line-height: 1.15;
}

.hpm-case-card p {
    margin: 0;
    color: var(--hpm-muted);
    font-size: 12.5px;
}

.hpm-progress-list {
    padding: 12px 16px;
    display: grid;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.hpm-progress-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    color: #e7ebf5;
    font-size: 12px;
    font-weight: 800;
}

.hpm-progress-row span:last-child {
    color: var(--hpm-accent);
}

.hpm-meter {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
}

.hpm-meter > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--hpm-accent);
    transition: width .25s ease;
}

.hpm-feed {
    padding: 14px 16px;
    min-height: 0;
    overflow: auto;
    flex: 1;
}

.hpm-feed h4 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 13px;
}

.hpm-note {
    position: relative;
    margin: 0 0 9px;
    padding: 9px 10px 9px 29px;
    border-radius: 10px;
    background: rgba(255,255,255,.055);
    color: #cbd3e4;
    font-size: 11.5px;
    border: 1px solid rgba(255,255,255,.07);
}

.hpm-note::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: 11px;
    top: 13px;
    background: var(--hpm-blue);
}

.hpm-note.is-clue::before { background: var(--hpm-accent); }
.hpm-note.is-conflict::before { background: var(--hpm-danger); }
.hpm-note.is-good::before { background: var(--hpm-good); }

.hpm-empty {
    color: #7f8aa3;
    font-size: 12px;
    font-style: italic;
}

.hpm-sidebar-actions {
    padding: 12px 16px 16px;
    display: grid;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.hpm-sidebar-actions .hpm-btn {
    width: 100%;
}

.hpm-mobile-controls {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: none;
    justify-content: space-between;
    align-items: end;
    pointer-events: none;
}

.hpm-dpad {
    width: 132px;
    height: 132px;
    display: grid;
    grid-template-columns: repeat(3, 42px);
    grid-template-rows: repeat(3, 42px);
    gap: 3px;
    pointer-events: auto;
}

.hpm-dpad button,
.hpm-interact-mobile {
    appearance: none;
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    background: rgba(9,15,27,.78);
    backdrop-filter: blur(8px);
    border-radius: 11px;
    font-weight: 950;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    touch-action: none;
}

.hpm-dpad button:active,
.hpm-interact-mobile:active {
    background: color-mix(in srgb, var(--hpm-accent) 30%, rgba(9,15,27,.85));
}

.hpm-dpad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.hpm-dpad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.hpm-dpad [data-dir="down"] { grid-column: 2; grid-row: 3; }
.hpm-dpad [data-dir="right"] { grid-column: 3; grid-row: 2; }

.hpm-interact-mobile {
    width: 88px;
    height: 58px;
    pointer-events: auto;
    color: #1d1707;
    background: color-mix(in srgb, var(--hpm-accent) 88%, white);
    border-color: transparent;
}

.hpm-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4,8,16,.82);
    backdrop-filter: blur(12px);
    overflow: auto;
}

.hpm-overlay[hidden] {
    display: none !important;
}

.hpm-intro-overlay {
    z-index: 40;
    padding: clamp(10px, 2.2vw, 26px);
    background:
        radial-gradient(circle at 50% 10%, color-mix(in srgb, var(--hpm-accent) 14%, transparent), transparent 34%),
        rgba(4,8,16,.96);
    backdrop-filter: blur(16px);
    transition: opacity .26s ease, transform .26s ease;
}

.hpm-intro-overlay.is-leaving {
    opacity: 0;
    transform: scale(1.018);
    pointer-events: none;
}

.hpm-intro-card {
    width: min(1040px, 100%);
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.15);
    background:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--hpm-accent) 15%, transparent), transparent 34%),
        linear-gradient(155deg, #182238, #0c1321 68%);
    box-shadow: 0 34px 110px rgba(0,0,0,.62);
}

.hpm-intro-heading {
    min-height: 108px;
    padding: 20px clamp(18px, 4vw, 34px) 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.hpm-intro-kicker {
    margin-bottom: 5px;
    color: var(--hpm-accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.hpm-intro-heading h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 5vw, 54px);
    line-height: .95;
    letter-spacing: -.055em;
}

.hpm-intro-skip {
    appearance: none;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    color: #aeb8cb;
    background: rgba(255,255,255,.045);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.hpm-intro-skip:hover {
    color: #fff;
    border-color: color-mix(in srgb, var(--hpm-accent) 55%, rgba(255,255,255,.13));
    background: color-mix(in srgb, var(--hpm-accent) 9%, rgba(255,255,255,.045));
}

.hpm-intro-scene {
    position: relative;
    overflow: hidden;
    background: #0f1728;
}

.hpm-intro-art {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 960 / 520;
}

.hpm-intro-loading {
    padding: 18px clamp(18px, 4vw, 34px) 22px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(4,8,16,.35);
}

.hpm-intro-loading-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    color: #e8edf6;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.hpm-intro-loading-copy span {
    color: var(--hpm-accent);
    font-variant-numeric: tabular-nums;
}

.hpm-intro-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.hpm-intro-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--hpm-accent) 72%, white), var(--hpm-accent));
    box-shadow: 0 0 18px color-mix(in srgb, var(--hpm-accent) 45%, transparent);
    transition: width .08s linear;
}

.hpm-intro-loading p {
    margin: 9px 0 0;
    color: #76839a;
    font-size: 10px;
    text-align: center;
    letter-spacing: .035em;
}

.hpm-modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 50px);
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.16);
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--hpm-accent) 12%, transparent), transparent 36%),
        linear-gradient(180deg, #1a2438, #101727);
    box-shadow: 0 28px 90px rgba(0,0,0,.5);
}

.hpm-modal-wide {
    width: min(1000px, 100%);
}

.hpm-modal-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.hpm-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(20px, 3vw, 29px);
    line-height: 1.1;
}

.hpm-modal-header p {
    margin: 6px 0 0;
    color: var(--hpm-muted);
    font-size: 13px;
}

.hpm-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
}

.hpm-modal-body {
    padding: 20px;
}

.hpm-start-card {
    width: min(680px, 100%);
    padding: clamp(22px, 5vw, 46px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.16);
    background:
        radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--hpm-accent) 22%, transparent), transparent 40%),
        linear-gradient(160deg, #1a2439 0%, #0f1626 100%);
    box-shadow: 0 35px 100px rgba(0,0,0,.55);
    text-align: center;
}

.hpm-start-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.11);
    color: var(--hpm-accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.hpm-start-card h1 {
    margin: 15px 0 10px;
    font-size: clamp(34px, 7vw, 66px);
    line-height: .95;
    letter-spacing: -.065em;
    color: #fff;
}

.hpm-start-card > p {
    max-width: 560px;
    margin: 0 auto;
    color: #bdc6d8;
    font-size: 15px;
}

.hpm-name-row {
    display: flex;
    gap: 9px;
    max-width: 480px;
    margin: 24px auto 0;
}

.hpm-input,
.hpm-select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 11px;
    color: #fff;
    background: rgba(5,9,17,.55);
    padding: 12px 13px;
    outline: none;
}

.hpm-input:focus,
.hpm-select:focus {
    border-color: var(--hpm-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hpm-accent) 18%, transparent);
}

.hpm-input::placeholder { color: #778198; }
.hpm-select option { color: #111; }

.hpm-start-stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.hpm-stat {
    padding: 11px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.07);
}

.hpm-stat strong {
    display: block;
    color: #fff;
    font-size: 19px;
}

.hpm-stat span {
    color: #8894aa;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 900;
}

.hpm-dialogue-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 20px;
}

.hpm-portrait {
    min-height: 330px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    background: #172238;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 16px 36px rgba(0,0,0,.26);
}

.hpm-portrait-art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 330px;
    object-fit: cover;
}

.hpm-portrait-name {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    padding: 9px 10px;
    text-align: center;
    border-radius: 10px;
    background: rgba(4,8,15,.82);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(7px);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.hpm-dialogue-copy {
    min-width: 0;
}

.hpm-speech {
    padding: 15px;
    border-radius: 13px;
    color: #e9edf6;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    min-height: 84px;
}

.hpm-speech strong { color: var(--hpm-accent); }

.hpm-questions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.hpm-question {
    appearance: none;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 11px;
    padding: 11px 12px;
    color: #e9edf6;
    background: rgba(255,255,255,.045);
    cursor: pointer;
    font-weight: 750;
}

.hpm-question:hover {
    border-color: color-mix(in srgb, var(--hpm-accent) 45%, transparent);
    background: color-mix(in srgb, var(--hpm-accent) 9%, rgba(255,255,255,.045));
}

.hpm-question.is-asked {
    opacity: .62;
}

.hpm-question small {
    display: block;
    margin-top: 3px;
    color: #8590a7;
    font-weight: 650;
}


.hpm-conversation-log {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 7px 4px 2px;
    scroll-behavior: smooth;
}

.hpm-chat-row {
    width: min(88%, 620px);
}

.hpm-chat-row span {
    display: block;
    margin: 0 0 4px 5px;
    color: #8f9ab0;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hpm-chat-row p {
    margin: 0;
    padding: 12px 13px;
    border-radius: 14px 14px 14px 4px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.06);
    color: #edf1f8;
    line-height: 1.45;
}

.hpm-chat-row.is-player {
    align-self: flex-end;
}

.hpm-chat-row.is-player span {
    margin-right: 5px;
    text-align: right;
    color: color-mix(in srgb, var(--hpm-accent) 75%, white);
}

.hpm-chat-row.is-player p {
    border-radius: 14px 14px 4px 14px;
    border-color: color-mix(in srgb, var(--hpm-accent) 28%, transparent);
    background: color-mix(in srgb, var(--hpm-accent) 13%, rgba(255,255,255,.045));
}

.hpm-reply-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.09);
}

.hpm-reply-header strong {
    color: #fff;
}

.hpm-reply-header span {
    color: var(--hpm-accent);
    font-size: 12px;
    font-weight: 900;
}

.hpm-conversation-ended {
    display: grid;
    gap: 8px;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--hpm-accent) 24%, rgba(255,255,255,.08));
    border-radius: 13px;
    background: color-mix(in srgb, var(--hpm-accent) 7%, rgba(255,255,255,.035));
}

.hpm-conversation-ended strong {
    color: var(--hpm-accent);
    font-size: 16px;
}

.hpm-conversation-ended span {
    color: #aab4c7;
}

.hpm-conversation-ended .hpm-btn {
    justify-self: start;
    margin-top: 4px;
}

.hpm-notebook-conversation li {
    margin-bottom: 10px;
}

.hpm-notebook-conversation li > span {
    display: block;
    margin-top: 4px;
    color: #aeb8ca;
}

.hpm-notebook-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hpm-tab {
    appearance: none;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 8px 11px;
    color: #cbd3e4;
    background: rgba(255,255,255,.04);
    cursor: pointer;
    font-weight: 850;
    font-size: 12px;
}

.hpm-tab.is-active {
    color: #17130a;
    background: var(--hpm-accent);
    border-color: transparent;
}

.hpm-tab-panel[hidden] { display: none; }

.hpm-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hpm-notebook-card {
    padding: 13px;
    border-radius: 12px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
}

.hpm-notebook-card h5 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 13px;
}

.hpm-notebook-card p,
.hpm-notebook-card li {
    margin: 0;
    color: #b8c2d5;
    font-size: 12px;
}

.hpm-notebook-card ul {
    margin: 7px 0 0;
    padding-left: 17px;
}

.hpm-conflict-card {
    border-color: rgba(239,91,103,.28);
    background: rgba(239,91,103,.08);
}

.hpm-evidence-card {
    border-color: color-mix(in srgb, var(--hpm-accent) 30%, transparent);
}

.hpm-timeline {
    position: relative;
    display: grid;
    gap: 9px;
    padding-left: 20px;
}

.hpm-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: rgba(255,255,255,.12);
}

.hpm-timeline-item {
    position: relative;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.045);
    color: #c7d0df;
    font-size: 12px;
}

.hpm-timeline-item::before {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    left: -18px;
    top: 14px;
    border-radius: 50%;
    background: var(--hpm-blue);
    box-shadow: 0 0 0 4px #141d2d;
}

.hpm-timeline-item strong {
    color: var(--hpm-accent);
    margin-right: 6px;
}

.hpm-verdict-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.hpm-choice {
    appearance: none;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 17px;
    text-align: left;
    color: #fff;
    background: rgba(255,255,255,.05);
    cursor: pointer;
}

.hpm-choice:hover,
.hpm-choice.is-selected {
    border-color: var(--hpm-accent);
    background: color-mix(in srgb, var(--hpm-accent) 11%, rgba(255,255,255,.05));
}

.hpm-choice strong {
    display: block;
    font-size: 16px;
}

.hpm-choice span {
    display: block;
    margin-top: 3px;
    color: #aeb8cb;
    font-size: 12px;
}

.hpm-verdict-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.hpm-field label {
    display: block;
    margin: 0 0 5px;
    color: #cbd3e4;
    font-size: 11px;
    font-weight: 850;
}

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

.hpm-result-hero {
    text-align: center;
    padding: 6px 0 20px;
}

.hpm-result-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 38px;
    background: rgba(88,214,141,.14);
    border: 1px solid rgba(88,214,141,.35);
}

.hpm-result-hero.is-wrong .hpm-result-icon {
    background: rgba(239,91,103,.14);
    border-color: rgba(239,91,103,.35);
}

.hpm-result-hero h3 {
    margin: 0;
    color: #fff;
    font-size: 28px;
}

.hpm-result-hero p {
    margin: 7px auto 0;
    max-width: 580px;
    color: #b8c2d4;
}

.hpm-score-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.hpm-score-box {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    text-align: center;
}

.hpm-score-box strong {
    display: block;
    color: var(--hpm-accent);
    font-size: 22px;
}

.hpm-score-box span {
    color: #8e99af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
}

.hpm-truth-card {
    padding: 15px;
    border-radius: 13px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.09);
    color: #cbd3e4;
}

.hpm-truth-card h4 {
    margin: 0 0 7px;
    color: #fff;
}

.hpm-result-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 17px;
    flex-wrap: wrap;
}

.hpm-timer-pill strong {
    min-width: 42px;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.hpm-score-total {
    border-color: color-mix(in srgb, var(--hpm-accent) 45%, rgba(255,255,255,.08));
    background: color-mix(in srgb, var(--hpm-accent) 10%, rgba(255,255,255,.05));
}

.hpm-score-total strong {
    font-size: 30px;
}

.hpm-efficiency-card {
    margin: 0 0 14px;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.045);
}

.hpm-efficiency-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.hpm-efficiency-heading strong,
.hpm-efficiency-heading span {
    display: block;
}

.hpm-efficiency-heading strong {
    color: #fff;
    font-size: 15px;
}

.hpm-efficiency-heading span {
    margin-top: 2px;
    color: #8f9bb0;
    font-size: 11px;
}

.hpm-efficiency-heading b {
    color: var(--hpm-accent);
    font-size: 24px;
    white-space: nowrap;
}

.hpm-efficiency-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}

.hpm-efficiency-grid > div {
    padding: 12px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    border-radius: 11px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
}

.hpm-efficiency-grid strong {
    color: #fff;
    font-size: 23px;
}

.hpm-efficiency-grid span {
    color: #aeb8cb;
    font-size: 11px;
    font-weight: 800;
}

.hpm-efficiency-grid em {
    color: var(--hpm-good);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.hpm-efficiency-card > p {
    margin: 11px 0 0;
    color: #8f9bb0;
    font-size: 11px;
}

.hpm-score-row-details {
    margin-top: 0;
}

.hpm-toast-stack {
    position: absolute;
    z-index: 45;
    top: 84px;
    right: 12px;
    width: min(340px, calc(100% - 24px));
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.hpm-toast {
    padding: 12px 13px;
    border-radius: 12px;
    color: #fff;
    background: rgba(11,17,29,.96);
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 14px 35px rgba(0,0,0,.35);
    font-size: 12px;
    font-weight: 750;
    animation: hpm-toast-in .2s ease both;
}

.hpm-toast strong {
    color: var(--hpm-accent);
}

.hpm-toast.is-conflict { border-color: rgba(239,91,103,.48); }
.hpm-toast.is-clue { border-color: color-mix(in srgb, var(--hpm-accent) 55%, transparent); }

@keyframes hpm-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hpm-game.is-fullscreen {
    max-width: none;
    margin: 0;
    border-radius: 0;
    border: 0;
    width: 100vw;
    height: 100vh;
}

.hpm-game.is-fullscreen .hpm-shell,
.hpm-game.is-fullscreen .hpm-layout {
    height: 100%;
}

.hpm-game.is-fullscreen .hpm-layout {
    min-height: 0;
    height: calc(100vh - 74px);
}

.hpm-game.is-fullscreen .hpm-stage-wrap {
    height: 100%;
    max-height: none;
    min-height: 0;
    aspect-ratio: auto;
}

@media (max-width: 1050px) {
    .hpm-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 850px) {
    .hpm-layout {
        display: block;
    }

    .hpm-sidebar {
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.1);
    }

    .hpm-case-card,
    .hpm-progress-list,
    .hpm-feed {
        display: none;
    }

    .hpm-sidebar-actions {
        grid-template-columns: 1fr 1fr;
        padding: 10px;
    }

    .hpm-stage-wrap {
        min-height: 480px;
        max-height: 72vh;
    }
}

@media (max-width: 700px), (pointer: coarse) {
    .hpm-mobile-controls { display: flex; }
    .hpm-prompt { bottom: 92px; }
    .hpm-hud { top: 8px; left: 8px; right: 8px; }
    .hpm-pill { font-size: 10px; padding: 6px 8px; }
}

@media (max-width: 640px) {
    .hpm-intro-overlay {
        padding: 7px;
    }

    .hpm-intro-card {
        border-radius: 16px;
    }

    .hpm-intro-heading {
        min-height: 82px;
        padding: 14px 15px 12px;
    }

    .hpm-intro-heading h1 {
        font-size: clamp(27px, 9vw, 42px);
    }

    .hpm-intro-art {
        width: 130%;
        max-width: none;
        margin-left: -15%;
    }

    .hpm-intro-loading {
        padding: 14px 15px 17px;
    }

    .hpm-game {
        margin: 12px auto;
        border-radius: 14px;
    }

    .hpm-topbar {
        align-items: flex-start;
        min-height: 68px;
        padding: 10px;
    }

    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary) {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 0;
    }

    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary)::first-letter {
        font-size: 16px;
    }

    .hpm-toolbar .hpm-btn-primary {
        padding: 9px 10px;
        font-size: 12px;
    }

    .hpm-stage-wrap {
        min-height: 520px;
        aspect-ratio: 9 / 12;
    }

    .hpm-name-row {
        flex-direction: column;
    }

    .hpm-start-stats {
        grid-template-columns: 1fr;
    }

    .hpm-dialogue-grid {
        grid-template-columns: 1fr;
    }

    .hpm-portrait {
        min-height: 245px;
    }

    .hpm-portrait-art {
        min-height: 245px;
        max-height: 300px;
    }

    .hpm-efficiency-grid {
        grid-template-columns: 1fr;
    }

    .hpm-card-grid,
    .hpm-verdict-grid,
    .hpm-verdict-fields,
    .hpm-score-row {
        grid-template-columns: 1fr;
    }

    .hpm-modal-body,
    .hpm-modal-header {
        padding: 15px;
    }

    .hpm-overlay {
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hpm-game *,
    .hpm-game *::before,
    .hpm-game *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}


/* ------------------------------------------------------------
   Mobile game pass — v1.5.0
   Keep the game feeling like an app instead of a webpage inside
   another webpage. These overrides intentionally live last.
   ------------------------------------------------------------ */
.hpm-btn-icon {
    display: inline-block;
    margin-right: 5px;
}

@media (max-width: 700px) {
    .hpm-game {
        width: 100%;
        max-width: 100%;
        margin: 8px auto;
        border-radius: 14px;
        overflow: hidden;
    }

    .hpm-shell {
        min-height: 0;
    }

    .hpm-topbar {
        min-height: 0;
        padding: 9px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        align-items: stretch;
    }

    .hpm-brand {
        padding: 0 2px;
    }

    .hpm-kicker {
        display: none;
    }

    .hpm-brand h2 {
        margin: 0;
        font-size: 20px;
        line-height: 1.05;
        text-align: center;
    }

    .hpm-toolbar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .hpm-toolbar .hpm-btn,
    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary) {
        width: 100%;
        min-width: 0;
        height: 39px;
        padding: 6px 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border-radius: 9px;
        font-size: 10px;
        line-height: 1;
        white-space: nowrap;
    }

    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary) {
        font-size: 10px;
    }

    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary)::first-letter {
        font-size: inherit;
    }

    .hpm-btn-icon {
        margin: 0;
        font-size: 14px;
        line-height: 1;
    }

    .hpm-btn-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hpm-layout {
        display: block;
        min-height: 0;
    }

    .hpm-stage-wrap {
        min-height: 0;
        height: clamp(500px, 68dvh, 620px);
        max-height: none;
        aspect-ratio: auto;
    }

    .hpm-hud {
        top: 7px;
        left: 7px;
        right: 7px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        align-items: start;
    }

    .hpm-hud-group {
        min-width: 0;
        gap: 5px;
        flex-wrap: nowrap;
    }

    .hpm-hud-group:first-child .hpm-pill:nth-child(2),
    .hpm-hud-group:last-child .hpm-pill:not(.hpm-timer-pill) {
        display: none;
    }

    .hpm-pill {
        max-width: 100%;
        padding: 6px 8px;
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hpm-mobile-controls {
        left: 10px;
        right: 10px;
        bottom: 10px;
        align-items: end;
    }

    .hpm-dpad {
        width: 108px;
        height: 108px;
        grid-template-columns: repeat(3, 34px);
        grid-template-rows: repeat(3, 34px);
        gap: 3px;
    }

    .hpm-dpad button {
        border-radius: 9px;
        font-size: 13px;
    }

    .hpm-interact-mobile {
        width: 80px;
        height: 50px;
        border-radius: 10px;
        font-size: 11px;
    }

    .hpm-prompt {
        bottom: 78px;
        max-width: calc(100% - 130px);
        padding: 8px 10px;
        font-size: 11px;
        line-height: 1.25;
    }

    .hpm-sidebar {
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.1);
    }

    .hpm-sidebar-actions {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding: 8px;
    }

    .hpm-sidebar-actions .hpm-btn {
        min-height: 44px;
        padding: 9px 8px;
        font-size: 12px;
    }

    /* All game overlays become viewport sheets on phones. */
    .hpm-overlay {
        position: fixed;
        inset: 0;
        z-index: 2147483000;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        overscroll-behavior: contain;
        background: #090f1b;
        backdrop-filter: none;
    }

    .hpm-modal,
    .hpm-modal-wide {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        border: 0;
        border-radius: 0;
        overflow: hidden;
        box-shadow: none;
    }

    .hpm-modal-header {
        position: relative;
        z-index: 3;
        flex: 0 0 auto;
        min-height: 58px;
        padding: calc(9px + env(safe-area-inset-top)) 12px 9px;
        align-items: center;
        background: rgba(11,17,29,.97);
        box-shadow: 0 1px 0 rgba(255,255,255,.08);
    }

    .hpm-modal-header h3 {
        font-size: 19px;
        line-height: 1.05;
    }

    .hpm-modal-header p {
        margin-top: 3px;
        font-size: 10.5px;
        line-height: 1.2;
    }

    .hpm-close {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .hpm-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 11px 12px calc(12px + env(safe-area-inset-bottom));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Interrogations: portrait stays compact; only chat/questions scroll internally. */
    [data-overlay="dialogue"] .hpm-modal-body {
        overflow: hidden;
    }

    .hpm-dialogue-grid {
        height: 100%;
        min-height: 0;
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    .hpm-portrait {
        align-self: start;
        position: sticky;
        top: 0;
        width: 82px;
        height: 126px;
        min-height: 126px;
        border-radius: 12px;
    }

    .hpm-portrait-art {
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }

    .hpm-portrait-name {
        left: 5px;
        right: 5px;
        bottom: 5px;
        padding: 4px 3px;
        border-radius: 6px;
        font-size: 7.5px;
        line-height: 1.15;
    }

    .hpm-dialogue-copy {
        min-width: 0;
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .hpm-conversation-log {
        flex: 0 1 auto;
        min-height: 78px;
        max-height: 27dvh;
        padding: 1px 3px 3px 1px;
        gap: 7px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .hpm-chat-row {
        width: 96%;
    }

    .hpm-chat-row span {
        margin-bottom: 2px;
        font-size: 8px;
    }

    .hpm-chat-row p {
        padding: 8px 9px;
        border-radius: 10px 10px 10px 3px;
        font-size: 11.5px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .hpm-chat-row.is-player p {
        border-radius: 10px 10px 3px 10px;
    }

    .hpm-reply-header {
        flex: 0 0 auto;
        margin-top: 8px;
        padding-top: 8px;
        gap: 6px;
        align-items: center;
    }

    .hpm-reply-header strong {
        font-size: 12px;
    }

    .hpm-reply-header span {
        font-size: 9.5px;
        white-space: nowrap;
    }

    .hpm-questions {
        flex: 1 1 auto;
        min-height: 0;
        margin-top: 7px;
        gap: 6px;
        align-content: start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 0 2px 2px 0;
    }

    .hpm-question {
        min-height: 43px;
        padding: 8px 9px;
        border-radius: 9px;
        font-size: 11.5px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .hpm-question small {
        display: none;
    }

    .hpm-conversation-ended {
        margin-top: 9px;
        padding: 11px;
        gap: 6px;
    }

    .hpm-conversation-ended strong {
        font-size: 14px;
    }

    .hpm-conversation-ended span {
        font-size: 11px;
    }

    .hpm-conversation-ended .hpm-btn {
        width: 100%;
        justify-self: stretch;
        min-height: 44px;
    }

    /* Notebook stays one clean row of tabs instead of wrapping over itself. */
    .hpm-notebook-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 4px;
        margin-bottom: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .hpm-notebook-tabs::-webkit-scrollbar {
        display: none;
    }

    .hpm-tab {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 7px 10px;
        font-size: 10.5px;
    }

    .hpm-card-grid,
    .hpm-verdict-grid,
    .hpm-verdict-fields,
    .hpm-score-row,
    .hpm-efficiency-grid {
        grid-template-columns: 1fr;
    }

    .hpm-notebook-card,
    .hpm-truth-card,
    .hpm-choice,
    .hpm-score-box,
    .hpm-efficiency-card {
        border-radius: 11px;
    }

    .hpm-choice {
        min-height: 70px;
        padding: 13px;
    }

    .hpm-verdict-actions,
    .hpm-result-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .hpm-verdict-actions .hpm-btn,
    .hpm-result-actions .hpm-btn {
        width: 100%;
        min-height: 44px;
    }

    .hpm-efficiency-heading {
        align-items: center;
    }

    .hpm-efficiency-grid > div {
        grid-template-columns: auto 1fr auto;
    }

    /* Start screen fits without the old three-card vertical pile. */
    [data-overlay="start"] {
        padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .hpm-start-card {
        width: min(520px, 100%);
        max-height: 100%;
        padding: 18px 15px;
        border-radius: 17px;
        overflow-y: auto;
    }

    .hpm-start-badge {
        padding: 6px 8px;
        font-size: 8px;
    }

    .hpm-start-card h1 {
        margin: 11px 0 8px;
        font-size: clamp(34px, 11vw, 48px);
    }

    .hpm-start-card > p {
        font-size: 12.5px;
        line-height: 1.35;
    }

    .hpm-name-row {
        margin-top: 15px;
        gap: 7px;
    }

    .hpm-name-row .hpm-btn {
        min-height: 44px;
    }

    .hpm-start-stats {
        margin-top: 12px;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .hpm-stat {
        padding: 8px 5px;
    }

    .hpm-stat strong {
        font-size: 16px;
    }

    .hpm-stat span {
        font-size: 7.5px;
        letter-spacing: .04em;
    }

    /* Intro fills the phone cleanly and crops the SVG rather than overflowing it. */
    .hpm-intro-overlay {
        padding: 0;
        align-items: stretch;
        overflow: hidden;
    }

    .hpm-intro-card {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .hpm-intro-heading {
        flex: 0 0 auto;
        min-height: 76px;
        padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
        align-items: center;
    }

    .hpm-intro-kicker {
        font-size: 8px;
    }

    .hpm-intro-heading h1 {
        font-size: clamp(28px, 9vw, 40px);
    }

    .hpm-intro-skip {
        min-width: 54px;
        min-height: 36px;
        padding: 7px 10px;
    }

    .hpm-intro-scene {
        flex: 1 1 auto;
        min-height: 0;
    }

    .hpm-intro-art {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: 50% 50%;
    }

    .hpm-intro-loading {
        flex: 0 0 auto;
        padding: 13px 14px calc(14px + env(safe-area-inset-bottom));
    }

    .hpm-toast-stack {
        position: fixed;
        z-index: 2147483640;
        top: calc(8px + env(safe-area-inset-top));
        right: 8px;
        width: calc(100vw - 16px);
    }
}

@media (max-width: 360px) {
    .hpm-toolbar .hpm-btn,
    .hpm-toolbar .hpm-btn:not(.hpm-btn-primary) {
        font-size: 9px;
    }

    .hpm-toolbar {
        gap: 4px;
    }

    .hpm-btn-icon {
        font-size: 12px;
    }

    .hpm-dialogue-grid {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 8px;
    }

    .hpm-portrait {
        width: 68px;
        height: 108px;
        min-height: 108px;
    }

    .hpm-question {
        font-size: 11px;
    }
}


/* ------------------------------------------------------------
   THERE ARE TWELVE OF US — horror fork
   ------------------------------------------------------------ */
.hpm-game {
    --hpm-bg:#080b11;
    --hpm-panel:#11161f;
    --hpm-panel-2:#171e29;
    --hpm-danger:#c93746;
    --hpm-good:#7ac29b;
    --hpm-blue:#7d98b8;
    --hpm-accent:#b52c3a;
    border-color:rgba(181,44,58,.32);
    box-shadow:0 28px 90px rgba(0,0,0,.58);
}
.hpm-shell { background:radial-gradient(circle at 50% -20%, rgba(150,30,42,.18), transparent 36%), linear-gradient(180deg,#0b0f16,#06080d 100%); }
.hpm-stage-shade { box-shadow:inset 0 0 140px rgba(0,0,0,.62); background:linear-gradient(180deg,rgba(0,0,0,.08),rgba(20,0,3,.12)); }
.hpm-start-badge,.hpm-intro-kicker,.hpm-kicker { color:#e05a66; }
.hpm-btn-primary { background:#b52c3a; color:#fff; }
.hpm-btn-primary:hover { background:#cf3b49; }
.hpm-case-label { color:#d95a66; }
.hpm-timer-pill { border-color:rgba(181,44,58,.34); }
.hpm-event-modal { width:min(560px,100%); }
.hpm-event-card { min-height:410px; padding:40px 28px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:13px; background:radial-gradient(circle at 50% 20%,rgba(181,44,58,.18),transparent 40%); }
.hpm-event-icon { width:74px;height:74px;border-radius:50%;display:grid;place-items:center;font-size:34px;background:rgba(181,44,58,.14);border:1px solid rgba(224,90,102,.36); }
.hpm-event-card h3 { margin:0; font-size:clamp(28px,5vw,46px); letter-spacing:-.035em; }
.hpm-event-card p { margin:0; max-width:460px; color:#e4e8ee; font-size:16px; }
.hpm-event-card span { color:#8f99aa; font-size:13px; }
.hpm-event-card .hpm-btn { margin-top:10px; min-width:190px; }
.hpm-event-count { color:#e05a66;font-weight:900;letter-spacing:.2em;font-size:12px; }
.hpm-missing-tag { display:inline-block;margin-left:5px;padding:2px 6px;border-radius:999px;background:rgba(181,44,58,.18);color:#ef7a85;font-size:9px;letter-spacing:.08em;vertical-align:2px; }
.hpm-choice.is-missing { opacity:.34; filter:grayscale(1); text-decoration:line-through; }
.hpm-accuse-intro { margin-bottom:14px;padding:15px;border:1px solid rgba(181,44,58,.25);border-radius:13px;background:rgba(181,44,58,.08); }
.hpm-accuse-intro strong { display:block;font-size:18px;color:#fff; }
.hpm-accuse-intro p { margin:5px 0;color:#b8c0cc; }
.hpm-accuse-intro span { color:#e05a66;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em; }
.hpm-suspect-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.hpm-game.is-flickering .hpm-stage-wrap,.hpm-game.is-flickering .hpm-topbar { animation:twelve-flicker 760ms steps(1,end); }
@keyframes twelve-flicker { 0%,100%{filter:none} 12%{filter:brightness(.05)} 22%{filter:brightness(1.4) contrast(1.2)} 34%{filter:brightness(.12)} 49%{filter:none} 61%{filter:brightness(.04)} 73%{filter:brightness(.8)} }

@media (max-width:700px){
    .hpm-hud-group:last-child .hpm-pill:nth-child(1){display:flex!important;}
    .hpm-hud-group:last-child .hpm-pill:nth-child(2){display:flex!important;}
    .hpm-hud-group:last-child .hpm-pill:nth-child(3){display:none!important;}
    .hpm-hud-group:last-child{gap:4px;}
    .hpm-event-card{min-height:100%;padding:calc(30px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));}
    .hpm-suspect-grid{grid-template-columns:1fr 1fr;gap:7px;}
    .hpm-suspect-grid .hpm-choice{min-height:72px;padding:9px;}
    .hpm-suspect-grid .hpm-choice strong{font-size:13px;}
    .hpm-suspect-grid .hpm-choice span{font-size:9.5px;}
}
