/* upload.nono.my
   Keeps the palette this site has always had (#2B2A33 ground, lavender accent)
   and borrows the shape language from id.nono.my: rounded cards, soft borders,
   chips rather than boxes. */
:root {
  --bg: #2B2A33;
  --panel: #34333e;
  --panel-2: #3d3b49;
  --line: #474553;
  --text: #f2eff7;
  --dim: #a49fb2;
  --accent: #d2ace8;
  --accent-deep: #ab80d1;
  --bad: #ff6c6c;
  --good: #8fdba8;
  --radius: 12px;
}
* { box-sizing: border-box; }
/* An explicit `display` in author CSS beats the [hidden] attribute, which is
   how the drop overlay ended up permanently on screen. Make hidden win for
   everything so this cannot happen again. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; padding: 1rem 1.1rem 3rem;
  background: var(--bg); color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100%;
}

/* ---- top bar ---- */
.bar {
  display: flex; align-items: center; gap: .55rem;
  flex-wrap: wrap; margin-bottom: .9rem;
}
.bar h1 {
  font-size: 1.05rem; margin: 0 .3rem 0 0; font-weight: 700;
  letter-spacing: -.01em; color: var(--accent);
}
input[type="search"], select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .4rem .6rem; font-size: .85rem; font-family: inherit;
}
input[type="search"] { flex: 1; min-width: 140px; }
input[type="search"]:focus, select:focus { outline: none; border-color: var(--accent-deep); }
button {
  font-family: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: .4rem .8rem; font-size: .85rem; font-weight: 600;
}
button:hover { border-color: var(--accent-deep); }
button.primary { background: var(--accent); border-color: var(--accent); color: #2a1f33; }
button.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.who { color: var(--dim); font-size: .78rem; margin-left: auto; }
.who a { color: var(--accent); text-decoration: none; }
.stats { color: var(--dim); font-size: .75rem; margin: 0 0 .7rem; }

/* ---- grid ---- */
.grid {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.tile {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.tile:hover { border-color: var(--accent-deep); }
.thumb {
  aspect-ratio: 16 / 10; background: var(--panel-2);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.glyph { font-size: 1.5rem; color: var(--dim); font-weight: 700; letter-spacing: .02em; }
.badge {
  position: absolute; right: .35rem; bottom: .35rem;
  background: rgba(20,18,26,.82); color: var(--text);
  font-size: .62rem; font-weight: 700; padding: .1rem .32rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.meta { padding: .45rem .55rem .5rem; display: grid; gap: .15rem; min-width: 0; }
.fname {
  font-size: .76rem; font-weight: 600; color: var(--text);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fname:hover { color: var(--accent); }
.sub { font-size: .68rem; color: var(--dim); display: flex; gap: .35rem; }
.actions { display: flex; gap: .3rem; padding: 0 .55rem .5rem; }
.act {
  flex: 1; padding: .22rem; font-size: .68rem; font-weight: 600;
  background: var(--panel-2); border: 1px solid transparent;
}
.act:hover { border-color: var(--accent-deep); }
.act.del:hover { border-color: var(--bad); color: var(--bad); }

/* ---- uploading tiles ---- */
.tile.uploading .thumb { background: var(--panel-2); }
.fill {
  position: absolute; inset: auto 0 0 0; height: 100%;
  background: linear-gradient(0deg, rgba(210,172,232,.30), rgba(210,172,232,.10));
  transform-origin: bottom; transition: transform .18s linear;
}
.pct {
  position: relative; font-size: .95rem; font-weight: 700; color: var(--text);
}
.tile.failed { border-color: var(--bad); }
.tile.failed .glyph { color: var(--bad); }

/* ---- drop overlay ---- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(43,42,51,.86); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 2rem;
}
.drop-inner {
  border: 2px dashed var(--accent); border-radius: 16px;
  padding: 2.5rem 3.5rem; font-size: 1.1rem; font-weight: 700; color: var(--accent);
}

/* ---- misc ---- */
.empty { color: var(--dim); font-size: .85rem; }
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: .5rem .9rem; border-radius: 999px; font-size: .8rem; z-index: 60;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
}
.toast.bad { border-color: var(--bad); color: var(--bad); }
