body.room-theme {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: #0f172a;
}

.room-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.room-hero,
.room-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.room-hero {
  padding: 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
}

.room-eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.room-title {
  margin: 10px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.room-subtitle {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.room-entry-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.room-entry-tile {
  border: 2px solid #dbeafe;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 22px 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.room-entry-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.room-entry-tile.is-active {
  transform: translateY(-1px);
}

.room-entry-tile-host {
  border-color: #3b82f6;
}

.room-entry-tile-join {
  border-color: #16a34a;
}

.room-entry-tile-host.is-active {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.18);
}

.room-entry-tile-join.is-active {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 16px 34px rgba(34, 197, 94, 0.18);
}

.room-entry-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.room-entry-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #0f172a;
}

.room-entry-desc {
  color: #475569;
  line-height: 1.6;
}

.room-entry-panel {
  display: none;
}

.room-entry-panel.active {
  display: block;
}

.room-grid-wide {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.room-card {
  padding: 20px;
}

.room-card h2,
.room-card h3 {
  margin-top: 0;
}

.room-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.room-chip {
  background: #e2e8f0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.room-actions button,
.room-btn,
.room-form button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.room-actions button:hover,
.room-btn:hover,
.room-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.room-btn-primary,
.room-form button {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
}

.room-btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: white; }
.room-btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.room-btn-secondary { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: white; }
.room-btn-muted { background: #e2e8f0; color: #0f172a; }

.room-form label {
  display: block;
  font-weight: 700;
  margin: 12px 0 6px;
}

.room-form input,
.room-form textarea,
.room-form button,
.room-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
}

.room-form textarea {
  min-height: 200px;
  resize: vertical;
}

.room-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.room-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  margin-top: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  min-height: 210px;
}

.room-qr-wrap img {
  width: 180px;
  height: 180px;
  max-width: 100%;
  border-radius: 12px;
  background: white;
  padding: 8px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.room-help,
.room-empty {
  color: #64748b;
  line-height: 1.6;
}

.status-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.status-message.info { background: #dbeafe; color: #1d4ed8; }
.status-message.success { background: #dcfce7; color: #166534; }
.status-message.error { background: #fee2e2; color: #b91c1c; }

.room-rejoin-card {
  border: 1px dashed #93c5fd;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.65), rgba(237, 233, 254, 0.65));
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.question-card {
  background: #eff6ff;
  border-radius: 16px;
  padding: 16px;
}

.question-meta {
  color: #1d4ed8;
  font-weight: 700;
  margin-bottom: 8px;
}

.options-list {
  display: grid;
  gap: 8px;
}

.option-pill {
  background: white;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.option-pill.selectable {
  cursor: pointer;
}

.option-pill input {
  width: auto;
  margin-right: 10px;
}

.correct-option {
  border-color: #16a34a;
  background: #dcfce7;
}

.explanation-box {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
}

.room-note-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #475569;
}

.room-note-list li {
  margin-bottom: 6px;
}

.quiz-finish-card {
  border-radius: 18px;
  padding: 20px;
  color: #0f172a;
  background: linear-gradient(135deg, #fff7ed 0%, #eff6ff 45%, #f5f3ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.quiz-finish-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-finish-card h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.quiz-finish-summary {
  margin: 0 0 16px;
  color: #475569;
  line-height: 1.6;
}

.quiz-finish-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-finish-stat {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 12px;
}

.quiz-finish-stat strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.quiz-finish-stat span {
  color: #64748b;
  font-size: 0.85rem;
}

.quiz-finish-podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.quiz-podium-place {
  background: rgba(255,255,255,0.8);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.quiz-podium-medal {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.quiz-podium-name {
  font-weight: 800;
  margin-bottom: 4px;
}

.quiz-podium-score {
  color: #475569;
  font-size: 0.9rem;
}

.room-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}

.room-link-btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
}

.room-link-btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

@media (max-width: 900px) {
  .room-grid-wide {
    grid-template-columns: 1fr;
  }

  .room-shell {
    padding: 16px;
  }
}
