:root {
  --bg: #f4efe6;
  --bg-deep: #ebe4d9;
  --surface: rgba(255, 251, 245, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 247, 239, 0.72);
  --text: #1e2d2a;
  --muted: #657570;
  --line: rgba(30, 45, 42, 0.1);
  --accent: #0d7a68;
  --accent-strong: #0b5d53;
  --accent-soft: #d8efe7;
  --warm: #f0c89f;
  --warn: #ba5a40;
  --shadow: 0 28px 80px rgba(63, 52, 35, 0.12);
  --shadow-soft: 0 14px 38px rgba(48, 41, 29, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-title: "Avenir Next", "PingFang SC", "Segoe UI", sans-serif;
  --font-body: "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 216, 168, 0.45), transparent 25%),
    radial-gradient(circle at 86% 18%, rgba(13, 122, 104, 0.18), transparent 24%),
    radial-gradient(circle at 60% 100%, rgba(13, 122, 104, 0.12), transparent 28%),
    linear-gradient(180deg, #faf6ef 0%, var(--bg) 46%, var(--bg-deep) 100%);
  font-family: var(--font-body);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.page-glow {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(28px);
  pointer-events: none;
  opacity: 0.72;
}

.glow-a {
  top: 70px;
  left: -40px;
  width: 280px;
  height: 280px;
  background: rgba(246, 203, 142, 0.34);
}

.glow-b {
  right: 6%;
  bottom: 12%;
  width: 320px;
  height: 320px;
  background: rgba(13, 122, 104, 0.16);
}

.glow-c {
  right: -60px;
  top: 120px;
  width: 300px;
  height: 300px;
  background: rgba(244, 180, 120, 0.2);
}

.landing-shell,
.page-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-card,
.panel,
.side-panel,
.note-card,
.room-code-card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-card,
.side-panel {
  border-radius: var(--radius-xl);
}

.hero-card,
.panel,
.side-panel,
.note-card {
  animation: rise-in 480ms ease both;
}

.landing-grid,
.room-hero {
  display: grid;
  gap: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.landing-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  align-items: stretch;
}

.room-hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  margin-bottom: 22px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-side,
.room-actions,
.stack,
.note-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow,
.mini-label,
.panel-label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mini-label {
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-title);
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

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

.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(13, 122, 104, 0.12);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
}

.stack {
  max-width: 420px;
}

.side-panel {
  padding: 24px;
  justify-content: space-between;
}

.join-panel h2 {
  margin-top: 2px;
}

.join-box {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.join-box label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.join-row,
.file-row,
.composer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.note-list {
  margin-top: 6px;
}

.note-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.8), rgba(255, 247, 239, 0.7));
}

.note-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.note-card span {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.primary-link,
.secondary-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.primary-link,
button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #f8fffc;
  box-shadow: 0 16px 30px rgba(13, 122, 104, 0.22);
}

.primary-strong {
  min-height: 56px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
}

.secondary-link {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-color: var(--line);
}

.primary-link:hover,
.secondary-link:hover,
button:hover {
  transform: translateY(-1px);
}

.primary-link:active,
.secondary-link:active,
button:active {
  transform: translateY(0);
}

.hint,
.muted {
  color: var(--muted);
}

.status-grid,
.workspace-grid {
  display: grid;
  gap: 20px;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.status-card {
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(13, 122, 104, 0.12);
}

.accent-card::before {
  background: linear-gradient(180deg, var(--accent), #58b79f);
}

.status-value {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.room-code-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 239, 231, 0.74));
}

.room-code-card strong {
  display: block;
  margin: 6px 0 10px;
  font-family: var(--font-title);
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 0.04em;
}

.message-log,
.transfer-list {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 249, 242, 0.64));
}

.message-log {
  height: 340px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.message-log:empty::before,
.transfer-list:empty::before {
  content: attr(data-empty);
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.message-item {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.6;
  word-break: break-word;
  animation: rise-in 220ms ease both;
}

.message-item.local {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(13, 122, 104, 0.16);
}

.message-item.remote {
  align-self: flex-start;
  background: var(--accent-soft);
}

.message-item.system {
  align-self: center;
  width: 100%;
  max-width: 100%;
  background: rgba(13, 122, 104, 0.08);
  color: var(--muted);
}

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

.composer-actions {
  justify-content: space-between;
}

textarea,
input[type="text"],
input[type="file"],
#room-id {
  width: 100%;
  border: 1px solid rgba(30, 45, 42, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea::placeholder,
input::placeholder {
  color: #8a9793;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: rgba(13, 122, 104, 0.34);
  box-shadow: 0 0 0 4px rgba(13, 122, 104, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

textarea {
  resize: vertical;
  min-height: 132px;
}

input[type="file"] {
  padding: 12px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(13, 122, 104, 0.12);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.transfer-list {
  min-height: 180px;
  margin-top: 18px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.transfer-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.transfer-card.error {
  border-color: rgba(186, 90, 64, 0.4);
}

.transfer-title {
  font-weight: 700;
}

.transfer-progress {
  height: 10px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(30, 45, 42, 0.08);
}

.transfer-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #86cdb4);
  border-radius: 999px;
  transition: width 120ms ease;
}

.transfer-footer {
  color: var(--muted);
  font-size: 14px;
}

.download-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .landing-grid,
  .room-hero,
  .status-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-side {
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .landing-shell,
  .page-shell {
    width: min(100vw - 20px, 1160px);
    padding-top: 18px;
  }

  .landing-grid,
  .room-hero,
  .panel {
    padding: 22px;
  }

  .join-row,
  .file-row,
  .composer-actions,
  .room-actions {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: clamp(30px, 11vw, 48px);
  }

  .message-log {
    height: 280px;
  }

  .status-value {
    font-size: 22px;
  }
}
