/* ==========================================================================
   testbeermap — Dark, iOS-inspired, mobile-first styles
   ========================================================================== */

:root {
  --bg: #0b0b0b;
  --card: #161618;
  --card-alt: #1c1c1f;
  --input: #222224;
  --accent: #ffb300;
  --accent-dim: #7a5900;
  --text: #ffffff;
  --text-dim: #929298;
  --danger: #ff5a5f;
  --success: #34c759;
  --border: #2a2a2d;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-height: 74px;
  --ease: cubic-bezier(0.25, 0.9, 0.35, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

a { color: var(--accent); text-decoration: none; }

::-webkit-scrollbar { width: 0; height: 0; }

img { max-width: 100%; display: block; }

/* -------------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------------- */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* -------------------------------------------------------------------------
   Auth screen
   ------------------------------------------------------------------------- */
#auth-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, #1a1408 0%, var(--bg) 55%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-bottom));
  z-index: 500;
  overflow-y: auto;
}

.auth-brand {
  text-align: center;
  margin-bottom: 36px;
}

.auth-brand .logo-emoji {
  font-size: 56px;
  display: block;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.auth-brand p {
  color: var(--text-dim);
  margin: 6px 0 0;
  font-size: 14px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
}

.auth-tabs {
  display: flex;
  background: var(--input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.auth-tab.active {
  background: var(--accent);
  color: #1a1200;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input, .field textarea, .field select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.field textarea { resize: none; min-height: 70px; }

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease), opacity 0.2s var(--ease), background 0.2s var(--ease);
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #1a1200; width: 100%; }
.btn-secondary { background: var(--input); color: var(--text); width: 100%; }
.btn-danger { background: rgba(255, 90, 95, 0.14); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.auth-error {
  background: rgba(255, 90, 95, 0.12);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-error.show { display: block; }

.auth-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 16px;
}

/* -------------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------------- */
#top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: calc(14px + var(--safe-top)) 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11,11,11,0.85) 0%, rgba(11,11,11,0) 100%);
}

#top-bar > * { pointer-events: auto; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(22,22,24,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.12s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }

.search-pill {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  background: rgba(22,22,24,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
  display: none;
}
.badge-dot.show { display: block; }

/* -------------------------------------------------------------------------
   Map
   ------------------------------------------------------------------------- */
#map-view {
  position: absolute;
  inset: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #111;
  z-index: 1;
}

.leaflet-container { background: #111 !important; font-family: inherit; }
.leaflet-control-attribution { display: none !important; }
.leaflet-control-zoom { display: none !important; }

.beer-pin {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.beer-pin span { transform: rotate(45deg); font-size: 15px; }

.user-location-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4c8dff;
  border: 3px solid white;
  box-shadow: 0 0 0 6px rgba(76,141,255,0.25);
}

.locate-btn {
  position: absolute;
  right: 14px;
  bottom: calc(var(--nav-height) + 100px + var(--safe-bottom));
  z-index: 55;
}

.drop-pin-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  z-index: 40;
  pointer-events: none;
  font-size: 34px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  display: none;
}
.drop-pin-hint.show { display: block; }

/* -------------------------------------------------------------------------
   Bottom navigation
   ------------------------------------------------------------------------- */
#bottom-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(17,17,18,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.nav-btn .nav-icon { font-size: 21px; }
.nav-btn.active { color: var(--accent); }

.nav-btn-add {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1200;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-top: -22px;
  box-shadow: 0 6px 18px rgba(255,179,0,0.4);
  border: 4px solid var(--bg);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.nav-btn-add:active { transform: scale(0.92) rotate(90deg); }

/* -------------------------------------------------------------------------
   Sheets (sliding bottom panels)
   ------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 101;
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.32s var(--ease);
  border: 1px solid var(--border);
  border-bottom: none;
}
.sheet.show { transform: translateY(0); }

.sheet.sheet-full { max-height: 94vh; }

.sheet-handle {
  width: 38px; height: 5px;
  background: var(--border);
  border-radius: 4px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sheet-header h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--input);
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  overflow-y: auto;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  padding: 12px 20px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Cards / lists
   ------------------------------------------------------------------------- */
.card {
  background: var(--card-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3a3d, #232325);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

.list-row-main { flex: 1; min-width: 0; }
.list-row-title {
  font-weight: 700; font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row-sub {
  font-size: 12.5px; color: var(--text-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row > .btn,
.list-row > button {
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-state p { margin: 4px 0 0; font-size: 13.5px; }

/* -------------------------------------------------------------------------
   Segmented control / chips
   ------------------------------------------------------------------------- */
.segmented {
  display: flex;
  background: var(--input);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.segmented button.active { background: var(--accent); color: #1a1200; }

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.chip {
  flex-shrink: 0;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--accent); color: #1a1200; border-color: var(--accent); }

/* -------------------------------------------------------------------------
   Color swatches
   ------------------------------------------------------------------------- */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.color-swatch.active { border-color: white; transform: scale(1.12); }

/* -------------------------------------------------------------------------
   Pin popup (Leaflet)
   ------------------------------------------------------------------------- */
.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.leaflet-popup-content { margin: 0; width: 230px !important; }
.leaflet-popup-tip { background: var(--card); }

.pin-popup-photo {
  width: 100%; height: 120px;
  object-fit: cover;
  background: var(--input);
}
.pin-popup-body { padding: 12px 14px; }
.pin-popup-beer { font-weight: 800; font-size: 15px; }
.pin-popup-meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.pin-popup-user { color: var(--accent); font-weight: 600; font-size: 12.5px; margin-top: 6px; }
.pin-popup-stats {
  display: flex; gap: 12px; margin-top: 8px;
  font-size: 12px; color: var(--text-dim);
}
.pin-popup-open {
  margin-top: 10px;
  width: 100%;
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   Pin detail sheet
   ------------------------------------------------------------------------- */
.pin-detail-photo {
  width: 100%; height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--input);
  margin-bottom: 14px;
}
.pin-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pin-detail-name { font-weight: 800; font-size: 20px; }
.pin-detail-abv {
  background: var(--input); color: var(--accent);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.pin-detail-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 14px; line-height: 1.5; }

.pin-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.action-btn {
  flex: 1;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 0;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.action-btn.liked { color: var(--danger); border-color: rgba(255,90,95,0.4); background: rgba(255,90,95,0.08); }

.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-bubble { flex: 1; }
.comment-user { font-weight: 700; font-size: 13px; }
.comment-text { font-size: 13.5px; margin-top: 2px; color: #e8e8ea; }
.comment-time { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.comment-delete { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; }

.comment-input-row {
  display: flex; gap: 8px; align-items: center;
}
.comment-input-row input {
  flex: 1;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.comment-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #1a1200;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.visibility-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 12px; letter-spacing: 0.4px;
}
.visibility-badge.public { background: rgba(52,199,89,0.14); color: var(--success); }
.visibility-badge.friends { background: rgba(255,179,0,0.14); color: var(--accent); }
.visibility-badge.private { background: rgba(255,90,95,0.14); color: var(--danger); }

/* -------------------------------------------------------------------------
   Profile
   ------------------------------------------------------------------------- */
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-sub { color: var(--text-dim); font-size: 13px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.3px; }

.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin: 18px 0 10px;
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pin-grid-item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--input);
  position: relative;
  cursor: pointer;
}
.pin-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.pin-grid-item .no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* -------------------------------------------------------------------------
   Notification list
   ------------------------------------------------------------------------- */
.notif-item {
  display: flex; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(255,179,0,0.04); margin: 0 -20px; padding: 13px 20px; }
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--input);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-text { font-size: 13.5px; }
.notif-time { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

/* -------------------------------------------------------------------------
   Toast
   ------------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #232325;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  max-width: 85vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------------------------------------------------------------------------
   Loading
   ------------------------------------------------------------------------- */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------------------
   Misc form helpers
   ------------------------------------------------------------------------- */
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-dim); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }

.photo-upload {
  width: 100%; height: 140px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  background: var(--input);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}
.photo-upload img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.photo-upload .icon { font-size: 26px; margin-bottom: 4px; }

.beer-suggestions {
  max-height: 160px;
  overflow-y: auto;
  background: var(--input);
  border-radius: var(--radius-sm);
  margin-top: -8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  display: none;
}
.beer-suggestions.show { display: block; }
.beer-suggestion-item {
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.beer-suggestion-item:last-child { border-bottom: none; }
.beer-suggestion-item:active { background: var(--card-alt); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.switch-row-label { font-size: 14px; font-weight: 600; }
.switch-row-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.toggle {
  width: 46px; height: 28px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s var(--ease);
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s var(--ease);
}
.toggle.on::after { transform: translateX(18px); }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: #1a1200;
  text-transform: uppercase;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.friend-req-actions { display: flex; gap: 8px; }
.friend-req-actions button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.friend-req-accept { background: rgba(52,199,89,0.14); color: var(--success); }
.friend-req-decline { background: rgba(255,90,95,0.14); color: var(--danger); }

.admin-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  #auth-screen { align-items: center; }
  .auth-card { max-width: 380px; margin: 0 auto; }
  .sheet { max-width: 480px; margin: 0 auto; left: 0; right: 0; }
}

/* -------------------------------------------------------------------------
   In-app camera
   ------------------------------------------------------------------------- */
.sheet-camera {
  background: #000;
  border: none;
  border-radius: 0;
  max-height: 100vh;
  z-index: 200;
}
#camera-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}
#camera-video, #camera-preview-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
#camera-video.mirrored, #camera-pip-img.mirrored { transform: scaleX(-1); }
#camera-canvas { display: none; }

#camera-pip-wrap {
  position: absolute;
  left: 14px;
  top: calc(84px + var(--safe-top));
  width: 96px; height: 128px;
  border-radius: 14px;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 5;
}
#camera-pip-img { position: static; width: 100%; height: 100%; object-fit: cover; }

#camera-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,0.55), transparent);
  z-index: 6;
}
#camera-top-bar .icon-btn {
  background: rgba(30,30,32,0.6);
  backdrop-filter: blur(6px);
}
.camera-mode-segmented {
  background: rgba(30,30,32,0.55);
  backdrop-filter: blur(6px);
}

#camera-dual-row {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 132px;
  z-index: 6;
}
#camera-dual-row .camera-dual-toggle-row {
  background: rgba(22,22,24,0.72);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
#camera-dual-row.hidden { display: none; }

#camera-status {
  position: absolute;
  top: calc(70px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,90,95,0.9);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 6;
  display: flex; align-items: center; gap: 6px;
}
#camera-status .rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

#camera-bottom-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 24px calc(28px + var(--safe-bottom));
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  z-index: 6;
}
#btn-camera-shutter {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 4px solid #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
#camera-shutter-inner {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.15s var(--ease);
}
#btn-camera-shutter.recording #camera-shutter-inner {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--danger);
}
#camera-bottom-bar .btn { flex-shrink: 0; }
#btn-camera-retake, #btn-camera-use { position: absolute; }
#btn-camera-retake { left: 24px; }
#btn-camera-use { right: 24px; }

/* -------------------------------------------------------------------------
   Nomination lock
   ------------------------------------------------------------------------- */
.nominate-locked-hint {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.nomination-reply-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,179,0,0.1);
  border: 1px solid rgba(255,179,0,0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.nomination-reply-banner .emoji { font-size: 22px; }

/* -------------------------------------------------------------------------
   Leaderboard
   ------------------------------------------------------------------------- */
.leaderboard-row.is-me { background: rgba(255,179,0,0.06); margin: 0 -20px; padding: 12px 20px; border-radius: 12px; }
.leaderboard-rank {
  width: 34px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-dim);
}

/* -------------------------------------------------------------------------
   Achievements
   ------------------------------------------------------------------------- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.achievement-badge {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
}
.achievement-badge.locked { opacity: 0.4; filter: grayscale(0.6); }
.achievement-badge.unlocked { border-color: var(--accent); background: rgba(255,179,0,0.08); }
.achievement-emoji { font-size: 26px; margin-bottom: 4px; }
.achievement-name { font-size: 10.5px; font-weight: 700; line-height: 1.25; }
.achievement-progress { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

/* -------------------------------------------------------------------------
   Video badge on grid thumbnails
   ------------------------------------------------------------------------- */
.pin-grid-video-badge {
  position: absolute; right: 6px; bottom: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.pin-grid-item { display: block; }

/* -------------------------------------------------------------------------
   Drinking graph
   ------------------------------------------------------------------------- */
.drinking-graph-wrap { margin-bottom: 20px; }
.drinking-graph-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px 6px;
}
.drinking-graph-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.drinking-graph-bar {
  width: 100%;
  max-width: 14px;
  border-radius: 4px 4px 2px 2px;
  background: var(--input);
  min-height: 3px;
}
.drinking-graph-bar.has-chug { background: var(--accent); }
.drinking-graph-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 2px;
}

/* -------------------------------------------------------------------------
   Map theme select (settings)
   ------------------------------------------------------------------------- */
.theme-select-row { margin-bottom: 18px; }

/* -------------------------------------------------------------------------
   Light map theme — swaps just the map chrome, the app shell stays dark
   ------------------------------------------------------------------------- */
body[data-map-theme="light"] #top-bar .search-pill {
  background: rgba(255,255,255,0.92);
  color: #1a1a1a;
}
body[data-map-theme="light"] #top-bar .icon-btn,
body[data-map-theme="light"] .locate-btn {
  background: rgba(255,255,255,0.92);
  color: #1a1a1a;
  border-color: rgba(0,0,0,0.08);
}
body[data-map-theme="light"] .drop-pin-hint { filter: invert(0); }