* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #eee;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 16px 32px;
}
#app { width: 100%; max-width: 420px; }
header {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: -16px -16px 16px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, #1a1a2e 80%, rgba(22, 33, 62, 0.94) 100%);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.header-brand { flex: 1; min-width: 0; text-align: left; }
h1 { font-size: 1.7rem; letter-spacing: -1px; line-height: 1.15; }
#subtitle { opacity: 0.7; font-size: 0.85rem; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-login {
  background: #ff4757;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.header-photos {
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 10px;
  line-height: 1.25;
  text-align: center;
  border-radius: 12px;
  max-width: 140px;
}
.header-photos strong {
  display: block;
  color: #ffd700;
  font-size: 0.9rem;
}
.header-actions .ghost { padding: 8px 12px; font-size: 0.85rem; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 0.95rem; }
.auth-switch .linkish,
button.linkish {
  background: none;
  border: none;
  color: #ff6b6b;
  font-weight: 700;
  text-decoration: underline;
  padding: 0;
  margin: 0;
  font-size: inherit;
  cursor: pointer;
  display: inline;
  width: auto;
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

.card, .person-card {
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}
input[type="file"] { margin: 16px 0; }
input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 1rem;
  margin-top: 6px;
}
#enter-btn, button {
  background: #ff4757;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 8px;
  transition: transform 0.1s;
}
#enter-btn:disabled, button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
button:hover:not(:disabled) { transform: scale(1.05); }
.not { background: #576574; }
.hot { background: #ff6b6b; }
.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.25); }

.person-card img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
}
.person-card { position: relative; }
.actions { display: flex; justify-content: space-around; margin: 20px 0; }
.stats { text-align: center; opacity: 0.8; }
#preview img, #add-preview img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin-top: 12px; }
#leaderboard-list { margin: 16px 0; }
.lb-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; background: rgba(255,255,255,0.05); border-radius: 8px; margin: 6px 0; }
.lb-item .badge { margin: 0; }

.ad-placeholder { margin-top: 20px; text-align: center; }
.ad-slot {
  background: rgba(255,255,255,0.08);
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 30px 10px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  opacity: 0.6;
}
.gopro {
  background: linear-gradient(90deg, #ffd700, #ffb700);
  color: #222;
  font-weight: 700;
  width: 100%;
  max-width: 320px;
}

.auth-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.tab { background: rgba(255,255,255,0.08); color: #eee; padding: 8px 18px; font-size: 0.9rem; }
.tab.active { background: #ff4757; }
.field, .field-label { display: block; text-align: left; font-size: 0.85rem; opacity: 0.85; margin-top: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 4px; }
.chip {
  background: rgba(255,255,255,0.08);
  color: #eee;
  padding: 8px 14px;
  margin: 0;
  font-size: 0.85rem;
  border-radius: 999px;
}
.chip.selected { background: #ff4757; }
.filters { margin-bottom: 16px; }
.filter-group { margin-bottom: 8px; }
.badge-row { position: absolute; top: 16px; left: 16px; display: flex; gap: 6px; z-index: 1; }
.badge {
  background: #ffd700;
  color: #222;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  margin: 0;
}
.badge-muted { background: rgba(0,0,0,0.55); color: #fff; }
.error { color: #ff8b8b; margin-top: 12px; font-size: 0.9rem; }
.muted { opacity: 0.7; font-size: 0.9rem; margin: 8px 0 16px; }
.check-label { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 12px 0; font-size: 0.9rem; }
.photos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.photo-tile {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.photo-tile img { width: 100%; height: 180px; object-fit: cover; display: block; }
.photo-tile .meta { padding: 8px; font-size: 0.85rem; }
.photo-tile .tile-actions { display: flex; flex-wrap: wrap; justify-content: center; }
.photo-tile button { padding: 6px 10px; font-size: 0.75rem; margin: 4px; }
.best-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ffd700;
  color: #222;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 999px;
}
.add-photo-card { margin-bottom: 16px; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}
.modal.hidden { display: none !important; }
.modal .card { max-width: 360px; width: 100%; }

.req { opacity: 0.75; font-weight: 600; font-size: 0.75rem; text-transform: lowercase; }

button.header-login,
button.header-photos,
button#header-logout-btn {
  margin: 0;
}
button.header-login:hover:not(:disabled),
button.header-photos:hover:not(:disabled),
button#header-logout-btn:hover:not(:disabled),
button.linkish:hover:not(:disabled) {
  transform: none;
}
button.linkish {
  margin: 0;
  padding: 0;
  background: none;
  color: #ff6b6b;
  box-shadow: none;
}

.chip.edition {
  border: 1px solid rgba(255, 215, 0, 0.4);
}
.chip.edition.selected {
  background: #c9a227;
  color: #1a1a1a;
}
.edition-hint { font-size: 0.8rem; margin: 4px 0 10px; }
.badge-cougar { background: #c9a227; color: #1a1a1a; }
.badge-sugardaddy { background: #8fa4b8; color: #1a1a1a; }
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 1rem;
  margin-top: 6px;
}
