/* Kontroller ve paylaşılan parçalar */

/* Düğmeler: birincil beyaz hap (ters çevirme), diğerleri gri tonlar. Kırmızı yalnızca kayıt düğmesinde. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-height); padding: 0 16px;
  border: 0; border-radius: var(--radius-control);
  background: var(--control); color: var(--text);
  font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background .15s, transform .1s var(--ease), opacity .15s;
}
.btn:hover { background: var(--control-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--text); color: var(--inverse); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 88%, var(--ground)); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--raised); color: var(--text); }
.btn-rec { background: var(--tally); color: #fff; }
.btn-rec:hover { background: var(--tally-hover); }
.btn-danger { background: var(--tally); color: #fff; }
.btn-danger:hover { background: var(--tally-hover); }
.btn-icon { width: 34px; padding: 0; }
.btn .icon, .btn-text .icon, .menu-item .icon { width: 18px; height: 18px; flex: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn-text { background: none; border: 0; padding: 0; color: var(--faint); font-size: 12px; }
.btn-text:hover { color: var(--text); }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; }
.link:hover { color: var(--text); }

/* Alanlar */
.input {
  width: 100%; height: 40px; padding: 0 14px;
  background: var(--raised); border: 1px solid transparent; border-radius: 10px;
  outline: none; transition: border-color .15s, background .15s;
}
.input:hover { background: var(--control); }
.input:focus { border-color: var(--faint); }
.input::placeholder { color: var(--faint); }
select.input {
  appearance: none; padding-right: 30px;
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b4b4b4' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.input-code { height: 52px; font-size: 26px; font-weight: 600; letter-spacing: .35em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--fs-small); color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--text); }
kbd { font: 600 11px var(--font); padding: 2px 6px; border-radius: 6px; background: rgba(127, 127, 127, .28); }

/* Yüzeyler: kenarlık ve gölge yok, bir ton yukarı */
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); }
.empty { padding: 28px; border-radius: var(--radius-card); background: var(--surface); color: var(--muted); }
.empty a:not(.btn) { color: var(--text); text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--radius-control); background: var(--raised); font-size: 13px; font-weight: 500; }
.chip button { background: none; border: 0; padding: 0 0 0 2px; color: var(--faint); font-size: 16px; line-height: 1; }
.chip button:hover { color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ok { color: var(--positive); font-size: 13px; font-weight: 500; }

.avatar {
  width: var(--s); height: var(--s); flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c); color: #000; font-weight: 600; font-size: calc(var(--s) * .42);
}
.score { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Sahne kartları: büyük kapak görseli, metin altta */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 18px; }
.scene-grid.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px 14px; }
.scene { display: grid; gap: 6px; align-content: start; cursor: pointer; outline-offset: 6px; border-radius: var(--radius-media); }
.scene-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-media); background: var(--surface); }
.scene-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.scene:hover .scene-img img { transform: scale(1.04); }
.scene.is-selected .scene-img { outline: 3px solid var(--text); outline-offset: -3px; }
.scene-dur, .scene-adult { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .78); }
.scene-dur { right: 8px; }
.scene-adult { left: 8px; }
.scene-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-top: 6px; }
.scene-meta { font-size: var(--fs-small); color: var(--faint); }
.scene-actions { display: flex; gap: 4px; margin-top: 6px; }

/* Video ekranı */
.screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); container-type: inline-size; }

.screen .shield { position: absolute; inset: 0; z-index: 2; }
/* Kapak görseli: ilk oynatmaya kadar videonun üstünde, sonra kaybolur */
.screen .poster { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: opacity .3s; }
.screen.has-played .poster { opacity: 0; }

.overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.countdown { font-size: clamp(40px, 15cqi, 140px); font-weight: 600; letter-spacing: -0.05em; color: #fff; font-variant-numeric: tabular-nums; animation: tick .6s var(--ease); }
@keyframes tick { from { transform: scale(1.25); opacity: 0; } }
.tally { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: var(--radius-control); background: var(--tally); color: #fff; font-weight: 600; font-size: 14px; }
.tally::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.subtitle { position: absolute; left: 50%; bottom: 7%; z-index: 4; transform: translateX(-50%); width: min(84%, 900px); display: grid; justify-items: center; gap: .3em; text-align: center; pointer-events: none; }
.subtitle:empty { display: none; }
.subtitle .who { font-size: clamp(10px, 1.9cqi, 15px); font-weight: 600; letter-spacing: .01em; color: var(--c, #fff); background: var(--scrim); padding: .15em .7em; border-radius: var(--radius-control); }
.subtitle .who.is-live { background: var(--tally); color: #fff; }
.subtitle .txt { font-size: clamp(12px, 3.1cqi, 34px); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; color: #fff; background: var(--scrim); padding: .3em .65em; border-radius: .45em; }
.screen-msg { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); background: var(--surface); }
.screen-stop { position: absolute; top: 14px; right: 14px; z-index: 6; }

/* Senaryo: zaman kodu · karakter · replik */
.script { display: grid; gap: 2px; max-height: 520px; overflow: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
.cue { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 12px 14px; margin: 0 -14px; border-radius: 12px; transition: background .15s; }
.cue:hover { background: var(--raised); }
.cue.is-other { opacity: .42; }
.cue.is-active { background: var(--tally-soft); }
.cue-time { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.cue-body { display: grid; gap: 2px; }
.cue-who { font-size: 13px; font-weight: 600; color: var(--c, var(--muted)); }
.cue-text { font-size: 16px; line-height: 1.4; }
.cue-acts { display: flex; align-items: center; gap: 6px; }

/* Tepkiler */
#reactions { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.float-emoji { position: absolute; bottom: -48px; font-size: 40px; animation: float 2.6s var(--ease) forwards; }
@keyframes float { to { transform: translateY(-72vh) scale(1.3); opacity: 0; } }

@media (max-width: 600px) {
  .cue { grid-template-columns: 1fr; gap: 6px; }
  .cue-acts { justify-content: flex-start; }
}

/* Açılır kart: yatay düğme, tıklayınca içerik aşağı doğru açılır */
.disclosure { border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.disclosure-toggle {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; border: 0; background: none; color: var(--text); text-align: left;
  transition: background .15s;
}
.disclosure-toggle:hover { background: var(--raised); }
.disclosure-toggle .grow { display: grid; gap: 2px; }
.disclosure-toggle strong { font-size: var(--fs-section); }
.disclosure-toggle small { color: var(--faint); }
.disclosure-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--raised); color: var(--text); }
.disclosure-icon .icon { width: 20px; height: 20px; }
.disclosure-hint { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); }
.disclosure-chevron { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--raised); transition: transform .25s var(--ease); }
.disclosure-chevron .icon { width: 16px; height: 16px; }
.disclosure.is-open .disclosure-chevron { transform: rotate(180deg); }
/* Yükseklik animasyonu: satır 0fr'dan 1fr'a */
.disclosure-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.disclosure.is-open .disclosure-panel { grid-template-rows: 1fr; }
.disclosure-inner { min-height: 0; overflow: hidden; }
.disclosure.is-open .disclosure-inner { padding: 4px 18px 16px; }
/* Senaryo listesi: belli bir yükseklikten sonra kendi içinde kayar */
.disclosure .script { max-height: min(480px, 60vh); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; margin: 0; padding: 0 6px 0 0; scrollbar-width: thin; scrollbar-color: var(--control-hover) transparent; }
.disclosure .script::-webkit-scrollbar { width: 6px; }
.disclosure .script::-webkit-scrollbar-thumb { background: var(--control-hover); border-radius: 99px; }
@media (max-width: 600px) { .disclosure-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .disclosure-panel, .disclosure-chevron { transition: none; } }

/* Katalogda henüz hazırlanan sahne */
.scene-prep { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.72); color: #fff; }

/* Yenile: küçük ikon, basınca döner */
.link-refresh { display: inline-flex; align-items: center; gap: 6px; }
.link-refresh .icon { width: 16px; height: 16px; }
.link-refresh.is-spinning .icon { animation: refresh-spin .6s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .link-refresh.is-spinning .icon { animation-duration: 1.6s; } }
/* Panel başlığı ve sağında küçük bir eylem (ör. arkadaş listesini yenile) */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Yönetim paneli kuyruğu: grupların arasında ve sekmelerin altında nefes payı */
.queue-group { margin-top: 20px; }
