/* ============================================
   SCC — Streamer Community College
   Main Stylesheet · Black & Gold · Phase 1
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@400;500;600&display=swap');

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #D4AF37;
  --gold-light: #F0D060;
  --gold-dim: #9A7F26;
  --black: #0A0A0A;
  --black-mid: #141414;
  --black-card: #1A1A1A;
  --black-border: #2A2A2A;
  --white: #F5F5F0;
  --white-dim: #A0A09A;
  --red: #E53935;
  --green: #43A047;
  --blue: #1E88E5;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.18s ease;
}

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Typography ───────────────────────────── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.15; color: var(--white); }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); }
p { color: var(--white-dim); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.gold { color: var(--gold); }
.dim { color: var(--white-dim); font-size: 0.85rem; }

/* ── Layout ───────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ── SCC Header / Nav ─────────────────────── */
.scc-header {
  background: var(--black-mid);
  border-bottom: 2px solid var(--gold);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.scc-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.scc-logo span { color: var(--white-dim); font-weight: 400; font-size: 0.7rem; display: block; letter-spacing: 0.08em; }
.scc-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav-link {
  color: var(--white-dim);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { color: var(--gold); background: rgba(212,175,55,0.08); text-decoration: none; }
.nav-link.active { color: var(--gold); background: rgba(212,175,55,0.12); }
.nav-user { display: flex; align-items: center; gap: 0.5rem; }
.avatar-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--black-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

/* ── Cards ────────────────────────────────── */
.card { background: var(--black-card); border: 1px solid var(--black-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.card-gold { border-color: var(--gold-dim); }
.card-header {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--black-border);
}

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover:not(:disabled) { background: var(--gold-light); color: var(--black); }
.btn-outline { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn-outline:hover:not(:disabled) { background: rgba(212,175,55,0.1); color: var(--gold); }
.btn-ghost { background: transparent; color: var(--white-dim); border: 1.5px solid var(--black-border); }
.btn-ghost:hover:not(:disabled) { color: var(--white); border-color: var(--white-dim); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: #c62828; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: #2e7d32; }
.btn-lg { font-size: 1.1rem; padding: 0.85rem 2rem; }
.btn-sm { font-size: 0.78rem; padding: 0.4rem 0.9rem; }
.btn-block { width: 100%; }
.btn-pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(212,175,55,0); }
}

/* ── Forms ────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--black);
  border: 1.5px solid var(--black-border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 0.35rem; }
.form-hint { font-size: 0.78rem; color: var(--white-dim); margin-top: 0.35rem; }

/* ── Badges ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-gold { background: rgba(212,175,55,0.15); color: var(--gold); border: 1px solid var(--gold-dim); }
.badge-red { background: rgba(229,57,53,0.15); color: #ef5350; border: 1px solid rgba(229,57,53,0.4); }
.badge-green { background: rgba(67,160,71,0.15); color: #66bb6a; border: 1px solid rgba(67,160,71,0.4); }
.badge-blue { background: rgba(30,136,229,0.15); color: #42a5f5; border: 1px solid rgba(30,136,229,0.4); }
.badge-live { background: var(--red); color: #fff; animation: live-blink 1.5s infinite; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ── Avatar Components ────────────────────── */
.avatar {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--black-card);
  border: 2px solid var(--black-border);
  flex-shrink: 0;
  user-select: none;
  font-style: normal;
}
.avatar-sm { width: 36px; height: 36px; font-size: 1.1rem; }
.avatar-md { width: 52px; height: 52px; font-size: 1.6rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 2.5rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 3.5rem; }

/* ── Presence ─────────────────────────────── */
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 6px rgba(67,160,71,0.6);
}

/* ── Toast ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 0.6rem;
  max-width: 360px;
}
.toast {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.88rem; color: var(--white);
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Spinner ──────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--black-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem;
  padding: 4rem 1rem;
  color: var(--white-dim);
}

/* ── Misc ─────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--black-border); margin: 1.5rem 0; }
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.alert-gold { background: rgba(212,175,55,0.1); border: 1px solid var(--gold-dim); color: var(--gold-light); }
.alert-red { background: rgba(229,57,53,0.1); border: 1px solid rgba(229,57,53,0.4); color: #ef5350; }
.alert-green { background: rgba(67,160,71,0.1); border: 1px solid rgba(67,160,71,0.4); color: #66bb6a; }

/* ── Countdown ────────────────────────────── */
.countdown {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1;
}
.countdown-label {
  text-align: center; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--white-dim); margin-top: 0.4rem;
}

/* ── Chat ─────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.chat-msg { display: flex; gap: 0.5rem; align-items: flex-start; }
.chat-msg-content {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  max-width: calc(100% - 44px);
  word-break: break-word;
}
.chat-msg-name { font-size: 0.7rem; font-weight: 600; color: var(--gold); margin-bottom: 0.1rem; }
.chat-msg-text { color: var(--white); }
.chat-input-row {
  display: flex; gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--black-border);
}
.chat-input {
  flex: 1;
  background: var(--black);
  border: 1.5px solid var(--black-border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}
.chat-input:focus { border-color: var(--gold); }

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--black-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Utilities ────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }

/* ════════════════════════════════════════════
   PAGE: Login
   ════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
  background: radial-gradient(ellipse at top, #1a1500 0%, var(--black) 60%);
}
.login-box { width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); color: var(--gold); }
.login-logo p { font-size: 0.82rem; margin-top: 0.25rem; }
.login-seal { font-size: 3.5rem; margin-bottom: 0.5rem; }
.login-footer { text-align: center; margin-top: 1.5rem; font-size: 0.82rem; color: var(--white-dim); }

/* ════════════════════════════════════════════
   PAGE: Avatar Selection
   ════════════════════════════════════════════ */
.avatar-select-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at top, #1a1500 0%, var(--black) 60%);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 700px;
  margin: 2rem 0;
}
.avatar-option {
  background: var(--black-card);
  border: 2px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.avatar-option:hover { border-color: var(--gold-dim); background: rgba(212,175,55,0.06); }
.avatar-option.selected { border-color: var(--gold); background: rgba(212,175,55,0.12); }
.avatar-option-emoji { font-size: 3rem; line-height: 1; }
.avatar-option-name { font-size: 0.8rem; font-weight: 600; color: var(--white-dim); }
.avatar-option.selected .avatar-option-name { color: var(--gold); }

/* ════════════════════════════════════════════
   PAGE: Campus Home
   ════════════════════════════════════════════ */
.campus-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  flex: 1;
}
@media (min-width: 768px) {
  .campus-layout { grid-template-columns: 1fr 300px; padding: 1.5rem; }
}

.campus-map-wrap {
  position: relative;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
  background: linear-gradient(135deg, #0d1a0d 0%, #0a1508 40%, #0d0a0a 100%);
}

/* ASCII campus background */
.campus-bg-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 0.55rem;
  color: rgba(212,175,55,0.06);
  white-space: pre;
  user-select: none;
  overflow: hidden;
  line-height: 1.2;
}

.map-hotspot {
  position: absolute;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  transition: transform var(--transition);
  z-index: 2;
}
.map-hotspot:hover { transform: scale(1.08); }
.map-hotspot-icon {
  background: var(--black-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 0 16px rgba(212,175,55,0.2);
  transition: var(--transition);
}
.map-hotspot:hover .map-hotspot-icon {
  background: rgba(212,175,55,0.15);
  box-shadow: 0 0 28px rgba(212,175,55,0.45);
}
.map-hotspot-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--gold);
  background: rgba(0,0,0,0.75);
  padding: 0.15rem 0.5rem;
  border-radius: 4px; white-space: nowrap;
  backdrop-filter: blur(4px);
}
.map-hotspot.live-now .map-hotspot-icon {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(229,57,53,0.5);
  animation: live-glow 2s infinite;
}
@keyframes live-glow {
  0%, 100% { box-shadow: 0 0 16px rgba(229,57,53,0.4); }
  50% { box-shadow: 0 0 30px rgba(229,57,53,0.7); }
}
.map-hotspot.live-now .map-hotspot-label { color: #ef5350; }

.campus-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.online-student-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 200px; overflow-y: auto; }
.online-student-item { display: flex; align-items: center; gap: 0.6rem; }
.online-student-name { font-size: 0.82rem; color: var(--white); }
.online-student-loc { font-size: 0.7rem; color: var(--white-dim); }

/* ════════════════════════════════════════════
   PAGE: Classroom
   ════════════════════════════════════════════ */
.classroom-page { display: flex; flex-direction: column; height: calc(100vh - 57px); overflow: hidden; }
.classroom-bar {
  padding: 0.5rem 1rem;
  background: var(--black-mid);
  border-bottom: 1px solid var(--black-border);
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.classroom-body {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
@media (min-width: 900px) {
  .classroom-body { grid-template-columns: 1fr 280px; grid-template-rows: 1fr; }
}
.stream-area { background: #000; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.stream-embed { width: 100%; flex: 1; min-height: 0; border: none; }
.stream-placeholder {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.75rem;
  color: var(--white-dim);
  font-size: 0.88rem;
  padding: 2rem;
}
.stream-placeholder .big-icon { font-size: 3rem; }
.student-grid-bar {
  background: var(--black-mid);
  border-top: 1px solid var(--black-border);
  padding: 0.5rem;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  max-height: 130px;
  overflow-y: auto;
}
.student-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  background: var(--black-card);
  border: 1px solid var(--black-border);
  min-width: 60px;
}
.student-tile-name { font-size: 0.62rem; color: var(--white-dim); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; max-width: 70px; }
.student-tile.on-camera { border-color: var(--green); }
.student-tile.on-camera .student-tile-name { color: #66bb6a; }

.classroom-sidebar {
  background: var(--black-mid);
  border-left: 1px solid var(--black-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-top {
  padding: 0.75rem;
  border-bottom: 1px solid var(--black-border);
  display: flex; flex-direction: column; gap: 0.6rem;
  flex-shrink: 0;
}
.queue-status {
  background: var(--black);
  border: 1px solid var(--black-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
}
.queue-position { font-size: 0.75rem; color: var(--white-dim); }
.selected-for-camera {
  background: rgba(67,160,71,0.1);
  border: 1px solid rgba(67,160,71,0.4);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}

.waiting-room {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; padding: 2rem 1rem; text-align: center; gap: 1.5rem;
}
.waiting-room .who-list {
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 0.4rem;
  text-align: left;
}
.who-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; background: var(--black-card); border-radius: var(--radius); }
.who-name { font-size: 0.85rem; }

/* ════════════════════════════════════════════
   PAGE: Lounge
   ════════════════════════════════════════════ */
.lounge-page { display: flex; flex-direction: column; height: calc(100vh - 57px); }
.lounge-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
@media (min-width: 700px) {
  .lounge-body { grid-template-columns: 220px 1fr; }
}
.lounge-who {
  border-right: 1px solid var(--black-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.lounge-