@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  button, input { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  button:disabled { cursor: not-allowed; }
  svg { display: block; }
  a { color: inherit; text-decoration: none; }
}

@layer base {
  :root { --paper: #f7f5ef; --ink: #253e32; --muted: #73786c; --line: #dfdfd4; --forest: #244c3e; --deep: #163b2f; --sage: #bbc7b0; --copper: #bd704b; --gold: #e4c788; --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; --sans: 'Avenir Next', Avenir, 'Trebuchet MS', sans-serif; color-scheme: light; }
  html { scroll-behavior: smooth; background: var(--paper); }
  body { color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; background: radial-gradient(ellipse at 0 0, #e9eadf55, transparent 50%), var(--paper); }
  button { color: inherit; }
  button, a, summary, input { touch-action: manipulation; }
  :focus-visible { outline: 3px solid #cb8e37; outline-offset: 5px; }
  button:disabled { opacity: .48; }
  h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; }
  h1 { font-size: clamp(30px, 3.25vw, 46px); line-height: 1.15; }
  h1 > span { color: var(--copper); }
  .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .17em; line-height: 1.5; }
  .svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; background: var(--forest); color: white; padding: 12px 20px; }
  .skip-link:focus { top: 12px; }
}

@layer layout {
  .site-header { max-width: 1320px; margin: auto; min-height: 99px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 40px; border-bottom: 1px solid var(--line); }
  .brand { display: flex; align-items: center; gap: 12px; }
  .brand > svg { width: 32px; height: 43px; }
  .brand > span { font-family: var(--serif); font-size: 28px; letter-spacing: -.045em; line-height: 1.15; }
  .brand i { font-size: 23px; font-weight: 400; }
  .brand small { display: block; font-family: var(--sans); font-size: 7px; font-weight: 600; letter-spacing: .15em; margin-top: 6px; }
  nav { display: flex; gap: 30px; align-items: center; font-size: 12px; font-weight: 600; }
  nav a { position: relative; padding: 14px 0; }
  nav a:hover { color: var(--copper); }
  .nav-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px; background: var(--forest); }
  nav a > span { margin-left: 4px; font-size: 15px; }
  .header-note { font-size: 11px; display: flex; gap: 8px; align-items: center; color: var(--muted); }
  .status-dot { width: 6px; height: 6px; background: #5f7951; border-radius: 50%; display: inline-block; flex-shrink: 0; }
  .page-shell { max-width: 1240px; margin: auto; padding: 0 32px; }
  .intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 34px 0 28px; }
  .intro .eyebrow { color: #7d816d; margin-bottom: 9px; font-size: 9px; }
  .intro-note { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 12px; }
  .intro-note strong { font-weight: 500; color: #475c4e; }
  .tiny-pine { font-family: var(--serif); font-size: 40px; color: #9ca78e; line-height: 1; }
  .game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 26px; align-items: start; }
  .play-column { min-width: 0; }
  .game-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 45px; padding: 0 2px 12px; }
  .game-type { display: flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 600; letter-spacing: .08em; }
  .toolbar-divider { color: #b7b8aa; margin: 0 3px; }
  .toolbar-actions { display: flex; align-items: center; gap: 13px; }
  .sidebar { padding-top: 3px; display: flex; flex-direction: column; gap: 20px; }
  .table-footnote { font-size: 10px; color: #788070; display: flex; justify-content: space-between; padding: 14px 2px; gap: 15px; }
  .learn-section { padding: 40px 0 45px; border-top: 1px solid var(--line); }
  .learn-heading { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 25px; }
  .learn-heading .eyebrow { color: var(--muted); margin-bottom: 10px; font-size: 9px; }
  .learn-heading h2 { font-size: 30px; }
  .learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .learn-grid article + article { border-left: 1px solid var(--line); padding-left: 30px; }
  .lesson-number { font-size: 9px; color: #8c806a; letter-spacing: .1em; font-weight: 600; }
  .learn-grid h3 { font-size: 22px; margin: 12px 0 8px; }
  .learn-grid p { font-size: 12px; color: #707569; max-width: 310px; line-height: 1.8; }
  .site-footer { max-width: 1240px; padding: 22px 32px 30px; margin: auto; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: 10px; }
  .footer-brand { color: var(--ink); font-family: var(--serif); font-size: 22px; letter-spacing: -.05em; }
  .site-footer > div { display: flex; gap: 24px; }
  .attribution { font-size: 9px; color: #73786b; }
}

@layer components {
  .icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 7px; background: transparent; border: 1px solid transparent; border-radius: 50%; }
  .icon-button svg { width: 18px; height: 18px; }
  .icon-button:hover { background: #e9ecdf; }
  .text-button { background: none; border: 0; padding: 8px 0; font-size: 11px; white-space: nowrap; }
  .text-button:hover { color: #a25b37; }
  .text-button > span { margin-left: 5px; }
  .button { min-height: 44px; padding: 12px 21px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 25px; transition: background .18s, box-shadow .18s, transform .18s; }
  .button:not(:disabled):hover { transform: translateY(-1px); }
  .primary { background: var(--forest); color: var(--paper); }
  .primary:hover { background: #173c2c; }
  .secondary { background: transparent; border-color: var(--line); }
  .secondary:hover { background: #eaece2; }
  .inline-link { font-size: 12px; font-weight: 600; white-space: nowrap; padding-bottom: 4px; border-bottom: 1px solid #9ca68d; }
  .scoreboard { background: #ebe5d5; border: 1px solid #ded6c4; border-radius: 9px 9px 0 0; height: 110px; padding: 10px 26px; display: flex; gap: 18px; align-items: center; box-shadow: inset 0 1px 0 #fff9; }
  .score-player { position: relative; flex: 0 0 66px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
  .score-name { grid-column: 1 / -1; font-size: 9px; font-weight: 700; letter-spacing: .14em; margin-bottom: 1px; }
  .score-player > strong { font-family: var(--serif); font-size: 37px; font-weight: 400; line-height: 1.1; }
  .score-target { font-size: 9px; color: #8c8c78; margin-left: 5px; }
  .player-dot { width: 6px; height: 6px; border-radius: 50%; position: absolute; left: -12px; top: 4px; }
  .you-dot { background: #36664b; }
  .bot-dot { background: var(--copper); }
  .opponent-score { color: #a05e40; }
  .board-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
  .pegboard { width: 100%; height: 76px; max-width: 370px; }
  .board-caption { display: block; text-align: center; font-size: 6px; letter-spacing: .18em; color: #8d846f; margin-top: -3px; }
  .felt-table { position: relative; isolation: isolate; padding: 20px 28px 0; min-height: 546px; border-radius: 0 0 10px 10px; color: #f3f3dd; background: radial-gradient(ellipse at 50% 35%, #3a6550 0, #2c5745 43%, #214637 100%); box-shadow: inset 0 2px 10px #102c3a28, 0 13px 26px -20px #132d24a6; overflow: hidden; }
  .felt-table::before { content: ''; position: absolute; inset: 11px; border: 1px solid #d5e3c918; border-radius: 4px; z-index: -1; pointer-events: none; }
  .felt-table::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .1; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23noise)' opacity='.5' d='M0 0h150v150H0z'/%3E%3C/svg%3E"); }
  .felt-topline { display: flex; justify-content: space-between; gap: 12px; font-size: 8px; letter-spacing: .12em; color: #d1dbbd; align-items: center; }
  .phase-track { display: flex; align-items: center; gap: 9px; letter-spacing: .03em; font-size: 9px; }
  .phase-track > span { color: #b5c6af; }
  .phase-track .current-phase { color: #fff3d4; font-weight: 700; }
  .phase-track .completed-phase { color: #d2dec2; }
  .phase-track i { font-style: normal; opacity: .5; }
  .mode-badge { font-size: 7px; padding: 4px 7px; border: 1px solid #b8caa140; border-radius: 3px; }
  .opponent-row { display: flex; justify-content: space-between; align-items: center; margin: 23px 0 12px; min-height: 42px; }
  .player-identity { display: flex; gap: 10px; align-items: center; }
  .avatar { width: 35px; height: 35px; border-radius: 50%; background: #aec2a1; color: #31523d; display: grid; place-items: center; border: 3px solid #d7e1c82e; }
  .avatar > svg { width: 22px; height: 25px; }
  .player-identity strong { font-weight: 500; font-size: 13px; display: flex; gap: 8px; align-items: center; }
  .player-identity small { display: block; font-size: 6px; margin-top: 3px; letter-spacing: .14em; color: #b9ceb0; }
  .dealer-chip { display: inline-grid; place-items: center; width: 15px; height: 15px; background: #e9d4a5; color: #3a5341; border-radius: 50%; font-size: 8px; font-weight: 700; line-height: 1; }
  .opponent-cards { display: flex; padding-right: 2px; }
  .opponent-cards .mini-back + .mini-back { margin-left: -11px; }
  .card-back { position: relative; width: 68px; height: 98px; border-radius: 5px; background: #ede8d7; padding: 5px; border: 1px solid #eee8d6; box-shadow: 0 3px 5px #102a2b35; }
  .card-back > div { height: 100%; border: 1px solid #93a389; background-color: #638267; background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, #d9dfba38 3px, #d9dfba38 4px), repeating-linear-gradient(-45deg, transparent, transparent 3px, #d9dfba38 3px, #d9dfba38 4px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .card-back svg { width: 31px; height: 39px; color: #e9e9c8; background: #638267; padding: 3px; }
  .card-back span { font-family: var(--serif); font-size: 8px; letter-spacing: .16em; color: #e5e8cf; background: #638267; padding: 0 3px; }
  .mini-back { width: 31px; height: 43px; border-radius: 3px; padding: 3px; transform: rotate(5deg); }
  .mini-back:nth-child(2n) { transform: rotate(-3deg); }
  .mini-back svg { width: 16px; height: 22px; padding: 0; }
  .mini-back span { display: none; }
  .phase-heading { text-align: center; margin: 19px 0 0; }
  .phase-heading h2 { font-size: clamp(23px, 2.25vw, 30px); line-height: 1.2; color: #f6f1dd; }
  .phase-heading p { color: #c1d1b8; font-size: 11px; margin-top: 8px; }
  .table-center { min-height: 152px; display: flex; justify-content: center; align-items: center; padding: 16px 0; }
  .deal-center { display: flex; align-items: center; justify-content: center; gap: 34px; }
  .deck-pile { position: relative; margin-top: 3px; }
  .deck-under { position: absolute; transform: rotate(-6deg) translate(-3px, -2px); }
  .deck-pile > span { position: absolute; font-size: 7px; letter-spacing: .12em; color: #b7c9aa; left: 0; right: 0; text-align: center; bottom: -18px; white-space: nowrap; }
  .crib-space { width: 125px; height: 97px; border: 1px dashed #a6b99d66; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #213f2c20; }
  .crib-symbol { font-size: 27px; color: #c7d0ad; line-height: 1.1; margin-bottom: 5px; }
  .crib-space strong { font-size: 10px; font-weight: 500; color: #e3e9d2; }
  .crib-space small { font-size: 8px; color: #b6c8ac; margin-top: 4px; }
  .your-hand-area { margin-top: 11px; }
  .your-hand { display: flex; justify-content: center; gap: 9px; min-height: 127px; align-items: end; padding-top: 12px; }
  .playing-card { width: 79px; height: 113px; flex: 0 0 auto; display: block; position: relative; padding: 0; border: 1px solid #e6e2d4; border-radius: 6px; background: #fffdf4; box-shadow: 0 4px 6px #11291e3b; color: #263b34; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
  .fresh-deal button.playing-card { animation: deal-in .4s backwards; animation-delay: calc(var(--card-order) * 35ms); }
  button.playing-card:not(:disabled):hover { transform: translateY(-9px); box-shadow: 0 9px 10px #11291e4d; }
  button.playing-card:disabled { opacity: .55; }
  button.playing-card[aria-pressed] { opacity: 1; }
  .playing-card.selected-card, .playing-card.selected-card:hover { transform: translateY(-16px); box-shadow: 0 0 0 2px #edca7f, 0 9px 12px #142c2650; }
  .card-face { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
  .card-face.red { color: #b45543; }
  .card-face.black { color: #263f35; }
  .card-corner { position: absolute; top: 6px; left: 6px; font-family: Georgia, serif; font-size: 17px; line-height: .95; display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 500; }
  .card-corner > svg { width: 9px; height: 10px; fill: currentColor; }
  .card-corner-bottom { top: auto; left: auto; bottom: 6px; right: 6px; transform: rotate(180deg); }
  .card-pips { width: 100%; height: 100%; padding: 5px 6px; fill: currentColor; }
  .card-check { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border-radius: 50%; background: #efd28d; color: #294d3b; width: 20px; height: 20px; font-size: 12px; font-weight: 700; box-shadow: 0 1px 2px #18352340; }
  .playing-card.highlighted-card { outline: 3px solid #eed18f; outline-offset: 3px; }
  .hand-label { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 8px; letter-spacing: .13em; color: #dfE5cf; margin: 15px 0 17px; }
  .hand-instruction { letter-spacing: 0; color: #b9cbae; font-size: 9px; margin-left: 6px; }
  .table-actionbar { min-height: 73px; margin: 0 -28px; padding: 13px 28px; background: #142f262f; border-top: 1px solid #c3d5b317; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
  .action-context { display: flex; gap: 9px; align-items: center; font-size: 10px; color: #d1d9bf; }
  .selection-dots { display: flex; gap: 4px; }
  .selection-dots > i { border: 1px solid #c8cdaa; width: 7px; height: 7px; border-radius: 50%; }
  .selection-dots > i.filled { background: #e5cd8b; border-color: #e5cd8b; }
  .table-primary { background: #eedcb4; color: #2c4938; box-shadow: 0 2px 3px #122e1e20; min-width: 181px; }
  .table-primary:not(:disabled):hover { background: #f9e8c7; }
  .table-primary:disabled { opacity: .52; }
  .pale-dot { background: #bbcba5; }
  .play-instruction { font-size: 11px; color: #d1dcc1; padding: 13px 0; }
  .play-instruction span { margin-left: 10px; }
  .coach-panel { background: #eeeee4; border: 1px solid #e1e2d6; border-radius: 8px; padding: 22px 23px 0; }
  .panel-label { display: flex; align-items: center; gap: 7px; font-size: 8px; font-weight: 700; letter-spacing: .13em; color: #63735b; }
  .spark { font-size: 19px; line-height: 1; }
  #coach > h2 { font-size: 29px; line-height: 1.13; margin: 19px 0 13px; }
  #coach > p { color: #68715f; font-size: 12px; line-height: 1.8; }
  .coach-tip { display: flex; gap: 12px; margin: 20px 0; padding-top: 17px; border-top: 1px solid #d8dccd; }
  .coach-tip > span { font-size: 22px; color: #a08b5f; line-height: 1; }
  .coach-tip p { font-size: 11px; color: #64725d; line-height: 1.8; }
  .hint-button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid #bdc8ad; border-radius: 5px; padding: 11px 14px; font-size: 11px; background: #faf9ef; font-weight: 600; min-height: 44px; margin-bottom: 20px; }
  .hint-button:hover { background: #e3e9d8; }
  .hint-button > span { font-size: 17px; color: #849773; }
  #coach > .hint-note { font-size: 10px; line-height: 1.65; margin: 10px 0 15px; }
  .score-history { margin: 18px -23px 0; border-top: 1px solid #dce0d1; }
  .score-history summary { padding: 13px 23px; font-size: 10px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; color: #65735a; }
  .score-history summary::-webkit-details-marker { display: none; }
  .score-history summary > span { font-size: 16px; }
  .score-history[open] summary > span { transform: rotate(45deg); }
  .score-history ol { margin: 0; padding: 0 23px 10px; list-style: none; }
  .score-history li { border-top: 1px solid #dde1d0; padding: 9px 0; font-size: 11px; }
  .score-history li > span { display: flex; justify-content: space-between; }
  .score-history li small { display: block; margin-top: 4px; color: #707967; font-size: 10px; }
  .ad-shell { text-align: center; }
  .ad-label { display: block; font-size: 7px; letter-spacing: .19em; color: #969a8c; margin-bottom: 8px; }
  .ad-slot { border: 1px solid #e5e5dd; background: #f0f0e980; position: relative; overflow: hidden; }
  .ad-slot::before { content: ''; position: absolute; width: 20px; height: 1px; background: #d7dbcf; top: 50%; left: calc(50% - 10px); }
  .ad-sidebar .ad-slot { width: 300px; height: 250px; }
  .ad-below { padding: 24px 0 30px; }
  .ad-below .ad-slot { max-width: 728px; height: 90px; margin: auto; }
  .stats-panel { padding: 3px 8px 0; }
  .stats-panel .panel-label { font-size: 8px; color: #7e8574; }
  .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 15px; }
  .stats-grid > div { display: flex; flex-direction: column; align-items: center; }
  .stats-grid > div + div { border-left: 1px solid #dbdfd0; }
  .stats-grid strong { font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.1; }
  .stats-grid span { font-size: 9px; color: #777f6d; margin-top: 5px; }
  .stats-panel > p:last-child { text-align: center; color: #8b907f; font-size: 9px; margin-top: 15px; }
  .pegging-center { width: 100%; display: flex; align-items: center; justify-content: center; gap: 15px; }
  .running-count { display: flex; flex-direction: column; min-width: 70px; }
  .running-count > span { color: #c4d1b6; font-size: 7px; letter-spacing: .1em; }
  .running-count > strong { color: #f3e9c9; font-family: var(--serif); font-size: 36px; line-height: 1.3; font-weight: 400; white-space: nowrap; }
  .running-count small { color: #b4c3a7; font-family: var(--sans); font-size: 10px; }
  .played-cards { display: flex; justify-content: center; align-items: center; flex: 1; min-width: 0; padding-right: 0; }
  .small-card { width: 54px; height: 78px; }
  .small-card .card-corner { font-size: 12px; top: 4px; left: 4px; }
  .small-card .card-corner-bottom { top: auto; left: auto; right: 4px; bottom: 4px; }
  .small-card .card-corner svg { width: 6px; height: 7px; }
  .played-card + .played-card { margin-left: -20px; }
  .played-card { position: relative; }
  .played-card:nth-child(even) { transform: rotate(4deg); }
  .played-by-you { transform: rotate(-4deg); }
  .played-card > span { position: relative; display: block; text-align: center; font-size: 6px; margin-top: 8px; color: #c4d0b6; }
  .played-card + .played-card > span { visibility: hidden; }
  .starter-small { padding-left: 13px; border-left: 1px solid #b5c7a539; }
  .starter-small > span, .starter-count > span { font-size: 6px; display: block; text-align: center; color: #c4d0b6; letter-spacing: .1em; margin-top: 8px; }
  .empty-play { text-align: center; font-size: 13px; font-family: var(--serif); color: #d5dec7; }
  .empty-play span { font-family: var(--sans); font-size: 9px; color: #bbccb0; }
  .last-play { background: #e3e7d9; padding: 14px; border-radius: 5px; margin: 18px 0; }
  .last-play .eyebrow { color: #697a5e; font-size: 7px; letter-spacing: .1em; }
  .last-play p { color: #4e6247; font-size: 11px; margin-top: 7px; }
  .last-play > strong { display: block; font-size: 16px; margin-top: 8px; }
  .empty-hand { color: #bdcbb3; font-family: var(--serif); font-size: 19px; margin: auto; }
  .counting-center { min-height: 279px; }
  .counting-cards { display: flex; align-items: center; gap: 8px; padding: 20px 0; }
  .cut-divider { height: 90px; width: 1px; background: #d7dfbd40; margin: 0 9px; }
  .starter-count { position: relative; }
  .starter-count > span { position: absolute; top: 100%; width: 100%; }
  .score-breakdown { margin-top: 17px; }
  .score-detail { width: 100%; padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; border: 0; border-bottom: 1px solid #d8decd; background: transparent; font-size: 11px; text-align: left; min-height: 40px; }
  .score-detail small { color: #7c846f; }
  .score-detail:hover, .score-detail.active-detail { background: #dfe7d4; }
  .score-detail > strong { white-space: nowrap; }
  .combination-group summary { cursor: pointer; list-style: none; }
  .combination-group summary::-webkit-details-marker { display: none; }
  .expand-combos { display: inline-block; margin-left: 7px; color: #758465; }
  .combination-group[open] .expand-combos { transform: rotate(180deg); }
  .combination-group > div { padding-left: 9px; border-left: 2px solid #c9d3bc; }
  .single-combination > p { font-size: 10px; color: #66725d; padding-top: 10px; }
  .combination-row { font-size: 10px; min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
  .score-total { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; font-size: 11px; }
  .score-total strong { font-size: 31px; font-family: var(--serif); font-weight: 400; }
  .score-total small { font-size: 10px; font-family: var(--sans); }
  .no-score { color: #737c67; font-size: 12px; }
  .table-flourish { font-size: 28px; color: #d9deb350; }
  .round-recap { min-height: 279px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 10px; }
  .recap-symbol { color: #dfcf9e; font-size: 55px; line-height: 1; margin-bottom: 20px; }
  .recap-score { display: flex; gap: 30px; align-items: center; }
  .recap-score > span { font-size: 10px; display: flex; flex-direction: column; align-items: center; color: #c8d4b9; }
  .recap-score strong { font-size: 42px; font-weight: 400; font-family: var(--serif); color: #f4e8c9; }
  .recap-score i { color: #9cb297; font-style: normal; }
  .recap-note { color: #bfccaf; font-size: 9px; margin-top: 20px; text-align: center; }
  dialog { border: 1px solid #d4dcc9; border-radius: 12px; padding: 37px; max-width: 520px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); box-shadow: 0 25px 100px #0d281d40; max-height: calc(100dvh - 40px); }
  dialog::backdrop { background: #132c24a8; backdrop-filter: blur(4px); }
  dialog h2 { font-size: 33px; margin: 12px 0 16px; line-height: 1.1; }
  dialog > p { color: #6c7663; font-size: 12px; }
  .dialog-close { position: absolute; right: 13px; top: 12px; font-size: 25px; line-height: 1; }
  .rules-list { padding-left: 20px; margin: 24px 0; font-size: 13px; color: #596b50; }
  .rules-list li { padding-left: 5px; margin-bottom: 14px; line-height: 1.7; }
  .rules-list strong { color: #294e39; }
  .dialog-bottom { margin-top: 26px; width: 100%; }
  .difficulty-options { border: 0; padding: 0; margin: 25px 0; }
  .difficulty-options legend { font-size: 10px; font-weight: 700; letter-spacing: .06em; margin-bottom: 12px; }
  .difficulty-options label { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #d4dcc9; border-radius: 6px; margin-bottom: 10px; cursor: pointer; }
  .difficulty-options label:has(:checked) { background: #e8eddf; border-color: #859b73; }
  .difficulty-options input { accent-color: #345c42; width: 17px; height: 17px; }
  .difficulty-options strong { font-size: 13px; }
  .difficulty-options small { display: block; color: #737c68; font-size: 11px; margin-top: 3px; }
  .dialog-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
  .noscript-message { position: fixed; bottom: 10px; left: 20px; right: 20px; background: #f4e9c6; color: #234832; border: 1px solid #b7a574; padding: 18px; border-radius: 5px; }
  [hidden] { display: none !important; }
  .consent-panel { max-width: 900px; margin: 20px auto; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #eef0e5; }
  .consent-panel h2 { font-size: 23px; margin-bottom: 10px; }
  .consent-panel p { font-size: 14px; line-height: 1.7; }
  .consent-panel a { text-decoration: underline; }
  .consent-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
  .consent-actions .button { flex: 1 1 180px; white-space: normal; }
  .site-footer > div { flex-wrap: wrap; align-items: center; }
  @media (max-width: 940px) { .consent-panel { margin: 16px; } }
  .language-picker { position: relative; font-size: 12px; flex-shrink: 0; z-index: 10; }
  .language-picker > summary { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; list-style: none; background: var(--paper); }
  .language-picker > summary::-webkit-details-marker { display: none; }
  .language-menu { display: flex; position: absolute; right: 0; top: calc(100% + 8px); flex-direction: column; align-items: stretch; gap: 0; min-width: 185px; max-height: min(480px, 70dvh); overflow: auto; padding: 7px; background: #fffdf5; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px #173c2c20; }
  .language-menu a { padding: 9px 13px; min-height: 38px; display: flex; justify-content: space-between; gap: 12px; border-radius: 4px; font-size: 13px; font-weight: 400; }
  .language-menu a:hover, .language-menu a[aria-current] { background: #e6ebde; color: var(--forest); }
  .site-footer { flex-wrap: wrap; }
  .footer-languages { flex: 0 0 100%; justify-content: center; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
  .footer-languages a { font-size: 11px; padding: 5px 0; }
  .footer-languages a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
  .game-description { max-width: 850px; color: #5e6b56; font-size: 14px; line-height: 1.85; margin-bottom: 30px; }
  .game-loading { padding: 50px 20px; text-align: center; }
  .game-loading h2 { font-size: 30px; }
  .game-loading p { margin: 20px 0; }
  .learn-section { margin-top: 28px; }
  .faq-section { padding: 5px 0 40px; max-width: 880px; }
  .faq-section h2 { font-size: 29px; margin-bottom: 20px; }
  .faq-section details { border-top: 1px solid var(--line); padding: 14px 0; }
  .faq-section summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }
  .faq-section p { font-size: 13px; color: #5e6b56; line-height: 1.8; padding: 10px 20px 0; }
  .breadcrumbs { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
  .breadcrumbs a { text-decoration: underline; }
  .table-scroll { overflow-x: auto; }
  .rules-table caption { text-align: left; font-family: var(--serif); font-size: 25px; margin: 18px 0 10px; }
  .rules-table tbody th { font-weight: 400; background: transparent; }
  .guide-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 28px; font-size: 14px; }
  .guide-links a, .rules-contents a { text-decoration: underline; text-underline-offset: 4px; }
  .rules-contents { margin-top: 28px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; background: #eef0e5; }
  .rules-contents ol { padding-left: 20px; }
  .article-shell section[id], #scoring-chart { scroll-margin-top: 24px; }
  .scoring-examples { display: grid; gap: 18px; margin: 24px 0; }
  .scoring-example { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #f1eee2; display: flex; flex-wrap: wrap; gap: 16px; }
  .example-hand > span, .example-starter > span { display: block; font-size: 12px; margin-bottom: 10px; }
  .example-hand > div, .example-starter > div { display: flex; flex-wrap: wrap; gap: 6px; }
  .example-card { display: inline-grid; place-items: center; width: 42px; height: 60px; border: 1px solid #cfc7b5; border-radius: 5px; background: #fffdf5; color: #244c3e; font-family: var(--serif); font-size: 21px; }
  .example-card.red { color: #a94536; }
  .scoring-example figcaption { flex-basis: 100%; font-size: 14px; }
  .scoring-example ul { margin: 10px 0 0; padding-left: 20px; }
  .phase-heading h2, .coach-panel h2, .intro h1 { overflow-wrap: anywhere; }
  .table-primary { white-space: normal; }
  .phase-track, .game-type, .score-name, .panel-label, .mode-badge { text-transform: uppercase; }
  html:lang(hi) { --sans: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Mangal', sans-serif; --serif: 'Kohinoor Devanagari', 'Nirmala UI', serif; }
  html:lang(hi) .eyebrow, html:lang(hi) .mode-badge, html:lang(hi) .phase-track, html:lang(hi) .panel-label { letter-spacing: 0; }
  html:lang(zh-Hans) { --sans: 'PingFang SC', 'Microsoft YaHei', sans-serif; --serif: 'Songti SC', 'SimSun', serif; }
  .article-shell { max-width: 800px; padding: 50px 28px 70px; margin: auto; }
  .article-shell h1 { margin: 12px 0 20px; }
  .article-shell h2 { font-size: 28px; margin: 35px 0 15px; }
  .article-shell p, .article-shell li { color: #5a6855; line-height: 1.85; margin-bottom: 12px; }
  .article-shell .button { margin-top: 22px; }
  .rules-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 20px 0; }
  .rules-table th, .rules-table td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; }
  .rules-table th { background: #e9eddf; }
  @keyframes deal-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
}

@layer responsive {
  @media (min-width: 901px) and (max-height: 900px) {
    .site-header { min-height: 71px; padding-top: 13px; padding-bottom: 13px; }
    .brand > span { font-size: 25px; }
    .brand > svg { width: 27px; height: 35px; }
    .brand small { font-size: 6px; margin-top: 4px; }
    .intro { padding-top: 20px; padding-bottom: 18px; }
    .intro .eyebrow { margin-bottom: 5px; font-size: 8px; }
    h1 { font-size: 35px; }
    .game-toolbar { min-height: 39px; padding-bottom: 7px; }
    .scoreboard { height: 82px; padding-top: 5px; padding-bottom: 5px; }
    .pegboard { height: 65px; }
    .board-caption { display: none; }
    .felt-table { min-height: 0; padding-top: 14px; }
    .opponent-row { margin-top: 11px; margin-bottom: 0; min-height: 35px; }
    .phase-heading { margin-top: 11px; }
    .phase-heading h2 { font-size: 26px; }
    .phase-heading p { font-size: 10px; margin-top: 5px; }
    .table-center { min-height: 114px; padding-top: 10px; padding-bottom: 10px; }
    .deck-pile > .card-back { width: 52px; height: 75px; }
    .deck-pile > span { bottom: -14px; font-size: 6px; }
    .crib-space { height: 78px; width: 112px; }
    .crib-symbol { font-size: 23px; }
    .your-hand-area { margin-top: 8px; }
    .your-hand { min-height: 112px; }
    .playing-card { width: 70px; height: 100px; }
    .small-card { width: 48px; height: 70px; }
    .card-corner { font-size: 15px; }
    .hand-label { margin-top: 10px; margin-bottom: 11px; }
    .table-actionbar { min-height: 62px; padding-top: 9px; padding-bottom: 9px; }
    .counting-center { min-height: 247px; }
    .round-recap { min-height: 227px; }
    .table-footnote { padding-top: 10px; }
    .coach-panel { padding-top: 18px; }
    #coach > h2 { font-size: 26px; margin-top: 14px; }
    .coach-tip { margin: 15px 0; padding-top: 14px; }
    .hint-button { margin-bottom: 15px; }
    .sidebar { gap: 16px; }
  }
  @media (min-width: 1400px) { .page-shell { max-width: 1320px; } .playing-card { width: 86px; height: 123px; } .small-card { width: 54px; height: 78px; } .your-hand { min-height: 137px; } .felt-table { min-height: 557px; } }
  @media (max-width: 1100px) {
    .header-note { display: none; }
    .site-header { padding: 19px 28px; }
    .game-layout { grid-template-columns: minmax(0, 1fr) 274px; gap: 19px; }
    .ad-sidebar { display: none; }
    .game-toolbar { flex-wrap: wrap; }
    .game-type { font-size: 8px; }
    .toolbar-actions { gap: 10px; }
    .felt-table { padding-left: 20px; padding-right: 20px; }
    .table-actionbar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
    .playing-card { width: 65px; height: 94px; }
    .small-card { width: 48px; height: 70px; }
    .your-hand { gap: 7px; min-height: 108px; }
    .card-corner { font-size: 14px; }
    .scoreboard { padding-left: 24px; padding-right: 17px; gap: 13px; }
    .score-player { flex-basis: 53px; }
    .score-player > strong { font-size: 31px; }
    .intro-note { display: none; }
    .counting-cards { gap: 5px; }
    .cut-divider { margin: 0 4px; }
    .felt-table { min-height: 526px; }
  }
  @media (max-width: 900px) {
    .page-shell { padding: 0 24px; max-width: 780px; }
    .game-layout { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 20px; padding-top: 0; }
    .coach-panel { padding: 17px 20px 0; }
    #coach > h2 { font-size: 25px; margin: 10px 0; }
    #coach > h2 br { display: inline; }
    #coach > h2 br::after { content: ' '; }
    .coach-tip { margin: 12px 0; padding-top: 12px; }
    .hint-button { margin-bottom: 12px; }
    .score-history { margin-left: -20px; margin-right: -20px; }
    .stats-panel { padding-top: 10px; }
    .playing-card { width: 80px; height: 115px; }
    .small-card { width: 54px; height: 78px; }
    .card-corner { font-size: 17px; }
    .your-hand { min-height: 129px; gap: 10px; }
    .felt-table { min-height: 547px; }
    .table-footnote { padding-bottom: 2px; }
    .learn-grid { gap: 20px; }
    .learn-grid article + article { padding-left: 20px; }
    .learn-heading h2 { font-size: 25px; }
    .learn-grid h3 { font-size: 20px; }
    .learn-heading { align-items: flex-start; }
    .learn-heading > a { margin-top: 25px; }
    .site-footer { flex-wrap: wrap; }
  }
  @media (min-width: 901px) and (max-height: 900px) {
    .felt-table { min-height: 0; }
    .your-hand { min-height: 112px; }
    .playing-card { width: 70px; height: 100px; }
    .small-card { width: 48px; height: 70px; }
  }
  @media (min-width: 901px) and (max-height: 780px) {
    .site-header { min-height: 63px; padding-top: 9px; padding-bottom: 9px; }
    .intro { padding-top: 13px; padding-bottom: 12px; }
    .intro .eyebrow { font-size: 7px; margin-bottom: 3px; }
    h1 { font-size: 31px; }
    .scoreboard { height: 70px; }
    .pegboard { height: 57px; }
    .opponent-row { min-height: 31px; margin-top: 8px; }
    .mini-back { height: 35px; width: 26px; }
    .phase-heading { margin-top: 8px; }
    .phase-heading h2 { font-size: 24px; }
    .phase-heading p { margin-top: 4px; }
    .table-center { min-height: 100px; }
    .deck-pile > .card-back { width: 45px; height: 65px; }
    .crib-space { height: 68px; }
    .crib-symbol { font-size: 20px; margin-bottom: 3px; }
    .counting-center { min-height: 233px; }
    .round-recap { min-height: 213px; }
  }
  @media (max-width: 600px) {
    .site-header { padding: 15px 18px; min-height: 72px; gap: 10px; flex-wrap: wrap; }
    .site-header > nav { order: 3; flex-basis: 100%; justify-content: center; gap: 24px; }
    .site-header > nav a { padding: 3px 0; }
    .language-picker { margin-left: auto; font-size: 11px; }
    .language-picker > summary { padding: 6px 9px; gap: 5px; }
    .language-menu { min-width: 170px; }
    .brand { gap: 7px; }
    .brand > svg { width: 23px; height: 32px; }
    .brand > span { font-size: 23px; }
    .brand i { font-size: 19px; }
    .brand small { display: none; }
    nav { gap: 13px; font-size: 10px; }
    nav .nav-active { display: none; }
    .page-shell { padding: 0 14px; }
    .intro { padding: 23px 2px 20px; }
    .intro .eyebrow { font-size: 7px; margin-bottom: 7px; }
    h1 { font-size: 30px; }
    .game-toolbar { padding-bottom: 9px; gap: 3px 10px; min-height: 42px; flex-wrap: wrap; }
    .game-type { font-size: 7px; gap: 5px; letter-spacing: .03em; }
    .game-type .status-dot { width: 4px; height: 4px; }
    .toolbar-divider { margin: 0; }
    .toolbar-actions { gap: 10px; }
    .icon-button { width: 32px; height: 32px; padding: 6px; }
    .text-button { font-size: 10px; }
    .text-button > span { margin-left: 2px; }
    .scoreboard { height: 87px; gap: 13px; padding: 9px 16px 9px 22px; }
    .score-player { flex-basis: 44px; }
    .score-player > strong { font-size: 28px; }
    .score-target { font-size: 7px; margin-left: 2px; }
    .score-name { font-size: 7px; }
    .player-dot { left: -9px; top: 3px; width: 5px; height: 5px; }
    .pegboard { height: 65px; }
    .board-caption { display: none; }
    .felt-table { padding: 16px 16px 0; min-height: 479px; }
    .felt-table::before { inset: 7px; }
    .felt-topline { font-size: 7px; gap: 5px; flex-wrap: wrap; }
    .phase-track { gap: 6px; font-size: 8px; }
    .mode-badge { font-size: 6px; padding: 3px 4px; letter-spacing: .06em; }
    .opponent-row { margin-top: 20px; margin-bottom: 11px; min-height: 35px; }
    .avatar { width: 31px; height: 31px; }
    .player-identity { gap: 7px; }
    .player-identity strong { font-size: 12px; }
    .player-identity small { font-size: 5px; letter-spacing: .08em; }
    .mini-back { width: 26px; height: 36px; padding: 2px; }
    .mini-back svg { width: 14px; height: 20px; }
    .opponent-cards .mini-back + .mini-back { margin-left: -12px; }
    .phase-heading { margin-top: 18px; }
    .phase-heading h2 { font-size: 25px; }
    .phase-heading p { font-size: 10px; margin-top: 7px; max-width: 280px; margin-left: auto; margin-right: auto; }
    .table-center { min-height: 143px; padding: 15px 0; }
    .deal-center { gap: 27px; }
    .deck-pile > .card-back { width: 56px; height: 81px; }
    .crib-space { width: 112px; height: 82px; }
    .crib-space strong { font-size: 9px; }
    .crib-space small { font-size: 7px; }
    .your-hand-area { margin-top: 9px; }
    .your-hand { min-height: 94px; gap: 6px; padding-top: 12px; }
    .playing-card { width: clamp(39px, 12.2vw, 68px); height: clamp(58px, 17.65vw, 98px); border-radius: 4px; }
    .card-corner { font-size: 12px; top: 4px; left: 4px; gap: 2px; }
    .card-corner-bottom { top: auto; left: auto; bottom: 4px; right: 4px; }
    .card-corner > svg { width: 7px; height: 7px; }
    .card-pips { padding: 5px 4px; }
    .card-check { width: 16px; height: 16px; font-size: 10px; bottom: -8px; }
    .playing-card.selected-card, .playing-card.selected-card:hover { transform: translateY(-11px); }
    .hand-label { margin: 13px 0 17px; font-size: 7px; }
    .hand-instruction { font-size: 8px; }
    .table-actionbar { margin: 0 -16px; padding: 12px 16px; min-height: 69px; gap: 8px; flex-wrap: wrap; }
    .table-primary { margin-left: auto; max-width: 100%; }
    .phase-track { max-width: 100%; flex-wrap: wrap; }
    .footer-languages { gap: 4px 14px; }
    .footer-languages a { font-size: 11px; }
    html:lang(hi) .phase-track { font-size: 10px; }
    html:lang(hi) .game-type, html:lang(hi) .panel-label { font-size: 10px; }
    .action-context { font-size: 8px; gap: 5px; }
    .table-primary { min-width: 0; padding: 10px 12px; font-size: 10px; gap: 12px; }
    .table-footnote { font-size: 8px; padding-top: 10px; }
    .table-footnote > span:last-child { display: none; }
    .sidebar { grid-template-columns: 1fr; gap: 20px; }
    .coach-panel { padding: 18px 20px 0; }
    #coach > h2 { font-size: 25px; }
    .coach-tip { margin: 13px 0; }
    .stats-panel { padding: 2px 12px 0; }
    .stats-panel .panel-label { text-align: center; justify-content: center; }
    .stats-grid strong { font-size: 24px; }
    .ad-below { padding: 26px 0; }
    .ad-below .ad-slot { width: min(320px, 100%); height: 100px; }
    .learn-section { padding: 28px 5px; }
    .learn-heading { display: block; margin-bottom: 25px; }
    .learn-heading .eyebrow { font-size: 7px; }
    .learn-heading h2 { font-size: 26px; max-width: 270px; }
    .learn-heading > a { display: inline-block; margin-top: 14px; font-size: 11px; }
    .learn-grid { grid-template-columns: 1fr; gap: 22px; }
    .learn-grid article + article { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
    .learn-grid h3 { font-size: 23px; margin-top: 7px; }
    .learn-grid p { max-width: none; }
    .site-footer { padding: 20px; gap: 9px; }
    .site-footer > span { font-size: 9px; }
    .site-footer > div { flex-basis: 100%; justify-content: space-between; margin-top: 8px; }
    .small-card { width: 43px; height: 63px; }
    .small-card .card-corner { font-size: 10px; }
    .small-card .card-corner svg { width: 5px; height: 6px; }
    .pegging-center { gap: 9px; }
    .running-count { min-width: 48px; }
    .running-count > span { font-size: 6px; }
    .running-count > strong { font-size: 27px; }
    .running-count small { font-size: 8px; }
    .played-card + .played-card { margin-left: -29px; }
    .starter-small { padding-left: 7px; }
    .empty-play { font-size: 12px; }
    .empty-play span { font-size: 8px; }
    .counting-center { min-height: 226px; }
    .counting-cards { gap: 5px; }
    .cut-divider { height: 60px; margin: 0 4px; }
    .counting-cards .playing-card { width: clamp(39px, 12.2vw, 65px); }
    .round-recap { min-height: 225px; }
    .play-instruction { font-size: 9px; }
    dialog { padding: 30px 24px 24px; }
    dialog h2 { font-size: 29px; }
    .dialog-actions { gap: 8px; }
    .dialog-actions .button { font-size: 11px; padding-left: 13px; padding-right: 13px; }
    .article-shell { padding: 35px 22px 50px; }
    .rules-table { font-size: 11px; }
    .rules-table td, .rules-table th { padding: 9px; }
  }
  @media (max-width: 360px) {
    .game-type { font-size: 6px; gap: 4px; }
    .toolbar-actions { gap: 7px; }
    .text-button { font-size: 9px; }
    .toolbar-actions .icon-button { width: 25px; }
    .phase-track { gap: 4px; font-size: 7px; }
    .mode-badge { font-size: 5px; }
    .phase-heading h2 { font-size: 22px; }
    .your-hand { gap: 4px; }
    .action-context { font-size: 7px; }
    .table-primary { font-size: 9px; padding-left: 9px; padding-right: 9px; }
    .card-corner { left: 3px; top: 3px; font-size: 11px; }
    .card-corner-bottom { left: auto; top: auto; bottom: 3px; right: 3px; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
}
