/* PixelPup Files - matches the PixelPup cyber-boho look: deep cosmos bg,
   lavender accents, frosted cards. Mobile-first. */
* { box-sizing: border-box; }
:root {
  --bg: #0d0b1e;
  --bg2: #171331;
  --card: rgba(30, 25, 60, 0.75);
  --line: rgba(183, 166, 255, 0.25);
  --text: #eae6ff;
  --muted: #9b93c0;
  --accent: #b7a6ff;
  --accent2: #7c5cff;
  --danger: #ff6b9d;
  --ok: #7dffb2;
}
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 700px at 20% -10%, #241c4d 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { font-weight: 600; margin: 0.2em 0 0.6em; }
.brand { font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent), #ff9de2);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big { font-size: 1.6rem; text-align: center; display: block; margin-bottom: 0.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.error { color: var(--danger); }
.ok { color: var(--ok); }

/* layout */
.bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
  background: rgba(13, 11, 30, 0.8); position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5; }
.bar .who { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
main { padding: 1rem; max-width: 1100px; margin: 0 auto; }
.centered { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

/* cards + forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.4rem; width: 100%; max-width: 360px; backdrop-filter: blur(10px); }
.card.wide { max-width: none; margin-bottom: 1rem; }
label { display: block; margin: 0.6rem 0; }
input, select {
  width: 100%; padding: 0.55rem 0.7rem; margin-top: 0.2rem;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.row { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.row.right { justify-content: flex-end; align-items: center; }
.row label { flex: 0 1 auto; margin: 0; }
.check input { width: auto; }

/* buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font: inherit; text-decoration: none; text-align: center; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(90deg, var(--accent2), #a052ff);
  border: none; color: #fff; font-weight: 600; }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.85em; }
.btn.danger { color: var(--danger); }
button[type="submit"] { margin-top: 0.8rem; width: 100%; }
.row button[type="submit"], .factions .btn { width: auto; margin-top: 0; }

/* uploader */
.uploader { border: 2px dashed var(--line); border-radius: 14px; text-align: center;
  padding: 1.6rem 1rem; margin-bottom: 1rem; transition: border-color 0.15s, background 0.15s; }
.uploader.hot { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }
.progress { position: relative; height: 22px; border-radius: 999px; overflow: hidden;
  background: var(--bg2); margin-top: 0.8rem; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--accent2), #a052ff); transition: width 0.2s; }
.progress-bar.ok { background: linear-gradient(90deg, #4fd48a, var(--ok)); }
.progress-bar.bad { background: var(--danger); }
.progress span { position: relative; font-size: 0.8em; line-height: 22px; }

.card.resume { border-color: var(--accent); display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.card.resume .btn { margin-top: 0.4rem; }

/* per-file upload rows with preview */
.up-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.up-row { display: flex; gap: 0.8rem; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.8rem; }
.up-thumb { flex: 0 0 auto; width: 68px; height: 50px; border-radius: 8px; overflow: hidden;
  background: var(--bg2); display: grid; place-items: center; }
.up-thumb img, .up-thumb video { width: 100%; height: 100%; object-fit: cover; }
.up-icon { font-size: 1.7rem; }
.up-info { flex: 1 1 auto; min-width: 0; }
.up-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-info .progress { height: 14px; margin-top: 0.35rem; }
.up-status { margin-top: 0.25rem; }
.up-status.ok { color: var(--ok); }

/* file grid */
.grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; }
.thumb { display: grid; place-items: center; aspect-ratio: 16/10; background: var(--bg2);
  text-decoration: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.icon { font-size: 2.6rem; }
.fmeta { padding: 0.6rem 0.8rem 0.2rem; }
.fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factions { display: flex; gap: 0.4rem; padding: 0.6rem 0.8rem 0.8rem; flex-wrap: wrap; }

/* share/invite lists */
.sharelist { list-style: none; margin: 0; padding: 0; }
.sharelist li { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.sharelist input { flex: 1 1 200px; font-size: 0.8em; }
#share-new, #inv-new { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; }
#share-new input, #inv-new input { flex: 1 1 220px; font-size: 0.8em; }
.qr { width: 200px; height: 200px; border-radius: 10px; background: #fff; padding: 8px; }

/* tabs */
.tabs { display: flex; gap: 0.3rem; }
.tab { background: none; border: none; color: var(--muted); font: inherit; cursor: pointer;
  padding: 0.4rem 0.8rem; border-radius: 999px; }
.tab.active { color: var(--text); background: rgba(124, 92, 255, 0.18); }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.table tr.disabled td { opacity: 0.45; }

/* viewer */
.viewer-main { text-align: center; }
.viewer-media { max-width: 100%; max-height: 75vh; border-radius: 12px; margin: 0.8rem 0; }
audio.viewer-media { width: 100%; }
.cast-row { margin: 0.2rem 0 0.4rem; }
#cast-btn { font-size: 0.95rem; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(5, 4, 15, 0.75); display: grid;
  place-items: center; padding: 1rem; z-index: 20; backdrop-filter: blur(3px); }
.modal { max-width: 520px; max-height: 85vh; overflow: auto; }
@media (max-width: 560px) {
  .bar { gap: 0.5rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
