/* [slice: weighoff] between years (src/ui/winter.js): the carving panel, trick-or-treat, and the winter pages (ledger,
   the Quarter Sun Crier, the scrapbook, the hub). Scoped under .wi- / .cr- / .sb- prefixes. */

.screen.wi { position: fixed; inset: 0; pointer-events: none; }
.wi > * { pointer-events: auto; }
body.wi-on #wkrow { display: none; }
/* the HUD, the dock's Next and the townsfolk's lines (Edna #27, Gran #28) sit above the winter scrim, not greyed out under it */
body.wi-on #game-ui { z-index: 5; }

/* ---------------------------------------------------------------- Halloween: the carving panel and the treats card */
.wi-carve, .wi-treats { position: absolute; left: var(--sl); right: var(--sr); bottom: var(--wi-bottom, 92px); padding: 12px 14px 14px; border-radius: 20px;
  max-height: calc(100vh - var(--wi-bottom, 92px) - 120px); overflow-y: auto; animation: wo-in 0.35s var(--spring); }
.wi-head .eyebrow { margin-bottom: 1px; }
.wi-head h2 { margin: 0 0 8px; font-size: var(--fs-xl); }
.wi-carve-row { display: flex; gap: 10px; align-items: flex-start; }
.wi-face { width: min(58vw, 236px); height: auto; aspect-ratio: 1; border-radius: 50% / 46%; touch-action: none; cursor: crosshair; flex: none;
  box-shadow: inset 0 -10px 24px rgba(80, 30, 5, 0.35), 0 6px 18px rgba(80, 40, 10, 0.3); }
.wi-carve-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wi-tools { flex-direction: column; }
.wi-tools button { flex-direction: column; min-height: 52px; }
.wi-tools button span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wi-tools small { font-size: 10px; font-weight: 700; color: var(--muted); }
.wi-stencils { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wi-stencils .chip { min-height: 44px; border: 1px solid var(--line); cursor: pointer; padding: 0 12px; }
.wi-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wi-actions .btn.primary { flex: 1 1 200px; }
.wi-note { margin: 6px 0 0; font-size: var(--fs-s); font-weight: 700; color: var(--ink); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wi-candy { margin: 6px 0 0; font-weight: 800; color: var(--pumpkin-dark); min-height: 1.2em; }
.wi-lot { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px; scrollbar-width: none; }
.wi-seed { flex: none; width: 78px; padding: 8px 6px; border-radius: 12px; background: #fbf3e4; border: 1px solid #e8d4b4; display: flex; flex-direction: column; align-items: center; gap: 1px;
  animation: wi-seed 0.5s var(--spring) both; }
.wi-seed::before { content: ''; width: 18px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff8e6, #e6d2a8); box-shadow: inset 0 0 0 1px #d7bf92; margin-bottom: 4px; }
.wi-seed b { font-size: var(--fs-xs); } .wi-seed span, .wi-seed i { font-size: 10px; color: var(--muted); font-style: normal; font-weight: 700; }
@keyframes wi-seed { 0% { opacity: 0; transform: translateY(-30px) scale(0.5) rotate(-20deg); } 70% { opacity: 1; transform: translateY(4px) scale(1.06); } 100% { transform: none; } }

/* ---------------------------------------------------------------- winter pages */
.wi-day::before { content: ''; position: absolute; inset: 0; background: rgba(211, 220, 219, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); pointer-events: none; }
.wi-page { position: absolute; left: var(--sl); right: var(--sr); top: calc(var(--top-h) + 56px); bottom: var(--wi-bottom, 92px); overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 14px 24px; border-radius: 20px; background: var(--card-strong); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.wi-title .eyebrow { margin-bottom: 2px; }
.wi-title h1 { margin: 0 0 6px; font-size: var(--fs-xxl); }
.wi-sec { margin-top: 16px; }
.wi-sec > .eyebrow { margin-bottom: 6px; }
.wi-net { margin-top: 8px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.wi-net span { font-weight: 800; color: var(--muted); font-size: var(--fs-s); }
.wi-net b { display: block; font: 650 var(--fs-xxl) Fraunces, Georgia, serif; color: var(--good); }
.wi-net.neg b { color: var(--bad); }
.wi-net small { display: block; margin-top: 4px; color: var(--muted); font-weight: 700; font-size: var(--fs-xs); }
.wi-spark { width: 100%; height: 54px; display: block; margin-top: 4px; }
.wi-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.wi-fact { padding: 8px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.wi-fact b { font: 650 var(--fs-l) Fraunces, Georgia, serif; color: var(--ink-strong); }
.wi-fact span { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); line-height: 1.2; }
.wi-card { margin-top: 6px; padding: 9px 11px; border-radius: 12px; background: #fff; border-left: 4px solid var(--pumpkin); font-size: var(--fs-s); font-weight: 600; line-height: 1.4; }
.wi-giant { display: flex; flex-direction: column; gap: 2px; }
.wi-giant b { font: 650 var(--fs-xl) Fraunces, Georgia, serif; color: var(--ink-strong); }
.wi-giant span { font-size: var(--fs-s); font-weight: 700; color: var(--muted); }
.wi-chart { width: 100%; height: auto; margin-top: 8px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); display: block; }
.wi-legend { margin: 4px 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.wi-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip.bad { background: #f3d6cd; color: #8a3a28; }

/* ---------------------------------------------------------------- the Quarter Sun Crier: a little newspaper */
.wi-crier { background: #f4efe2 radial-gradient(120% 80% at 50% 0%, #fbf8ef, #ece4cf); }
.crier { font-family: Georgia, 'Times New Roman', serif; color: #1f1c17; }
.cr-mast { text-align: center; border-bottom: 3px double #1f1c17; padding-bottom: 6px; }
.cr-top { display: flex; justify-content: space-between; gap: 8px; font: 700 10.5px 'Nunito Sans', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid #1f1c17; padding-bottom: 4px; }
.cr-mast h1 { margin: 6px 0 0; font: 900 clamp(26px, 8.4vw, 40px)/1 Fraunces, Georgia, serif; letter-spacing: -0.01em; color: #1f1c17; }
.cr-motto { font-style: italic; font-size: 11.5px; margin-top: 3px; }
.cr-head { margin: 12px 0 4px; font: 900 clamp(22px, 6.6vw, 30px)/1.06 Fraunces, Georgia, serif; text-transform: uppercase; letter-spacing: -0.01em; color: #111; }
.cr-sub { font-style: italic; font-weight: 700; margin-bottom: 6px; }
.cr-photo { margin: 8px 0; }
.cr-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; filter: sepia(0.35) contrast(1.08) grayscale(0.25); border: 1px solid #1f1c17; }
.cr-photo figcaption { font-size: 11.5px; font-style: italic; margin-top: 3px; }
.cr-nophoto { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #e2d8c0; font-style: italic; color: #6a5f4c; }
.cr-briefs { border-top: 1px solid #1f1c17; border-bottom: 1px solid #1f1c17; padding: 4px 0; }
.cr-briefs p { margin: 6px 0; font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.25; }
.cr-box { margin-top: 12px; border-top: 2px solid #1f1c17; padding-top: 6px; }
.cr-box h3 { margin: 0 0 4px; font: 900 13px 'Nunito Sans', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.cr-box p { margin: 4px 0; font-size: 14.5px; line-height: 1.4; }
.cr-letter { font-style: italic; }
.cr-by { font-size: 11.5px; font-style: italic; }
.cr-fog { display: flex; align-items: flex-end; gap: 4px; height: 52px; margin-top: 4px; }
.cr-fog i { flex: 1; background: repeating-linear-gradient(0deg, #6a6458 0 2px, #9a9384 2px 4px); border-radius: 2px 2px 0 0; }
.cr-ad { margin-top: 14px; border: 2px solid #1f1c17; padding: 8px 10px; }
.cr-ad h3 { margin: 0 0 4px; font: 900 12px 'Nunito Sans', sans-serif; letter-spacing: 0.14em; }
.cr-ad p { margin: 0; font: 700 13.5px ui-monospace, Menlo, monospace; }

/* ---------------------------------------------------------------- the scrapbook */
.wi-scrapbook { background: #efe6d6 radial-gradient(100% 60% at 50% 0%, #f7f0e2, #e8dcc6); }
.sb-page { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; border-radius: 14px; background: #fffaf0; box-shadow: var(--shadow-sm); }
.sb-page:not(.big) { flex-direction: row; align-items: flex-start; }
.sb-photo { position: relative; padding: 8px 8px 22px; background: #fff; box-shadow: 0 4px 12px rgba(60, 40, 20, 0.2); transform: rotate(-2deg); align-self: center; width: min(88%, 300px); }
.sb-page:not(.big) .sb-photo { width: 104px; padding: 4px 4px 12px; flex: none; }
.sb-photo img, .sb-photo .cr-nophoto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.sb-photo .tape { position: absolute; top: -8px; left: 50%; width: 70px; height: 18px; margin-left: -35px; background: rgba(233, 214, 160, 0.75); transform: rotate(3deg); }
.sb-text { flex: 1; min-width: 0; }
.sb-text h3 { margin: 2px 0; font-size: var(--fs-xl); }
.sb-head { margin: 2px 0 8px; font: 800 13px/1.3 Georgia, serif; text-transform: uppercase; }
.sb-page:not(.big) .wi-facts { display: none; }
.sb-moment { margin: 8px 0 0; font-style: italic; font-size: var(--fs-s); color: var(--ink); }

/* ---------------------------------------------------------------- the hub */
.wi-cash { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-weight: 800; color: var(--ink-strong); }
.wi-cash small { font-weight: 700; color: var(--bad); }
.wi-tabs { margin-top: 10px; position: sticky; top: -14px; z-index: 1; }
.wi-tabs button { min-width: 0; font-size: var(--fs-xs); }
.wi-tab { margin-top: 6px; }
.wi-item, .wi-seedcard { display: flex; gap: 10px; align-items: center; margin-top: 6px; padding: 10px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.wi-item .grow, .wi-seedcard .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wi-item b, .wi-seedcard b { font-weight: 800; color: var(--ink-strong); }
.wi-item span, .wi-seedcard span { font-size: var(--fs-s); color: var(--muted); font-weight: 600; line-height: 1.3; }
.wi-item small { font-size: var(--fs-xs); color: var(--warn); font-weight: 800; }
.wi-item .btn { flex: none; min-width: 92px; min-height: 44px; padding: 0 12px; }
.wi-item.owned { opacity: 0.8; }
.wi-item.later { opacity: 0.85; background: var(--chip); }
.wi-price { font-weight: 800; color: var(--muted); font-size: var(--fs-s); white-space: nowrap; }
.wi-seedcard.on { outline: 3px solid var(--sage); }
.wi-seedbtns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.wi-seedbtns .btn { min-height: 44px; min-width: 92px; padding: 0 10px; }

@media (min-width: 900px) {
  .wi-carve, .wi-treats { left: auto; right: var(--sr); width: 440px; }
  .wi-page { left: 50%; right: auto; width: 640px; transform: translateX(-50%); }
}
