:root {
  --bg: #12141a;
  --panel: #1b1e27;
  --panel-2: #21242f;
  --text: #ece9e2;
  --text-dim: #9aa0ae;
  --accent: #e8a23d;
  --accent-dim: rgba(232, 162, 61, 0.16);
  --signal: #6fa287;
  --danger: #c1594b;
  --border: rgba(236, 233, 226, 0.1);
  --radius: 6px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(232, 162, 61, 0.06), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(111, 162, 135, 0.05), transparent 45%);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.frame {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.screen { width: 100%; display: flex; justify-content: center; }
.screen.hidden { display: none; }

.panel {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
}

.panel-center { text-align: center; padding-top: 40px; padding-bottom: 36px; }

/* Landing */

.spectrum {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  margin-bottom: 22px;
}
.spectrum span {
  flex: 1;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 1px;
}
.spectrum span:nth-child(3n+1) { height: 40%; }
.spectrum span:nth-child(3n+2) { height: 100%; opacity: 0.9; }
.spectrum span:nth-child(3n)   { height: 65%; }
.spectrum span:nth-child(5n)   { opacity: 0.35; }

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0 0 10px;
  max-width: 30ch;
}

.sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 20px;
  max-width: 38ch;
}

.rules {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.rules p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 18px;
  cursor: pointer;
}
.agree-row input { margin-top: 3px; accent-color: var(--accent); }
.agree-row.shake { animation: shake 0.35s; }
@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.status-text {
  font-size: 0.82rem;
  color: var(--danger);
  margin: 10px 0 0;
  min-height: 1em;
}

/* Buttons */

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius);
  padding: 13px 18px;
  cursor: pointer;
  width: 100%;
}
.btn-primary { background: var(--accent); color: #191308; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  margin-top: 10px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* Searching */

.scan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 44px;
  margin: 0 auto 20px;
}
.scan span {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: scanbar 1.1s ease-in-out infinite;
}
.scan span:nth-child(odd) { animation-delay: -0.6s; }
.scan span:nth-child(3n) { animation-delay: -0.3s; }
.scan span:nth-child(4n) { animation-delay: -0.9s; }
@keyframes scanbar {
  0%, 100% { height: 20%; opacity: 0.4; }
  50% { height: 100%; opacity: 1; }
}

.scan-label {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin: 0 0 18px;
}

.static-burst {
  width: 100%;
  height: 44px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(193,89,75,0.35) 0 2px, transparent 2px 6px);
  opacity: 0.6;
}

/* Chat */

.chat-shell {
  width: 100%;
  max-width: 480px;
  height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-live { background: var(--signal); box-shadow: 0 0 0 3px rgba(111,162,135,0.2); }

.chat-actions { display: flex; gap: 6px; }
.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-icon:hover { color: var(--text); border-color: var(--text-dim); }
#report-btn:hover { color: var(--danger); border-color: var(--danger); }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.msg.stranger { align-self: flex-start; background: var(--panel-2); color: var(--text); }
.msg.me { align-self: flex-end; background: var(--accent-dim); color: var(--text); border: 1px solid rgba(232,162,61,0.3); }

.msg.system {
  align-self: center;
  background: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}
.composer input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 12px 14px;
}
.composer input:focus { outline: none; border-color: var(--accent); }
.btn-send { width: auto; padding: 12px 20px; }

@media (max-width: 420px) {
  .chat-shell { height: calc(100vh - 32px); }
}
