/* ─── RESET & TOKENS ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0D0C0B;
  --surface:     #181614;
  --surface2:    #222018;
  --surface3:    #2A2826;
  --text:        #F0EBE6;
  --muted:       #9A9490;
  --muted2:      #605C58;
  --amber:       #CC5F42;
  --amber-soft:  rgba(204,95,66,.15);
  --amber-mid:   rgba(204,95,66,.30);
  --border:      rgba(240,235,230,.07);
  --border2:     rgba(240,235,230,.13);
  --radius:      12px;
  --radius-sm:   8px;
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
.h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.h3 { font-size: 1rem;    font-weight: 600; }
.small { font-size: .8125rem; color: var(--muted); }
.tag-label {
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,12,11,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
  height: 56px;
}
.nav-logo {
  font-size: .9375rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text);
  flex-shrink: 0;
}
.nav-logo span { color: var(--amber); }
.nav-spacer { flex: 1; }
.nav-link {
  font-size: .875rem; color: var(--muted);
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--amber); }
.nav-btn {
  font-size: .875rem; font-weight: 600;
  padding: 8px 18px; border-radius: var(--radius-sm);
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid var(--amber-mid);
  transition: background .15s, border-color .15s;
}
.nav-btn:hover { background: var(--amber-mid); border-color: var(--amber); }

/* ─── FILTER CHIPS ───────────────────────────────────────────────────────── */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 20px 24px 0;
}
.chip {
  font-size: .8125rem; font-weight: 500;
  padding: 6px 16px; border-radius: 99px;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border);
  transition: all .15s;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--border2); }
.chip.active {
  background: var(--amber-soft); color: var(--amber);
  border-color: var(--amber-mid);
}

/* ─── PHOTO GRID (masonry via columns) ───────────────────────────────────── */
.grid-wrap { padding: 20px 24px 48px; }
.grid {
  column-count: 3;
  column-gap: 12px;
}
@media (max-width: 900px) { .grid { column-count: 2; } }
@media (max-width: 560px) { .grid { column-count: 1; } }

.photo-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  border-color: var(--amber-mid);
}
.photo-card img {
  width: 100%; height: auto;
  display: block;
  background: var(--surface2);
  transition: opacity .2s;
}
.photo-card img.loading { opacity: 0; }
.photo-card-meta {
  padding: 10px 12px 12px;
  display: flex; align-items: center; gap: 8px;
}
.photo-card-meta .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface3); flex-shrink: 0;
  overflow: hidden;
}
.photo-card-meta .avatar img { width: 100%; height: 100%; object-fit: cover; }
.photo-card-meta .name {
  font-size: .8125rem; font-weight: 500; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-card-meta .steps-badge {
  font-size: .6875rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  background: var(--amber-soft); color: var(--amber);
  white-space: nowrap; flex-shrink: 0;
}

/* ─── EMPTY / LOADING STATES ─────────────────────────────────────────────── */
.state-center {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  padding: 80px 24px; color: var(--muted);
}
.state-center svg { opacity: .3; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MODAL / SHEET ──────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  max-width: 480px; width: 100%;
  padding: 28px;
  transform: translateY(20px);
  transition: transform .25s ease;
  max-height: 90vh; overflow-y: auto;
}
.overlay.open .sheet { transform: translateY(0); }

/* ─── DETAIL PAGE ─────────────────────────────────────────────────────────── */
.detail-wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.detail-hero {
  position: relative;
  width: 100%; border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
  margin-bottom: 24px; max-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.detail-hero img { max-height: 70vh; width: 100%; object-fit: contain; }
.detail-hero #before-img {
  position: absolute; inset: 0; height: 100%;
  pointer-events: none;
}
.detail-hero.comparing { cursor: ew-resize; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  transform: translateX(-50%);
  pointer-events: none;
}
.compare-handle-grip {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: #0D0C0B;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  pointer-events: auto; cursor: ew-resize;
}
.compare-label {
  position: absolute; top: 12px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em;
  color: #fff; background: rgba(0,0,0,.55);
  padding: 4px 10px; border-radius: 99px;
  pointer-events: none;
}
.compare-label-before { left: 12px; }
.compare-label-after  { right: 12px; }
.detail-meta {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.detail-meta .avatar-lg {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface2); flex-shrink: 0; overflow: hidden;
}
.detail-meta .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta .author-name { font-weight: 600; }
.detail-meta .author-sub  { font-size: .8125rem; color: var(--muted); }

.detail-description {
  font-size: .9375rem; line-height: 1.6; color: var(--text);
  margin-bottom: 20px;
}

.exif-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.exif-chip {
  font-size: .8rem; padding: 5px 12px;
  background: var(--surface2); border-radius: 99px;
  color: var(--muted); border: 1px solid var(--border);
}
.exif-chip strong { color: var(--text); margin-right: 4px; }

/* ─── PIEDPATH TIMELINE ───────────────────────────────────────────────────── */
.piedpath-section { margin-bottom: 32px; }
.piedpath-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.piedpath-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}
.step-list { display: flex; flex-direction: column; gap: 6px; }
.step-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
}
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--amber-soft); border: 1px solid var(--amber-mid);
  color: var(--amber); font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-tool-icon {
  font-size: .75rem; color: var(--muted2);
  width: 20px; text-align: center; flex-shrink: 0;
}
.step-label { font-size: .875rem; color: var(--text); }

/* ─── EXPERT NOTE ─────────────────────────────────────────────────────────── */
.expert-note {
  margin-bottom: 32px; padding: 14px 16px;
  background: var(--amber-soft); border: 1px solid var(--amber-mid);
  border-radius: var(--radius-sm);
}
.expert-note .piedpath-title { margin-bottom: 8px; }
.expert-note p {
  font-size: .875rem; line-height: 1.6; color: var(--text);
  font-style: italic;
}

/* ─── IMPORT BUTTON ──────────────────────────────────────────────────────── */
.import-wrap {
  position: sticky; bottom: 0;
  background: linear-gradient(transparent, var(--bg) 40%);
  padding: 32px 0 24px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.btn-import {
  flex: 1; min-width: 160px;
  padding: 14px 24px; border-radius: var(--radius-sm);
  background: var(--amber); color: #fff; font-weight: 700;
  font-size: .9375rem; letter-spacing: .01em;
  transition: opacity .15s, transform .1s;
  text-align: center;
}
.btn-import:hover   { opacity: .9; }
.btn-import:active  { transform: scale(.98); }
.btn-secondary {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border2); font-size: .9rem;
  transition: color .15s, border-color .15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border2); }

/* ─── QR MODAL ───────────────────────────────────────────────────────────── */
.qr-modal-inner { text-align: center; }
.qr-modal-inner canvas { margin: 0 auto 16px; border-radius: var(--radius-sm); }
.qr-modal-inner p { font-size: .875rem; color: var(--muted); }

/* ─── ADMIN TABLE ────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 4px;
  padding: 20px 24px 0;
}
.admin-tab {
  font-size: .875rem; font-weight: 500;
  padding: 8px 20px; border-radius: var(--radius-sm);
  color: var(--muted); background: transparent;
  border: 1px solid transparent;
  transition: all .15s;
}
.admin-tab:hover { background: var(--surface2); color: var(--text); }
.admin-tab.active {
  background: var(--amber-soft); color: var(--amber);
  border-color: var(--amber-mid);
}
.admin-tab .badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 7px; border-radius: 99px;
  font-size: .7rem; font-weight: 700;
  background: var(--amber); color: #fff;
}
.admin-grid { padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 10px; }
.admin-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; overflow: hidden;
}
.admin-card-thumb {
  width: 90px; height: 90px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface2);
}
.admin-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-card-info { flex: 1; min-width: 0; }
.admin-card-info .title { font-weight: 600; margin-bottom: 4px; }
.admin-card-info .sub   { font-size: .8125rem; color: var(--muted); margin-bottom: 8px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-approve {
  padding: 6px 16px; border-radius: var(--radius-sm); font-size: .8125rem; font-weight: 600;
  background: rgba(74,196,120,.15); color: #4AC478; border: 1px solid rgba(74,196,120,.3);
  transition: background .15s;
}
.btn-approve:hover { background: rgba(74,196,120,.28); }
.btn-reject {
  padding: 6px 16px; border-radius: var(--radius-sm); font-size: .8125rem; font-weight: 600;
  background: rgba(220,60,60,.12); color: #e05555; border: 1px solid rgba(220,60,60,.28);
  transition: background .15s;
}
.btn-reject:hover { background: rgba(220,60,60,.24); }
.btn-view {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: .8125rem;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
}

/* ─── AUTH FORM ──────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 18px; padding: 36px; width: 100%; max-width: 400px;
}
.auth-logo { font-size: 1.1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 28px; }
.auth-logo span { color: var(--amber); }
.auth-toggle { margin-bottom: 24px; font-size: .875rem; color: var(--muted); }
.auth-toggle a { color: var(--amber); font-weight: 500; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8125rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .9375rem; font-family: var(--font);
  transition: border-color .15s;
  outline: none;
}
.form-input:focus { border-color: var(--amber); }
.form-input::placeholder { color: var(--muted2); }
.form-error { font-size: .8125rem; color: #e05555; margin-top: 4px; min-height: 18px; }
.btn-full {
  width: 100%; padding: 13px; border-radius: var(--radius-sm);
  background: var(--amber); color: #fff; font-weight: 700; font-size: .9375rem;
  transition: opacity .15s; margin-top: 8px;
}
.btn-full:hover   { opacity: .9; }
.btn-full:disabled { opacity: .5; cursor: not-allowed; }
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--muted2); font-size: .8125rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border2); }
.btn-google {
  width: 100%; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); font-size: .9rem;
  border: 1px solid var(--border2); display: flex; align-items: center;
  justify-content: center; gap: 10px; transition: border-color .15s;
}
.btn-google:hover { border-color: var(--border2); background: var(--surface3); }

/* ─── 404 ────────────────────────────────────────────────────────────────── */
.not-found {
  min-height: calc(100vh - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 24px;
}
.not-found .code { font-size: 5rem; font-weight: 800; color: var(--amber); opacity: .4; line-height: 1; }
.not-found .msg  { font-size: 1.1rem; color: var(--muted); }
.not-found a { color: var(--amber); font-weight: 600; }

/* ─── RESPONSIVE NAV ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 0 16px; }
  .nav-link { display: none; }
  .grid-wrap { padding: 16px 12px 48px; }
  .filters   { padding: 16px 12px 0; }
  .detail-wrap { padding: 20px 16px 80px; }
  .admin-grid  { padding: 16px 12px 48px; }
}

/* ─── SITE FOOTER ────────────────────────────────────────────────────────── */
/* Carries the links Play expects to be reachable from the site itself —
   privacy and account deletion — rather than only from a URL typed by
   someone who already knows it. */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px;
  padding: 28px 16px 40px;
  border-top: 1px solid var(--border);
  font-size: .8125rem; color: var(--muted2);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--amber); text-decoration: underline; }
