.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-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-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-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;
    }
}
