:root {
  --bg: #0b0b0f;
  --surface: #131318;
  --surface-2: #1c1c23;
  --surface-3: #26262f;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #ededf2;
  --muted: #9d9daa;
  --faint: #6e6e7b;
  --accent: #d6393f;
  --accent-hover: #e2464c;
  --accent-text: #ff7a7e;
  --accent-soft: rgba(214, 57, 63, .14);
  --ok: #3dbb7d;
  --warn: #f5a524;
  --glass: rgba(24, 24, 30, .82);
  --radius: 14px;
  --topbar: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.15);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; background: var(--bg); }

/* Gövde kilitli: iOS klavye açılınca sayfanın kendisi kaymasın.
   Yükseklik görünen alandan ölçülür (app.js → --app-height). */
body {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--app-height, 100%);
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button, input, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
input { caret-color: var(--accent-text); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.spacer { flex: 1; }

.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 40px; height: 40px; color: var(--faint); }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- butonlar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 48px; font-size: 16px; }

.send-btn {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  cursor: pointer;
  transition: transform .12s, opacity .15s;
}
.send-btn svg { width: 20px; height: 20px; }
.send-btn:active { transform: scale(.9); }

/* ---------- form ---------- */

input {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: 16px; /* iOS odaklanınca yakınlaştırmasın */
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--faint); }
input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
input:focus-visible { outline: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.opt { color: var(--faint); font-weight: 400; }
.form-error { margin: 0; color: var(--accent-text); font-size: 14px; }

/* ---------- marka ---------- */

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo { width: 28px; height: 28px; flex: none; }

/* ---------- giriş ---------- */

.lobby {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 500px at 50% -15%, rgba(214, 57, 63, .16), transparent 65%),
    var(--bg);
}
.card {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 18px;
  padding: 32px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.card h1 { margin: 6px 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.card .lead { margin: 0; color: var(--muted); font-size: 14px; }
.card .btn-block { margin-top: 4px; }

.install {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 36px 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px; color: var(--muted);
}
.install .ic { margin-top: 1px; color: var(--accent-text); }
.install p { margin: 0; line-height: 1.5; }
.install b { color: var(--text); font-weight: 600; }
.install-close {
  position: absolute; top: 4px; right: 4px;
  width: 30px; height: 30px;
  border: 0; background: none; color: var(--faint);
  font-size: 20px; line-height: 1; cursor: pointer;
}

/* ---------- oda ---------- */

.room { height: 100%; display: flex; flex-direction: column; }

.topbar {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.room-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted); font-size: 13px;
}
.room-chip b { color: var(--text); font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.conn {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 165, 36, .18);
}
.conn.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 187, 125, .18); }

.people { display: flex; align-items: center; }
.avatar {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  margin-left: -8px;
  border: 2px solid var(--surface); border-radius: 50%;
  background: hsl(var(--h, 220) 42% 40%);
  color: #fff; font-size: 12px; font-weight: 600;
}
.avatar:first-child { margin-left: 0; }
.avatar.more { background: var(--surface-3); color: var(--muted); }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }

/* sahne */
.stage {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 20px 24px;
  overflow: auto;
}
.stage-inner {
  /* Video ekrana sığsın: genişlik, kalan yüksekliğe göre 16:9 */
  width: min(100%, calc((var(--app-height, 100vh) - var(--topbar) - 120px) * 16 / 9));
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}
.now { min-height: 46px; display: flex; align-items: center; gap: 12px; }
.now-text { flex: 1; min-width: 0; }
.now-actions { display: none; align-items: center; gap: 10px; flex: none; }
.mini-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.mini-btn svg { width: 18px; height: 18px; }
.mini-btn:active { transform: scale(.92); }
.now-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; overflow-wrap: anywhere; }
.now-meta { margin-top: 2px; color: var(--muted); font-size: 13px; }

/* ---------- oynatıcı ---------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0, 0, 0, .5);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.player video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: #000;
  object-fit: contain;
}
.player video::cue {
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-family: var(--font);
}

.tap-layer { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }

/* çift dokunma ile ±10 sn */
.ripple {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  width: 38%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #fff; font-size: 13px; font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
.ripple svg { width: 34px; height: 34px; }
.ripple.left { left: 0; background: radial-gradient(ellipse at 0% 50%, rgba(255, 255, 255, .16), transparent 70%); }
.ripple.right { right: 0; background: radial-gradient(ellipse at 100% 50%, rgba(255, 255, 255, .16), transparent 70%); }
.ripple.on { opacity: 1; transition: opacity .08s; }

.spinner {
  position: absolute; z-index: 2;
  top: 50%; left: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* kontroller */
.controls {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 26%, transparent 58%, rgba(0, 0, 0, .75));
  pointer-events: none;
  transition: opacity .22s;
}
.player.no-video .controls { display: none; }
.player.ctl-hidden .controls { opacity: 0; }
.player.ctl-hidden .controls * { pointer-events: none !important; }
.player.ctl-hidden { cursor: none; }

.ctl-btn {
  position: relative;
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none; color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color .15s, transform .12s;
}
@media (hover: hover) { .ctl-btn:hover { background: rgba(255, 255, 255, .1); } }
.ctl-btn:active { transform: scale(.9); }
.ctl-btn svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }

.ctl-top {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 0;
  pointer-events: auto;
}
.ctl-title {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.ctl-people { color: rgba(255, 255, 255, .8); font-size: 13px; padding-right: 6px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

.ctl-center {
  display: flex; align-items: center; justify-content: center; gap: clamp(20px, 8vw, 56px);
  pointer-events: none;
}
.ctl-skip, .ctl-play {
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  color: #fff; cursor: pointer;
  pointer-events: auto;
  transition: transform .12s, background-color .15s;
}
.ctl-skip { width: 52px; height: 52px; background: rgba(0, 0, 0, .28); }
.ctl-skip svg { width: 30px; height: 30px; }
.ctl-play { width: 68px; height: 68px; background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ctl-play svg { width: 34px; height: 34px; }
.ctl-skip:active, .ctl-play:active { transform: scale(.9); }
@media (hover: hover) { .ctl-play:hover, .ctl-skip:hover { background: rgba(0, 0, 0, .5); } }

.ctl-bottom { padding: 0 12px 6px; pointer-events: auto; }
.ctl-row { display: flex; align-items: center; gap: 2px; margin-top: -2px; }
.ctl-time {
  padding-left: 4px;
  font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

/* sarma çubuğu */
.seek {
  position: relative;
  height: 30px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
  pointer-events: auto;
}
.seek-track {
  position: relative;
  width: 100%; height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  overflow: hidden;
  transition: height .15s;
}
.seek-buf, .seek-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.seek-buf { background: rgba(255, 255, 255, .35); }
.seek-fill { background: var(--accent); }
.seek-thumb {
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  transition: transform .15s;
}
.seek.active .seek-track { height: 6px; }
.seek.active .seek-thumb { transform: scale(1.35); }
.seek-bubble {
  position: absolute; bottom: 30px; left: 0;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .8);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.badge.dot { position: absolute; top: 6px; right: 6px; min-width: 9px; width: 9px; height: 9px; padding: 0; }

.im-only { display: none !important; }
.ctl-top { visibility: hidden; }

/* ses / altyazı menüsü */
.track-menu {
  position: absolute; z-index: 6;
  right: 12px; bottom: 64px;
  width: 230px; max-height: calc(100% - 80px);
  overflow-y: auto;
  padding: 6px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  animation: pop .18s var(--ease-out);
}
.track-group:not([hidden]) + .track-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.track-head { padding: 6px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.track-opt {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px;
  border: 0; border-radius: 9px;
  background: none; color: var(--text);
  font-size: 14px; text-align: left;
  cursor: pointer;
}
.track-opt:hover { background: rgba(255, 255, 255, .06); }
.track-opt svg { width: 16px; height: 16px; color: var(--accent-text); visibility: hidden; }
.track-opt[aria-checked="true"] { font-weight: 600; }
.track-opt[aria-checked="true"] svg { visibility: visible; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* tam ekranda sohbet: yazarken video klavyenin üstünde küçülür */
.im-chat {
  position: absolute; z-index: 4;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s, transform .2s var(--ease-out);
}
.player.composing .im-chat { opacity: 1; pointer-events: auto; transform: none; }
.player.composing .controls { opacity: 0; pointer-events: none; }
.player.composing .controls * { pointer-events: none !important; }
.player.composing video { height: calc(100% - 56px); }

.im-log {
  max-height: min(40vh, 220px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px);
  mask-image: linear-gradient(to bottom, transparent, #000 24px);
}
.im-line {
  align-self: flex-start;
  max-width: min(70%, 460px);
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.im-line b { margin-right: 6px; font-weight: 600; color: hsl(var(--h, 220) 70% 74%); }
.im-line.me { align-self: flex-end; background: rgba(214, 57, 63, .8); }
.im-line.me b { display: none; }

.im-composer {
  display: flex; gap: 8px; align-items: center;
  height: 48px;
}
.im-composer input {
  height: 42px; border-radius: 21px;
  background: rgba(30, 30, 38, .85);
  border-color: var(--line-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.im-composer .send-btn { width: 42px; height: 42px; }

/* katılma / boş ekran */
.overlay { position: absolute; inset: 0; }
.empty {
  z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; text-align: center;
  color: var(--muted);
  background: radial-gradient(circle at 50% 45%, #18181e, #000 75%);
}
.empty p { margin: 0; }
.sync {
  z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 0;
  background: rgba(0, 0, 0, .62);
  color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.sync-circle {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 10px 34px rgba(214, 57, 63, .5);
  transition: transform .15s;
}
.sync:active .sync-circle { transform: scale(.92); }
.sync-circle svg { width: 30px; height: 30px; margin-left: 3px; }

/* ---------- tam ekran (yatay telefon / tam ekran düğmesi) ---------- */

.room.immersive .player {
  position: fixed; z-index: 30;
  left: 0; top: 0;
  width: 100%; height: var(--app-height, 100%);
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}
.player:fullscreen { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }
.room.immersive .im-only { display: grid !important; }
.room.immersive .ctl-top { visibility: visible; }
.room.immersive .ctl-top {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
}
.room.immersive .ctl-bottom {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.room.immersive .track-menu { right: max(12px, env(safe-area-inset-right)); }

/* ---------- üstten düşen bildirimler ---------- */

.banners {
  position: fixed; z-index: 60;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 50%;
  width: min(440px, calc(100% - 20px));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.banner {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px 10px 10px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  color: var(--text); text-align: left;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  animation: drop-in .34s var(--ease-spring);
}
.banner .avatar { width: 36px; height: 36px; margin: 0; border: 0; font-size: 13px; }
.banner-body { flex: 1; min-width: 0; }
.banner-name { font-size: 13px; font-weight: 600; }
.banner-text {
  font-size: 14px; line-height: 1.35;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.banner-hint { color: var(--faint); font-size: 11px; white-space: nowrap; align-self: flex-start; padding-top: 2px; }
.banner.note {
  width: auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  cursor: default;
}
.banner.out { animation: fly-out .22s var(--ease-out) forwards; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-120%); } }
@keyframes fly-out { to { opacity: 0; transform: translateY(-120%); } }

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

.panel {
  min-height: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.tabs { flex: none; display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* sohbet */
.messages {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 85%; }
.msg.cont { margin-top: -7px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg-name { padding: 0 4px; font-size: 12px; font-weight: 600; color: hsl(var(--h, 220) 70% 72%); }
.bubble {
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 18px 18px 18px 6px;
  font-size: 15px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.msg.me .bubble { background: var(--accent); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg.cont .bubble { border-top-left-radius: 6px; }
.msg.me.cont .bubble { border-top-left-radius: 18px; border-top-right-radius: 6px; }
.msg.new { animation: msg-in .22s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.note { align-self: center; max-width: 90%; color: var(--faint); font-size: 12px; text-align: center; }

.chat-form {
  flex: none;
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px;
  padding-bottom: max(10px, calc(env(safe-area-inset-bottom) - 12px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
:root[data-kb="open"] .chat-form { padding-bottom: 8px; }
.chat-form input { height: 40px; border-radius: 20px; background: var(--surface-2); border-color: transparent; }

/* videolar */
.videos { gap: 14px; padding: 16px; overflow-y: auto; }
.videos-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.video-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.video-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: 12px;
  color: var(--text); text-align: left;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.video-item:hover { border-color: var(--line-strong); }
.video-item.active { background: var(--accent-soft); border-color: rgba(214, 57, 63, .5); cursor: default; }
.video-thumb {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--surface-3); color: var(--muted);
}
.video-thumb svg { width: 20px; height: 20px; }
.video-item.active .video-thumb { background: var(--accent); color: #fff; }
.vtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vname { font-size: 14px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.vmeta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.vlive { flex: none; color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.empty-list {
  padding: 28px 12px;
  border: 1px dashed var(--line-strong); border-radius: 12px;
  color: var(--muted); font-size: 14px; text-align: center;
}
.help { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.55; }

.uploads:empty { display: none; }
.uploads { display: flex; flex-direction: column; gap: 10px; }
.upload-row { font-size: 13px; }
.upload-row .uname { display: flex; justify-content: space-between; gap: 12px; }
.upload-row .uname span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .uname span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-row .bar { height: 4px; margin-top: 6px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.upload-row .bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.upload-row.error, .upload-row.error .uname span:last-child { color: var(--accent-text); }

/* kısa bildirim */
.toast {
  position: fixed; z-index: 70;
  left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--text); color: var(--bg);
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}

/* ---------- telefon (dikey) ---------- */

@media (max-width: 900px) {
  :root { --topbar: 52px; }
  .topbar { gap: 8px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .brand-name, .room-label { display: none; }

  .layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .stage { padding: 0; overflow: visible; justify-content: flex-start; }
  .stage-inner { width: 100%; gap: 0; }
  .player { border-radius: 0; box-shadow: none; }
  .now { min-height: 0; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .now-title { font-size: 15px; }
  .panel { border-left: 0; }

  /* Yazma çubuğu: büyük dokunma alanı */
  .chat-form { padding-top: 10px; min-height: 64px; }
  .chat-form input { height: 44px; border-radius: 22px; }
  .chat-form .send-btn { width: 44px; height: 44px; }

  /* Klavye açıkken sohbete yer aç: video kalır, başlık ve sekmeler gizlenir */
  :root[data-kb="open"] .now,
  :root[data-kb="open"] .tabs { display: none; }
  :root[data-kb="open"] .messages { padding-top: 10px; padding-bottom: 6px; }
}

/* Dikey telefonda üst bar yok: video en üstten başlar (durum çubuğunun altı siyah),
   oda/kişiler/davet videonun altındaki satırda. */
@media (max-width: 900px) and (orientation: portrait) {
  .topbar { display: none; }
  .stage { padding-top: env(safe-area-inset-top); background: #000; }
  .now-actions { display: flex; }
  .now-actions .avatar { width: 28px; height: 28px; font-size: 11px; border-color: var(--surface); }
}

@media (max-width: 380px) {
  #inviteBtn span { display: none; }
  #inviteBtn { width: 34px; padding: 0; }
}

/* Telefon yan çevrildi ama tam ekran kapalı: video solda, panel sağda */
@media (orientation: landscape) and (max-height: 520px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: none; }
  .stage { padding: 8px; justify-content: center; }
  .stage-inner { width: min(100%, calc((var(--app-height, 100vh) - var(--topbar) - 16px) * 16 / 9)); }
  .player { border-radius: 10px; }
  .now { display: none; }
  .panel { border-left: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
