:root {
  --bg: #08070c;
  --bg-2: #0e0d14;
  --panel: #13121b;
  --panel-2: #1a1824;
  --line: #262335;
  --line-2: #322e45;
  --text: #f3f1f8;
  --muted: #8f89a3;
  --faint: #5d5870;
  --pink: #ff4f8b;
  --red: #ff4757;
  --orange: #ff7a3d;
  --violet: #8b5cf6;
  --green: #22c55e;
  --yellow: #f5b83d;
  --grad: linear-gradient(135deg, #ff4f8b 0%, #ff4757 45%, #ff7a3d 100%);
  --r: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.55 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--red); min-height: 1.4em; font-size: 13px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* --- Ortak bileşenler --- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 9px 16px; border-radius: 11px; font: 600 13.5px Inter, sans-serif; cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: #46405f; background: #211e2e; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 28px -12px rgba(255, 71, 87, .8); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.wide { width: 100%; justify-content: center; padding: 12px; }
.btn.danger { color: #ff8a95; }
.icon-btn { background: none; border: 0; color: var(--text); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--panel-2); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: #4ade80; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .25); }
.pill.run { color: #fbbf24; background: rgba(245, 184, 61, .1); border-color: rgba(245, 184, 61, .25); }
.pill.bad { color: #ff7b88; background: rgba(255, 71, 87, .1); border-color: rgba(255, 71, 87, .25); }
.pill.vio { color: #c4b5fd; background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
input, select, textarea { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(255, 79, 139, .6); outline-offset: 0; border-color: transparent; }
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: #cfcadf; }
label.field small { font-weight: 500; color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 11px; }

/* --- Marka --- */
.wordmark { font-family: Anton, Impact, sans-serif; font-size: 40px; letter-spacing: .04em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark span { font-family: Inter, sans-serif; font-weight: 800; font-size: .32em; letter-spacing: .3em; margin-left: 10px; color: var(--muted); -webkit-text-fill-color: var(--muted); vertical-align: middle; }
.wordmark.sm { font-size: 28px; }

/* --- Giriş --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden; }
.login-art { position: absolute; inset: -20%; background: radial-gradient(40% 40% at 25% 30%, rgba(255, 79, 139, .22), transparent 70%), radial-gradient(35% 35% at 75% 70%, rgba(255, 122, 61, .18), transparent 70%), radial-gradient(30% 30% at 60% 20%, rgba(139, 92, 246, .14), transparent 70%); filter: blur(10px); }
.login-card { position: relative; width: 100%; max-width: 400px; background: rgba(19, 18, 27, .85); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 24px; padding: 40px 32px; text-align: center; box-shadow: var(--shadow); }
.login-card .muted { margin: 10px 0 28px; }
.login-card form { display: grid; gap: 14px; }
.pin { display: flex; justify-content: center; gap: 12px; }
.pin input { width: 62px; height: 70px; text-align: center; font: 700 30px Inter, sans-serif; border-radius: 14px; padding: 0; }

/* --- Yerleşim --- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 14px; }
.side-brand { padding: 0 10px 22px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--pink); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 10px; }
.side-status { display: grid; gap: 6px; font-size: 12px; }
.side-status div { display: flex; justify-content: space-between; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 18px 28px; background: rgba(8, 7, 12, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
#menu { display: none; }
.view { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }
#flash { padding: 0 28px; }
.flash { margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.flash.ok { background: rgba(34, 197, 94, .1); color: #4ade80; border: 1px solid rgba(34, 197, 94, .25); }
.flash.bad { background: rgba(255, 71, 87, .1); color: #ff7b88; border: 1px solid rgba(255, 71, 87, .25); }

/* --- Genel bakış --- */
.stat { padding: 18px 20px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .hint { font-size: 12px; color: var(--faint); margin-top: 2px; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; position: relative; }
.tl:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 34px; bottom: -6px; width: 2px; background: var(--line); }
.tl .bul { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--panel-2); border: 2px solid var(--line-2); color: var(--faint); }
.tl.done .bul { background: rgba(34, 197, 94, .15); border-color: var(--green); color: var(--green); }
.tl.active .bul { border-color: var(--pink); color: var(--pink); animation: pulse 1.2s infinite; }
.tl.fail .bul { border-color: var(--red); color: var(--red); }
.tl b { display: block; font-size: 14px; }
.tl span { font-size: 12.5px; color: var(--muted); }
.countdown { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.conn-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.conn-row:last-child { border-bottom: 0; }

/* --- Şarkı kartları --- */
.songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.song { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; transition: .18s; display: flex; flex-direction: column; }
.song:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.song .thumb { aspect-ratio: 9/12; background: var(--panel-2) center/cover no-repeat; position: relative; }
.song .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .85)); }
.song .thumb .tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 1; }
.song .thumb .score { position: absolute; right: 12px; bottom: 10px; z-index: 1; font: 800 22px Inter; }
.song .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.song .body b { font-size: 15px; }
.song .body span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.slot { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--grad); color: #fff; }
.slot.aksam { background: linear-gradient(135deg, #6d28d9, #a855f7); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 600 13px Inter; cursor: pointer; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* --- Çekmece (şarkı detayı) --- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(980px, 100%); background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; padding: 28px; animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-x { position: absolute; right: 18px; top: 18px; }
.detail-head { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; padding-right: 40px; }
.detail-head img { width: 110px; height: 110px; border-radius: 18px; object-fit: cover; }
.detail-head h2 { font-size: 26px; margin: 6px 0 4px; }
.videos { display: grid; grid-template-columns: 9fr 16fr; gap: 14px; align-items: start; }
.videos video { width: 100%; border-radius: 14px; background: #000; display: block; }
.vph { border-radius: 14px; background: var(--panel); border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.vph.v { aspect-ratio: 9/16; } .vph.h { aspect-ratio: 16/9; }
.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.scenes figure { margin: 0; }
.scenes img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 12px; display: block; }
.scenes figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
pre.lyrics { white-space: pre-wrap; font: 14px/1.75 Inter, sans-serif; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0; max-height: 520px; overflow: auto; }
pre.lyrics .tag { color: var(--pink); font-weight: 700; }
.caption-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; font-size: 13.5px; }
audio { width: 100%; height: 42px; }
.section { margin-top: 26px; }
.section > h3 { margin-bottom: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* --- Laboratuvar --- */
.lab { display: grid; gap: 14px; }
.lab-item { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.lab-item.picked { border-color: rgba(255, 79, 139, .55); box-shadow: inset 0 0 0 1px rgba(255, 79, 139, .3); }
.lab-top { display: flex; gap: 16px; align-items: start; }
.lab-top .big { font: 800 34px Inter; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 70px; text-align: right; }
.gate { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--grad); }
details { margin-top: 12px; }
details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--pink); list-style: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cols h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
ul.clean { margin: 6px 0 0; padding-left: 18px; color: #d6d1e4; font-size: 13.5px; }
ul.clean li { margin: 3px 0; }

/* --- Kural kitabı / rapor --- */
textarea.rules { min-height: 64vh; font: 13.5px/1.65 "JetBrains Mono", monospace; resize: vertical; }
.md h1, .md h2, .md h3 { margin: 18px 0 8px; }
.md h1 { font-size: 20px; } .md h2 { font-size: 16px; color: #fff; } .md h3 { font-size: 14px; color: var(--pink); }
.md p { margin: 6px 0; color: #d6d1e4; }
.md ul { margin: 6px 0; padding-left: 20px; color: #d6d1e4; }
.md li { margin: 3px 0; }
.md strong { color: #fff; }
.artist { padding: 12px 0; border-bottom: 1px solid var(--line); }
.artist:last-child { border: 0; }
.artist b { display: block; margin-bottom: 4px; }
.sources a { display: block; font-size: 12.5px; color: var(--muted); text-decoration: none; padding: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources a:hover { color: var(--text); }

/* --- Tablolar / kayıtlar --- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.logs { font: 12.5px/1.6 "JetBrains Mono", monospace; max-height: 70vh; overflow: auto; }
.logs div { padding: 6px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.logs time { color: var(--faint); }
.logs .hata { color: #ff8a95; }
.logs .uyari { color: #fbbf24; }

/* --- Ayarlar --- */
.settings-group { margin-bottom: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 18px; }
.save-bar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; gap: 12px; align-items: center; }

/* --- Mobil --- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; width: 260px; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  #menu { display: block; }
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 18px; }
  #run-btn { padding: 8px 12px; font-size: 12.5px; }
  .view { padding: 18px 16px 50px; }
  #flash { padding: 0 16px; }
  .g4, .g3, .g2, .cols { grid-template-columns: 1fr 1fr; }
  .videos { grid-template-columns: 1fr; }
  .scenes { grid-template-columns: repeat(2, 1fr); }
  .drawer-panel { padding: 20px 16px; }
  .detail-head { flex-direction: column; align-items: flex-start; }
  .logs div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 520px) {
  .g3, .g2, .cols { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
  .stat .hint { display: none; }
  #view-sub { display: none; }
  .songs { grid-template-columns: 1fr 1fr; gap: 10px; }
  #run-btn span { display: none; }
}
