:root {
  --bg: #0e1420;
  --bg-card: #1a2332;
  --text: #f2f0e9;
  --muted: #9aa5b5;
  --accent: #e8b44f;
  --accent-soft: rgba(232, 180, 79, 0.18);
  --green: #5fc88f;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

/* ============ TV SCREEN ============ */

body.tv {
  height: 100vh;
  overflow: hidden;
}

body.tv #main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 2.2vh 3.5vw;
}

.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 1.2vh;
}

.series {
  font-size: 1.6vw;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.week { font-size: 1.3vw; color: var(--muted); margin-top: 0.4vh; }
.slide-count { font-size: 1.3vw; color: var(--muted); font-variant-numeric: tabular-nums; }

.tv-slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2vh 2vw;
  overflow: hidden;
}

.day-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.5vh 1.2vw;
  font-size: 1.1vw;
  margin-bottom: 2vh;
}

.tv-slide h1 { font-size: 3.4vw; line-height: 1.15; margin-bottom: 2.5vh; }
.tv-slide .body-text p { font-size: 1.75vw; line-height: 1.55; color: #dfe3ea; margin-bottom: 2vh; max-width: 75vw; }

.scripture-ref { font-size: 2.2vw; color: var(--accent); margin-bottom: 2.5vh; }
.scripture p {
  font-family: var(--serif);
  font-size: 2vw;
  line-height: 1.6;
  margin-bottom: 1.8vh;
  max-width: 78vw;
  color: #ece9df;
}

.prayer p {
  font-family: var(--serif);
  font-size: 2.3vw;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 2.2vh;
  max-width: 72vw;
}

/* welcome slide */
.welcome { text-align: center; align-items: center; }
.welcome h1 { font-size: 4.2vw; margin-bottom: 1vh; }
.welcome h2 { font-size: 2.2vw; color: var(--accent); font-weight: 600; margin-bottom: 0.8vh; }
.welcome .passage { font-size: 1.6vw; color: var(--muted); margin-bottom: 3.5vh; }
.qr-block img {
  width: 26vh; height: 26vh;
  border-radius: 12px;
  background: white;
  padding: 0.8vh;
}
.qr-block p { font-size: 1.6vw; margin-top: 1.5vh; }
.join-url { color: var(--accent); font-size: 1.3vw !important; }

/* poll slide */
.prompt { max-width: 80vw; }
.hint { color: var(--muted); font-size: 1.4vw; margin-bottom: 3vh; }

.poll-results { display: flex; flex-direction: column; gap: 2.2vh; max-width: 72vw; }
.poll-label { font-size: 1.7vw; margin-bottom: 0.7vh; }
.poll-bar-track {
  position: relative;
  background: var(--bg-card);
  border-radius: 10px;
  height: 4.5vh;
  overflow: hidden;
}
.poll-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f0cc7e);
  border-radius: 10px;
  transition: width 0.6s ease;
  min-width: 4px;
}
.poll-count {
  position: absolute;
  right: 1vw; top: 50%;
  transform: translateY(-50%);
  font-size: 1.6vw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.vote-total { margin-top: 3vh; color: var(--muted); font-size: 1.3vw; }

/* open responses */
.responses {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4vh 1vw;
  align-content: flex-start;
  overflow: hidden;
  max-height: 48vh;
}
.response-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.4vh 1.3vw;
  font-size: 1.6vw;
  max-width: 38vw;
  animation: pop-in 0.35s ease;
}
.resp-name {
  display: block;
  font-size: 1vw;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5vh;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.waiting { color: var(--muted); font-size: 1.4vw; font-style: italic; }

/* discussion slide */
.tv-slide .discuss-cue {
  display: inline-block;
  align-self: flex-start;
  margin-top: 3vh;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1.2vh 1.8vw;
  font-size: 1.5vw;
}
.p-slide .discuss-cue {
  display: inline-block;
  margin-top: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 17px;
  line-height: 1.5;
}

/* footer: participants + presence */
.tv-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.4vh;
  min-height: 7vh;
}
.participants { display: flex; flex-wrap: wrap; gap: 0.8vh 0.6vw; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5vw;
  background: var(--bg-card);
  border-radius: 999px;
  padding: 0.6vh 1.1vw 0.6vh 0.5vw;
  font-size: 1.15vw;
  transition: opacity 0.3s;
}
.chip .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2vh; height: 3.2vh;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1408;
  font-weight: 700;
  font-size: 1.6vh;
}
.chip.online { box-shadow: 0 0 0 1px rgba(95, 200, 143, 0.55); }
.chip.online .avatar { background: var(--green); color: #06281a; }
.chip.offline { opacity: 0.38; }
.online-count { color: var(--green); font-size: 1.2vw; white-space: nowrap; }
.footer-right { display: flex; align-items: center; gap: 1vw; }
.mini-qr { width: 6.5vh; height: 6.5vh; border-radius: 6px; background: white; padding: 0.4vh; }

/* ============ MOBILE ============ */

body.mobile {
  min-height: 100vh;
  background: var(--bg);
  font-size: 19px;
}

body.mobile #main, .join-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

.join-card { padding-top: 12vh; text-align: center; }
.join-card .series { font-size: 13px; margin-bottom: 18px; }
.join-card h1 { font-size: 32px; margin-bottom: 8px; }
.join-card .sub { color: var(--muted); margin-bottom: 30px; }
.join-card label { display: block; text-align: left; margin-bottom: 8px; color: var(--muted); }
.join-card input {
  width: 100%;
  font-size: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--bg-card);
  color: var(--text);
  margin-bottom: 16px;
}
.join-card button, .respond-form button {
  width: 100%;
  font-size: 20px;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #1a1408;
  cursor: pointer;
}
.error { color: #ff8e8e; margin-bottom: 14px; }

.p-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}
.p-name { font-weight: 700; color: var(--accent); text-decoration: none; }
a.p-name:active { opacity: 0.7; }
.p-progress { color: var(--muted); font-variant-numeric: tabular-nums; }

.p-slide .day-badge { font-size: 14px; padding: 5px 14px; margin-bottom: 14px; }
.p-slide h1 { font-size: 30px; line-height: 1.25; margin-bottom: 16px; }
.p-slide .body-text p { font-size: 20px; line-height: 1.6; color: #dfe3ea; margin-bottom: 16px; }
.p-slide .scripture-ref { font-size: 22px; color: var(--accent); margin-bottom: 14px; }
.p-slide .scripture p { font-family: var(--serif); font-size: 21px; line-height: 1.65; margin-bottom: 14px; }
.p-slide .prayer p { font-family: var(--serif); font-size: 21px; font-style: italic; line-height: 1.65; margin-bottom: 16px; }
.p-slide .hint { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.p-welcome { text-align: center; padding-top: 10vh; }
.p-welcome h1 { margin-bottom: 14px; }
.p-welcome p { color: var(--muted); line-height: 1.6; }

.vote-options { display: flex; flex-direction: column; gap: 10px; }
.vote-btn {
  width: 100%;
  text-align: left;
  font-size: 19px;
  padding: 17px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.vote-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
  font-weight: 700;
}
.voted-note { color: var(--green); font-size: 16px; margin-top: 14px; }

.respond-form textarea {
  width: 100%;
  font-size: 19px;
  font-family: var(--sans);
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--bg-card);
  color: var(--text);
  margin-bottom: 12px;
  resize: vertical;
}

/* ============ HOST ============ */

.host-nav { display: flex; gap: 10px; margin-bottom: 18px; }
.nav-btn {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.nav-btn.primary { background: var(--accent); color: #1a1408; border: none; }

.host-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.host-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 14px;
}
.host-row.current { box-shadow: 0 0 0 2px var(--accent); }
.host-kind {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}
.host-kind.kind-poll, .host-kind.kind-open { background: var(--accent-soft); color: var(--accent); }
.host-title { line-height: 1.35; }
