/* A ruled paper reference: ordinary card faces belong in the guide only. */
.hu-guide-button,.hu-close,.hu-pots button,.hu-reveal-actions button { font: inherit; cursor: pointer; touch-action: manipulation; }
.hu-guide-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px; min-height: 44px; color: #f2e7d2; border: 0; background: none; }
html:has(.hu-guide[open]),body:has(.hu-guide[open]) { overflow: hidden; }
.hu-guide {
  --hu-ink: #30342d; --hu-rule: #aca18b78; --hu-secondary: #575a4d;
  color-scheme: light; box-sizing: border-box; width: min(570px,calc(100% - 22px)); max-width: none;
  max-height: min(820px,calc(100vh - 30px));
  max-height: min(820px,calc(100dvh - max(14px,env(safe-area-inset-top)) - max(14px,env(safe-area-inset-bottom))));
  margin: auto; padding: 0; border: 1px solid #bcaf93; border-radius: 5px; overflow: hidden;
  background: #ede6d7; color: var(--hu-ink); box-shadow: 0 12px 38px #0d100c70;
  text-align: start; font: 400 14px/1.5 var(--sans,system-ui); text-shadow: none;
}
.hu-guide[open] { display: flex; flex-direction: column; }
.hu-guide::backdrop { background: #111610ad; }
.hu-guide-head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--hu-rule); padding: 9px 23px; }
.hu-guide-head h2 { margin: 0; font: 650 26px/1.3 var(--serif,serif); letter-spacing: -.06em; }
.hu-close { min-height: 44px; padding: 4px 8px; color: #3d4032; background: none; border: 0; border-radius: 2px; font-size: 13px; }
.hu-close:hover { background: #ddd4c0; }
.hu-guide-scroll { min-height: 0; padding: 0 23px 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #aca38e #ede6d7; }
.hu-guide :focus-visible { outline: 2px solid #785d36; outline-offset: -2px; }
.hu-intro { margin: 16px 0; color: var(--hu-secondary); font-size: 13px; }
.hu-intro strong { color: var(--hu-ink); }
.hu-ranks,.hu-pots ul { margin: 0; padding: 0; list-style: none; }
.hu-ranks li { display: grid; grid-template-columns: 23px minmax(0,1fr) auto; align-items: center; column-gap: 9px; padding-block: 9px; border-top: 1px solid var(--hu-rule); }
.hu-order { align-self: start; margin-top: 2px; color: #756951; font: italic 14px/1.6 Georgia,serif; font-variant-numeric: tabular-nums; }
.hu-rank-copy { display: grid; gap: 2px; }
.hu-rank-copy strong { font: 650 16px/1.35 var(--serif,serif); }
.hu-rank-copy small,.hu-notes dd { font-size: 12px; line-height: 1.5; color: var(--hu-secondary); }
.hu-cards { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.hu-card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 24px; height: 32px; box-sizing: border-box; border: 1px solid #b3a78f; border-radius: 3px; color: #2e392e; background: #fbf6eb; font: 700 14px/1 Georgia,serif; }
.hu-card b { font: inherit; }
.hu-card i { font: normal 11px/1 Georgia,serif; }
.hu-card.hu-red { color: #953d34; }
.hu-notes { border-top: 1px solid #91836b9c; margin: 0; padding-top: 13px; }
.hu-notes dt { font-weight: 650; }
.hu-notes dd { margin: 3px 0 12px; }
.hu-notes dd:last-child { margin-bottom: 0; }

/* On felt: keep a small text footprint. Longer ledgers open without moving cards. */
.hu-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hu-hand,.hu-reveal-status { margin: 0; color: #f1e4c9; font: 500 13px/1.4 var(--sans,system-ui); text-align: center; }
.hu-hand strong { font-weight: 660; }
.hu-hand-detail { color: #ddcfb7; }
.hu-result { position: relative; min-width: 0; max-width: 100%; margin: 0 auto; text-align: center; color: #f6e9cc; line-height: 1.24; }
.hu-recipient { max-width: 100%; overflow-wrap: anywhere; font: 650 clamp(16px,1.8vw,25px)/1.25 var(--serif,serif); letter-spacing: -.04em; text-wrap: balance; }
.hu-recipient b { font: inherit; }
.hu-award { display: block; margin-top: 2px; font: 450 12px/1.25 var(--sans,system-ui); color: #e2d4b9; }
.hu-award strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.hu-pots { position: relative; width: fit-content; margin: 1px auto 0; color: #e4d5b7; font: 450 12px/1.35 var(--sans,system-ui); pointer-events: auto; }
.hu-pots summary,.hu-reveal summary { width: fit-content; max-width: 100%; margin-inline: auto; cursor: pointer; touch-action: manipulation; }
.hu-pots summary { min-height: 24px; padding: 4px 3px; line-height: 1.4; }
.hu-pot-sheet { position: absolute; z-index: 15; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); width: min(235px,78vw); max-height: min(235px,33dvh); overflow-y: auto; overscroll-behavior: contain; padding: 5px 11px; border: 1px solid #a5997a; border-radius: 4px; background: #eee6d3; color: #363a30; box-shadow: 0 4px 14px #0b100e55; text-align: start; text-shadow: none; }
.hu-pots li { display: grid; gap: 2px; padding-block: 6px; }
.hu-pots li + li { border-top: 1px solid #b8ac92; }
.hu-pots li span { color: #585a4c; }
.hu-winner-switch { display: flex; flex-wrap: wrap; gap: 0 9px; border-bottom: 1px solid #b8ac92; }
.hu-winner-switch button { min-height: 44px; padding: 4px 2px; color: #4a4d41; border: 0; background: none; }
.hu-winner-switch button[aria-pressed="true"] { color: #302a1f; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.hu-reveal,.hu-reveal-status { position: relative; width: max-content; max-width: 100%; margin: 0 auto; color: #ece0c6; text-align: center; font: 500 12px/1.35 var(--sans,system-ui); pointer-events: auto; }
.hu-reveal summary { min-height: 44px; padding: 12px 3px 10px; text-decoration: underline; text-decoration-color: #b9ab8c; text-underline-offset: 4px; }
.hu-reveal-clock { color: #d3c2a2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hu-reveal-actions { position: absolute; z-index: 15; left: 50%; bottom: 100%; transform: translateX(-50%); display: grid; grid-template-columns: auto auto; gap: 1px; padding: 2px; border: 1px solid #aba084; border-radius: 3px; background: #eae2cf; box-shadow: 0 3px 10px #10120e63; }
.hu-reveal-actions button { min-height: 44px; padding: 5px 9px; white-space: nowrap; color: #35392e; border: 0; background: transparent; font-size: 13px; }
.hu-reveal-actions button + button { border-left: 1px solid #bdb198; }
.hu-reveal-actions button:not(:disabled):hover,.hu-winner-switch button:not(:disabled):hover { background: #d7ccb3; }
.hu-reveal-actions button:disabled { opacity: .55; }
:is(.hu-pots,.hu-reveal) summary:focus-visible { outline: 2px solid #f5e4b6; outline-offset: 1px; }
:is(.hu-pots,.hu-reveal) button:focus-visible { outline: 2px solid #785d36; outline-offset: -2px; }
@media(max-width:470px) {
  .hu-guide-head { padding: 6px 14px; }
  .hu-guide-scroll { padding: 0 14px 16px; }
  .hu-ranks li { grid-template-columns: 17px minmax(0,1fr) auto; gap: 3px 6px; }
  .hu-rank-copy strong { font-size: 14px; }
  .hu-cards { gap: 2px; }
  .hu-card { width: 20px; height: 28px; }
  .hu-recipient { font-size: 16px; }
}
@media(max-width:345px) {
  .hu-ranks li { grid-template-columns: 20px minmax(0,1fr); }
  .hu-ranks .hu-cards { grid-column: 2; }
}
/* An expanded ledger sits above its trigger rather than enlarging the felt's result row. */
.game .table-outcome:has(.hu-pots[open]) { overflow: visible; }
.game .board:has(.hu-pots[open]) { z-index: 6; }
.game .table-outcome .hu-result .hu-pots { margin-inline: auto; }
.game .table-outcome .hu-pots .hu-pot-sheet li { padding-block: 6px; }
.game .table-outcome .hu-pots .hu-pot-sheet li b { color: #35392e; }

.hu-reveal-rank { grid-column: 1/-1; margin: 0; padding: 7px 8px; color: #35392e; border-bottom: 1px solid #bdb198; }
.hu-reveal-shown-rank { display: block; margin-top: 3px; }

.game .controls .show-below:has(.hu-reveal,.hu-reveal-status) { justify-content: center; }
dialog.show-choice{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(368px,calc(100vw - 32px));max-height:calc(100dvh - 24px);padding:27px 24px 20px;color:#eff2ed;background:#202924;border:1px solid #4b5750;border-radius:14px;box-shadow:0 12px 42px #09100c55;text-align:center;font:500 15px/1.4 system-ui,sans-serif;}
dialog.show-choice::backdrop{background:#0c130f59;}
.show-choice h2{margin:0;color:inherit;font:750 clamp(21px,4.9vw,25px)/1.35 system-ui,sans-serif;letter-spacing:-.045em;outline:none;}.show-choice .choice-rank{margin:6px 0 0;color:#c2cdc4;font-size:14px}.choice-rank:empty{display:none;}.show-choice .choice-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:21px;}
.show-choice .choice-buttons button{box-sizing:border-box;width:100%;min-width:0;min-height:52px;padding:8px 4px;border:1px solid #69766d;border-radius:8px;box-shadow:none;background:#2c3730;color:#f3f5ef;font:700 17px/1.2 system-ui,sans-serif;cursor:pointer;}.show-choice .choice-buttons [data-action=showCards]{background:#e4ece0;color:#1a271e;border-color:#e4ece0;}.choice-buttons button:focus-visible{outline:3px solid #e9c77e;outline-offset:2px;}.choice-buttons button:hover:not(:disabled){filter:brightness(1.09);}.show-choice .choice-note{margin:13px 0 0;font-size:12px;color:#bbc6be;}.choice-note .hu-reveal-clock{padding:0;border:0;background:none;color:inherit;font:inherit;font-variant-numeric:tabular-nums;}
#rebuy-dialog form{margin:0}#rebuy-dialog label{display:block;color:#cdd7cd;font-size:14px}#rebuy-example{display:block;margin:8px 0;color:#f5e7b3;font-size:20px}#rebuy-input{box-sizing:border-box;width:100%;border:1px solid #7d8e80;border-radius:6px;min-height:46px;padding:8px 10px;background:#18231d;color:#fff;font:inherit}#rebuy-dialog .choice-buttons button:disabled{opacity:.45;cursor:default}
