@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); }
:root {
  --ink: #1f2430; --muted: #646b78; --paper: #fbf9f4; --rule: #e6e0d3; --accent: #a8650f;
  --panel: #f3efe6; --panel-edge: #e2dbcb; --screen: #12161f;
  --serif: "Source Serif 4", Charter, Georgia, serif; --sans: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.62 var(--serif);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.page { max-width: 680px; margin: 0 auto; padding: 26px 20px 96px; }
h1 { font: 650 2.6em/1.08 var(--serif); letter-spacing: -0.02em; margin: 0 0 0.35em; }
h2 { font: 650 1.4em/1.25 var(--serif); letter-spacing: -0.01em; margin: 2.4em 0 0.55em; }
.dek { font: 400 1.22em/1.5 var(--serif); color: #3d4452; margin: 0 0 1.1em; }
.byline { color: var(--muted); font: 400 15px/1.55 var(--sans); margin: 0 0 2.6em; padding-bottom: 1.6em; border-bottom: 1px solid var(--rule); }
a { color: #1e5b9c; text-decoration-thickness: 1px; text-underline-offset: 2px; }
p { margin: 0 0 1.05em; }
code { font: 0.9em ui-monospace, "SF Mono", Menlo, monospace; background: #efe9dc; padding: 0.05em 0.3em; border-radius: 4px; }
sup { line-height: 0; }
em.claim { font-style: normal; background: linear-gradient(transparent 55%, #fbe2a8 55%); padding: 0 0.1em; }

/* Widgets: a light panel; the board and the tree are dark "light boxes" inside it. */
.widget { background: var(--panel); border: 1px solid var(--panel-edge); color: var(--ink); border-radius: 14px;
  padding: 18px; margin: 1.8em -18px 2em; font: 400 15px/1.5 var(--sans); }
@media (min-width: 960px) { .widget.wide { margin-left: -120px; margin-right: -120px; } }
.widget canvas.board { width: 100%; display: block; touch-action: manipulation; border-radius: 10px; max-width: 380px; margin: 0 auto;
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 6px 18px -8px rgba(20,24,33,.45); }
.widget canvas:focus-visible { outline: 3px solid #4a90d9; outline-offset: 3px; }
@media (min-width: 720px) {
}
.widget .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.widget button { font: 600 14px/1 var(--sans); background: #fff; color: var(--ink); border: 1px solid #d3cab6;
  border-radius: 999px; padding: 9px 15px; cursor: pointer; box-shadow: 0 1px 0 rgba(31,36,48,.06); transition: border-color .15s, background .15s; }
.widget button:hover { border-color: var(--accent); }
.widget button:active { transform: translateY(1px); }
.widget button:focus-visible { outline: 3px solid #4a90d9; outline-offset: 2px; }
.widget button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.widget button.primary:hover { background: #343b4b; }
.widget > .controls + canvas.board { margin-top: 14px; }
.widget button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.widget button:disabled { opacity: 0.45; cursor: default; }
.widget .readout { margin: 12px 0 0; min-height: 3em; }
.widget .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.widget .note { color: var(--muted); font-size: 13.5px; }
.widget .good { color: #1d7a48; font-weight: 600; } .widget .bad { color: #b42d22; font-weight: 600; } .widget .maybe { color: #8a5700; font-weight: 600; }
.widget input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.widget label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
aside.aside { margin: 1.6em 0; font: 400 16px/1.55 var(--sans); color: var(--muted); border-left: 3px solid var(--rule); padding-left: 14px; }
footer { margin-top: 4.5em; color: var(--muted); font: 400 14.5px/1.6 var(--sans); border-top: 1px solid var(--rule); padding-top: 1.4em; }
noscript p { background: #fff1d6; padding: 10px; }
@media (max-width: 719px) { .widget { margin-left: -12px; margin-right: -12px; padding: 14px; } }

.chart-wrap { position: relative; }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--sans); }
svg.chart .grid { stroke: #e2dbcb; stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 12px; }
svg.chart .axis { fill: var(--muted); font-size: 12.5px; }
svg.chart .ref { fill: none; stroke: #8b93a1; stroke-width: 2; stroke-dasharray: 5 4; }
svg.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
svg.chart .hit { fill: transparent; cursor: default; }
svg.chart .hit:focus-visible { outline: none; stroke: #2f6fb8; stroke-width: 3; fill: rgba(47, 111, 184, 0.12); }
svg.chart .label { fill: var(--muted); font-size: 12.5px; } svg.chart .label.strong { fill: var(--ink); font-weight: 600; }
.chart-wrap .tip { position: absolute; background: #fff; border: 1px solid var(--panel-edge); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; line-height: 1.45; box-shadow: 0 4px 14px -6px rgba(20,24,33,.35); pointer-events: none; width: 220px; }
table.data { border-collapse: collapse; font-size: 13.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 3px 10px; text-align: right; border-bottom: 1px solid var(--rule); }
@media (max-width: 600px) { svg.chart .tick { font-size: 19px; } svg.chart .axis, svg.chart .label { font-size: 20px; } }
/* shuffle */
.widget canvas.strip { width: 100%; height: auto; display: block; border-radius: 10px; background: var(--screen); }
.cards { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; margin-top: 12px; }
.cards button.card { padding: 0; border-radius: 6px; aspect-ratio: 5 / 7; font: 600 13px/1 var(--sans); background: #fff;
  border: 1px solid #d3cab6; color: var(--ink); display: flex; align-items: center; justify-content: center; position: relative; }
.cards button.card.red { color: #b42d22; }
.cards button.card:disabled { opacity: 1; background: #e9e3d6; color: #b5ad9c; border-color: #e2dbcb; cursor: default; }
.cards button.card.mark { outline: 3px solid #2f6fb8; outline-offset: 1px; z-index: 1; }
.cards button.card .heat { position: absolute; inset: 0; border-radius: 5px; background: #e9a650; pointer-events: none; }
.cards button.card span { position: relative; }
.cards br.narrow, .spread br.narrow { display: none; }
.dealt { min-height: 1.5em; margin: 10px 0 0; line-height: 1.6; word-spacing: 2px; } .dealt .red { color: #b42d22; }
@media (max-width: 480px) { .cards { gap: 2px; } .cards button.card { font-size: 12px; line-height: 1.15; border-radius: 4px; aspect-ratio: 1 / 2; }
  .cards br.narrow, .spread br.narrow { display: inline; } }
.deal { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.bigcard { width: 64px; aspect-ratio: 5 / 7; border-radius: 8px; background: #fff; border: 1px solid #d3cab6; display: flex;
  align-items: center; justify-content: center; font: 700 20px/1 var(--sans); box-shadow: 0 4px 12px -6px rgba(20,24,33,.4); }
.bigcard.back { background: repeating-linear-gradient(45deg, #2b3a55 0 6px, #34476a 6px 12px); border-color: #2b3a55; }
.bigcard.red { color: #b42d22; }
.scores { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 14px; }
.widget select { font: 500 14px/1 var(--sans); padding: 7px 10px; border-radius: 10px; border: 1px solid #d3cab6; background: #fff; color: var(--ink); }
.spread { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 12px; }
.spread button.card { width: calc((100% - 25 * 2px) / 26); min-width: 0; padding: 0; aspect-ratio: 5 / 7; font: 600 11px/1 var(--sans);
  border-radius: 4px; background: #fff; border: 1px solid #d3cab6; color: var(--ink); }
.spread button.card.red { color: #b42d22; }
.spread button.card.picked { background: #fff1c2; border-color: #e2b85a; transform: translateY(-4px); }
.spread button.card.found { outline: 3px solid #1d7a48; outline-offset: 1px; }
.spread button.card.gap { background: transparent; border: 1px dashed #b9ae95; color: transparent; }
@media (max-width: 480px) { .spread button.card { width: calc((100% - 12 * 2px) / 13); font-size: 12px; line-height: 1.15; aspect-ratio: 1 / 2; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.widget .controls + canvas.strip { margin-top: 14px; }
.widget canvas.strip[hidden] { display: none; }
svg.fold { width: 100%; height: auto; display: block; background: #fffdf8; border: 1px solid var(--panel-edge); border-radius: 10px; }
table { border-collapse: collapse; font: 400 15px/1.45 var(--sans); width: 100%; margin: 0 0 1.4em; } th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { table:not(.data) { font-size: 0.8125rem; } table:not(.data) th, table:not(.data) td { padding-right: 5px; overflow-wrap: anywhere; } }

/* ---- the living-room floor */
.floor { --plank: #7a5136; color: #fff6e6; padding: clamp(18px, 3vw, 44px) clamp(14px, 3vw, 48px) clamp(24px, 3vw, 44px); background-color: var(--plank);
  background-image: radial-gradient(90% 80% at 68% 45%, rgba(255,214,150,.2), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 238px, rgba(30,14,5,.5) 238px 240px),
    repeating-linear-gradient(90deg, rgba(255,220,170,.05) 0 3px, transparent 3px 11px, rgba(40,18,6,.07) 11px 14px, transparent 14px 23px),
    linear-gradient(90deg, rgba(40,20,8,.42), rgba(40,20,8,.12) 45%, rgba(40,20,8,.3)); }
.floor .in { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 8fr); gap: 10px clamp(20px, 3vw, 48px); align-items: start; }
.floor .ask { background: rgba(38,20,10,.62); border-radius: 6px; padding: clamp(14px, 1.8vw, 26px); }
.floor h1 { font: 700 clamp(2rem, 3.3vw, 3rem)/1.02 var(--serif); letter-spacing: -.025em; margin: 0 0 .35em; text-wrap: balance; }
.floor .dek { font: 400 1.08rem/1.45 var(--serif); color: #f6e3c8; margin: 0 0 1em; }
#checker p { font: 400 clamp(1.12rem, 1.5vw, 1.3rem)/1.75 var(--serif); margin: 0 0 .8em; }
#checker input { width: 2.7em; font: 650 1em/1.2 var(--serif); color: #ffd58a; background: transparent; border: 0; border-bottom: 2px solid rgba(255,213,138,.65); padding: 0; text-align: center; border-radius: 0; }
#checker input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tag { position: relative; background: #e8cf9f; color: #33210f; font: 400 .95rem/1.45 var(--sans); padding: 16px 18px 10px 44px; clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 26px), 0 26px); min-height: 9.5em; }
.tag::before { content: ""; position: absolute; left: 15px; top: 50%; width: 15px; height: 15px; margin-top: -8px; border-radius: 50%; background: #3a2312; border: 2px solid #b58d52; }
.tag p { margin: 0 0 .5em; } .tag .good { color: #13592f; } .tag .bad { color: #99211a; }
#tool, #present { min-width: 0; } #tool[hidden], #present[hidden] { display: none; }
#tool { grid-row: span 2; text-align: center; }
#plan { width: 100%; max-height: min(78vh, 720px); min-height: 280px; display: block; overflow: visible; }
#plan .turn, #plan .knob { cursor: grab; touch-action: none; } #plan.held .turn, #plan.held .knob { cursor: grabbing; }
#plan .box { fill: #cfa06a; stroke: #6f4a26; } #plan .bare { fill: #d3261b; fill-opacity: .82; pointer-events: none; } #plan .lid { fill-opacity: .9; }
#plan .curl { fill: #2e7d62; } #plan .dot { fill: #ffd58a; stroke: #4a2c17; } #plan .knob:focus { outline: none; } #plan .knob:focus-visible .dot { stroke: #fff; }
#plan .dim { fill: #a3231a; font-family: Inter, sans-serif; font-weight: 650; paint-order: stroke; stroke: #f6efe2; }
.now { display: inline-block; font: 650 1.12rem/1.3 var(--sans); margin: .5em 0 .7em; padding: .45em .9em; border-radius: 999px; background: #fff6e6; color: #33210f; }
.now.good { background: #cdeccb; color: #10401f; } .now.bad { background: #fbd9d3; color: #7d140d; } .now.maybe { background: #fbe6b4; color: #5c3b00; }
.floor .controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.floor button { font: 600 .92rem/1 var(--sans); color: #33210f; background: #fff6e6; border: 1px solid #fff6e6; border-radius: 999px; padding: 11px 17px; cursor: pointer; } .floor button.primary { background: #ffd58a; border-color: #ffd58a; }
.floor button:disabled { opacity: .5; cursor: default; } .floor button:focus-visible, .floor input[type=range]:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.floor svg.fold { background: none; border: 0; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); max-height: 330px; }
#present .controls { padding: 0 10px; } #present input[type=range] { flex: 1; min-width: 120px; accent-color: #ffd58a; min-height: 28px; }
.page > .note { color: var(--muted); font: 400 .88rem/1.55 var(--sans); } .page .byline { margin-bottom: 1.2em; padding-bottom: 1em; }
@media (max-width: 860px) { .floor .in { grid-template-columns: minmax(0, 1fr); } #tool { grid-row: auto; } .tag { min-height: 0; } }
@media (forced-colors: active) { .tag { border: 1px solid CanvasText; } #plan, svg.fold { forced-color-adjust: none; } .now { border: 1px solid CanvasText; } .floor button { border-color: CanvasText; } }
@media print { .floor { background: none; color: #000; } .floor h1, .floor .dek, #checker p, #checker input { color: #000; } .floor .ask { background: none; padding: 0; } .floor .controls { display: none; } }
.floor { overflow: clip; } #present svg.fold { overflow: visible; }
