:root {
  --bg: #07111f;
  --panel: rgba(12, 21, 40, 0.84);
  --panel-2: rgba(18, 29, 54, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f7ff;
  --muted: #acb9d8;
  --accent: #7c4dff;
  --accent-2: #18d6ff;
  --danger: #ff5e7e;
  --success: #43e2a6;
  --warning: #ffbf4d;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(124,77,255,.25), transparent 30%), linear-gradient(180deg, #040914 0%, #09162b 100%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.strongish { font-weight: 600; }

.bg-orb {
  position: fixed; border-radius: 999px; filter: blur(80px); opacity: .45; pointer-events: none; z-index: 0;
}
.orb-1 { width: 280px; height: 280px; background: var(--accent); top: 70px; left: -80px; }
.orb-2 { width: 320px; height: 320px; background: var(--accent-2); right: -90px; top: 300px; }
.bg-grid {
  position: fixed; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 30px 30px; pointer-events: none; z-index: 0;
}

.topbar, .page-shell { position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px; position: sticky; top: 0; backdrop-filter: blur(20px);
  background: rgba(4,10,22,.78); border-bottom: 1px solid var(--line); z-index: 10;
}
.brand-inline { display: flex; align-items: center; gap: 14px; }
.tiny-logo { width: 44px; height: 44px; }
.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.page-shell { max-width: 1320px; margin: 0 auto; padding: 26px; }
.section-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; backdrop-filter: blur(16px); margin-bottom: 22px;
}
.stage-bg { background-image: linear-gradient(rgba(8,16,31,.55), rgba(8,16,31,.78)), url('/assets/stage-bg.svg'); background-size: cover; background-position: center; }
.hero {
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 22px; min-height: 420px; align-items: stretch;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.hero-copy h1 { font-size: clamp(2.2rem, 4vw, 4rem); margin: 0; }
.hero-copy p { color: var(--muted); max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side { display: grid; gap: 16px; }
.glass-card {
  background: rgba(8,15,30,.72); border: 1px solid rgba(255,255,255,.07); border-radius: 20px; padding: 18px;
}
.card-header, .section-head, .section-head.compact { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2, .section-head.compact h2 { margin: 8px 0 0; }
.onair-main { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.avatar-xl { width: 92px; height: 92px; border-radius: 24px; object-fit: cover; border: 2px solid rgba(255,255,255,.12); }
.quick-stats { display: grid; gap: 16px; }

.community-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; }
.column-left, .column-right { min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.chat-topbar, .chat-compose, .cam-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.chat-topbar { margin-bottom: 14px; }
.chat-messages {
  background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 18px; min-height: 340px; max-height: 520px; overflow: auto; padding: 14px; display: grid; gap: 10px;
}
.message {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.05); border-radius: 16px; padding: 12px 14px;
}
.message-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.emoji-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.emoji-chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--text); padding: 8px 12px;
}
.emoji-chip img { width: 22px; height: 22px; object-fit: contain; }
.wish-list, .admin-list { display: grid; gap: 10px; margin-top: 16px; }
.wish-card, .admin-row, .team-card, .schedule-card, .cam-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
}
.wish-card time { display: block; margin-top: 8px; color: var(--muted); font-size: .85rem; }
.wish-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:8px; }
.wish-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.wish-card.done { opacity: .72; border-color: rgba(67,226,166,.28); }
.wish-card.done strong, .admin-row.is-done strong { text-decoration: line-through; }
.done-pill { background: rgba(67,226,166,.16); color: #a5f8d6; }
.team-grid, .schedule-grid, .cam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.team-card-head, .schedule-card-head { display: flex; gap: 12px; align-items: center; }
.team-avatar { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; flex-shrink: 0; }
.schedule-avatar { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex-shrink: 0; }
.schedule-card h3, .team-card h3 { margin-bottom: 6px; }
.schedule-card {
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.schedule-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.04), transparent 55%);
  opacity: .55;
}
.schedule-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0,0,0,.24);
  border-color: rgba(142,238,255,.35);
}
.schedule-card:hover .schedule-avatar {
  transform: scale(1.06);
  box-shadow: 0 12px 24px rgba(0,0,0,.24);
}
.schedule-avatar {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  border: 2px solid rgba(255,255,255,.08);
}
.schedule-copy { min-width: 0; }
.schedule-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.schedule-autodj {
  border-color: rgba(255,191,77,.24);
  box-shadow: 0 0 0 1px rgba(255,191,77,.08), 0 12px 28px rgba(255,191,77,.08);
}
.schedule-autodj .schedule-avatar {
  border-color: rgba(255,191,77,.32);
  box-shadow: 0 0 22px rgba(255,191,77,.12);
}
.schedule-live {
  border-color: rgba(67,226,166,.42);
  box-shadow: 0 0 0 1px rgba(67,226,166,.14), 0 0 32px rgba(67,226,166,.18), 0 18px 36px rgba(0,0,0,.24);
  background: linear-gradient(180deg, rgba(67,226,166,.08), rgba(255,255,255,.03));
}
.schedule-live .schedule-avatar {
  border-color: rgba(67,226,166,.52);
  box-shadow: 0 0 24px rgba(67,226,166,.24);
}
.admin-team-row { display:flex; align-items:center; gap:12px; }
.admin-team-avatar { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.autodj-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: center; }
.autodj-cover-wrap { display: flex; justify-content: center; }
.autodj-cover { width: 100%; max-width: 280px; aspect-ratio: 1/1; object-fit: cover; border-radius: 28px; border: 1px solid var(--line); }
#camVideo {
  width: 100%; min-height: 240px; background: #000; border-radius: 18px; border: 1px solid var(--line); object-fit: cover; margin-bottom: 12px;
}
.cam-card img { width: 100%; border-radius: 12px; margin-top: 10px; object-fit: cover; }

input, textarea, select {
  width: 100%; padding: 12px 14px; background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
}
textarea { resize: vertical; }
.primary-btn, .ghost-btn, .danger {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700;
}
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
.ghost-btn { background: rgba(255,255,255,.06); color: white; border: 1px solid var(--line); }
.danger { background: rgba(255,94,126,.16); color: #ffd7df; border: 1px solid rgba(255,94,126,.28); }
.full-btn { width: 100%; }
.link-btn { display: inline-flex; align-items: center; }
.pill, .status-badge {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
}
.pill { background: rgba(255,255,255,.07); color: #dbe8ff; }
.pill.small { font-size: .75rem; }
.pill.live { background: rgba(24,214,255,.14); color: #8eeeff; }
.pill.warning { background: rgba(255,191,77,.15); color: #ffd28a; }
.status-badge.online { background: rgba(67,226,166,.16); color: #a5f8d6; }
.status-badge.offline { background: rgba(255,94,126,.16); color: #ffd0da; }
.switch-row { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.switch-row input { width: auto; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 20;
}
.modal-panel {
  width: min(1180px, 100%); max-height: 92vh; overflow: auto; background: #091427; border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-card {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px;
}
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-row img { width: 22px; height: 22px; }

@media (max-width: 1024px) {
  .hero, .community-grid, .autodj-layout, .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 14px 16px; }
  .page-shell { padding: 16px; }
  .nav-links { gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .chat-topbar, .chat-compose, .cam-actions { flex-direction: column; }
}

.chat-authbox { display:grid; gap:10px; margin-bottom:14px; }
.auth-grid { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.chat-auth-actions { display:flex; flex-wrap:wrap; gap:10px; }
.small-btn { padding: 6px 10px; font-size: .82rem; margin-top: 8px; }


.admin-list .muted { font-size: 0.9rem; }

#modWishTools { max-height: 420px; overflow: auto; }
#modQuickStatus { line-height: 1.45; }


.floating-mod-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.moderator-tools-panel {
  width: min(560px, calc(100vw - 24px));
}

.moderator-tools-list {
  max-height: 55vh;
  overflow: auto;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .floating-mod-btn {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
}


.cam-status { margin: 10px 0 0; font-size: .95rem; }
.cam-status.info { color: var(--muted); }
.cam-status.warn { color: #ffd166; }
.cam-status.success { color: #7CFCB0; }
.cam-status.error { color: #ff8f8f; }
button:disabled { opacity: .6; cursor: not-allowed; }
