:root {
  color-scheme: light;
  --bg-a: #0b1020;
  --bg-b: #14213d;
  --panel: rgba(12, 18, 34, 0.72);
  --panel-strong: rgba(18, 28, 54, 0.92);
  --line: rgba(159, 183, 255, 0.16);
  --text: #edf3ff;
  --muted: rgba(237, 243, 255, 0.7);
  --accent: #78d3ff;
  --accent-strong: #4db8ff;
  --accent-alt: #8af0c1;
  --bubble-left: rgba(255, 255, 255, 0.08);
  --bubble-right: linear-gradient(135deg, #4db8ff 0%, #78d3ff 100%);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(77, 184, 255, 0.24), transparent 36%),
    radial-gradient(circle at right 18%, rgba(138, 240, 193, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.status-card,
.lobby,
.translator,
.footnote {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 28px;
  border-radius: 28px;
}

.eyebrow,
.pill,
.status-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.eyebrow,
.pill {
  padding: 8px 12px;
  background: rgba(77, 184, 255, 0.12);
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 18px;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lede {
  margin-top: 16px;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.primary-btn,
.secondary-link {
  border-radius: 14px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.primary-btn {
  border: 0;
  color: #08111f;
  background: linear-gradient(135deg, #8af0c1 0%, #78d3ff 100%);
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(77, 184, 255, 0.22);
  cursor: pointer;
}

.secondary-link {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

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

.section-kicker {
  color: var(--accent-alt);
  margin-bottom: 10px;
}

.translator h2 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.footnote p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.lobby,
.translator {
  margin-top: 18px;
  border-radius: 28px;
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.engine-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.room-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.logout-btn {
  min-height: 38px;
  padding: 0 14px;
}

.call-btn,
.hangup-btn {
  min-height: 38px;
  padding: 0 14px;
}

.lobby-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.lobby-panel > .field {
  grid-column: span 6;
}

.lobby-panel .submit-btn {
  grid-column: 1 / -1;
}

.chat-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.participant-panel {
  border-radius: 22px;
  padding: 18px;
  background: rgba(8, 17, 31, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.participant-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.participant-head h3 {
  margin-top: 4px;
  font-size: 1rem;
}

.participant-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.participant-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.participant-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.participant-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.participant-item strong,
.participant-item span {
  display: block;
}

.participant-item span {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.participant-item.active {
  border-color: rgba(120, 211, 255, 0.55);
  background: rgba(77, 184, 255, 0.12);
}

.participant-item:hover {
  transform: translateY(-1px);
}

.chat-main {
  min-width: 0;
}

.draw-shell {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 17, 31, 0.42);
}

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

.draw-head h3 {
  margin-top: 4px;
  font-size: 1rem;
}

.draw-actions {
  display: flex;
  gap: 8px;
}

.draw-clear-btn {
  min-height: 38px;
  padding: 0 14px;
}

.draw-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(4, 9, 18, 0.92);
  background-size: 24px 24px, 24px 24px, auto;
}

.chat-composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 8px;
}

.message-row {
  flex: 1 1 320px;
  display: grid;
  gap: 8px;
}

.message-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 14px;
  outline: none;
}

.message-row input:focus {
  border-color: rgba(120, 211, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(77, 184, 255, 0.18);
}

.field span {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 14px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(120, 211, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(77, 184, 255, 0.18);
}

.submit-btn {
  flex: 0 0 auto;
}

.chat-log {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  min-height: 220px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.bubble-row {
  display: flex;
}

.bubble-row.left {
  justify-content: flex-start;
}

.bubble-row.right {
  justify-content: flex-end;
}

.bubble {
  max-width: min(78%, 620px);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.7;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.14);
}

.bubble.left {
  background: var(--bubble-left);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.bubble.right {
  background: var(--bubble-right);
  color: #09111f;
  font-weight: 700;
}

.bubble-meta {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.footnote {
  margin-top: 18px;
  border-radius: 22px;
  padding: 18px 20px;
}

@media (max-width: 900px) {
  .lobby-panel {
    grid-template-columns: 1fr;
  }

  .lobby-panel > .field,
  .lobby-panel .submit-btn {
    grid-column: auto;
  }

  .section-head {
    flex-direction: column;
  }

  .room-actions {
    align-items: flex-start;
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0 32px;
  }

  .hero,
  .translator {
    padding: 18px;
    border-radius: 22px;
  }

  .bubble {
    max-width: 92%;
  }
}
