/* ================================================================
   PORCO'S SOFTSERVE TRACKER
   Pulled straight from the Small Oven 2026 poster:
   deep indigo bg, cream/yellow text, hot-pink offset shadows,
   chunky display + brush script.
   ================================================================ */

:root {
  /* default palette — the "Indigo" theme */
  --bg: #3f4889;
  --bg-deep: #34396f;
  --cream: #f4e4bc;
  --cream-soft: #f6ebcc;
  --yellow: #fcd86a;
  --pink: #ee6388;
  --pink-deep: #d44a72;
  --hot-pink: #ff7a9e;
  --ink: #2a2f5b;
  --white-soft: #fdf6e3;
  --gf: #7ee0c5;     /* mint for GF badge */
  --vg: #ffb87a;     /* peach for vegan badge */
  --card: rgba(255,255,255,0.05);
  --line: rgba(244,228,188,0.18);
  --line-strong: rgba(244,228,188,0.35);

  --gap: 14px;
  --pad: 16px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --f-display: 'Bagel Fat One', 'Cherry Bomb One', system-ui, sans-serif;
  --f-script: 'Caveat Brush', 'Patrick Hand', cursive;
  --f-hand:   'Patrick Hand', 'Caveat Brush', cursive;
  --f-body:   'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.4;
  /* paper-y noise texture so the indigo doesn't feel flat */
  background-image:
    radial-gradient(ellipse at top, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(0,0,0,0.15), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
input, textarea, select {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}
textarea { resize: none; }

/* ============ Frame layout ============ */
.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px 96px;
  position: relative;
}

/* hand-drawn outer border like the poster */
.poster-border {
  position: fixed;
  inset: 8px;
  border: 2.5px solid var(--cream);
  border-radius: 28px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  /* wobble the corners with a clip path that mimics hand-drawn line */
  filter: url(#wobble);
}
@media (min-width: 560px) {
  .poster-border { inset: 14px; }
}

/* ============ Header ============ */
.hero-head {
  position: relative;
  text-align: center;
  padding: 8px 0 18px;
  z-index: 1;
}
.title-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 6px 8px 0;
}
.title-main {
  font-family: var(--f-display);
  font-size: clamp(40px, 11vw, 56px);
  line-height: 0.92;
  letter-spacing: 0.5px;
  color: var(--cream);
  text-shadow:
    4px 5px 0 var(--pink),
    4px 5px 0 var(--pink),
    5px 6px 0 var(--pink);
  -webkit-text-stroke: 1px var(--ink);
  margin: 0;
  white-space: nowrap;
}
.title-sub {
  font-family: var(--f-display);
  font-size: clamp(18px, 5vw, 22px);
  letter-spacing: 2px;
  color: var(--yellow);
  margin-top: 4px;
  -webkit-text-stroke: 0.5px var(--ink);
}
.title-dots {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.title-dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--cream); opacity: 0.7;
}
/* drip under the title */
.title-drip {
  position: absolute;
  top: 60%;
  width: 60px;
  height: 36px;
  opacity: 0.9;
  pointer-events: none;
}
.title-drip.left { left: -52px; }
.title-drip.right { right: -52px; transform: scaleX(-1); }

/* ============ Tab pill ============ */
.tab-row {
  display: flex;
  gap: 6px;
  margin: 6px auto 18px;
  background: rgba(0,0,0,0.18);
  padding: 5px;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.tab-row button {
  padding: 8px 16px;
  font-family: var(--f-hand);
  font-size: 17px;
  color: var(--cream);
  border-radius: 999px;
  letter-spacing: 0.4px;
  transition: background 120ms, color 120ms;
  white-space: nowrap;
}
.tab-row button.active {
  background: var(--cream);
  color: var(--ink);
}

/* ============ Section labels — "Weeks", "Flavors", "Toppings" style ============ */
.section-label {
  font-family: var(--f-script);
  font-size: 30px;
  color: var(--yellow);
  position: relative;
  display: inline-block;
  margin: 6px 0 10px;
  padding: 0 6px;
  letter-spacing: 0.3px;
  line-height: 1;
}
.section-label::after {
  /* pink highlighter underline */
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  bottom: -2px;
  height: 9px;
  background: var(--pink);
  z-index: -1;
  border-radius: 2px;
  transform: rotate(-1deg);
}

/* ============ Current week hero card ============ */
.now-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
  overflow: hidden;
}
.now-card::before {
  content: 'THIS WEEK';
  position: absolute;
  top: 14px; right: -34px;
  background: var(--pink);
  color: var(--cream);
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 4px 40px;
  transform: rotate(34deg);
  box-shadow: 0 1px 0 var(--pink-deep);
}
.now-week-range {
  font-family: var(--f-hand);
  color: var(--yellow);
  font-size: 22px;
  letter-spacing: 0.5px;
  margin: 0;
}
.now-week-meta {
  font-family: var(--f-body);
  color: var(--cream);
  opacity: 0.7;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 2px 0 0;
}

/* ============ Flavor row ============ */
.flavor {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.flavor:first-of-type { border-top: none; padding-top: 4px; }
.flavor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: 4px;
}
.flavor-name {
  font-family: var(--f-hand);
  font-size: 28px;
  color: var(--white-soft);
  letter-spacing: 0.4px;
  line-height: 1;
  white-space: nowrap;
}
.flavor-badges {
  display: inline-flex;
  gap: 4px;
}
.badge {
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 3px 7px 2px;
  border-radius: 5px;
  display: inline-block;
  color: var(--ink);
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.badge.gf { background: var(--gf); }
.badge.v  { background: var(--vg); }

.topping-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.18);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.topping-row .label {
  font-family: var(--f-hand);
  font-size: 15px;
  color: var(--yellow);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.topping-row .name {
  font-family: var(--f-hand);
  font-size: 18px;
  color: var(--white-soft);
  line-height: 1.05;
  flex: 1 1 auto;
  min-width: 0;
}
.topping-row .flavor-badges { margin-left: auto; }

/* ============ Friend chips + logging UI ============ */
.friends-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-hand);
  font-size: 16px;
  color: var(--cream);
  transition: transform 120ms, background 120ms, border-color 120ms;
  white-space: nowrap;
  line-height: 1;
}
.friend-chip:hover { transform: translateY(-1px); }
.friend-chip.has-entry {
  background: rgba(238,99,136,0.18);
  border-color: var(--pink);
}
.friend-chip.adding {
  border-style: dashed;
  opacity: 0.7;
}
.friend-chip .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--ink);
  -webkit-text-stroke: 0;
}
.friend-chip .mini-stars {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--yellow);
  margin-left: 2px;
  line-height: 1;
}

/* the per-friend entry card that expands */
.entry-card {
  margin-top: 12px;
  background: rgba(0,0,0,0.22);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  position: relative;
}
.entry-card .who {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.entry-card .who .avatar {
  width: 30px; height: 30px;
}
.entry-card .who h4 {
  font-family: var(--f-hand);
  font-size: 20px;
  color: var(--cream);
  margin: 0;
  line-height: 1.2;
}
.entry-card .close {
  margin-left: auto;
  font-size: 22px;
  color: var(--cream);
  opacity: 0.6;
  width: 28px; height: 28px;
  line-height: 1;
}

.choice-row { margin-top: 14px; }
.choice-row .row-label {
  font-family: var(--f-hand);
  font-size: 14px;
  color: var(--yellow);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.95;
  text-transform: uppercase;
}
.choice-group {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.choice {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--cream);
  transition: all 120ms;
  white-space: nowrap;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.choice:hover { border-color: var(--line-strong); }
.choice.selected {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}
.choice.selected.pink {
  background: var(--pink);
  color: var(--white-soft);
  border-color: var(--pink);
}

/* Stars */
.stars {
  display: inline-flex;
  gap: 2px;
}
.star-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 80ms;
}
.star-btn:active { transform: scale(0.85); }
.star-btn svg {
  width: 30px; height: 30px;
}
.star-btn .fill { fill: var(--cream); opacity: 0.18; }
.star-btn.on .fill { fill: var(--yellow); opacity: 1; }
.star-btn .stroke { stroke: var(--ink); stroke-width: 1.5; fill: none; }

/* Comment textarea */
.comment-box {
  margin-top: 10px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--f-hand);
  font-size: 17px;
  color: var(--cream);
  width: 100%;
  min-height: 56px;
  letter-spacing: 0.3px;
}
.comment-box::placeholder { color: var(--cream); opacity: 0.4; }
.comment-box:focus { border-color: var(--line-strong); }

.entry-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.entry-card .actions button {
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 1.4px;
  padding: 9px 14px;
  border-radius: 999px;
  -webkit-text-stroke: 0.5px var(--ink);
}
.btn-primary {
  background: var(--pink);
  color: var(--cream);
  box-shadow: 0 2px 0 var(--pink-deep);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--pink-deep); }
.btn-ghost {
  color: var(--cream);
  opacity: 0.7;
}
.btn-danger {
  color: var(--pink);
  opacity: 0.9;
  margin-left: auto;
}

/* ============ Season list ============ */
.season-list { margin-top: 4px; position: relative; z-index: 1; }
.week-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 4px 12px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  align-items: start;
  cursor: pointer;
  position: relative;
}
.week-row:first-child { border-top: 1.5px dashed var(--line-strong); }
.week-row.is-current {
  background: linear-gradient(90deg, rgba(238,99,136,0.15), transparent 70%);
  border-radius: 10px;
  padding-left: 8px;
  margin-left: -4px;
}
.week-row.is-current .wk-range { color: var(--cream); }
.week-row.is-current::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  background: var(--pink);
  border-radius: 2px;
}
.week-row.is-past { opacity: 0.55; }
.week-row:hover .wk-range { color: var(--yellow); }
.wk-range {
  font-family: var(--f-hand);
  color: var(--yellow);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0.3px;
  transition: color 120ms;
  align-self: start;
  padding-top: 1px;
}
.wk-flavors-stack {
  display: block;
}
.wk-flavor-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-hand);
  font-size: 20px;
  color: var(--white-soft);
  line-height: 1.2;
  flex-wrap: wrap;
  row-gap: 2px;
  margin-top: 2px;
}
.wk-flavor-line:first-child { margin-top: 0; }
.wk-topping {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--cream);
  opacity: 0.65;
  margin-top: 6px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wk-topping b {
  font-weight: 700;
  color: var(--cream);
  opacity: 1;
  letter-spacing: 0.3px;
  text-transform: none;
  font-size: 14px;
  font-family: var(--f-hand);
}
.wk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.wk-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-hand);
  font-size: 13px;
  color: var(--cream);
  background: rgba(0,0,0,0.2);
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
}
.wk-stamp .av {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: 9px;
  color: var(--ink);
}
.wk-stamp .mini-stars { color: var(--yellow); font-size: 10px; letter-spacing: 1px; }

/* ============ Bottom legend (matches poster footer) ============ */
.legend {
  margin-top: 28px;
  padding: 14px 12px 6px;
  border-top: 1.5px dashed var(--line-strong);
  text-align: center;
  position: relative;
  z-index: 1;
}
.legend .sprinkle-line {
  font-family: var(--f-display);
  color: var(--pink);
  font-size: 18px;
  letter-spacing: 1.5px;
  line-height: 1.2;
  -webkit-text-stroke: 0.5px var(--ink);
}
.legend .key {
  font-family: var(--f-hand);
  color: var(--cream);
  font-size: 17px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.legend .key b.gf { color: var(--gf); }
.legend .key b.vg { color: var(--vg); }

/* ============ Friends manage ============ */
.manage-friends {
  margin-top: 6px;
  font-family: var(--f-hand);
  font-size: 15px;
  color: var(--cream);
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-style: dotted;
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,22,50,0.7);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  animation: fade 180ms ease;
}
.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 2px solid var(--cream);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 20px 18px 32px;
  animation: slide 220ms cubic-bezier(.2,.8,.2,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateY(100%); } }
.modal-sheet h3 {
  font-family: var(--f-display);
  color: var(--cream);
  margin: 0 0 12px;
  font-size: 22px;
  text-shadow: 2px 3px 0 var(--pink);
  -webkit-text-stroke: 0.5px var(--ink);
}
.friend-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.friend-edit-row .avatar { width: 32px; height: 32px; }
.friend-edit-row input {
  flex: 1;
  font-family: var(--f-hand);
  font-size: 19px;
  color: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 4px 2px;
}
.friend-edit-row .swatches {
  display: inline-flex; gap: 4px;
}
.friend-edit-row .swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
}
.friend-edit-row .swatch.on { outline: 2px solid var(--cream); outline-offset: 1px; }
.friend-edit-row .rm {
  color: var(--pink); font-size: 18px; padding: 4px 8px;
}
.add-friend-row {
  display: flex; gap: 8px; margin-top: 10px;
}
.add-friend-row input {
  flex: 1;
  font-family: var(--f-hand);
  font-size: 19px;
  color: var(--cream);
  border-bottom: 1.5px dashed var(--line-strong);
  padding: 4px 2px;
}
.add-friend-row button {
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 1.4px;
  background: var(--pink);
  color: var(--cream);
  padding: 8px 14px;
  border-radius: 999px;
  -webkit-text-stroke: 0.5px var(--ink);
}

/* ============ Density tweak ============ */
body[data-density="compact"] .app { padding: 10px 12px 80px; }
body[data-density="compact"] .now-card { padding: 14px 12px 12px; }
body[data-density="compact"] .week-row { padding: 8px 4px; }
body[data-density="compact"] .flavor-name { font-size: 24px; }
body[data-density="compact"] .wk-range, body[data-density="compact"] .wk-flavors { font-size: 17px; }

/* ============ Theme tweaks ============ */
body[data-theme="cherry"] {
  --bg: #5a2a4d;
  --bg-deep: #461f3c;
  --cream: #ffe9d6;
  --yellow: #ffcb6a;
  --pink: #ff6e9c;
  --pink-deep: #d44e7e;
}
body[data-theme="pistachio"] {
  --bg: #2f5e4b;
  --bg-deep: #234a3b;
  --cream: #f6e7c4;
  --yellow: #ffd66a;
  --pink: #ff8c70;
  --pink-deep: #d96b54;
}
body[data-theme="midnight"] {
  --bg: #1c2241;
  --bg-deep: #141833;
  --cream: #f5e9c6;
  --yellow: #ffd47a;
  --pink: #ff5b8a;
  --pink-deep: #d33d6c;
}

/* drips tweak */
body[data-drips="off"] .title-drip { display: none; }
body[data-drips="off"] .poster-border { opacity: 0.35; }
body[data-drips="heavy"] .title-drip { opacity: 1; transform: scale(1.15); }
body[data-drips="heavy"] .title-drip.right { transform: scale(1.15) scaleX(-1); }

/* ============ Misc ============ */
.empty-friends {
  font-family: var(--f-hand);
  color: var(--cream);
  opacity: 0.6;
  font-size: 16px;
  margin-top: 12px;
  text-align: center;
}
.scroll-anchor { scroll-margin-top: 12px; }

/* tucked sprinkle dots */
.sprinkles {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.sprinkles span {
  position: absolute;
  width: 8px; height: 3px;
  border-radius: 999px;
  transform-origin: center;
}
