/*
   Calmio — warm, healing palette
   linen   #F7F2E9  page background (soft beige)
   card    #FFFDF8  cards (warm white)
   ink     #3D332A  text (warm espresso, softer than black)
   cacao   #8A5A44  primary actions, links
   oat     #F0E6D6  soft fills
   rose    #C4788C  "share love" accent
   gold    #D9A441  star ratings
   signal  #B3492F  emergency (warm brick)
   Type: Fraunces (display) / Atkinson Hyperlegible (body)
*/

:root {
  --paper: #f7f2e9;
  --card: #fffdf8;
  --ink: #3d332a;
  --ink-soft: #82735f;
  --cacao: #8a5a44;
  --cacao-deep: #6e4534;
  --oat: #f0e6d6;
  --oat-line: #e2d4be;
  --blossom: #c4788c;
  --blossom-soft: #f9ecef;
  --gold: #d9a441;
  --signal: #b3492f;
  --signal-soft: #fbede8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 12px rgba(90, 70, 50, 0.09);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Atkinson Hyperlegible", "Verdana", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.8em; }
a { color: var(--cacao); }

.muted { color: var(--ink-soft); font-size: 0.9rem; }
.tiny  { color: var(--ink-soft); font-size: 0.8rem; }

/* Layout shell */
body { min-height: 100vh; display: flex; flex-direction: column; }
.shell {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.shell > .view, .shell > header { flex-shrink: 0; }

header.topbar[hidden] { display: none !important; }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.brand, .locklogo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--cacao-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .dot, .locklogo .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cacao);
  display: inline-block;
}

nav.mainnav { display: flex; gap: 6px; flex-wrap: wrap; }
nav.mainnav button {
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
nav.mainnav button:hover { background: var(--oat); color: var(--ink); }
nav.mainnav button.active { background: var(--cacao); color: #fff; }

.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.quickhide {
  font-family: var(--font-body);
  font-size: 0.8rem;
  border: 1.5px solid var(--oat-line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
}
.quickhide:hover { background: var(--oat); color: var(--ink); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cacao);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 74px; height: 74px; font-size: 1.6rem; }
.linklike {
  background: none; border: none;
  color: var(--cacao);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

/* Views */
.view { display: none; animation: fadein 0.25s ease; }
.view.visible { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Hero greeting (signature element) */
.hero {
  position: relative;
  padding: 34px 28px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
}
.hero .breath {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--oat) 0%, transparent 70%);
  animation: breathe 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe {
  0%, 100% { transform: scale(1);   opacity: 0.8; }
  50%      { transform: scale(1.25); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .breath { animation: none; }
  .view { animation: none; }
}
.hero h1 { color: var(--cacao-deep); }

/* Cards & grid */
.grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--oat);
}
.list-item:last-child { border-bottom: none; }
.list-item a { font-weight: 700; text-decoration: none; }
.list-item a:hover { text-decoration: underline; }

.pill {
  display: inline-block;
  background: var(--oat);
  color: var(--cacao-deep);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 2px 10px;
  margin-right: 6px;
}
.pill.love { background: var(--blossom-soft); color: var(--blossom); }
.pill.lock { background: var(--oat); color: var(--ink-soft); font-family: var(--font-body); font-weight: 400; }

.notice {
  background: var(--blossom-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.notice b { color: var(--blossom); }

/* Forms */
label { display: block; font-weight: 700; font-size: 0.9rem; margin: 14px 0 5px; }
/* Every text-like field, defined by exclusion so a new input type
   (email, search, tel...) can never be accidentally left unstyled. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]),
textarea, select {
  width: 100%;
  border: 1.5px solid var(--oat-line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}
input:disabled { background: var(--oat); color: var(--ink-soft); cursor: not-allowed; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(138, 90, 68, 0.35);
  outline-offset: 1px;
}

.btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  background: var(--cacao);
  color: #fff;
  margin-top: 14px;
}
.btn:hover { background: var(--cacao-deep); }
.btn.secondary { background: var(--oat); color: var(--cacao-deep); }
.btn.secondary:hover { background: var(--oat-line); }
.btn.love { background: var(--blossom); }
.btn.love:hover { filter: brightness(0.92); }
.btn.danger { background: var(--signal); }
.btn.small { padding: 8px 16px; font-size: 0.88rem; margin-top: 8px; }

/* Anonymous toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.switch { position: relative; width: 48px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--oat-line);
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--cacao); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* Tabs (share thoughts / share love) */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  border: 1.5px solid var(--oat-line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
}
.tabs button.active { background: var(--cacao); border-color: var(--cacao); color: #fff; }
.tabs button.active.tab-love { background: var(--blossom); border-color: var(--blossom); }

/* Scheduling */
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.slot-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1.5px solid var(--oat-line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
}
.slot-btn:hover { border-color: var(--cacao); background: var(--oat); }
.gcal-btn {
  display: inline-block;
  background: var(--oat);
  color: var(--cacao-deep);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 7px 14px;
  margin-top: 6px;
}
.gcal-btn:hover { background: var(--oat-line); }

/* Emergency */
.crisis-box {
  background: var(--signal-soft);
  border: 2px solid var(--signal);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.crisis-box h2 { color: var(--signal); }
.crisis-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(179, 73, 47, 0.2);
  flex-wrap: wrap;
}
.crisis-line:last-child { border-bottom: none; }
.call-btn {
  display: inline-block;
  background: var(--signal);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  flex: none;
}
.call-btn:hover { background: #96391f; }

/* Conversations */
.thread { margin-top: 10px; }
.bubble {
  max-width: 85%;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--oat);
}
.bubble.mine { background: var(--cacao); color: #fff; margin-left: auto; }
.bubble .tiny { display: block; margin-top: 3px; }
.bubble.mine .tiny { color: rgba(255,255,255,0.75); }

/* AI helper */
.chatlog {
  border: 1.5px solid var(--oat-line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 14px;
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.chatrow { display: flex; margin-bottom: 10px; }
.chatrow.user { justify-content: flex-end; }
.chatmsg {
  max-width: 80%;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--oat);
}
.chatrow.user .chatmsg { background: var(--cacao); color: #fff; }
.chat-inputrow { display: flex; gap: 8px; }
.chat-inputrow input { flex: 1; }
.chat-inputrow .btn { margin-top: 0; }

.demo-banner {
  background: #fdf6e3;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Welcome */
.welcome-wrap {
  max-width: 560px;
  margin: 6vh auto 0;
}
.role-row { display: flex; gap: 10px; margin-top: 6px; }
.role-row button {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--oat-line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  color: var(--ink-soft);
}
.role-row button.active { border-color: var(--cacao); color: var(--cacao-deep); background: var(--oat); }

/* Testimonials — People we have helped */
.testimonial {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--oat);
}
.testimonial:last-child { border-bottom: none; }
.testimonial .avatar { width: 44px; height: 44px; }
.testimonial .stars-static { color: var(--gold); letter-spacing: 2px; font-size: 0.95rem; }
.testimonial blockquote {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink);
}

/* Star rating buttons (delete flow) */
.stars { display: flex; gap: 4px; margin-top: 4px; }
.stars button {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--oat-line);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.stars button.on { color: var(--gold); }

/* Settings extras */
.profile-photo-row { display: flex; align-items: center; gap: 16px; margin: 14px 0 4px; }
.danger-zone {
  margin-top: 34px;
  border: 2px solid var(--signal);
  border-radius: var(--radius);
  background: var(--signal-soft);
  padding: 18px 20px;
}
.danger-zone h2 { color: var(--signal); }

/* Check-in / delete modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 51, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(61, 51, 42, 0.25);
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 26px 22px;
  animation: fadein 0.25s ease;
}
.modal h2 { color: var(--cacao-deep); }
.modal .btn { width: 100%; margin-top: 10px; }
.modal .crisis-line { border-bottom: 1px solid var(--oat); }
.soothe {
  background: var(--oat);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 1.02rem;
}

/* Lock screen (quick hide / auto-lock) */
.lockscreen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}
.lockscreen.open { display: flex; }
.lockcard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.lockcard .locklogo { justify-content: center; margin-bottom: 8px; }
.lockcard input { margin-top: 10px; text-align: center; }
.lockcard .btn { width: 100%; }
.lockcard .linklike { display: inline-block; margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 70;
}
.toast.show { opacity: 1; }

/* ---------- Site footer (every page) ---------- */
.site-footer {
  margin-top: auto;                /* sticks to the very bottom of the page */
  padding: 28px 8px 88px;          /* extra bottom room so the report button never covers it */
  border-top: 1px solid var(--oat-line);
  text-align: center;
  font-size: 0.86rem;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--cacao);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover { color: var(--cacao-deep); }

/* ---------- Report-a-problem button (bottom right) ---------- */
.report-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--oat-line);
  background: var(--card);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(61, 51, 42, 0.16);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 60;
}
.report-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(61, 51, 42, 0.22);
}

/* ---------- Privacy policy modal body ---------- */
.privacy-body {
  max-height: 46vh;
  overflow-y: auto;
  font-size: 0.92rem;
  padding-right: 4px;
}
.privacy-body p { margin: 0 0 12px; }

/* ---------- Logo (wordmark left of the mark, plain text, no link) ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}
.logo-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--cacao-deep);
  line-height: 1;
}
.logo-dot { color: var(--blossom); }
.logo-mark { width: 30px; height: 30px; flex-shrink: 0; }

/* ---------- Pager (arrows above the box, left and right aligned) ---------- */
.pager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}
.pager-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--cacao-deep);
  text-align: center;
  flex: 1;
}
.arrow-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--oat-line);
  background: var(--card);
  color: var(--cacao);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(61, 51, 42, 0.10);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}
.arrow-btn:hover {
  background: var(--oat);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(61, 51, 42, 0.15);
}
.arrow-btn:active { transform: translateY(0); }

/* ---------- Booking calendar table ---------- */
.cal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  border: 1px solid var(--oat-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(61, 51, 42, 0.06);
  font-size: 0.82rem;
}
.cal-table th, .cal-table td {
  border: 1px solid var(--oat-line);
  text-align: center;
  padding: 0;
}
.cal-table thead th {
  background: var(--oat);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cacao-deep);
  padding: 8px 2px;
  font-size: 0.86rem;
}
.cal-table thead th.wknd { background: #8d867c; color: #f4efe6; }
.cal-date { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-soft); }
.cal-table thead th.wknd .cal-date { color: #ddd6ca; }
.cal-hourcol {
  width: 62px;
  background: var(--oat);
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--ink-soft);
  padding: 6px 4px;
}
.cal-cell { height: 42px; }
.cal-cell.free { background: #ffffff; }
.cal-cell.free button, .cal-cell.mine button {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--cacao);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.cal-cell.free button:hover { background: var(--oat); }
.cal-cell.taken {                 /* booked by someone else: dark gray */
  background: #8f8a82;
  color: #f4efe6;
  font-weight: 700;
  font-size: 0.76rem;
}
.cal-cell.wknd { background: #8d867c; }        /* school closed on weekends */
.cal-cell.closed {                             /* past / too close to start */
  background: #ece5d8;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(61,51,42,0.05) 5px, rgba(61,51,42,0.05) 10px);
}
.cal-cell.mine { background: var(--blossom); }
.cal-cell.mine button { color: #ffffff; }
.cal-cell.mine button:hover { background: rgba(0,0,0,0.08); }

.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.cal-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--oat-line);
  vertical-align: -1px;
  margin-right: 5px;
}
.dot-free   { background: #ffffff; }
.dot-mine   { background: var(--blossom); border-color: var(--blossom); }
.dot-taken  { background: #8f8a82; border-color: #8f8a82; }
.dot-closed { background: #ece5d8; }

/* ---------- Responsive: phones and small tablets ---------- */
@media (max-width: 700px) {
  /* Only Mon-Fri fits on small screens - the school is closed weekends anyway */
  .cal-table th.wknd, .cal-table td.wknd { display: none; }
  .cal-table { font-size: 0.74rem; }
  .cal-hourcol { width: 46px; font-size: 0.66rem; }
  .cal-cell { height: 38px; }
  .cal-table thead th { font-size: 0.76rem; padding: 6px 1px; }
}

@media (max-width: 760px) {
  .shell { padding: 0 12px 0; }
  header.topbar { row-gap: 4px; }
  nav.mainnav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  nav.mainnav::-webkit-scrollbar { display: none; }
  nav.mainnav button { white-space: nowrap; padding: 7px 12px; font-size: 0.9rem; }
  h1 { font-size: 1.6rem; }
  .card { padding: 18px 14px; }
  .hero { padding: 26px 16px; }
  .role-row { flex-wrap: wrap; }
  .modal { width: 92vw; max-width: 92vw; max-height: 85vh; overflow-y: auto; }
  .report-fab { width: 46px; height: 46px; right: 14px; bottom: 14px; }
  .site-footer { padding: 14px 8px 78px; font-size: 0.8rem; }
  .grid { gap: 14px; }
  .profile-photo-row { flex-wrap: wrap; }
  .student-head { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .logo-word { font-size: 1.15rem; }
  .logo-mark { width: 24px; height: 24px; }
  .whoami { font-size: 0.85rem; }
  h1 { font-size: 1.4rem; }
}

/* ===================== The Garden ===================== */
.garden-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--oat-line);
  box-shadow: 0 4px 16px rgba(61, 51, 42, 0.08);
  margin-top: 8px;
  background: #eef0dd;
}
.garden-svg { display: block; width: 100%; height: auto; }

/* gentle life in the scene */
.gsun { animation: gbreathe 9s ease-in-out infinite; transform-origin: 760px 72px; }
@keyframes gbreathe { 0%,100% { opacity: 0.8; } 50% { opacity: 1; } }
.gcloud1 { animation: gdrift 95s linear infinite; }
.gcloud2 { animation: gdrift 140s linear infinite reverse; }
@keyframes gdrift { from { transform: translateX(-120px); } to { transform: translateX(980px); } }
.gtree { animation: gsway 8s ease-in-out infinite alternate; transform-origin: 104px 268px; transform-box: view-box; }
@keyframes gsway { from { transform: rotate(-0.7deg); } to { transform: rotate(0.9deg); } }
.gripple { animation: gripple 5s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.gr2 { animation-delay: 2.4s; }
@keyframes gripple { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
.gbfly { animation: gfly1 18s ease-in-out infinite; }
.gb2 { animation: gfly2 24s ease-in-out infinite; }
.gwings { animation: gflap 0.5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes gflap { from { transform: scaleX(1); } to { transform: scaleX(0.45); } }
@keyframes gfly1 {
  0% { transform: translate(240px, 210px); } 25% { transform: translate(420px, 170px); }
  50% { transform: translate(560px, 230px); } 75% { transform: translate(380px, 260px); }
  100% { transform: translate(240px, 210px); }
}
@keyframes gfly2 {
  0% { transform: translate(660px, 250px); } 30% { transform: translate(520px, 200px); }
  60% { transform: translate(300px, 240px); } 100% { transform: translate(660px, 250px); }
}
.gflower {
  animation: gsway 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: bottom center;
}
.gtwinkle { animation: gtwinkle 2.6s ease-in-out infinite; }
@keyframes gtwinkle { 0%,100% { opacity: 0; } 50% { opacity: 0.9; } }
.gpop { animation: gpop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes gpop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* watering effect */
.water-fx { position: absolute; inset: 0; pointer-events: none; }
.water-fx i {
  position: absolute;
  top: -12px;
  width: 4px;
  height: 12px;
  border-radius: 999px;
  background: #9dc4d1;
  opacity: 0.85;
  animation: gdrop 1.1s ease-in forwards;
}
@keyframes gdrop { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(105%) translateY(420px); opacity: 0; } }

/* stats bar */
.garden-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.garden-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.gstat { display: flex; flex-direction: column; }
.gstat b { font-family: var(--font-display); font-size: 1.25rem; color: var(--cacao-deep); }

/* earn list */
.earn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--oat-line);
  border-radius: 10px;
  margin-top: 8px;
  background: var(--card);
}
.earn-row b { margin-left: auto; color: var(--cacao); }
.earn-row.done { background: var(--oat); }
.earn-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--oat-line);
  background: #fff;
  color: #5f8a52;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.earn-row.done .earn-check { background: #eaf1e2; border-color: #b9d08b; }

/* collection */
.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.coll-item {
  border: 1px solid var(--oat-line);
  border-radius: 12px;
  background: var(--card);
  padding: 8px 4px 6px;
  text-align: center;
}
.coll-item svg { width: 44px; height: 64px; }
.coll-item span { display: block; font-size: 0.68rem; color: var(--ink-soft); line-height: 1.2; }
.coll-item.unknown { opacity: 0.6; }

/* reveal (item-drop) */
.reveal-backdrop { background: rgba(61, 51, 42, 0.55); }
.reveal-stage {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 34px 30px 28px;
  width: min(400px, 92vw);
  text-align: center;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(61, 51, 42, 0.35);
  animation: gpop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-rays {
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg, rgba(217, 164, 65, 0.14) 0deg 12deg, transparent 12deg 24deg);
  animation: gspin 16s linear infinite;
  pointer-events: none;
}
@keyframes gspin { to { transform: rotate(360deg); } }
.reveal-flower { position: relative; width: 150px; height: 200px; margin: 0 auto; animation: grise 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards; }
.reveal-flower svg { width: 100%; height: 100%; }
@keyframes grise { from { transform: scale(0.2) translateY(40px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.reveal-kicker {
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 4px 0 0;
}
#reveal-name { position: relative; margin: 2px 0 4px; }
.reveal-sparkles i {
  position: absolute;
  width: 7px; height: 7px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: gtwinkle 1.8s ease-in-out infinite;
}
.reveal-sparkles i:nth-child(1) { top: 12%; left: 14%; }
.reveal-sparkles i:nth-child(2) { top: 20%; right: 12%; animation-delay: 0.3s; }
.reveal-sparkles i:nth-child(3) { top: 46%; left: 8%;  animation-delay: 0.6s; }
.reveal-sparkles i:nth-child(4) { top: 40%; right: 7%; animation-delay: 0.9s; }
.reveal-sparkles i:nth-child(5) { top: 64%; left: 16%; animation-delay: 1.2s; }
.reveal-sparkles i:nth-child(6) { top: 60%; right: 18%; animation-delay: 0.45s; }
.reveal-sparkles i:nth-child(7) { top: 8%;  left: 48%; animation-delay: 0.75s; }
.reveal-sparkles i:nth-child(8) { top: 70%; left: 46%; animation-delay: 1.05s; }

@media (prefers-reduced-motion: reduce) {
  .gsun, .gcloud1, .gcloud2, .gtree, .gripple, .gbfly, .gwings, .gflower,
  .gtwinkle, .reveal-rays, .reveal-flower { animation: none !important; }
}
@media (max-width: 700px) {
  .garden-bar { flex-direction: column; align-items: stretch; }
  .garden-stats { justify-content: space-between; }
  .coll-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* ---------- Crisis line editor (admin) ---------- */
.crisis-edit-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 90px auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.crisis-edit-row input { margin: 0; }
@media (max-width: 700px) {
  .crisis-edit-row { grid-template-columns: 1fr 1fr; }
  .crisis-edit-row .crisis-num { grid-column: 1; }
}

/* water tank shimmer + drip */
.gtank-shimmer { animation: gtankshine 4s ease-in-out infinite; }
@keyframes gtankshine { 0%,100% { opacity: 0.35; } 50% { opacity: 0.8; } }
.gtank-drip { animation: gtankdrip 3.5s ease-in infinite; }
@keyframes gtankdrip {
  0%, 55% { transform: translateY(0); opacity: 0; }
  60% { opacity: 0.9; }
  90%, 100% { transform: translateY(11px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .gtank-shimmer, .gtank-drip { animation: none !important; } }
