/* ═══════════════════════════════════════════
   PARTICIPANT VIEW — Mobile-First Interface
   Light Mode — Clean & Readable
═══════════════════════════════════════════ */

#screen-participant {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ── Participant Header ── */
.part-header {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-default);
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  box-shadow: var(--shadow-sm);
}

.part-header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.part-header-logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Presenter's custom logo in participant header */
.part-header-pres-logo {
  max-height: 32px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.part-user-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.part-user-email {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-3);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-default);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main Content ── */
.part-content {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: var(--sp-6) var(--sp-5) var(--sp-10);
}

/* ── Waiting State ── */
.part-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: var(--sp-4);
}

/* ── Lobby Screen (before presenter starts) ── */
.part-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-4) 0 var(--sp-8);
  text-align: center;
}

.part-lobby-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(99,102,241,0.3);
}

.part-lobby-logo img {
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
}

.part-lobby-greeting {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.part-lobby-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.part-lobby-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  animation: pulse 1.8s ease-in-out infinite;
}

/* Session code card */
.part-lobby-code-card {
  background: var(--surface-1);
  border: 2px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-7);
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-md);
}

.part-lobby-code-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.part-lobby-code {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--accent-primary);
  line-height: 1;
}

/* Instructions */
.part-lobby-instructions {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  width: 100%;
  max-width: 360px;
}

.part-lobby-instructions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.part-lobby-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.part-lobby-steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-num {
  min-width: 22px;
  height: 22px;
  background: var(--accent-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.part-lobby-pulse {
  display: flex;
  gap: 6px;
  margin-top: var(--sp-2);
}

.waiting-animation {
  width: 88px;
  height: 88px;
  position: relative;
  margin-bottom: var(--sp-3);
}

.waiting-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.5,0,0.5,1) infinite;
}
.waiting-ring:nth-child(2) {
  inset: 10px;
  border-top-color: var(--accent-secondary);
  animation-delay: -0.4s;
}
.waiting-ring:nth-child(3) {
  inset: 20px;
  border-top-color: var(--border-accent);
  animation-delay: -0.8s;
}

.waiting-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waiting-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.waiting-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.6;
}

.waiting-pulse-dots {
  display: flex;
  gap: 6px;
}
.waiting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: waitDot 1.4s ease-in-out infinite;
}
.waiting-dot:nth-child(2) { animation-delay: 0.2s; }
.waiting-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes waitDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Slide Info Bar ── */
.part-slide-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.part-slide-num {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.part-poll-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-full);
  letter-spacing: 0.03em;
}
.part-poll-status-badge.open    { background: rgba(5,150,105,0.1);  color: var(--text-success); border: 1px solid rgba(5,150,105,0.2); }
.part-poll-status-badge.closed  { background: rgba(220,38,38,0.08); color: var(--text-danger);  border: 1px solid rgba(220,38,38,0.15); }
.part-poll-status-badge.pending { background: var(--surface-4);     color: var(--text-muted);   border: 1px solid var(--border-default); }

.status-badge-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.open    .status-badge-dot { background: var(--accent-success); animation: pulse 2s infinite; }
.closed  .status-badge-dot { background: var(--accent-danger); }
.pending .status-badge-dot { background: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ── Question ── */
.part-question {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: var(--sp-6);
  color: var(--text-primary);
}

/* ── Options Grid ── */
.part-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.part-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  background: var(--surface-1);
  border: 2px solid var(--border-default);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-fast);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}

.part-option:hover:not(.disabled):not(.voted) {
  border-color: var(--accent-primary);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.part-option.selected {
  border-color: var(--accent-primary);
  background: rgba(79,70,229,0.06);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-accent);
}

.part-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.part-option.voted {
  cursor: default;
}

/* Progress fill behind option (results mode) */
.part-option-progress {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(79,70,229,0.07);
  border-radius: var(--r-lg);
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}

/* Check circle */
.part-option-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
  font-size: 11px;
  background: var(--surface-1);
  color: #fff;
}
.part-option.multi .part-option-check { border-radius: var(--r-sm); }
.part-option.selected .part-option-check {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* Color dot */
.part-option-color {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}

/* Option text — must be dark and readable */
.part-option-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
  line-height: 1.35;
}

.part-option-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
  z-index: 1;
}

.part-option-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-accent);
  font-family: var(--font-mono);
}

.part-option-votes {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Multi-select hint ── */
.part-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--sp-3);
}
.part-hint strong { color: var(--text-secondary); }

/* ── Submit Button ── */
.part-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 16px;
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-4);
}

/* ── Inline Feedback Banner ── */
.part-feedback {
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 14px;
  font-weight: 600;
  animation: slideUp 0.35s var(--t-spring);
  margin-bottom: var(--sp-4);
}

.part-feedback.success {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.part-feedback.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.part-feedback-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
}

/* ── Results Mini Chart ── */
.part-results-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  margin-top: var(--sp-4);
}

/* ── Timer Bar (Participant) ── */
.part-timer-bar {
  height: 4px;
  background: var(--surface-4);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

.part-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--r-full);
  transition: width 1s linear;
}

/* ── Connection Banner ── */
.part-connection-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 13px;
  color: #92400e;
  margin-bottom: var(--sp-4);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .part-content  { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .part-question { font-size: 20px; }
  .part-option   { padding: var(--sp-3) var(--sp-4); }
  .part-user-email { max-width: 120px; }
}

/* ═══════════════════════════════════════════
   TEXT SLIDE
═══════════════════════════════════════════ */
.part-text-slide {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: var(--sp-6) 0;
}

.part-text-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.part-text-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
}

/* ═══════════════════════════════════════════
   QR SLIDE (participant view)
═══════════════════════════════════════════ */
.part-qr-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 0 var(--sp-8);
  text-align: center;
}

.part-qr-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.part-qr-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.5;
}

.part-qr-box {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.part-qr-code-label {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent-primary);
  background: var(--surface-1);
  border: 2px solid var(--border-accent);
  border-radius: var(--r-lg);
  padding: 10px 20px;
  margin-top: var(--sp-2);
}

/* ═══════════════════════════════════════════
   STAR RATING SLIDE (participant)
═══════════════════════════════════════════ */
.part-star-rating {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin: var(--sp-5) 0;
}

.part-star-btn {
  background: none;
  border: none;
  font-size: clamp(36px, 10vw, 52px);
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.15s, transform 0.15s;
  padding: 0 4px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.part-star-btn:not(:disabled):hover,
.part-star-btn.active {
  color: #f59e0b;
  transform: scale(1.15);
}

.part-star-btn:active { transform: scale(0.95); }
.part-star-btn:disabled { cursor: default; }
.part-star-rating.voted .part-star-btn { cursor: default; }

.part-rating-results {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-top: var(--sp-5);
}

.part-rating-avg-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  text-align: center;
}

.part-rating-dist {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.part-rating-dist-row {
  display: grid;
  grid-template-columns: 32px 1fr 36px;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--text-muted);
}
/* ═══════════════════════════════════════════
   SUBTITLE — Participant & Presentation
═══════════════════════════════════════════ */

/* Participant slide subtitle */
.part-slide-subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: -12px;
  margin-bottom: var(--sp-5);
  padding: 10px 14px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* Rating results toggle button */
.part-results-toggle {
  width: 100%;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  transition: all var(--t-fast);
}
.part-results-toggle:hover {
  background: var(--surface-2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Mini bar track (rating distribution) */
.mini-bar-track {
  height: 8px;
  background: var(--surface-4);
  border-radius: 99px;
  overflow: hidden;
  flex: 1;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* Presentation subtitle */
.pres-subtitle {
  font-size: clamp(14px, 2vw, 20px);
  opacity: 0.75;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  margin-top: -8px;
  margin-bottom: 16px;
}

/* Canvas editor subtitle */
.canvas-subtitle {
  font-size: 11px;
  opacity: 0.65;
  line-height: 1.4;
  margin-top: -6px;
  margin-bottom: 8px;
  padding: 4px 6px;
  border-left: 2px solid rgba(255,255,255,0.3);
}
