:root {
  --turuncu: #ff8a3d;
  --turuncu-koyu: #ff6a00;
  --sari: #ffd166;
  --pembe: #ff6fb5;
  --mor: #b388ff;
  --krem: #fff7ee;
  --metin: #5a3a1a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", system-ui, sans-serif;
  color: var(--metin);
  background: linear-gradient(160deg, #fff0dd 0%, #ffe1ef 60%, #fff7d6 100%);
  overflow: hidden;
}

.ust-bar {
  text-align: center;
  padding: 8px;
  background: linear-gradient(90deg, var(--turuncu), var(--pembe));
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.ust-bar h1 {
  margin: 0;
  color: white;
  font-size: clamp(18px, 3.5vw, 30px);
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
  letter-spacing: 1px;
}

.alan {
  display: flex;
  gap: 12px;
  padding: 12px;
  height: calc(100% - 50px);
}

/* --- Sahne --- */
.sahne-cerceve {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.sahne {
  position: relative;
  aspect-ratio: 3 / 4;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  background: #fff;
  border: 6px solid var(--sari);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  touch-action: none;
}
.arkaplan {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #fde9f3;
}
.parca {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.parca img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.18));
}
.parca.secili .kontrol { display: block; }
.kontrol { display: none; }

.tutamac {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--turuncu);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  touch-action: none;
  cursor: pointer;
}
.t-sil { top: 0; right: 0; border-color: var(--pembe); }
.t-boyut { bottom: 0; right: 0; cursor: nwse-resize; }
.t-dondur { top: -36px; left: 50%; cursor: grab; }
.secim-cercevesi {
  position: absolute; inset: 0;
  border: 2px dashed var(--turuncu);
  border-radius: 8px;
  pointer-events: none;
}

.sahne-araclar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.arac-btn {
  font: inherit;
  font-size: clamp(13px, 2vw, 16px);
  padding: 10px 14px;
  border: none;
  border-radius: 16px;
  background: white;
  color: var(--metin);
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.08s;
}
.arac-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.arac-btn.tehlike { background: #ffe1e1; color: #c0392b; }

/* --- Panel (dolap) --- */
.panel {
  flex: 0 0 38%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.7);
  border: 4px solid var(--turuncu);
  border-radius: 20px;
  padding: 10px;
  overflow: hidden;
}
.sekmeler {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.sekme {
  font: inherit;
  font-size: clamp(12px, 1.6vw, 15px);
  padding: 8px 12px;
  border: none;
  border-radius: 14px;
  background: #fff;
  color: var(--metin);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
.sekme.aktif {
  background: var(--turuncu);
  color: white;
  font-weight: bold;
}
.urunler {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
}
.urun {
  aspect-ratio: 1;
  background: white;
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  transition: transform 0.08s;
}
.urun:active { transform: scale(0.94); }
.urun:hover { border-color: var(--sari); }
.urun img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- Modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal.gizli { display: none; }
.modal-ic {
  background: var(--krem);
  border-radius: 22px;
  padding: 22px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  border: 5px solid var(--sari);
}
.modal-ic h2 { color: var(--turuncu-koyu); margin-top: 0; }
.secim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.secim {
  font: inherit; font-size: 16px; padding: 16px 10px;
  border: none; border-radius: 16px; background: white;
  cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
.secim:active { transform: translateY(2px); }
.kapat {
  font: inherit; padding: 10px 22px; border: none; border-radius: 14px;
  background: var(--pembe); color: white; cursor: pointer; font-size: 15px;
}
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 16px 0; }
.album-oge { position: relative; }
.album-oge img { width: 100%; border-radius: 12px; border: 3px solid var(--sari); }
.album-oge .indir {
  position: absolute; bottom: 6px; right: 6px;
  background: white; border-radius: 10px; padding: 4px 8px;
  font-size: 13px; text-decoration: none; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.album-bos { color: #b08; opacity: 0.7; padding: 20px; }

/* --- Bildirim --- */
.bildirim {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--turuncu); color: white;
  padding: 12px 22px; border-radius: 18px; font-size: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3); z-index: 2000;
  transition: opacity 0.3s;
}
.bildirim.gizli { opacity: 0; pointer-events: none; }

/* --- Dar ekran (tablet dik / telefon): alt alta --- */
@media (max-width: 820px) {
  .alan { flex-direction: column; height: calc(100% - 46px); }
  .sahne-cerceve { flex: 1 1 60%; min-height: 0; }
  .sahne { height: 100%; width: auto; }
  .panel { flex: 0 0 38%; max-width: none; width: 100%; }
  .urunler { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
}
