@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@700;900&family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #090914;
  --surface:      #10102A;
  --surface-2:    #181836;
  --surface-3:    #22224A;

  --primary:      #9D6FFF;
  --primary-dim:  rgba(157,111,255,0.16);
  --primary-glow: rgba(157,111,255,0.38);

  --pink:         #FF6BB5;
  --cyan:         #22D4F4;
  --lime:         #A3E635;
  --orange:       #FF9F45;
  --red:          #FF5C6C;
  --green:        #4ADE80;
  --amber:        #FBBF24;

  --text:         #F4F4FF;
  --text-dim:     rgba(244,244,255,0.65);
  --text-muted:   rgba(244,244,255,0.36);

  --r-card:       28px;
  --r-xl:         32px;
  --r-lg:         20px;
  --r-md:         14px;
  --r-sm:         10px;
  --r-pill:       100px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background blobs (MD3 dynamic color orbs) */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(157,111,255,0.09) 0%, transparent 70%);
  top: -180px;
  right: -120px;
}
body::after {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255,107,181,0.07) 0%, transparent 70%);
  bottom: 60px;
  left: -100px;
}

/* ── App Shell ─────────────────────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.app-header {
  flex-shrink: 0;
  padding: 16px 20px 12px;
}

.app-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.progress-track {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 9px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--pink) 100%);
  border-radius: var(--r-pill);
  transition: width 0.65s cubic-bezier(0.34,1.56,0.64,1);
  width: 0%;
}

.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-toggle-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--r-pill);
  padding: 5px 18px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-toggle-btn:active { transform: scale(0.93); }
.filter-toggle-btn--active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Filter Panel ──────────────────────────────────────────────────────────── */

.filter-panel {
  flex-shrink: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1);
  padding: 0 20px;
}
.filter-panel--open { max-height: 280px; }

.filter-panel-inner {
  padding: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1.5px solid var(--surface-2);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 44px;
  flex-shrink: 0;
}

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.fpill {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--surface-3);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}
.fpill--active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.06);
}
.fpill:active { transform: scale(0.91); }

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.filter-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-action-btns { display: flex; gap: 8px; }

.filter-action-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  background: var(--surface);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34,1.56,0.64,1), opacity 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.filter-action-btn:active { transform: scale(0.93); opacity: 0.75; }

/* ── Views ─────────────────────────────────────────────────────────────────── */

.view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.view--active { display: flex; }

/* ── Crawl View ────────────────────────────────────────────────────────────── */

.card-area {
  flex: 1;
  min-height: 0;
  padding: 10px 16px;
  display: flex;
  align-items: stretch;
}

.card-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: var(--r-card);
}

.card {
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 0 0 28px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  border: 1.5px solid var(--surface-3);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.card::-webkit-scrollbar { display: none; }

.card--visited {
  border-color: rgba(157,111,255,0.45);
  box-shadow: 0 12px 40px rgba(157,111,255,0.14);
}

/* ── Card Hero Image ─────────────────────────────────────────────────────────── */

.card-hero {
  width: 100%;
  height: 45svh;
  border-radius: calc(var(--r-card) - 1.5px) calc(var(--r-card) - 1.5px) 0 0;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.card-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, transparent 30%, rgba(10,10,28,0.92) 100%);
  pointer-events: none;
}

.card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 20px 20px;
  z-index: 1;
}

/* Card content padding (below hero) */
.card-divider { margin-left: 20px; margin-right: 20px; }
.card-section { padding: 0 20px; }
.checkin-wrap { padding: 20px 20px 4px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */

.card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
}

.badge--type       { background: var(--surface-2); color: var(--text-dim); border-color: var(--surface-3); }
.badge--speakeasy  { background: rgba(157,111,255,0.18); color: #C4A0FF; border-color: rgba(157,111,255,0.45); }
.badge--lounge     { background: rgba(34,212,244,0.15);  color: #5EDDF5; border-color: rgba(34,212,244,0.4); }
.badge--nightclub  { background: rgba(255,107,181,0.16); color: #FF8FC8; border-color: rgba(255,107,181,0.45); }
.badge--sportsbar  { background: rgba(255,159,69,0.15);  color: #FFB76A; border-color: rgba(255,159,69,0.4); }
.badge--restaurant { background: rgba(163,230,53,0.14);  color: #BCEC60; border-color: rgba(163,230,53,0.4); }
.badge--floor      { background: var(--primary-dim); color: var(--primary); border-color: rgba(157,111,255,0.45); margin-left: auto; }

/* ── Card Content ──────────────────────────────────────────────────────────── */

.card-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.card-tagline {
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  color: rgba(244,244,255,0.75);
  line-height: 1.5;
  margin-bottom: 0;
}

.card-divider {
  height: 1.5px;
  background: var(--surface-2);
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: var(--r-pill);
}

.card-section { margin-bottom: 18px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  font-weight: 500;
}

.res-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  margin-bottom: 8px;
}

.res-badge--walkin      { background: rgba(74,222,128,0.14); color: var(--green); border-color: rgba(74,222,128,0.42); }
.res-badge--recommended { background: rgba(251,191,36,0.14);  color: var(--amber); border-color: rgba(251,191,36,0.42); }
.res-badge--required    { background: rgba(255,92,108,0.14);  color: var(--red);   border-color: rgba(255,92,108,0.42); }

.res-detail { font-size: 15px; font-weight: 500; color: var(--text-dim); line-height: 1.55; }

.tips-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tips-list li {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  padding-left: 22px;
  position: relative;
}
.tips-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--primary);
  font-size: 11px;
  line-height: 1.5;
}

.checkin-wrap { padding-top: 20px; padding-bottom: 4px; }

.checkin-btn {
  width: 100%;
  padding: 17px;
  border-radius: var(--r-pill);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.checkin-btn--active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(157,111,255,0.45);
}
.checkin-btn--active:active { transform: scale(0.95); box-shadow: 0 2px 12px rgba(157,111,255,0.3); }
.checkin-btn--visited {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1.5px solid var(--surface-3);
  cursor: default;
  box-shadow: none;
}

/* ── Stamp ─────────────────────────────────────────────────────────────────── */

.stamp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
}
.stamp-overlay--show { opacity: 1; }

.stamp-inner {
  font-family: 'Unbounded', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
  border-radius: 22px;
  padding: 14px 30px;
  transform: rotate(-12deg) scale(0);
  box-shadow: 0 10px 48px rgba(157,111,255,0.55);
}

.stamp-overlay--show .stamp-inner {
  animation: stampIn 0.44s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes stampIn {
  0%   { transform: rotate(-12deg) scale(2.4); opacity: 0; }
  52%  { transform: rotate(-12deg) scale(0.88); opacity: 1; }
  72%  { transform: rotate(-12deg) scale(1.07); opacity: 1; }
  100% { transform: rotate(-12deg) scale(1);    opacity: 1; }
}

/* ── Bottom Nav ────────────────────────────────────────────────────────────── */

.bottom-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 10px 20px max(16px, env(safe-area-inset-bottom));
  gap: 14px;
}

.nav-btn {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--surface-3);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), background 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.nav-btn:active { transform: scale(0.86); }

.nav-counter {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── No Results ────────────────────────────────────────────────────────────── */

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.no-results-icon  { font-size: 48px; }
.no-results-title { font-size: 16px; font-weight: 800; color: var(--text-dim); }
.no-results-sub   { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }

/* ── Tab Bar ───────────────────────────────────────────────────────────────── */

.tab-bar {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1.5px solid var(--surface-2);
  padding: 6px 8px max(10px, env(safe-area-inset-bottom));
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s cubic-bezier(0.34,1.56,0.64,1);
  border-radius: var(--r-lg);
}
.tab-btn--active {
  background: var(--primary-dim);
}

.tab-icon {
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  display: block;
}
.tab-label {
  font-family: 'Nunito', sans-serif;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s;
}

.tab-btn--active .tab-icon  { color: var(--primary); transform: scale(1.15); }
.tab-btn--active .tab-label { color: var(--primary); }

/* ── Browse View ───────────────────────────────────────────────────────────── */

.view--browse { overflow: hidden; }

.browse-header {
  flex-shrink: 0;
  padding: 14px 20px 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.browse-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
}

.browse-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.browse-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.browse-list::-webkit-scrollbar { display: none; }

.browse-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--surface-3);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1), opacity 0.14s;
  -webkit-tap-highlight-color: transparent;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}
.browse-row:active { transform: scale(0.975); opacity: 0.8; }
.browse-row--visited { border-color: rgba(157,111,255,0.3); }
.browse-row--visited .browse-name { color: var(--text-dim); }

.browse-row-content { flex: 1; min-width: 0; }

.browse-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.browse-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-visited-text {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.browse-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.browse-hours { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.browse-arrow { font-size: 22px; color: var(--text-muted); flex-shrink: 0; line-height: 1; }

/* ── Visits View ───────────────────────────────────────────────────────────── */

.view--visits { overflow: hidden; }

.visits-header {
  flex-shrink: 0;
  padding: 14px 20px 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.visits-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
}

.visits-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.visits-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visits-list::-webkit-scrollbar { display: none; }

.visit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--surface-3);
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}

.visit-row-main { flex: 1; min-width: 0; }

.visit-name {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.visit-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 10px;
  text-align: center;
  padding: 24px;
}
.empty-icon  { font-size: 40px; }
.empty-title { font-size: 16px; font-weight: 800; color: var(--text-dim); }
.empty-sub   { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }

/* ── Completion Screen ─────────────────────────────────────────────────────── */

.completion-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.completion-screen--visible { opacity: 1; }

.completion-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(56px, env(safe-area-inset-top)) 28px max(40px, env(safe-area-inset-bottom));
  max-width: 420px;
  width: 100%;
}

.completion-star {
  font-size: 64px;
  margin-bottom: 18px;
  line-height: 1;
  animation: floatBounce 2.4s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-10px) rotate(4deg); }
}

.completion-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 12px;
}

.completion-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.65;
  margin-bottom: 36px;
}

.completion-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 36px;
}

.completion-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1.4;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 11px 16px;
  border: 1.5px solid var(--surface-3);
}

.c-check {
  color: var(--primary);
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.reset-btn {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--r-pill);
  padding: 15px 44px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reset-btn:active { transform: scale(0.94); opacity: 0.75; }
