.hxh-combat-result {
    width: min(100%, 640px);
    margin: 2rem auto;
    color: #5c3c10;
    background: #fffcf5;
    border: 2px solid #d4b896;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(140,109,63,.12);
}
.hxh-result-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #6b4b1e, #8c6d3f);
    color: #fff3d5;
}
.hxh-result-heading h1 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: inherit;
}
.hxh-result-heading > i { font-size: 1.5rem; }
.hxh-result-rewards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.75rem 1.25rem;
    margin: 0;
    text-align: center;
}
.hxh-result-rewards > div + div { border-left: 1px solid #d4b896; }
.hxh-result-rewards dt { font-size: .95rem; font-weight: normal; }
.hxh-result-rewards dt i { display: block; color: #8c6d3f; margin-bottom: .5rem; }
.hxh-result-rewards dd { margin: .5rem 0 0; font-size: 1.5rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.hxh-result-loot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 1.25rem 1.5rem;
}
.hxh-result-loot img { object-fit: contain; border: 1px solid #d4b896; border-radius: 6px; background: #f8f0dd; }
.hxh-result-loot span, .hxh-result-loot strong { display: block; }
.hxh-result-loot span { font-size: .85rem; color: #80663e; }
.hxh-result-message { margin: 0; padding: 1.75rem 1.25rem; text-align: center; }
.hxh-result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1.25rem;
    border-top: 1px solid #d4b896;
    background: #f8f0dd;
}
.hxh-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1rem;
    border: 1px solid #b99a68;
    border-radius: 6px;
    background: #fffcf5;
    color: #5c3c10;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}
.hxh-result-button:hover { background: #ead7ad; color: #5c3c10; text-decoration: none; }
.hxh-result-button-primary { background: #745326; border-color: #745326; color: #fff3d5; }
.hxh-result-button-primary:hover { background: #5c3c10; color: #fff3d5; }
@media (max-width: 480px) {
    .hxh-combat-result { margin: 1rem auto; }
    .hxh-result-rewards { gap: .5rem; padding: 1.25rem .5rem; }
    .hxh-result-rewards dt { font-size: .8rem; }
    .hxh-result-rewards dd { font-size: 1.25rem; }
    .hxh-result-actions > * { flex: 1 1 auto; }
}

.hxh-skip-link {
    position:fixed;
    top:.5rem;
    left:.5rem;
    z-index:20000;
    transform:translateY(-200%);
    background:#fff;
    color:#1b3449;
    padding:.8rem 1rem;
    border:2px solid #1b3449;
    border-radius:.3rem
}

.hxh-skip-link:focus {
    transform:none
}

:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
    outline:3px solid #175f91!important;
    outline-offset:3px
}

#main {
    scroll-margin-top:5rem
}

#combat-feedback:empty {
    display:none
}

#combat-feedback:not(:empty) {
    padding:.7rem 1rem;
    border-left:3px solid #916f2c;
    background:#fff5dc;
    color:#44331e;
    margin:.75rem 0
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior:auto!important
    }
    .hxh-modal,.hxh-modal-content {
        animation:none!important;
        transition:none!important
    }
}

/* Inset range marker remains visible on textured tiles and clipped board edges. */
#combat-live [data-preview="1"] {
    position: relative;
    box-shadow: inset 0 0 0 4px #e8a623, inset 0 0 0 100px #e8a62355 !important;
}
#combat-live [data-preview="1"]::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 2px dashed #5c3c10;
    pointer-events: none;
    z-index: 2;
}

/* Combat confirmation uses the arena's parchment, ink and action typography. */
.combat-confirm {
    width: min(440px, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 0;
    border: 2px solid #8c6d3f;
    border-radius: 10px;
    background: #fffcf5;
    color: #5c3c10;
    box-shadow: 0 12px 40px #241a1266;
    font-family: 'gyreschola', serif;
}
.combat-confirm::backdrop { background: #241a1299; }
.combat-confirm h2 {
    margin: 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #8c6d3f, #5c3c10);
    color: #f5e7c1;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    line-height: 1.4;
}
.combat-confirm p { margin: 0; padding: 1.25rem; line-height: 1.5; }
.combat-confirm-actions { display: flex; flex-wrap: wrap; gap: .75rem; padding: 0 1.25rem 1.25rem; }
.combat-confirm-actions button {
    flex: 1 1 150px;
    min-height: 44px;
    padding: .65rem .75rem;
    border: 2px solid #8c6d3f;
    border-radius: 8px;
    background: #f5e7c1;
    color: #5c3c10;
    font-family: 'Cinzel', serif;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}
.combat-confirm-actions button:hover { background: #ead7ad; }
.combat-confirm-actions .combat-confirm-abandon { border-color: #c82333; background: #dc3545; color: #fff; }
.combat-confirm-actions .combat-confirm-abandon:hover { background: #c82333; }

/* POST-backed rest actions retain the existing appearance of navigation links. */
.rest-link:not(.btn) {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}
.rest-link:not(.btn):hover { text-decoration: underline; }
