/* ========================================================
   TCB - The City Beautiful — mobile app styles
   Mobile-first, max-width 480px centered on desktop
   ======================================================== */

:root {
  --red: #e23744;
  --red-soft: #fdeaec;
  --fg: #171413;
  --muted: #7a7570;
  --bg: #ffffff;
  --line: #efeae5;
  --chip: #f5f1ec;
  --green: #2fa56b;
  --gold: #f5b301;
  --shadow-1: 0 2px 8px rgba(23,20,19,0.06);
  --shadow-2: 0 8px 24px rgba(23,20,19,0.12);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--fg);
  background: #f4ede4;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* Hide scrollbars on horizontal rows */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

/* ========== App shell (mobile frame) ========== */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
}

/* ========== Splash ========== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--red);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  animation: splashFade 0.4s ease-in 1.4s forwards;
}
.splash-logo {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -2px;
  animation: splashPop 0.6s cubic-bezier(.34,1.56,.64,1);
}
.splash-tag {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 2.5px;
  opacity: 0.9;
  animation: fadeIn 0.6s 0.3s both;
}
.splash-since {
  position: absolute; bottom: 32px;
  font-size: 10px; letter-spacing: 2px; opacity: 0.7;
  animation: fadeIn 0.6s 0.5s both;
}
@keyframes splashPop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes splashFade { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ========== Top header ========== */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 0;
}
.top-row { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 6px; }
.brand-logo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--red);
  line-height: 1;
}
.brand-city {
  font-size: 11px; color: var(--muted); letter-spacing: 0.4px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--fg);
  position: relative;
}
.icon-btn:hover { background: var(--chip); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; background: var(--red); border-radius: 50%;
  border: 2px solid var(--bg);
}
.wallet {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px;
  background: var(--chip);
  border-radius: 100px;
  font-weight: 600; font-size: 13px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #ffae4d);
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px;
}

/* ========== Category pills ========== */
.pills {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 12px 16px 14px;
}
.pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--chip);
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  transition: all 0.15s;
}
.pill.active { background: var(--fg); color: #fff; }

/* ========== Main scroll area ========== */
.main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 84px; /* room for bottom tab bar */
}
.screen { display: none; animation: fadeIn 0.25s; padding: 0 16px 16px; }
.screen.active { display: block; }

/* ========== Section header ========== */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 18px 0 12px;
}
.section-title {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
}
.section-link { font-size: 13px; color: var(--red); font-weight: 600; }

/* ========== Hero post ========== */
.hero {
  border-radius: 14px; overflow: hidden;
  background: var(--chip);
  position: relative;
  animation: slideUp 0.35s;
}
.hero-img { aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.hero-body { padding: 14px; }
.eyebrow {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--red);
  background: var(--red-soft);
  padding: 4px 8px; border-radius: 4px;
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; line-height: 1.2;
}
.hero-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.hero-actions {
  margin-top: 12px; display: flex; gap: 16px; align-items: center;
}
.act { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.act .num { font-variant-numeric: tabular-nums; }
.act.on { color: var(--red); }
.act.on .heart { fill: var(--red); }

/* ========== Post list cards ========== */
.post-card {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  animation: slideUp 0.35s;
}
.post-card:last-child { border-bottom: 0; }
.post-thumb {
  width: 96px; height: 96px;
  border-radius: 12px;
  background-size: cover; background-position: center;
  flex: 0 0 auto;
}
.post-body { flex: 1; min-width: 0; }
.post-title {
  font-family: var(--serif);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.2px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.post-actions { margin-top: 8px; display: flex; gap: 12px; }

/* ========== Events strip (horizontal) ========== */
.h-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.event-card {
  flex: 0 0 75%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  animation: slideRight 0.35s;
}
.event-img {
  aspect-ratio: 16 / 9;
  background-size: cover; background-position: center;
  position: relative;
}
.event-date {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 700;
  line-height: 1;
  min-width: 44px;
  box-shadow: var(--shadow-1);
}
.event-date .d { font-size: 18px; color: var(--red); display: block; }
.event-date .m { font-size: 9px; letter-spacing: 1.2px; color: var(--muted); margin-top: 2px; display: block; }
.event-tag {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  padding: 4px 8px; border-radius: 100px;
}
.event-body { padding: 12px 14px 14px; }
.event-title {
  font-family: var(--serif);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.2px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-venue { margin-top: 6px; font-size: 11px; color: var(--muted); }
.event-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.event-price { font-size: 13px; font-weight: 600; color: var(--fg); }
.btn-rsvp {
  background: var(--red); color: #fff;
  padding: 7px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
  transition: background 0.15s;
}
.btn-rsvp.going { background: var(--green); }
.btn-rsvp:hover { filter: brightness(0.95); }

/* ========== Deals grid (2 col) ========== */
.deals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.deal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  animation: slideUp 0.35s;
}
.deal-img {
  aspect-ratio: 4 / 3;
  background-size: cover; background-position: center;
  position: relative;
}
.deal-offer {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 4px 8px; border-radius: 6px;
}
.deal-body { padding: 10px 12px 12px; }
.deal-brand { font-size: 13px; font-weight: 700; }
.deal-detail {
  margin-top: 4px; font-size: 11px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-foot {
  margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.deal-expire { font-size: 10px; color: var(--muted); }
.btn-claim {
  background: var(--fg); color: #fff;
  padding: 6px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
}
.btn-claim.claimed { background: var(--green); }

/* Featured deal banner */
.deal-banner {
  background: linear-gradient(135deg, var(--red), #ff8a4d);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px;
  animation: slideUp 0.35s;
}
.deal-banner .pct { font-family: var(--serif); font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.deal-banner .txt h4 { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.deal-banner .txt p { font-size: 12px; opacity: 0.9; margin-top: 2px; }

/* ========== Nearby cards ========== */
.nearby-card {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  animation: slideUp 0.35s;
}
.nearby-card:last-child { border-bottom: 0; }
.nearby-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  background-size: cover; background-position: center;
  flex: 0 0 auto;
}
.nearby-body { flex: 1; min-width: 0; }
.nearby-name { font-weight: 600; font-size: 14px; }
.nearby-meta { margin-top: 3px; font-size: 11px; color: var(--muted); }
.nearby-rating {
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
  font-size: 11px;
}
.nearby-rating .star { color: var(--gold); font-size: 12px; }
.nearby-distance {
  font-size: 11px; font-weight: 600; color: var(--red);
  flex: 0 0 auto;
}

/* Map placeholder */
.map-box {
  margin: 0 -16px 14px;
  height: 200px;
  background: linear-gradient(135deg, #d6e9ff, #b3d4ff);
  position: relative; overflow: hidden;
}
.map-pin {
  position: absolute;
  width: 28px; height: 28px;
  background: var(--red); border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.map-pin::after {
  content: ''; position: absolute; top: 8px; left: 8px;
  width: 12px; height: 12px; background: #fff; border-radius: 50%;
}

/* ========== Search bar ========== */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--chip);
  border-radius: 100px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.search input { flex: 1; background: none; border: 0; outline: none; font-size: 14px; }

/* ========== Trending (full list) language switcher ========== */
.lang-switch {
  display: inline-flex; gap: 4px;
  background: var(--chip);
  border-radius: 100px;
  padding: 3px;
}
.lang-switch button {
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
}
.lang-switch button.on { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-1); }

/* ========== More screen — categories grid ========== */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 4px; }
.cat-tile {
  background: var(--chip);
  border-radius: 14px;
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 12px; font-weight: 600;
  text-align: center;
  padding: 8px;
  transition: transform 0.15s;
}
.cat-tile:hover { transform: translateY(-2px); }
.cat-tile .ico { font-size: 24px; }

.quick-links {
  margin-top: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.qlink {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.qlink:last-child { border-bottom: 0; }
.qlink .arr { margin-left: auto; color: var(--muted); }

/* ========== Bottom tab bar ========== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0;
  font-size: 10px; color: var(--muted);
  font-weight: 500;
}
.tab .ico { font-size: 20px; }
.tab.active { color: var(--red); }

/* ========== Profile drawer ========== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86%, 360px);
  background: var(--bg);
  z-index: 110;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head {
  background: linear-gradient(135deg, var(--red), #ff8a4d);
  color: #fff;
  padding: 24px 20px 20px;
}
.drawer-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 26px; font-weight: 700;
}
.drawer-name { margin-top: 10px; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.drawer-sub { font-size: 12px; opacity: 0.9; }

.city-select {
  margin: 16px; padding: 14px 16px;
  background: var(--chip);
  border-radius: 12px;
}
.city-select label { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.city-select select {
  width: 100%; margin-top: 6px;
  background: none; border: 0;
  font-size: 16px; font-weight: 600;
  outline: none;
}

.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 16px 12px; }
.stat-card {
  background: var(--chip);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.stat-card .n { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.stat-card .l { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.4px; }

.menu-list { padding: 8px 0; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
}
.menu-item .ico { font-size: 18px; width: 22px; text-align: center; color: var(--muted); }
.menu-item .arr { margin-left: auto; color: var(--muted); }

/* ========== Claim sheet (bottom modal) ========== */
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 480px;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  z-index: 120;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip { width: 38px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto 14px; }
.sheet h3 { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.sheet p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.code-box {
  margin: 18px 0;
  padding: 18px;
  background: var(--red-soft);
  border: 2px dashed var(--red);
  border-radius: 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px; font-weight: 700;
  color: var(--red);
  letter-spacing: 1.5px;
}
.btn-primary {
  width: 100%;
  background: var(--red); color: #fff;
  padding: 14px;
  border-radius: 100px;
  font-size: 14px; font-weight: 600;
}
.btn-secondary {
  width: 100%;
  background: var(--chip); color: var(--fg);
  padding: 12px;
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  margin-top: 8px;
}

/* ========== Pull to refresh indicator ========== */
.refresh-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--chip);
  font-size: 12px; color: var(--muted);
  transition: height 0.2s;
}
.refresh-bar.show { height: 40px; }

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translate(-50%, 20px);
  background: var(--fg); color: #fff;
  padding: 11px 18px;
  border-radius: 100px;
  font-size: 13px;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: all 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Empty placeholder */
.empty {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 13px;
}
