.pk-history {
    box-sizing: border-box;
    min-width: 0;
    padding: 16px;
    border: 1px solid #b99a61;
    border-radius: 14px;
    background: #123d36;
    color: #f9f6e9;
    font: 14px/1.45 "IBM Plex Sans", sans-serif;
}
.pk-history [hidden] { display: none !important; }
.pk-history__header, .pk-history__hand-summary, .pk-history__players li,
.pk-history__round-head, .pk-history__actions li, .pk-history__ledger li,
.pk-history__pot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-history__header { align-items: flex-start; }
.pk-history__title { margin: 0; color: #fff7dc; font: 800 20px/1.2 "Cairo", sans-serif; }
.pk-history__toggle, .pk-history__retry {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d4bd83;
    border-radius: 8px;
    background: #f4d38a;
    color: #27342e;
    font: 800 12px/1.2 "IBM Plex Sans", sans-serif;
    cursor: pointer;
}
.pk-history__toggle:focus-visible, .pk-history__retry:focus-visible,
.pk-history__hand-summary:focus-visible { outline: 3px solid #fff0b6; outline-offset: 2px; }
.pk-history__toggle:disabled { opacity: .55; cursor: default; }
.pk-history__preview { min-width: 0; margin-top: 8px; }
.pk-history__preview p { margin: 5px 0; }
.pk-history__meta, .pk-history__label { color: #c9dfcf; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pk-history__winner { color: #fff7dc; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.pk-history__payout { color: #ffe09a; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pk-history__extra { color: #e8efd8; font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pk-history__empty, .pk-history__status, .pk-history__muted { color: #d4e7d7; }
.pk-history__empty { margin: 10px 0 2px; }
.pk-history__preview-board { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pk-history__cards { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; min-width: 0; }
.pk-history__card { display: block; width: 28px; height: 41px; border-radius: 4px; background: #fff; box-shadow: 0 2px 5px #061b194d; }
.pk-history__preview-board .pk-history__card { width: 24px; height: 35px; }
.pk-history__panel { margin-top: 15px; padding-top: 13px; border-top: 1px solid #c5aa7470; }
.pk-history__panel > .pk-history__status { margin: 0 0 10px; }
.pk-history__count { margin: 0 0 8px; color: #d4e7d7; font-size: 11px; font-variant-numeric: tabular-nums; }
.pk-history__hands { display: grid; gap: 9px; max-height: min(61dvh, 620px); overflow: auto; overscroll-behavior: contain; scrollbar-color: #ac9867 #123d36; }
.pk-history__hand { min-width: 0; border: 1px solid #91b29f78; border-radius: 9px; background: #0e342f; }
.pk-history__hand-summary { min-height: 44px; padding: 8px 11px; color: #f9f6e9; cursor: pointer; list-style-position: inside; }
.pk-history__hand-summary::after { flex: 0 0 7px; width: 7px; height: 7px; border-right: 2px solid #f4d38a; border-bottom: 2px solid #f4d38a; content: ""; transform: rotate(45deg); }
.pk-history__hand[open] .pk-history__hand-summary::after { transform: rotate(225deg); }
.pk-history__hand-summary strong { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.pk-history__hand-summary span { min-width: 0; color: #ffe09a; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.pk-history__hand[open] > .pk-history__hand-summary { border-bottom: 1px solid #91b29f78; }
.pk-history__hand-body { display: grid; gap: 17px; padding: 12px; }
.pk-history__hand-body h4 { margin: 0 0 8px; color: #fff7dc; font-size: 14px; }
.pk-history__hand-body h5 { margin: 0; color: #e8efd8; font-size: 12px; }
.pk-history__board { display: grid; gap: 3px; }
.pk-history__players, .pk-history__actions, .pk-history__ledger { margin: 0; padding: 0; list-style: none; }
.pk-history__players { display: grid; gap: 7px; }
.pk-history__players li { min-width: 0; padding-block: 4px; border-bottom: 1px solid #91b29f45; }
.pk-history__player-name { display: grid; min-width: 0; }
.pk-history__player-name strong { overflow-wrap: anywhere; }
.pk-history__player-name span { color: #d4e7d7; font-size: 11px; font-variant-numeric: tabular-nums; }
.pk-history__round { padding: 9px 0; border-top: 1px solid #91b29f78; }
.pk-history__round-head { margin-bottom: 7px; }
.pk-history__round-head .pk-history__card { width: 19px; height: 28px; }
.pk-history__actions { display: grid; gap: 5px; counter-reset: action; }
.pk-history__actions li { align-items: baseline; position: relative; padding-left: 16px; font-size: 12px; }
.pk-history__actions li::before { position: absolute; left: 0; color: #cfbb82; content: counter(action) "."; counter-increment: action; }
.pk-history__actions strong { min-width: 0; overflow-wrap: anywhere; }
.pk-history__actions span { flex: 0 1 60%; color: #dcebdc; text-align: right; font-variant-numeric: tabular-nums; }
.pk-history__result { margin: 0 0 9px; color: #ffe09a; font-weight: 700; }
.pk-history__partial { margin: 0; color: #f8df9b; font-size: 12px; }
.pk-history__pot-row, .pk-history__ledger li { padding: 4px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-history__pot-row { border-bottom: 1px solid #91b29f45; }
.pk-history__pot-row strong, .pk-history__ledger strong { color: #ffe09a; text-align: right; }
.pk-history__ledger-group { margin-top: 10px; }
.pk-history__ledger-group h5 { margin-bottom: 4px; }
.pk-history__retry { margin-top: 8px; }
@media (max-width: 600px) {
    .pk-history { padding: 12px; }
    .pk-history__title { font-size: 18px; }
    .pk-history__hands { max-height: min(45dvh, 420px); }
    .pk-history__card { width: 26px; height: 38px; }
}
.pk-room.is-immersive .pk-history { padding: 8px 10px; }
.pk-room.is-immersive .pk-history__hands { max-height: min(45dvh, 400px); }
.pk-room.is-immersive .pk-history__title { font-size: 16px; }
.pk-room.is-immersive .pk-history__preview-board .pk-history__card { width: 18px; height: 27px; }
@media (prefers-reduced-motion: no-preference) {
    .pk-history__toggle, .pk-history__retry { transition: background-color 150ms ease; }
    .pk-history__toggle:hover:not(:disabled), .pk-history__retry:hover { background: #ffe5a9; }
}
