
/* ==========================================================================
   FOOD FRIENDS — TOWNSHIP ENGINE

   One stylesheet for EVERY township. Citrus Grove, Rainbow Valley, Berry
   Bluffs and the rest all render through this; only the theme tokens change,
   supplied per township as data.

   Prefixes checked before use: `twn-` and `ffx-` both returned zero.
   Everything is scoped to .twn-root so a township can never leak into the
   rest of the app.
   ========================================================================== */
.twn-root{
  /* defaults; each township overrides these six on its own wrapper */
  --twn-1:#F5911E; --twn-2:#F6C744; --twn-3:#8CC63F;
  --twn-4:#F2789F; --twn-5:#4FB8B0; --twn-ink:#1F3054;
  --twn-paper:#FFFDF8; --twn-line:#EFE6D8;
  background:#fff !important;
  font-family:'Nunito',system-ui,-apple-system,sans-serif;
}
.twn-wrap{ max-width:1180px; margin:0 auto; padding:0 clamp(16px,4vw,32px); }
.twn-sec{ margin:0 0 clamp(34px,5vw,60px); min-width:0; }
.twn-body{ padding:clamp(18px,3vw,30px) 0 110px; min-width:0; }
.twn-sr{ position:absolute !important; width:1px !important; height:1px !important;
  padding:0 !important; margin:-1px !important; overflow:hidden !important;
  clip:rect(0 0 0 0) !important; white-space:nowrap !important; border:0 !important; }

/* ---- type ------------------------------------------------------------- */
.twn-eb{ font-size:.72rem; font-weight:800; letter-spacing:.2em; text-transform:uppercase;
  margin:0 0 10px; color:var(--twn-1) !important; -webkit-text-fill-color:var(--twn-1) !important; }
.twn-h1{ font-family:'Playfair Display',Georgia,serif !important;
  font-size:clamp(2rem,5vw,3.1rem) !important; font-weight:700 !important; line-height:1.06;
  margin:0 0 10px !important; color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-h2{ font-family:'Playfair Display',Georgia,serif !important;
  font-size:clamp(1.35rem,2.8vw,2rem) !important; font-weight:700 !important;
  margin:0 0 6px !important; color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-h3{ font-size:1.02rem !important; font-weight:800 !important; margin:0 !important;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-sub{ margin:0; font-size:1.02rem; line-height:1.7; max-width:60ch;
  color:#5A6472 !important; -webkit-text-fill-color:#5A6472 !important; }
.twn-note{ margin:12px 0 0; font-size:.83rem; line-height:1.7;
  color:#61697A !important; -webkit-text-fill-color:#61697A !important; }
.twn-hrow{ display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; flex-wrap:wrap; margin:0 0 18px; }

/* ---- hero ------------------------------------------------------------- */
/* A global `.page` gradient was winning over this and flattening the hero to
   pale grey, which left the white heading almost invisible. Scoped to
   .twn-root and marked important so a township theme always shows. */
.twn-root .twn-hero{ position:relative; border-radius:32px; overflow:hidden; margin:16px 0 0;
  background-image:linear-gradient(160deg, var(--twn-2) 0%, var(--twn-1) 45%, var(--twn-5) 100%) !important;
  background-color:var(--twn-1) !important; }
/* The SAME global gradient was also landing on the inner panel and painting
   right over the hero. The hero keeps its gradient; every layer inside it is
   forced transparent. */
.twn-root .twn-hero-in{ padding:clamp(28px,5vw,56px) clamp(20px,4vw,48px);
  position:relative; z-index:2;
  background-image:none !important; background-color:transparent !important; }
.twn-root .twn-hero > *, .twn-root .twn-cta > *{
  background-image:none !important; background-color:transparent !important; }
.twn-root .twn-hero .twn-inc{ background-color:rgba(255,255,255,.92) !important; }
.twn-hero .twn-h1, .twn-hero .twn-eb{ color:#fff !important; -webkit-text-fill-color:#fff !important; }
.twn-hero .twn-sub{ color:rgba(255,255,255,.94) !important; -webkit-text-fill-color:rgba(255,255,255,.94) !important; }
.twn-hero-art{ position:absolute; inset:0; z-index:1; opacity:.28;
  background-repeat:no-repeat; background-position:right bottom; background-size:contain; }
.twn-inc{ display:inline-flex; align-items:center; gap:8px; margin:14px 0 0;
  padding:8px 16px; border-radius:99px; background:rgba(255,255,255,.9);
  font-size:.78rem; font-weight:800;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }

/* ---- buttons ---------------------------------------------------------- */
.twn-b{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:48px; padding:13px 22px; border-radius:999px; cursor:pointer; font:inherit;
  font-size:.9rem; font-weight:800; background:#fff !important;
  border:2px solid var(--twn-line) !important;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important;
  transition:transform .16s ease, box-shadow .16s ease; }
.twn-b:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(31,48,84,.14); }
.twn-b.is-solid{ background:var(--twn-ink) !important; border-color:var(--twn-ink) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }
.twn-b.is-sun{ background:var(--twn-1) !important; border-color:var(--twn-1) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }
.twn-b.is-sm{ min-height:44px; padding:11px 16px; font-size:.82rem; }
.twn-b:focus-visible, .twn-chip:focus-visible, .twn-card:focus-visible,
.twn-ch:focus-visible, .twn-arrow:focus-visible, .twn-tile:focus-visible,
.twn-flip:focus-visible, .twn-opt:focus-visible{ outline:3px solid #1F3054; outline-offset:3px; }
.twn-acts{ display:flex; gap:10px; flex-wrap:wrap; }

/* ---- carousel --------------------------------------------------------- */
.twn-caro{ position:relative; }
.twn-track{ display:flex; gap:14px; overflow-x:auto; padding:6px 2px 16px;
  scroll-snap-type:x mandatory; scroll-behavior:smooth; }
.twn-track::-webkit-scrollbar{ height:8px; }
.twn-track::-webkit-scrollbar-thumb{ background:var(--twn-line); border-radius:99px; }
.twn-char{ flex:none; width:150px; scroll-snap-align:start; cursor:pointer; font:inherit;
  background:#fff !important; border:2px solid var(--twn-line) !important; border-radius:24px;
  padding:16px 12px; text-align:center; display:flex; flex-direction:column; gap:8px;
  align-items:center; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.twn-char:hover{ transform:translateY(-6px) scale(1.02); box-shadow:0 16px 34px rgba(31,48,84,.14); }
.twn-face{ width:88px; height:88px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:2.6rem; line-height:1; }
.twn-char-n{ font-size:.88rem; font-weight:800; line-height:1.25;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-char-t{ font-size:.74rem; font-weight:700;
  color:#6B7280 !important; -webkit-text-fill-color:#6B7280 !important; }
.twn-arrow{ width:46px; height:46px; min-height:46px; border-radius:50%; cursor:pointer;
  font:inherit; font-size:1.2rem; font-weight:800; flex:none;
  background:#fff !important; border:2px solid var(--twn-line) !important;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-arrow:hover{ background:var(--twn-paper) !important; }
.twn-caro-nav{ display:flex; gap:10px; justify-content:flex-end; margin:0 0 10px; }
@media (max-width:700px){ .twn-caro-nav{ display:none; } }

/* ---- cards ------------------------------------------------------------ */
.twn-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.twn-grid.is-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }
.twn-grid.is-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.twn-card{ background:#fff !important; border:2px solid var(--twn-line) !important;
  border-radius:26px; overflow:hidden; text-align:left; width:100%; min-width:0;
  display:flex; flex-direction:column; box-shadow:0 3px 14px rgba(31,48,84,.05); }
button.twn-card{ cursor:pointer; font:inherit;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
button.twn-card:hover{ transform:translateY(-4px); box-shadow:0 18px 38px rgba(31,48,84,.12); }
.twn-thumb{ height:150px; display:flex; align-items:center; justify-content:center;
  font-size:3rem; position:relative; }
.twn-thumb img{ width:100%; height:100%; object-fit:cover; }
.twn-card-b{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:6px; flex:1; }
.twn-card-t{ font-size:1.02rem; font-weight:800; line-height:1.3;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-card-d{ font-size:.86rem; line-height:1.6;
  color:#606A7B !important; -webkit-text-fill-color:#606A7B !important; }
.twn-meta{ display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; padding-top:10px; }
.twn-chip{ font-size:.72rem; font-weight:800; padding:5px 11px; border-radius:99px;
  background:var(--twn-paper) !important; border:1px solid var(--twn-line) !important;
  color:#5A6472 !important; -webkit-text-fill-color:#5A6472 !important; }
.twn-heart{ position:absolute; top:10px; right:10px; width:44px; height:44px; min-height:44px;
  border-radius:50%; cursor:pointer; font:inherit; font-size:1.05rem; padding:0; z-index:2;
  background:rgba(255,255,255,.94) !important; border:0 !important;
  box-shadow:0 3px 10px rgba(31,48,84,.16); }

/* ---- flip cards ------------------------------------------------------- */
.twn-flip{ perspective:1000px; background:none !important; border:0 !important;
  padding:0; cursor:pointer; font:inherit; min-height:190px; }
.twn-flip-in{ position:relative; width:100%; height:190px;
  transition:transform .55s cubic-bezier(.22,1,.36,1); transform-style:preserve-3d; }
.twn-flip[aria-pressed="true"] .twn-flip-in{ transform:rotateY(180deg); }
.twn-flip-f, .twn-flip-bk{ position:absolute; inset:0; border-radius:24px;
  backface-visibility:hidden; -webkit-backface-visibility:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:20px; text-align:center; gap:10px; border:2px solid var(--twn-line); }
.twn-flip-f{ background:#fff; }
.twn-flip-bk{ transform:rotateY(180deg); background:var(--twn-paper); }
/* Nothing inside the card should ever intercept a click — the whole card is
   the button, including the text. */
.twn-flip *{ pointer-events:none; }
/* `.twn-flip-in` is a <span>, so it was inline and `width:100%` did nothing —
   it measured 0px wide, and the absolutely-positioned faces collapsed with it.
   That is why the fact text wrapped one word per line. */
.twn-root .twn-flip-in{ display:block; width:100%; height:220px; }
.twn-root .twn-flip-f, .twn-root .twn-flip-bk{ display:flex; width:100%; }
.twn-root .twn-flip{ min-height:220px; }
.twn-root .twn-flip-f, .twn-root .twn-flip-bk{
  border:0 !important; box-shadow:0 6px 20px rgba(31,48,84,.10); justify-content:center; }
.twn-flip-face{
  width:76px; height:76px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:2.5rem; line-height:1; background:rgba(255,255,255,.7); }
.twn-root .twn-flip-q{ font-size:1.02rem; font-weight:800; line-height:1.4; }
.twn-flip-badge{
  display:inline-block; font-size:.72rem; font-weight:800; letter-spacing:.06em;
  padding:5px 12px; border-radius:99px; background:rgba(255,255,255,.9);
  color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
.twn-root .twn-flip-a{
  font-size:1rem; line-height:1.6; font-weight:700;
  color:#fff !important; -webkit-text-fill-color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.22); }
.twn-root .twn-flip-hint{ font-size:.74rem; font-weight:800; }
.twn-root .twn-flip-hint.is-back{
  color:rgba(255,255,255,.92) !important; -webkit-text-fill-color:rgba(255,255,255,.92) !important; }
.twn-flip-q{ font-size:.92rem; font-weight:800; line-height:1.4;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-flip-a{ font-size:.88rem; line-height:1.6;
  color:#4E5766 !important; -webkit-text-fill-color:#4E5766 !important; }
.twn-flip-hint{ font-size:.72rem; font-weight:800;
  color:var(--twn-1) !important; -webkit-text-fill-color:var(--twn-1) !important; }
@media (prefers-reduced-motion:reduce){
  .twn-flip-in{ transition:none; }
  .twn-char:hover, button.twn-card:hover, .twn-b:hover{ transform:none; }
}

/* ---- quiz -------------------------------------------------------------- */
.twn-quiz{ background:var(--twn-paper) !important; border:2px solid var(--twn-line) !important;
  border-radius:28px; padding:clamp(18px,3vw,28px); }
.twn-prog{ height:10px; border-radius:99px; background:#EFEAE2; overflow:hidden; margin:12px 0 0; }
.twn-prog span{ display:block; height:100%; border-radius:99px;
  background:var(--twn-3); transition:width .35s ease; }
.twn-opt{ display:block; width:100%; text-align:left; min-height:52px; padding:14px 18px;
  border-radius:16px; cursor:pointer; font:inherit; font-size:.94rem; font-weight:700;
  margin:0 0 10px; background:#fff !important; border:2px solid var(--twn-line) !important;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-opt:hover{ border-color:var(--twn-5) !important; }
.twn-opt.is-right{ background:#EAF6E6 !important; border-color:var(--twn-3) !important; }
.twn-opt.is-wrong{ background:#FDEFF3 !important; border-color:var(--twn-4) !important; }
.twn-fb{ margin:12px 0 0; padding:14px 16px; border-radius:16px; font-size:.92rem; font-weight:700;
  background:#fff !important; border:2px solid var(--twn-line) !important;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }

/* ---- badges ------------------------------------------------------------ */
.twn-badges{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.twn-badge{ border-radius:22px; padding:16px 10px; text-align:center;
  background:#fff !important; border:2px dashed var(--twn-line) !important;
  display:flex; flex-direction:column; gap:6px; align-items:center; min-width:0; }
.twn-badge.is-earned{ border-style:solid !important; border-color:var(--twn-3) !important;
  background:#F4FBF1 !important; }
.twn-badge-i{ font-size:2rem; line-height:1; filter:grayscale(1); opacity:.4; }
.twn-badge.is-earned .twn-badge-i{ filter:none; opacity:1; }
.twn-badge-n{ font-size:.76rem; font-weight:800; line-height:1.3;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-badge-d{ font-size:.68rem;
  color:#77808F !important; -webkit-text-fill-color:#77808F !important; }

/* ---- checklist / taste lab --------------------------------------------- */
.twn-check{ display:flex; align-items:center; gap:14px; width:100%; text-align:left;
  min-height:60px; padding:14px 18px; border-radius:18px; cursor:pointer; font:inherit;
  margin:0 0 10px; background:#fff !important; border:2px solid var(--twn-line) !important;
  font-size:.95rem; font-weight:700;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }
.twn-check[aria-pressed="true"]{ background:#F4FBF1 !important; border-color:var(--twn-3) !important; }
.twn-box{ width:28px; height:28px; border-radius:9px; flex:none; display:flex;
  align-items:center; justify-content:center; font-size:1rem;
  border:2px solid var(--twn-line); background:#fff; }
.twn-check[aria-pressed="true"] .twn-box{ background:var(--twn-3); border-color:var(--twn-3); color:#fff; }

/* ---- timeline ----------------------------------------------------------- */
.twn-time{ display:flex; gap:10px; overflow-x:auto; padding:4px 2px 14px; }
.twn-stage{ flex:none; width:140px; border-radius:22px; padding:16px 12px; cursor:pointer;
  font:inherit; text-align:center; background:#fff !important;
  border:2px solid var(--twn-line) !important; display:flex; flex-direction:column; gap:6px;
  align-items:center; }
.twn-stage[aria-pressed="true"]{ border-color:var(--twn-3) !important; background:#F4FBF1 !important; }
.twn-stage-i{ font-size:1.9rem; }
.twn-stage-n{ font-size:.8rem; font-weight:800;
  color:var(--twn-ink) !important; -webkit-text-fill-color:var(--twn-ink) !important; }

/* ---- explore tiles ------------------------------------------------------ */
.twn-tiles{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.twn-root .twn-tile{ background-image:none !important; }
.twn-tile{ border-radius:28px; padding:26px 22px; cursor:pointer; font:inherit; text-align:left;
  border:0 !important; min-height:150px; display:flex; flex-direction:column; gap:8px;
  justify-content:flex-end; transition:transform .18s ease, box-shadow .18s ease; }
.twn-tile:hover{ transform:translateY(-4px); box-shadow:0 18px 38px rgba(31,48,84,.16); }
.twn-tile-i{ font-size:2.2rem; }
.twn-tile-n{ font-size:1.1rem; font-weight:800;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }
.twn-tile-d{ font-size:.82rem; color:rgba(255,255,255,.92) !important;
  -webkit-text-fill-color:rgba(255,255,255,.92) !important; }

/* ---- footer panel -------------------------------------------------------- */
.twn-root .twn-cta{ border-radius:34px; padding:clamp(30px,5vw,56px) clamp(20px,4vw,40px);
  text-align:center;
  background-image:linear-gradient(135deg, var(--twn-2), var(--twn-1) 55%, var(--twn-4)) !important;
  background-color:var(--twn-1) !important; }
.twn-cta .twn-h2{ color:#fff !important; -webkit-text-fill-color:#fff !important; }
.twn-cta p{ color:rgba(255,255,255,.95) !important; -webkit-text-fill-color:rgba(255,255,255,.95) !important;
  font-size:1rem; margin:8px 0 0; }
.twn-cta-faces{ font-size:2.2rem; letter-spacing:6px; margin:0 0 12px; }

/* ---- modal --------------------------------------------------------------- */
#twnSheet{ position:fixed; inset:0; z-index:9600; display:none; align-items:flex-end;
  justify-content:center; background:rgba(20,28,44,.5); font-family:'Nunito',system-ui,sans-serif; }
#twnSheet.is-open{ display:flex; }
/* A global rule was forcing this box to display:flex; flex-direction:row, so the
   title, close button, body and footer all sat on ONE LINE and the modal
   collapsed to a 50px strip. Forced back to a block, with the header and footer
   given their own explicit flex so they are not affected either. */
#twnSheet .twn-box{ display:block !important; flex-direction:column !important;
  height:auto !important; min-height:0 !important;
  width:100%; max-width:620px; max-height:calc(100dvh - 40px); overflow-y:auto;
  background:#fff !important; border-radius:30px 30px 0 0; padding:24px clamp(18px,4vw,28px) 32px; }
#twnSheet .twn-box > *{ width:auto !important; }
#twnSheet .twn-box-b{ display:block !important; }
@media (min-width:720px){
  #twnSheet{ align-items:center; padding:16px; }
  #twnSheet .twn-box{ border-radius:30px; padding-bottom:26px; } }
#twnSheet .twn-box-h{ display:flex !important; flex-direction:row !important;
  align-items:flex-start; justify-content:space-between; gap:14px; margin:0 0 8px; }
#twnSheet .twn-box-t{ font-family:'Playfair Display',Georgia,serif !important;
  font-size:1.4rem !important; font-weight:700 !important; margin:0 !important;
  color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
#twnSheet .twn-box-x{ flex:none; width:46px; height:46px; min-height:46px; border-radius:50%;
  cursor:pointer; font:inherit; font-size:1.1rem; background:#F1EDE6 !important;
  border:0 !important; color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
#twnSheet .twn-box-b{ font-size:.95rem; line-height:1.72;
  color:#3E4B65 !important; -webkit-text-fill-color:#3E4B65 !important; }
#twnSheet .twn-box-b p{ margin:0 0 12px; color:#3E4B65 !important; -webkit-text-fill-color:#3E4B65 !important; }
#twnSheet .twn-box-b ul{ margin:0 0 12px; padding-left:20px; }
#twnSheet .twn-box-b li{ margin:0 0 7px; }
#twnSheet .twn-k{ font-size:.68rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase;
  margin:16px 0 5px; color:#C2761C !important; -webkit-text-fill-color:#C2761C !important; }
#twnSheet .twn-box-f{ display:flex !important; flex-direction:row !important;
  gap:10px; flex-wrap:wrap; margin:18px 0 0; }
#twnSheet .twn-hero-face{ width:110px; height:110px; border-radius:50%; margin:0 auto 12px;
  display:flex; align-items:center; justify-content:center; font-size:3.4rem; }
#twnSheet .twn-safe{ border-radius:18px; padding:16px 18px; margin:0 0 12px; font-size:.9rem;
  line-height:1.65; }
#twnSheet .twn-safe.is-kid{ background:#F4FBF1 !important;
  color:#3B5A32 !important; -webkit-text-fill-color:#3B5A32 !important; }
#twnSheet .twn-safe.is-adult{ background:#FDF1F4 !important;
  color:#8A3B55 !important; -webkit-text-fill-color:#8A3B55 !important; }
#twnSheet .twn-safe b{ display:block; margin:0 0 6px; }

#twnToast{ position:fixed; left:50%; bottom:24px; transform:translate(-50%,14px); z-index:9800;
  background:#1F3054 !important; color:#fff !important; -webkit-text-fill-color:#fff !important;
  padding:14px 24px; border-radius:999px; font:700 .88rem/1.3 'Nunito',system-ui,sans-serif;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
  max-width:calc(100vw - 32px); text-align:center; }
#twnToast.on{ opacity:1; transform:translate(-50%,0); }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width:1020px){
  .twn-grid, .twn-grid.is-4{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .twn-tiles{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .twn-badges{ grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:620px){
  .twn-grid, .twn-grid.is-2, .twn-grid.is-4, .twn-tiles{ grid-template-columns:1fr; }
  .twn-badges{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .twn-acts .twn-b{ flex:1 1 auto; }
  .twn-char{ width:132px; }
  .twn-thumb{ height:130px; }
}

