/* Kitchen Table — shared styles. Warm, cozy, high-contrast, large print. */
/* Colours are all variables, so a theme is just a different set of values.
   :root is the Kitchen theme (the default). The other themes are below, then High contrast, which wins over every theme.
   .sw-preview[data-theme] reuses the same sets for the little previews in Settings. */
:root, .sw-preview[data-theme="kitchen"] {
  --bg: #f7eedc;
  --bg-2: #efdfc2;
  --glow: rgba(255, 255, 255, 0.7);
  --ink: #2a1a0b;
  --ink-soft: #4b3420;
  --ink-faint: #75604a;
  --heading: #5c3a1a;
  --card: #fffaf0;
  --card-edge: #b98e5a;
  --wood: #8a5a2b;
  --wood-dark: #5c3a1a;
  --board-edge: #5c3a1a;
  --accent: #1f5e3b;
  --accent-dark: #133d26;
  --accent-ink: #ffffff;
  --focus: #1d4ed8;
  --soon: #e7dccb;
  --soon-ink: #5d4b38;
  --table: #a8723f;
  --table-2: #95622f;
  --felt: #1f6b45;
  --felt-2: #164f35;
  --paper: #fbf3df;
  --grid-bg: #ffffff;
  --found-ink: #5b4a38;
  --tile-face: #fffdf5;
  --tile-face-2: #f1e4c8;
  --tile-edge: #8f7448;
  --tile-side: #c9ab7a;
  --select: #ffe27a;
  --select-ring: #1e3a8a;
  --hint-ring: #15803d;
  --cal-bg: #fffdf8;
  --cal-edge: #d6c3a3;
  --cal-top: #b91c1c;
  --stamp: #b91c1c;
  --heart: #be123c;
  --field-bg: #ffffff;
  --err: #9a3412;
  --veil: rgba(30, 20, 10, 0.55);
  --art-line: #3a2a1c;
  --cloth-a: rgba(31, 94, 59, 0.55);
  --cloth-b: rgba(255, 250, 240, 0.9);
  --sh-tiles: #1f6b3a;
  --sh-cards: #b3261e;
  --sh-words: #1d4f9c;
  --sh-numbers: #94560a;
  --sh-brain: #6a3fa0;
  color-scheme: light;
}

/* Garden Porch: sage and cream */
html[data-theme="garden"], .sw-preview[data-theme="garden"] {
  --bg: #edf1e2;
  --bg-2: #dde5cc;
  --glow: rgba(255, 255, 255, 0.65);
  --ink: #1c2a1a;
  --ink-soft: #3a4b36;
  --ink-faint: #5d6e57;
  --heading: #2d4a27;
  --card: #fbfcf3;
  --card-edge: #93a883;
  --wood: #6b8a5a;
  --wood-dark: #35502c;
  --board-edge: #35502c;
  --accent: #2b6657;
  --accent-dark: #1c4439;
  --focus: #1d4ed8;
  --soon: #dfe4d0;
  --soon-ink: #4a5a44;
  --table: #86a173;
  --table-2: #77925f;
  --felt: #2f6b54;
  --felt-2: #245445;
  --paper: #f4f3df;
  --grid-bg: #fdfdf5;
  --found-ink: #55634d;
  --cal-bg: #fdfdf5;
  --cal-edge: #c3cfb0;
  --cal-top: #a8432f;
  --stamp: #a8432f;
  --heart: #b4234a;
  --veil: rgba(20, 30, 15, 0.55);
  --cloth-a: rgba(79, 125, 84, 0.55);
  --cloth-b: rgba(253, 253, 245, 0.9);
  --sh-tiles: #2a6a35;
  --sh-cards: #a8322a;
  --sh-words: #25589a;
  --sh-numbers: #8a5808;
  --sh-brain: #6b4a9a;
}

/* Seaside Cottage: soft blue and white */
html[data-theme="seaside"], .sw-preview[data-theme="seaside"] {
  --bg: #e9f2f8;
  --bg-2: #d3e4ee;
  --glow: rgba(255, 255, 255, 0.8);
  --ink: #12263a;
  --ink-soft: #35506a;
  --ink-faint: #55708a;
  --heading: #1b4a70;
  --card: #ffffff;
  --card-edge: #86adc6;
  --wood: #4a7ca0;
  --wood-dark: #1e4d72;
  --board-edge: #1e4d72;
  --accent: #1c5f8f;
  --accent-dark: #12405f;
  --focus: #c2410c;
  --soon: #dbe7ef;
  --soon-ink: #46617a;
  --table: #7aa3bf;
  --table-2: #6893b1;
  --felt: #2a6788;
  --felt-2: #1f5370;
  --paper: #f3f8fb;
  --grid-bg: #ffffff;
  --found-ink: #4a6279;
  --cal-bg: #ffffff;
  --cal-edge: #b7cfdf;
  --cal-top: #c2452f;
  --stamp: #c2452f;
  --heart: #c2185b;
  --veil: rgba(10, 25, 40, 0.55);
  --cloth-a: rgba(60, 120, 165, 0.55);
  --cloth-b: rgba(255, 255, 255, 0.9);
  --sh-tiles: #1d6b45;
  --sh-cards: #b5342c;
  --sh-words: #1c5ea8;
  --sh-numbers: #8a5600;
  --sh-brain: #6a42a0;
}

/* Evening: warm dark, never pure black. Tiles, cards and the letter grid stay light so they read the same. */
html[data-theme="evening"], .sw-preview[data-theme="evening"] {
  --bg: #231b15;
  --bg-2: #33281f;
  --glow: rgba(255, 190, 110, 0.07);
  --ink: #f6ecd9;
  --ink-soft: #d8c8ad;
  --ink-faint: #bfae93;
  --heading: #f0d3a0;
  --card: #30261e;
  --card-edge: #8b7357;
  --wood: #b89468;
  --wood-dark: #c9a773;
  --board-edge: #7d6140;
  --accent: #e2a94b;
  --accent-dark: #f2c775;
  --accent-ink: #1d1309;
  --focus: #8ccaff;
  --soon: #3a2f25;
  --soon-ink: #d0c0a6;
  --table: #4a3626;
  --table-2: #3d2c1f;
  --felt: #1b5239;
  --felt-2: #123b29;
  --paper: #2b221a;
  --grid-bg: #ece0c4;
  --found-ink: #cdbb9f;
  --tile-face: #f3e8cc;
  --tile-face-2: #e1d1ab;
  --select: #ffd966;
  --select-ring: #9fd0ff;
  --hint-ring: #5be28c;
  --cal-bg: #382c22;
  --cal-edge: #6f5a44;
  --cal-top: #c2493f;
  --stamp: #ff9585;
  --heart: #ff8aa3;
  --field-bg: #1a130e;
  --err: #ffb08a;
  --veil: rgba(0, 0, 0, 0.62);
  --art-line: #1c130b;
  --cloth-a: rgba(226, 169, 75, 0.5);
  --cloth-b: rgba(48, 38, 30, 0.95);
  --sh-tiles: #6fd08a;
  --sh-cards: #ff9585;
  --sh-words: #8fb8ff;
  --sh-numbers: #f2b94b;
  --sh-brain: #c6a2f5;
  color-scheme: dark;
}

/* Seasonal accent, layered on any theme (set by js/site.js from the month and the Settings switch) */
html[data-season="harvest"] { --cloth-a: rgba(196, 98, 16, 0.6); }
html[data-season="holiday"] { --cloth-a: rgba(185, 28, 28, 0.6); }

html { font-size: 18px; }
html[data-text="large"] { font-size: 21px; }
html[data-text="xl"] { font-size: 25px; }

/* High contrast always wins over a theme (the [data-theme] part makes it beat the theme sets above) */
html.high-contrast, html.high-contrast[data-theme] {
  --bg: #000000;
  --bg-2: #000000;
  --glow: transparent;
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --ink-faint: #cccccc;
  --heading: #ffffff;
  --card: #000000;
  --card-edge: #ffffff;
  --wood: #ffffff;
  --wood-dark: #ffffff;
  --board-edge: #ffffff;
  --accent: #ffd400;
  --accent-dark: #ffffff;
  --accent-ink: #000000;
  --focus: #00e5ff;
  --soon: #1a1a1a;
  --soon-ink: #ffffff;
  --table: #1c1c1c;
  --table-2: #1c1c1c;
  --felt: #000000;
  --felt-2: #000000;
  --paper: #000000;
  --grid-bg: #ffffff;
  --found-ink: #ffffff;
  --tile-face: #ffffff;
  --tile-face-2: #ffffff;
  --tile-edge: #000000;
  --tile-side: #777777;
  --select: #ffd400;
  --select-ring: #00e5ff;
  --hint-ring: #00ff66;
  --cal-bg: #000000;
  --cal-edge: #ffffff;
  --cal-top: #ffffff;
  --stamp: #ffd400;
  --heart: #ff6b8b;
  --field-bg: #000000;
  --err: #ffffff;
  --veil: rgba(0, 0, 0, 0.8);
  --art-line: #000000;
  --cloth-a: #ffffff;
  --cloth-b: #000000;
  --sh-tiles: #00ff66;
  --sh-cards: #ff8a8a;
  --sh-words: #7ab8ff;
  --sh-numbers: #ffd400;
  --sh-brain: #d9a6ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Taps act immediately: no double-tap zoom delay (pinch zoom still works). */
html, body, a, button, .modal, .modal-box { touch-action: manipulation; }

/* Hover is only a bonus for mouse users; nothing depends on it. */
@media (hover: hover) {
  .btn:hover { background: var(--bg-2); }
  .btn-primary:hover { background: var(--accent-dark); }
  html.high-contrast .btn-primary:hover { background: #fff; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Verdana, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* Buttons: big, bold, easy to hit */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 56px;
  padding: 0.35em 1em;
  font: inherit;
  font-size: max(20px, 1.1rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--wood-dark);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-dark); }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- Page shell (home, about, privacy) ---------- */
body.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, var(--glow), transparent 60%),
    var(--bg);
}
html.high-contrast body.site { background: var(--bg); }

/* A thin gingham tablecloth band across the top (its colour follows the theme and the season) */
.cloth {
  height: 12px;
  background:
    repeating-linear-gradient(90deg, var(--cloth-a) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(0deg, var(--cloth-a) 0 6px, var(--cloth-b) 6px 12px);
}
html.high-contrast .cloth { background: #fff; height: 4px; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.5rem;
}
.site-top .top-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--heading);
  text-decoration: none;
  min-height: 48px;
}
.wordmark svg { width: 2.5rem; height: 2.5rem; flex: none; }
.wordmark span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.tagline { margin: 0; font-size: 1.05rem; color: var(--ink-soft); }
.site-top .tagline { padding-left: 3rem; margin-top: -0.2rem; }
.hero { padding-bottom: 1.5rem; }

.section-title {
  margin: 2rem 0 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  color: var(--heading);
}

/* Continue card: one compact strip */
.continue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  padding: 0.55rem 1rem;
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--accent-dark);
  color: var(--ink);
  text-decoration: none;
}
.continue[hidden] { display: none; }
.continue .mini-row { display: flex; gap: 5px; }
.continue .mini-tile { width: 38px; height: 49px; border-radius: 7px; box-shadow: 2px 2px 0 var(--tile-side); }
.continue .mini-card {
  width: 36px;
  height: 50px;
  background: #fffdf8;
  border: 2px solid #4a3b2a;
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--tile-side);
  overflow: hidden;
}
.continue .mini-card svg { display: block; width: 100%; height: 100%; }
.continue .mini-letter {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  font: 800 25px / 1 Verdana, Arial, sans-serif;
  color: #1f1408;
  background: #ffe27a;
  border: 2px solid #4a3b2a;
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--tile-side);
}
.continue .mini-card .c0, .continue .mini-card .c3 { color: #17171b; }
.continue .mini-card .c1, .continue .mini-card .c2 { color: #c4161c; }
.continue-text { flex: 1 1 14rem; min-width: 0; }
.continue-text strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; line-height: 1.2; }
.continue-text span { font-size: 1.05rem; color: var(--ink-soft); }
.continue .btn { padding-left: 1.4em; padding-right: 1.4em; }

/* Cards (shared) */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.4rem;
  background: var(--card);
  border: 3px solid var(--card-edge);
  border-radius: 22px;
  box-shadow: 0 6px 0 var(--card-edge);
  color: var(--ink);
}
.mini-tile {
  width: 72px;
  height: 92px;
  background: linear-gradient(145deg, var(--tile-face), var(--tile-face-2));
  border: 2px solid var(--tile-edge);
  border-radius: 9px;
  box-shadow: 4px 4px 0 var(--tile-side);
}
.mini-tile svg { display: block; width: 100%; height: 100%; }
.badge {
  align-self: flex-start;
  padding: 0.15em 0.8em;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid currentColor;
  border-radius: 999px;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.continue:focus-visible { outline: 5px solid var(--focus); outline-offset: 4px; }

/* ---------- Today at the Table ---------- */
.home .site-top, .home main, .home .site-foot { position: relative; z-index: 1; }

/* Teacup steam */
.wordmark .steam { animation: steam 3.2s ease-in-out infinite; transform-box: fill-box; }
.wordmark .steam.s2 { animation-delay: -1.6s; }
@keyframes steam {
  0%, 100% { opacity: 0.25; transform: translateY(2px); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* The greeting: one compact line */
.today-hero { margin: 0.1rem 0 0.7rem; }
.greeting { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.55rem; margin: 0; font-size: 1.3rem; font-weight: 400; line-height: 1.4; color: var(--ink-soft); }
.greeting #greeting { font-weight: 700; color: var(--heading); }
.greeting .dot { color: var(--ink-faint); }
.greeting #today-date { font-weight: 700; color: var(--ink); }
.deco { display: none; width: 1.7rem; height: 1.7rem; }
html[data-season="harvest"] .deco-harvest, html[data-season="holiday"] .deco-holiday { display: inline-block; }
html.high-contrast .deco { display: none !important; }

/* Today's puzzles on the left; the little calendar and streak on the right */
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.today-card { border-color: var(--accent); box-shadow: 0 5px 0 var(--accent-dark); padding: 1rem 1.1rem; gap: 0.5rem; }
.today-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; line-height: 1.2; color: var(--heading); }
.daily-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.daily-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--card-edge);
  border-radius: 14px;
}
.daily-item .gc-art { flex: none; width: 5rem; height: 3.4rem; margin: 0; border-radius: 10px; }
.daily-text { flex: 1 1 9rem; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.daily-text strong { font-size: 1.2rem; line-height: 1.25; }
.daily-text span { color: var(--ink-soft); font-size: 1rem; }
.daily-item .btn { min-width: 6.5em; }
.done-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 56px;
  padding: 0 1rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 14px;
}
.done-check svg { width: 1.6em; height: 1.6em; }
.today-card .note { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

.today-side { display: grid; gap: 0.9rem; min-width: 0; }

/* Paper calendar: a compact month of square cells */
.calendar {
  --cell: calc((15rem - 1.6rem - 4px - 18px) / 7);   /* seven square cells fill the 15rem column */
  position: relative;
  padding: 1.15rem 0.8rem 0.7rem;
  background: var(--cal-bg);
  border: 2px solid var(--cal-edge);
  border-radius: 6px 6px 14px 14px;
  box-shadow: 0 2px 0 var(--cal-edge), 0 8px 14px rgba(40, 25, 5, 0.16);
  color: var(--ink);
}
html.high-contrast .calendar { box-shadow: none; }
.calendar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: var(--cal-top);
  border-radius: 4px 4px 0 0;
}
.cal-binding { position: absolute; top: -7px; left: 0; right: 0; display: flex; justify-content: space-around; }
.cal-binding span { width: 11px; height: 17px; border: 3px solid #6b7280; border-radius: 7px; background: var(--cal-bg); }
.calendar h2 { margin: 0.2rem 0 0; text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; line-height: 1.2; color: var(--heading); }
.cal-grid { display: grid; grid-template-columns: repeat(7, var(--cell)); gap: 3px; margin: 0.35rem 0 0; }
.cal-head { text-align: center; font-weight: 700; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.4; }
.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--cell);
  aspect-ratio: 1;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 8px;
}
.cal-day.blank { visibility: hidden; }
.cal-day.future { color: var(--ink-faint); }
.cal-day.today { outline: 3px solid var(--accent); outline-offset: -2px; }
.cal-day .stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  margin: -50% 0 0 -50%;
  color: var(--stamp);
  opacity: 0.9;
  pointer-events: none;
}
.cal-day .stamp svg { width: 100%; height: 100%; }
.cal-day .stamp .tick { stroke: var(--cal-bg); }

.streak-card { padding: 0.7rem 0.9rem; gap: 0; }
.streak { display: flex; align-items: center; gap: 0.7rem; }
.streak-num {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
}
.streak-text { display: flex; flex-direction: column; line-height: 1.3; }
.streak-text strong { font-size: 1.15rem; }
.streak-text span { font-size: 0.9rem; color: var(--ink-soft); }

/* Game pictures: one flat, bold style, on a panel tinted with the shelf colour */
.gc-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 6.2rem;
  margin: 0 0 0.35rem;
  overflow: hidden;
  background: var(--sh, var(--card-edge));
  border-radius: 14px;
  isolation: isolate;
}
.gc-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--card); opacity: 0.8; }
.gc-art .art { height: 100%; width: auto; max-width: 100%; }
.art .o { stroke: var(--art-line); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.art .o2 { stroke-width: 2; }
.art .dash { stroke-dasharray: 4 4; }
.art .l { fill: none; stroke: var(--art-line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art .leg { stroke-width: 3.6; }
.art .steam { stroke: #fffbee; stroke-width: 2.6; opacity: 0.9; }
html.high-contrast .gc-art::before { opacity: 1; }
html.high-contrast .art .o, html.high-contrast .art .l { stroke: #000; }

/* Shelves: each has its own colour for the heading and its cards */
.shelf-tiles { --sh: var(--sh-tiles); }
.shelf-cards { --sh: var(--sh-cards); }
.shelf-words { --sh: var(--sh-words); }
.shelf-numbers { --sh: var(--sh-numbers); }
.shelf-brain { --sh: var(--sh-brain); }
.shelf .section-title { padding-left: 0.6rem; border-left: 0.5rem solid var(--sh); color: var(--sh); }

/* Game cards on shelves and favorites */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; }
.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem 1rem;
  background: var(--card);
  border: 3px solid var(--sh, var(--card-edge));
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--sh, var(--card-edge));
}
.game-card h3 { margin: 0.2rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; line-height: 1.2; }
.game-card p { margin: 0; flex: 1; font-size: 1.1rem; color: var(--ink-soft); }
.game-card.soon { background: var(--soon); border-style: dashed; box-shadow: none; }
.game-card.soon h3 { color: var(--soon-ink); }
.game-card.soon .gc-art::before { background: var(--soon); }
.gc-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.5rem; }
.gc-actions .btn-primary { flex: 1; }
.gc-actions .badge { align-self: center; color: var(--soon-ink); }
.fav {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  background: var(--card);
  border: 3px solid var(--card-edge);
  border-radius: 50%;
  cursor: pointer;
  color: var(--heart);
}
.fav svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.fav-empty { grid-column: 1 / -1; margin: 0; font-size: 1.15rem; color: var(--ink-soft); }
.fav-empty svg { width: 1.2em; height: 1.2em; vertical-align: -0.2em; fill: none; stroke: var(--heart); stroke-width: 2.4; }

/* Seasonal decoration: a few leaves (or snowflakes) drifting down behind the top of the page.
   Shown only while html has data-season; never when motion is reduced or High contrast is on. */
.season { display: none; position: absolute; top: 0; left: 0; right: 0; height: 420px; overflow: hidden; pointer-events: none; z-index: 0; }
html[data-season] .season { display: block; }
.season .fall { position: absolute; top: -40px; opacity: 0.7; animation: fall 16s linear infinite; }
.season .fall svg { display: block; width: 100%; height: 100%; }
.season-snow .fall { opacity: 0.9; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.7; }
  50% { transform: translate(30px, 230px) rotate(160deg); }
  85% { opacity: 0.55; }
  100% { transform: translate(-10px, 460px) rotate(320deg); opacity: 0; }
}
html.reduce-motion .season, html.high-contrast .season { display: none !important; }
@media (prefers-reduced-motion: reduce) { .season { display: none !important; } }

/* Our promises */
.promises {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1.25rem;
  list-style: none;
  background: var(--card);
  border: 3px solid var(--card-edge);
  border-radius: 22px;
}
.promises li { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.promise-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.promise-icon svg { width: 60%; height: 60%; }

/* Footer */
.site-foot { margin-top: auto; padding: 2.5rem 0 2rem; }
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 3px solid var(--card-edge);
}
.site-foot a, .linklike {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.5rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.site-foot a:focus-visible, .linklike:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }

/* Plain text pages (about, privacy) */
.page { max-width: 46rem; padding-bottom: 1rem; }
.page h1 { margin: 0.5rem 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; color: var(--heading); }
.page h2 { margin: 1.75rem 0 0.5rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; color: var(--heading); }
.page p, .page li { font-size: 1.15rem; line-height: 1.65; }
.page ul { padding-left: 1.4rem; }
.page .lead { font-size: 1.3rem; }

@media (max-width: 900px) {
  .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day { width: auto; }
  .site-top .tagline { display: none; }
}
@media (max-width: 480px) {
  .site-top { flex-wrap: wrap; }
  .wordmark { white-space: nowrap; }
  .site-top .top-actions { flex: 1 1 100%; }
  .site-top .top-actions .btn { flex: 1; }
  .greeting .dot { display: none; }
  .greeting { font-size: 1.15rem; }
  .promises { grid-template-columns: 1fr; }
  .continue .btn { flex: 1 1 100%; }
  .daily-item .btn, .done-check { flex: 1 1 100%; justify-content: center; }
  .calendar { padding-left: 0.6rem; padding-right: 0.6rem; }
}

/* Settings: theme picker with big previews */
.setting-note { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.seg.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.theme-btn { flex-direction: column; gap: 0.4rem; min-width: 0; padding: 0.5rem 0.5rem 0.55rem; }
.theme-btn .sw-name { font-size: 1.05rem; line-height: 1.2; }
.theme-btn[aria-pressed="true"] .sw-name::before { content: "\2713\00a0"; }
.sw-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 4.6rem;
  padding: 0.45rem;
  background: var(--bg);
  border: 2px solid var(--card-edge);
  border-radius: 12px;
  text-align: left;
}
.sw-bar { display: block; width: 100%; height: 0.45rem; margin-bottom: 0.3rem; background: var(--accent); border-radius: 3px; }
.sw-card {
  display: block;
  width: 62%;
  padding: 0.3rem 0.35rem 0.35rem;
  background: var(--card);
  border: 2px solid var(--card-edge);
  border-radius: 7px;
}
.sw-card i { display: block; height: 0.3rem; margin-bottom: 0.22rem; background: var(--ink); border-radius: 2px; }
.sw-card i + i { width: 60%; margin-bottom: 0; background: var(--ink-soft); }
.sw-btn { position: absolute; right: 0.45rem; bottom: 0.45rem; width: 28%; height: 1.1rem; background: var(--accent); border-radius: 6px; }

/* ---------- Feedback form ---------- */
/* Switched off in js/config.js (FEEDBACK_ENABLED): hide every way in, and any text that only makes sense with it. */
.feedback-off [data-feedback], .feedback-off [data-feedback-only] { display: none !important; }
.modal-box.fb-box { text-align: left; }
.fb-box h2 { text-align: center; }
.fb-faces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0.75rem 0 1.25rem; }
.fb-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.3rem;
  font: inherit;
  font-size: max(18px, 1.05rem);
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--card-edge);
  border-radius: 16px;
  cursor: pointer;
}
.fb-face svg { width: 4.2rem; height: 4.2rem; }
.fb-face[aria-pressed="true"] { border-color: var(--accent); outline: 4px solid var(--accent); background: var(--bg-2); }
.fb-face:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.fb-label { display: block; margin: 0.9rem 0 0.35rem; font-weight: 700; font-size: 1.15rem; }
.fb-label span { font-weight: 400; color: var(--ink-soft); }
.fb-box textarea, .fb-box input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: max(18px, 1.1rem);
  color: var(--ink);
  background: var(--field-bg);
  border: 3px solid var(--card-edge);
  border-radius: 12px;
}
html.high-contrast .fb-box textarea, html.high-contrast .fb-box input { border-color: #fff; }
.fb-box textarea:focus, .fb-box input:focus { outline: 4px solid var(--focus); outline-offset: 1px; }
.fb-box .fb-note { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--ink-soft); }
.fb-box .fb-status { min-height: 1.5em; margin: 0.25rem 0 0.75rem; font-weight: 700; color: var(--err); }
.fb-thanks { text-align: center; }

/* Modal dialogs (shared) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--veil);
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%;
  max-width: 36rem;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 1.5rem;
  text-align: center;
  background: var(--card);
  color: var(--ink);
  border: 4px solid var(--wood);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.modal-box h2 { margin: 0 0 0.5rem; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.modal-box p { margin: 0 0 1rem; font-size: 1.15rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* How to play pages (and the 404 page): the same plain page, with bigger print and a big Play button */
.guide .lead { font-size: 1.5rem; }
.guide p, .guide li { font-size: 1.35rem; }
.guide li { margin: 0.4rem 0; }
.guide ol, .guide ul { padding-left: 1.7rem; }
.guide .guide-play { margin: 1.5rem 0; }
.btn-play { min-height: 68px; padding: 0.4em 1.6em; font-size: 1.6rem; }
.guide .guide-more { list-style: none; padding: 0; }
.guide .guide-more a { display: inline-flex; align-items: center; min-height: 48px; color: var(--heading); font-weight: 700; text-underline-offset: 0.2em; }
.guide a:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.page a:not(.btn) { color: var(--heading); text-underline-offset: 0.2em; }
.page a:not(.btn):focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }

/* "How to play" link on a game card */
.gc-guide { display: inline-flex; align-items: center; min-height: 48px; font-size: 1.1rem; font-weight: 700; color: var(--heading); text-underline-offset: 0.2em; }
.gc-guide:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }

/* Accounts: big, simple sign-in screens (js/account.js) */
.accounts-off [data-accounts-only], .accounts-off #acct-btn, .accounts-off .acct-setting { display: none !important; }
.modal-box.acct-box { max-width: 38rem; text-align: left; }
.acct-box h2 { text-align: center; font-size: 2.3rem; }
.acct-lead { font-size: 1.45rem; line-height: 1.45; text-align: center; margin: 0 0 1.1rem; }
.acct-addr { overflow-wrap: anywhere; }
.acct-label { display: block; margin: 0.5rem 0 0.35rem; font-size: 1.3rem; font-weight: 700; }
.acct-input {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.3em 0.6em;
  font: inherit;
  font-size: 1.9rem;
  color: var(--ink);
  background: var(--card);
  border: 4px solid var(--wood-dark);
  border-radius: 14px;
  box-sizing: border-box;
}
.acct-input:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.acct-code { font-size: 3rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.acct-msg { min-height: 1.6em; margin: 0.6rem 0; font-size: 1.25rem; font-weight: 700; color: var(--err); }
.acct-small { margin: 1rem 0 0.5rem; font-size: 1.1rem; color: var(--ink-soft); text-align: center; }
.acct-box .modal-actions { margin-top: 0.75rem; }
.acct-box .btn-play { width: 100%; }
.acct-ts { display: flex; justify-content: center; min-height: 0.5rem; margin-top: 1rem; }
.acct-ts[hidden] { display: none; }
.acct-who { margin: 0 0 0.75rem; font-size: 1.3rem; }
.acct-email { font-size: 1.05rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-danger { color: var(--err); border-color: var(--err); }
html.high-contrast .btn-danger { color: #fff; border-color: #fff; }
.fb-ts { display: flex; justify-content: center; margin: 0.5rem 0; min-height: 0.5rem; }
html:not(.accounts-off) [data-accounts-off-only] { display: none; }
