/* CrewFest — dark festival look: black, blood red, bone white, gothic titles. */
:root {
  --bg: #0b0908;
  --bg-2: #15110f;
  --card: #1b1613;
  --card-2: #241d19;
  --line: #3a2e27;
  --text: #efe6da;
  --muted: #a39282;
  --red: #c4161c;
  --red-hot: #ff3b2f;
  --ember: #e8892b;
  --must: #c4161c;
  --maybe: #8a6a2f;
  --radius: 10px;
  --font-title: "Pirata One", "UnifrakturCook", Georgia, serif;
  --font-body: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --tabs-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
/* iOS zooms on inputs under 16px */
input, select { font-size: 17px; }
body {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(196, 22, 28, .28), transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 110%, rgba(232, 137, 43, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 500 17px/1.35 var(--font-body);
  letter-spacing: .01em;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 72px);
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(var(--bg) 70%, rgba(11, 9, 8, .85));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-title {
  font: 400 34px/1 var(--font-title);
  color: var(--text);
  text-shadow: 0 0 18px rgba(255, 59, 47, .45), 2px 2px 0 var(--red);
}
.brand-sub { white-space: nowrap; font-size: 13px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin-top: 4px; }
.top-right { display: flex; align-items: center; gap: 6px; flex: none; }
.sync {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.sync::before { content: "●"; margin-right: 5px; }
.sync[data-state="ok"]::before { color: #3fb950; }
.sync[data-state="pending"] { color: var(--ember); border-color: var(--ember); }
.sync[data-state="offline"] { color: #ffb3ad; border-color: var(--red); }
.sync[data-state="offline"]::before { color: var(--red-hot); }
.me {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  flex: none; padding: 6px 12px; font-weight: 600; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.view { max-width: 980px; margin: 0 auto; padding: 14px 16px; }
.section-title {
  font: 400 30px/1.1 var(--font-title); margin: 18px 0 10px; color: var(--text);
  display: flex; align-items: baseline; gap: 10px;
}
.section-title small { font: 600 14px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.stage-title {
  font-weight: 700; text-transform: uppercase; letter-spacing: .18em; font-size: 14px;
  color: var(--ember); margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--line);
}
.empty { color: var(--muted); text-align: center; padding: 40px 10px; font-size: 18px; }

/* ---------- filters ---------- */
.filters { position: sticky; top: 72px; z-index: 10; background: var(--bg); padding: 8px 0 10px; display: grid; gap: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 14px; min-height: 40px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red-hot); color: #fff; }
.filter-row { display: flex; gap: 8px; }
.search, .select {
  flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px;
}
.select { flex: 0 1 170px; }
.count { color: var(--muted); font-size: 14px; }

/* ---------- band card ---------- */
.grid { display: grid; gap: 10px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.band {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.band[data-level="2"] { border-color: var(--must); box-shadow: 0 0 0 1px var(--must), 0 6px 22px rgba(196, 22, 28, .25); }
.band[data-level="1"] { border-color: var(--maybe); }
.band-head { display: flex; gap: 12px; padding: 10px; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.band-pic {
  width: 64px; height: 64px; border-radius: 8px; flex: none; object-fit: cover;
  background: var(--bg-2); filter: grayscale(.35) contrast(1.1);
}
.band-pic.ph { display: grid; place-items: center; font: 400 30px var(--font-title); color: var(--red); }
.band-main { flex: 1; min-width: 0; }
.band-name {
  margin: 0; font-size: 22px; font-weight: 700; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.band-meta { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.band-expand {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  transition: transform .2s;
}
.band[open] .band-expand { transform: rotate(180deg); }

.band-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.lvl {
  flex: 1; border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 8px 6px; min-height: 44px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 14px;
}
.lvl[data-l="2"][aria-pressed="true"] { background: var(--must); border-color: var(--red-hot); color: #fff; }
.lvl[data-l="1"][aria-pressed="true"] { background: var(--maybe); border-color: #c89b4a; color: #fff; }
.lvl { font-size: 24px; line-height: 1; padding: 6px; }
.lvl[data-l="-1"][aria-pressed="true"] { background: #3a3532; border-color: #6d625a; }
.band[data-level="-1"] { opacity: .55; }
.band[data-level="-1"] .band-pic { filter: grayscale(1); }

.crew { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 10px; }
.crew-tag { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.crew-tag.l2 { border-color: var(--must); color: #ffb3ad; }
.crew-tag.l1 { border-color: var(--maybe); color: #e5c68a; }
.crew-tag.l-1 { color: var(--muted); border-style: dashed; }

.band-body { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 10px; background: rgba(0, 0, 0, .2); }
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.track { display: flex; align-items: center; gap: 8px; }
.track-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--red); background: transparent; color: var(--red-hot);
  font-size: 12px;
}
.track-play[aria-pressed="true"] { background: var(--red); color: #fff; }
.track-play:disabled { opacity: .3; cursor: default; }
.track-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-yt { flex: none; font-size: 13px; font-weight: 700; color: #ff6b62; background: none; border: 1px solid rgba(255, 78, 69, .4); border-radius: 999px; padding: 8px 10px; }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.link {
  flex: 1; text-align: center; text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: .06em;
  padding: 12px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
}
.link.spotify { color: #1ed760; }
.link.youtube { color: #ff4e45; }
.link.deezer { color: #b48cff; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- band info ---------- */
.info { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.info-origin { margin: 0; font-weight: 600; letter-spacing: .03em; }
.genres { display: flex; flex-wrap: wrap; gap: 5px; }
.genre { font-size: 13px; padding: 2px 8px; border-radius: 4px; background: rgba(232, 137, 43, .12); color: #f0b47a; border: 1px solid rgba(232, 137, 43, .35); }
.bio {
  margin: 0; font-size: 16px; line-height: 1.4; font-weight: 400; color: #ddd2c4;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.bio.open { -webkit-line-clamp: unset; display: block; }
.bio-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bio-more { background: none; border: 0; color: var(--red-hot); font-weight: 700; padding: 8px 0; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; }
.bio-src { color: var(--muted); font-size: 13px; text-decoration: none; padding: 8px 0; margin-left: auto; }
.info-links { display: flex; flex-wrap: wrap; gap: 6px; }
.info-link { font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.info-label { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: block; margin-bottom: 5px; }
.similar-btn { font-size: 14px; font-weight: 600; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--red); background: transparent; color: var(--text); min-height: 36px; }
.similar-others { margin: 0; }
.band.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--red-hot); } 100% { box-shadow: 0 0 0 0 transparent; } }
.filter-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.filter-selects .select { flex: none; padding: 9px 8px; font-size: 16px; }

/* ---------- crew ranking ---------- */
.rank { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.rank-pos { font: 400 28px var(--font-title); color: var(--red-hot); text-align: center; }
.rank-score { font-weight: 700; color: var(--ember); font-size: 20px; }
.members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login h1 { font: 400 48px/1 var(--font-title); margin: 0 0 6px; text-shadow: 0 0 24px rgba(255, 59, 47, .5), 3px 3px 0 var(--red); }
.login p { color: var(--muted); margin: 0 0 20px; }
.login form { display: grid; gap: 10px; text-align: left; }
.login label { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: grid; gap: 4px; }
.login input { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 18px; }
.btn {
  background: var(--red); border: 1px solid var(--red-hot); border-radius: var(--radius); padding: 12px; color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 18px;
}
.btn:disabled { opacity: .6; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.error { color: var(--red-hot); min-height: 1.3em; margin: 0; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(11, 9, 8, .95); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.tab {
  flex: 1; max-width: 160px; display: grid; justify-items: center; gap: 2px; text-decoration: none;
  padding: 6px 4px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
}
.tab-icon { font-size: 22px; line-height: 1; position: relative; }
.tab-badge {
  position: absolute; top: -6px; right: -14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red-hot); color: #fff; font: 700 12px/18px var(--font-body); letter-spacing: 0;
}
.tab[aria-current="page"] { color: var(--text); background: var(--card); box-shadow: inset 0 -2px 0 var(--red); }

/* ---------- player ---------- */
.player {
  position: fixed; left: 8px; right: 8px; z-index: 31;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 6px);
  max-width: 620px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: #201916; border: 1px solid var(--red); border-radius: 12px; padding: 8px 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.player[hidden] { display: none; }
.player-controls { display: flex; align-items: center; gap: 4px; }
.player-toggle, .player-close, .player-skip { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--red); color: #fff; flex: none; }
.player-skip { background: transparent; color: var(--text); width: 36px; }
.player-skip[hidden] { display: none; }
.player-skip:disabled { opacity: .3; }
.player-close { background: transparent; color: var(--muted); }
.player-info { min-width: 0; display: grid; }
.player-track { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-band { color: var(--muted); font-size: 14px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.player-bar span { display: block; height: 100%; width: 0; background: var(--red-hot); }

.toast {
  position: fixed; left: 50%; top: 84px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 40;
  background: var(--card-2); border: 1px solid var(--red); padding: 8px 16px; border-radius: 999px; transition: .25s; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .brand-title { font-size: 28px; }
  .brand-sub { font-size: 11px; letter-spacing: .14em; }
  .sync-label { display: none; }
  /* Too tall to stay pinned on a phone: let it scroll away with the list. */
  .filters { position: static; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- playlist ---------- */
.pl-options { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.pl-row { display: grid; gap: 6px; }
.pl-label { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.seg { display: flex; gap: 6px; }
.seg .chip { flex: 1; }
.pl-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0; }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px 6px 6px; width: 100%; text-align: left;
}
.pl-item img, .pl-item .ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.pl-item .ph { display: grid; place-items: center; font: 400 22px var(--font-title); color: var(--red); }
.pl-item-main { min-width: 0; display: grid; }
.pl-item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item-band { color: var(--muted); font-size: 14px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item[aria-current="true"] { border-color: var(--red-hot); background: linear-gradient(90deg, rgba(196, 22, 28, .25), var(--card)); }
.pl-item-lvl { font-size: 13px; color: var(--muted); }

/* ---------- chat ---------- */
.chat-list { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 6px; }
.chat-day { text-align: center; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin: 10px 0 2px; }
.msg {
  max-width: 82%; justify-self: start; display: grid; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 11px;
}
.msg.mine { justify-self: end; background: #3a1214; border-color: var(--red); border-radius: 14px 14px 4px 14px; }
.msg.pending { opacity: .65; border-style: dashed; }
.msg-who { font-size: 13px; font-weight: 700; color: var(--ember); }
.msg-body { font-weight: 400; overflow-wrap: anywhere; }
.msg-time { font-size: 12px; color: var(--muted); justify-self: end; }
.chat-checkin { justify-self: center; font-size: 14px; color: #f0b47a; background: rgba(232, 137, 43, .1); border: 1px solid rgba(232, 137, 43, .3); border-radius: 999px; padding: 4px 12px; text-align: center; }
.chat-dock {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); z-index: 15;
  background: linear-gradient(transparent, var(--bg) 18%); padding: 14px 0 8px; display: grid; gap: 8px;
}
body.has-player .chat-dock { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 76px); }
.chat-form { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.chat-input { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; min-width: 0; }
.chat-send { width: 48px; padding: 0; border-radius: 50%; font-size: 20px; letter-spacing: 0; }
.chat-quick .chip { text-transform: none; letter-spacing: 0; font-size: 15px; }

/* ---------- presence / map ---------- */
.presence { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.here-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.here-row .select { flex: none; }
.toggle { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--muted); }
.toggle input { width: 22px; height: 22px; accent-color: var(--red); flex: none; }
.push-btn { font-size: 14px; letter-spacing: .06em; }
.crew-map { height: 300px; margin: 10px 0; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); z-index: 0; }
.crew-map .leaflet-control-attribution { font-size: 10px; }
.pin {
  display: inline-block; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--card-2); color: var(--text); border: 2px solid var(--ember); border-radius: 999px;
  padding: 2px 8px; font: 700 13px var(--font-body); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.pin.is-me { border-color: var(--red-hot); background: var(--red); color: #fff; }
.pin.old { opacity: .55; border-style: dashed; }
.pos-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.pos { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pos-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline;
  background: none; border: 0; padding: 10px 12px; text-align: left; min-height: 44px;
}
.pos-row .pos-when { grid-column: 1 / -1; }
.pos.open { border-color: var(--ember); }
.timeline { list-style: none; margin: 0; padding: 4px 12px 10px 22px; display: grid; gap: 4px; border-top: 1px dashed var(--line); position: relative; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 8px; bottom: 12px; border-left: 2px dotted var(--line); }
.timeline li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; font-size: 15px; }
.timeline li.pending { opacity: .65; }
.tl-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-note { font-size: 12px; color: var(--ember); text-transform: uppercase; letter-spacing: .06em; }
.pos.is-me { border-color: var(--red); }
.pos-who { font-weight: 700; }
.pos-where { color: #f0b47a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-when { color: var(--muted); font-size: 14px; }
.member-panel { border-top: 1px dashed var(--line); display: grid; gap: 6px; padding-top: 10px; }
.member-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 12px; }
.member-actions .btn { text-decoration: none; text-align: center; font-size: 16px; }
.join-btn:disabled { background: #2d4a2d; border-color: #3fb950; opacity: 1; }
.tl-title { padding: 6px 12px 0; margin: 0; }
.member-panel .timeline { border-top: 0; }
/* Live action, deliberately unlike the red 🤘 Incontournable pick */
.go-btn { display: grid; gap: 1px; justify-items: center; width: 100%; padding: 9px; border-radius: 10px; border: 1px dashed #3fb950; background: rgba(63, 185, 80, .08); color: #8fe39b; font-weight: 700; font-size: 16px; }
.go-btn small { font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.go-btn.on { background: #1e3a23; border-style: solid; color: #c9f5cf; }
.crew-tag.going { border-color: #3fb950; color: #8fe39b; }
.pin .to { font-weight: 600; opacity: .85; }
.pos-going { grid-column: 1 / -1; color: #8fe39b; font-size: 14px; }

/* ---------- schedule / demo ---------- */
.band-time { font-size: 15px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.band-time.past { color: var(--muted); text-decoration: line-through; }
.band-time .fake { color: var(--muted); font-weight: 400; font-size: 13px; }
.live { font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 1px 7px; border-radius: 4px; }
.live.now { background: var(--red); color: #fff; animation: pulse 1.6s infinite; }
.live.soon { background: rgba(232, 137, 43, .2); color: #f0b47a; border: 1px solid var(--ember); }
@keyframes pulse { 50% { opacity: .55; } }
.demo-bar {
  position: sticky; top: 0; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 16px; background: repeating-linear-gradient(45deg, #3a2a05, #3a2a05 10px, #2a1f04 10px, #2a1f04 20px);
  border-bottom: 1px solid #c89b4a; font-size: 14px;
}
.demo-bar[hidden] { display: none; }
.demo-label { font-weight: 700; color: #ffd27a; letter-spacing: .06em; }
.demo-clock { font-weight: 700; margin-right: auto; font-variant-numeric: tabular-nums; }
.demo-btn { background: #1b1613; border: 1px solid #c89b4a; color: #ffd27a; border-radius: 6px; padding: 6px 9px; font-weight: 700; min-height: 36px; }
.alert-slot { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.alert {
  margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center;
  background: linear-gradient(90deg, rgba(196, 22, 28, .35), var(--card)); border: 1px solid var(--red-hot); border-radius: var(--radius); padding: 10px 12px;
}
.alert-text { font-weight: 600; }
.alert-text small { display: block; color: var(--muted); font-weight: 500; }
.alert .btn { font-size: 15px; padding: 10px 12px; }
.alert-close { grid-column: 2; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 4px; }
.pos-missing { grid-column: 1 / -1; color: #ffb3ad; font-size: 14px; }
.overlap { color: #ffb3ad; font-size: 14px; margin: 0 0 6px; }
.install-ios { margin: 0; font-size: 15px; color: var(--muted); }
.install-ios strong { color: var(--text); }

/* ---------- PC view (≥ 1024 px): sidebar navigation, wider content ---------- */
@media (min-width: 1024px) {
  :root { --side-w: 210px; }
  body { padding-bottom: 96px; }
  body.logged .view, body.logged .alert-slot, body.logged .demo-bar { margin-left: var(--side-w); }
  .view { max-width: 1320px; padding: 20px 32px; }
  .alert-slot { max-width: 1320px; padding: 0 32px; }
  .tabs {
    top: 73px; bottom: 0; right: auto; width: var(--side-w);
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tab {
    max-width: none; flex: none; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; font-size: 16px; letter-spacing: .1em;
  }
  .tab[aria-current="page"] { box-shadow: inset 3px 0 0 var(--red); }
  .tab-badge { right: -12px; }
  .filters { position: sticky; top: 73px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
  .section-title { font-size: 36px; }

  /* crew: two columns, map follows the scroll */
  .crew-layout { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .crew-mapcol { position: sticky; top: 90px; }
  .crew-mapcol .crew-map { height: calc(100vh - 140px); min-height: 420px; margin: 0; }
  .crew-side .pos-list { margin-top: 10px; }
  .rank { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

  /* chat: centred column, composer at the bottom of the window */
  .chat-list, .chat-dock { max-width: 820px; margin-left: auto; margin-right: auto; }
  .chat-dock { bottom: 0; }
  body.has-player .chat-dock { bottom: 84px; }
  .msg { max-width: 70%; }

  /* playlist: options beside the list */
  .pl-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

  .player { left: calc(var(--side-w) + 24px); right: 24px; bottom: 16px; }
  .toast { top: 90px; }
}

/* ---------- chat media ---------- */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chat-seg { max-width: 320px; flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; padding: 0; }
.emoji-bar .emoji { font-size: 24px; background: none; border: 0; padding: 4px 6px; min-width: 40px; min-height: 40px; }
.msg-body a { color: #ffb3ad; overflow-wrap: anywhere; }
.msg-body.big { font-size: 40px; line-height: 1.1; }
.msg.has-photo { padding: 4px 4px 6px; }
.msg-photo, .msg-gif { display: block; border: 0; padding: 0; background: none; border-radius: 10px; overflow: hidden; max-width: 100%; }
.msg-photo img, .msg-gif img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 10px; object-fit: cover; }
.msg-photo.ph { width: 200px; height: 140px; display: grid; place-items: center; background: var(--bg-2); font-size: 30px; }
.msg.has-photo .msg-who, .msg.has-photo .msg-body, .msg.has-photo .msg-time { padding: 0 6px; }
.yt { position: relative; display: block; margin: 6px 0 2px; max-width: 320px; border-radius: 10px; overflow: hidden; }
.yt img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 56px; height: 40px; border-radius: 10px; background: rgba(255, 0, 0, .9); color: #fff; display: grid; place-items: center; font-size: 18px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
.album-item { position: relative; border: 0; padding: 0; background: var(--bg-2); aspect-ratio: 1; overflow: hidden; border-radius: 6px; }
.album-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-who { position: absolute; left: 4px; bottom: 4px; font-size: 12px; font-weight: 700; background: rgba(0, 0, 0, .6); padding: 1px 6px; border-radius: 999px; }
.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; }
.viewer::backdrop { background: rgba(0, 0, 0, .92); }
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.viewer-img { width: 100%; height: 100%; object-fit: contain; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(11, 9, 8, .9); }
.viewer-who { margin-right: auto; color: var(--muted); font-weight: 600; }
.viewer-bar .btn { font-size: 15px; padding: 10px 14px; text-decoration: none; letter-spacing: .04em; }
@media (min-width: 1024px) { .album { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } .chat-head { max-width: 820px; margin: 0 auto; } }
.emoji-bar[hidden] { display: none; }

/* ---------- GIF search ---------- */
.gif-btn { font: 800 13px var(--font-body); letter-spacing: .04em; color: var(--ember); }
.gif-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.gif-panel[hidden] { display: none; }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 4px; }
.gif-item { border: 0; padding: 0; background: var(--bg-2); border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 10; }
.gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-status { margin: 0; }
.gif-status:empty { display: none; }
.giphy-credit { margin: 0; font-size: 11px; color: var(--muted); text-align: right; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 380px) { .chat-form .icon-btn { width: 38px; height: 38px; } }

/* ---------- meeting point / quick actions ---------- */
.meeting { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.meeting-now { display: grid; gap: 2px; }
.meeting-now small { color: var(--muted); }
.meeting .btn { font-size: 15px; text-decoration: none; text-align: center; }
.pin.meeting-pin { border-color: #3fb950; background: #183a1f; color: #c9f5cf; }
.chip.action { border-color: var(--red); color: #ffb3ad; }
.checkin-link { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.checkin-map { opacity: .8; }

/* ---------- in-app YouTube player ---------- */
.yt {
  position: fixed; z-index: 32; right: 8px; left: 8px;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 6px);
  max-width: 420px; margin-left: auto;
  background: #120e0c; border: 1px solid var(--red); border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .7);
}
.yt[hidden] { display: none; }
.yt.big { max-width: 960px; left: 8px; margin: 0 auto; }
.yt-frame { aspect-ratio: 16 / 9; background: #000; display: grid; place-items: center; }
.yt-frame iframe, .yt-frame > div { width: 100%; height: 100%; display: block; }
.yt-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.yt-info { flex: 1; min-width: 0; display: grid; }
.yt-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-band { color: var(--muted); font-size: 13px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt .player-skip:disabled { opacity: .3; }
body.has-video .player { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 6px); opacity: .0; pointer-events: none; }
@media (min-width: 1024px) {
  .yt { bottom: 16px; right: 24px; left: auto; width: 420px; }
  .yt.big { width: auto; left: calc(var(--side-w) + 24px); right: 24px; max-width: 1100px; }
}
.yt-band-btn { font-size: 15px; color: #ff6b62; border-color: rgba(255, 78, 69, .5); }
.filter-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.clear-filters { background: none; border: 1px solid var(--red); color: #ffb3ad; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.clear-filters[hidden] { display: none; }
.past-slot { font-size: 14px; color: var(--muted); }
.past-slot:empty { display: none; }
.past-slot.center { text-align: center; }
.past-toggle { background: none; border: 0; color: #ffb3ad; font-weight: 700; text-decoration: underline; padding: 6px 0; font-size: 14px; }
