@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0a0000;
  font-family: 'Crimson Text', serif;
  min-height: 100vh;
  color: #cc0000;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #3a0000 0%, #0a0000 60%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(180,0,0,0.03) 2px, rgba(180,0,0,0.03) 4px);
  pointer-events: none;
}

.landing {
  min-height: 100vh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.landing.active { display: flex; }

.flame-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.flame { width: 12px; height: 28px; position: relative; }
.flame svg { width: 100%; height: 100%; animation: flicker 1.8s ease-in-out infinite; }
.flame:nth-child(2) svg { animation-delay: 0.3s; }
.flame:nth-child(3) svg { animation-delay: 0.6s; }
.flame:nth-child(4) svg { animation-delay: 0.1s; }
.flame:nth-child(5) svg { animation-delay: 0.9s; }

@keyframes flicker {
  0%,100% { transform: scaleX(1) scaleY(1); }
  25% { transform: scaleX(0.85) scaleY(1.05); }
  50% { transform: scaleX(1.1) scaleY(0.97); }
  75% { transform: scaleX(0.9) scaleY(1.03); }
}

.sigil {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  opacity: 0.85;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,100% { filter: drop-shadow(0 0 6px #cc0000); }
  50% { filter: drop-shadow(0 0 18px #ff2200); }
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 900;
  color: #cc0000;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 30px rgba(200,0,0,0.6), 0 0 60px rgba(200,0,0,0.3);
}

.subtitle {
  font-size: 1rem;
  color: #660000;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.portal-card {
  width: 100%;
  max-width: 520px;
  background: rgba(15,0,0,0.9);
  border: 1px solid #330000;
  border-top: 1px solid #660000;
  border-radius: 4px;
  padding: 2rem;
  position: relative;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cc0000, transparent);
}

.label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #660000;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.room-input {
  width: 100%;
  height: 44px;
  background: #0f0000;
  border: 1px solid #330000;
  border-radius: 2px;
  color: #cc0000;
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.5rem;
}

.room-input::placeholder { color: #440000; }
.room-input:focus { border-color: #660000; box-shadow: 0 0 12px rgba(180,0,0,0.2); }

.btn-row { display: flex; gap: 10px; }
.btn, .mini-btn {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn {
  flex: 1;
  height: 46px;
  font-size: 13px;
  border: none;
}

.btn:active, .mini-btn:active { transform: scale(0.98); }
.btn-sacrifice { background: #cc0000; color: #0a0000; font-weight: 700; }
.btn-sacrifice:hover { background: #ff1100; box-shadow: 0 0 20px rgba(200,0,0,0.5); }
.btn-shade { background: transparent; color: #660000; border: 1px solid #330000 !important; font-weight: 400; }
.btn-shade:hover { border-color: #660000 !important; color: #990000; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.5rem 0;
  color: #330000;
  font-size: 11px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #330000);
}

.direct-link {
  background: #0f0000;
  border: 1px solid #220000;
  border-radius: 2px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 12px;
  color: #440000;
  word-break: break-all;
  line-height: 1.6;
}
.direct-link span { color: #880000; }
.footer-runes { text-align: center; margin-top: 1.5rem; font-size: 18px; color: #330000; letter-spacing: 0.5em; }

.ember {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cc0000;
  animation: rise linear infinite;
  opacity: 0;
  z-index: 0;
}

@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0.8; }
  100% { transform: translateY(-120px) translateX(var(--dx)); opacity: 0; }
}

.meeting-view {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 2;
  background: #080000;
}
.meeting-view.active { display: block; }
.meeting-bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: rgba(15,0,0,0.94);
  border-bottom: 1px solid #330000;
}
.meeting-bar strong {
  display: block;
  font-family: 'Cinzel', serif;
  color: #cc0000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meeting-bar span { color: #660000; font-size: 14px; }
.meeting-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: #990000;
  border: 1px solid #330000;
}
.mini-btn:hover { color: #ff1100; border-color: #660000; }
.mini-btn.danger { background: #cc0000; color: #0a0000; border-color: #cc0000; font-weight: 700; }
#jitsi-container { width: 100%; height: calc(100vh - 64px); background: #000; }

@media (max-width: 600px) {
  .landing { padding: 1rem; }
  h1 { font-size: 2rem; letter-spacing: 0.06em; }
  .subtitle { font-size: 0.8rem; letter-spacing: 0.15em; }
  .portal-card { max-width: 100%; padding: 1.25rem; }
  .flame-row { gap: 1rem; }
  .sigil { width: 60px; height: 60px; }
  .btn-row { flex-direction: column; }
  .meeting-bar { height: auto; min-height: 72px; align-items: flex-start; flex-direction: column; padding: 10px; }
  #jitsi-container { height: calc(100vh - 112px); }
}
