:root{
  --bg:#1e1b4b;
  --panel:#2a2755;
  --accent:#1070ff;
  --muted:#3a3570;
  --text:#ffffff;
  --card:#111217;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg,var(--bg) 0%, #121026 100%);
  color:var(--text);
}

header {
  position: fixed; /* fixed ile sayfada sabitlenir */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1500; /* diğer elementlerin üstünde */
  padding: 18px 24px; /* üstten boşluk ekli */
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  backdrop-filter: blur(2px);
}

h2{
  top: 0;
  left: 0;
  right: 0;
  padding: 30px 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 30px;
  margin: 0;
}

.dropdown, .fixed-dropdown{
  list-style:none;
  margin:0;
  padding:0;
}
.fixed-dropdown{
  position:fixed;
  top:18px;
  right:18px;
  z-index:1200;
}
.fixed-dropdown > li > button{
  border:0;
  background:var(--accent);
  color:#fff;
  width:44px;
  height:44px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,0.45);
}
.fixed-dropdown > li > button:active{transform:translateY(1px);}
.dropdown-menu{
  position: absolute;
  top:58px;
  right:0;
  background:#121218;
  border-radius:10px;
  padding:8px 6px;
  min-width:160px;
  box-shadow: -6px 8px 18px rgba(0,0,0,0.6);
  transform-origin: top right;
  opacity:0;
  visibility:hidden;
  transform: translateY(-6px) scale(0.98);
  transition:all .18s ease;
  z-index:1300;
}
.fixed-dropdown.open .dropdown-menu{
  opacity:1;
  visibility:visible;
  transform: translateY(0) scale(1);
}
.dropdown-menu a{
  display:block;
  color:#fff;
  padding:10px 12px;
  text-decoration:none;
  border-radius:8px;
  font-size:14px;
}
.dropdown-menu a:hover{background:rgba(255,255,255,0.03);}

.container{
  max-width:1200px;
  margin:28px auto;
  padding:0 24px 40px; /* alt boşluk eklendi */
}

.tabs{
  display:flex;
  gap:12px;
  align-items:center;
  margin:18px 0 8px 0;
}
.tab-btn{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.04);
  background:transparent;
  color:var(--text);
  cursor:pointer;
  transition: all .18s ease;
  font-weight:600;
}
.tab-btn.active{
  background: linear-gradient(90deg,var(--accent), #6e9bff 140%);
  color:#041025;
  box-shadow: 0 6px 18px rgba(16,112,255,0.16);
}

.story-panel{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:14px;
  padding:18px;
  margin-top:12px;
  margin-bottom:40px;
  box-shadow: 0 6px 30px rgba(3,5,18,0.6);
  border:1px solid rgba(255,255,255,0.03);
}

.episodes-list{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:18px;
  margin-top:6px;
}

.ep-card{
  background:var(--panel);
  border-radius:12px;
  padding:12px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  transition: transform .16s ease, box-shadow .16s ease;
  cursor:pointer;
  border:1px solid rgba(255,255,255,0.02);
}
.ep-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(3,5,18,0.6);
}
.ep-badge{
  min-width:44px;
  height:44px;
  border-radius:10px;
  background: linear-gradient(180deg,var(--accent), #6e9bff);
  display:inline-grid;
  place-items:center;
  font-weight:700;
  color:#041025;
  font-size:16px;
  flex-shrink:0;
}
.ep-meta{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.ep-meta h3{
  margin:0;
  font-size:16px;
  letter-spacing:0.2px;
}
.ep-meta p{
  margin:0;
  color: #d6d8df;
  font-size:14px;
  line-height:1.35;
  max-height:40px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Detay panel overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.7); /* koyu arka plan */
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9999; /* üstte olması için */
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ep-detail {
  width: 100%;
  max-width: 900px;
  border-radius: 18px;
  background: linear-gradient(180deg, #0e0f16, #121218);
  padding: 28px;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  position: relative;
  border: 1px solid rgba(255,255,255,0.03);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: all .35s ease;
}

.overlay.open .ep-detail {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ep-detail .close-btn{
  position:absolute;
  right:18px;
  top:14px;
  background:transparent;
  border:0;
  color:#fff;
  font-size:28px;
  cursor:pointer;
}
.ep-detail .ep-header{
  display:flex;
  gap:16px;
  align-items:center;
  margin-bottom:12px;
}
.ep-detail .big-badge{
  width:72px;height:72px;border-radius:14px;
  background: linear-gradient(180deg,var(--accent), #6e9bff);
  display:grid;place-items:center;color:#041025;font-weight:800;font-size:22px;
}
.ep-detail h3{margin:0 0 8px 0;font-size:20px;}
.ep-detail .ep-text{
  color:#d6d8df;
  font-size:15px;
  line-height:1.6;
  max-height:60vh;
  overflow:auto;
  padding-right:6px;
  transform: scale(0.95);
  opacity:0;
  transition: all .35s ease .1s; /* gecikmeli animasyon */
}
.overlay.open .ep-detail .ep-text{
  transform: scale(1);
  opacity:1;
}
.ep-detail .ep-text::-webkit-scrollbar{width:8px;}
.ep-detail .ep-text::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.06);border-radius:6px;}

@media (max-width:820px){
  .episodes-list{grid-template-columns:1fr;}
  header{padding:14px;}
  .container{padding:0 16px;}
  .fixed-dropdown{top:12px; right:12px;}
}
