:root {
  --ink: #2a2622;
  --ink-soft: #5a5248;
  --cream: #fff8ef;
  --cream-2: #f4ead8;
  --paper: #fffdf8;
  --line: rgba(42, 38, 34, 0.12);
  --accent: #e08a3c;
  --accent-deep: #c46a22;
  --accent-soft: #f6d2a8;
  --sky-top: #7eb8d4;
  --sky-horizon: #f3c989;
  --grass-far: #6fa86a;
  --grass-mid: #4e8f55;
  --grass-near: #3d7a48;
  --soil: #c17a45;
  --cat: #ee9a3c;
  --cat-deep: #d07a22;
  --cat-light: #f7c06a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --radius: 28px;
  --font-ui: "Nunito", "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
  --shadow: 0 10px 28px rgba(42, 38, 34, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: #1d2a28;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

#app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
.screen[hidden], [hidden] { display: none !important; }

/* ——— buttons ——— */
.btn {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.btn.primary {
  background: var(--accent);
  color: #fffdf8;
  box-shadow: 0 8px 0 var(--accent-deep), var(--shadow);
  width: 100%;
}
.btn.primary:active { transform: translateY(3px); box-shadow: 0 5px 0 var(--accent-deep); }
.btn.chip {
  background: var(--paper);
  border: 2px solid var(--line);
  min-width: 72px;
  flex: 1;
  box-shadow: 0 3px 0 rgba(42, 38, 34, 0.08);
}
.btn.chip:active { transform: translateY(2px); box-shadow: none; }
.btn.chip.is-selected {
  background: #2a2622;
  color: var(--cream);
  border-color: #2a2622;
}
.btn.chip.wide { width: 100%; flex: none; }
.btn.text {
  min-height: 48px;
  color: var(--ink-soft);
  font-weight: 700;
  width: 100%;
  background: transparent;
  box-shadow: none;
}
.btn.text.back { width: auto; padding: 0 8px; }

/* ——— morning ——— */
#screen-morning { background: linear-gradient(180deg, #1c2a44 0%, #3d4d6a 38%, #f3c989 72%, #f6e6c8 100%); }
.morning-sky {
  position: relative;
  height: 30vh;
  min-height: 180px;
  max-height: 240px;
}
.morning-sky::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(243, 201, 137, 0.4));
  pointer-events: none;
}
.stars, .stars span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #f7efd2;
  box-shadow:
    40px 30px 0 0.5px #f7efd2,
    90px 70px 0 0 #f7efd2,
    160px 24px 0 1px #f7efd2,
    230px 88px 0 0 #f7efd2,
    280px 40px 0 0.5px #f7efd2,
    60px 110px 0 0 #f7efd2,
    310px 120px 0 0.5px #f7efd2,
    200px 50px 0 0 #f7efd2;
  opacity: 0.85;
  top: 16px; left: 20px;
}
.morning-moon {
  position: absolute;
  top: 18%;
  right: 16%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f7efd2;
  box-shadow: 0 0 40px rgba(247, 239, 210, 0.55);
}
.morning-moon::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(210, 200, 160, 0.45);
  top: 16px; left: 12px;
}
.morning-cat { position: absolute; left: 18%; bottom: 4%; transform: scale(1.15); }
.morning-copy {
  flex: 1;
  background: var(--cream);
  border-radius: 32px 32px 0 0;
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(20, 20, 30, 0.12);
  min-height: 0;
}
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
#screen-morning h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.lede {
  margin: 8px 0 14px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.45;
  max-width: 28ch;
}
.sleep-field { display: block; margin-bottom: 10px; }
.sleep-field > span {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.seed-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  margin: 8px 0 16px;
  color: var(--ink);
}

/* ——— scroll wheels ——— */
.wheels {
  --wheel-item: 44px;
  --wheel-h: 176px;
  position: relative;
  display: flex;
  height: calc(var(--wheel-h) + 22px);
  padding-top: 22px;
  user-select: none;
  -webkit-user-select: none;
}
.sleep-field .wheels {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 22px 6px 0;
  height: calc(var(--wheel-h) + 22px);
  overflow: hidden;
}
.wheel-col {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.wheel-label {
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  pointer-events: none;
  z-index: 3;
}
.wheel {
  height: var(--wheel-h);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  padding-block: calc((var(--wheel-h) - var(--wheel-item)) / 2);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 72%, transparent 100%);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-item {
  height: var(--wheel-item);
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  opacity: 0.35;
  transform: scale(0.86);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.wheel-item.is-active {
  opacity: 1;
  transform: scale(1);
}
.wheel-highlight {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(22px + (var(--wheel-h) - var(--wheel-item)) / 2);
  height: var(--wheel-item);
  border-radius: 12px;
  background: rgba(42, 38, 34, 0.06);
  box-shadow: inset 0 0 0 1px rgba(42, 38, 34, 0.05);
  pointer-events: none;
  z-index: 0;
}

/* ——— log time sheet ——— */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 430px;
  margin: 0 auto;
}
.sheet-root[hidden] { display: none !important; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 24, 20, 0.45);
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
.sheet {
  position: relative;
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  padding: 8px 16px calc(18px + var(--safe-b));
  box-shadow: 0 -12px 40px rgba(20, 20, 30, 0.18);
  transform: translateY(8px);
  animation: sheet-in 0.28s ease-out forwards;
}
@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: rgba(42, 38, 34, 0.18);
  margin: 6px auto 8px;
}
.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px;
  margin-bottom: 4px;
}
.sheet-head h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.sheet-head .btn.text { min-height: 44px; width: auto; padding: 0 8px; }
.sheet-head .btn.text:first-child { justify-self: start; }
.sheet-head .btn.accent {
  justify-self: end;
  color: var(--accent-deep);
  font-weight: 800;
}
.sheet-head .btn.accent:disabled { color: #b5aea4; }
.sheet .wheels {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 22px 6px 0;
  height: calc(var(--wheel-h) + 22px);
  overflow: hidden;
  --wheel-h: 220px;
}
.sheet-preview {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  text-align: center;
  margin: 14px 0 6px;
  min-height: 1.3em;
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .wheel { scroll-behavior: auto; }
}
#start-day { margin-top: auto; }

/* ——— main chrome ——— */
#screen-main {
  padding-top: calc(var(--safe-t) + 8px);
  padding-bottom: calc(var(--safe-b) + 8px);
  background: var(--cream);
  gap: 8px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 0;
  min-height: 44px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 8px;
  background: var(--cat);
  position: relative;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.08);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 8px; height: 10px;
  background: var(--cat);
  top: -5px;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.brand-mark::before { left: 2px; }
.brand-mark::after { right: 2px; }
.brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
}
.demo-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  padding: 6px 4px 6px 10px;
  min-height: 44px;
  user-select: none;
}
.demo-toggle input {
  appearance: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: #d7cfc3;
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
}
.demo-toggle input::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.demo-toggle input:checked { background: var(--accent); }
.demo-toggle input:checked::after { transform: translateX(16px); }

.stats { padding: 2px 22px 6px; }
.win-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.caught-total {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 15px;
  margin-top: 2px;
}

/* ——— garden scene ——— */
.scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
  margin: 0 14px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #b8d7e6 40%, var(--sky-horizon) 62%, #8fbf72 63%, var(--grass-near) 100%);
  box-shadow: var(--shadow), inset 0 -24px 30px rgba(30, 60, 30, 0.12);
  isolation: isolate;
}
.sky { position: absolute; inset: 0 0 38% 0; }
.sun {
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #ffe08a;
  box-shadow: 0 0 30px rgba(255, 210, 100, 0.7);
  top: 14%;
  right: 16%;
  transition: top 1s linear, right 1s linear, background 1s linear, opacity 1s linear;
}
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.86);
  height: 18px;
  border-radius: 20px;
  animation: drift 28s linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
  bottom: 4px;
}
.cloud::before { width: 22px; height: 22px; left: 10px; }
.cloud::after { width: 16px; height: 16px; right: 10px; }
.cloud.c1 { width: 70px; top: 16%; left: 8%; animation-duration: 36s; }
.cloud.c2 { width: 54px; top: 28%; left: 48%; animation-duration: 44s; opacity: 0.8; }
.cloud.c3 { width: 42px; top: 12%; left: 70%; animation-duration: 30s; opacity: 0.7; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(40px); }
}

.hills { position: absolute; inset: 0; pointer-events: none; }
.hill {
  position: absolute;
  border-radius: 50%;
  background: var(--grass-far);
}
.hill.far {
  width: 140%; height: 56%;
  left: -20%; bottom: 18%;
  background: #8fbf78;
}
.hill.mid {
  width: 90%; height: 46%;
  left: -30%; bottom: 8%;
  background: var(--grass-mid);
}
.hill.near {
  width: 120%; height: 42%;
  right: -40%; bottom: -8%;
  background: var(--grass-near);
}

.ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18%;
  background: linear-gradient(180deg, rgba(61,122,72,0) 0%, #2f5e38 100%);
}

.tod {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(42, 38, 34, 0.7);
  background: rgba(255, 248, 239, 0.7);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
}

/* props */
.prop { position: absolute; pointer-events: none; }
.bamboo { left: 10%; bottom: 22%; display: flex; gap: 6px; align-items: flex-end; }
.bamboo span {
  display: block;
  width: 7px;
  background: repeating-linear-gradient(#7db86a 0 18px, #5a934d 18px 20px);
  border-radius: 4px;
  box-shadow: 2px 0 0 rgba(0,0,0,0.06);
}
.bamboo span:nth-child(1) { height: 88px; }
.bamboo span:nth-child(2) { height: 114px; }
.bamboo span:nth-child(3) { height: 70px; }

.birdbath { left: 32%; bottom: 16%; width: 44px; }
.bath-bowl {
  width: 44px; height: 14px;
  background: #d9d4c8;
  border-radius: 4px 4px 40% 40%;
  box-shadow: inset 0 4px 0 #8eb4c8, inset 0 7px 0 rgba(255,255,255,0.4);
}
.bath-stem { width: 8px; height: 28px; margin: 0 auto; background: #cfc8ba; }
.bath-base { width: 24px; height: 6px; margin: 0 auto; background: #cfc8ba; border-radius: 50%; }

.planter { bottom: 10%; width: 36px; }
.planter.p1 { right: 18%; }
.planter.p2 { right: 7%; bottom: 18%; }
.planter .pot {
  height: 22px;
  background: linear-gradient(#d4895a, #b56a3d);
  border-radius: 2px 2px 8px 8px;
  position: relative;
}
.planter .pot::before {
  content: "";
  position: absolute;
  left: -3px; right: -3px; top: 0;
  height: 7px;
  background: #e09a6a;
  border-radius: 3px;
}
.planter .leaves { position: relative; height: 28px; }
.planter .leaves i {
  position: absolute;
  width: 14px; height: 22px;
  background: #3f8f4c;
  border-radius: 80% 0 80% 0;
  bottom: 0;
}
.planter .leaves i:nth-child(1) { left: 2px; transform: rotate(-30deg); }
.planter .leaves i:nth-child(2) { left: 12px; transform: rotate(20deg); background: #4ea15b; height: 26px; }
.planter .leaves i:nth-child(3) { left: 20px; transform: rotate(48deg); }
.planter .leaves.basil i { background: #2f7a43; }
.planter .leaves.basil i:nth-child(2) { background: #3d9154; }

.fern { display: none; }

/* ——— cat ——— */
.cat-wrap {
  position: absolute;
  left: 54%;
  bottom: 16%;
  z-index: 5;
  transform-origin: 50% 100%;
}
.cat {
  position: relative;
  width: 86px;
  height: 70px;
  transform-origin: 50% 80%;
}
.cat-body {
  position: absolute;
  left: 18px; bottom: 4px;
  width: 52px; height: 34px;
  background: radial-gradient(circle at 30% 30%, var(--cat-light), var(--cat) 55%, var(--cat-deep));
  border-radius: 22px 22px 16px 16px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.06);
}
.cat-stripe {
  position: absolute;
  background: var(--cat-deep);
  opacity: 0.45;
  border-radius: 4px;
}
.cat-stripe.s1 { width: 8px; height: 22px; left: 16px; top: 4px; transform: rotate(12deg); }
.cat-stripe.s2 { width: 8px; height: 18px; left: 28px; top: 6px; transform: rotate(12deg); }
.cat-head {
  position: absolute;
  left: 6px; top: 4px;
  width: 40px; height: 36px;
  background: var(--cat);
  border-radius: 50% 50% 46% 46%;
  z-index: 2;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.05);
}
.cat-ear {
  position: absolute;
  top: -8px;
  width: 14px; height: 16px;
  background: var(--cat);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.cat-ear.left { left: 2px; transform: rotate(-12deg); }
.cat-ear.right { right: 2px; transform: rotate(12deg); }
.cat-ear::after {
  content: "";
  position: absolute;
  left: 4px; top: 6px;
  width: 6px; height: 8px;
  background: #f3c0b0;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.cat-eye {
  position: absolute;
  top: 15px;
  width: 7px; height: 7px;
  background: #2a2622;
  border-radius: 50%;
}
.cat-eye.left { left: 9px; }
.cat-eye.right { right: 9px; }
.cat.is-idle .cat-eye { animation: blink 5s infinite; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.08); }
}
.cat-nose {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 6px; height: 4px;
  margin-left: -3px;
  background: #c45a4a;
  border-radius: 50%;
}
.cat-tail {
  position: absolute;
  right: -2px;
  bottom: 16px;
  width: 28px; height: 10px;
  background: var(--cat);
  border-radius: 10px 10px 10px 0;
  transform-origin: 0 50%;
  transform: rotate(20deg);
}
.cat.is-idle .cat-tail { animation: swish 2.6s ease-in-out infinite; }
@keyframes swish {
  0%, 100% { transform: rotate(16deg); }
  50% { transform: rotate(38deg); }
}

/* curled morning cat */
.cat.is-curled { width: 78px; height: 52px; }
.cat.is-curled .cat-body {
  left: 12px; bottom: 0; width: 56px; height: 28px; border-radius: 20px;
}
.cat.is-curled .cat-head { left: 36px; top: 0; }
.cat.is-curled .cat-tail {
  left: 4px; right: auto; bottom: 8px;
  transform: rotate(-30deg);
  animation: none;
}
.cat.is-curled .cat-eye {
  height: 2px; border-radius: 2px; top: 17px;
  animation: none;
}

/* catch choreography */
.cat.is-stalk { animation: stalk 0.45s ease-out forwards; }
@keyframes stalk {
  to { transform: translate(8px, 6px) scale(1.02, 0.9); }
}
.cat.is-pounce { animation: pounce 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes pounce {
  0% { transform: translate(0, 0) rotate(0); }
  35% { transform: translate(-28px, -54px) rotate(-18deg) scale(1.08, 0.92); }
  70% { transform: translate(-64px, -10px) rotate(-8deg) scale(0.96, 1.06); }
  100% { transform: translate(-58px, 0) rotate(0) scale(1); }
}
.cat.is-chase { animation: chase 0.9s ease-in-out forwards; }
@keyframes chase {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-30px, -16px); }
  50% { transform: translate(-70px, 4px) scaleX(-1); }
  75% { transform: translate(-20px, -20px) scaleX(-1); }
  100% { transform: translate(0, 0); }
}
.cat.is-tumble { animation: tumble 0.9s ease-in-out forwards; }
@keyframes tumble {
  0% { transform: translate(0,0) rotate(0); }
  40% { transform: translate(-40px, -36px) rotate(-200deg); }
  70% { transform: translate(-70px, 4px) rotate(-340deg); }
  100% { transform: translate(-50px, 0) rotate(-360deg); }
}
.cat.is-smug { animation: smug 0.8s ease-out forwards; }
@keyframes smug {
  0% { transform: translate(0, 0); }
  40% { transform: translate(-36px, -20px); }
  100% { transform: translate(-30px, 4px); }
}
.cat.is-smug .cat-eye,
.cat.is-smug-sit .cat-eye,
.cat.is-pounce.is-landed .cat-eye {
  height: 3px;
  border-radius: 2px;
  top: 17px;
  animation: none;
}

/* ——— gremlins ——— */
#gremlin-layer { position: absolute; inset: 0; z-index: 4; }
.gremlin {
  position: absolute;
  width: 40px;
  height: 44px;
  transform: translate(-50%, -100%);
  animation: bob 2.4s ease-in-out infinite;
  z-index: 4;
  filter: drop-shadow(0 2px 0 rgba(30, 24, 16, 0.35));
}
.gremlin .g-body {
  position: absolute;
  left: 6px; bottom: 5px;
  width: 28px; height: 26px;
  border-radius: 14px 14px 10px 10px;
  background: var(--g, #7a5ea7);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.14), inset 0 6px 0 rgba(255,255,255,0.16);
}
.gremlin .g-ear {
  position: absolute;
  top: 0;
  width: 12px; height: 14px;
  background: var(--g, #7a5ea7);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.gremlin .g-ear.l { left: 3px; transform: rotate(-16deg); }
.gremlin .g-ear.r { right: 3px; transform: rotate(16deg); }
.gremlin .g-eye {
  position: absolute;
  bottom: 16px;
  width: 6px; height: 7px;
  background: #1c1a18;
  border-radius: 50%;
  z-index: 1;
}
.gremlin .g-eye.l { left: 11px; }
.gremlin .g-eye.r { right: 11px; }
.gremlin .g-foot {
  position: absolute;
  bottom: 0;
  width: 9px; height: 7px;
  background: var(--g, #7a5ea7);
  border-radius: 40% 40% 40% 40%;
  z-index: 0;
}
.gremlin .g-foot.l { left: 7px; }
.gremlin .g-foot.r { right: 7px; }
.gremlin .g-eye::after {
  content: "";
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  top: 1px; left: 1px;
}
.gremlin.type-a { --g: #7a5ea7; }
.gremlin.type-b { --g: #c45b8c; }
.gremlin.type-c { --g: #d4653a; }
.gremlin.type-d { --g: #2e8f8f; }
.gremlin.is-caught {
  animation: evict 0.55s ease-in forwards;
}
@keyframes bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -5px; }
}
@keyframes evict {
  0% { opacity: 1; transform: translate(-50%, -100%) scale(1) rotate(0); }
  40% { opacity: 1; transform: translate(-50%, -160%) scale(1.15) rotate(-20deg); }
  100% { opacity: 0; transform: translate(-50%, -40%) scale(0.3) rotate(50deg); }
}

/* ——— panels ——— */
.panel {
  padding: 10px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.quick-row .btn.chip {
  min-width: 0;
  padding: 0 4px;
  font-size: 16px;
}
.duration-row { display: flex; gap: 10px; }
.btn.chip.wide { width: 100%; flex: none; }
.panel-kicker {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 14px;
}
.timer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 72px;
  letter-spacing: -0.04em;
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  padding: 6px 0 4px;
}
.catch-panel { padding-bottom: 8px; }
.catch-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  text-align: center;
}
.flavor {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  text-align: center;
  min-height: 4.2em;
  padding: 0 6px;
}

/* ——— share ——— */
#screen-share {
  background: #eadcc4;
  padding-top: calc(var(--safe-t) + 8px);
  padding-bottom: calc(var(--safe-b) + 12px);
}
#screen-share .topbar { padding-left: 10px; padding-right: 16px; }
.topbar-spacer { width: 52px; }
.share-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  min-height: 0;
}
#share-card {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(42, 38, 34, 0.22);
  background: #fff;
}
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 18px 0;
}

/* scene phase tweaks via data-phase */
.scene[data-phase="afternoon"] {
  background: linear-gradient(180deg, #6eb0d4 0%, #c5e0ef 42%, #f0d9a0 62%, #8fbf72 63%, var(--grass-near) 100%);
}
.scene[data-phase="evening"] {
  background: linear-gradient(180deg, #5a6ea8 0%, #c97b6a 42%, #f0b27a 62%, #4e7a4a 63%, #2f5e38 100%);
}
.scene[data-phase="evening"] .sun { background: #ff9a62; box-shadow: 0 0 30px rgba(255, 120, 60, 0.55); }
.scene[data-phase="evening"] .tod { color: rgba(255,248,239,0.9); background: rgba(42,38,34,0.35); }
.scene[data-phase="evening"] .cloud { background: rgba(255, 220, 200, 0.7); }

@media (prefers-reduced-motion: reduce) {
  .cat.is-idle .cat-tail,
  .cat.is-idle .cat-eye,
  .cloud,
  .gremlin { animation: none; }
  .cat.is-pounce, .cat.is-chase, .cat.is-tumble, .cat.is-smug, .cat.is-stalk {
    animation-duration: 0.01ms;
  }
}
