.bh {
    --bh-ink: #172033;
    --bh-muted: #516173;
    --bh-line: #cedbdc;
    --bh-accent: #0f766e;
    --bh-selected: #e7f4f1;
    color: var(--bh-ink);
    max-width: 760px;
    margin: 1.5rem auto 3rem;
    padding: 0 1.25rem;
    font-family: system-ui, sans-serif;
}
.bh *, .bh *::before, .bh *::after { box-sizing: border-box; }
.bh [hidden] { display: none !important; }
.bh ::selection { color: #fff; background: var(--bh-accent); }
.bh h1, .bh h2, .bh h3 { text-wrap: balance; }
.bh p { text-wrap: pretty; }
.bh a { color: var(--bh-accent); text-underline-offset: .2em; }
.bh button, .bh a, .bh summary { -webkit-tap-highlight-color: transparent; }
.bh :is(button, a, summary):focus-visible { outline: 3px solid var(--bh-accent); outline-offset: 4px; }
.bh button { font: inherit; cursor: pointer; }
.bh-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bh-header h1 { font-size: 2rem; font-weight: 760; letter-spacing: -.035em; margin: 0 0 .25rem; }
.bh-header p { color: var(--bh-muted); margin: 0; }
.bh-all-games { font-size: .9rem; white-space: nowrap; padding: .7rem 0; }
.bh-modes { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; border-bottom: 1px solid var(--bh-line); margin-top: 1.3rem; }
.bh-modes a { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1rem; text-decoration: none; color: var(--bh-muted); border-bottom: 3px solid transparent; }
.bh-modes a[aria-current="page"] { border-color: var(--bh-accent); color: var(--bh-accent); font-weight: 700; }
.bh-modes > span { margin-left: auto; font-size: .8rem; color: var(--bh-muted); text-align: right; font-variant-numeric: tabular-nums; }
.bh-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: .7rem 0 1rem; }
.bh-progress { font-size: .85rem; color: var(--bh-muted); margin: 0; }
.bh-help { font-size: .85rem; flex-shrink: 0; }
.bh-help summary { min-height: 44px; display: flex; align-items: center; color: var(--bh-accent); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.bh-help[open] { flex-shrink: 1; }
.bh-topline:has(.bh-help[open]) { display: block; }
.bh-help p { max-width: 68ch; margin: .6rem 0; line-height: 1.6; }
.bh-endpoints { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; gap: .5rem; padding: 1.6rem 0; }
.bh-endpoints h2 { font-size: 1.8rem; font-weight: 730; text-align: center; margin: 0; overflow-wrap: anywhere; }
.bh-link { display: flex; align-items: center; color: var(--bh-accent); }
.bh-link span { flex: 1; height: 1px; background: var(--bh-line); }
.bh-link i { font-size: 1.75rem; }
.bh fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.bh legend { font-size: .95rem; text-align: center; width: 100%; margin: 0 0 1rem; color: var(--bh-muted); }
.bh-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.bh-choice { position: relative; display: flex; min-height: 74px; border: 1px solid var(--bh-line); border-radius: 10px; align-items: center; justify-content: center; padding: .85rem 1.2rem; cursor: pointer; background: #fff; }
.bh-choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bh-choice-word { font-size: 1.08rem; font-weight: 650; text-align: center; overflow-wrap: anywhere; }
.bh-choice:has(input:focus-visible) { outline: 3px solid var(--bh-accent); outline-offset: 3px; }
.bh-choice:has(input:checked) { border-color: var(--bh-accent); background: var(--bh-selected); }
.bh-choice:has(input:checked) .bh-choice-word { color: #085c55; }
.bh-choice-mark { display: none; position: absolute; right: .4rem; top: .25rem; color: var(--bh-accent); font-size: .75rem; }
.bh-choice:has(input:checked) .bh-choice-mark, .bh-choice.is-best .bh-choice-mark { display: block; }
.bh-choice.is-best { border-color: var(--bh-accent); background: var(--bh-selected); }
.bh-choice:has(input:disabled), .bh-choice input:disabled { cursor: default; }
.bh-choice.is-other { color: var(--bh-muted); background: #f6f8f8; }
.bh-play-actions { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0 .8rem; }
.bh-primary, .bh a.bh-primary { min-height: 48px; padding: .8rem 1.25rem; background: var(--bh-accent); color: #fff; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: .65rem; text-decoration: none; font-weight: 650; }
.bh-play-actions .bh-primary { flex: 1; }
.bh-primary:disabled { background: #e9eeee; color: #596666; cursor: default; }
.bh-text-button { border: 0; background: transparent; color: var(--bh-muted); text-decoration: underline; text-underline-offset: .2em; padding: .75rem .2rem; min-height: 44px; }
.bh-hints { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .85rem; }
.bh-hints > span { color: var(--bh-muted); margin-right: auto; }
.bh-hints button, .bh-secondary { background: #fff; border: 1px solid var(--bh-line); color: var(--bh-ink); border-radius: 7px; padding: .6rem .8rem; min-height: 44px; }
.bh-hints small { font-size: .8rem; margin-left: .35rem; color: var(--bh-muted); font-variant-numeric: tabular-nums; }
.bh-hints button:disabled { color: #586667; background: #f1f5f4; cursor: default; }
.bh-hint-copy p { background: #edf6f3; padding: .6rem .8rem; margin: .6rem 0; border-radius: 6px; color: #145f54; font-size: .9rem; }
.bh-feedback { color: var(--bh-muted); font-size: .85rem; min-height: 1.3em; margin: .85rem 0 0; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.bh-result { margin-top: 1.5rem; border-top: 2px solid var(--bh-accent); padding-top: 1.5rem; animation: bh-result-arrive 300ms cubic-bezier(.16, 1, .3, 1); }
.bh-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bh-result h2 { font-size: 1.6rem; font-weight: 720; margin: 0 0 .35rem; }
.bh-result h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
.bh-result-heading p { color: var(--bh-muted); font-size: .9rem; margin: 0; }
.bh-points { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bh-points strong { display: block; font-size: 1.75rem; line-height: 1.15; }
.bh-points span { color: var(--bh-muted); font-size: .75rem; }
.bh-answer-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6rem; padding: 1.15rem .7rem; margin: 1.25rem 0; background: var(--bh-selected); border-radius: 8px; text-align: center; overflow-wrap: anywhere; }
.bh-answer-line strong { color: #085c55; font-size: 1.35rem; }
.bh-answer-line i { color: var(--bh-accent); }
.bh-explanation p, .bh-comparison p { line-height: 1.6; max-width: 68ch; margin: .3rem 0; }
.bh-comparison { margin-top: 1.15rem; padding-top: 1.15rem; border-top: 1px solid var(--bh-line); }
.bh-comparison p { color: var(--bh-muted); }
.bh-result-actions { display: flex; gap: .65rem; margin-top: 1.5rem; flex-wrap: wrap; }
.bh-result-actions .bh-primary { flex: 1; }
.bh-invitation { padding: .85rem 0; border-block: 1px solid var(--bh-line); color: var(--bh-ink); line-height: 1.6; max-width: 68ch; overflow-wrap: anywhere; }
.bh-share-text { width: 100%; min-height: 150px; padding: .75rem; font: inherit; line-height: 1.5; color: var(--bh-ink); background: #fff; border: 1px solid var(--bh-line); border-radius: 8px; overflow-wrap: anywhere; }
.bh-share-text:focus-visible { outline: 3px solid var(--bh-accent); outline-offset: 3px; }
#bridge-hunter-beta-game .bh-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#bridge-beta-challenge { grid-column: 1 / -1; }
#bridge-hunter-beta-game .bh-result-actions a.bh-secondary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
.bh-alternatives { margin-top: 1.25rem; border-top: 1px solid var(--bh-line); }
.bh-alternatives summary { cursor: pointer; min-height: 44px; padding: .8rem 0; color: var(--bh-accent); font-size: .9rem; }
.bh-alternatives article { padding: .85rem 0; border-top: 1px solid var(--bh-line); }
.bh-alternatives article p { color: var(--bh-muted); margin: .35rem 0 0; font-size: .9rem; line-height: 1.5; }
.bh-return, .bh-storage-note { font-size: .85rem; margin: 1.25rem 0 0; color: var(--bh-muted); }
.bh-storage-note { color: #7e4307; line-height: 1.6; overflow-wrap: anywhere; }
#bridge-beta-result-title:focus-visible { outline: 3px solid var(--bh-accent); outline-offset: 4px; }
.bh-practice-return { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
@media (hover: hover) {
    .bh-choice:has(input:not(:disabled)):hover { border-color: var(--bh-accent); background: #f4f9f7; }
    .bh-primary:not(:disabled):hover, .bh a.bh-primary:hover { background: #085c55; color: #fff; }
    .bh-hints button:not(:disabled):hover, .bh-secondary:hover { border-color: var(--bh-accent); background: #f4f9f7; }
}
@keyframes bh-result-arrive { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bh-result { animation: none; } }
@media (max-width: 540px) {
    .bh { margin-top: 1rem; padding: 0 1rem; }
    .bh-header { flex-wrap: wrap; gap: .25rem 1rem; }
    .bh-header h1 { font-size: 1.7rem; }
    .bh-header p { font-size: .9rem; }
    .bh-all-games { font-size: .8rem; }
    .bh-modes { margin-top: .8rem; }
    .bh-modes a { padding: .5rem .7rem; }
    .bh-modes > span { flex-basis: 100%; padding: .35rem 0; text-align: left; font-size: .875rem; }
    .bh-topline { margin: .3rem 0; gap: .5rem; }
    .bh-progress { font-size: .78rem; }
    .bh-endpoints { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); padding: 1.15rem 0; }
    .bh-endpoints h2 { font-size: 1.4rem; }
    .bh-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .bh-choice { min-height: 58px; padding: .7rem; }
    .bh-choice-word { font-size: 1rem; }
    .bh-play-actions { margin-top: 1rem; gap: .7rem; }
    .bh-hints > span { width: 100%; margin: 0; }
    .bh-hints button { flex: 1; }
    .bh-result-heading { align-items: start; }
    .bh-result h2 { font-size: 1.4rem; }
    .bh-answer-line { gap: .4rem; font-size: .9rem; }
}

/* Short, in-context guidance leaves the board playable immediately. */
.bh-first-move { margin: 0 0 16px; color: var(--bh-ink); line-height: 1.5; max-width: 70ch; }
.bh-first-example { margin: 0 0 16px; font-size: .9rem; line-height: 1.5; }
.bh-first-example summary { cursor: pointer; color: var(--bh-accent); padding: 10px 0; min-height: 44px; box-sizing: border-box; text-decoration: underline; text-underline-offset: 3px; }
.bh-first-example summary:focus-visible { outline: 3px solid var(--bh-accent); outline-offset: 3px; }
.bh-first-example p { margin: 8px 0; max-width: 70ch; }

#bridge-hunter-beta-game[data-locale="de"] #bridge-beta-next { grid-column: 1 / -1; }
#bridge-hunter-beta-game[data-locale="de"] #bridge-beta-challenge { grid-column: auto; }

/* German invitation messages stay readable and selectable on narrow screens. */
html[lang="de"] .bh-share-preview { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bh-line); }
html[lang="de"] .bh-share-preview[hidden] { display: none; }
html[lang="de"] .bh-share-preview label { display: block; font-weight: 700; margin-bottom: .5rem; }
html[lang="de"] .bh-share-preview p { font-size: .95rem; line-height: 1.55; max-width: 65ch; }
html[lang="de"] .bh-share-preview textarea { box-sizing: border-box; width: 100%; max-width: 100%; resize: vertical; font-size: 16px; }

/* One German sharing action includes the result and comparison invitation. */
html[lang="de"] #bridge-beta-share { display: none; }
html[lang="de"] #bridge-beta-challenge { grid-column: 1 / -1; }

/* Optional return guidance; game choices remain the focus. */
.bh-return-plan { margin: 0 0 24px; padding: 12px 0; border-block: 1px solid var(--bh-line, #c8cec6); font-size: 1rem; line-height: 1.5; }
.bh-return-plan p { max-width: 70ch; margin: 0 0 8px; }
.bh-return-plan a { display: inline-block; padding-block: 8px; text-underline-offset: 3px; color: inherit; }
.bh-return-plan summary { cursor: pointer; padding-block: 8px; }
.bh-return-plan details p { margin-block: 10px; }
.bh-return-plan a:focus-visible, .bh-return-plan summary:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.bh-replay-goal { max-width: 65ch; line-height: 1.5; margin-block: 20px 16px; }
