/* ============================================================
   Stüdyo — oyunla aynı görsel dil (şeker/pastel)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #4b3f8f;
  --ink-soft: #8579c9;
  --line: #e9e4fb;
  --accent: #7a5cf0;
  --green: #2fae7d;
  --green-dark: #1d8a60;
  --shadow: 0 10px 26px rgba(75, 63, 143, 0.12);
}

body {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold",
               -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(70vw 40vh at 10% -5%, #ffe9c9 0%, rgba(255,233,201,0) 60%),
    radial-gradient(70vw 45vh at 105% 0%, #ffd9ea 0%, rgba(255,217,234,0) 55%),
    linear-gradient(170deg, #eef3ff 0%, #f3eeff 60%, #fdeef6 100%);
  background-attachment: fixed;
}

/* ---------- üst çubuk ---------- */
.st-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 32px);
  background: linear-gradient(120deg, #7a5cf0, #a55eea 60%, #f75f92);
  color: #fff;
  box-shadow: 0 6px 20px rgba(122, 92, 240, 0.35);
}

.st-brand { display: flex; align-items: center; gap: 12px; }

.st-logo {
  font-size: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 8px 10px;
}

.st-brand h1 { font-size: 24px; font-weight: 900; letter-spacing: 0.5px; }
.st-brand p { font-size: 13px; opacity: 0.85; }

.st-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.35);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s;
}

.st-back:hover { background: rgba(255,255,255,0.3); }

/* ---------- düzen ---------- */
.st-main {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 26px);
  display: grid;
  grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: clamp(14px, 2.5vw, 24px);
  align-items: start;
}

@media (max-width: 780px) {
  .st-main { grid-template-columns: 1fr; }
}

.st-panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 24px;
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.st-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 16px;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8a6cf5, #6a4de0);
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(122, 92, 240, 0.4);
}

.st-panel h3 { font-size: 16px; font-weight: 900; margin-bottom: 10px; }

/* ---------- kategori sekmeleri ---------- */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.cat-tab {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-tab:hover { border-color: #cabffa; }

.cat-tab.active {
  background: linear-gradient(180deg, #8a6cf5, #6a4de0);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(122, 92, 240, 0.4);
}

/* ---------- öğe listesi ---------- */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.item-list::-webkit-scrollbar { width: 8px; }
.item-list::-webkit-scrollbar-thumb { background: #d8d0f5; border-radius: 8px; }

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f7f4ff;
  cursor: pointer;
  transition: all 0.13s;
}

.item-row:hover { background: #efe9ff; transform: translateX(2px); }

.item-row.selected {
  border-color: var(--accent);
  background: #efe9ff;
  box-shadow: 0 3px 10px rgba(122, 92, 240, 0.18);
}

.item-row .row-emoji { font-size: 26px; width: 38px; text-align: center; }

.item-row .row-thumb {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.item-row .row-name { flex: 1; font-weight: 800; font-size: 15px; }

.item-row.removed { opacity: 0.45; }
.item-row.removed .row-name { text-decoration: line-through; }

.row-removed-tag {
  font-size: 11px;
  font-weight: 800;
  color: #d64545;
  background: #fdeaea;
  padding: 3px 8px;
  border-radius: 999px;
}

.danger-btn.restore {
  color: var(--green-dark);
  border-color: #bfe9d8;
}

.danger-btn.restore:hover { background: #eafaf3; }
.item-row .badge { font-size: 15px; opacity: 0.18; }
.item-row .badge.on { opacity: 1; }
.item-row .row-quiet { font-size: 14px; }

/* ---------- yeni öğe formu ---------- */
.new-item-form {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f6f2ff, #efe9ff);
  border: 1.5px dashed #c9bcf5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-item-form h3 { margin-bottom: 2px; color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; }

.new-item-form input[type="text"] {
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.new-item-form input[type="text"]:focus { border-color: var(--accent); }
.new-item-form input::placeholder { color: #b3a9df; font-weight: 500; }

/* ---------- işaret satırı ---------- */
.flag-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.45;
}

.flag-row input {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.flag-row small { color: var(--ink-soft); font-weight: 500; }

.flag-row.boxed {
  background: #fff8ec;
  border: 1.5px solid #f5dfb8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

/* ---------- düzenleme blokları ---------- */
.edit-block {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 18px;
  background: #faf8ff;
  border: 1px solid var(--line);
}

.current-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 44px;
  flex-wrap: wrap;
}

.current-row img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--line);
  box-shadow: 0 3px 8px rgba(75, 63, 143, 0.08);
}

.current-row .cur-emoji { font-size: 52px; }
.current-row .muted { color: #a49bd4; font-size: 13.5px; font-weight: 600; }

/* ---------- butonlar ---------- */
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #8a6cf5, #6a4de0);
  color: #fff;
  padding: 11px 20px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 0 #5438c9, 0 6px 14px rgba(122, 92, 240, 0.3);
  transition: transform 0.12s;
}

.file-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5438c9; }
.file-btn input { display: none; }
.fb-icon { font-size: 17px; }

.save-btn, .preview-btn, .danger-btn {
  border: none;
  border-radius: 14px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s;
}

.save-btn {
  background: linear-gradient(180deg, #3ecf8e, var(--green));
  color: #fff;
  box-shadow: 0 4px 0 var(--green-dark), 0 6px 14px rgba(47, 174, 125, 0.3);
}

.save-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-dark); }
.save-btn:disabled { background: #bfe9d8; box-shadow: none; cursor: default; }

.preview-btn {
  background: linear-gradient(180deg, #ffdf6b, #ffbe3d);
  color: #6b4a00;
  box-shadow: 0 4px 0 #e09a1f, 0 6px 14px rgba(255, 190, 61, 0.35);
}

.preview-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e09a1f; }

.danger-btn {
  background: #fff;
  color: #d64545;
  border: 2px solid #f6caca;
}

.danger-btn:hover { background: #fdeeee; }

.del-btn, .play-btn {
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.play-btn { background: #ece7fd; color: var(--ink); }
.play-btn:hover { background: #e0d8fb; }
.del-btn { background: #fdeaea; color: #d64545; }
.del-btn:hover { background: #fbdcdc; }

.hint { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin: 12px 0 10px; }

/* ---------- resim kırpma ---------- */
#crop-canvas {
  width: 100%;
  max-width: 340px;
  display: block;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: repeating-conic-gradient(#eceaf4 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  touch-action: none;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(75, 63, 143, 0.1);
}

#crop-canvas:active { cursor: grabbing; }

.zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  margin: 12px 0;
  font-size: 18px;
}

/* ---------- youtube satırı ---------- */
.yt-row { display: flex; gap: 8px; margin-top: 12px; }

.yt-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.yt-row input:focus { border-color: var(--accent); }
.yt-row input::placeholder { color: #b3a9df; font-weight: 500; }
.yt-row button { white-space: nowrap; }
.yt-row button:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ---------- ses kesme ---------- */
#wave-canvas {
  width: 100%;
  display: block;
  border-radius: 14px;
  background: linear-gradient(180deg, #241f3d, #1a1630);
  margin-bottom: 12px;
  border: 2px solid #35305a;
}

.trim-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

.trim-row label { display: flex; align-items: center; gap: 10px; }

.trim-tag {
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  width: 86px;
  text-align: center;
}

.trim-tag.start { background: #e2f7ee; color: var(--green-dark); }
.trim-tag.end   { background: #fdeaea; color: #d64545; }

.trim-info { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- kaydırıcılar ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9d0f7, #cabffa);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #f0ecff);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(75, 63, 143, 0.3);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}

/* ---------- durum bildirimi (toast) ---------- */
.status-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(75, 63, 143, 0.4);
  transition: transform 0.25s ease;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}

.status-msg:not(:empty) { transform: translateX(-50%) translateY(0); }
.status-msg.err { background: #d64545; }
