:root {
  --bg: #0b0b0d;
  --panel: #15151a;
  --panel-2: #1d1d24;
  --line: #2a2a33;
  --text: #f2f2f4;
  --muted: #9a9aa6;
  --accent: #e5202a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(229, 32, 42, 0.18);
  --danger: #ff3b3b;
  --radius: 12px;
  --display: "Pirata One", "Impact", "Arial Black", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-accent="green"] {
  --accent: #39ff14;
  --accent-ink: #0b0b0d;
  --accent-soft: rgba(57, 255, 20, 0.16);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; overflow-x: hidden; color: var(--text); background: var(--bg);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-box { text-align: center; width: min(360px, 100%); min-width: 0; }
.gate form { display: grid; gap: 12px; margin-top: 24px; min-width: 0; }
.gate input {
  width: 100%; min-width: 0;   /* a wide-spaced input must not grow past a phone screen */
  font-size: 28px; letter-spacing: 0.4em; text-align: center; padding: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
}
.gate input:focus { outline: 2px solid var(--accent); }
.error { color: var(--danger); }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- poster header ---------- */
.poster {
  position: relative; padding: 20px 16px 10px; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.poster::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: screen;
}
.poster > * { position: relative; }
.poster-top { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: var(--display); font-weight: 400; margin: 0;
  font-size: 56px; line-height: 1; letter-spacing: 0.02em; color: var(--accent);
  text-shadow: 0 0 24px var(--accent-soft);
}
.gate .logo { font-size: 72px; }
.tagline {
  margin: 4px 0 0; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted);
}
.chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text);
}
#accent-toggle { color: var(--accent); font-size: 16px; }

/* ---------- week strip ---------- */
.week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px;
}
.day {
  min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 4px; text-align: center; min-height: 64px;
}
.day .wd { font-size: 10px; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.day .dn { font-family: var(--display); font-size: 24px; line-height: 1.1; }
.day .ct { font-size: 11px; color: var(--muted); margin-top: 2px; }
.day.today { border-color: var(--accent); background: var(--accent-soft); }
.day.today .wd { color: var(--accent); }
.day.heavy .ct { color: var(--accent); font-weight: 600; }

/* ---------- sections and cards ---------- */
main { padding-bottom: 40px; }
.show { padding: 18px 16px 4px; }
.show h2 {
  font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0 0 10px;
  letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 10px;
}
.show h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.show h2 .toggle {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer;
}
.show.collapsed .cards { display: none; }
.count { font-family: var(--body); font-size: 13px; color: var(--muted); }
.cards { display: grid; gap: 10px; min-width: 0; }
.empty { color: var(--muted); margin: 4px 0 12px; }

.card {
  position: relative; min-width: 0; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--course); border-radius: var(--radius); padding: 12px 14px;
}
.card.done { opacity: 0.7; }
.card .course {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--course); font-weight: 600;
}
.card .kind { color: var(--muted); font-weight: 400; letter-spacing: 0.1em; }
.card .title { font-size: 17px; font-weight: 600; margin: 4px 0 2px; padding-right: 86px; }
.card .when { font-size: 13px; color: var(--muted); }
.card .when b { color: var(--text); font-weight: 600; }
.card .when.urgent b { color: var(--accent); }
.card .when .meta { color: var(--muted); font-weight: 400; }
.card .source { margin-top: 6px; font-size: 13px; color: var(--muted); font-style: italic; }
.dates { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.dates li { margin: 2px 0; }
.dates b { color: var(--text); font-weight: 600; }
.stamp {
  position: absolute; top: 10px; right: 10px; transform: rotate(-8deg);
  font-family: var(--display); font-size: 18px; letter-spacing: 0.08em; line-height: 1;
  padding: 4px 8px; border: 2px solid currentColor; border-radius: 6px; opacity: 0.9;
}
.stamp.sold { color: var(--accent); }
.stamp.noshow { color: var(--danger); }
.stamp.late { color: var(--danger); }
.stamp.excused { color: var(--muted); }
.stamp.encore { color: var(--accent); }
.behind { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; font-size: 14px; }
.behind li { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--course); border-radius: 10px; padding: 8px 12px; }
.behind .meta { color: var(--muted); font-size: 12.5px; }

.note { margin-top: 8px; font-size: 14.5px; color: #d7d7de; max-height: 7.5em; overflow: hidden; position: relative; }
.note.open { max-height: none; }
.note:not(.open).long::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5em;
  background: linear-gradient(transparent, var(--panel));
}
.more { background: none; border: 0; color: var(--accent); padding: 4px 0; cursor: pointer; font-size: 13px; }
.links { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.links li { margin: 2px 0; }
.links .meta { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }

.prose a { word-break: break-word; }
.prose ul { padding-left: 20px; margin: 6px 0; }
.prose p { margin: 6px 0; }
.prose h3 { font-size: 15px; margin: 12px 0 4px; color: var(--accent); }

.foot {
  display: flex; justify-content: space-between; padding: 24px 16px; color: var(--muted); font-size: 12px;
}
.foot a { color: var(--muted); }

/* ---------- sheets (Tab + Roadie) ---------- */
.sheet {
  position: fixed; inset: 0; background: var(--bg); z-index: 20;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 720px) {
  .sheet { inset: 24px auto 24px 50%; transform: translateX(-50%); width: 680px; max-height: calc(100vh - 48px);
    border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
  main, .gate { max-width: 720px; margin: 0 auto; }
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.head-actions { display: flex; gap: 8px; align-items: center; }
.eyebrow { font-family: var(--display); color: var(--accent); font-size: 22px; line-height: 1; }
.sheet-title { font-size: 14px; color: var(--muted); margin-top: 2px; }
.close { background: none; border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; }
.sheet-body { overflow: auto; padding: 16px; }

.messages { flex: 1; overflow: auto; padding: 16px; display: grid; gap: 10px; align-content: start; }
.msg { max-width: 88%; overflow-wrap: anywhere; padding: 10px 13px; border-radius: 14px; font-size: 15px; white-space: pre-wrap; }
.msg.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.roadie { justify-self: start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.roadie b { color: var(--accent); }
.msg.typing { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; resize: none; font: inherit; padding: 10px 12px; max-height: 120px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
}
.composer textarea:focus { outline: 2px solid var(--accent); }
.fineprint { margin: 0; padding: 6px 16px 12px; font-size: 11.5px; color: var(--muted); }
