:root {
  --fg: #f4f1ea;
  --muted: #b9b4a8;
  --accent: #ffffff;
  --bg: #07070a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow: hidden;
}
body.locked { overflow: hidden; }

.bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.scrim {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 25%);
  pointer-events: none;
}

.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 24px 32px;
}
.brand {
  color: var(--fg); text-decoration: none;
  font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: 14px;
}
.menu-item {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--fg); font: inherit; font-size: 14px;
  letter-spacing: .18em; text-transform: uppercase;
  border-bottom: 1px solid transparent;
}
.menu-item:hover, .menu-item:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

.modal {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: 88vh; overflow-y: auto;
  padding: 40px 36px 36px;
  background: rgba(14,14,18,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.modal h2 {
  margin: 0 0 14px;
  font-size: 22px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg);
}
.modal p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--fg); }
.modal h2:not(:first-child) { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }

.credits { margin: 0; }
.credits dt {
  margin-top: 18px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.credits dt:first-child { margin-top: 0; }
.credits dd { margin: 4px 0 0; font-size: 18px; line-height: 1.4; }
.amp { color: var(--muted); font-size: 14px; }

.close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 28px; line-height: 1;
}
.close:hover, .close:focus-visible { color: var(--fg); outline: none; }

@media (max-width: 520px) {
  .nav { padding: 18px 20px; }
  .modal-card { padding: 36px 22px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
}

/* ---------- nav tweaks: readable over a light or dark video ---------- */
.nav { z-index: 5; mix-blend-mode: difference; gap: 28px; }
.nav nav { display: flex; gap: 28px; }
.nav .menu-item { color: #fff; }
.nav .menu-item:hover, .nav .menu-item:focus-visible { color: #fff; border-color: #fff; }
.scrim { display: none; }

/* ---------- chat strip ---------- */
.strip {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 4;
  width: min(460px, 100%);
  display: flex; flex-direction: column;
  background: #000; color: #fff;
  border-left: 1px solid #222;
}
.strip-head {
  padding: 70px 24px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .24em;
  border-bottom: 1px solid #222;
  display: flex; align-items: center; gap: 10px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.gate { margin: auto 0; padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; }
.gate[hidden], .chat[hidden] { display: none; }
.gate h1 { margin: 0; font-size: 30px; line-height: 1.1; text-transform: uppercase; letter-spacing: .04em; }
.gate p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.gate .fine { font-size: 11px; color: #777; }
.err { color: #fff !important; font-size: 13px; min-height: 1em; }

.strip input {
  background: #111; border: 1px solid #333; color: #fff;
  padding: 14px; font: inherit; font-size: 16px; border-radius: 4px; min-width: 0;
}
.strip input:focus { outline: none; border-color: #fff; }
button.primary {
  background: #fff; color: #000; border: 0; border-radius: 4px; cursor: pointer;
  padding: 14px 20px; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
button.primary:hover { background: #ddd; }
button.primary:disabled { opacity: .5; cursor: wait; }

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.log { flex: 1; overflow-y: auto; padding: 20px 22px 8px; display: flex; flex-direction: column; gap: 12px; }
.m { max-width: 88%; padding: 12px 14px; border-radius: 10px; line-height: 1.5; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.m.bot { align-self: flex-start; background: #141414; border: 1px solid #2a2a2a; }
.m.me { align-self: flex-end; background: #fff; color: #000; }
.m.thinking { color: #888; font-style: italic; }
.m.notice, .m.err { border-color: #fff; }
.m.star { cursor: pointer; border-style: dashed; border-color: #fff; }

.chips { display: flex; flex-direction: column; gap: 8px; padding: 0 22px 10px; }
.chips:empty { display: none; }
.chips button {
  text-align: left; background: transparent; color: #fff; cursor: pointer;
  border: 1px solid #444; border-radius: 6px; padding: 11px 12px; font: inherit; font-size: 14px; line-height: 1.35;
}
.chips button:hover, .chips button:focus-visible { border-color: #fff; background: #111; outline: none; }
.chips b { display: inline-block; width: 1.4em; }

.composer { display: flex; gap: 8px; padding: 14px 22px 22px; border-top: 1px solid #222; }
.composer input { flex: 1; }

/* ---------- leaderboard ---------- */
.sub { color: var(--muted); }
.lb { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lb li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; }
.lb .empty { color: var(--muted); justify-content: center; }
.lb .rank { font-size: 22px; font-weight: 800; width: 28px; text-align: center; }
.lb .what { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb .what span { color: #ccc; font-size: 14px; line-height: 1.4; }
.lb .what i { color: var(--muted); font-size: 12px; }
.lb .vote { background: none; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lb .vote:hover { border-color: #fff; }
.lb .vote.on { background: #fff; color: #000; cursor: default; }

@media (max-width: 520px) { .strip { border-left: 0; } }

/* never show native video controls / play overlay on the background */
.bg { pointer-events: none; }
.bg::-webkit-media-controls, .bg::-webkit-media-controls-start-playback-button,
.bg::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
