:root {
  color-scheme: light;
  --ink: #102018;
  --muted: #5a6a5f;
  --paper: #f6f4ef;
  --accent: #c65a3a;
  --accent-dark: #9c3c22;
  --panel: rgba(255, 255, 255, 0.86);
  --outline: rgba(16, 32, 24, 0.12);
  --shadow: 0 18px 40px rgba(16, 32, 24, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  background: radial-gradient(circle at top left, #f0dcc4, #f6f4ef 55%, #efe9e2);
  color: var(--ink);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.bg-shape-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, #d96f4b, #a64f33);
  top: -120px;
  right: -160px;
}

.bg-shape-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at 60% 30%, #6aa38b, #3d6b58);
  bottom: -140px;
  left: -120px;
}

.shell {
  position: relative;
  z-index: 1;
  padding: 32px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--ink);
  color: #f7f4ed;
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

h1 {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  font-size: 2.4rem;
  margin-top: 0;
}

h2 {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  margin-top: 0;
}

.lead {
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: #fff4ee;
  box-shadow: 0 12px 24px rgba(198, 90, 58, 0.35);
}

.primary:hover {
  background: var(--accent-dark);
}

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

.panel-right {
  display: flex;
  align-items: stretch;
}

.join-box {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--outline);
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  margin: 16px 0 20px;
}

label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  font-size: 1rem;
  background: #fff;
}

.create-result {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.create-result img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: #fff;
}

.link-row {
  display: flex;
  gap: 10px;
}

.link-row input {
  flex: 1;
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.code {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.4em;
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
}

.chat-shell {
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
}

.chat-title {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  font-size: 1.6rem;
}

.chat-subtitle {
  color: var(--muted);
}

.messages {
  background: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  border: 1px solid var(--outline);
  padding: 18px;
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 75%;
  background: #fff;
  border: 1px solid var(--outline);
  box-shadow: 0 6px 12px rgba(16, 32, 24, 0.08);
}

.bubble.me {
  align-self: flex-end;
  background: #fde6da;
}

.bubble.system {
  align-self: center;
  background: transparent;
  border: none;
  color: var(--muted);
  box-shadow: none;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .messages {
    height: 300px;
  }

  .actions {
    flex-direction: column;
  }
}
