/* ============================================================================
   HOST SUB-SITE — "modern MySpace" social profile for trivia hosts.
   Standalone (no app chrome). Brand colors arrive as --hs-primary / --hs-accent
   from a nonce'd :root block in the page template; everything derives from them
   so each host's page is unmistakably *theirs*.
   ============================================================================ */

:root {
  --hs-primary: #f0a32f;
  --hs-accent: #e2694a;
  --hs-bg: #1b120a;
  --hs-text: #f4ebdc;
  /* Everything below derives from the page's background + text, so a brand
     background (dark OR light, set in Branding) keeps every card, border and
     muted line readable. White-alpha surfaces vanished on a light page. */
  --hs-bg-2: color-mix(in srgb, var(--hs-bg) 90%, var(--hs-text));
  --hs-surface: color-mix(in srgb, var(--hs-text) 4.5%, transparent);
  --hs-surface-2: color-mix(in srgb, var(--hs-text) 6%, transparent);
  --hs-border: color-mix(in srgb, var(--hs-text) 12%, transparent);
  --hs-muted: color-mix(in srgb, var(--hs-text) 66%, var(--hs-bg));
  /* Accent as TEXT: a bright brand accent (cyan, gold) is unreadable on a
     light page, so words in the accent lean toward the page's ink. */
  --hs-accent-ink: color-mix(in srgb, var(--hs-accent) 62%, var(--hs-text));
  --hs-gold: #fbbf24;
  --hs-radius: 16px;
  --hs-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Rubik', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -5%, color-mix(in srgb, var(--hs-primary) 22%, transparent), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, color-mix(in srgb, var(--hs-accent) 16%, transparent), transparent 55%),
    var(--hs-bg);
  color: var(--hs-text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--hs-accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: 'Rubik', sans-serif; line-height: 1.15; }

.hs-shell { max-width: 1100px; margin: 0 auto; padding: 0 1rem 4rem; }

/* ── Cover band ─────────────────────────────────────────────────────────── */
.hs-cover {
  height: 200px;
  margin: 0 -1rem;
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--hs-primary) 75%, #000) 0%,
                    color-mix(in srgb, var(--hs-accent) 60%, var(--hs-primary)) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -40px 60px -20px rgba(0, 0, 0, 0.55);
}
.hs-cover.has-img { background-size: cover; background-position: center; }
.hs-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 200px at 80% 10%, rgba(255, 255, 255, 0.18), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 22px);
  mix-blend-mode: screen;
}

/* ── Profile header ─────────────────────────────────────────────────────── */
/* The avatar overlaps the cover; the name sits below it, so it reads on the
   page background whatever the cover's colours are. */
.hs-profile {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: -64px;
  padding: 0 .5rem 1rem;
  position: relative;
  z-index: 2;
}
.hs-avatar {
  width: 132px; height: 132px; flex: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--hs-primary), var(--hs-accent));
  padding: 4px;
  box-shadow: 0 0 0 3px var(--hs-bg), 0 14px 40px -12px color-mix(in srgb, var(--hs-accent) 60%, transparent);
}
.hs-avatar img, .hs-avatar .hs-avatar-fallback {
  width: 100%; height: 100%; border-radius: 20px; object-fit: cover;
  background: var(--hs-bg-2);
}
.hs-avatar img { display: block; }
/* Same specificity as the rule above: a lone .hs-avatar-fallback lost to its
   display:block and the letter sat in the top-left corner. */
.hs-avatar .hs-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 3rem;
  color: var(--hs-text); letter-spacing: -1px;
}
.hs-id { flex: 1; min-width: 0; padding-top: 76px; }
/* One ink per headline: a two-tone gradient on a heading reads as an AI tell. */
.hs-name {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 800; margin: 0;
  color: var(--hs-text);
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.hs-verified {
  font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--hs-accent-ink); border: 1px solid color-mix(in srgb, var(--hs-accent) 45%, transparent);
  background: color-mix(in srgb, var(--hs-accent) 12%, transparent);
  padding: .2rem .5rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
}
.hs-status { color: var(--hs-muted); font-size: 1.05rem; margin: .35rem 0 .7rem; }
.hs-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.hs-statpill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--hs-surface); border: 1px solid var(--hs-border);
  padding: .3rem .65rem; border-radius: 999px; font-size: .85rem; color: var(--hs-text);
}
.hs-statpill b { font-weight: 700; }
.hs-statpill small { color: var(--hs-muted); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.hs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-weight: 700; font-size: .95rem; padding: .6rem 1.1rem; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; transition: transform .14s var(--hs-spring), filter .14s ease;
  text-decoration: none; min-height: 44px;
}
.hs-btn:hover { transform: translateY(-2px); text-decoration: none; }
.hs-btn-primary {
  color: #100e0c; background: linear-gradient(120deg, var(--hs-accent), var(--hs-primary));
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--hs-accent) 70%, transparent);
}
.hs-btn-ghost { color: var(--hs-text); background: var(--hs-surface); border-color: var(--hs-border); }
.hs-btn-block { width: 100%; }

/* ── Layout grid ────────────────────────────────────────────────────────── */
.hs-grid { display: grid; grid-template-columns: 312px 1fr; gap: 1.25rem; align-items: start; }
.hs-rail { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.hs-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* ── Cards & panels ─────────────────────────────────────────────────────── */
.hs-card, .hs-panel {
  background: linear-gradient(180deg, var(--hs-surface-2), var(--hs-surface));
  border: 1px solid var(--hs-border); border-radius: var(--hs-radius);
  backdrop-filter: blur(6px);
}
.hs-card { padding: 1rem 1.05rem; }
.hs-panel { padding: 1.1rem 1.2rem 1.25rem; }
.hs-card-title {
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--hs-muted); margin-bottom: .75rem;
}
.hs-panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.hs-icon {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hs-primary) 40%, transparent),
                              color-mix(in srgb, var(--hs-accent) 30%, transparent));
  border: 1px solid var(--hs-border);
}
.hs-panel-head h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.hs-empty { color: var(--hs-muted); font-style: italic; padding: .35rem 0; }

/* ── Rail: contact card ─────────────────────────────────────────────────── */
.hs-contact .hs-followcount { text-align: center; color: var(--hs-muted); font-size: .9rem; margin-top: .6rem; }
.hs-contact .hs-followcount b { color: var(--hs-text); font-size: 1.05rem; }
.hs-meta-rows { margin-top: .85rem; display: flex; flex-direction: column; gap: .5rem; }
.hs-meta-row { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--hs-muted); }
.hs-meta-row b { color: var(--hs-text); font-weight: 600; }
.hs-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.hs-link {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem;
  background: var(--hs-surface); border: 1px solid var(--hs-border);
  padding: .35rem .6rem; border-radius: 999px; color: var(--hs-text);
}
.hs-link:hover { border-color: var(--hs-accent); text-decoration: none; }

/* ── Rail: Top 8 ────────────────────────────────────────────────────────── */
.hs-top8 { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.hs-team {
  position: relative; text-align: center; padding: .7rem .4rem .55rem;
  background: var(--hs-surface); border: 1px solid var(--hs-border); border-radius: 13px;
  transition: transform .14s var(--hs-spring), border-color .14s ease;
}
a.hs-team:hover { transform: translateY(-3px); border-color: var(--hs-accent); text-decoration: none; }
.hs-team-rank {
  position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hs-primary), var(--hs-accent)); color: #100e0c;
  font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.5);
}
.hs-team-av {
  width: 48px; height: 48px; margin: 0 auto .4rem; border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hs-primary) 60%, #000), var(--hs-accent));
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 1.1rem;
  object-fit: cover;
}
.hs-team-name { font-size: .8rem; font-weight: 600; color: var(--hs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-team-glory { font-size: .72rem; color: var(--hs-muted); }

/* ── Rail: Plus nudge ───────────────────────────────────────────────────── */
.hs-plus {
  background: linear-gradient(135deg, color-mix(in srgb, var(--hs-primary) 30%, transparent),
                              color-mix(in srgb, var(--hs-accent) 22%, transparent));
  border: 1px solid color-mix(in srgb, var(--hs-accent) 35%, transparent);
}
.hs-plus h3 { font-size: 1rem; margin-bottom: .35rem; }
.hs-plus p { font-size: .85rem; color: var(--hs-muted); margin-bottom: .75rem; }

/* ── Events ─────────────────────────────────────────────────────────────── */
.hs-events { display: flex; flex-direction: column; gap: .6rem; }
.hs-event {
  display: flex; align-items: center; gap: .9rem; padding: .7rem .8rem;
  background: var(--hs-surface); border: 1px solid var(--hs-border); border-radius: 13px;
  transition: transform .14s var(--hs-spring), border-color .14s ease;
}
.hs-event:hover { transform: translateX(3px); border-color: var(--hs-accent); text-decoration: none; }
.hs-datebadge {
  flex: none; width: 54px; text-align: center; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--hs-border); background: var(--hs-bg-2);
}
.hs-datebadge .m { font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(120deg, var(--hs-primary), var(--hs-accent)); color: #100e0c; padding: .15rem 0; }
.hs-datebadge .d { font-size: 1.3rem; font-weight: 800; padding: .15rem 0 .25rem; color: var(--hs-text); }
.hs-event-body { min-width: 0; }
.hs-event-title { font-weight: 700; color: var(--hs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-event-meta { font-size: .82rem; color: var(--hs-muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.hs-event-go { margin-left: auto; flex: none; color: var(--hs-accent-ink); font-weight: 700; font-size: .85rem; }

/* ── Venues / generic tiles ─────────────────────────────────────────────── */
.hs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.hs-tile {
  padding: .85rem .9rem; background: var(--hs-surface); border: 1px solid var(--hs-border); border-radius: 13px;
  transition: transform .14s var(--hs-spring), border-color .14s ease;
}
.hs-tile:hover { transform: translateY(-3px); border-color: var(--hs-accent); text-decoration: none; }
.hs-tile-title { font-weight: 700; color: var(--hs-text); margin-bottom: .2rem; }
.hs-tile-meta { font-size: .82rem; color: var(--hs-muted); }
.hs-tile-pill {
  display: inline-block; margin-top: .4rem; font-size: .72rem; color: var(--hs-accent-ink);
  background: color-mix(in srgb, var(--hs-accent) 12%, transparent); padding: .15rem .5rem; border-radius: 999px;
}

/* ── Leaderboard rows ───────────────────────────────────────────────────── */
.hs-board { display: flex; flex-direction: column; gap: .45rem; }
.hs-board-row {
  display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem;
  background: var(--hs-surface); border: 1px solid var(--hs-border); border-radius: 11px;
}
.hs-board-row.top1 { border-color: color-mix(in srgb, var(--hs-gold) 55%, transparent); background: color-mix(in srgb, var(--hs-gold) 8%, var(--hs-surface)); }
.hs-rank { font-family: 'Rubik', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--hs-accent-ink); width: 1.7rem; text-align: center; }
.hs-board-row.top1 .hs-rank { color: var(--hs-gold); }
.hs-board-name { font-weight: 600; flex: 1; color: var(--hs-text); }
.hs-board-stat { font-size: .85rem; color: var(--hs-muted); }

/* ── The Wall — styling lives in WallSection.vue (content-hashed bundle, so it
   never goes stale from a cached host-site.css). This is only the minimal
   no-JS / crawler fallback shown before the island mounts. ────────────────── */
.hs-wall-ssr { display: flex; flex-direction: column; gap: .4rem; }
.hs-wall-ssr-item { color: var(--hs-text); line-height: 1.5; }

/* ── Gallery / media ────────────────────────────────────────────────────── */
.hs-gallery { display: grid; gap: .55rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hs-gallery.hs-cols-1 { grid-template-columns: minmax(0, 1fr); }
.hs-gallery.hs-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hs-gallery.hs-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hs-gallery.hs-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hs-gallery.hs-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hs-gallery figure { margin: 0; }
.hs-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--hs-border); }
.hs-gallery figcaption { font-size: .78rem; color: var(--hs-muted); margin-top: .25rem; }
.hs-media img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--hs-border); }
.hs-caption { font-size: .82rem; color: var(--hs-muted); margin-top: .4rem; }
.hs-team-av.hs-team-av-sm { width: 34px; height: 34px; margin: 0; }
.hs-owner-note {
  font-size: .88rem; color: var(--hs-muted); padding: .9rem 1rem;
  border: 1px dashed var(--hs-border); border-radius: 12px;
}
.hs-prose { color: var(--hs-text); }
.hs-prose :is(h2, h3) { margin: 0 0 .5rem; }
.hs-prose p { margin: 0 0 .65rem; }
.hs-prose ul { margin: 0 0 .65rem 1.1rem; }
.hs-prose a { color: var(--hs-accent-ink); text-decoration: underline; }

/* ── Owner banner, gated, footer ────────────────────────────────────────── */
.hs-owner {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin: 1rem 0 0; padding: .7rem 1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--hs-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--hs-accent) 30%, transparent); font-size: .9rem;
}
.hs-owner code { background: color-mix(in srgb, var(--hs-text) 10%, transparent); padding: .15rem .45rem; border-radius: 6px; }
.hs-owner.is-draft { border-style: dashed; }

/* Section anchors (/h/slug#events): land with a little air above. */
.hs-main > section[id] { scroll-margin-top: 1rem; }
html { scroll-behavior: smooth; }
.hs-gated { text-align: center; padding: 1.5rem; border: 1px dashed var(--hs-border); border-radius: 13px; color: var(--hs-muted); }
.hs-footer { text-align: center; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hs-border); color: var(--hs-muted); font-size: .82rem; }
.hs-footer a { color: var(--hs-text); font-weight: 600; }
.hs-missing { max-width: 520px; margin: 5rem auto; text-align: center; }
.hs-missing h1 { font-size: 1.8rem; margin-bottom: .6rem; }

/* ── Follow island (Vue) — base.html's .btn-neon no longer in scope ─────── */
#host-site-app { width: 100%; }
#host-site-app .btn-neon {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; width: 100%;
  font-weight: 700; font-size: .95rem; padding: .7rem 1rem; border-radius: 12px; min-height: 44px;
  cursor: pointer; border: 1px solid transparent; color: #100e0c;
  background: linear-gradient(120deg, var(--hs-accent), var(--hs-primary));
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--hs-accent) 70%, transparent);
  transition: transform .14s var(--hs-spring);
}
#host-site-app .btn-neon:hover { transform: translateY(-2px); }
#host-site-app .btn-neon-ghost {
  color: var(--hs-text); background: var(--hs-surface); border-color: var(--hs-border); box-shadow: none;
}
#host-site-app .btn-neon:disabled { opacity: .6; cursor: default; transform: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* A 4-6 column gallery is postage stamps on a phone. */
  .hs-gallery.hs-cols-3, .hs-gallery.hs-cols-4,
  .hs-gallery.hs-cols-5, .hs-gallery.hs-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hs-grid { grid-template-columns: 1fr; }
  .hs-rail { position: static; }
  .hs-profile { flex-direction: column; align-items: center; text-align: center; margin-top: -56px; }
  .hs-id { padding-top: 0; }
  .hs-name { justify-content: center; }
  .hs-avatar { width: 110px; height: 110px; }
  .hs-stats { justify-content: center; }
  .hs-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
