/* OverlayX Studio — yönetici paneli (OverlayX tasarım sistemiyle aynı belirteçler) */
:root {
  color-scheme: dark;
  --bg: #101114; --bg-2: #17191E; --surface: #1D2026; --surface-2: #23262D;
  --border: #2B2E35; --border-2: #3A3E47;
  --text: #F3F3F1; --text-2: #92959E; --text-3: #6C707A;
  --accent: #C6FF4D; --accent-ink: #101114; --mint: #5CF2C4; --warn: #F5B54A; --danger: #FF8A7A;
  --f-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r-1: 4px; --r-2: 6px; --r-3: 10px;
  --t: 160ms cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font: 500 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.mono { font-family: var(--f-mono); }

/* üst çubuk */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 20px; background: rgba(16,17,20,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 16px/1 var(--f-head); }
.brand b { color: var(--accent); font-weight: 600; }
.ox-word { font: italic 700 17px/1 var(--f-head); letter-spacing: .05em; background: linear-gradient(#ffffff, #b9bac2); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ox-word b { font-weight: 700; background: linear-gradient(135deg, #ecff4a, #9be000); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ox-studio { margin-left: -4px; font: 500 11px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.mode { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.mode .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mode strong { color: var(--text); font-weight: 600; }

/* yerleşim */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto; }
.side-h { margin: 12px 8px 6px; font: 500 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.mod-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.mod-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--text-2); text-align: left; transition: background var(--t), color var(--t); }
.mod-list button:hover { background: var(--bg-2); color: var(--text); }
.mod-list button[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.mod-list small { font: 500 10px/1 var(--f-mono); color: var(--text-3); text-transform: uppercase; }
.view { padding: 28px 32px 120px; min-width: 0; }
.view:focus { outline: none; }

/* başlık */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.head h1 { font-size: 30px; margin-top: 6px; }
.head p { color: var(--text-2); margin-top: 6px; max-width: 60ch; }
.obs { display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.obs-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.obs code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg-2); font: 12px/1.4 var(--f-mono); color: var(--text-2); max-width: 460px; }

/* düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-2); border: 1px solid transparent; font-weight: 600; font-size: 13px; transition: background var(--t), border-color var(--t); white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d4ff73; }
.btn-secondary { border-color: var(--border-2); background: transparent; }
.btn-secondary:hover { border-color: var(--text-2); background: var(--surface); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* modül ekranı */
.mod-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 28px; align-items: start; }
.form { display: grid; gap: 16px; min-width: 0; }
.box { border: 1px solid var(--border); border-radius: var(--r-3); background: var(--bg-2); }
.box > summary, .box-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font: 600 15px/1.2 var(--f-head); cursor: pointer; list-style: none; }
.box > summary::-webkit-details-marker { display: none; }
.box > summary::after { content: "+"; font: 400 18px/1 var(--f-mono); color: var(--text-2); transition: transform var(--t); }
.box[open] > summary::after { transform: rotate(45deg); }
.box-h { cursor: default; }
.box-body { padding: 4px 16px 16px; display: grid; gap: 12px; }
.box-note { color: var(--text-2); font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--text-2); }
.field.changed > span::after { content: " ●"; color: var(--mint); font-size: 10px; }
.input, .select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--bg); transition: border-color var(--t); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); }
.color { display: flex; align-items: center; gap: 8px; }
.color input[type=color] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-2); background: none; cursor: pointer; flex: none; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.color .input { font-family: var(--f-mono); text-transform: uppercase; }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { min-width: 42px; text-align: right; font: 12px var(--f-mono); color: var(--text); }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* tema kartları ve şablonlar */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.theme-card { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--border-2); border-radius: var(--r-3); background: var(--bg); cursor: pointer; text-align: left; transition: border-color var(--t), background var(--t); }
.theme-card:hover { border-color: var(--text-2); }
.theme-card[aria-checked="true"] { border-color: var(--accent); background: rgba(198,255,77,.06); }
.theme-card b { font: 600 15px var(--f-head); }
.theme-card small { color: var(--text-2); font-size: 12.5px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--bg); }
.preset:hover { border-color: var(--text-2); }
.swatches { display: inline-flex; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -4px; }
.swatches i:first-child { margin-left: 0; }

/* görsel yuvaları */
.slot { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.slot-thumb { width: 44px; height: 44px; border-radius: var(--r-2); border: 1px dashed var(--border-2); background: var(--bg) center / contain no-repeat; }
.slot-meta { display: grid; gap: 4px; min-width: 0; }
.slot-meta small { color: var(--text-3); font-size: 12px; }
.slot-actions { display: flex; gap: 6px; }

/* önizleme */
.preview { position: sticky; top: 76px; display: grid; gap: 10px; }
.stage { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--r-3); overflow: hidden; background-color: #0c0d10;
  background-image: linear-gradient(to bottom, transparent 62%, rgba(255,255,255,.035) 62%, rgba(255,255,255,.035) calc(62% + 1px), transparent calc(62% + 1px)), repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 64px); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; color-scheme: normal; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tests { display: flex; flex-wrap: wrap; gap: 6px; }
.trigger { min-height: 34px; padding: 0 11px; border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--surface); font-size: 12.5px; font-weight: 500; }
.trigger:hover { border-color: var(--text-2); }
.hint { color: var(--text-2); font-size: 12.5px; }

/* genel kartlar */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pkg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pkg:last-child { border-bottom: 0; }
.pkg b { font: 600 15px var(--f-head); }
.pkg small { color: var(--text-2); }
.drop { display: grid; place-items: center; gap: 8px; padding: 28px; border: 1px dashed var(--border-2); border-radius: var(--r-3); text-align: center; color: var(--text-2); }
.drop.over { border-color: var(--accent); background: rgba(198,255,77,.05); }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.steps code, .hint code, .box-note code { font: 12px var(--f-mono); color: var(--text); background: var(--surface); padding: 1px 5px; border-radius: 3px; }
.empty { padding: 40px 0; color: var(--text-2); display: grid; gap: 10px; justify-items: start; }

/* kaydet çubuğu ve bildirim */
.savebar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; border: 1px solid var(--border-2); border-radius: var(--r-3); background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.savebar[hidden] { display: none; }
.savebar span { font-size: 13px; }
.savebar-actions { display: flex; gap: 6px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--surface); font-size: 13px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--t), transform var(--t); }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.err { border-color: var(--danger); }

.platform-note { margin: 0; padding: 10px 14px; border: 1px solid rgba(92,242,196,.35); border-left: 3px solid var(--mint); border-radius: var(--r-2); background: rgba(92,242,196,.06); color: var(--text); font-size: 13px; }

/* liste alanı (çark dilimleri, boss listesi, görevler…) */
.list-field { grid-column: 1 / -1; }
.list-rows { display: grid; gap: 8px; }
.list-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg); }
.list-n { align-self: center; min-width: 20px; font: 600 12px var(--f-mono); color: var(--text-3); }
.sub { display: grid; gap: 4px; flex: 1 1 120px; min-width: 0; }
.sub > span { font-size: 11.5px; color: var(--text-3); }
.sub-color, .sub-toggle { flex: 0 0 auto; }
.sub-number { flex: 0 1 90px; }
.sub input[type=color] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-2); background: none; cursor: pointer; }
.sub input[type=checkbox] { width: 18px; height: 38px; accent-color: var(--accent); margin: 0; }
.list-acts { display: flex; gap: 2px; margin-left: auto; }
.list-acts .btn { min-height: 38px; padding: 0 10px; }
.list-del:hover { color: var(--danger); }
.list-field > .btn { justify-self: start; }

.palette-field { grid-column: 1 / -1; }
.pal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pal-item { position: relative; display: inline-flex; }
.pal-item input[type=color] { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-2); background: none; cursor: pointer; }
.pal-item button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border: 1px solid var(--border-2); border-radius: 50%; background: var(--surface); color: var(--text-2); font-size: 12px; line-height: 1; opacity: 0; transition: opacity var(--t); }
.pal-item:hover button, .pal-item:focus-within button { opacity: 1; }
.pal-item button:hover { color: var(--danger); border-color: var(--danger); }
.pal .btn { min-height: 40px; width: 40px; padding: 0; }
@media (hover: none) { .pal-item button { opacity: 1; } }

/* giriş sekmeleri (Klasik / Arena) */
.obs-name { flex: none; min-width: 56px; font: 600 12px var(--f-head); color: var(--text); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--bg); }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 1180px) { .mod-grid { grid-template-columns: minmax(0, 1fr); } .preview { position: static; order: -1; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .view { padding: 20px 16px 120px; }
  .fields, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .mode span.mode-detail { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Topluluk ayar kodu */
#community-box .box-body { display: grid; gap: 12px; }
#community-box textarea { min-height: 64px; padding: 10px 12px; font: 12px/1.5 var(--f-mono); resize: vertical; }
#community-box .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#community-box .field { display: grid; gap: 6px; }
