/* Extends root style.css. Presenter view keeps the full CRT chrome; audience
   view opts out of scanlines/vignette/numbers-layer for a lighter mobile page. */

body.audience-view::before,
body.audience-view::after {
  display: none;
}

/* ---------- shared layout ---------- */

.page-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 2rem;
}

.page-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 15px rgba(0,255,204,0.6);
  background: rgba(5, 5, 10, 0.7);
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.5rem;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title-row .page-title {
  flex: 1;
  margin-bottom: 0;
}

.btn-reset-room {
  flex-shrink: 0;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-reset-room::before { content: '!! '; }

.btn-reset-room:hover {
  background: var(--accent2);
  color: #0a0a0f;
  box-shadow: 0 0 18px rgba(255,0,170,0.5);
}

/* ---------- generic topic / special buttons ---------- */

.topic-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  background: rgba(10, 10, 20, 0.92);
  color: var(--fg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.topic-btn::before {
  content: '> ';
  opacity: 0.6;
  color: var(--accent);
}

.topic-btn:hover:not(.disabled) {
  border-color: var(--accent);
  background: rgba(0,255,204,0.08);
  box-shadow: 0 0 14px rgba(0,255,204,0.2);
  color: #fff;
}

.topic-btn.selected {
  border-color: var(--accent);
  background: rgba(0,255,204,0.15);
  color: #fff;
  box-shadow: 0 0 18px rgba(0,255,204,0.35);
}

.topic-btn.disabled {
  opacity: 0.35;
  text-decoration: line-through;
}

/* Audience can't tap disabled topics, but the presenter must still be able
   to click them to re-enable -- so pointer-events:none is scoped here only. */
.audience-view .topic-btn.disabled {
  pointer-events: none;
}

.special-btn {
  border-color: var(--accent2);
}

.special-btn::before {
  content: '? ';
  color: var(--accent2);
}

.special-btn:hover:not(.disabled) {
  border-color: var(--accent2);
  background: rgba(255,0,170,0.08);
  box-shadow: 0 0 14px rgba(255,0,170,0.25);
}

.special-btn.selected {
  border-color: var(--accent2);
  background: rgba(255,0,170,0.18);
  box-shadow: 0 0 18px rgba(255,0,170,0.4);
}

/* ---------- presenter: layout grid ---------- */

.presenter-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

.panel {
  border: 1px solid rgba(0, 191, 255, 0.35);
  background: rgba(6, 6, 13, 0.95);
  padding: 1.2rem 1.3rem;
  box-shadow: 0 0 30px rgba(0,191,255,0.08);
}

.panel-title {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent3);
  opacity: 1;
  margin-bottom: 0.9rem;
}

/* join / qr panel */

#qr-code img {
  width: 100%;
  max-width: 220px;
  display: block;
  margin: 0 auto 0.8rem;
  background: #fff;
  padding: 8px;
}

.join-url {
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--accent);
  text-align: center;
  user-select: all;
}

/* roster */

.roster-list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.roster-name {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--fg);
  border-bottom: 1px solid rgba(26,42,58,0.6);
}

.roster-name::before {
  content: '\25CF ';
  color: var(--accent);
}

.roster-name.disconnected {
  color: #5a6478;
  opacity: 0.6;
}

.roster-name.disconnected::before {
  color: #5a6478;
}

/* vote tally + end-vote controls */

.vote-tally-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.7rem;
  color: var(--accent3);
  margin-top: 0.2rem;
  opacity: 0.85;
}

.vote-tally-row .voters {
  text-align: right;
  flex: 1;
}

.end-vote-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.btn-end-vote {
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  background: transparent;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-end-vote::before { content: '>> '; }

.btn-end-vote:hover:not(:disabled) {
  background: rgba(255,0,170,0.12);
  box-shadow: 0 0 18px rgba(255,0,170,0.4);
  color: #fff;
}

.btn-end-vote:disabled {
  opacity: 0.35;
  cursor: default;
}

.countdown {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  color: var(--accent2);
  text-shadow: 0 0 10px rgba(255,0,170,0.5);
}

.current-topic-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(8, 8, 16, 0.95);
  border: 1px solid var(--accent);
  box-shadow: 0 0 30px rgba(0,255,204,0.18);
  padding: 1rem 1.6rem;
  margin-bottom: 1.5rem;
}

.current-topic-banner-label {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #fff;
}

.current-topic-banner-timer {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0,255,204,0.6);
  white-space: nowrap;
}

/* ---------- wheel ---------- */

.wheel-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5,5,10,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.wheel-overlay.hidden {
  display: none;
}

.wheel-pointer {
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--accent2);
  margin-bottom: -6px;
  filter: drop-shadow(0 0 8px rgba(255,0,170,0.6));
  z-index: 2;
}

.wheel-frame {
  position: relative;
  width: min(70vmin, 560px);
  height: min(70vmin, 560px);
  border-radius: 50%;
  border: 3px solid var(--border);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,255,204,0.15);
}

#wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotate(0deg);
}

.wheel-slice {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

.wheel-label-layer {
  position: absolute;
  inset: 0;
}

.wheel-label-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transform-origin: 50% 50%;
}

.wheel-slice-label {
  margin-top: 12%;
  width: 34%;
  font-size: 0.7rem;
  line-height: 1.3;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 4px #000, 0 0 4px #000, 0 0 8px rgba(0,0,0,0.9);
  transform: rotate(-90deg);
}

.wheel-result {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 14px var(--accent);
  max-width: 80vw;
}

/* ---------- audience view ---------- */

.audience-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.2rem 4rem;
}

.audience-wrap .page-title {
  text-align: center;
}

.name-form {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.name-input {
  padding: 0.8rem 1rem;
  background: rgba(13,13,26,0.8);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
}

.name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,255,204,0.3);
}

.btn-join {
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-join:hover {
  background: rgba(0,255,204,0.12);
  color: #fff;
  box-shadow: 0 0 16px rgba(0,255,204,0.35);
}

.your-vote {
  width: min(420px, 100%);
  margin-bottom: 1.2rem;
  padding: 0.7rem 1rem;
  border-left: 2px solid var(--accent);
  background: rgba(0,255,204,0.05);
  font-size: 0.85rem;
  color: var(--fg);
}

.topic-list {
  width: min(420px, 100%);
}

.connection-status {
  position: fixed;
  top: 0.6rem;
  right: 0.8rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #5a6478;
  z-index: 600;
}

.connection-status.connected { color: var(--accent); }
.connection-status.disconnected { color: var(--accent2); }
