:root {
  color-scheme: dark;
  --bg: #0D0D0D;
  --bg-elev: rgba(255, 255, 255, 0.04);
  --bg-elev-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f6;
  --muted: #8b93a3;
  --accent: #E30613;
  --accent-2: #A80410;
  --live: #FF2A38;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Canlı yayın sayfası her zaman koyu: video üzerinde beyaz zemin göz yorar. */


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

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

button { font: inherit; color: inherit; cursor: pointer; }

/* Arka plan ışıkları */
.backdrop { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.backdrop span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(120px); opacity: 0.18;
  animation: drift 24s ease-in-out infinite alternate;
}
.backdrop span:nth-child(1) { background: var(--accent); top: -30vmax; left: -20vmax; }
.backdrop span:nth-child(2) { background: var(--accent-2); bottom: -35vmax; right: -25vmax; animation-delay: -12s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* Marka */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px -6px var(--accent);
}
.brand-mark span { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.brand-lg { font-size: 18px; margin-bottom: 28px; }
.brand-lg .brand-mark { width: 36px; height: 36px; border-radius: 11px; }

/* Ortak butonlar */
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px var(--accent-2);
  transition: transform .15s ease, filter .15s ease, opacity .15s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(0.98); }
.primary:disabled { opacity: .6; cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-elev-2); }
.ghost { border: 1px solid var(--border); background: var(--bg-elev); backdrop-filter: blur(12px); }
.lang-toggle { height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; }

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

/* Giriş */
.login { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login .lang-toggle { position: absolute; top: 16px; right: 16px; }
.login-card {
  width: 100%; max-width: 400px; padding: 36px 32px 32px;
  border-radius: 24px; border: 1px solid var(--border);
  background: var(--bg-elev); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.2,.8,.2,1);
}
.login-card h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 24px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; height: 48px; padding: 0 48px 0 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--bg-elev-2); color: var(--text);
  font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.input-wrap .icon-btn { position: absolute; right: 5px; top: 5px; color: var(--muted); }
.error { color: var(--live); font-size: 14px; margin: -4px 0 14px !important; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Uygulama */
.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.streams { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.streams::-webkit-scrollbar { display: none; }
.stream-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev);
  font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.stream-chip:hover { border-color: var(--border-strong); }
.stream-chip[aria-current="true"] { background: var(--bg-elev-2); border-color: var(--accent); }
.stream-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.stream-chip.is-live .dot { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev);
  font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted);
}

.stage-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }

.stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--border);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }

.hud {
  position: absolute; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px; padding: 14px;
  transition: opacity .3s ease, transform .3s ease;
  color: #fff;
}
.hud-top { top: 0; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.hud-bottom { bottom: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent); }
.stage.idle .hud-bottom { opacity: 0; transform: translateY(8px); pointer-events: none; }
.stage.idle { cursor: none; }
.hud .icon-btn:hover { background: rgba(255,255,255,.14); }
.spacer { flex: 1; }
.stream-name { font-weight: 600; font-size: 14px; letter-spacing: .01em; opacity: .9; }
/* Telefonda yer dar: yayın kodu üstteki başlıkta zaten görünüyor. */
@media (max-width: 560px) { .stream-name { display: none; } }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  background: rgba(255,255,255,.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pill.subtle { font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.live-pill { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stage[data-state="live"] .live-pill { background: var(--live); color: #fff; box-shadow: 0 6px 20px -6px var(--live); }
.stage[data-state="live"] .live-pill .dot { background: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }

/* Durum katmanları */
.overlay {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: #fff;
  /* Alt/üst HUD butonlarının altına girmesin diye kenarlarda pay bırakılır. */
  padding: 56px 24px 64px;
  background: radial-gradient(ellipse at center, #10141c 0%, #05070a 75%);
}
.overlay h2 { margin: 18px 0 0; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: -0.01em; }
.overlay p { margin: 0; color: #9aa3b2; font-size: 14px; max-width: 360px; }
.stage[data-state="connecting"] .overlay-connecting,
.stage[data-state="waiting"] .overlay-waiting,
.stage[data-state="unsupported"] .overlay-unsupported { display: flex; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }

.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.overlay-connecting p { margin-top: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.radar { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.radar span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: 0;
  animation: ripple 3s cubic-bezier(.2,.6,.4,1) infinite;
}
.radar span:nth-child(2) { animation-delay: 1s; }
.radar span:nth-child(3) { animation-delay: 2s; }
.radar i { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 24px var(--accent); }
@keyframes ripple { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }

/* Bilgi şeridi */
.meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 16px;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--border);
}
.meta-item { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: color-mix(in srgb, var(--bg) 88%, var(--text) 3%); }
.meta-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.meta-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-value.ok { color: var(--ok); }
.meta-value.live { color: var(--live); }
.meta-value.warn { color: var(--warn); }

/* Bildirim */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  animation: rise .25s ease;
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .streams { order: 3; flex-basis: 100%; }
  .brand-text { font-size: 15px; }
  .stage-wrap { padding: 12px 0 24px; }
  .stage { border-radius: 0; border-left: 0; border-right: 0; }
  .meta { grid-template-columns: repeat(2, 1fr); margin: 12px 16px 0; }
  .login-card { padding: 28px 22px 24px; }
}

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

/* ---- Sekmeler ------------------------------------------------------------ */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-elev);
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--bg-elev-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* ---- Eğitim görünümü ----------------------------------------------------- */
:root {
  /* Grafik paleti (dataviz kategorik 1-4, koyu zemin adımları) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --grid: rgba(255, 255, 255, 0.07);
  --axis: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.03);
  --chart-surface: #0d1015;
}
@media (prefers-color-scheme: light) {
  :root {
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
    --grid: rgba(15, 23, 42, 0.07);
    --axis: rgba(15, 23, 42, 0.18);
    --card: rgba(255, 255, 255, 0.8);
    --chart-surface: #ffffff;
  }
}

.train-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.runs { margin-bottom: 16px; }
.runs:empty { display: none; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

.train-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 64px 24px; }
.train-empty h2 { margin: 18px 0 0; font-size: 20px; }
.train-empty p { margin: 0; max-width: 380px; }

.train-head { padding: 22px 24px; }
.train-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.train-title h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--muted);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.running { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.status-pill.running::before { animation: pulse 1.6s ease-in-out infinite; }
.status-pill.stalled { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.run-info { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.run-info span {
  font-size: 12px; font-family: var(--mono); padding: 3px 9px; border-radius: 7px;
  background: var(--bg-elev-2); color: var(--muted);
}
.run-info b { color: var(--text); font-weight: 600; }
.progress { height: 8px; border-radius: 999px; background: var(--bg-elev-2); overflow: hidden; }
.progress > div {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.progress-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.progress-meta #run-epoch { font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.kpis:empty { display: none; }
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.kpi-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-delta { font-weight: 600; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--warn); }

.charts { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
.chart-card { padding: 16px 16px 10px; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-title { font-weight: 600; font-size: 15px; }
.chart-sub { font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.chart-body { position: relative; }
.chart-body svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: none; stroke-width: 1; }
.chart-body svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); stroke: none; }
.chart-body svg .end-label { fill: var(--text); font-weight: 600; }
.chart-body svg .gridline { stroke: var(--grid); stroke-width: 1; }
.chart-body svg .axisline { stroke: var(--axis); stroke-width: 1; }
.chart-body svg .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-body svg .marker { stroke: var(--chart-surface); stroke-width: 2; }
.chart-body svg .crosshair { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute; z-index: 4; pointer-events: none; min-width: 150px;
  padding: 8px 10px; border-radius: 10px; font-size: 12px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip div { display: flex; align-items: center; gap: 6px; }
.chart-tip div span:last-child { margin-left: auto; padding-left: 12px; font-weight: 600; }
.chart-tip i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); }

.table-card { margin-top: 16px; padding: 0; overflow: hidden; }
.table-card summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14px; }
.table-scroll { overflow: auto; max-height: 420px; border-top: 1px solid var(--border); }
#metric-table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
#metric-table th, #metric-table td { padding: 6px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
#metric-table th { position: sticky; top: 0; background: var(--bg); color: var(--muted); font-weight: 600; }
#metric-table th:first-child, #metric-table td:first-child { text-align: left; }

@media (max-width: 720px) {
  .tabs { order: 2; }
  .train-wrap { padding: 12px 12px 32px; }
  .train-head { padding: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-sub { font-size: 12px; }
  .charts { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Yönetim sayfası ----------------------------------------------------- */
.admin-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.admin-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-wrap h2 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.small { font-size: 13px; }
.field em { font-style: normal; color: var(--muted); opacity: .8; }
.input-wrap input:not([type="password"]) { padding-right: 14px; }

.create-card { padding: 20px; position: sticky; top: 80px; }
.create-card > p { margin: 4px 0 18px; }
.create-card .primary { margin-top: 6px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--border-strong); background: var(--bg-elev-2); color: var(--muted);
}
.segmented button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }

.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 12px; }
.broadcast-list { display: flex; flex-direction: column; gap: 12px; }
.list-empty { padding: 28px; text-align: center; }
.list-empty p { margin: 0; }

.broadcast { padding: 18px 20px; transition: border-color .3s, box-shadow .3s; }
.broadcast.live { border-color: color-mix(in srgb, var(--live) 40%, var(--border)); }
.broadcast.off { opacity: .6; }
.broadcast.flash { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.broadcast-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.broadcast h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.01em; }
.broadcast-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.broadcast-meta .code { font-family: var(--mono); color: var(--text); }

.status-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; flex-shrink: 0;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border: 1px solid var(--border); color: var(--muted);
}
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-badge.live { background: var(--live); border-color: var(--live); color: #fff; }
.status-badge.live .dot { background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.status-badge.waiting { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

.share { margin: 16px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-link {
  flex: 1; min-width: 200px; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg-elev-2); color: var(--text);
  font: 13px var(--mono); outline: none; text-overflow: ellipsis;
}
.share-row.secondary { gap: 6px 16px; font-size: 13px; }
.pw { color: var(--muted); }
.pw b { color: var(--text); font-family: var(--mono); font-weight: 600; margin-left: 4px; }

.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.actions .spacer { flex: 1; }
.act {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg-elev-2); font-size: 14px; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.act:hover { border-color: var(--accent); }
.act svg { width: 16px; height: 16px; }
.act.primary-soft { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.link-btn { border: 0; background: none; padding: 4px 2px; font-size: 13px; color: var(--accent); text-decoration: none; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.danger-text { color: var(--live); }
.mine { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--live); }
.mine .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }

.python-help { margin-top: 16px; padding: 0; overflow: hidden; }
.python-help summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14px; }
.python-help > div { padding: 0 18px 16px; }
.python-help pre { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--bg-elev-2); overflow-x: auto; font: 13px/1.6 var(--mono); }
.python-help code { font-family: var(--mono); }

/* Tarayıcıdan yayın paneli */
.studio {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; padding: 16px; margin-bottom: 20px;
  border-color: color-mix(in srgb, var(--live) 45%, var(--border));
  box-shadow: 0 20px 60px -30px var(--live);
}
.studio-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.studio-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.studio-preview .pill { position: absolute; top: 12px; left: 12px; }
.live-pill.on { background: var(--live); color: #fff; }
.live-pill.on .dot { background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.studio[data-state="reconnecting"] .live-pill.on, .studio[data-state="connecting"] .live-pill.on { background: var(--warn); }
.studio-info { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.studio-title h2 { font-size: 20px; margin-top: 2px; }
.studio-state { font-weight: 600; }
.studio[data-state="live"] .studio-state { color: var(--ok); }
.studio[data-state="reconnecting"] .studio-state { color: var(--warn); }
.studio-stats { font: 13px var(--mono); color: var(--muted); min-height: 1.4em; }
.studio-info p { margin: 4px 0; }
.danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px;
  border: 0; background: var(--live); color: #fff; font-weight: 600; margin-top: 6px;
}
.danger:hover { filter: brightness(1.08); }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .create-card { position: static; }
  .studio { grid-template-columns: minmax(0, 1fr); }
}

/* ---- İzleyici: yayın başlığı, mesaj ekranı, bitti ekranı ------------------- */
.broadcast-title {
  min-width: 0; flex: 1; font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.primary { text-decoration: none; }
.message-card h1 { margin-bottom: 6px; }
.stage[data-state="ended"] .overlay-ended { display: flex; animation: fade .3s ease; }
.stage[data-state="ended"] .live-pill { visibility: hidden; }
input[readonly] { opacity: .75; }
@media (max-width: 720px) {
  .broadcast-title { order: 3; flex-basis: 100%; }
}
