:root {
  --accent: #b8860b;
  --ink: #1b1712;
  --paper: #faf7f2;
  --card: #ffffff;
  --rule: #e8dfd0;
  --muted: #8a8168;
  --success: #2f6f4e;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  min-height: 100dvh; /* actual visible height on mobile, adjusts as the address bar shows/hides */
  display: flex;
  flex-direction: column;
  position: relative;
}

.loading-screen, .error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  font-family: var(--font-display);
  gap: 8px;
  padding: 24px;
}

/* ---------- Decorative corner line art ---------- */

.bg-decor {
  position: fixed;
  width: 220px;
  height: 220px;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIwIiBoZWlnaHQ9IjIyMCIgdmlld0JveD0iMCAwIDIyMCAyMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYjg4NjBiIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+CjxwYXRoIGQ9Ik0xMCAyMTAgQyA2MCAxNjAsIDQwIDEwMCwgMTAwIDYwIEMgMTQwIDM1LCAxNjAgMjAsIDIxMCAxMCIvPgo8cGF0aCBkPSJNNjAgMTUwIEMgNzUgMTQwLCA4NSAxMjUsIDgwIDExMCIvPgo8cGF0aCBkPSJNOTAgMTEwIEMgMTA1IDEwMCwgMTE1IDg1LCAxMDggNzAiLz4KPHBhdGggZD0iTTEyMCA3MCBDIDEzNSA2MCwgMTQ1IDQ4LCAxMzggMzUiLz4KPGVsbGlwc2UgY3g9Ijc4IiBjeT0iMTA4IiByeD0iMTAiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtMzAgNzggMTA4KSIvPgo8ZWxsaXBzZSBjeD0iMTA2IiBjeT0iNjgiIHJ4PSI5IiByeT0iNC41IiB0cmFuc2Zvcm09InJvdGF0ZSgtMzAgMTA2IDY4KSIvPgo8ZWxsaXBzZSBjeD0iMTM2IiBjeT0iMzMiIHJ5PSI0IiByeD0iOCIgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDEzNiAzMykiLz4KPC9zdmc+");
  background-repeat: no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.bg-decor-top { top: 0; right: 0; }
.bg-decor-bottom { bottom: 0; left: 0; transform: rotate(180deg); }

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 20px 4px;
}
.biz-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent);
  margin: 0;
  line-height: 1.1;
}
.table-badge {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 6px 0 0;
}
.table-badge::after { content: ''; }

.lang-switcher {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.lang-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Tabs ---------- */

.tabbar {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 14px auto 0;
  display: flex;
  gap: 22px;
  padding: 4px 20px 18px;
}
.tab {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  cursor: pointer;
}
.tab-icon-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(30, 20, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.tab-icon { font-size: 2.1rem; line-height: 1; }
.tab-label {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.tab:active .tab-icon-btn { transform: scale(0.94); }
.tab.active .tab-icon-btn { background: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22); }
.tab.active .tab-label { color: var(--accent); }

/* ---------- Main ---------- */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 20px 20px;
  width: 100%;
}

/* ---------- Category cards (level 1) ---------- */

.menu-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 10px 6px;
  box-shadow: 0 2px 10px rgba(30, 20, 0, 0.06);
  cursor: pointer;
  text-align: center;
  width: 100%;
}
.cat-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #faf1de;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.35rem;
}
.cat-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Category detail (level 2) ---------- */

.back-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0 18px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(30, 20, 0, 0.06);
  overflow: hidden;
}

.item-photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #faf1de;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-photo { width: 100%; height: 100%; object-fit: cover; }
.item-photo-fallback { font-size: 1.6rem; }

.item-text { padding: 7px 8px 9px; display: flex; flex-direction: column; gap: 1px; }
.item-name { font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { font-family: var(--font-mono); font-size: 0.76rem; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.item-desc {
  margin: 1px 0 0;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-hint { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 20px 0; }

/* ---------- Floating action buttons ---------- */

.fab-row {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 14px));
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  background: linear-gradient(to top, var(--paper) 65%, transparent);
}
.fab {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 14px 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease;
  box-shadow: 0 2px 8px rgba(30, 20, 0, 0.05);
}
.fab:active { transform: scale(0.97); }
.fab-icon { font-size: 1.4rem; color: var(--accent); }

/* ---------- Review tab ---------- */

.review-wrap { text-align: center; padding: 10px 0 30px; }
.review-prompt { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 4px; }
.review-sub { color: var(--muted); margin: 0 0 24px; }

.stars { display: flex; justify-content: center; gap: 10px; }
.star {
  background: none;
  border: none;
  font-size: 2.4rem;
  line-height: 1;
  color: #ddd0b0;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 4px;
}
.star.filled { color: var(--accent); }
.star:active { transform: scale(1.2); }

.review-result { margin-top: 26px; font-family: var(--font-display); font-size: 1.15rem; }

.private-form { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.private-form-lede { font-size: 0.9rem; color: var(--muted); text-align: center; margin: 0 0 6px; }
.private-form textarea, .private-form input {
  font-family: var(--font-body);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: #fff;
}
.private-form textarea:focus, .private-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.btn-primary:active { transform: scale(0.98); }

.private-thanks { margin-top: 20px; color: var(--success); font-weight: 600; }

/* ---------- Social tab ---------- */

.social-wrap { text-align: center; padding: 10px 0 30px; }
.social-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 22px; }
.social-row { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.social-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--accent);
  text-decoration: none; box-shadow: 0 2px 8px rgba(30, 20, 0, 0.06);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 100;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  .fab, .star, .btn-primary, .toast { transition: none; animation: none; }
}
