/* Drip -- AI outfit rater. Black base, purple->pink gradient, gold accents. */
:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.14);
  --text: #ffffff;
  --muted: rgba(255,255,255,.52);
  --muted-2: rgba(255,255,255,.34);
  --grad: linear-gradient(135deg, #a259ff 0%, #ff6b6b 100%);
  --grad-soft: linear-gradient(135deg, rgba(162,89,255,.16), rgba(255,107,107,.16));
  --purple: #a259ff;
  --pink: #ff6b6b;
  --gold: #f5c518;
  --danger: #ff5468;
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --header-h: 56px;
  --maxw: 620px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.45; overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea {
  font-family: inherit; font-size: 15px; width: 100%; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 14px; outline: none;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(162,89,255,.22); }
select { appearance: none; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; letter-spacing: .02em; text-transform: uppercase; }
.hidden { display: none !important; }

/* Text helpers */
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.muted { color: var(--muted); }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  transition: transform .1s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.grad { background: var(--grad); color: #fff; border: none; box-shadow: 0 8px 26px rgba(162,89,255,.35); }
.btn.grad:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.gold { background: var(--gold); color: #1a1400; border: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(255,84,104,.5); color: #ff9aa6; }
.btn.danger:hover { background: rgba(255,84,104,.15); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* --- Auth screen --- */
#authScreen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.wordmark { font-size: 46px; font-weight: 900; letter-spacing: -.03em; text-align: center; margin: 0 0 2px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .32em; text-transform: uppercase; margin-bottom: 26px; }
.auth-tabs { display: flex; gap: 6px; background: var(--surface); border-radius: 999px; padding: 5px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 11px; border-radius: 999px; font-weight: 700; color: var(--muted); font-size: 14px; transition: all .15s; }
.auth-tabs button.active { background: var(--grad); color: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --- App shell --- */
#appShell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: rgba(10,10,10,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.app-header .logo { font-size: 24px; font-weight: 900; letter-spacing: -.03em; }
.app-header .h-actions { display: flex; align-items: center; gap: 6px; }
.rep-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13px; color: var(--gold); background: rgba(245,197,24,.12); border: 1px solid rgba(245,197,24,.3); padding: 5px 11px; border-radius: 999px; }
.rep-badge svg { width: 14px; height: 14px; fill: var(--gold); }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px); }

/* --- Bottom nav --- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(14,14,14,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.bottom-nav .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted-2); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 8px 0; }
.bottom-nav .nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.bottom-nav .nav-item.active { color: var(--text); }
.bottom-nav .nav-item.active svg { stroke: url(#dripGrad); }
.bottom-nav .nav-fab {
  width: 56px; height: 56px; border-radius: 50%; background: var(--grad); margin-top: -22px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(162,89,255,.45); flex: 0 0 auto;
}
.bottom-nav .nav-fab svg { width: 28px; height: 28px; stroke: #fff; }

/* --- Cards / grids --- */
.section-title { font-size: 22px; font-weight: 900; letter-spacing: -.02em; margin: 6px 2px 16px; }
.feed { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.outfit-card { cursor: pointer; transition: transform .12s ease, border-color .15s; }
.outfit-card:active { transform: scale(.99); }
.outfit-photo { position: relative; width: 100%; aspect-ratio: 4/5; background: var(--bg-2); overflow: hidden; }
.outfit-photo img { width: 100%; height: 100%; object-fit: cover; }
.score-chip {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: baseline; gap: 2px;
  background: rgba(0,0,0,.62); backdrop-filter: blur(6px); border: 1px solid rgba(245,197,24,.4);
  padding: 6px 11px; border-radius: 999px; font-weight: 900; color: var(--gold); font-size: 17px;
}
.score-chip .max { font-size: 11px; color: rgba(245,197,24,.6); font-weight: 700; }
.occ-chip {
  position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; letter-spacing: .02em;
}
.card-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.card-foot .u { font-weight: 700; font-size: 14px; }
.card-foot .rep { color: var(--gold); font-size: 12px; font-weight: 700; }

/* Profile grid */
.p-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.p-tile { position: relative; aspect-ratio: 4/5; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); cursor: pointer; border: 1px solid var(--line); }
.p-tile img { width: 100%; height: 100%; object-fit: cover; }
.p-tile .score-chip { top: 8px; right: 8px; font-size: 14px; padding: 4px 8px; }
.p-tile .vis-dot { position: absolute; bottom: 8px; left: 8px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }

.profile-head { display: flex; align-items: center; gap: 16px; margin: 4px 2px 22px; }
.profile-head .avatar { width: 72px; height: 72px; font-size: 28px; }
.profile-head .p-name { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.stat-row { display: flex; gap: 10px; margin: 0 0 22px; }
.stat { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.stat .v { font-size: 24px; font-weight: 900; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* --- Upload --- */
.uploader { display: flex; flex-direction: column; gap: 4px; }
.drop {
  aspect-ratio: 4/5; max-height: 46vh; border-radius: var(--radius); border: 2px dashed var(--line-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface); color: var(--muted); text-align: center; padding: 20px; overflow: hidden; position: relative;
}
.drop.has-img { border-style: solid; padding: 0; }
.drop img { width: 100%; height: 100%; object-fit: cover; }
.drop .drop-ico { width: 54px; height: 54px; border-radius: 50%; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; }
.drop .drop-ico svg { width: 26px; height: 26px; stroke: var(--purple); fill: none; stroke-width: 2; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2);
  font-weight: 700; font-size: 13.5px; color: var(--muted); transition: all .12s; text-transform: capitalize;
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

/* Visibility segmented */
.seg { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px; }
.seg button { flex: 1; padding: 10px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); text-transform: capitalize; }
.seg button.active { background: var(--grad); color: #fff; }

/* --- Detail --- */
.detail-photo { width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); aspect-ratio: 4/5; margin-bottom: 18px; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.score-hero { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.score-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative;
  background: radial-gradient(closest-side, var(--bg) 72%, transparent 73% 100%), conic-gradient(var(--gold) calc(var(--p)*1%), rgba(255,255,255,.1) 0); }
.score-ring .n { font-size: 26px; font-weight: 900; color: var(--gold); }
.score-hero .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.score-hero .fb { font-size: 14px; color: rgba(255,255,255,.82); margin-top: 4px; line-height: 1.5; }
.block-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.block-card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.tip { display: flex; gap: 10px; padding: 7px 0; font-size: 14.5px; line-height: 1.45; }
.tip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); margin-top: 8px; flex-shrink: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 7px 13px; border-radius: 999px; background: var(--grad-soft); border: 1px solid rgba(162,89,255,.3); font-weight: 700; font-size: 13px; text-transform: capitalize; }
.rate-row { display: flex; flex-wrap: wrap; gap: 7px; }
.rate-pill { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 800; display: flex; align-items: center; justify-content: center; transition: all .1s; }
.rate-pill.on { background: var(--gold); color: #1a1400; border-color: transparent; }

/* Misc */
.detail-user { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; margin: 50px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); z-index: 100;
  background: #fff; color: #0a0a0a; font-weight: 700; font-size: 14px; padding: 11px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); color: #fff; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.back-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.ai-pending { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

@media (min-width: 640px) {
  .p-grid { grid-template-columns: repeat(3, 1fr); }
}
