@font-face { font-family: "Inter"; font-weight: 100 900; src: url(/p/engine/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Inter"; font-weight: 100 900; src: url(/p/engine/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Poppins"; font-weight: 600; src: url(/p/engine/fonts/Poppins-SemiBold.ttf) format("truetype"); }

:root {
  color-scheme: dark;
  --bg: #08090e; --bg2: #0c0d14; --surface: #11131c; --surface2: #161826; --surface3: #1c1f30;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.15);
  --text: #f2f3f8; --muted: #a2a7bb; --dim: #70758a;
  --a1: #8b5cf6; --a2: #22d3ee; --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Poppins", "Inter", sans-serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.grad { background: linear-gradient(90deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
[hidden] { display: none !important; }

/* düğmeler ve alanlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line2); background: var(--surface2); cursor: pointer; font-weight: 600;
  white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--surface3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border: 0; background: linear-gradient(90deg, var(--a1), #5b8def 60%, var(--a2)); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 32px; height: 32px; padding: 0; }
.btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px;
  color: var(--text); font-size: 14px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--a1); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input[type=color] { padding: 2px; height: 38px; width: 52px; }
input[type=range] { padding: 0; border: 0; box-shadow: none; accent-color: var(--a1); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface3); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface3); color: var(--muted); border: 1px solid var(--line); }
.chip.ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.chip.warn { color: var(--warn); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.chip.ai { color: #c4b5fd; border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.1); }

/* giriş */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(800px 500px at 20% 0%, rgba(139,92,246,.18), transparent), radial-gradient(700px 500px at 100% 100%, rgba(34,211,238,.1), transparent), var(--bg); }
.login { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; }
.login h1 { margin-top: 26px; }
.login p { margin: 6px 0 22px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--bad); background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.logo-s { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--a1), var(--a2));
  display: grid; place-items: center; font-family: "Poppins"; font-weight: 600; color: #fff; font-size: 18px; flex: none; }
.login-brand, .brand { display: flex; align-items: center; gap: 10px; font-family: "Poppins"; font-size: 17px; }
.login-brand span, .brand span { font-weight: 300; color: var(--muted); }

/* üst çubuk */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 20px;
  background: rgba(8,9,14,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.top nav a:hover { color: var(--text); }
.top nav a.on { color: var(--text); background: var(--surface2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.jobpill { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--surface2);
  border: 1px solid rgba(139,92,246,.4); font-size: 12.5px; font-weight: 600; }
.jobpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 10px var(--a2); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

main { padding: 24px 20px 60px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .row { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 18px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* bölüm listesi */
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ep { overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; }
.ep:hover { border-color: var(--line2); transform: translateY(-2px); }
.ep .thumb { aspect-ratio: 9 / 12; background: var(--bg2) center / cover no-repeat; display: grid; place-items: center; color: var(--dim);
  border-bottom: 1px solid var(--line); }
.ep .thumb.h { aspect-ratio: 16 / 10; }
.ep .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.ep .t { font-weight: 600; line-height: 1.3; }
.ep .chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* düzenleyici */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 92px); overflow: auto; }
.settings { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.settings .full { grid-column: 1 / -1; }
.scenes { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.scene { overflow: hidden; }
.scene-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; cursor: pointer; user-select: none; }
.scene-h .n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface3); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.scene-h .ty { font-weight: 600; }
.scene-h .say { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.scene-h .tools { display: flex; gap: 4px; }
.scene-b { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.scene.collapsed .scene-b { display: none; }
.help { font-size: 12.5px; color: var(--dim); margin: -4px 0 0; }
.say-box textarea { min-height: 84px; }
.sublist { display: flex; flex-direction: column; gap: 8px; }
.subitem { display: grid; gap: 8px; align-items: end; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.addrow { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.savebar { position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: rgba(22,24,38,.92); backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: 14px; }
.savebar .st { color: var(--muted); font-size: 13px; }
.savebar .st.dirty { color: var(--warn); }
.errs { color: var(--bad); font-size: 13px; margin: 0; padding-left: 18px; }
.json-edit { width: 100%; min-height: 60vh; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }

/* sağ panel */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tabs button { border: 0; background: none; padding: 12px 10px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--a1); }
.tabbody { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.viewer { position: relative; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.viewer.v { aspect-ratio: 9 / 16; max-height: 62vh; margin: 0 auto; width: 100%; }
.viewer.h { aspect-ratio: 16 / 9; }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer video { width: 100%; height: 100%; display: block; background: #000; }
.viewer .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--dim); padding: 20px; }
.ctrl { display: flex; align-items: center; gap: 10px; }
.ctrl input[type=range] { flex: 1; }
.ctrl .tm { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; min-width: 84px; text-align: right; }
.prog { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .4s; }
.job { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.job .row { font-size: 13px; }
.log { max-height: 160px; overflow: auto; font: 11.5px/1.5 ui-monospace, Consolas, monospace; color: var(--muted); white-space: pre-wrap; margin: 0; }
.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.frames a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.frames img { width: 100%; display: block; }
.frames.h { grid-template-columns: 1fr 1fr; }
.out { display: flex; flex-direction: column; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font-size: 15px; }
.stat span { font-size: 11.5px; color: var(--dim); }
.note { font-size: 12.5px; color: var(--warn); background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.25); border-radius: 9px; padding: 8px 10px; }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line2);
  border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal .row.end { justify-content: flex-end; }

/* işler / müzik listeleri */
.list { display: flex; flex-direction: column; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list .it:last-child { border-bottom: 0; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 12px;
  background: var(--surface3); border: 1px solid var(--line2); box-shadow: 0 14px 40px rgba(0,0,0,.5); font-weight: 500; max-width: calc(100vw - 32px); }
.toast.bad { border-color: rgba(248,113,113,.5); color: #fecaca; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--a2); animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  main { padding: 16px 16px 60px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand > div:last-child { display: none; }
  .top nav a { padding: 7px 8px; }
  .settings, .grid2 { grid-template-columns: 1fr; }
  .eps { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats { grid-template-columns: 1fr 1fr; }
}
