:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #101119;
  color: #f5f2ff;
  --muted: #bcb9ce;
  --surface: #1a1b27;
  --line: #38394e;
  --accent: #cefb83;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #d6c0ff; outline-offset: 4px; }
.top {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 12px max(5vw, calc((100vw - 1150px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; gap: 12px; align-items: center; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.mark { background: var(--accent); color: #16210d; border-radius: 10px; padding: 7px 10px; font-size: 1rem; }
main { width: min(90%, 1150px); margin: 0 auto; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.65rem, 7vw, 5.25rem); letter-spacing: -.075em; line-height: .98; margin-bottom: 20px; }
p { color: var(--muted); line-height: 1.55; }
p:empty { display: none; }
#notice { margin-top: 24px; }
.gate {
  margin: clamp(34px, 10vh, 110px) auto;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  width: min(100%, 890px);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
}
.gate-art, .card-art {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, #ffffff0a 0 1px, transparent 1px 21px),
    radial-gradient(ellipse at 25% 15%, #5a537d, transparent 65%),
    linear-gradient(140deg, #352b59, #202538 70%, #39402c);
}
.gate-art span {
  display: grid;
  place-items: center;
  width: clamp(82px, 14vw, 150px);
  aspect-ratio: 1;
  border-radius: 32%;
  transform: rotate(-12deg);
  background: var(--accent);
  color: #15200d;
  font-size: clamp(2rem, 6vw, 4.5rem);
  box-shadow: 12px 18px 0 #09091770, 0 0 50px #aaff4940;
}
.gate-content { padding: clamp(24px, 5vw, 58px); }
.gate-content h1 { font-size: clamp(2.5rem, 5.4vw, 4.15rem); }
form label, .filters label { display: grid; gap: 8px; font-size: .95rem; font-weight: 650; }
#login { display: grid; gap: 12px; margin-top: 25px; }
input, select { width: 100%; min-height: 45px; padding: 9px 12px; color: inherit; background: #11121c; border: 1px solid var(--line); border-radius: 9px; }
select { appearance: none; padding-right: 35px; background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 52% / 5px 5px no-repeat, linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 52% / 5px 5px no-repeat #11121c; }
button { min-height: 44px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: #16210d; font-weight: 750; }
button:hover { filter: brightness(1.1); }
.secondary { color: inherit; background: var(--surface); border-color: var(--line); }
#login-error, #video-error { color: #ffb5bf; margin: 0; }
.hero { padding: clamp(38px, 7vw, 80px) 0 18px; }
.hero p { font-size: 1.125rem; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
#count { margin: 22px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; padding-bottom: 44px; }
.card { padding: 0; overflow: hidden; text-align: left; background: var(--surface); color: inherit; border-color: var(--line); }
.card-art { aspect-ratio: 16 / 9; color: var(--accent); font-size: 2.2rem; }
.card-content { display: grid; gap: 6px; padding: 15px; overflow-wrap: anywhere; }
.card-content strong { font-size: 1.13rem; }
.card-content > span { color: var(--muted); font-weight: 500; font-size: .93rem; }
dialog { width: min(92vw, 850px); max-height: 90dvh; border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--surface); color: inherit; }
dialog::backdrop { background: #080810d9; }
.player-header, .player-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.player-header > div, .player-footer > p { min-width: 0; overflow-wrap: anywhere; }
#clip-meta { margin-bottom: 4px; }
video { width: 100%; max-height: 55dvh; display: block; background: #080810; border-radius: 10px; }
.player-footer { margin-top: 14px; }
#share { flex-shrink: 0; }
#share-status { margin: 10px 0 0; }
@media (max-width: 640px) {
  .gate { grid-template-columns: 1fr; }
  .gate-art { min-height: 150px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .player-footer { flex-wrap: wrap; }
}
