/* ============================================================
   Plot Day — cozy storybook garden
   ============================================================ */

:root {
  --paper: #f6eedd;
  --paper-deep: #efe2c8;
  --ink: #4a3b2a;
  --ink-soft: #7a6a52;
  --leaf: #5d8f4e;
  --leaf-deep: #3f6b35;
  --terracotta: #d9714e;
  --terracotta-deep: #b9552f;
  --sky-day: #cfe6f5;
  --soil: #b58963;
  --soil-deep: #93673f;
  --sun-3: #e0d77c;
  --sun-2: #bdcf74;
  --sun-1: #9ab884;
  --sun-0: #7e9f92;
  --grass-under: #97b573;
  --shade-veil: rgba(54, 76, 128, .42);
  --card: #fffaf0;
  --thrive: #4e9b3f;
  --ok: #e0a52e;
  --dead: #c4452e;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    repeating-linear-gradient(-45deg, transparent 0 34px, rgba(122, 106, 82, .03) 34px 35px),
    linear-gradient(180deg, #c8e4e2 0%, #e6e7d0 30%, #f6eedd 62%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, .big-score, .finish-btn, .season-badge {
  font-family: "Baloo 2", cursive;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px 10px;
  max-width: 1080px;
  margin: 0 auto;
}
.masthead h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--leaf-deep);
  text-shadow: 0 2px 0 rgba(255,255,255,.7);
}
/* bundled Twemoji UI icons */
.em {
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  display: inline-block;
}
.masthead .em-lg { width: 1.9rem; height: 1.9rem; vertical-align: -.2rem; }
.phase-btn .em { width: 1.25rem; height: 1.25rem; }
.dev-btn .em { width: 1rem; height: 1rem; }
.seed-stats .em { width: .82rem; height: .82rem; vertical-align: -.14rem; }
.drop-badge .em { width: .9em; height: .9em; vertical-align: 0; }
.results-tally .em, .par-score .em { width: .95em; height: .95em; }
.season-badge .em { width: .95em; height: .95em; }
.tagline {
  margin: -4px 0 0 2px;
  color: var(--ink-soft);
  font-style: italic;
  font-size: .95rem;
}
.day-block { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.day-row { display: flex; align-items: center; gap: 8px; }
.mute-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--paper-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mute-btn:hover { border-color: var(--terracotta); }
.mute-btn .em { width: .95rem; height: .95rem; vertical-align: 0; }
.season-badge {
  display: inline-block;
  white-space: nowrap;
  background: var(--leaf);
  color: #fff;
  padding: 3px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 0 var(--leaf-deep);
}
.season-badge.winter { background: #5b87b8; box-shadow: 0 2px 0 #3c618c; }
.season-badge.fall   { background: #c07a35; box-shadow: 0 2px 0 #96581d; }
.season-badge.spring { background: #c96a8d; box-shadow: 0 2px 0 #a14a6d; }
.day-label { color: var(--ink-soft); font-weight: 700; font-size: .85rem; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0 18px;
  max-width: 1110px;
  margin: 0 auto;
  padding: 8px 26px 40px;
}
.board-wrap, .field-notes, .dev-panel { grid-column: 1; }
.sidebar { grid-column: 2; grid-row: 1 / span 3; }
.dev-panel { margin-top: 14px; justify-self: center; }

/* ---------- sun arc / phase buttons ---------- */
.sun-arc {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.phase-btn {
  font-family: "Nunito", sans-serif;
  font-size: 1.15rem;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: 12px;
  padding: 5px 14px 3px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: transform .12s, border-color .12s;
}
.phase-btn small { font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.phase-btn:hover { transform: translateY(-2px); }
.phase-btn.is-active { border-color: var(--terracotta); color: var(--ink); background: #fff; }

/* ---------- board ---------- */
.board-wrap { min-width: 0; }
.board {
  position: relative;
  display: grid;
  gap: 5px;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, .45) 0 4px, transparent 5px),
    radial-gradient(circle at 68% 64%, rgba(255, 255, 255, .35) 0 3px, transparent 4px),
    radial-gradient(circle at 42% 82%, rgba(122, 104, 78, .22) 0 4px, transparent 5px),
    #cfc5aa;
  background-size: 47px 53px, 61px 41px, 53px 67px, auto;
  border: 6px solid #8a6242;
  border-radius: 18px;
  padding: 11px;
  box-shadow: 0 12px 26px rgba(74, 59, 42, .28), inset 0 2px 6px rgba(74, 59, 42, .25);
}
/* gouache grain wash unifying the whole board */
.board::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.33 0 0 0 0 0.28 0 0 0 0 0.16 0 0 0 0.07 0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.board.winter {
  --sun-3: #f3eedb;
  --sun-2: #dfe5d3;
  --sun-1: #c4d6d3;
  --sun-0: #a9c2ca;
  --grass-under: #c2d0d3;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, .5) 0 4px, transparent 5px),
    radial-gradient(circle at 68% 64%, rgba(255, 255, 255, .4) 0 3px, transparent 4px),
    radial-gradient(circle at 42% 82%, rgba(96, 112, 122, .2) 0 4px, transparent 5px),
    #b9c3c4;
  background-size: 47px 53px, 61px 41px, 53px 67px, auto;
}
/* greenhouse interior reads as a warm GROWING zone — green tiles vs the
   pale snow outside (a playtester read the glass as ice). Sun gradient is
   preserved so shelter triage on sun still reads at a glance. */
.board.winter .tile.inside[data-sun="3"] { background-color: #d4ebbf; }
.board.winter .tile.inside[data-sun="2"] { background-color: #bfe0a8; }
.board.winter .tile.inside[data-sun="1"] { background-color: #a6d094; }
.board.winter .tile.inside[data-sun="0"] { background-color: #8fbd84; }

/* illustrated structures drawn over the grid */
.scene {
  position: absolute;
  inset: 10px;
  display: grid;
  gap: 4px;
  pointer-events: none;
  /* no z-index: it would isolate blending — DOM order already paints it above */
}
.scene .structure { position: relative; }
.scene .structure svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 2px rgba(58, 45, 25, .28));
}
.scene .s-tree svg { inset: -14% -10% -2% -10%; width: 120%; height: 116%; }
.scene .s-house svg { inset: -8% -4% 0 -4%; width: 108%; height: 108%; }
/* glass casts barely any shadow — it's a window, not a wall */
.scene .s-glass svg { filter: drop-shadow(0 2px 2px rgba(58, 45, 25, .16)); }
/* chimney smoke: a barely-there winter drift, cozy not busy */
.scene .chimney-smoke { animation: smokeDrift 3.8s ease-in-out infinite alternate; }
@keyframes smokeDrift {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-2.5px); opacity: .75; }
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.1rem, 5.5vw, 1.9rem);
  cursor: pointer;
  user-select: none;
  transition: transform .1s ease, box-shadow .1s ease;
}
.tile {
  background-image:
    radial-gradient(rgba(255, 255, 255, .14) 11%, transparent 12%),
    radial-gradient(rgba(46, 70, 30, .07) 9%, transparent 10%);
  background-size: 22px 22px, 30px 30px;
  background-position: 0 0, 11px 8px;
}
.tile[data-sun="3"] { background-color: var(--sun-3); }
.tile[data-sun="2"] { background-color: var(--sun-2); }
.tile[data-sun="1"] { background-color: var(--sun-1); }
.tile[data-sun="0"] { background-color: var(--sun-0); box-shadow: inset 0 3px 8px rgba(38, 64, 84, .28); }
.tile[data-sun="0"].status-thrive { box-shadow: inset 0 3px 8px rgba(38, 64, 84, .28), inset 0 0 0 3px var(--thrive); }
.tile[data-sun="0"].status-ok { box-shadow: inset 0 3px 8px rgba(38, 64, 84, .28), inset 0 0 0 3px var(--ok); }
.tile[data-sun="0"].status-dead { box-shadow: inset 0 3px 8px rgba(38, 64, 84, .28), inset 0 0 0 3px var(--dead); }

.tile.obstacle { cursor: default; background-color: var(--grass-under); }

/* tilled soil bed under planted crops */
.tile.tilled::before {
  content: "";
  position: absolute;
  inset: 30% 18% 12% 18%;
  background: radial-gradient(ellipse at 50% 42%, #9a6c44 0%, #855833 70%, #744c2a 100%);
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 255, 255, .25);
}
.board.winter .tile.tilled::before {
  background: radial-gradient(ellipse at 50% 42%, #7d6850 0%, #6a563f 70%, #594832 100%);
}

.tile > .barrel-art {
  position: relative;
  z-index: 1;
  width: 76%;
  height: 76%;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .25));
}

/* watercolor sprites: multiply makes the white paper vanish into the board */
.crop-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.07) contrast(1.05);
  pointer-events: none;
  animation: pop .25s ease;
  transform-origin: bottom center;
}
.tile .crop-art.tall-art {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: auto;
  max-width: none;
  height: 140%;
  transform: translateX(-50%);
  animation: none;
  z-index: 2;
}
.tile.has-art::before { opacity: .35; } /* the art brings its own soil mound */
.tile.status-ok .crop-art { filter: brightness(1.07) contrast(1.05) saturate(.72); }
.tile.status-dead .crop-art { filter: brightness(1.07) contrast(1.05) grayscale(.85) brightness(.85) sepia(.3); }
.board.resolved .tile.status-thrive .crop-art { animation: sway 2.4s ease-in-out infinite; }
.board.resolved .tile.status-thrive .crop-art.tall-art { animation: none; }
.pips { z-index: 3; }
.crop-art[src*="Corn"] { clip-path: inset(0 0 7% 0); } /* source has an artifact bar */

/* gouache SVG crop sprites */
.crop-svg {
  position: relative;
  z-index: 1;
  width: 88%;
  height: 88%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  animation: pop .25s ease;
  transform-origin: bottom center;
  filter: drop-shadow(0 2px 1.5px rgba(46, 62, 33, .25));
}
.crop-svg svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scale(1.32);
  transform-origin: 50% 86%;
}
.crop-svg.flip svg { transform: scale(1.32) scaleX(-1); }
.crop-svg.tallc svg { transform: scale(1.12); transform-origin: 50% 92%; }
.crop-svg.tallc.flip svg { transform: scale(1.12) scaleX(-1); }
.crop-svg.tallc {
  position: absolute;
  bottom: 2%;
  left: 50%;
  width: 82%;
  height: 122%;
  transform: translateX(-50%);
  animation: none;
  z-index: 2;
}
.tile.status-ok .crop-svg { filter: drop-shadow(0 2px 1.5px rgba(46,62,33,.25)) saturate(.7) brightness(.97); }
.tile.status-dead .crop-svg { filter: drop-shadow(0 1px 1px rgba(46,62,33,.2)) grayscale(.85) brightness(.82) sepia(.3); }
.board.resolved .tile.status-thrive .crop-svg { animation: sway 2.4s ease-in-out infinite; }
.board.resolved .tile.status-thrive .crop-svg.tallc { animation: none; }
.crop-art.flip { transform: scaleX(-1); }
.crop-art.tall-art.flip { transform: translateX(-50%) scaleX(-1); }
.scene .structure.flip img { transform: scaleX(-1); }
.scene .structure.gflipx svg { transform: scaleX(-1); }
/* gflipy retired: the doors-away garage is now drawn as a proper back view */

.scene .structure img {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.07) contrast(1.05);
}
.scene .s-tree img { inset: -16% -12% -4% -12%; width: 124%; height: 120%; }
.scene .s-house img { inset: -10% -8% -2% -8%; width: 116%; height: 112%; }

/* hover-capable devices only: on touch, :hover sticks after a tap and the
   lift shadow was REPLACING the status ring (the "my red outline vanished"
   bug). Rings ride along explicitly so desktop hover never hides truth. */
@media (hover: hover) {
  .tile:not(.obstacle):hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, .18); z-index: 2; }
  .tile.status-thrive:hover { box-shadow: 0 4px 8px rgba(0, 0, 0, .18), inset 0 0 0 3px var(--thrive); }
  .tile.status-ok:hover     { box-shadow: 0 4px 8px rgba(0, 0, 0, .18), inset 0 0 0 3px var(--ok); }
  .tile.status-dead:hover   { box-shadow: 0 4px 8px rgba(0, 0, 0, .18), inset 0 0 0 3px var(--dead); }
}

/* sun pips */
.pips {
  position: absolute;
  top: 3px; left: 5px;
  display: flex; gap: 2px;
  pointer-events: none;
}
.pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 0 0 1px rgba(255,255,255,.6);
}
/* empty pip = hollow socket: light fill + dark ring reads on every
   seasonal palette (a flat low-alpha dot vanished on winter's pale tiles) */
.pip.off {
  background: rgba(255, 255, 255, .4);
  border: 1.2px solid rgba(74, 59, 42, .5);
  box-shadow: none;
}

/* ghost shade: what watering the placed talls would add */
.tile .gveil {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(58, 76, 105, .32) 0 5px, transparent 5px 11px);
  transition: opacity .18s;
}
.board[data-view="day"]  .tile.ghost-any  .gveil { opacity: .45; }
.board[data-view="am"]   .tile.ghost-am   .gveil { opacity: .6; }
.board[data-view="noon"] .tile.ghost-noon .gveil { opacity: .6; }
.board[data-view="pm"]   .tile.ghost-pm   .gveil { opacity: .6; }

/* phase-view shade veil */
.tile .veil {
  position: absolute; inset: 0;
  border-radius: 9px;
  background: var(--shade-veil);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.board[data-view="am"]   .tile.shade-am   .veil,
.board[data-view="noon"] .tile.shade-noon .veil,
.board[data-view="pm"]   .tile.shade-pm   .veil { opacity: 1; }
/* phase views: pips step back so the shade veils star — but stay countable
   (.25 forced a round-trip to all-day just to read a shaded tile's sun) */
.board:not([data-view="day"]) .pips { opacity: .45; }

/* plant on tile */
.tile .crop {
  position: relative;
  z-index: 1;
  line-height: 1;
  animation: pop .25s ease;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.2));
}
@keyframes pop {
  0% { transform: scale(.3); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.tile .drop-badge {
  position: absolute;
  bottom: 2px; right: 4px;
  font-size: .65em;
  z-index: 2;
}
.tile .zone-badge {
  position: absolute;
  top: 2px; right: 3px;
  font-family: "Nunito", sans-serif;
  font-size: .52em;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
  background: #2fa3b5;
  border-radius: 7px;
  padding: 0 4px;
  z-index: 2;
  pointer-events: none;
}
.tile .zone-badge.missed { background: #b9b1a0; }
.tile .friend-badge {
  position: absolute;
  bottom: 2px; left: 3px;
  font-family: "Nunito", sans-serif;
  font-size: .52em;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
  background: #d4566f;
  border-radius: 7px;
  padding: 0 4px;
  z-index: 2;
  pointer-events: none;
}
.tile .friend-badge.foe { background: #8c5a4f; }
.tile .friend-badge.ghost {
  background: rgba(255, 255, 255, .65);
  color: #d4566f;
  border: 1.5px dashed #d4566f;
  padding: 0 3px;
}
.tile .friend-badge.ghost.foe { color: #8c5a4f; border-color: #8c5a4f; }

/* live point worth of each plant — solid = watered, ghost = if watered */
.tile .pts-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: .58em;
  line-height: 1.35;
  color: #ffeebe;
  background: rgba(58, 45, 25, .8);
  border-radius: 8px;
  padding: 0 5.5px;
  z-index: 2;
  pointer-events: none;
}
.tile .pts-badge.ghost {
  background: rgba(58, 45, 25, .38);
  border: 1.5px dashed rgba(58, 45, 25, .55);
  color: #fff8e2;
}
.tile .pts-badge.zero { background: rgba(146, 50, 30, .85); }
/* after Finish, the garden is for admiring, not auditing */
.board.resolved .pts-badge { display: none; }

.bot-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 1rem;
  background: #4a3b2a;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.bot-banner[hidden] { display: none; }

/* install nudge: a gentle flow banner above the masthead (pushes content
   down — never overlaps the mobile seed tray). Android shows the "Add"
   button (fires the real prompt); iOS shows the Share→Add hint instead. */
.install-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #5d8f4e;
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.3;
}
.install-nudge .em { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.install-text { flex: 1 1 auto; }
.install-go {
  flex: 0 0 auto;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: .85rem;
  background: #fff;
  color: #3c6b2f;
  border: none;
  border-radius: 999px;
  padding: 5px 15px;
  cursor: pointer;
}
.install-go:active { transform: translateY(1px); }
.install-x {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .85);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.install-nudge[hidden] { display: none; }
.install-ios { display: none; }
.install-nudge.ios .install-android { display: none; }
.install-nudge.ios .install-ios { display: inline; }
.install-nudge.ios .install-go { display: none; }

/* projected-status ring */
.tile.status-thrive { box-shadow: inset 0 0 0 3px var(--thrive); }
.tile.status-ok     { box-shadow: inset 0 0 0 3px var(--ok); }
.tile.status-dead   { box-shadow: inset 0 0 0 3px var(--dead); }

/* resolved looks */
.board.resolved .tile { cursor: default; }
.board.resolved .tile.status-thrive .crop { animation: sway 2.4s ease-in-out infinite; transform-origin: bottom center; }
.board.resolved .tile.status-dead .crop { filter: grayscale(1) brightness(.75); }
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

.board-hint { color: var(--ink-soft); font-size: .85rem; text-align: center; margin: 10px 4px 0; }
/* sun line + running tally: two shoulders of one row (centered text and
   a right chip collide at phone width). Chip goes ghost while thirsty. */
.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 8px;
  /* reserve the chip's height (24px) so the row doesn't collapse — and shift
     the board — when neither the reroll nor the tally chip is showing (e.g.
     a barrel placed then dug up on an otherwise-untouched practice plot, or
     hard mode where the tally chip is hidden entirely) */
  min-height: 1.5rem;
}
.board-meta .arc-label { text-align: left; margin: 0; }
.tally-chip {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(58, 45, 25, .8);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 2px 9px;
}
.tally-chip .em { width: .82rem; height: .82rem; }
.tally-chip.ghost {
  background: rgba(255, 255, 255, .65);
  color: var(--ink);
  border: 1.5px dashed var(--ink-soft);
}
/* the plan outruns the water: the "if watered" promise can't be kept */
.tally-chip.ghost.over {
  color: var(--dead);
  border-color: var(--dead);
}
.tally-chip[hidden] { display: none; }
/* reroll: a tappable twin of the tally chip, terracotta so it reads as a verb */
.reroll-chip {
  cursor: pointer;
  background: var(--terracotta);
  border: 1.5px solid var(--terracotta-deep);
  box-shadow: 0 2px 0 var(--terracotta-deep);
  font-family: inherit;
}
.reroll-chip:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--terracotta-deep); }
.reroll-chip[hidden] { display: none; }
.arc-label {
  text-align: center;
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
}
.par-hint { font-size: .78rem; color: var(--ink-soft); margin: 0 0 10px; }

/* ---------- sidebar panels ---------- */
.panel {
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 3px 0 rgba(122, 106, 82, .12);
}
.panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--leaf-deep);
}

/* seed packet */
.packet { display: flex; flex-direction: column; gap: 6px; }
.seed-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--paper-deep);
  border-radius: 10px;
  padding: 5px 9px;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  transition: transform .1s, border-color .1s;
}
.seed-card:hover:not(:disabled) { transform: translateX(3px); }
.seed-card.is-selected { border-color: var(--terracotta); background: #fff3ea; }
.seed-card:disabled { opacity: .4; cursor: default; }
.seed-emoji { font-size: 1.5rem; line-height: 1; }
.eimg-card { width: 1.55rem; height: 1.55rem; display: block; }
.tile img.crop {
  width: 52%;
  height: 52%;
  object-fit: contain;
  margin-top: 10%;
}
.seed-name { font-weight: 800; font-size: .9rem; display: block; }
.seed-stats {
  font-size: .72rem;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.seed-stats > span { white-space: nowrap; }
/* the heart is heart-pink.svg (a slim classic heart in the row's pink), sized
   through .seed-stats .em like every other icon. The caution triangle is a bold
   shape that fills its whole box, so it reads bigger than the padded crop/heart
   icons at the same box size — shrink it a touch so the row sizes match. */
.seed-stats .em.caution { width: .68rem; height: .68rem; vertical-align: -.1rem; }
.seed-qty {
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 1rem;
  color: var(--leaf-deep);
  background: var(--paper);
  padding: 1px 9px;
  border-radius: 999px;
}

/* water + tools */
.water-meter { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
/* a failed watering shakes the meter — a dry can must never read as a dead button */
.water-meter.denied { animation: deny-shake .4s ease; }
.water-meter.denied .water-label, .water-meter.denied .water-count { color: var(--dead); }
@keyframes deny-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.water-label { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.short-label { display: none; }
.water-count { display: none; font-weight: 800; }
.water-pips { display: flex; gap: 3px; flex-wrap: wrap; }
.wpip {
  width: 11px; height: 14px;
  background: #35aebf;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.12);
}
.wpip.spent { background: #d8d2c2; box-shadow: none; }

.barrel-btn { width: 100%; margin-bottom: 8px; font-size: .85rem; }
.barrel-btn:disabled { opacity: .45; cursor: default; transform: none; }
.tool-row { display: flex; gap: 8px; margin-bottom: 10px; }
.tool-btn {
  flex: 1;
  white-space: nowrap;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: .9rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--paper-deep);
  border-radius: 10px;
  padding: 7px 8px;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.tool-btn:hover { transform: translateY(-2px); }
.tool-btn.is-selected { border-color: var(--terracotta); background: #fff3ea; }
.dock-label { display: none; } /* mobile dock only: tiny label under the tool icon */

.finish-btn {
  width: 100%;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: var(--terracotta);
  border: none;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--terracotta-deep);
  transition: transform .1s, box-shadow .1s;
}
.finish-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--terracotta-deep); }
.finish-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--terracotta-deep); }

/* field notes (under the board) */
.field-notes {
  margin: 14px 6px 0;
  padding-top: 12px;
  border-top: 2px dashed var(--paper-deep);
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 10px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: 999px;
  padding: 4px 13px 4px 9px;
  /* fluid on phones so the longest chip (Hanging on) keeps to one line */
  font-size: clamp(.6rem, 2.8vw, .8rem);
  line-height: 1.2;
}
.status-chip strong { color: var(--ink); font-weight: 800; }
.status-chip em { font-style: normal; color: var(--ink-soft); font-weight: 600; }
.ring { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.ring-thrive { background: var(--thrive); }
.ring-ok { background: var(--ok); }
.ring-dead { background: var(--dead); }
.guide {
  list-style: none;
  margin: 2px auto 0;
  padding: 0;
  max-width: 724px; /* wide enough that every rule stays on one line per column */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 18px;
  text-align: left;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.guide li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 8px;
  align-items: start;
}
.guide strong { color: var(--ink); }
.guide .gi { width: .95rem; height: .95rem; margin-top: .16rem; }
.guide .gi-pip {
  width: .62rem; height: .62rem;
  margin: .3rem auto 0;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7), 0 1px 2px rgba(74, 59, 42, .25);
}
/* winter-only guide lines: "tender" is jargon until someone says it plainly,
   and the generic barrel line is misleading when the barrel can freeze */
.guide .winter-note { display: none; }
body.season-winter .guide .winter-note { display: grid; }
/* two guide columns only when each rule fits on one line; below that,
   one comfortable column */
@media (max-width: 1100px) {
  .guide { grid-template-columns: 1fr; max-width: 480px; }
}
/* dev / practice */
.dev-panel h2 { color: var(--ink-soft); }
.footer { grid-column: 1; text-align: center; }
.version {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(122, 106, 82, .55);
  margin: 4px 0 0;
}
.footnotes {
  font-size: .72rem;
  font-weight: 600;
  color: rgba(122, 106, 82, .55);
  margin: 2px 0 0;
}
.footnotes a { color: inherit; }
.dev-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dev-btn {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: .85rem;
  background: var(--paper);
  border: 2px solid var(--paper-deep);
  border-radius: 9px;
  padding: 5px 9px;
  cursor: pointer;
}
.dev-btn:hover { border-color: var(--terracotta); }

/* ---------- mobile: bottom dock ---------- */
@media (max-width: 720px) {
  .masthead { padding: 12px 16px 4px; }
  .masthead h1 { font-size: 1.9rem; }
  .tagline { font-size: .8rem; }

  .layout {
    grid-template-columns: 1fr;
    padding: 6px 12px 215px; /* clear the fixed dock */
  }
  .board-wrap, .field-notes, .dev-panel, .sidebar { grid-column: auto; grid-row: auto; }
  .dev-panel { justify-self: stretch; }

  /* the sidebar becomes a fixed bottom dock: seed tray + action bar */
  .sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 5;
    background: var(--card);
    border-top: 3px solid var(--paper-deep);
    box-shadow: 0 -8px 22px rgba(74, 59, 42, .18);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .sidebar .panel {
    margin: 0; padding: 0;
    background: none; border: none; box-shadow: none; border-radius: 0;
  }
  .packet-panel h2 { display: none; }

  /* horizontal seed tray */
  .packet {
    flex-direction: row;
    overflow-x: auto;
    gap: 7px;
    padding: 6px 2px 4px;
    -webkit-overflow-scrolling: touch;
  }
  .seed-card {
    flex: 0 0 auto;
    width: 96px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 1px;
    padding: 6px 3px 5px;
    position: relative;
  }
  .seed-card:hover:not(:disabled) { transform: none; }
  .seed-emoji { font-size: 1.55rem; }
  .seed-name { font-size: .7rem; white-space: nowrap; }
  .seed-stats { font-size: .6rem; letter-spacing: 0; justify-content: center; gap: 0 5px; }
  .seed-qty {
    position: absolute;
    top: -7px; right: -5px;
    font-size: .78rem;
    padding: 0 7px;
    border: 2px solid var(--card);
  }

  /* action bar: water chip + barrel + tools + finish in one row */
  .tools-panel { display: flex; align-items: stretch; gap: 4px; margin-top: 8px; }
  .water-meter {
    margin: 0;
    gap: 3px;
    background: var(--paper);
    border-radius: 10px;
    padding: 0 6px;
    flex: 0 0 auto;
  }
  .water-pips { display: none; }
  .water-count { display: inline; }
  .long-label { display: none; }
  .short-label { display: inline; }
  .tool-row { display: contents; }
  .tool-btn { padding: 7px 11px; font-size: 1rem; }
  .barrel-btn { width: auto; margin: 0; font-size: 1rem; }
  /* icon-over-label dock buttons, echoing the sun-phase buttons;
     min-width 0 lets the row compress instead of pushing Finish offscreen */
  .tools-panel .tool-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; padding: 4px 4px 3px;
    min-width: 44px; /* short labels (DIG) match their siblings */
    flex: 0 0 auto; /* tools hug their content; Finish takes the rest */
  }
  .finish-btn { min-width: 0; }
  .tools-panel .dock-label {
    display: block;
    font-size: .52rem; font-weight: 800;
    letter-spacing: .03em; text-transform: uppercase;
    color: var(--ink-soft);
  }
  .finish-btn { flex: 1; width: auto; padding: 8px 6px; font-size: 1rem; }
}

/* ultra-narrow phones: the dock can't fit seven labeled buttons, so fall
   back to icon-only tools (must follow the dock rules above to win the
   cascade), and the status chips step down once more */
@media (max-width: 374px) {
  .tools-panel .dock-label { display: none; }
  .tools-panel .tool-btn { min-width: 0; }
}

/* ---------- guided tutorial ---------- */
/* anchored callout: the confirm-card's little sibling, pointing at one
   tile, seed card, or tool; positioned from JS (positionTutorPop) */
.tutor-pop {
  position: fixed;
  z-index: 30;
  width: min(242px, calc(100vw - 16px));
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: 14px;
  padding: 10px 12px 6px;
  box-shadow: 0 12px 30px rgba(74, 59, 42, .32);
}
.tutor-pop[hidden] { display: none; }
.tutor-pop p {
  margin: 0;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.tutor-pop .em { width: .95em; height: .95em; }
.tutor-pop::after { /* arrow toward the target; --arrow-x set from JS */
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  top: -7px;
  width: 12px; height: 12px;
  background: var(--card);
  border-left: 2px solid var(--paper-deep);
  border-top: 2px solid var(--paper-deep);
  transform: translateX(-50%) rotate(45deg);
}
.tutor-pop.arrow-down::after { /* card sits above its target */
  top: auto; bottom: -7px;
  border-left: none; border-top: none;
  border-right: 2px solid var(--paper-deep);
  border-bottom: 2px solid var(--paper-deep);
}
.tutor-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}
.tutor-count {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
#tutor-skip {
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}
#tutor-skip:hover { color: var(--terracotta-deep); }
#tutor-next { /* "Got it" on look-only steps: a small finish-btn cousin */
  display: block;
  width: 100%;
  margin-top: 8px;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  background: var(--terracotta);
  border: none;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--terracotta-deep);
}
#tutor-next:hover { background: var(--terracotta-deep); }
#tutor-next[hidden] { display: none; }
.tutor-pop.nudge { animation: tutorNudge .3s; }
@keyframes tutorNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
/* the one element the current step wants tapped (no z-index: lifting a
   tile above the scene layer would hide fences and trees drawn over it) */
.tutor-target { animation: tutorPulse 1.3s ease-in-out infinite; }
@keyframes tutorPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--terracotta); }
  50% { box-shadow: 0 0 0 3px var(--terracotta), 0 0 16px 5px rgba(217, 113, 78, .55); }
}

/* the water count bumps whenever it changes, so the budget discovers
   itself even for players who skipped the tutorial */
.water-count.bump {
  display: inline-block; /* spans can't transform */
  animation: waterBump .5s ease;
}
@keyframes waterBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.5); color: #2fa3b5; }
  100% { transform: scale(1); }
}

/* ---------- ribbons (horticulture-show awards on the results card) ---------- */
.ribbon-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 8px;
}
.ribbon-line[hidden] { display: none; }
.ribbon-svg {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
  /* the stamp: falls from above (visible during the fall), squishes flat on
     contact, the recovery goes straight into a swell, then a single shrink
     that dips just under size and clicks back — so it LANDS, not bounces.
     Per-keyframe easing drives the shape; fires a beat after the score fades
     in (see .score-line). */
  animation: ribbonStamp .54s ease .2s both;
}
@keyframes ribbonStamp {
  0%   { opacity: 0; transform: translateY(-58px) scale(1.03); animation-timing-function: cubic-bezier(.5, 0, .85, .3); }
  20%  { opacity: 1; }
  42%  { transform: translateY(0) scale(1.26, .7); animation-timing-function: cubic-bezier(.3, .6, .4, 1); }
  56%  { transform: translateY(0) scale(1.1, 1.1); animation-timing-function: ease-in; }
  84%  { transform: translateY(0) scale(.98, .98); }
  100% { transform: translateY(0) scale(1); }
}
/* Supreme Champion drops farther, slams harder and swells bigger — beating
   the bot should feel unmistakably different from every other tier */
.ribbon-line.is-supreme .ribbon-svg {
  width: 54px;
  height: 54px;
  animation: ribbonStampSupreme .64s ease .22s both;
}
@keyframes ribbonStampSupreme {
  0%   { opacity: 0; transform: translateY(-82px) scale(1.04); animation-timing-function: cubic-bezier(.5, 0, .85, .3); }
  20%  { opacity: 1; }
  40%  { transform: translateY(0) scale(1.36, .6); animation-timing-function: cubic-bezier(.3, .6, .4, 1); }
  54%  { transform: translateY(0) scale(1.18, 1.18); animation-timing-function: ease-in; }
  82%  { transform: translateY(0) scale(.96, .96); }
  100% { transform: translateY(0) scale(1); }
}
/* a single soft gleam slides across the fabric once, clipped to the ribbon
   shape by its own art used as a mask — premium texture, no screen particles */
.ribbon-badge { position: relative; display: inline-block; line-height: 0; }
.ribbon-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  /* the gleam sweeps via background-position (NOT transform) so the mask —
     on this same element — stays pinned to the ribbon shape while it slides */
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .72) 50%, transparent 60%);
  background-size: 250% 100%;
  background-repeat: no-repeat;
  background-position: 150% 0;
  -webkit-mask-image: var(--ribbon-mask);
  mask-image: var(--ribbon-mask);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  animation: ribbonGleam .75s ease-out .72s both;
  pointer-events: none;
}
@keyframes ribbonGleam {
  0%   { background-position: 150% 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { background-position: -50% 0; opacity: 0; }
}
/* the score & skill ease in first; the ribbon stamps onto them */
.score-line { animation: scoreFade .42s ease both; }
@keyframes scoreFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* Supreme-only celebration: a few soft petals & leaves drift behind the
   ribbon, then fade. Spawned in JS (gated to beating the bot) so it stays
   rare; sits below the card's content via the card's isolation context. */
.petal-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  border-radius: 20px;
}
.petal {
  position: absolute;
  top: -8%;
  width: 14px;
  height: 14px;
  opacity: 0;
  border-radius: 0 100% 0 100%;
  animation-name: petalFall;
  animation-timing-function: ease-in;
  animation-fill-mode: both;
  will-change: transform, opacity;
}
.petal-pink  { background: radial-gradient(circle at 30% 30%, rgba(255, 209, 224, .95), rgba(240, 150, 180, .68)); }
.petal-green { background: radial-gradient(circle at 30% 30%, rgba(198, 230, 172, .95), rgba(120, 180, 110, .68)); }
@keyframes petalFall {
  0%   { transform: translate(0, -10px) rotate(0); opacity: 0; }
  12%  { opacity: .7; }
  85%  { opacity: .55; }
  100% { transform: translate(var(--drift, 0), 340px) rotate(var(--spin, 120deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ribbon-svg,
  .ribbon-line.is-supreme .ribbon-svg,
  .score-line { animation: none; }
  .ribbon-badge::after { animation: none; opacity: 0; }
}
.ribbon-name {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.2rem;
  color: #ffe9b8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}

/* ---------- results ---------- */
.results-scrim[hidden] { display: none; }
.results-scrim {
  position: fixed; inset: 0;
  background: rgba(74, 59, 42, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 10;
}

/* themed confirm: a little garden-paper card, also the home of future
   tutorial pop-ups */
.confirm-card {
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: 18px;
  padding: 20px 18px 14px;
  max-width: 330px;
  width: 100%;
  text-align: center;
  box-shadow: 0 14px 36px rgba(74, 59, 42, .35);
}
.confirm-card p {
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions .tool-btn,
.confirm-actions .finish-btn {
  flex: 1; width: auto; font-size: 1rem; padding: 9px 8px;
  white-space: pre-line; /* labels carry their own line breaks so paired buttons match */
  line-height: 1.25;
}
/* the conventional exit, top corner; "Look at garden" retired in its favor */
/* ---------- trophy cabinet & calendar (paper, not dusk: it's a noon visit) ---------- */
.cabinet-card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--paper-deep);
  border-radius: 18px;
  padding: 16px 16px 14px;
  width: min(430px, 100%);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain; /* don't let scroll bleed through to the board behind */
  box-shadow: 0 14px 36px rgba(74, 59, 42, .35);
}
.cabinet-card h2 {
  margin: 0 0 10px;
  font-family: "Baloo 2", sans-serif;
  color: var(--leaf-deep);
  font-size: 1.3rem;
}
.cabinet-card h2 .em { width: 1.1rem; height: 1.1rem; vertical-align: -.12rem; }
.cabinet-card .results-x {
  border-color: var(--paper-deep);
  background: var(--paper);
  color: var(--ink-soft);
}
.cabinet-card .results-x:hover { border-color: var(--terracotta); }
.cabinet-shelf {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  background: var(--paper);
  border: 2px solid var(--paper-deep);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.shelf-slot { display: flex; align-items: center; gap: 3px; font-weight: 800; font-size: .78rem; color: var(--ink); }
.shelf-slot .ribbon-svg { width: 26px; height: 26px; animation: none; filter: none; }
.shelf-slot.none { opacity: .3; }
.cabinet-stats { font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.55; }
.cabinet-stats .em { width: .85rem; height: .85rem; vertical-align: -.12rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-title { font-family: "Baloo 2", sans-serif; font-weight: 700; color: var(--ink); }
.cal-nav {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid var(--paper-deep);
  background: var(--paper);
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: .6rem; font-weight: 800; color: var(--ink-soft);
  text-align: center;
  margin-bottom: 3px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1.5px solid var(--paper-deep);
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: "Nunito", sans-serif;
}
.cal-cell.pad { visibility: hidden; }
.cal-cell.off { opacity: .3; cursor: default; }
.cal-cell.missed { background: transparent; }
.cal-cell.today { border: 2px solid var(--terracotta); }
/* the day whose card is open below — leaf, so it never reads as "today" */
.cal-cell.selected { border: 2px solid var(--leaf-deep); background: #e9f1da; }
.cal-cell i {
  position: absolute; top: 2px; left: 4px;
  font-style: normal; font-size: .55rem; font-weight: 800;
  color: var(--ink-soft);
}
.cal-cell .ribbon-svg { width: 56%; height: 56%; margin-top: 5px; animation: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.cal-cell .em { width: 42%; height: 42%; margin-top: 6px; opacity: .75; } /* sprout: played, no ribbon */
.cal-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
  margin-top: 6px;
  animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes dotPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .55; } }
.cal-detail {
  background: var(--paper);
  border: 2px solid var(--paper-deep);
  border-radius: 12px;
  padding: 8px 11px;
  margin-top: 10px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.6;
}
.cal-detail[hidden] { display: none; }
.cal-detail .em { width: .85rem; height: .85rem; vertical-align: -.12rem; }
.cal-detail-ribbon { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
/* archive: "play this plot" action inside the calendar detail card */
.cal-play {
  display: inline-block;
  margin-top: 6px;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: .8rem;
  background: #5d8f4e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
}
.cal-play:active { transform: translateY(1px); }
/* ribbon + "see the garden" share one row; button hugs the right, wraps if tight */
.cal-detail-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cal-detail-foot .cal-detail-ribbon { margin-top: 0; }
.cal-detail-foot .cal-play { margin-top: 0; margin-left: auto; }
/* pull the rosette left ~3px so its centred-in-the-SVG artwork lines up with
   the text above it (scoped to .cal-detail — does NOT touch the calendar
   cells, results screen, or trophy shelf, which use .ribbon-svg elsewhere) */
.cal-detail .ribbon-svg { width: 20px; height: 20px; animation: none; filter: none; vertical-align: -5px; margin-left: -3px; }
.settings-row { border-top: 2px dashed var(--paper-deep); margin-top: 14px; padding-top: 11px; }
.hard-toggle {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
}
.hard-toggle input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--terracotta); cursor: pointer; }
.hard-toggle strong { color: var(--ink); }

/* settings: backup / restore */
.set-label { font-weight: 800; color: var(--ink); font-size: .9rem; }
.set-hint { font-size: .76rem; color: var(--ink-soft); margin: 4px 0 10px; line-height: 1.5; }
.set-actions { display: flex; flex-direction: column; gap: 8px; }
.set-btn {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: .9rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--paper-deep);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.set-btn:hover { border-color: var(--terracotta); }
.set-btn:active { transform: translateY(1px); }
.set-msg { font-size: .8rem; font-weight: 800; margin: 10px 0 0; }
.set-msg.ok { color: var(--leaf-deep); }
.set-msg.err { color: var(--dead); }

/* hard mode: the math disappears, the truth stays (pips, rings, drops) */
body.hardmode .pts-badge,
body.hardmode .friend-badge,
body.hardmode .zone-badge,
body.hardmode #tally-chip { display: none !important; } /* the SCORE chip, not the reroll verb beside it */

.results-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 240, 210, .25);
  background: rgba(255, 244, 222, .08);
  color: #efe6d2;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.results-x:hover { border-color: rgba(255, 240, 210, .6); }

/* day's end: the card sinks into dusk */
.results-card {
  position: relative;
  isolation: isolate; /* contains the petal layer (z-index:-1) above the card bg, below content */
  background:
    radial-gradient(110% 60% at 85% -8%, rgba(255, 226, 158, .14) 0%, transparent 55%),
    linear-gradient(180deg, #2c3150 0%, #3a3a58 52%, #5e4450 86%, #6e4a48 100%);
  border: 3px solid rgba(255, 240, 210, .14);
  border-radius: 20px;
  padding: 22px 26px;
  max-width: 430px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  overscroll-behavior: contain; /* don't let scroll bleed through to the board behind */
  box-shadow: 0 20px 50px rgba(10, 12, 28, .55);
  animation: rise .3s ease;
  color: #efe6d2;
}
@keyframes rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.results-card h2 { margin: 0 0 12px; color: #f3e7c8; font-size: 1.5rem; }
.score-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.big-score { font-size: 2.9rem; font-weight: 800; color: #ffb178; line-height: 1; }
.big-score small { font-size: .85rem; color: #bfb39b; margin-left: 6px; font-family: "Nunito", sans-serif; font-weight: 800; }
.skill-hero {
  font-size: 1.25rem;
  color: #ffd98a;
  margin-top: 8px;
  font-weight: 700;
}
/* the bot verdict: its own controlled line under the skill number */
.skill-hero .skill-sub {
  display: block;
  font-size: .82rem;
  font-weight: 800;
  margin-top: 3px;
  color: #e8cf9f;
}
.par-score {
  font-weight: 800;
  color: #bfb39b;
  text-align: right;
  font-size: .95rem;
  padding-top: .55rem;
}
.ladder-row { margin-bottom: 4px; white-space: nowrap; }
.ladder-row span { color: #efe6d2; }
.results-tally { font-size: .85rem; color: #cfc3aa; font-weight: 700; margin-bottom: 10px; }
.results-card .par-hint { color: #a99e88; }
.share-text {
  background: rgba(12, 14, 30, .35);
  border: 2px dashed rgba(255, 240, 210, .22);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .8rem;
  line-height: 1.5;
  overflow-x: hidden;
  margin: 0 0 12px;
  color: #efe6d2;
}
.share-head {
  font-family: ui-monospace, Consolas, monospace;
  white-space: pre-line;
  margin-bottom: 8px;
}
.share-grid { display: inline-flex; flex-direction: column; gap: 2px; }
.sg-row { display: flex; gap: 2px; }
.sg-row span {
  width: 1.35em;
  height: 1.35em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  line-height: 1;
}

.results-card .tool-btn {
  background: rgba(255, 244, 222, .08);
  border-color: rgba(255, 240, 210, .22);
  color: #efe6d2;
}
.results-card .tool-btn:disabled { opacity: .35; }
.results-actions { display: flex; flex-direction: column; gap: 8px; }

