:root {
  --bg0: #0b1220;
  --bg1: #142033;
  --accent: #3d9cf0;
  --danger: #e25555;
  --warn: #d4a017;
  --mine: #1e4d7a;
  --theirs: #24364f;
  --text: #eef3fa;
  --muted: #9aa8bc;
  --line: rgba(255, 255, 255, 0.08);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1c3354 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screen[hidden] { display: none !important; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.brand { font-weight: 700; letter-spacing: 0.02em; }
.status { color: var(--muted); font-size: 0.8rem; }

.lobby-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 24px 8px;
}

.lobby-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.hint { color: var(--muted); margin: 0; max-width: 28rem; line-height: 1.4; }

.voice-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7ec4ff, var(--accent) 45%, #1a3a5c 75%);
  box-shadow: 0 0 0 0 rgba(61, 156, 240, 0.45);
  animation: pulse 2.4s ease-in-out infinite;
}

.orb-sm { width: 96px; height: 96px; }
.orb-mini { width: 42px; height: 42px; }

.orb.speaking { animation-duration: 1.1s; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 156, 240, 0.35); transform: scale(1); }
  50% { box-shadow: 0 0 0 14px rgba(61, 156, 240, 0); transform: scale(1.04); }
}

.timer { font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--muted); }

.chat {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  line-height: 1.35;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.mine {
  align-self: flex-end;
  background: var(--mine);
  border-bottom-right-radius: 4px;
}

.bubble.theirs {
  align-self: flex-start;
  background: var(--theirs);
  border-bottom-left-radius: 4px;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 95%;
  text-align: center;
}

.bubble.photo-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  min-width: 140px;
}

.bubble.photo-card:not(:has(img)) {
  padding: 18px 14px;
}

.bubble.photo-card img {
  display: block;
  width: 180px;
  max-width: 70vw;
  height: auto;
}

.bubble.photo-card .cap {
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.consent-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.78rem;
  color: var(--muted);
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.composer input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101a2b;
  color: var(--text);
  padding: 12px;
  font-size: 1rem;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 600;
  color: var(--text);
  background: #24364f;
  cursor: pointer;
}

.btn.primary { background: var(--accent); color: #041018; }
.btn.secondary { background: #24364f; }
.btn.danger { background: var(--danger); }
.btn.warn { background: var(--warn); color: #1a1400; }
.btn.block { width: 100%; }
.btn.btn-sm { padding: 8px 10px; font-size: 0.85rem; white-space: nowrap; }
.btn.icon { padding: 12px; min-width: 48px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ads {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 80, 160, 0.45);
  display: grid;
  place-items: center;
  z-index: 15;
  font-size: 1.2rem;
  font-weight: 700;
  pointer-events: none;
}

.drop-overlay[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
}

.modal[hidden] { display: none !important; }

.modal-card {
  width: min(420px, 100%);
  background: #152236;
  border-radius: 16px;
  padding: 14px;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

.panel-title { margin: 0 0 8px; }

#photoImg {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
  margin-bottom: 10px;
}
