* { margin: 0; padding: 0; box-sizing: border-box; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

input, textarea, select { font-size: 16px !important; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 30% 20%, #142033, #05070c 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: #0e1420;
  border: 1px solid #1e2636;
  border-radius: 20px;
  padding: 30px 26px;
  color: #e8ecf3;
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}
.tg-icon { font-size: 2.4rem; text-align: center; margin-bottom: 10px; }

.auth-card h1 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 10px;
}
.auth-sub {
  text-align: center;
  color: #8b95a8;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 26px;
}

.auth-submit {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  margin-top: 6px;
  border: none;
  background: linear-gradient(135deg, #ff3b4e, #ff6b4a);
  color: #fff;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  font-size: 0.96rem;
}
.tg-btn { background: linear-gradient(135deg, #26a5e4, #1c8ad9); }

.auth-waiting {
  text-align: center;
  color: #8b95a8;
  font-size: 0.8rem;
  margin-top: 18px;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 7px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-line { font-size: 0.7rem; color: #9fe6b0; font-weight: 700; margin-top: 3px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }

html, body {
  height: 100%;
  background: #000;
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  overflow: hidden;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hidden { display: none !important; }

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px calc(16px + env(safe-area-inset-top, 0px));
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  z-index: 10;
}

.status {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 7px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.status.ok { color: #6ee7a0; }
.status.err { color: #ff6b6b; }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}

.object-bar {
  position: absolute;
  top: 76px;
  left: 16px;
  right: 16px;
  z-index: 9;
}
.object-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.object-input::placeholder { color: rgba(255,255,255,0.55); font-weight: 500; }
.object-input:focus { outline: none; border-color: #22d3ee; }

/* Live overlay preview mimicking the burned-in watermark */
.overlay-preview {
  position: absolute;
  left: 0; right: 0;
  bottom: 170px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.15));
  color: #fff;
  z-index: 8;
  pointer-events: none;
}
.addr-line {
  font-size: 0.92rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  margin-bottom: 3px;
}
.meta-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 500;
  color: #e2e8f0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.bottombar {
  position: absolute;
  bottom: 118px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 10;
}
.mode-btn {
  border: none;
  background: rgba(255,255,255,0.12);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 999px;
}
.mode-btn.active {
  background: #fff;
  color: #111;
}

.controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 34px calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}

.shutter {
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: transparent;
  position: relative;
  margin: 0 auto;
}
.shutter::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
  transition: all .15s ease;
}
.shutter.recording::before {
  border-radius: 8px;
  background: #ff3b4e;
  inset: 18px;
}
.shutter.recording {
  border-color: #ff3b4e;
}

.download-btn, .spacer { width: 52px; }
.download-btn {
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 4px;
}

.toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 0.88rem;
  max-width: 82%;
  text-align: center;
  z-index: 30;
}
