:root {
  --bg: #0e0c0a;
  --bg2: #1a120c;
  --ink: #f4efe9;
  --muted: #b3a89f;
  --accent: #ff7a18;
  --accent2: #ffb347;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% -10%, #2a1a10 0%, var(--bg) 45%, #0b0a08 100%);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 300px at 80% 10%, rgba(255, 122, 24, 0.18), transparent 60%),
    radial-gradient(500px 500px at 10% 90%, rgba(255, 179, 71, 0.15), transparent 55%);
  pointer-events: none;
}

.wrap {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: grid;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff7a18, #ffb347);
  color: #15110f;
  font-size: 28px;
  font-weight: 700;
  font-family: "Fraunces", serif;
}

.brand h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 32px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  overflow: hidden;
  min-height: 260px;
  padding: 10px;
}

.label {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

video {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #0a0908;
  object-fit: cover;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active { transform: translateY(1px); }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #15110f;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--stroke);
}

.chat {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.chat-header {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-log {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.msg {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.msg.me { background: rgba(255, 122, 24, 0.2); }

.debug {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.debug-header {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.debug-log {
  min-height: 80px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink);
  padding: 10px 14px;
}

.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  opacity: 0.4;
}

@media (max-width: 640px) {
  .wrap { padding-top: 20px; }
  .brand h1 { font-size: 26px; }
}
