/* Toe Beans: a soft berry-and-cream page, a cat's paw holding the letters on a rug. The title screen and the sheets are
   shared/mainmenu.js (menu.css, loaded after this); only their colors are set here (--sg-*). */
:root {
  --bg: #f8ebe7; --bg-hi: #fff7f3; --ink: #4a2a34; --ink-soft: #7d5a64; --line: rgba(74, 42, 52, 0.18);
  --accent: #c4577a; --accent-dark: #973a5b; --gold: #e2a43a; --sheet: #fff8f5; --card: #fffaf8;
  --both: #7a5bc4; --paw-w: 330px;
  color-scheme: light;
}
* { box-sizing: border-box; }
* { touch-action: manipulation; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(ellipse 110% 60% at 50% 0%, var(--bg-hi), transparent 70%), var(--bg);
  overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
.app {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: calc(var(--sg-corner-top) - 2px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.app > * { width: 100%; max-width: 480px; }

/* ---- top bar ---- */
.bar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 16px;
  background: rgba(255, 255, 255, 0.75); box-shadow: 0 2px 0 rgba(74, 42, 52, 0.12); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.news { position: relative; }
.icon-btn.news::after { content: ''; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg, #fff); } /* a result waits in Stats */
.sub { margin: 0; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.2; color: var(--ink-soft); min-width: 0; }
.sub b { color: var(--ink); font-size: 19px; }
.sub .tag { display: inline-block; margin-left: 6px; padding: 1px 8px 0; border-radius: 999px; background: #e3d6f5; color: #4d2f80; font-size: 13px; }

/* ---- score and the rank ladder (a linear bar to Top Cat, with a tick at each rank) ---- */
.score { padding: 2px 4px 0; }
.score-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rank { font-weight: 800; font-size: 22px; line-height: 1.1; color: var(--accent-dark); }
.points { font-weight: 800; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ladder { position: relative; height: 12px; margin: 5px 0 3px; border-radius: 999px; background: rgba(74, 42, 52, 0.12); overflow: visible; }
.ladder-fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, #ef9db3, var(--accent)); transform-origin: left center; transform: scaleX(0); transition: transform 0.45s cubic-bezier(.2, .9, .3, 1.2); }
.ladder .tick { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(74, 42, 52, 0.2); }
.ladder .tick.on { background: #fff; box-shadow: 0 0 0 2px var(--accent-dark); }
.ladder .tick.top { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--gold); box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(74, 42, 52, 0.3); }
.next { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--ink-soft); min-height: 19px; }

/* ---- the words found ---- */
.found-row { display: flex; gap: 8px; }
.found {
  flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 4px 12px 2px 14px; border: 0;
  border-radius: 16px; background: rgba(255, 255, 255, 0.8); box-shadow: 0 2px 0 rgba(74, 42, 52, 0.1); cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.found-count { flex: none; font-weight: 800; font-size: 16px; }
.found-peek { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; font-size: 15px; color: var(--ink-soft); text-transform: capitalize; }
.found .chev { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--ink-soft); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.found[aria-expanded="true"] .chev { transform: rotate(180deg); }
.hint-btn {
  flex: none; min-width: 76px; min-height: 48px; padding: 4px 12px 2px; border: 0; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, 0.8); box-shadow: 0 2px 0 rgba(74, 42, 52, 0.1); font-weight: 800; font-size: 15px; line-height: 1.1;
}
.hint-btn.locked { color: var(--ink-soft); background: rgba(74, 42, 52, 0.07); box-shadow: none; }
.hint-btn small { display: block; font-size: 11px; font-weight: 700; }
.found-list {
  max-height: 34vh; overflow: auto; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px -10px rgba(74, 42, 52, 0.5); columns: 3 92px; column-gap: 12px; font-weight: 700; font-size: 16px; line-height: 1.6;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.found-list[hidden] { display: none; }
.found-list span { display: block; break-inside: avoid; text-transform: capitalize; }
.found-list .both::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: -1px; border-radius: 50%; background: var(--both); box-shadow: inset 0 0 0 3px #fff; outline: 1.5px solid var(--both); outline-offset: -1.5px; }
.found-list .pangram { color: var(--accent-dark); font-weight: 800; }
.found-list .empty { columns: 1; color: var(--ink-soft); }
.found-list .bonus::before, .tb-answers span.got.bonus::before { content: "★ "; color: var(--accent); }
.found-list .note { column-span: all; margin-top: 8px; font-size: 13px; font-weight: 600; text-transform: none; }

/* ---- the typed word and the paw ---- */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.typed {
  margin: 0; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 1px;
  font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: 0.04em; text-transform: uppercase;
}
.typed-text .c { color: var(--accent-dark); }
.typed-text .x { color: rgba(74, 42, 52, 0.35); }
.caret { width: 3px; height: 34px; border-radius: 2px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.typed.shake { animation: shake 0.42s ease-in-out; }
.rug {
  position: relative; width: min(100%, calc(var(--paw-w) + 30px)); border-radius: 28px; padding: 10px 15px 6px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 8px 22px -14px rgba(74, 42, 52, 0.6);
}
.paw { position: relative; width: var(--paw-w); max-width: 100%; margin: 0 auto; aspect-ratio: 388 / 410; }
.paw svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.paw .pw-bean, .paw .pw-spot { transform-box: view-box; transition: transform 0.09s ease-out; }
.paw .pw-bean.down, .paw .pw-spot.down { transform: scale(0.9); }
.paw .pw-letter { transition: opacity 0.16s; }
.paw.shuffling .pw-letter { opacity: 0; }
.paw .key {
  position: absolute; display: block; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transform: translate(-50%, -50%);
}
.paw .key:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

/* ---- the buttons under the paw ---- */
.controls { flex: none; display: grid; grid-template-columns: 1fr 64px 1fr; gap: 10px; align-items: center; }
.ctl {
  min-height: 54px; padding: 4px 14px 0; border: 2px solid rgba(74, 42, 52, 0.2); border-radius: 999px; background: #fff;
  font-weight: 800; font-size: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ctl.round { width: 64px; height: 64px; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.ctl.round svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ctl.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctl.down, .ctl:active { transform: scale(0.96); }

/* ---- messages ---- */
/* over the score (the rank and points it's about), never over the word you're typing or the paw (Jay, 2026-11-16) */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 5; width: auto; margin: 0; max-width: calc(100% - 32px);
  padding: 9px 16px 7px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 800; font-size: 17px; line-height: 1.2;
  text-align: center; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--accent-dark); }
.toast.wow { background: linear-gradient(90deg, #7a5bc4, var(--accent)); }
.pop {
  position: fixed; left: 50%; top: 46%; z-index: 4; width: auto; margin: 0; font-weight: 800; font-size: 34px; color: var(--accent-dark);
  text-shadow: 0 2px 0 #fff; opacity: 0; pointer-events: none; transform: translate(-50%, 0);
}
.pop.on { animation: pop-up 0.9s ease-out; }
@keyframes pop-up { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(5px); } }

/* ---- sheets (results, stats, archive, answers, hints, the paw collection) ---- */
.tb-result { text-align: center; }
.tb-result .big { margin: 0; font-weight: 800; font-size: 30px; line-height: 1.1; color: var(--accent-dark); }
.tb-result .line { margin: 2px 0 0; font-weight: 700; font-size: 16px; color: var(--ink-soft); }
.tb-beans { display: flex; justify-content: center; gap: 4px; margin: 10px 0 4px; }
.tb-beans i { width: 22px; height: 26px; border-radius: 50%; background: rgba(74, 42, 52, 0.12); }
.tb-beans i.on { background: radial-gradient(circle at 35% 30%, #ffd4da, #f3a3ad 55%, #d9798a); }
.tb-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 6px; }
.tb-num { text-align: center; }
.tb-num b { display: block; font-size: 28px; line-height: 1.05; }
.tb-num span { display: block; font-size: 13px; font-weight: 700; line-height: 1.15; color: var(--ink-soft); }
.tb-h { margin: 10px 0 4px; font-weight: 800; font-size: 17px; }
.tb-note { margin: 6px 0 0; font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--ink-soft); }
.tb-next { margin: 10px 0 0; text-align: center; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.tb-share { width: 100%; min-height: 50px; margin-top: 8px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 800; font-size: 18px; cursor: pointer; }
.tb-dist { display: grid; gap: 4px; }
.tb-bar { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.tb-bar i { display: block; min-width: 26px; padding: 1px 8px 0; border-radius: 6px; background: #b9a3ad; color: #fff; text-align: right; font-style: normal; line-height: 22px; }
.tb-bar.me i { background: var(--accent); }
.tb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tb-day { display: flex; gap: 6px; align-items: stretch; }
.tb-day .go {
  flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px 4px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; font-weight: 800; font-size: 16px;
}
.tb-day small { display: block; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.tb-day .chip { flex: none; padding: 3px 10px 1px; border-radius: 999px; font-size: 14px; background: rgba(74, 42, 52, 0.08); }
.tb-day .chip.good { background: var(--accent); color: #fff; }
.tb-day .chip.top { background: var(--gold); color: #4a2a00; }
.tb-day .ans { flex: none; min-width: 86px; min-height: 52px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.7); font-weight: 800; font-size: 15px; cursor: pointer; }
.tb-more { min-height: 48px; width: 100%; margin-top: 8px; border: 0; border-radius: 14px; background: rgba(74, 42, 52, 0.09); font-weight: 800; font-size: 16px; cursor: pointer; }
.tb-letters { display: flex; justify-content: center; gap: 6px; margin: 2px 0 8px; }
.tb-letters span { width: 40px; height: 44px; display: grid; place-items: center; padding-top: 3px; border-radius: 50%; background: #f3a3ad; color: #5b2734; font-weight: 800; font-size: 22px; text-transform: uppercase; }
.tb-letters span.c { background: var(--accent-dark); color: #fff; }
.tb-answers { columns: 3 90px; column-gap: 12px; font-weight: 700; font-size: 16px; line-height: 1.55; }
.tb-answers span { display: block; break-inside: avoid; text-transform: capitalize; color: var(--ink-soft); }
.tb-answers span.got { color: var(--ink); }
.tb-answers span.got::before { content: "✓ "; color: var(--accent); }
.tb-answers span.pangram { font-weight: 800; color: var(--accent-dark); }
.tb-legend { font-size: 14px; }
.tb-key { white-space: nowrap; }
.tb-key.got::before { content: "✓ "; color: var(--accent); }
.tb-key.pangram { font-weight: 800; color: var(--accent-dark); margin-left: 8px; }
.tb-grid { width: 100%; border-collapse: collapse; font-weight: 800; font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.tb-grid th, .tb-grid td { padding: 5px 2px 3px; border-bottom: 1px solid var(--line); }
.tb-grid th { color: var(--ink-soft); font-size: 13px; }
.tb-grid td.zero { color: rgba(74, 42, 52, 0.25); }
.tb-starts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-weight: 800; font-size: 16px; text-transform: uppercase; }
.tb-starts span b { color: var(--accent-dark); }
.tb-ach { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tb-ach li { display: flex; gap: 10px; align-items: center; padding: 8px 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.75); font-weight: 700; font-size: 15px; line-height: 1.25; }
.tb-ach li b { display: block; font-size: 16px; }
.tb-ach li.no { opacity: 0.55; }
.tb-ach .medal { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f4c44e; color: #6b4a0c; font-weight: 800; }
.tb-ach li.no .medal { background: rgba(74, 42, 52, 0.14); color: transparent; }
.tb-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tb-pick {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 120px; padding: 6px 4px 4px; border: 2px solid transparent;
  border-radius: 16px; background: rgba(255, 255, 255, 0.75); cursor: pointer; font-weight: 700; font-size: 13px; line-height: 1.1; text-align: center;
}
.tb-pick svg { width: 76px; height: auto; display: block; }
.tb-pick .swatch { width: 76px; height: 76px; border-radius: 14px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }
.tb-pick[aria-pressed="true"] { border-color: var(--accent); background: #fff; }
.tb-pick.locked { cursor: default; background: rgba(74, 42, 52, 0.06); color: var(--ink-soft); }
.tb-pick.locked .q { width: 64px; height: 64px; margin: 6px 0; display: grid; place-items: center; border-radius: 50%; border: 2px dashed rgba(74, 42, 52, 0.3); font-weight: 800; font-size: 26px; color: rgba(74, 42, 52, 0.4); }
.tb-gold { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tb-how-paw { width: 150px; margin: 4px auto 0; }
.tb-how-paw svg { width: 100%; height: auto; display: block; }

/* ---- the title screen's colors (the layout is shared/mainmenu.js) ---- */
#mm {
  --sg-bg: radial-gradient(ellipse 100% 70% at 50% 25%, var(--bg-hi), transparent 75%), var(--bg);
  --sg-ink: var(--ink); --sg-ink-soft: var(--ink-soft);
  --sg-title: var(--accent-dark); --sg-title-shadow: 0 2px 0 #fff;
  --sg-accent: var(--accent); --sg-accent-ink: #fff;
  --sg-card: #fff; --sg-card-ink: var(--ink); --sg-line: rgba(74, 42, 52, 0.16);
}
#mm .tb-title-art { width: 272px; height: 150px; }
#mm .tb-title-art svg { display: block; width: 100%; height: 100%; }
.sg-sheet { --sg-sheet-bg: var(--sheet); --sg-sheet-ink: var(--ink); --sg-accent: var(--accent); --sg-accent-ink: #fff; --sg-ink-soft: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .typed.shake { animation: none; color: #b8384f; }
  .pop.on { animation: fade-pop 0.9s ease-out; }
  .ladder-fill, .found .chev, .toast, .paw .pw-bean, .paw .pw-spot, .paw .pw-letter { transition: none; }
  .paw .pw-bean.down, .paw .pw-spot.down { transform: none; filter: brightness(0.9); }
  @keyframes fade-pop { 0%, 100% { opacity: 0; } 25%, 70% { opacity: 1; } }
}
