/* ARENA Player */
.ap {
  --ap-accent: #ff3b4e;
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 20px; overflow: hidden;
  isolation: isolate; user-select: none; -webkit-user-select: none; color: #fff;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.07);
  font-family: inherit; outline: none;
}
.ap:fullscreen, .ap.is-fs { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; display: grid; place-items: center; background: #000; }
.ap__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ap__iframe-wrap { position: absolute; inset: 0; z-index: 2; background: #000; }
.ap:fullscreen .ap__iframe-wrap, .ap.is-fs .ap__iframe-wrap {
  position: relative; inset: auto; width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16));
}
.ap__iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.ap.is-iframe .ap__bar, .ap.is-iframe .ap__center, .ap.is-iframe .ap__shade { display: none !important; }

/* CAPITALIPTV sponsor/watermark kapatıcı kutular */
.ap__masks { position: absolute; inset: 0; z-index: 4; pointer-events: none; display: none; }
.ap.is-iframe.has-masks .ap__masks,
.ap.is-iframe.has-watermark-mask .ap__masks { display: block; }
.ap:fullscreen .ap__masks, .ap.is-fs .ap__masks {
  inset: auto; width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16));
}
.ap__mask {
  position: absolute; pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(135deg, #0b0e14 0%, #141923 100%);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
  color: #ffffff; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  user-select: none; overflow: hidden; white-space: nowrap;
}
.ap__mask i {
  width: 5px; height: 5px; border-radius: 50%; background: #ff3b4e;
  box-shadow: 0 0 6px #ff3b4e; flex: none;
}
.ap__mask em { font-style: normal; color: #ff3b4e; }
/* 1: Üst orta (Dizi/Film yazısı) */
.ap__mask--tc { top: 1.6%; left: 50%; transform: translateX(-50%); width: 43%; height: 4.2%; font-size: clamp(8px, 0.75vw, 11px); }
/* 2: Sağ üst (Selcuksports HD logosu) */
.ap__mask--tr { top: 3.2%; right: 2.2%; width: 23%; height: 8.6%; font-size: clamp(9px, 0.9vw, 13px); }
/* 3: Sol alt (dedebet logosu) */
.ap__mask--bl { bottom: 0.6%; left: 0.4%; width: 14.4%; height: 10.2%; font-size: clamp(9px, 1.05vw, 14px); }
/* 4: Alt orta (Yeni X hesabımız yazısı) */
.ap__mask--bc { bottom: 1.4%; left: 50%; transform: translateX(-50%); width: 30%; height: 4.6%; font-size: clamp(8px, 0.75vw, 11px); }
/* 5: Sağ alt (izleAMK watermark logosu kapatıcı) */
.ap__mask--br { display: none; bottom: 60px; right: 12px; width: 146px; height: 50px; font-size: 11px; }

/* Modlara göre görünürlük */
.ap.is-iframe.has-masks .ap__mask--tc,
.ap.is-iframe.has-masks .ap__mask--tr,
.ap.is-iframe.has-masks .ap__mask--bl,
.ap.is-iframe.has-masks .ap__mask--bc { display: flex; }
.ap.is-iframe.has-masks .ap__mask--br { display: none !important; }

.ap.is-iframe.has-watermark-mask .ap__mask--tc,
.ap.is-iframe.has-watermark-mask .ap__mask--tr,
.ap.is-iframe.has-watermark-mask .ap__mask--bl,
.ap.is-iframe.has-watermark-mask .ap__mask--bc { display: none !important; }
.ap.is-iframe.has-watermark-mask .ap__mask--br { display: flex !important; }

@media (max-width: 768px) {
  .ap__mask--br { bottom: 48px; right: 8px; width: 102px; height: 38px; font-size: 9px; }
}
@media (max-width: 480px) {
  .ap__mask--br { bottom: 42px; right: 4px; width: 72px; height: 28px; font-size: 8px; }
}

/* Iframe kontrolleri (ses ayarı ve tam ekran) */
.ap__float-bar {
  position: absolute; right: 12px; bottom: 10px; z-index: 5;
  display: none; align-items: center; gap: 8px;
}
.ap.is-iframe .ap__float-bar { display: inline-flex; }

.ap__vol-float {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px;
  background: rgba(11, 14, 20, 0.88); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff; backdrop-filter: blur(8px);
}
.ap__vol-float .ap__ib { width: 30px; height: 30px; }
.ap__vol-float .ap__ib svg { width: 17px; height: 17px; }
.ap__vol-range--float { width: 70px !important; opacity: 1 !important; margin: 0 4px !important; }

.ap__fs-float {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  background: rgba(11, 14, 20, 0.88); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(8px); transition: background 0.2s, transform 0.15s;
}
.ap__fs-float:hover { background: rgba(255, 59, 78, 0.9); transform: scale(1.04); }
.ap__fs-float svg { width: 16px; height: 16px; }
.ap__fs-float .on { display: none; }
.ap__fs-float.is-on .on { display: block; }
.ap__fs-float.is-on .off { display: none; }
.ap__poster {
  position: absolute; inset: 0; z-index: 0; display: grid; place-items: center;
  background: radial-gradient(900px 400px at 50% 0%, rgba(255, 59, 78, 0.16), transparent 70%), linear-gradient(180deg, #0f131a, #07090c);
}

.ap__shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0, transparent 22%, transparent 62%, rgba(0, 0, 0, 0.78) 100%); }
.ap.show-ui .ap__shade { opacity: 1; }

/* top */
.ap__top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  opacity: 0; transform: translateY(-6px); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
.ap.show-ui .ap__top { opacity: 1; transform: none; }
.ap__title { font-weight: 700; font-size: 15px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); display: flex; align-items: center; gap: 10px; min-width: 0; }
.ap__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap__chip {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 12px; font-weight: 700; font-size: 13px;
  background: rgba(10, 12, 16, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ap__chip .lg { width: 18px; height: 18px; object-fit: contain; }
.ap__chip .sc { font-size: 15px; letter-spacing: 0.02em; }
.ap__chip .min { color: var(--ap-accent); }

/* center play */
.ap__center {
  position: absolute; z-index: 4; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22); transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.28, 1), opacity 0.3s, background 0.2s;
  opacity: 0; transform: scale(0.8); pointer-events: none;
}
.ap__center svg { width: 30px; height: 30px; margin-left: 3px; }
.ap[data-state='idle'] .ap__center, .ap[data-state='paused'] .ap__center { opacity: 1; transform: scale(1); pointer-events: auto; }
.ap[data-state='idle'] .ap__center { animation: ap-breathe 2.6s ease-in-out infinite; }
.ap__center:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.06) !important; }
.ap.is-tapped .ap__center { animation: ap-tap 0.5s ease; }

.ap__spinner { position: absolute; z-index: 4; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.25s; animation: ap-spin 0.8s linear infinite; }
.ap[data-state='loading'] .ap__spinner, .ap.is-buffering .ap__spinner { opacity: 1; }
.ap[data-state='loading'] .ap__center, .ap.is-buffering .ap__center { opacity: 0 !important; }

/* message overlay */
.ap__msg {
  position: absolute; inset: 0; z-index: 6; display: none; place-items: center; text-align: center; padding: 28px;
  background: radial-gradient(700px 320px at 50% 30%, rgba(255, 59, 78, 0.12), transparent 70%), rgba(7, 9, 12, 0.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ap[data-state='error'] .ap__msg, .ap[data-state='empty'] .ap__msg { display: grid; animation: ap-fade 0.4s ease; }
.ap__msg-box { max-width: 460px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: ap-rise 0.5s cubic-bezier(0.22, 0.8, 0.28, 1); }
.ap__msg-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 6px; }
.ap__msg-ico svg { width: 26px; height: 26px; opacity: 0.85; }
.ap__msg h4 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.ap__msg p { margin: 0; color: #a4adbd; font-size: 13.5px; line-height: 1.5; }
.ap__msg-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.ap__btn { padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; background: #fff; color: #0a0c10; transition: transform 0.15s; }
.ap__btn:hover { transform: translateY(-1px); }
.ap__btn--ghost { background: rgba(255, 255, 255, 0.1); color: #fff; }
.ap__add { display: flex; gap: 8px; width: 100%; margin-top: 10px; }
.ap__add input {
  flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06);
  color: #fff; padding: 0 12px; font: inherit; font-size: 13px; outline: none; transition: border-color 0.2s, background 0.2s;
}
.ap__add input:focus { border-color: rgba(91, 140, 255, 0.7); background: rgba(255, 255, 255, 0.09); }
.ap__add input::placeholder { color: #6b7587; }
.ap__hint { font-size: 12px; color: #6b7587; }

/* bottom bar */
.ap__bar { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 0 16px 12px; opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
.ap.show-ui .ap__bar { opacity: 1; transform: none; pointer-events: auto; }
.ap.hide-cursor { cursor: none; }

.ap__progress { position: relative; height: 18px; display: none; align-items: center; cursor: pointer; margin-bottom: 2px; }
.ap.is-vod .ap__progress { display: flex; }
.ap__track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); transition: height 0.15s; overflow: hidden; }
.ap__progress:hover .ap__track { height: 6px; }
.ap__buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.28); }
.ap__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ap-accent); }

.ap__row { display: flex; align-items: center; gap: 4px; height: 44px; }
.ap__sp { flex: 1; }
.ap__ib {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.ap__ib:hover { background: rgba(255, 255, 255, 0.14); }
.ap__ib:active { transform: scale(0.92); }
.ap__ib svg { width: 22px; height: 22px; }
.ap__ib .on { display: none; }
.ap__ib.is-on .on { display: block; }
.ap__ib.is-on .off { display: none; }
.ap__ib:focus-visible { outline: 2px solid #5b8cff; }

.ap__vol { display: flex; align-items: center; }
.ap__vol input[type='range'] { width: 0; opacity: 0; transition: width 0.25s cubic-bezier(0.22, 0.8, 0.28, 1), opacity 0.2s, margin 0.25s; margin: 0; }
.ap__vol:hover input[type='range'], .ap__vol:focus-within input[type='range'] { width: 84px; opacity: 1; margin: 0 8px 0 2px; }
.ap input[type='range'] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255, 255, 255, 0.25) var(--v, 100%)); outline: none; cursor: pointer; }
.ap input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.ap input[type='range']::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }

.ap__live {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; margin-left: 6px; border-radius: 999px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.1); transition: background 0.2s, opacity 0.2s; display: none;
}
.ap.is-live .ap__live { display: inline-flex; }
.ap__live i { width: 7px; height: 7px; border-radius: 50%; background: #8791a3; transition: background 0.3s; }
.ap__live.at-edge i { background: var(--ap-accent); animation: ap-blink 1.4s ease-in-out infinite; }
.ap__live:not(.at-edge) { opacity: 0.85; }
.ap__live:not(.at-edge):hover { background: rgba(255, 255, 255, 0.2); }
.ap__time { font-size: 12.5px; margin-left: 8px; color: #dfe4ee; font-variant-numeric: tabular-nums; display: none; }
.ap.is-vod .ap__time { display: block; }

.ap__menu {
  position: absolute; right: 0; bottom: 52px; min-width: 190px; padding: 6px; border-radius: 14px; z-index: 8;
  background: rgba(18, 22, 30, 0.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); transform-origin: bottom right; animation: ap-menu 0.18s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.ap__menu-title { padding: 8px 10px 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7587; font-weight: 700; }
.ap__opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; text-align: left; transition: background 0.15s; }
.ap__opt:hover { background: rgba(255, 255, 255, 0.09); }
.ap__opt .ck { width: 14px; opacity: 0; }
.ap__opt.is-sel .ck { opacity: 1; }
.ap__opt small { margin-left: auto; color: #6b7587; }
.ap__menu-wrap { position: relative; }

.ap__toast {
  position: absolute; z-index: 7; left: 50%; top: 16%; transform: translate(-50%, -6px); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(10, 12, 16, 0.7); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); opacity: 0; pointer-events: none; transition: all 0.3s ease;
}
.ap__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@keyframes ap-spin { to { transform: rotate(360deg); } }
@keyframes ap-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ap-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ap-menu { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes ap-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes ap-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.22); } 50% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } }
@keyframes ap-tap { 0% { transform: scale(0.85); } 100% { transform: scale(1); } }

@media (max-width: 640px) {
  .ap { border-radius: 14px; }
  .ap__vol input[type='range'] { display: none; }
  .ap__ib { width: 36px; height: 36px; }
  .ap__center { width: 62px; height: 62px; margin: -31px 0 0 -31px; }
  .ap__chip .lg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap *, .ap *::before { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
