:root {
  --board: #142b36;
  --board-dark: #0d1e26;
  --ink: #f4f1ea;
  --muted: #a9bcc4;
  --pink: #dd7272;
  --shadow: #221f20;
  --script: 'Kaushan Script', cursive;
  --hand: 'Mali', 'Comic Sans MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- home masthead: logo inside a comic speech bubble ---------- */
.masthead {
  padding: 16px 16px 30px;
  background: linear-gradient(#fff 0 45%, transparent 45%);
}
.bubble {
  display: block;
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border: 3px solid var(--shadow);
  border-radius: 30px;
  padding: 12px 18px;
  box-shadow: 6px 6px 0 var(--shadow);
}
.bubble img { width: 100%; }
.bubble::after {                     /* the bubble's tail */
  content: '';
  position: absolute;
  left: 22%;
  bottom: -20px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-right: 3px solid var(--shadow);
  border-bottom: 3px solid var(--shadow);
  transform: skewY(40deg) rotate(10deg);
  box-shadow: 5px 5px 0 var(--shadow);
}

/* ---------- slim bar on section pages ---------- */
.bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--board-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.bar-back {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .3);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}
.bar-space { flex: 1; }
.bar-logo {
  flex: none;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
}
.bar-logo img { height: 28px; width: auto; }

body.in-section .masthead { display: none; }
body.in-section .bar { display: flex; }

/* ---------- page ---------- */
.menu {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px 8px;
}

.status { text-align: center; color: var(--muted); padding: 40px 0; }
.status button {
  font: inherit; color: #fff; background: var(--pink); border: 0; border-radius: 999px;
  padding: 8px 18px; margin-top: 10px; cursor: pointer;
}

/* ---------- home: section cards ---------- */
.lead {
  text-align: center;
  font-family: var(--script);
  font-size: 26px;
  color: var(--muted);
  margin: 0 0 14px;
}
.cards { display: grid; gap: 14px; }

/* phones: wide row cards — drawing on the left, name on the right */
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 10px 14px 10px 10px;
  background: var(--board-dark);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--shadow);
  color: var(--ink);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform .12s ease;
}
.card:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--shadow); }
.card-art { flex: none; width: 92px; height: 92px; object-fit: contain; }
.card-text { display: grid; gap: 2px; min-width: 0; }
.card-title {
  font-family: var(--script);
  font-size: 32px;
  line-height: 1.15;
  color: var(--c);
  text-shadow: 2px 3px 0 var(--shadow);
}
.card-sub { font-size: 13px; line-height: 1.3; color: var(--muted); }

.small-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.card.small { min-height: 0; padding: 8px 10px; gap: 8px; border-width: 2px; box-shadow: 3px 3px 0 var(--shadow); }
.card.small .card-art { width: 44px; height: 44px; }
.card.small .card-title { font-size: 22px; }

/* bigger screens: tall comic-panel cards in a grid */
@media (min-width: 700px) {
  .lead { font-size: 30px; margin-bottom: 20px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
  .card { flex-direction: column; padding: 18px 16px 16px; text-align: center; transform: rotate(var(--tilt, 0deg)); }
  .card-art { width: auto; height: 160px; max-width: 100%; }
  .card-title { font-size: 40px; }
  .card.small { flex-direction: row; transform: none; text-align: left; }
  .card.small .card-art { width: 44px; height: 44px; }
}
@media (hover: hover) and (min-width: 700px) {
  .card:hover { transform: rotate(0deg) scale(1.02); }
}

/* ---------- section page ---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
}
.hero-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 12vw, 68px);
  line-height: 1.05;
  margin: 0;
  color: var(--c);
  text-shadow: 3px 4px 0 var(--shadow);
  transform: rotate(-4deg);
  transform-origin: left center;
}
.hero-art { width: auto; height: clamp(96px, 28vw, 180px); max-width: 45%; object-fit: contain; }

@media (min-width: 860px) {
  .board { columns: 2; column-gap: 56px; }
}

.cat {
  break-inside: avoid;
  padding: 8px 0 24px;
}

.cat-banner { margin: 0 0 6px; }
.banner {
  width: auto;
  max-width: min(100%, 420px);
  max-height: 150px;
  margin-left: -4px;
}
@media (min-width: 700px) { .banner { max-height: 190px; } }

.cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
  font-weight: 400;
}
.cat-title {
  font-family: var(--script);
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1.1;
  color: var(--c, #e8b04a);
  text-shadow: 3px 4px 0 var(--shadow);
  transform: rotate(-4deg);
  transform-origin: left center;
}
.cat-icon { width: auto; height: 64px; max-width: 35%; object-fit: contain; }

.items { list-style: none; margin: 0; padding: 0; }

.item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}
.item.has-detail { cursor: pointer; }

.thumb {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 2px 3px 0 var(--shadow);
  background: var(--board-dark);
}

.item-main { flex: 1; min-width: 0; }

.line {
  display: flex;
  align-items: baseline;
}
.name { letter-spacing: .01em; min-width: 0; }
.dots {
  flex: 1;
  min-width: 14px;
  margin: 0 6px;
  border-bottom: 2px dotted rgba(244, 241, 234, .5);
  transform: translateY(-5px);
}
.price { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* calories: a small pill right after the name, only when set */
.kcal {
  display: inline-block;
  margin-left: 7px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid rgba(169, 188, 196, .45);
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 2px;
}

/* allergen stickers under the item name */
.stickers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.sticker { display: inline-block; flex: none; line-height: 0; }
.sticker svg { width: 20px; height: 20px; border-radius: 5px; box-shadow: 1px 2px 0 rgba(0, 0, 0, .35); }
.sticker.big svg { width: 34px; height: 34px; border-radius: 8px; box-shadow: 2px 3px 0 rgba(0, 0, 0, .35); }

.desc {
  margin: 1px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.3;
}

.note {
  margin: 8px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.interlude {
  break-inside: avoid;
  width: min(70%, 300px);
  margin: 4px auto 26px;
  transform: rotate(var(--tilt, -2deg));
}

.more { margin-top: 12px; padding-top: 16px; border-top: 2px dashed rgba(255, 255, 255, .18); }
.more-title { font-family: var(--script); font-weight: 400; font-size: 24px; color: var(--muted); margin: 0 0 12px; }

.foot {
  text-align: center;
  color: var(--muted);
  font-family: var(--script);
  font-size: 24px;
  padding: 12px 16px calc(32px + env(safe-area-inset-bottom));
}
.foot p { margin: 0; }

/* ---------- allergen legend (bottom of every page) ---------- */
.legend {
  margin-top: 26px;
  padding: 16px 16px 14px;
  background: var(--board-dark);
  border: 2px dashed rgba(255, 255, 255, .22);
  border-radius: 16px;
}
.legend-title { font-family: var(--script); font-weight: 400; font-size: 26px; margin: 0 0 2px; color: var(--ink); }
.legend-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.legend-list + .legend-note { margin: 12px 0 0; }
.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px 12px;
}
.legend-list li { display: flex; align-items: center; gap: 9px; font-size: 15px; }

/* ---------- item detail sheet ---------- */
.detail {
  width: min(92vw, 440px);
  padding: 0;
  border: 4px solid var(--shadow);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--shadow);
  background: #fff;
  color: var(--shadow);
  overflow: hidden;
}
.detail::backdrop { background: rgba(8, 18, 23, .72); }
.detail img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee; }
.detail img[hidden] { display: none; }
.detail-body { padding: 14px 20px 20px; }
.detail h3 { font-family: var(--script); font-weight: 400; font-size: 30px; margin: 0 0 6px; color: #b84a4a; }
.detail p { margin: 0 0 8px; }
.detail-price { font-weight: 600; font-size: 20px; }
.detail-kcal { color: #6b7880; font-size: 14px; }
.detail-allergens { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.detail-allergens:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  background: #f3efe8;
  border-radius: 999px;
  font-size: 14px;
}
.chip .sticker svg { box-shadow: none; }
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--shadow);
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
