:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --border: #2a2a2e;
  --text: #efeff1;
  --muted: #adadb8;
  --purple: #9147ff;
  --purple-hi: #a970ff;
  --live: #eb0400;
  --voted: #00b46a;
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8; --surface: #fff; --surface-2: #efeff1; --border: #dcdce0;
    --text: #0e0e10; --muted: #53535f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;   /* sticky footer */
}
a { color: var(--purple-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.wrap { max-width: 1100px; width: 100%; margin: 0 auto; padding: 20px 16px 40px; flex: 1 0 auto; }

/* header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; filter: invert(1); }  /* dark default → white mark */
.brand-tag {
  font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em;
  border-left: 1px solid var(--border); padding-left: 10px; white-space: nowrap;
}
@media (prefers-color-scheme: light) { .brand-logo { filter: none; } }

.site-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; flex: none; }
.user-chip { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; }
.avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-radius: 6px; padding: 7px 12px;
  font-weight: 600; font-size: 14px; color: var(--text); background: var(--surface-2);
}
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }

/* now playing */
.now-playing {
  display: flex; gap: 18px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--live);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
}
.now-playing[hidden] { display: none; }
.np-art { width: 78px; height: 104px; object-fit: cover; border-radius: 8px; flex: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.28); }
.np-body { flex: 1; min-width: 0; }
.np-label { color: var(--live); font-weight: 700; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.np-title { font-size: 22px; font-weight: 800; margin-top: 3px; line-height: 1.15; }
.np-sub { color: var(--muted); margin-top: 2px; }
.np-watch { flex: none; padding: 10px 18px; font-size: 15px; }
.np-watch .live-dot { background: #fff; }

/* live-on-main banner (replaces now-playing when Christian is streaming) */
.live-banner {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--live); border-left: 4px solid var(--live);
  border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
}
.live-banner[hidden] { display: none; }
.lb-body { min-width: 0; }
.lb-label { color: var(--live); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.lb-label .live-dot { animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.lb-title { font-size: 20px; font-weight: 800; margin-top: 2px; }
.lb-sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-live { background: var(--live); color: #fff; flex: none; }
.btn-live .live-dot { background: #fff; }

/* YouTube promo — VODs, cinematics, trophy guides */
.yt-promo {
  --yt: #ff0033;
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px; color: var(--text);
  background: rgba(255,0,51,.06); border: 1px solid rgba(255,0,51,.28);
  border-radius: var(--radius); padding: 14px 18px;
}
.yt-promo:hover { text-decoration: none; background: rgba(255,0,51,.11); }
.yt-ico { color: var(--yt); flex: none; line-height: 0; display: inline-flex; }
.yt-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.yt-text strong { font-size: 15px; }
.yt-sub { background: var(--yt); color: #fff; flex: none; font-weight: 700; padding: 9px 18px; }
.yt-sub:hover { filter: brightness(1.08); }

/* toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.search input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px;  /* 16px = no iOS zoom-on-focus */
}
.search input:focus { outline: 2px solid var(--purple); border-color: var(--purple); }

.notice {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--purple);
  padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; color: var(--muted);
}

/* grid — title spans the full body width; vote controls sit in a bottom row */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.card {
  display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; align-items: stretch;
}
.card-locked { opacity: .6; }
.card-art { position: relative; flex: none; width: 62px; }
.card-art img, .art-fallback { width: 62px; height: 83px; border-radius: 6px; object-fit: cover; display: block; }
.art-fallback { background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.badge { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 4px; }
.badge-live { background: var(--live); color: #fff; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.card-title { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; }
.card-meta { font-size: 12.5px; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: auto; padding-top: 8px; }
.vote-count { font-size: 12.5px; color: var(--muted); }
.vote-count b { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.vote-btn { background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.vote-btn.voted { background: var(--voted); color: #fff; border-color: transparent; }
.vote-btn:disabled { opacity: .6; cursor: default; }
.yt-link { font-size: 12.5px; margin-left: auto; }
.locked { font-size: 12.5px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); }

/* footer */
.site-footer {
  flex: none; max-width: 1100px; width: 100%; margin: 0 auto; padding: 18px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--border);
}
.footer-copy { display: flex; flex-direction: column; gap: 2px; }
.socials { display: flex; gap: 14px; align-items: center; }
.socials a { color: var(--muted); display: inline-flex; line-height: 0; }
.socials a:hover { color: var(--text); }

/* toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ------- tablet ------- */
@media (max-width: 720px) {
  .site-header { padding: 10px 12px; gap: 8px; }
  .wrap { padding: 16px 12px 32px; }
  .brand-logo { height: 26px; }
}

/* ------- phone ------- */
@media (max-width: 480px) {
  .site-nav { gap: 8px; }
  .brand-tag { display: none; }              /* logo alone is enough on a phone */
  .hide-xs { display: none; }                /* "with Twitch" */
  .btn { padding: 8px 12px; }

  .now-playing { gap: 12px 14px; padding: 12px; flex-wrap: wrap; }
  .np-art { width: 56px; height: 75px; }
  .np-title, .lb-title { font-size: 17px; }
  .np-watch { width: 100%; justify-content: center; }   /* full-width below the info */

  .live-banner { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .lb-watch { width: 100%; justify-content: center; }
  .yt-promo { flex-wrap: wrap; }
  .yt-sub { width: 100%; justify-content: center; margin-top: 2px; }

  .toolbar { gap: 8px; }
  .search { min-width: 0; flex-basis: 100%; }
  .stats { flex-basis: 100%; }

  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 10px; gap: 10px; }
  .card-art, .card-art img, .art-fallback { width: 58px; }
  .card-art img, .art-fallback { height: 77px; }
  .vote-btn { padding: 9px 12px; min-height: 40px; }   /* comfortable tap target */

  .site-footer { flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px 12px; }
}
