/* xtranslate live — matches the app's dark console aesthetic. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0c10;
  --surface: #16181d;
  --surface-2: #1e2127;
  --accent: #e64a3b;
  --accent-soft: #ff6b5b;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --ok: #34c759;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.accent { color: var(--accent); }

.view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.hero { font-size: 64px; line-height: 1; }
.hero.small { font-size: 44px; }

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.hint { color: var(--muted); font-size: 15px; }

/* ---- code entry ---- */
#code-form { display: flex; gap: 10px; align-items: center; }
#code-input {
  width: 260px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 14px;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 16px 10px;
  outline: none;
}
#code-input:focus { border-color: var(--accent); }
#code-input::placeholder { color: #3a3f47; }
#code-go {
  width: 64px;
  height: 76px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}
#code-go:active { background: var(--accent-soft); }
.error { color: var(--accent-soft); font-size: 14px; }

/* ---- Android app download (bottom of the code screen) ---- */
.apk {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  color: var(--fg);
  text-decoration: none;
}
.apk:active { border-color: var(--accent); }
.apk-icon { font-size: 26px; }
.apk-title { display: block; font-size: 15px; font-weight: 600; }
.apk-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---- language grid ---- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 420px;
  max-height: 62dvh;
  overflow-y: auto;
  padding: 4px;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 14px;
  color: var(--fg);
  font-size: 15px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: start;
}
.lang-btn .flag { font-size: 24px; }
.lang-btn:active, .lang-btn.selected { border-color: var(--accent); }

/* ---- name step ---- */
.name-form { display: flex; gap: 10px; align-items: center; }
.name-form input {
  width: 240px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 14px;
  color: var(--fg);
  font-size: 19px;
  text-align: center;
  padding: 14px 10px;
  outline: none;
}
.name-form input:focus { border-color: var(--accent); }
.name-form button {
  width: 60px;
  height: 58px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

/* ---- flag images (SVG — emoji flags don't render on Windows) ---- */
.flag-img { width: 24px; height: 24px; vertical-align: middle; }
.flag-img.big { width: 30px; height: 30px; flex-shrink: 0; }
.flag-img.small { width: 16px; height: 16px; }
.flag-img.hero-flag { width: 72px; height: 72px; }

/* ---- session ---- */
.view.session {
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}
.bar {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(11, 12, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-2);
  z-index: 5;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #777;
  flex-shrink: 0;
}
.dot.on { background: var(--ok); }
.dot.err { background: var(--accent); }
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 10px;
}
.people { color: var(--muted); font-size: 14px; }
.spacer { flex: 1; }
.icon-btn {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  font-size: 20px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--fg);
}
.icon-btn.on { border-color: var(--accent); }

.feed {
  flex: 1;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 90px;
  overflow-y: auto;
}
.feed-empty {
  margin: auto;
  color: var(--muted);
  font-size: 40px;
  opacity: 0.4;
}
.cap {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  animation: rise 0.25s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.cap.partial { opacity: 0.7; border-style: dashed; }
.cap.partial .txt { font-style: italic; }
.cap .who {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.cap .txt { font-size: 19px; line-height: 1.45; }
.cap .orig { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---- session ended ---- */
.ended {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: rgba(11, 12, 16, 0.94);
  backdrop-filter: blur(6px);
}
.ended-icon { font-size: 72px; }
.ended button {
  width: 90px;
  height: 70px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 34px;
  cursor: pointer;
}

.foot {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  background: linear-gradient(transparent, var(--bg) 60%);
  pointer-events: none;
}
