* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #0d0f12; color: #e9eaee; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
button, input, select { font: inherit; }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 24px;
  background: rgba(13,15,18,.92); backdrop-filter: blur(10px); border-bottom: 1px solid #1d2026; }
.top:empty { display: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: 4px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.18); flex: none; }
.searchform { display: flex; align-items: center; gap: 8px; min-width: 0; }
.searchbox { display: flex; align-items: center; gap: 8px; width: min(420px, 34vw); height: 38px; padding: 0 12px;
  background: #171a1f; border: 1px solid #262a31; border-radius: 10px; color: #6b7280; }
.searchbox:focus-within { border-color: #3ddc84; }
.search { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; }
.search::placeholder { color: #6b7280; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sel { height: 38px; padding: 0 10px; background: #171a1f; color: #e9eaee; border: 1px solid #262a31; border-radius: 10px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #262a31; background: #171a1f; color: #e9eaee; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #1e2228; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: #3ddc84; border-color: #3ddc84; color: #06120b; }
.btn.primary:hover:not(:disabled) { background: #5ee69b; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.linkbtn { border: 0; background: none; padding: 4px 6px; color: #9aa0aa; font-weight: 600; cursor: pointer; border-radius: 6px; }
.linkbtn:hover { color: #fff; background: #1e2228; }
.linkbtn.danger:hover { color: #ff7a7a; }
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #9aa0aa; cursor: pointer; flex: none; }
.iconbtn:hover { background: #1e2228; color: #fff; }
.iconbtn .ic { width: 20px; height: 20px; }
.spacer { flex: 1; }
.status { display: flex; align-items: center; gap: 8px; color: #c7cad1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status:empty { display: none; }
.credits { padding: 4px 10px; border-radius: 999px; background: #171a1f; border: 1px solid #22262d; color: #9aa0aa; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account { display: flex; align-items: center; gap: 4px; color: #c7cad1; white-space: nowrap; }
.who-name { font-weight: 600; }
.muted { color: #6b7280; }
.small { font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; animation: p 1s ease-in-out infinite alternate; flex: none; }
@keyframes p { from { opacity: .25; } to { opacity: 1; } }

/* ---------- filtros ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 24px 4px; }
.bar:empty { display: none; }
.seg { display: flex; padding: 3px; background: #15181d; border: 1px solid #22262d; border-radius: 10px; flex: none; }
.seg button { border: 0; background: none; color: #9aa0aa; padding: 6px 12px; border-radius: 7px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button.on { background: #262a31; color: #fff; }
.toggle { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid #22262d; background: #15181d; color: #9aa0aa; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none; }
.toggle.on { border-color: #3ddc84; color: #3ddc84; background: rgba(61,220,132,.08); }
.chip { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: #262a31; color: #fff; cursor: pointer; white-space: nowrap; flex: none; }
.chip b { color: #9aa0aa; font-weight: 400; }

/* ---------- grade ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding: 18px 24px 60px; }
.card { background: #15181d; border: 1px solid #1f232a; border-radius: 14px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
@media (hover: hover) { .card:hover { border-color: #353a43; transform: translateY(-2px); } .card:hover .play { opacity: 0; } }
.media, .mosaic { position: relative; aspect-ratio: 4 / 5; background: #000; overflow: hidden; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; pointer-events: none; }
.play .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.nomedia { display: grid; place-items: center; height: 100%; padding: 16px; color: #9aa0aa; text-align: center; font-size: 13px; background: #1a1d22; }
.nomedia.sm { padding: 0; }
.badge { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px); color: #c7cad1; }
.badge.ok { background: #3ddc84; color: #06120b; }
.badge.mid { background: #f5b942; color: #1d1405; }
.foot { padding: 10px 12px 12px; display: grid; gap: 6px; }
.priceRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.price { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price.none, .bigprice.none { font-size: 13px; font-weight: 500; color: #6b7280; }
.shimmer { color: #3a3f48 !important; animation: p .9s ease-in-out infinite alternate; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(61,220,132,.12); color: #3ddc84; font-size: 12px; font-weight: 600; flex: none; }
.tag .ic { width: 13px; height: 13px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 13px; color: #c7cad1; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.meta { display: flex; gap: 12px; color: #9aa0aa; font-size: 12px; font-variant-numeric: tabular-nums; }
.m { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.m .ic { width: 13px; height: 13px; }
.mosaic { display: grid; gap: 2px; }
.mosaic.n2, .mosaic.n3, .mosaic.n4 { grid-template-columns: 1fr 1fr; }
.mosaic.n3 > :first-child { grid-row: span 2; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.empty { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: center; padding: 100px 16px; text-align: center; color: #6b7280; font-size: 15px; }
.empty strong { color: #e9eaee; font-size: 16px; }

/* ---------- detalhe ---------- */
.modal { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 32px; background: rgba(0,0,0,.72); }
.sheet { display: grid; grid-template-columns: minmax(0, auto) 360px; width: min(1100px, 100%); max-height: calc(100vh - 64px);
  background: #15181d; border: 1px solid #262a31; border-radius: 16px; overflow: hidden; }
.big { position: relative; display: grid; place-items: center; background: #000; min-height: 0; }
.closefloat { display: none; position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; background: rgba(0,0,0,.6); color: #fff; }
.big img, .big video { max-width: 100%; max-height: calc(100vh - 64px); display: block; }
.big .nomedia { width: 420px; height: 520px; }
.side { display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow-y: auto; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.verdict { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; border-radius: 12px; background: #1d2026; }
.verdict strong { font-size: 18px; }
.verdict span { color: #9aa0aa; font-variant-numeric: tabular-nums; }
.verdict.ok { background: rgba(61,220,132,.12); } .verdict.ok strong { color: #3ddc84; }
.verdict.mid { background: rgba(245,185,66,.12); } .verdict.mid strong { color: #f5b942; }
.offer { display: grid; gap: 2px; }
.offerPrice { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bigprice { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.signals { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.signals li { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 8px; }
.signals li span { font-weight: 600; font-variant-numeric: tabular-nums; }
.signals li em { font-style: normal; color: #9aa0aa; }
.links { display: grid; gap: 8px; }
.linkrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: #1b1e24; border: 1px solid #262a31; color: #e9eaee; text-decoration: none; font-weight: 600; }
a.linkrow:hover { border-color: #3a3f48; }
.linkrow em { font-style: normal; font-weight: 400; color: #9aa0aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.linkrow.ok { border-color: rgba(61,220,132,.4); }
.linkrow.ok span { color: #3ddc84; }
.linkrow.off { opacity: .55; }
.body { margin: 0; color: #c7cad1; white-space: pre-wrap; font-size: 13px; line-height: 1.5; max-height: 180px; overflow-y: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* ---------- login ---------- */
#auth:empty { display: none; }
body.authmode .top, body.authmode .bar, body.authmode .grid, body.authmode .modal { display: none; }
#auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.authcard { width: min(380px, 100%); display: grid; gap: 10px; }
.authcard .brand { margin-bottom: 18px; }
.authcard h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.authcard > p { margin: 0; }
.authform { display: grid; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: #c7cad1; }
.field input, .input { height: 44px; padding: 0 14px; background: #171a1f; color: #fff; border: 1px solid #262a31; border-radius: 10px; outline: 0; font-size: 16px; min-width: 0; }
.field input:focus, .input:focus { border-color: #3ddc84; }
.authform .btn { height: 44px; margin-top: 4px; }
.hint { margin: -6px 0 0; font-size: 12px; color: #6b7280; }
.formerr { margin: 0; color: #ff7a7a; font-size: 13px; }
.formerr:empty { display: none; }
.invitenote { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(61,220,132,.08); color: #3ddc84; font-weight: 600; }

/* ---------- convites ---------- */
.admin { grid-column: 1 / -1; display: grid; gap: 18px; width: min(760px, 100%); margin: 0 auto; }
.panel { background: #15181d; border: 1px solid #1f232a; border-radius: 14px; padding: 20px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font-size: 17px; }
.panel > p { margin: 0; }
.inviteform { display: flex; gap: 8px; }
.inviteform .input { flex: 1; height: 40px; font-size: 14px; }
.newlink { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.3); }
.newlink code { flex: 1 1 100%; font-size: 13px; color: #3ddc84; word-break: break-all; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #1f232a; }
.list li:first-child { border-top: 0; }
.li-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.li-main strong, .li-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main span { font-size: 13px; }
.li-actions { display: flex; gap: 4px; }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #1f232a; color: #9aa0aa; white-space: nowrap; }
.pill.aguardando { background: rgba(245,185,66,.12); color: #f5b942; }
.pill.usado { background: rgba(61,220,132,.12); color: #3ddc84; }
.pill.me { background: #262a31; color: #fff; }

/* ---------- celular ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .top { flex-wrap: wrap; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .top .spacer { display: none; }
  .brand { order: 1; flex: 1; }
  .top > .seg { order: 2; }
  .account { order: 3; }
  .searchform { order: 4; flex: 1 1 100%; }
  .searchbox { flex: 1; width: auto; min-width: 0; height: 42px; }
  .searchform { min-width: 0; }
  .search { font-size: 16px; }
  .searchform .sel { width: 92px; height: 42px; padding: 0 6px; font-size: 13px; }
  .searchform .btn { height: 42px; padding: 0 14px; }
  .status { order: 5; flex: 1; font-size: 13px; }
  .credits { order: 6; }
  .bar { flex-wrap: nowrap; padding: 10px 12px 2px; overflow-x: auto; scrollbar-width: none; }
  .bar::-webkit-scrollbar { display: none; }
  .bar .spacer { display: none; }
  .bar .sel { flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 40px; }
  .card { border-radius: 12px; }
  .badge { left: 8px; top: 8px; font-size: 11px; padding: 3px 8px; }
  .foot { padding: 8px 10px 10px; gap: 4px; }
  .price { font-size: 15px; }
  .tag { padding: 2px 6px; font-size: 0; gap: 0; }
  .tag .ic { width: 14px; height: 14px; }
  .who { font-size: 12px; }
  .av { width: 16px; height: 16px; }
  .meta { gap: 8px; font-size: 11px; }
  .meta .m:nth-child(3) { display: none; }
  .modal { padding: 0; place-items: stretch; }
  .sheet { display: block; max-height: none; height: 100dvh; border-radius: 0; border: 0; overflow-y: auto; }
  .big { display: block; height: 58vh; overflow: hidden; }
  .big img, .big video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
  .big .nomedia { width: 100%; height: 40vh; }
  .side { overflow: visible; padding: 14px 14px max(20px, env(safe-area-inset-bottom)); }
  .closefloat { display: grid; }
  .side .row .iconbtn { display: none; }
  .actions .btn { flex: 1; }
  .admin { gap: 12px; }
  .panel { padding: 16px; }
  .inviteform { flex-direction: column; }
  .newlink .btn { flex: 1; }
  .list li { flex-wrap: wrap; }
}
