/* ushla.uz — deliberately minimal. Monochrome, no rounded corners,
   no bright accents. Everything is sharp edges and grayscale. */

:root {
  --bg: #0c0c0c;
  --panel: #141414;
  --line: #262626;
  --line-strong: #383838;
  --text: #e6e6e6;
  --muted: #777;
  --me: #1c1c1c;
  --them: #161616;
  --live: #9a9a9a;
}

* { box-sizing: border-box; }

/* The hidden attribute must win over any explicit display below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

code, .code {
  font-family: "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

/* ---- buttons ---- */
.btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--text); }
.btn:active { background: #1a1a1a; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---- lobby ---- */
#lobby {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  justify-content: center;
}
.lobby-head h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.lobby-head h1 .tld { color: var(--muted); font-weight: 400; }
.lobby-head p { margin: 0 0 32px; font-size: 14px; }

.code-block {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-block .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.code {
  font-size: 26px;
  letter-spacing: 0.14em;
  word-break: break-all;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.actions .btn { flex: 1; }

.status { font-size: 13px; margin-top: 24px; }

/* ---- chat ---- */
#chat { height: 100%; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.head-left { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px;
  background: var(--live);
  display: inline-block;
}
.dot.off { background: #4a4a4a; }
.safety code { color: var(--text); letter-spacing: 0.08em; }

/* call buttons in the header */
.head-right { display: flex; align-items: center; gap: 10px; }
.callbtn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 4px 9px;
  font-size: 11px;
  font-family: inherit;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.callbtn:hover { color: var(--text); border-color: var(--text); }
.callbtn.active { color: var(--text); border-color: var(--text); }

/* incoming call banner */
.incoming {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.incoming-actions { display: flex; gap: 8px; }

/* live call view */
.call-view {
  position: relative;
  background: #000;
  border-bottom: 1px solid var(--line);
  height: 46vh;
  min-height: 240px;
  overflow: hidden;
}
.remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.audio-only {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.audio-only .timer { font-size: 22px; letter-spacing: 0.1em; color: var(--text); }
.local-video {
  position: absolute;
  bottom: 64px;
  right: 12px;
  width: 132px;
  max-width: 34%;
  border: 1px solid var(--line-strong);
  background: #0a0a0a;
  object-fit: cover;
  transform: scaleX(-1); /* mirror own preview */
}
.call-controls {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.callctl {
  background: rgba(20,20,20,0.85);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-family: inherit;
  letter-spacing: 0.05em;
  cursor: pointer;
  min-width: 56px;
}
.callctl:hover { border-color: var(--text); }
.callctl.off { color: var(--muted); border-color: var(--line); }
.callctl.hang { border-color: #6a3030; color: #cf9a9a; }
.callctl.hang:hover { border-color: #b05050; color: #e0b0b0; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 78%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg.me { align-self: flex-end; background: var(--me); border-color: var(--line-strong); }
.msg.them { align-self: flex-start; background: var(--them); }
.msg.sys {
  align-self: center;
  border: none;
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  text-align: center;
}

.msg .meta {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 0.04em;
}

/* media + files inside a message */
.msg img, .msg video {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--line);
}
.msg audio { display: block; width: 240px; max-width: 100%; }
.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-card .fname { word-break: break-all; }
.file-card a { color: var(--text); text-decoration: underline; }
.progress {
  height: 2px;
  background: var(--line);
  margin-top: 6px;
  width: 100%;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--live);
  width: 0%;
}

/* ---- composer ---- */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.file-btn {
  border: 1px solid var(--line-strong);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
  flex: none;
  color: var(--muted);
}
.file-btn:hover { color: var(--text); border-color: var(--text); }

#input {
  flex: 1;
  resize: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  max-height: 140px;
}
#input:focus { outline: none; border-color: var(--text); }

.composer .btn { flex: none; align-self: stretch; }

/* ---- drag/drop hint ---- */
.drop-hint {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  border: 2px dashed var(--line-strong);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.06em;
  z-index: 10;
}

/* ---- ended ---- */
#ended {
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}
