/* Solitaire collection - shared styles first, then one section per variant.
   Variant rules are scoped with body.variant-<id> so layouts never collide. */

:root {
  color-scheme: light;
  --ink: #173f49;
  --muted: #52747a;
  --sea-deep: #287580;
  --coral: #b64f50;
  --gold: #f1c978;
  --glass: rgba(255, 253, 247, .88);
  --shadow: rgba(34, 80, 87, .22);
  --column: 900px;
  /* Card size follows the smaller of screen width and screen height,
     so cards never outgrow the board on wide-but-short laptop screens. */
  --card-width: clamp(78px, min(7vw, 11vh), 105px);
  --card-height: calc(var(--card-width) / .70);
  /* Plain starting color (matches the starter theme's felt) until the
     chosen theme is applied - avoids flashing another theme on load. */
  --theme-bg-color: #427F83;
  font-family: "Fraunces", Georgia, serif;
}

/* Fonts (bundled - the page's security settings block Google Fonts). Pazienza uses the serif Fraunces for
   everything (Jacqui, Nov 26, 2026 - farmhouse card table; moved off the studio fonts). Fredoka stays only
   for the shared sideways-phone screen (assets/shared/sideways.css, a studio file used unchanged). */
@font-face {
  font-family: "Fredoka";
  src: url("assets/fonts/fredoka-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
/* Read by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
html, body { min-width: 320px; margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--theme-bg-color);
  background-image: var(--theme-background);
  background-position: center;
  background-size: var(--theme-bg-size, cover);
  background-repeat: var(--theme-bg-repeat, no-repeat);
  background-attachment: fixed;
}
button { font: inherit; }
button:focus-visible { outline: 4px solid #f6b83f; outline-offset: 3px; }

.app {
  width: min(var(--column), 100%);
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topbar {
  min-height: 56px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 8px 22px var(--shadow);
}
h1 { margin: 0; font: 600 clamp(1.3rem, 2.4vw, 1.75rem)/1 "Fraunces", Georgia, serif; color: var(--sea-deep); }
/* Long game names shrink, then trim with "...", instead of sliding under the buttons. */
#title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.soft-button {
  min-height: 44px;
  min-width: 82px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid rgba(37,102,111,.30);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  font-weight: 800;
  cursor: pointer;
}
.soft-button:hover:not(:disabled) { background: #fff; }
.soft-button:disabled { opacity: .45; cursor: default; }

.game {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  background: rgba(255,253,247,.22);
}

/* Holds whatever board the current variant draws. */
.board { display: flex; flex-direction: column; gap: 8px; }

/* ===== Peak, Two Peaks, Tri Peaks (pyramid games); Golf shares the stock/pile/score row ===== */
/* Cards sit in straight, centered rows. peaks.js sets the card size from the
   board width and gives each card its place: --px (across, in card widths
   from the center) and --py (down, in card heights). */
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .tableau { position: relative; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .slot {
  position: absolute;
  left: calc(50% + var(--px) * var(--card-width));
  top: calc(var(--py) * var(--card-height));
  transform: translateX(-50%);
  transition: opacity .25s ease, transform .25s ease;
}
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .slot.cleared { opacity: 0; pointer-events: none; transform: translate(-50%, -8%) scale(.9); }

.card-shape, .game-card { width: var(--card-width); height: var(--card-height); border-radius: calc(var(--card-width) * .11); }
.game-card {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--ink);
  background: #fbfaf3 var(--theme-card-front) center / 100% 100%;
  box-shadow: 0 6px 14px rgba(38,72,77,.27);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card.red { color: var(--coral); }
.game-card.covered { background-image: var(--theme-card-back); background-color: transparent; cursor: default; }
/* Full-deck themes: the image is the whole card (its own rounded corners). */
.game-card.face-image { background-color: transparent; background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.game-card.playable:hover { transform: translateY(-5px); box-shadow: 0 10px 22px rgba(31,74,80,.35); }
.game-card.hinted { outline: 4px solid var(--gold); outline-offset: 1px; animation: hint .75s ease-in-out infinite alternate; }
@keyframes hint { to { transform: translateY(-6px); box-shadow: 0 0 22px rgba(246,190,71,.9); } }

.corner { position: absolute; left: 15%; top: 13%; display: grid; justify-items: center; font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: .85; text-shadow: 0 1px 0 #fff; }
.rank { font-size: calc(var(--card-width) * .27); }
.suit { font-size: calc(var(--card-width) * .2); }
.center-suit { position: absolute; left: 50%; top: 54%; transform: translate(-50%,-50%); font-size: calc(var(--card-width) * .5); opacity: .2; }

:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .play-row { display: flex; justify-content: center; align-items: flex-start; gap: clamp(18px, 5vw, 44px); }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .pile { display: grid; justify-items: center; gap: 4px; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid, .variant-klondike, .variant-spider) .pile-label { font-size: .8rem; font-weight: 800; color: #315d64; }
/* The stock count lives in the pile label ("Stock 33"), not on the card (Nov 21, 2026). */
.pile-label { white-space: nowrap; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .stock {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--theme-card-back) center / 100% 100%;
  box-shadow: 0 6px 14px rgba(38,72,77,.27);
  cursor: pointer;
}
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .stock:disabled { cursor: default; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .stock.empty { background: rgba(255,255,255,.35); border: 2px dashed rgba(40,117,128,.45); box-shadow: none; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .stock.hinted { outline: 4px solid var(--gold); outline-offset: 2px; }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .active-slot { width: var(--card-width); height: var(--card-height); }
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .active-slot .game-card { cursor: default; }

:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .score {
  min-width: 96px;
  padding: 8px 12px;
  display: grid;
  justify-items: center;
  align-self: center;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 15px;
  background: rgba(255,253,247,.88);
  box-shadow: 0 6px 15px rgba(42,83,88,.13);
}
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .score-label { font-size: .78rem; font-weight: 800; color: #4E6E72; } /* 4.7:1 on the score box */
:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .score strong { font-size: 1.5rem; line-height: 1.1; color: var(--sea-deep); }

.status { min-height: 1.3em; margin: 0; text-align: center; font-weight: 800; text-shadow: 0 1px 4px rgba(255,255,255,.95); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Dialog */
.dialog {
  width: min(460px, calc(100% - 24px));
  max-height: calc(100dvh - 36px);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 22px;
  color: var(--ink);
  background: #fdfbf3;
  box-shadow: 0 24px 60px rgba(18,47,52,.36);
}
.dialog::backdrop { background: rgba(23,63,73,.35); }
.dialog h2 { margin: 0 0 10px; font: 600 1.5rem/1.15 "Fraunces", Georgia, serif; }
.dialog p, .dialog li { line-height: 1.5; }
.dialog ul { padding-left: 1.2em; }
.dialog .actions { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dialog .primary { color: #fff; background: var(--sea-deep); border-color: var(--sea-deep); }
/* Keep the blue button blue on hover/tap (the general .soft-button hover rule turns buttons white). */
.dialog .primary:hover:not(:disabled) { color: #fff; background: #1f626b; border-color: #1f626b; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(40,117,128,.15); font-weight: 700; }
.setting input { width: 22px; height: 22px; accent-color: var(--sea-deep); }
.setting select { padding: 6px 8px; border: 1px solid rgba(40,117,128,.35); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; }

/* ===== Klondike, FreeCell, Golf (column games) ===== */
/* Equal columns (7 or 8). Card width comes from the screen width (7 cards
   across) but never gets taller than the screen allows. */
body.variant-klondike, body.variant-golf { --cols: 7; }
body.variant-freecell { --cols: 8; }
/* Spider has ten columns, so it uses a tighter gap to keep the cards as wide as possible. */
body.variant-spider { --cols: 10; }
body.variant-klondike, body.variant-freecell, body.variant-golf, body.variant-spider {
  --k-gap: clamp(4px, 1.2vw, 12px);
  --card-width: clamp(30px, min(calc((min(100vw, var(--column)) - 46px - (var(--cols) - 1) * var(--k-gap)) / var(--cols)), 13vh), 96px);
  /* Must be restated here: the :root version was worked out from the root's card width. */
  --card-height: calc(var(--card-width) / .70);
}
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-row,
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-tableau { display: grid; grid-template-columns: repeat(var(--cols), var(--card-width)); justify-content: center; column-gap: var(--k-gap); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-tableau { align-items: start; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-col { position: relative; height: 100%; min-height: var(--card-height); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-slot { position: absolute; left: 0; top: 0; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-stock { position: relative; padding: 0; border: 0; background: var(--theme-card-back) center / 100% 100%; box-shadow: 0 6px 14px rgba(38,72,77,.27); cursor: pointer; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-stock.empty { background: rgba(255,255,255,.35); border: 2px dashed rgba(40,117,128,.45); box-shadow: none; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-stock:disabled { cursor: default; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-stock.hinted { outline: 4px solid var(--gold); outline-offset: 2px; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider, .variant-pyramid) .k-recycle { font-size: calc(var(--card-width) * .45); font-weight: 900; color: var(--sea-deep); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-waste { position: relative; width: var(--card-width); height: var(--card-height); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-waste .game-card { position: absolute; top: 0; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-waste div.game-card { cursor: default; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) :is(.k-foundation, .k-cell) { width: var(--card-width); height: var(--card-height); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-empty { width: var(--card-width); height: var(--card-height); display: grid; place-items: center; border: 2px dashed rgba(40,117,128,.45); border-radius: calc(var(--card-width) * .11); background: rgba(255,255,255,.3); color: rgba(40,117,128,.55); font: 600 calc(var(--card-width) * .38)/1 "Fraunces", Georgia, serif; }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .k-foundation .game-card { cursor: default; }
/* Bigger corner rank/suit: these cards are small and mostly covered */
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .rank { font-size: calc(var(--card-width) * .33); }
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .suit { font-size: calc(var(--card-width) * .25); }
/* Small cards: keep the corner readable when columns overlap */
:is(.variant-klondike, .variant-freecell, .variant-golf, .variant-spider) .corner { left: 9%; top: 6%; }

/* Theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-choice { display: grid; gap: 6px; padding: 6px; color: var(--ink); border: 1px solid rgba(37,102,111,.25); border-radius: 14px; background: #fff; cursor: pointer; font-weight: 700; }
.theme-choice.current { border-color: var(--sea-deep); box-shadow: inset 0 0 0 2px var(--sea-deep); }
.theme-choice.locked { cursor: default; opacity: .6; }
.theme-preview { position: relative; height: 82px; border-radius: 10px; background: center / cover no-repeat; }
.theme-mini-back { position: absolute; left: 50%; top: 50%; width: 44px; height: 63px; transform: translate(-50%, -50%) rotate(-6deg); border-radius: 5px; background: #fbfaf3 center / 100% 100% no-repeat; box-shadow: 0 3px 8px rgba(38,72,77,.3); }
.theme-name { font-size: .9rem; }
.theme-mix { margin-top: 14px; }
.theme-mix summary { cursor: pointer; font-weight: 800; color: var(--sea-deep); padding: 6px 0; }
.theme-mix select { min-height: 36px; padding: 0 8px; border: 1px solid rgba(37,102,111,.35); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }

/* Pyramid: the card waiting for a partner, and empty Next/Waste spots */
/* Covered pyramid cards are dimmed so the usable ones stand out. */
.variant-pyramid .slot .game-card:not(.playable) { filter: brightness(.8) saturate(.8); cursor: default; }
.variant-pyramid .game-card.selected { outline: 4px solid #fffdf7; outline-offset: 1px; transform: translateY(-6px); box-shadow: 0 0 0 7px rgba(241,201,120,.55), 0 10px 22px rgba(31,74,80,.35); }
.variant-pyramid .stock { display: grid; place-items: center; }
.variant-pyramid .empty-slot { border: 2px dashed rgba(40,117,128,.45); border-radius: calc(var(--card-width) * .11); background: rgba(255,255,255,.2); }
body.theme-dark .variant-pyramid .empty-slot, body.theme-dark.variant-pyramid .empty-slot { border-color: rgba(247,239,219,.45); background: rgba(255,255,255,.06); }
.variant-pyramid .play-row { gap: clamp(10px, 3.5vw, 36px); }

/* Games menu */
.game-list { display: grid; gap: 8px; }
.game-choice { display: grid; gap: 2px; padding: 12px 14px; text-align: left; color: var(--ink); border: 1px solid rgba(37,102,111,.25); border-radius: 14px; background: #fff; cursor: pointer; }
.game-choice strong { font: 600 1.1rem/1.2 "Fraunces", Georgia, serif; color: var(--sea-deep); }
.game-choice span { font-size: .9rem; color: var(--muted); }
.game-choice.current { border-color: var(--sea-deep); box-shadow: inset 0 0 0 1px var(--sea-deep); }

/* Win celebration: the shared studio file assets/shared/celebrate.css (Nov 26). */

/* Win / loss message placed over the board by core.js placeDialog(). */
.dialog.over-board { position: fixed; margin: 0; inset: auto; }

/* Larger text setting */
body.large-text { font-size: 118%; }

/* Phones */
@media (max-width: 720px) {
  :root { --card-width: clamp(58px, 15.5vw, 74px); }
  .game { padding: 8px 6px 10px; }
  /* Fill the screen: the board stretches and the buttons sit at the bottom, near your thumb. */
  .app { min-height: 100vh; min-height: 100dvh; }
  .game { flex: 1 1 auto; }
  .board { flex: 1 1 auto; }
  /* Pyramid games: center the layout and stock in the tall board. */
  :is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-pyramid) .board { justify-content: center; gap: 22px; }
  /* Golf: columns and stock row centered together in the tall board. */
  .variant-golf .board { justify-content: center; gap: 18px; }
  .topbar .soft-button { min-width: 0; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation: none !important; transition: none !important; }

/* Smallest phones: keep the game name readable. Must stay last so it wins over the phone rules above. */
@media (max-width: 360px) {
  #title { font-size: 1rem; }
  .topbar { gap: 6px; padding-right: 8px; }
  .topbar .soft-button { padding: 0 9px; font-size: .9rem; }
}

/* Dark tables (felt themes): light text and outlines so labels stay readable. */
/* The board panel keeps a visible edge on dark tables, so it reads as a framed board sitting on the table. */
body.theme-dark .game { background: rgba(255,255,255,.06); border-color: rgba(247,239,219,.32); box-shadow: 0 10px 30px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.04); }
body.theme-dark .status { color: #f7efdb; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
body.theme-dark .pile-label { color: #f7efdb; }
body.theme-dark :is(.k-empty, .stock.empty, .k-stock.empty) { border-color: rgba(247,239,219,.5); background: rgba(255,255,255,.08); color: rgba(247,239,219,.6); }
body.theme-dark .k-recycle { color: #f7efdb; }

/* Felt tables (repeating tile): soft lamp-over-the-table lighting - a little
   lighter in the middle, gently darker toward the edges. Full-picture
   backgrounds (Ocean, future paid themes) are left as drawn. */
body.table-tile {
  background-image: radial-gradient(ellipse 85% 70% at 50% 42%, rgba(255,255,255,.13), rgba(255,255,255,0) 55%, rgba(0,0,0,.28) 100%), var(--theme-background);
  background-size: 100% 100%, var(--theme-bg-size, auto);
  background-repeat: no-repeat, var(--theme-bg-repeat, repeat);
  background-position: center, center;
  background-attachment: fixed, fixed;
}

/* Painted tables: on computers and other landscape screens, show the whole
   painting (its decorated frame included) and fill the leftover strips with
   the theme's background color. */
@media (orientation: landscape) {
  body.table-whole { background-size: contain; }
}

/* Portrait tables: on screens taller than they are wide (phones held
   upright), a theme with a tall painting (backgroundPortrait in themes.js)
   shows that instead of cutting the sides off its wide painting. Themes
   without one keep their wide painting. */
@media (orientation: portrait) {
  body.table-portrait { background-image: var(--theme-background-portrait); background-size: cover; background-repeat: no-repeat; }
}

/* Klondike and Spider: stock pile + label in the top row. Their cards are narrow, so the label starts at the
   pile's left edge and runs into the empty space to its right instead of off the board. */
:is(.variant-klondike, .variant-spider) .k-pile { display: grid; justify-items: start; align-content: start; gap: 4px; }
:is(.variant-klondike, .variant-spider) .k-row { align-items: start; }

/* Spider: ten columns need a tighter gap (placed last so it wins over the shared column-game gap). */
body.variant-spider { --k-gap: clamp(2px, .7vw, 10px); }

/* ----- Default theme (id "tumble-theory"; card typography from Nov 21, 2026) -----
   The card text rules below (serif ranks, bundled suits, ink and deep coral, hint, empty spots) still
   apply. The look itself is now the farmhouse card table at the end of this file (Nov 26) - the flat
   Nov 21 look was retired on Nov 22. Each rule is scoped to the piece it belongs to, so mixing pieces with
   other themes still works. Measured contrasts: see THEME-SPEC.md. */
/* The four card suits only (DejaVu Sans, cut down). Fredoka has no suit symbols, and each device's
   own fallback draws them at different sizes (hearts came out much bigger). This set matches. */
@font-face {
  font-family: "TT Suits";
  src: url("assets/fonts/suits-dejavu.woff2") format("woff2");
  unicode-range: U+2660-2667;
  font-display: block;
}
body[data-front="tumble-theory"] .game-card:not(.covered) {
  color: #0B3F47;
  background: #FFFDF8;
  box-shadow: inset 0 0 0 1.5px #075E6C, 0 3px 8px rgba(11,63,71,.22);
}
body[data-front="tumble-theory"] .game-card.red:not(.covered) { color: #B04A3B; }
body[data-front="tumble-theory"] .game-card .corner { left: 9%; top: 6%; line-height: .9; font-family: "Fraunces", Georgia, serif; font-weight: 700; text-shadow: none; }
body[data-front="tumble-theory"] .game-card .rank { font-size: calc(var(--card-width) * .36); }
body[data-front="tumble-theory"] .game-card :is(.suit, .center-suit) { font-family: "TT Suits", "Fraunces", serif; font-weight: 400; }
body[data-front="tumble-theory"] .game-card .suit { font-size: calc(var(--card-width) * .25); }
body[data-front="tumble-theory"] .game-card .center-suit { opacity: .14; }
body[data-front="tumble-theory"] .game-card.playable:not(.covered):hover { box-shadow: inset 0 0 0 1.5px #075E6C, 0 8px 16px rgba(11,63,71,.28); }
body[data-back="tumble-theory"] :is(.game-card.covered, .stock:not(.empty), .k-stock:not(.empty)) { box-shadow: 0 3px 8px rgba(11,63,71,.25); }
body[data-table="tumble-theory"] :is(.status, .pile-label, .k-recycle) { color: #FFFDF8; text-shadow: none; }
/* Empty spots (and Klondike / FreeCell's "A" foundation labels): 3.3:1 on the table. */
body[data-table="tumble-theory"] :is(.k-empty, .stock.empty, .k-stock.empty) { border-color: rgba(255,253,248,.9); color: rgba(255,253,248,.9); }
body[data-table="tumble-theory"] :is(.game-card, .stock, .k-stock).hinted {
  outline: 4px solid #F96B56; outline-offset: 0;
  box-shadow: inset 0 0 0 3px #0B3F47, 0 0 16px rgba(249,107,86,.55);
  animation-name: tt-hint;
}
@keyframes tt-hint { to { transform: translateY(-6px); box-shadow: inset 0 0 0 3px #0B3F47, 0 0 24px rgba(249,107,86,.8); } }

/* ----- Settings in the studio layout (same structure as Conforto), Nov 21, 2026 ----- */
.set-group { margin: 14px 0 0; text-align: left; }
.set-group h3 { margin: 0 0 6px 2px; font: 800 .72rem/1.2 "Fraunces", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; color: #4E6E72; }
.set-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 12px; margin: 0 0 6px; background: rgba(7,94,108,.06); border: 1px solid rgba(7,94,108,.2); border-radius: 12px; color: var(--ink); font: 700 1rem/1.25 "Fraunces", Georgia, serif; text-align: left; cursor: pointer; }
.set-row > span:first-child { flex: 1; }
.set-row select { padding: 6px 8px; border: 1px solid rgba(7,94,108,.35); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; min-height: 36px; }
.set-val { font-weight: 600; color: #4E6E72; font-size: .92rem; }
.set-chev { font-size: 1.4rem; line-height: 1; color: #4E6E72; }
.set-switch-row { cursor: default; }
.set-switch { position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px; border: 1px solid #6c8a8d; background: #d6dfdf; cursor: pointer; padding: 0; }
.set-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fffdf8; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s ease; }
.set-switch[aria-checked="true"] { background: #075E6C; border-color: #075E6C; }
.set-switch[aria-checked="true"] .set-knob { left: 25px; }
.set-row:focus-visible, .set-switch:focus-visible { outline: 3px solid #075E6C; outline-offset: 2px; }
.file-input { display: block; width: 100%; margin: 4px 0 8px; font: inherit; }
.note { min-height: 1.4em; margin: 4px 0 0; font-weight: 700; color: #0B3F47; }
@media (prefers-reduced-motion: reduce) { .set-knob { transition: none; } }
body.reduced-motion .set-knob { transition: none; }


/* Art URLs here carry ?v=<theme version> like the images core.js loads - bump it with themes.js "version"
   whenever these files change, or browsers keep the old art. */
/* Farmhouse card table (Nov 26, 2026 - Pazienza ART-SPEC.md), laid out like Jacqui's mockup: one wood
   frame around everything (header strip, felt, buttons), the header a cream strip on the wood, the felt an inset
   panel, the buttons on the wood below it. Cream page outside the frame. Style only - same elements and order. */
body[data-table="tumble-theory"] { background-color: #D8C2A2; background-image: none; } /* tan page (Jacqui, Nov 26: the cream was too light) */
body[data-table="tumble-theory"] .app {
  border: 20px solid transparent;
  border-image: url("assets/themes/card-table/frame.webp?v=8") 41 / 20px stretch;
  background: url("assets/themes/card-table/wood.webp?v=8") center top / 650px repeat;
  background-clip: padding-box;
  padding: 2px 6px 8px;
  margin-top: 8px;
  gap: 10px;
  filter: drop-shadow(0 10px 18px rgba(74,48,22,.28));
}
body[data-table="tumble-theory"] .topbar {
  /* The cream strip from Jacqui's board frame (colors sampled from her art), set into the wood. */
  border: 2px solid #8A4A1C; border-radius: 999px;
  background: #D8C2A2; /* same tan as the page (Jacqui, Nov 26) */
  box-shadow: inset 0 2px 4px rgba(110,60,20,.3), 0 1px 0 rgba(255,220,170,.35);
}
body[data-table="tumble-theory"] .game { position: relative; border: 0; background: none; box-shadow: none; border-radius: 0; padding: 12px 12px 0; }
/* The felt: covers the board and status, stops above the buttons. */
body[data-table="tumble-theory"] .game::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 calc(44px + 12px + 14px) 0;
  background: url("assets/themes/card-table/felt.webp?v=8") center / 400px repeat;
  border-radius: 18px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.45), inset 0 0 0 2px rgba(60,30,10,.55), 0 1px 0 rgba(255,220,170,.35);
}
body[data-table="tumble-theory"] .game { isolation: isolate; }
body[data-table="tumble-theory"] .controls {
  /* Bottom strip matching the header strip (Jacqui, Nov 26: symmetry). */
  margin-top: 12px; padding: 5px 10px; flex-wrap: nowrap;
  border: 2px solid #8A4A1C; border-radius: 999px;
  background: #D8C2A2; /* same tan as the page (Jacqui, Nov 26) */
  box-shadow: inset 0 2px 4px rgba(110,60,20,.3), 0 1px 0 rgba(255,220,170,.35);
}
body[data-table="tumble-theory"] .soft-button {
  border: 0; border-radius: 0; background: none;
  border-image: url("assets/themes/card-table/button.webp?v=8") 100 fill / 22px stretch;
  color: #0B3F47; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(60,30,10,.4));
}
body[data-table="tumble-theory"] .soft-button:hover:not(:disabled) { background: none; filter: drop-shadow(0 2px 3px rgba(60,30,10,.4)) brightness(1.03); }
body[data-table="tumble-theory"] .soft-button:active:not(:disabled) { transform: translateY(2px); filter: drop-shadow(0 1px 1px rgba(60,30,10,.4)); }
body[data-table="tumble-theory"] .soft-button:disabled { opacity: .6; }
body[data-table="tumble-theory"]:is(.variant-peak, .variant-twopeaks, .variant-tripeaks, .variant-golf, .variant-pyramid) .score {
  border: 0; border-radius: 0; background: none; box-shadow: none;
  border-image: url("assets/themes/card-table/panel.webp?v=8") 70 fill / 18px stretch;
  filter: drop-shadow(0 3px 5px rgba(40,30,15,.35));
}
body[data-front="tumble-theory"] .game-card:not(.covered) { background: #F9ECD3 var(--theme-card-front) center / 100% 100%; box-shadow: 0 3px 8px rgba(30,40,35,.35); }
body[data-front="tumble-theory"] .game-card.playable:not(.covered):hover { box-shadow: 0 8px 16px rgba(30,40,35,.4); }
body[data-back="tumble-theory"] .game-card.covered { background-color: transparent; }
@media (max-width: 720px) {
  body[data-table="tumble-theory"] .app { border-width: 8px; border-image-width: 8px; padding: 0 2px 4px; margin-top: 0; gap: 8px; }
  body[data-table="tumble-theory"] .game { padding: 8px 6px 0; }
  body[data-table="tumble-theory"] .game::before { border-radius: 12px; inset: 0 0 calc(44px + 8px + 14px) 0; }
  body[data-table="tumble-theory"] .controls { margin-top: 8px; }
}
/* Home link as a cream button like Games and Settings (Jacqui, Nov 26). */
body[data-table="tumble-theory"] .tts-home {
  background: none; border-radius: 0; box-shadow: none; min-height: 44px; padding: 4px 16px 4px 12px;
  border-image: url("assets/themes/card-table/button.webp?v=8") 100 fill / 22px stretch;
  color: #0B3F47; font: 800 15px/1.2 "Fraunces", Georgia, serif;
  filter: drop-shadow(0 2px 3px rgba(60,30,10,.4));
}
body[data-table="tumble-theory"] .tts-home:hover { background: none; filter: drop-shadow(0 2px 3px rgba(60,30,10,.4)) brightness(1.03); }
@media (max-width: 480px) { body[data-table="tumble-theory"] .tts-home { padding: 4px 10px; } }

/* Version line at the bottom of Settings (Nov 26). */
.settings-version { margin: 14px 0 0; text-align: center; font: 700 11px/1.2 "Fraunces", Georgia, serif; letter-spacing: .08em; color: #5A6B6E; }
