:root {
  color-scheme: dark;
  --base: #0e191b;
  --surface: #142224;
  --raised: #19292b;
  --line: #2a3b3c;
  --text: #f5f2e8;
  --muted: #a9b9b6;
  --accent: #f2cb89;
  --accent-text: #271d12;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 59% 0, #142224 0, transparent 58%), var(--base);
  font: 1rem/1.5 var(--sans);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
svg { display: block; flex: none; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; transform: translateY(-130%); background: var(--accent); color: var(--accent-text); padding: 9px 14px; border-radius: 7px; }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--line); background: #101c1ed9; }
.header-inner {
  min-height: 69px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1460px;
  padding: 0 34px;
  margin-inline: auto;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 12px; white-space: nowrap; font: normal 1.53rem/1 var(--serif); letter-spacing: -.035em; }
.brand strong { color: var(--accent); font-weight: inherit; }
.brand-mark, .daily-icon {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(150deg, #fbe0ab, #d9a759);
  color: #233832;
}
.brand-mark span { position: relative; font: 1.7rem/1 var(--serif); top: -1px; }
.brand-mark span::after { content: ''; display: block; position: absolute; inset: 5px -3px; border: 1px solid #59442a; transform: rotate(45deg) scale(.88); border-radius: 2px; opacity: .65; }
.header-inner nav, .header-tools { display: flex; align-items: center; gap: 8px; }
.header-tools { justify-self: end; gap: 9px; }
.nav-link, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); font-size: .875rem; font-weight: 620;
}
.nav-link:hover, .icon-button:hover { background: var(--raised); border-color: var(--line); }
.nav-link { white-space: nowrap; }
.nav-link [data-icon] { color: var(--accent); }
.icon-button { width: 42px; padding: 0; border-color: var(--line); color: #d8e5df; }
.icon-button svg { margin: auto; }

.page-wrap {
  width: min(100%, 1460px);
  margin-inline: auto;
  padding: 32px 34px 44px;
  display: grid;
  grid-template-columns: clamp(158px, 13.4vw, 190px) minmax(0, 1fr);
  gap: clamp(20px, 2.7vw, 39px);
}
.sidebar { padding-top: 13px; min-width: 0; }
.sidebar-title { color: var(--muted); font-size: .84rem; padding-inline: 12px; margin-bottom: 11px; font-weight: 600; }
#quick-nav { display: grid; gap: 4px; }
.quick-link {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; min-height: 45px;
  border-radius: 9px; font-size: .92rem; color: #c8d4cf; border: 1px solid transparent;
  transition: background .16s, color .16s;
}
.quick-link .quick-pip { flex: 0 0 20px; text-align: center; color: #a8bfb5; font-size: 1.05rem; line-height: 1; }
.quick-link:hover { background: var(--surface); color: var(--text); }
.quick-link[aria-current="page"] {
  background: #22342d; border-color: #32493e; font-weight: 650; color: #fff5dc; box-shadow: inset 2px 0 0 #e3b76f;
}
.quick-link[aria-current="page"] .quick-pip { color: var(--accent); }
.daily-tile {
  margin-top: 27px; display: flex; align-items: center; gap: 12px; padding: 12px 10px;
  border: 1px solid #384b42; border-radius: 10px; background: linear-gradient(138deg, #24362e, #182729);
}
.daily-tile:hover { border-color: #7d7456; }
.daily-tile strong, .daily-tile small { display: block; }
.daily-tile strong { font-size: .92rem; }
.daily-tile small { color: #bbcdc2; font-size: .82rem; }
.daily-icon { border: 1px solid #645c41; width: 33px; color: var(--accent); background: #3a4131; }
.daily-icon svg { width: 17px; height: 17px; }
.sidebar-stat { display: flex; align-items: center; gap: 9px; margin-top: 17px; padding: 0 10px; color: var(--muted); font-size: .85rem; }
.sidebar-stat strong { margin-left: auto; color: var(--text); }
.sidebar-stat-icon { color: var(--accent); }

.stage { min-width: 0; }
.game-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 22px; margin-bottom: 20px; }
.game-heading h1 { font: normal clamp(2.2rem, 4.25vw, 3.75rem)/1.02 var(--serif); letter-spacing: -.045em; }
.game-heading p { color: var(--muted); margin-top: 9px; }
.variants { display: inline-flex; flex: none; padding: 4px; background: #111f21; border: 1px solid var(--line); border-radius: 10px; }
.variants a { display: grid; place-items: center; min-width: 68px; height: 37px; padding: 0 10px; border-radius: 7px; font-weight: 620; font-size: .875rem; color: #c1ceca; white-space: nowrap; }
.variants a:hover { background: var(--surface); }
.variants a[aria-current="page"] { color: var(--accent-text); background: var(--accent); box-shadow: 0 1px 3px #050b0c9e; }

.felt {
  --felt-edge: #286257;
  --felt-dark: #104039;
  --felt-light: #22745d;
  --felt-fade: #0d453e;
  --felt-text: #f4f8ed;
  --felt-subtle: #bcdbca;
  --felt-border: #ffffff30;
  min-width: 0; border-radius: 21px; overflow: hidden;
  border: 1px solid var(--felt-edge);
  background:
    radial-gradient(circle at 1px 1px, #ffffff06 .6px, transparent 1px) 0 0 / 4px 4px,
    radial-gradient(ellipse at 50% 25%, var(--felt-light) 0, var(--felt-fade) 72%, var(--felt-dark) 100%);
  box-shadow: inset 0 0 80px #00000029, 0 18px 65px #070d0f38;
  color: var(--felt-text);
}
.felt[data-felt="blue"] { --felt-edge: #335e76; --felt-dark: #112d44; --felt-fade: #143c54; --felt-light: #285c76; }
.felt[data-felt="plum"] { --felt-edge: #75445b; --felt-dark: #401e34; --felt-fade: #50283b; --felt-light: #79465a; }
.toolbar { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--felt-border); background: #0d1b142b; }
.play-controls, .scoreboard { display: flex; align-items: center; gap: 6px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid transparent; font-size: .875rem; font-weight: 680;
}
.button.primary { color: var(--accent-text); background: linear-gradient(#f7d7a0, #edbe73); border-color: #f1ce96; box-shadow: 0 2px 4px #010d0a47; }
.button.primary:hover { background: #ffdfab; }
.button.clear { color: inherit; background: #09201c25; border-color: var(--felt-border, var(--line)); }
.button.clear:hover:not(:disabled) { background: #ffffff19; }
.button.clear:disabled { color: #bad6c8a2; background: transparent; border-color: #ffffff14; }
.button svg { width: 17px; height: 17px; }
.scoreboard { gap: 0; font-variant-numeric: tabular-nums; }
.scoreboard div { min-width: 69px; display: grid; line-height: 1.2; padding: 0 12px; text-align: center; }
.scoreboard div + div { border-left: 1px solid var(--felt-border); }
.scoreboard span { font-size: .78rem; color: var(--felt-subtle); }
.scoreboard strong { font-size: 1.05rem; margin-top: 4px; font-weight: 660; }

.playfield {
  container-type: inline-size;
  min-width: 0;
  overflow-x: auto;
  padding: 25px clamp(9px, 2.4vw, 34px) 15px;
  scrollbar-color: #a3b8a978 #00000020;
}
.board {
  --gap: clamp(5px, 1.4cqw, 17px);
  --card: clamp(29px, calc((100cqw - (var(--cols, 7) - 1) * var(--gap)) / var(--cols, 7)), 113px);
  --card-h: calc(var(--card) * 1.41);
  --face-step: calc(var(--card) * .31);
  --hidden-step: calc(var(--card) * .17);
  --stride: calc(var(--card) + var(--gap));
  min-width: max-content;
  min-height: clamp(320px, 37cqw, 402px);
  width: max-content;
  margin-inline: auto;
  touch-action: pan-y;
  user-select: none;
}
.board[data-compact="true"] { --gap: clamp(4px, 1.25cqw, 13px); }
.board[data-big="true"] { --gap: clamp(3px, 1.05cqw, 11px); --card: clamp(22px, calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols)), 87px); }
.board[data-game="crescent-solitaire"], .board[data-game="crescent-four"] { --face-step: calc(var(--card) * .28); }
.board[data-game="solitaire-face-up"] { --face-step: calc(var(--card) * .29); }
.board-top, .tableau, .gap-grid { display: grid; grid-template-columns: repeat(var(--cols, 7), var(--card)); gap: var(--gap); }
.board-top { row-gap: 7px; align-items: end; margin-bottom: clamp(17px, 3cqw, 33px); }
.board-top.compact-top { margin-bottom: 0; margin-top: 17px; justify-content: center; }
.tableau + .tableau { margin-top: calc(var(--gap) + 10px); }
.top-pile { grid-column: var(--pile-column, auto); min-width: 0; position: relative; }
.slot, .card, .pile-col { position: relative; width: var(--card); }
.slot, .card { height: var(--card-h); border-radius: clamp(3px, calc(var(--card) * .072), 10px); }
.slot {
  display: grid; place-items: center; border: 1px dashed #e6fae75a;
  background: #00271e24; color: #e6fae794; font-family: var(--serif);
  font-size: calc(var(--card) * .43);
  line-height: 1;
}
.slot:disabled { color: #e6fae76b; }
.slot .slot-small { font: 560 clamp(.55rem, calc(var(--card) * .12), .78rem)/1 var(--sans); letter-spacing: .02em; }
.slot:not(:disabled):hover, .slot.is-target { border-color: #f4d391; background: #ffeea619; }
.board-top .top-pile .slot { display: grid; }
.pile-col {
  min-height: var(--card-h);
  height: calc(var(--card-h) + var(--up-count, 0) * var(--face-step) + var(--down-count, 0) * var(--hidden-step));
}
.pile-col > .card, .pile-col > .slot, .shape .card, .top-pile > .fan-card {
  position: absolute;
  top: calc(var(--up, 0) * var(--face-step) + var(--down, 0) * var(--hidden-step));
  left: 0;
}
.top-pile .fan-card { transform: translateX(calc(var(--fan, 0) * var(--card) * .18)); pointer-events: none; }
.top-pile .fan-card:not(:disabled) { pointer-events: auto; }
.card {
  display: block; border: 1px solid #fffdf5; padding: 0;
  background: linear-gradient(145deg, #fffdfa, #f4ecdb 123%);
  color: #18232c; overflow: hidden;
  box-shadow: 0 2px 4px #00000066, 0 8px 16px #021c192b, inset 0 -1px 0 #dbd3c1;
  -webkit-tap-highlight-color: transparent;
  transition: filter .13s, box-shadow .13s;
}
.card.red { color: #ac213b; }
.card:disabled:not(.back) { cursor: default; }
.card:not(:disabled):hover { filter: brightness(1.045); }
.card.is-selected {
  outline: 3px solid #ffcf72; outline-offset: 1px;
  box-shadow: 0 0 16px #ffcf7260, 0 2px 6px #0009;
  z-index: 3;
}
.card.is-hint, .slot.is-hint, .card.is-target { outline: 3px solid #ffd784; outline-offset: 2px; }
.card.is-hint, .slot.is-hint { animation: hint-glow 1.2s ease-in-out 2; }
.card.is-dragging { opacity: .4; }
@keyframes hint-glow { 50% { box-shadow: 0 0 15px 5px #ffe1a06e; } }
.card:focus-visible, .slot:focus-visible { z-index: 4; outline-offset: 1px; }
.card-corner {
  position: absolute; top: 4.4%; left: 6.6%; display: grid; grid-template-columns: auto auto; gap: 2px;
  align-items: center; font: bold calc(var(--card) * .205)/1 var(--serif);
}
.card-corner.bottom { inset: auto 6.6% 4.4% auto; transform: rotate(180deg); }
.card-corner em { font: normal .82em/1 var(--serif); }
.card-center {
  position: absolute; inset: 21% 19%; display: grid; place-items: center;
  font: normal calc(var(--card) * .48)/1 var(--serif); pointer-events: none;
}
.card-center.pips { font-size: calc(var(--card) * .205); }
.card-center.pips span { position: absolute; translate: -50% -50%; }
.card-center.pips .inverted { rotate: 180deg; }
.card-center.royal {
  inset: 22% 21%; background: #e6d6b34a; border: 1px solid #a1855067;
  outline: 1px solid #a1855037; outline-offset: 2px;
}
.card-center.royal span { translate: 0 -1%; }
.card-center.large { font-size: calc(var(--card) * .64); }
.card .card-corner, .card .card-center, .card .back-pattern { pointer-events: none; }
.card.back {
  display: grid; place-items: center; background: var(--back, #1f465a); border: 1px solid #f3dfba;
  box-shadow: 0 2px 4px #0008, 0 7px 15px #02221b53, inset 0 0 0 2px #f2e6c6;
}
.back-pattern {
  position: relative; display: grid; place-items: center; width: 88%; height: 91%; border: 1px solid #fff1cb9e; border-radius: 5%;
  background:
    repeating-linear-gradient(45deg, #fdf4dc24 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, #fdf4dc17 0 1px, transparent 1px 6px),
    radial-gradient(ellipse, #fff1cb35, transparent 56%);
  color: #ffe5b1; font: normal calc(var(--card) * .36)/1 var(--serif);
}
.back-pattern::after { content: ''; position: absolute; width: 32%; aspect-ratio: 1; border: 1px solid #fae5b8a6; border-radius: 10%; rotate: 45deg; }
.felt[data-deck="wine"] { --back: #7a384d; }
.felt[data-deck="copper"] { --back: #874f36; }
.stock-label { position: absolute; top: 5px; right: 5px; z-index: 1; border-radius: 5px; padding: 3px 5px; background: #0c2325da; color: white; font: 620 clamp(.54rem, calc(var(--card) * .125), .8rem)/1 var(--sans); }
.slot-label { text-align: center; color: var(--felt-subtle); margin-top: 5px; font-size: clamp(.6rem, calc(var(--card) * .13), .78rem); line-height: 1.15; white-space: nowrap; }
.slot-label:empty { display: none; }
.run-result { color: var(--accent); font: normal calc(var(--card) * .36)/1 var(--serif); }
.shape {
  width: calc(var(--width) * var(--card) + (var(--width) - 1) * var(--gap));
  --shape-step: calc(var(--card) * .39);
  height: calc(var(--card-h) + var(--shape-step) * (var(--rows) - 1));
  position: relative;
}
.shape .card { left: calc(var(--x) * var(--stride)); top: calc(var(--y) * var(--shape-step)); }
.shape .covered:not(.back) { filter: saturate(.72) brightness(.89); }
.gap-grid { row-gap: calc(var(--gap) + 7px); }
.gap-grid .slot { font: .66rem/1 var(--sans); }
.drag-ghost { pointer-events: none; position: fixed; z-index: 20; transform: translate(-50%, -25%); rotate: -5deg; opacity: .95; filter: brightness(1.04); }

.table-notice {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 47px; padding: 6px 20px; border-top: 1px solid #e3f9e122;
  font-size: .88rem; color: var(--felt-subtle); background: #072d2463;
}
.table-notice .special-control { min-height: 33px; font-size: .82rem; }
.table-notice #status:empty::before { content: '\00a0'; }
.below-table { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px 0; color: var(--muted); font-size: .875rem; }
.deal-details, .shortcuts, .text-button { display: inline-flex; align-items: center; gap: 8px; }
.deal-details { gap: 14px; }
.deal-details strong { color: #e5e9de; font-weight: 580; font-variant-numeric: tabular-nums; }
.shortcuts { gap: 6px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 5px; border: 1px solid #495755; color: #e2ebe4; font: .78rem/1 var(--sans); }
kbd + kbd, .shortcuts kbd:last-of-type { margin-left: 5px; }
.text-button { color: var(--accent); border: 0; background: transparent; padding: 3px 0; font-weight: 620; font-size: .875rem; }
.text-button:hover { text-decoration: underline; }
.text-button svg { width: 16px; height: 16px; }

.more-games { margin-top: 31px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
h2 { font: normal 1.65rem/1.2 var(--serif); letter-spacing: -.02em; }
.game-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-tile {
  display: flex; gap: 14px; align-items: center; min-width: 0;
  background: linear-gradient(154deg, #1a2a2b, #142124); border: 1px solid var(--line);
  border-radius: 11px; min-height: 79px; padding: 11px; transition: background .15s, border-color .15s;
}
.game-tile:hover { background: #263931; border-color: #688070; }
.game-tile strong { display: block; font-size: .94rem; line-height: 1.2; margin-bottom: 4px; }
.game-tile small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.2; }
.tile-art {
  --stamp: #3d765f; --stamp-ink: #275544;
  position: relative; isolation: isolate; display: grid; place-items: center; flex: 0 0 53px; height: 51px;
  background: var(--stamp); border: 1px solid #fdf5d83c; border-radius: 8px; overflow: hidden;
}
.tile-art .layout-glyph { display: block; width: 100%; height: 100%; }
[data-family="Spider"] .tile-art { --stamp: #3f576e; --stamp-ink: #28415b; }
[data-family="Clearing"] .tile-art { --stamp: #7b5262; --stamp-ink: #823349; }
[data-family="FreeCell"] .tile-art { --stamp: #716340; --stamp-ink: #785a25; }
[data-family="Yukon"] .tile-art { --stamp: #4a6a6b; --stamp-ink: #254e52; }
[data-family="Sorting"] .tile-art { --stamp: #615a7a; --stamp-ink: #514873; }
[data-family="Card games"] .tile-art { --stamp: #775342; --stamp-ink: #773e31; }
.how-to { margin-top: 27px; padding: 22px 0 0; border-top: 1px solid var(--line); }
.how-to ol { padding-left: 24px; margin: 12px 0 0; color: #c1ccc7; }
.how-to li { padding: 5px 0 5px 5px; }
.site-footer { display: flex; justify-content: space-between; gap: 8px; max-width: 1392px; margin: 0 auto; padding: 17px 24px 27px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

dialog {
  width: min(calc(100% - 32px), 540px); max-height: min(84vh, 820px); overflow: auto;
  color: var(--text); background: var(--surface); border: 1px solid #435653; border-radius: 17px;
  padding: 21px; box-shadow: 0 22px 120px #0009;
}
dialog::backdrop { background: #071113bc; backdrop-filter: blur(3px); }
dialog[data-view="library"] { width: min(calc(100% - 32px), 940px); }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.dialog-top h2 { font-size: 2rem; }
.dialog-close { margin-left: auto; flex-shrink: 0; }
.dialog-copy { color: var(--muted); margin-bottom: 12px; }
.dialog-rules { padding-left: 22px; margin: 14px 0; color: #d5e0d8; }
.dialog-rules li { padding: 5px 0 5px 5px; }
.dialog-actions { display: grid; gap: 8px; }
.dialog-actions button { display: flex; gap: 11px; align-items: center; padding: 10px 13px; min-height: 58px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); color: var(--text); }
.dialog-actions button:hover { border-color: #7d8974; background: #253632; }
.dialog-actions button > svg { color: var(--accent); }
.dialog-actions button strong, .dialog-actions button small { display: block; }
.dialog-actions button small { font-size: .87rem; color: var(--muted); }
.library-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(115px, 185px); gap: 10px; }
.library-tools input, .library-tools select, .setting-row select {
  width: 100%; padding: 10px 13px; min-height: 44px; border-radius: 8px; border: 1px solid #435751;
  background: #102023; color: var(--text); font-size: .9rem;
}
.library-tools input::placeholder { color: #a0b3ae; }
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; top: 12px; left: 12px; color: var(--muted); }
.search-wrap input { padding-left: 38px; }
.library-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#library-count { color: var(--muted); font-size: .875rem; margin: 12px 0; }
.setting-row { display: grid; grid-template-columns: 1fr minmax(120px, 39%); align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.setting-row input { justify-self: end; width: 19px; height: 19px; accent-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.stat-grid div { border-radius: 9px; padding: 12px; border: 1px solid var(--line); background: var(--raised); }
.stat-grid span, .stat-grid strong { display: block; }
.stat-grid span { font-size: .86rem; color: var(--muted); }
.stat-grid strong { color: var(--accent); font-size: 1.35rem; }
.win-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
#table:focus, .game-heading h1:focus { outline: none; }

@media (max-width: 1050px) {
  .page-wrap { padding: 24px 24px 34px; gap: 20px; }
  .header-inner { padding-inline: 24px; }
  .toolbar { padding-inline: 13px; }
  .scoreboard div { min-width: 53px; padding-inline: 8px; }
  .button { padding-inline: 9px; gap: 5px; }
  .game-cards { gap: 8px; }
  .game-tile { gap: 8px; padding: 8px; }
  .tile-art { flex-basis: 43px; height: 45px; }
}
@media (max-width: 830px) {
  .sidebar { display: none; }
  .page-wrap { display: block; }
  .playfield { padding-inline: 17px; }
  .header-inner { min-height: 61px; }
}
@media (max-width: 575px) {
  .header-inner { min-height: 57px; grid-template-columns: 1fr auto auto; gap: 4px; padding-inline: 10px; }
  .brand { font-size: 1.14rem; gap: 6px; }
  .brand-mark { width: 28px; border-radius: 7px; }
  .brand-mark span { font-size: 1.28rem; }
  .brand-mark span::after { inset: 4px -2px; }
  .header-inner nav, .header-tools { gap: 2px; }
  .nav-link { padding-inline: 6px; min-height: 36px; font-size: .78rem; }
  .nav-link [data-icon] { display: none; }
  .icon-button { width: 34px; min-height: 34px; border-color: transparent; }
  .header-tools .icon-button svg { width: 17px; height: 17px; }
  .page-wrap { padding: 17px 9px 28px; }
  .game-heading { margin: 0 3px 12px; align-items: flex-start; flex-wrap: wrap; }
  .game-heading h1 { font-size: 2.3rem; }
  .game-heading p { margin-top: 5px; font-size: .91rem; }
  .variants { padding: 3px; }
  .variants a { min-width: 61px; height: 29px; font-size: .8rem; }
  .felt { border-radius: 14px; }
  .toolbar { flex-wrap: wrap; padding: 8px; min-height: 0; gap: 8px; }
  .play-controls { gap: 4px; flex: 1 0 100%; }
  .play-controls .button { font-size: .83rem; padding-inline: 8px; min-height: 37px; flex: 1; }
  .play-controls .button.primary { flex: 1.35; }
  .play-controls .button svg { width: 15px; height: 15px; }
  .scoreboard { width: 100%; }
  .scoreboard div { padding-block: 2px; display: flex; align-items: baseline; justify-content: center; gap: 5px; flex: 1; }
  .scoreboard strong { font-size: .9rem; margin-top: 0; }
  .scoreboard span { font-size: .73rem; }
  .playfield { padding: 16px 8px 11px; }
  .board { min-height: clamp(243px, 67cqw, 326px); --face-step: calc(var(--card) * .36); --hidden-step: calc(var(--card) * .2); }
  .table-notice { min-height: 42px; padding: 6px 10px; font-size: .78rem; }
  .below-table { padding-inline: 3px; padding-top: 8px; font-size: .79rem; }
  .deal-details { gap: 10px; }
  .text-button { font-size: .8rem; }
  .shortcuts { display: none; }
  .more-games { margin: 21px 2px 0; }
  .game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-tile { min-height: 63px; }
  .tile-art { flex-basis: 37px; height: 38px; }
  .game-tile strong { font-size: .83rem; }
  .game-tile small { font-size: .74rem; }
  .how-to { margin-inline: 3px; padding-top: 16px; }
  .how-to li { font-size: .94rem; }
  .dialog-top h2 { font-size: 1.65rem; }
  dialog { padding: 15px; }
  .library-tools { grid-template-columns: minmax(0, 1fr) minmax(92px, 118px); }
}
@media (max-width: 360px) {
  .header-inner { padding-inline: 6px; }
  .brand { font-size: 1rem; }
  .nav-link { padding-inline: 4px; }
  .header-tools .icon-button { width: 29px; }
  .play-controls .button { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.board-top { align-items: start; }
.board.versus {
  width: 100%; min-width: 0; max-width: 910px;
  --card: clamp(40px, 8.9cqw, 86px);
}
.seats { display: flex; justify-content: center; gap: clamp(5px, 1.5cqw, 15px); flex-wrap: wrap; }
.seat {
  display: grid; padding: 6px 12px; min-width: 90px; border-radius: 8px; text-align: center;
  border: 1px solid var(--felt-border); background: #041d2439; font-size: .88rem;
}
.seat.turn { border-color: #f4c781; color: #ffe1aa; }
.seat small { color: var(--felt-subtle); font-size: .8rem; }
.team-scores { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px 15px; margin-top: 15px; }
.team-value { font-size: .83rem; color: var(--felt-subtle); }
.team-value b { color: var(--felt-text); margin-left: 2px; }
.team-value.trump { color: var(--accent); }
.vs-center, .draw-area { display: flex; justify-content: center; gap: clamp(8px, 2.5cqw, 26px); padding-block: 18px; }
.trick-place.took > .card { outline: 2px solid var(--accent); outline-offset: 3px; }
.seat-caption { display: block; margin-top: 4px; color: var(--felt-subtle); text-align: center; line-height: 1.2; font-size: .77rem; }
.player-hand-label { text-align: center; margin: 12px 0 6px; color: var(--felt-subtle); font-size: .9rem; }
.player-hand {
  display: flex; justify-content: center; min-height: var(--card-h); padding: 7px 2px 5px;
  --hand-step: min(calc(var(--card) * .82), calc((100cqw - var(--card) - 8px) / max(1, var(--hand-size) - 1)));
}
.player-hand .card, .player-hand > div { flex: 0 0 var(--card); }
.player-hand > .card + .card, .player-hand > div + div { margin-left: calc(var(--hand-step) - var(--card)); }
.player-hand .card.is-selected { translate: 0 -8px; }
.versus .vs-controls { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-items: center; }
.versus .vs-controls button { min-height: 36px; }
.versus .decisions { align-items: center; text-align: center; max-width: 650px; margin-inline: auto; }
.versus .decisions h3 { font-size: 1rem; margin-bottom: 5px; }
.alone-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 7px; font-size: .87rem; }
.alone-toggle input { accent-color: var(--accent); }
.trash-row { margin-top: 4px; }
.table-actions { margin-block: 7px 2px; }
.seven-table { max-width: 720px; display: grid; gap: 5px; margin: 20px auto 14px; }
.seven-line { display: grid; grid-template-columns: 1em repeat(13, minmax(0, 1fr)); gap: clamp(2px, .8cqw, 7px); align-items: center; }
.seven-pip { color: var(--felt-text); }
.seven-rank {
  display: grid; place-items: center; min-height: clamp(22px, 4.5cqw, 34px); border-radius: 4px; border: 1px solid var(--felt-border);
  color: #f8f7e8a0; background: #0d191b28; font: bold clamp(.7rem, 2.25cqw, 1rem)/1 var(--serif);
}
.seven-rank.anchor { border-color: #f4c781aa; }
.seven-rank.used { color: #192833; background: #f7e5bf; border-color: transparent; }
.seven-line.red .seven-rank.used { color: #a63347; }
.copy-fallback { width: 100%; padding: 12px; color: var(--text); background: var(--base); border: 1px solid var(--line); border-radius: 8px; }
.special-control.is-hint { outline: 2px solid var(--accent); }
@media (max-width: 575px) {
  .seat { flex: 1; min-width: 65px; padding: 6px 4px; font-size: .84rem; }
  .seat small { font-size: .71rem; }
  .vs-center, .draw-area { padding-block: 12px; }
  .player-hand-label { margin-top: 8px; }
}

.header-inner { grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 64px; }
.game-heading { align-items: center; justify-content: flex-start; margin: 0; gap: 16px; }
.game-heading h1 { font-size: clamp(1.15rem, 2.1vw, 1.7rem); line-height: 1.08; letter-spacing: -.028em; }
.game-heading > div { padding-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.focus-toggle, .mobile-shortcut { display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: transparent; font-size: .8rem; }
.focus-toggle[aria-pressed="true"], .focus-toggle:hover, .mobile-shortcut:hover { color: var(--accent); border-color: var(--accent); }
.mobile-shortcut { display: none; }
.page-wrap { padding-top: 14px; }
.focus-mode .page-wrap { grid-template-columns: 1fr; }
.focus-mode .sidebar { display: none; }
.toolbar { flex-wrap: wrap; justify-content: flex-start; min-height: 57px; gap: 8px 14px; padding-block: 8px; }
.toolbar .variants { padding: 2px; background: #12372e; border-color: var(--felt-border); }
.toolbar .variants a { min-width: 54px; height: 32px; padding-inline: 9px; }
.toolbar .scoreboard { margin-left: auto; }
#undo:not(:disabled), #hint:not(:disabled) { color: #fff5dd; border-color: #f1d6a266; background: #284c3f; box-shadow: inset 0 1px 0 #ffffff12, 0 2px 3px #061d1842; }
#undo:hover:not(:disabled), #hint:hover:not(:disabled) { background: #385d4f; }
#new-deal { border-color: transparent; background: transparent; }
#new-deal:hover { border-color: var(--felt-border); }
.felt { position: relative; isolation: isolate; }
.felt::before { content: ''; pointer-events: none; position: absolute; inset: 0; z-index: -1; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h160v160H0z'/%3E%3C/svg%3E"); }
.board:not(.versus) { touch-action: pan-x pan-y; --face-step: clamp(24px, calc(var(--card) * .32), 28px); --hidden-step: clamp(8px, calc(var(--card) * .105), 10px); }
.board:not(.versus) .card[data-location]:not(:disabled):not([data-board-action]) { touch-action: none; }
.pile-col > .card:not(.back) { box-shadow: 0 2px 6px #00000047, inset 0 -1px 0 #dbd3c1; }
.pile-col > .card:last-child:not(.back) { box-shadow: 0 3px 8px #07171155, inset 0 -1px 0 #dbd3c1; }
.card-corner { font-size: clamp(12px, calc(var(--card) * .205), 24px); }
.felt[data-large="true"] .card-corner { font-size: clamp(16px, calc(var(--card) * .26), 30px); gap: 1px; }
.felt[data-large="true"] .board:not(.versus) { --face-step: clamp(25px, calc(var(--card) * .38), 36px); }
#auto-complete { border-radius: 20px; min-height: 36px; }
@media (prefers-reduced-motion: no-preference) {
  #auto-complete:not([hidden]) { animation: show-finish .23s ease-out; }
  @keyframes show-finish { from { transform: translateY(4px); opacity: 0; } }
}
@media (min-width: 831px) and (max-width: 1090px) { .focus-toggle span:last-child { display: none; } }
@media (max-width: 830px) {
  .focus-toggle { display: none; }
  .mobile-shortcut { display: inline-flex; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12rem; }
  .header-inner { grid-template-columns: 1fr auto auto; gap: 0 6px; }
  .header-inner .game-heading { grid-column: 1/-1; grid-row: 2; justify-content: space-between; flex-wrap: nowrap; padding: 3px 0 8px; gap: 6px; }
  .game-heading > div { border: 0; padding: 0; }
  .game-heading h1 { font-size: 1.3rem; }
  .header-inner > .brand, .header-inner > nav, .header-inner > .header-tools { grid-row: 1; min-height: 46px; }
  .page-wrap { padding-top: 8px; }
}
@media (max-width: 575px) {
  .toolbar { padding: 6px 8px; gap: 5px 6px; }
  .toolbar .variants a { min-width: 44px; padding-inline: 5px; height: 29px; }
  .toolbar .scoreboard { width: auto; flex: 1; }
  .toolbar .scoreboard div { min-width: 0; padding-inline: 4px; }
  .board[data-compact="true"]:not(.versus) { --card: clamp(43px, calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols)), 92px); }
  .felt[data-large="true"] .board:not(.versus) { --card: clamp(48px, calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols)), 95px); }
  .card-corner { gap: 1px; }
}

.toolbar button, .toolbar a { touch-action: manipulation; }

.board-scroll-tip {
  padding: 7px 14px 0;
  text-align: center;
  color: var(--felt-subtle);
  font-size: .83rem;
}
.board:not(.versus) { touch-action: manipulation; }
.board:not(.versus) .card[data-location]:not(:disabled):not([data-board-action]) {
  touch-action: pinch-zoom;
}
.playfield[data-wide="true"] .board:not(.versus) .card[data-location]:not(:disabled):not([data-board-action]) {
  touch-action: pan-x pinch-zoom;
}
.felt[data-left-handed="true"] .board[data-has-stock="true"]:not(.versus) .board-top .top-pile[style] {
  grid-column: calc(var(--cols) - var(--pile-column) + 1);
}
.felt[data-left-handed="true"] .board[data-has-stock="true"]:not(.versus) .top-pile .fan-card {
  transform: translateX(calc(var(--fan, 0) * var(--card) * -.18));
}
.card.is-target, .slot.is-target {
  outline: 2px dashed #f7dc9f;
  outline-offset: 1px;
}
.card:focus-visible, .slot:focus-visible {
  outline: 3px solid #ffe7ae;
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .card.is-selected { outline: 3px solid Highlight; }
  .card.is-target, .slot.is-target { outline-color: Highlight; }
  .card:focus-visible, .slot:focus-visible { outline-color: CanvasText; }
}
#open-shortcuts { text-align: right; min-height: 36px; }
@media (max-width: 575px) {
  .board[data-compact="true"]:not(.versus) {
    --card: clamp(46px, calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols)), 92px);
  }
  .play-controls .button { min-height: 42px; }
  .toolbar .variants a { min-height: 34px; }
}

.shortcut-list { margin: 0 0 14px; }
.shortcut-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shortcut-list dt { color: var(--accent); font-weight: 650; }
.shortcut-list dd { margin: 0; text-align: right; }

@media (max-width: 420px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 3px; }
  .brand { min-width: 0; max-width: 100%; }
  .brand > span:last-child { white-space: normal; }
  .header-inner .game-heading { min-width: 0; }
  .game-heading > div { min-width: 0; }
  .mobile-shortcut { flex-shrink: 0; max-width: 42vw; }
  .mobile-shortcut:not([hidden]) { display: block; }
  .deal-details { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
}

#open-daily { color: #f4d599; background: #f0be6910; border-color: #e4bb7240; }
#open-daily:hover { background: #f0be6921; border-color: #e4bb7270; }
@media (max-width: 360px) {
  .header-inner .brand { font-size: .95rem; gap: 4px; }
  .header-inner .brand-mark { width: 23px; }
  .header-inner .nav-link { padding-inline: 4px; font-size: .72rem; }
}

/* One compact row above the cards, with primary actions directly below play. */
.header-inner:not(.directory-header) { grid-template-columns: auto minmax(0, 1fr) auto; }
.brand { min-height: 44px; align-items: center; }
.brand .wordmark { display: block; width: clamp(142px, 15vw, 184px); height: auto; }
.header-inner nav .nav-link, .focus-toggle { min-height: 44px; min-width: 44px; }
#more { font: inherit; font-size: .875rem; font-weight: 640; gap: 6px; border-color: var(--line); }
#more > span { font-weight: 400; font-size: 1rem; }
.toolbar { padding: 6px clamp(10px, 2vw, 26px); }
.toolbar .variants { max-width: 100%; overflow-x: auto; }
.toolbar .variants a { min-width: 48px; min-height: 44px; }
.toolbar .scoreboard { flex: 0 1 auto; }
.play-controls { justify-content: center; gap: 8px; padding: 7px 12px 12px; }
.play-controls .button { min-height: 44px; min-width: 44px; flex: 0 1 136px; }
#new-deal { color: #221e14; background: var(--accent); border-color: #f6dba5; }
#new-deal:hover { background: #ffe2a9; }
.below-table { flex-wrap: wrap; gap: 4px 16px; }
/* Keep the compact header entry when the sidebar is unavailable. */
@media (min-width: 831px) {
  body:not(.focus-mode) #open-daily { display: none; }
}
.felt[data-playing] #new-deal {
  color: var(--felt-text);
  background: #09201c25;
  border-color: var(--felt-border);
}
.felt[data-playing] #new-deal:hover { background: #385d4f; }
.spider-progress {
  padding: 9px clamp(10px, 2vw, 26px) 0;
  color: var(--felt-subtle);
  font-size: .83rem;
}
.spider-progress strong { font-variant-numeric: tabular-nums; }
.board[data-game^="spider-solitaire"] .board-top .slot:disabled {
  border-color: #e6fae73b;
  color: #e6fae74d;
}
@media (min-width: 831px) {
  .spider-progress:not([hidden]) ~ .playfield { padding-block: 15px 10px; }
  .board[data-game^="spider-solitaire"] { min-height: clamp(306px, 35cqw, 388px); }
}
.focus-mode :is(.more-games, .how-to, #strategy-content, .site-footer) { display: none; }
.focus-mode .focus-toggle { display: inline-flex; }
.more-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.more-links + .more-links { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.more-links > * { display: flex; align-items: center; text-align: left; padding: 9px 12px; min-height: 44px; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: .94rem; }
.more-links > :hover { border-color: var(--accent); }
dialog { max-height: min(86dvh, 820px); overscroll-behavior: contain; }
dialog button { min-height: 44px; }
.dialog-actions [data-preferred] { border-color: #be9c63; }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-actions > button { min-height: 44px; }
.board:not(.versus) .card[data-location]:not(:disabled):not([data-board-action]) { touch-action: pan-y pinch-zoom; }
.playfield[data-wide="true"] .board:not(.versus) .card[data-location]:not(:disabled):not([data-board-action]) { touch-action: pan-x pan-y pinch-zoom; }
.board:not(.versus) .card.is-selected[data-location]:not(:disabled):not([data-board-action]) { touch-action: pinch-zoom; }
.card.is-hint, .slot.is-hint { outline: 3px dotted #8ff1ea; outline-offset: 1px; }
.card.is-target, .slot.is-target { outline: 2px dashed #ffde99; outline-offset: 0; }
.card:focus-visible, .slot:focus-visible { outline: 3px double white; outline-offset: 1px; }
:where(.card,.slot).move-snap { animation: card-settle 150ms ease-out; }
@keyframes card-settle { from { translate: 0 -5px; filter: brightness(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .move-snap, .is-hint { animation: none !important; }
}
@media (max-width: 830px) {
  .header-inner:not(.directory-header) { grid-template-columns: minmax(0,1fr) auto; gap: 0 6px; min-height: 0; }
  .header-inner .game-heading { grid-row: 2; padding: 0 0 6px; margin: 0; min-height: 28px; }
  .header-inner .game-heading h1 { font-size: 1.3rem; }
  .header-inner .focus-toggle[aria-pressed="true"] { padding: 0 8px; }
  .header-inner > nav, .header-inner > .brand { min-height: 44px; }
  .page-wrap { padding-top: 5px; }
  .playfield { padding-top: 12px; }
}
@media (max-width: 575px) {
  .header-inner { padding-inline: 10px; }
  .header-inner .brand .wordmark { width: clamp(124px, 38vw, 157px); }
  .header-inner .nav-link { min-width: 44px; min-height: 44px; font-size: .82rem; padding-inline: 6px; }
  .header-inner .game-heading { padding: 0 0 4px; }
  .page-wrap { padding-inline: 6px; }
  .toolbar { gap: 3px 5px; padding: 3px 6px; min-height: 52px; }
  .toolbar .variants a { min-width: 44px; min-height: 44px; }
  .toolbar .scoreboard div { flex-direction: column; gap: 0; align-items: center; padding-inline: 6px; }
  .toolbar .scoreboard span { font-size: .75rem; }
  .toolbar .scoreboard strong { font-size: .94rem; }
  .playfield { padding: 11px 5px 7px; }
  .board { --gap: clamp(3px, 1cqw, 5px); }
  .play-controls { padding: 8px 8px 10px; gap: 6px; }
  .play-controls .button { flex: 1; min-height: 44px; }
  .table-notice { min-height: 36px; }
}
@media (max-width: 359px) {
  #open-games { display: none; }
  .toolbar .scoreboard div { padding-inline: 4px; }
}

.site-footer { display: grid; gap: 8px; }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.trust-content { max-width: 52rem; line-height: 1.6; overflow-wrap: anywhere; }
.trust-content h2 { margin: 1.5rem 0 .35rem; }
.trust-content p { margin: .75rem 0; }
.trust-content a { text-decoration: underline; }

dialog[data-view="calendar"] { width: min(calc(100% - 28px), 480px); }
.challenge-modes { display: flex; gap: 7px; margin-bottom: 12px; }
.challenge-modes button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.challenge-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.challenge-stats > div { padding: 7px 4px; }
.challenge-stats span { font-size: .84rem; }
.challenge-month { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 16px 0 8px; }
.challenge-month h3 { font-size: 1.08rem; margin: 0; text-align: center; }
.challenge-month button { min-height: 40px; padding: 5px 8px; justify-self: start; }
.challenge-month button:last-child { justify-self: end; }
.challenge-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.challenge-weekday { color: var(--muted); text-align: center; font-size: .79rem; }
.challenge-day {
  display: flex; justify-content: center; align-items: center; gap: 2px; min-height: 36px; min-width: 0;
  border: 1px solid transparent; border-radius: 7px; text-align: center; font-size: .9rem;
}
span.challenge-day { color: var(--muted); opacity: .65; }
a.challenge-day { color: var(--text); border-color: var(--line); background: var(--raised); }
a.challenge-day:hover, a.challenge-day.is-active { border-color: var(--accent); }
a.challenge-day[aria-current="date"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 -2px var(--accent); }
a.challenge-day.is-complete { background: #223c32; color: #c7eed7; }
.challenge-day span { font-size: .7rem; }
.challenge-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 9px 0; color: var(--muted); font-size: .86rem; }
.challenge-footer strong { color: #c7eed7; }
.challenge-footer a { min-height: 36px; }
.challenge-achievements { border-top: 1px solid var(--line); padding-top: 9px; }
.challenge-achievements summary { cursor: pointer; padding-block: 4px; }
.challenge-achievements ul { list-style: none; padding-left: 0; }
.challenge-achievements li { display: flex; justify-content: space-between; gap: .7rem; padding-block: 4px; font-size: .88rem; }
.challenge-achievements li strong { color: var(--accent); }
.copy-fallback.result-copy { resize: vertical; min-height: 7rem; }

.strategy {
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.strategy ul {
  margin: 12px 0 0;
  padding-left: 24px;
  max-width: 75ch;
  color: #c1ccc7;
}
.strategy li {
  padding: 5px 0 5px 5px;
}
.strategy strong {
  color: var(--text);
}
.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
}
.guide-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}
.directory-shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 35px 0 45px;
}
.directory-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.directory-shell h1 {
  margin-bottom: 8px;
  font: normal clamp(2rem, 5vw, 3rem)/1.15 var(--serif);
}
.directory-shell p {
  color: var(--muted);
}
.directory-family {
  margin-top: 29px;
}
.directory-family .game-cards {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.directory-family .game-tile {
  min-height: 100%;
}
.directory-shell .library-tools {
  margin-top: 18px;
}
.directory-shell .search-wrap input {
  padding-inline-start: 12px;
}

.game-guide {
  max-width: 72ch;
  color: #c1ccc7;
  overflow-wrap: break-word;
}
.game-guide section + section {
  margin-top: 26px;
}
.game-guide :is(h2, h3) {
  color: var(--text);
}
.game-guide h3 {
  margin-top: 14px;
  font-size: 1rem;
}
.game-guide p {
  margin: 8px 0 0;
  line-height: 1.6;
}
.game-guide ul {
  margin: 8px 0 0;
  padding-inline-start: 24px;
}
.game-guide li {
  line-height: 1.55;
}
:is(.game-guide, #guide-entry) a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}

.game-heading #classic-subtitle {
  margin-top: 2px;
  font-size: .75rem;
  line-height: 1.15;
}
.game-guide > h3 {
  margin-top: 20px;
}

.win-cascade {
  position: fixed;
  z-index: 8;
  pointer-events: none;
}

.not-found {
  padding: clamp(18px, 4vw, 44px);
}
.not-found p {
  color: var(--felt-text);
}
.not-found > .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: 18px 26px;
}
.not-found .game-tile {
  min-height: 60px;
}

/* Solitaire Tango's locally drawn presswork deck. */
:root {
  --card-paper: #fffaf0;
  --card-shade: #f5edda;
  --card-edge: #c7bea6;
  --card-ink: #182c31;
  --card-red: #a52c3e;
  --deck-gold: #e9cc95;
}

.felt {
  --felt-edge: #3d6958;
  --felt-dark: #12392e;
  --felt-fade: #184a39;
  --felt-light: #235943;
  background: radial-gradient(ellipse at 47% 22%, var(--felt-light), var(--felt-fade) 67%, var(--felt-dark));
}
.felt::before { content: none; }

.card {
  background: linear-gradient(150deg, var(--card-paper) 45%, var(--card-shade));
  color: var(--card-ink);
  border-color: var(--card-edge);
}
.card.red { color: var(--card-red); }
.card-corner {
  top: 3%;
  left: 5%;
  gap: .08em;
  font: 700 clamp(.75rem, calc(var(--card) * .295), 1.5rem)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.045em;
}
.card-corner.bottom { inset: auto 5% 3% auto; }
.card-corner em { font: normal .94em/1 var(--serif); }
.card-corner b { font-weight: 700; }
.felt[data-large="true"] .card-corner { font-size: clamp(1rem, calc(var(--card) * .35), 2rem); }
.board:not(.versus) {
  /* Leave a full line of ink showing on each exposed face. */
  --face-step: clamp(24px, calc(var(--card) * .36), 34px);
}
.felt[data-large="true"] .board:not(.versus) { --face-step: clamp(25px, calc(var(--card) * .46), 44px); }

.card-center.pips { inset: 28% 21%; font-size: calc(var(--card) * .192); }
.card-center.royal { inset: 20% 10%; border: none; outline: none; background: none; }
.card-center.royal svg { width: 100%; height: 100%; }
.card-center.large { font-size: calc(var(--card) * .62); }
.card.back {
  background: var(--back, #294855);
  border-color: #e5d3ae;
  box-shadow: inset 0 0 0 1px #f4e4c3, 0 2px 4px #071b1680;
}
.back-pattern {
  background: center / 100% 100% no-repeat url('/cards/back.svg');
  border: none;
  border-radius: 0;
  width: 94%;
  height: 95%;
}
.back-pattern::after { content: none; }
.stock-label { background: #182e30; color: #fff8e8; border: 1px solid #a89c73; }

/* Keep rank and suit visible in a horizontal fan, including its mirrored layout. */
.top-pile:has(.fan-card) > .card:not(:last-of-type) .card-corner:not(.bottom),
.player-hand > .card:not(:last-of-type) .card-corner:not(.bottom) {
  grid-template-columns: auto;
  justify-items: center;
  gap: 0;
}
.top-pile .fan-card { transform: translateX(calc(var(--fan) * var(--card) * .42)); }
.felt[data-left-handed="true"] .board[data-has-stock="true"]:not(.versus) .top-pile .fan-card {
  transform: translateX(calc(var(--fan) * var(--card) * -.42));
}
.felt[data-left-handed="true"] .top-pile:has(.fan-card) > .card:not(:last-of-type) .card-corner:not(.bottom) {
  left: auto;
  right: 5%;
}
.card:disabled { opacity: 1; }
@media (min-width: 375px) {
  .card-corner { font-size: clamp(.875rem, calc(var(--card) * .295), 1.5rem); }
}
/* Reversed explicit columns still belong to the same stock/foundation row. */
.felt[data-left-handed="true"] .board[data-has-stock="true"]:not(.versus) .board-top .top-pile[style] {
  grid-row: 1;
}
