:root {
  --bg: #0b0e14;
  --bg-soft: #131824;
  --bg-lift: #1a2130;
  --line: #26304200;
  --border: #263042;
  --text: #e6ecf5;
  --text-dim: #8d9bb3;
  --accent: #f4576b;
  --accent-2: #3fb950;
  --danger: #ff5470;
  --warn: #ffb020;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- lobby -- */

.lobby-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(244, 87, 107, .22), transparent 60%),
    radial-gradient(800px 500px at 95% 110%, rgba(63, 185, 80, .16), transparent 60%),
    var(--bg);
  padding: 32px 16px;
}

.lobby { width: 100%; max-width: 560px; }

.lobby__head { margin-bottom: 24px; }

.brand { display: flex; align-items: center; gap: 10px; }

.brand__dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(244, 87, 107, .8);
}

.brand__name { font-weight: 700; letter-spacing: -.02em; font-size: 19px; }
.brand__logo { height: 40px; width: auto; max-width: 100%; display: block; }
.topbar__logo { height: 20px; width: auto; flex-shrink: 0; }

.lobby__tagline { color: var(--text-dim); margin: 10px 0 0; font-size: 15px; }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field small { font-size: 11.5px; color: var(--text-dim); }

input[type="text"], select {
  background: var(--bg-lift);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
}

input[type="text"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 87, 107, .18);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }
.btn--lg { padding: 14px; font-size: 15px; }
.btn--sm { padding: 7px 11px; font-size: 12.5px; }

.status {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  background: rgba(255, 84, 112, .12);
  border: 1px solid rgba(255, 84, 112, .35);
  color: #ffb3c0;
  white-space: pre-wrap;
}
.status--info {
  background: rgba(244, 87, 107, .12);
  border-color: rgba(244, 87, 107, .35);
  color: #cfc2ff;
}

.health { margin-top: 22px; }
.health h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0 0 10px; }
.health ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.health li { font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.ok { color: var(--accent-2); }
.bad { color: var(--danger); }

/* ----------------------------------------------------------------- room -- */

.room-body {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: 56px 1fr 76px;
  grid-template-areas:
    "top    top"
    "stage  panel"
    "ctl    panel";
  overflow: hidden;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  gap: 12px;
}

.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }

.pill {
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-lift);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.pill--rec { color: var(--danger); border-color: rgba(255, 84, 112, .4); animation: blink 1.6s infinite; }
.pill--muted { text-transform: uppercase; letter-spacing: .06em; }

@keyframes blink { 50% { opacity: .35; } }

.inline-field { display: flex; align-items: center; gap: 6px; }
.inline-field select { width: auto; padding: 6px 8px; font-size: 12.5px; border-radius: 8px; }

.stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  gap: 12px;
}

.videos {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  align-content: center;
}

.video-tile {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 160px;
}
.video-tile--speaking { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(63, 185, 80, .35); }
.video-tile__mount { position: absolute; inset: 0; }
.video-tile__mount .OT_widget-container { border-radius: 12px; }

.video-tile__label {
  position: absolute;
  left: 10px; bottom: 10px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Canli altyazi seridi */
.caption-bar {
  flex: 0 0 auto;
  min-height: 92px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-lift));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.caption-bar__empty { color: var(--text-dim); font-size: 13.5px; text-align: center; }

.caption-bar__line { font-size: 21px; line-height: 1.35; font-weight: 500; }
.caption-bar__speaker { color: var(--accent-2); font-weight: 700; margin-right: 8px; }
.caption-bar__text.is-partial { opacity: .68; }

.caption-bar__source {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

/* ---------------------------------------------------------------- panel -- */

.panel {
  grid-area: panel;
  border-left: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel__tabs { display: flex; border-bottom: 1px solid var(--border); }

.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 13px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.panel__body { flex: 1; min-height: 0; position: relative; }

.tabview { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.tabview.is-active { display: flex; }

.transcript, .chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry {
  background: var(--bg-lift);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
}
.entry__head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.entry__speaker { color: var(--accent-2); font-weight: 700; }
.entry__text { font-size: 13.5px; line-height: 1.45; }
.entry__original {
  font-size: 11.5px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--border);
}

.transcript__actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.people { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; overflow-y: auto; }
.person {
  background: var(--bg-lift);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}
.person__name { font-size: 13.5px; font-weight: 600; }
.person__langs { font-size: 11.5px; color: var(--text-dim); }

.chat__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat__form input { flex: 1; }
.chat-msg { font-size: 13px; }
.chat-msg b { color: var(--accent); }

/* ------------------------------------------------------------- controls -- */

.controls {
  grid-area: ctl;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.ctl {
  background: var(--bg-lift);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 8px 14px;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 78px;
  transition: background .15s, border-color .15s;
}
.ctl span { font-size: 10.5px; color: var(--text-dim); }
.ctl:hover { border-color: var(--accent); }
.ctl.is-off { background: rgba(255, 84, 112, .14); border-color: rgba(255, 84, 112, .45); }
.ctl.is-on  { background: rgba(63, 185, 80, .14); border-color: rgba(63, 185, 80, .45); }
.ctl--danger { background: rgba(255, 84, 112, .18); border-color: rgba(255, 84, 112, .45); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: var(--bg-lift);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 50;
  max-width: 70vw;
}

@media (max-width: 900px) {
  .room-body {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 220px 76px;
    grid-template-areas: "top" "stage" "panel" "ctl";
  }
  .panel { border-left: none; border-top: 1px solid var(--border); }
  .field-row { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ tercüman -- */

.interp {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
  flex-wrap: wrap;
}

.interp__state { color: var(--text-dim); }
.interp__state--on { color: var(--accent-2); font-weight: 600; }

.interp__mix {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-dim);
}

.interp__mix input[type="range"] {
  width: 130px;
  accent-color: var(--accent);
}

/* ------------------------------------------------------------ mikrofon -- */

.mic-warning {
  grid-area: top;
  align-self: end;
  justify-self: center;
  position: relative;
  z-index: 30;
  transform: translateY(100%);
  background: rgba(255, 176, 32, .14);
  border: 1px solid rgba(255, 176, 32, .5);
  color: #ffd28a;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  max-width: 620px;
  line-height: 1.45;
}

.mic-level {
  display: inline-block;
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .2);
  overflow: hidden;
}

.mic-level i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-2);
  transition: width .1s linear;
}

/* ------------------------------------------------------------ cihaz seçimi */

.device {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-lift);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 15px;
}
.device select {
  width: auto;
  max-width: 130px;
  padding: 3px 6px;
  font-size: 11.5px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-dim);
}
.device select:focus { box-shadow: none; color: var(--text); }
.device select:disabled { opacity: .45; }
