/* Control-centre style round buttons (keeps site accent + glass) */
.ae-action-row { gap: 12px !important; flex-wrap: wrap; }
.ae-action {
  border-radius: 999px !important; clip-path: none !important; -webkit-clip-path: none !important;
  padding: 7px 20px 7px 7px !important; margin: 0 !important;
  background: var(--glass-bg) !important; border: 1px solid var(--glass-border) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.18) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .2s, box-shadow .25s, border-color .25s, background .25s;
}
.ae-action strong {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff !important; font-size: 16px; line-height: 1;
  box-shadow: 0 4px 14px rgba(47,128,255,.45);
}
.ae-action:hover { transform: translateY(-2px); border-color: var(--accent) !important; box-shadow: 0 10px 24px rgba(47,128,255,.28) !important; }
.ae-action:active { transform: scale(.97); }
@media (max-width: 760px) {
  .ae-action-row .ae-action { flex: 1 1 0; justify-content: center; padding: 6px 14px 6px 6px !important; }
}

/* Episode numbers: round, like the control-centre tiles */
.sx-eps { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)) !important; justify-items: center; gap: 10px !important; }
.sx-ep {
  width: 50px !important; height: 50px !important; border-radius: 50% !important;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 !important;
  background: rgba(127,127,127,.12) !important; border: 1px solid var(--glass-border) !important;
}
.sx-ep.active { background: var(--accent) !important; box-shadow: 0 6px 18px rgba(47,128,255,.5) !important; }
.sx-ep.seen::after { top: 4px !important; right: 4px !important; }
.sx-range { border-radius: 999px !important; }

/* "You May Also Like" cards on the watch page (replaces the episode number grid) */
.sx-suggest { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.sx-sug {
  display: block; position: relative; overflow: hidden; border-radius: 14px; text-decoration: none; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border); clip-path: none !important;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.sx-sug:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(47,128,255,.25); }
.sx-sug img, .sx-sug-noimg { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: rgba(127,127,127,.15); }
.sx-sug-t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 8px 9px 2px; font-size: 12px; font-weight: 700; line-height: 1.3;
}
.sx-sug-s { display: block; padding: 0 9px 9px; font-size: 11px; color: var(--accent); font-weight: 700; }

/* ---- Watch page control bar: Quality / Server / Audio & Language / More Servers ---- */
.sx-bar { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px !important; padding: 12px !important; }
.sx-ctl {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  padding: 12px 6px; border-radius: 18px; cursor: pointer; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border); clip-path: none !important;
  transition: transform .2s, border-color .25s, box-shadow .25s;
}
.sx-ctl:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 20px rgba(47,128,255,.25); }
.sx-ctl-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(47,128,255,.45); }
.sx-ctl-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sx-ctl-l { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); text-align: center; line-height: 1.2; }
.sx-ctl-v { font-size: 12px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .sx-ctl-l { font-size: 9px; } .sx-ctl-v { font-size: 11px; } }

/* Bottom sheets */
.sx-sheet-wrap { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sx-sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sx-sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sx-sheet {
  position: relative; width: min(560px, 100%); max-height: 78vh; overflow-y: auto; clip-path: none !important;
  border-radius: 22px 22px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--glass-bg); border: 1px solid var(--glass-border); transform: translateY(30px); transition: transform .25s;
}
.sx-sheet-wrap.open .sx-sheet { transform: none; }
.sx-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 15px; color: var(--text); }
.sx-sheet-x { background: none; border: none; color: var(--text); font-size: 16px; cursor: pointer; }
.sx-opt {
  display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 6px 0; padding: 12px 18px;
  border-radius: 999px; border: 1px solid var(--glass-border); background: transparent; color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.sx-opt:hover, .sx-opt.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sx-opt small { opacity: .8; font-weight: 700; }
.sx-opt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; margin: 6px 0; border-radius: 999px; border: 1px solid var(--glass-border); }
.sx-opt-name { font-weight: 600; font-size: 14px; color: var(--text); }
.sx-opt-name small { color: var(--text-dim); font-weight: 700; margin-left: 4px; }
.sx-del { background: none; border: 1px solid var(--glass-border); color: var(--text-dim); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.sx-del:hover { border-color: var(--accent); color: var(--accent); }
.sx-add { display: grid; gap: 8px; margin-top: 14px; }
.sx-add input { padding: 12px 16px; border-radius: 999px; border: 1px solid var(--glass-border); background: rgba(127,127,127,.1); color: var(--text); font: inherit; font-size: 13px; }
.sx-add input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,128,255,.2); }
.sx-add button { padding: 13px; border-radius: 999px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(47,128,255,.4); }
.sx-add small { color: var(--text-dim); font-size: 11px; line-height: 1.4; padding: 0 6px; }
.sx-add-err { color: #ff6b6b; font-size: 12px; min-height: 1em; padding: 0 6px; }
.sx-sheet .sx-note { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin: 10px 4px; }

/* ---- Control bar alignment: every box identical height, rows locked ---- */
.sx-bar { align-items: stretch !important; }
.sx-ctl {
  height: 100%; min-height: 124px; box-sizing: border-box;
  display: grid !important; grid-template-rows: 38px 26px 18px; row-gap: 6px;
  align-content: center; justify-items: center; align-items: center;
  padding: 12px 8px !important;
}
.sx-ctl-ico { grid-row: 1; }
.sx-ctl-l { grid-row: 2; display: flex; align-items: center; justify-content: center; min-height: 26px; max-width: 100%; }
.sx-ctl-v { grid-row: 3; display: block; width: 100%; text-align: center; line-height: 18px; }
/* 3 suggestion cards per row on phones so the list is not oversized */
@media (max-width: 560px) {
  .sx-suggest { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
  .sx-sug-t { font-size: 11px !important; padding: 6px 7px 1px !important; }
  .sx-sug-s { font-size: 10px !important; padding: 0 7px 7px !important; }
}

/* Feedback toast + warning note */
.sx-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 100000;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff;
  background: var(--accent); box-shadow: 0 8px 24px rgba(47,128,255,.45); max-width: calc(100vw - 32px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sx-toast.show { opacity: 1; transform: translate(-50%, 0); }
.sx-sheet .sx-warn { color: #ff8a8a; font-weight: 700; }

/* Sheets: solid panel + strong dim so the page footer never shows through the sheet */
.sx-sheet-back { background: rgba(0,0,0,.78) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-sheet {
  background: var(--bg) !important;
  box-shadow: 0 -18px 50px rgba(0,0,0,.55);
  border-color: var(--glass-border) !important;
}
.sx-sheet::before {
  content: ""; display: block; width: 44px; height: 5px; border-radius: 99px;
  background: var(--glass-border); margin: 0 auto 10px;
}
.sx-sheet-wrap { z-index: 2147483600 !important; }
.sx-toast { z-index: 2147483601 !important; }

/* Popover: opens right next to the button you tapped (not at the bottom of the page) */
.sx-sheet-back { background: rgba(0,0,0,.35) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.sx-sheet-wrap { align-items: stretch !important; justify-content: stretch !important; }
.sx-sheet.sx-pop {
  position: fixed !important; border-radius: 20px !important; padding: 12px 14px 14px !important;
  overflow-y: auto; max-height: 70vh; box-sizing: border-box;
  transform: translateY(6px) scale(.98) !important; transform-origin: 50% 100%;
  transition: transform .2s ease, opacity .2s ease; box-shadow: 0 16px 40px rgba(0,0,0,.6) !important;
}
.sx-sheet-wrap.open .sx-sheet.sx-pop { transform: none !important; }
.sx-sheet.sx-pop::before { display: none !important; }
.sx-sheet.sx-pop .sx-opt { padding: 10px 16px; font-size: 13px; margin: 5px 0; }
.sx-sheet.sx-pop .sx-note { font-size: 11px; }

/* Numbered servers + group labels + More Servers rows */
.sx-grp { margin: 10px 4px 2px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.sx-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; margin-right: 10px; flex: none; font-size: 12px; font-weight: 800; background: rgba(47,128,255,.18); color: var(--accent); }
.sx-opt.on .sx-badge, .sx-opt:hover .sx-badge { background: rgba(255,255,255,.25); color: #fff; }
.sx-opt.sx-srv { justify-content: flex-start; }
.sx-opt.sx-srv .sx-srv-n { flex: 1; text-align: left; }
.sx-opt-name { display: flex; align-items: center; min-width: 0; }
.sx-row-btns { display: flex; gap: 6px; flex: none; }
.sx-use { background: var(--accent); border: none; color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.sx-sheet .sx-ok { color: var(--accent); font-weight: 700; }

/* Episode list: show-more button */
.ae-ep-more { display: flex; justify-content: center; margin: 6px 0 4px; }
.ae-ep-morebtn {
  border-radius: 999px; padding: 12px 24px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border); transition: border-color .25s, transform .2s;
}
.ae-ep-morebtn:hover { border-color: var(--accent); transform: translateY(-2px); }
.ae-episode { clip-path: none !important; }
.ae-episode:hover { border-color: var(--accent) !important; transform: translateY(-2px); }

/* Season switcher chips (Details page) */
.ae-seasons { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ae-seasons::-webkit-scrollbar { display: none; }
.ae-season-chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; padding: 10px 18px;
  border-radius: 999px; text-decoration: none; color: var(--text); background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: border-color .25s, transform .2s, background .25s;
}
.ae-season-chip b { font-size: 13px; font-weight: 800; }
.ae-season-chip small { font-size: 10px; font-weight: 700; color: var(--text-dim); letter-spacing: .04em; }
.ae-season-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.ae-season-chip.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 18px rgba(47,128,255,.45); color: #fff; }
.ae-season-chip.on small { color: rgba(255,255,255,.85); }
