/* =====================================================================
   SUGOIX · Sci-Fi Glass Layer  (inspired by the INTECH reference card)
   Loaded LAST on every page. Remove the <link> to go back to the old look.
   - Does NOT change button classes or any animation/transition.
   - Shapes: chamfered corners (top-right + bottom-left), thin edge light,
     pill inputs, ambient light streaks behind the page (dark theme).
   ===================================================================== */
:root {
  --cut: 16px;            /* big chamfer: panels, hero */
  --cut-sm: 11px;         /* small chamfer: cards, tiles, dropdowns */
  --edge: rgba(15, 23, 42, 0.18);          /* light theme edge line */
  --field-bg: rgba(15, 23, 42, 0.06);
}
[data-theme="dark"] {
  --edge: rgba(170, 205, 255, 0.38);       /* dark theme edge line (cool white-blue) */
  --field-bg: rgba(150, 190, 255, 0.09);
}

/* ---------- 1. Ambient blue/cyan light streaks behind everything (dark only) ---------- */
[data-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(62% 44% at 50% 64%, rgba(47, 128, 255, 0.24), transparent 70%),
    radial-gradient(30% 20% at 50% 64%, rgba(56, 189, 248, 0.14), transparent 75%),
    repeating-conic-gradient(from 0deg at 50% 64%, rgba(47, 128, 255, 0.16) 0 0.7deg, transparent 0.7deg 4deg, rgba(56, 189, 248, 0.11) 4deg 4.5deg, transparent 4.5deg 9deg);
  -webkit-mask-image: radial-gradient(circle at 50% 64%, #000 0, rgba(0, 0, 0, 0.6) 38%, transparent 80%);
          mask-image: radial-gradient(circle at 50% 64%, #000 0, rgba(0, 0, 0, 0.6) 38%, transparent 80%);
}

/* ---------- 2. Panels: chamfered glass with edge light + side tabs ---------- */
.glass-panel, .stream-box, .episode-panel, #remote-upload-container, .url-upload, .ae-bottom-actions {
  border-radius: 2px !important;
  border-color: var(--glass-border);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.glass-panel {
  background:
    linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px)) top right / var(--cut) var(--cut) no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px)) bottom left / var(--cut) var(--cut) no-repeat,
    linear-gradient(var(--edge), var(--edge)) left 0 top 26px / 2px 14px no-repeat,
    linear-gradient(var(--edge), var(--edge)) left 0 top 48px / 2px 14px no-repeat,
    linear-gradient(var(--edge), var(--edge)) right 0 bottom 26px / 2px 14px no-repeat,
    linear-gradient(var(--edge), var(--edge)) right 0 bottom 48px / 2px 14px no-repeat,
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 42%),
    var(--glass-bg);
}
.hero { border-radius: 2px !important; clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }

/* ---------- 3. Anime cards, network tiles, language tiles ---------- */
.card {
  position: relative; border-radius: 3px;
  clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
}
.card::after {                       /* thin edge light on the two cut corners */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background:
    linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px)) top right / var(--cut-sm) var(--cut-sm) no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px) calc(50% + 0.6px), transparent calc(50% + 0.6px)) bottom left / var(--cut-sm) var(--cut-sm) no-repeat;
}
.network-row img, .lang-poster-card {
  clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
}

/* ---------- 4. Pill inputs (search, upload URL, filters) ---------- */
input[type="text"], input[type="search"], input[type="url"], input[type="email"], input[type="password"], select {
  background: var(--field-bg); border: 1px solid var(--glass-border); border-radius: 999px;
  color: var(--text); padding-left: 18px; padding-right: 18px;
}
input[type="text"]::placeholder, input[type="search"]::placeholder, input[type="url"]::placeholder { color: var(--text-dim); opacity: .8; }
input[type="text"]:focus, input[type="search"]:focus, input[type="url"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 128, 255, 0.22);
}
.search { background: var(--field-bg); }
.search input { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }   /* the pill is the .search box itself */
#video-url-input { border-radius: 999px !important; }

/* ---------- 5. Dropdowns / drawer / chips / header+footer lines ---------- */
.search-suggest {
  border-radius: 3px !important;
  clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
}
.section-head a { background: transparent; border-radius: 999px; padding: 6px 14px; }   /* ghost pill like "Option 1 / 2" */
.site-header { border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(47, 128, 255, 0.55), transparent) 1; }
.footer { border-top: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(47, 128, 255, 0.45), transparent) 1; }

/* Phones: slightly smaller cuts so text never touches the corner */
@media (max-width: 600px), (max-device-width: 600px) and (pointer: coarse) { :root { --cut: 12px; --cut-sm: 9px; } }

/* ---------- 6. Language tiles ("Stream in Your Language") - these spans had no layout CSS, so tiles looked empty ---------- */
.lang-poster-card { position: relative; display: block !important; overflow: hidden; aspect-ratio: 3 / 4.2; }
.lang-poster-card .lang-poster-img { position: absolute; inset: 0; background-color: rgba(255, 255, 255, 0.05); background-size: cover; background-position: center; }
.lang-poster-card .lang-poster-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.05) 62%); }
.lang-poster-card .lang-poster-watch { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; }
.lang-poster-card .lang-poster-name { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.lang-poster-card .lang-poster-name b { font-size: 18px; line-height: 1.15; color: #fff !important; }
.lang-poster-card .lang-poster-name small { font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, 0.78) !important; }
#langPosterGrid .lang-poster-card, .network-row img[src] { border-radius: 3px !important; }   /* match the chamfered shape (page CSS forced 12px) */


/* ---------- Reference-style primary buttons: white pill, dark text (dark theme) ---------- */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .ae-watch-primary,
[data-theme="dark"] .upload-btn,
[data-theme="dark"] .sx-btn.primary {
  background: #ffffff !important; color: #05070d !important; border-color: #ffffff !important;
  box-shadow: 0 6px 22px rgba(120, 170, 255, 0.28) !important;
}
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .ae-watch-primary:hover,
[data-theme="dark"] .upload-btn:hover,
[data-theme="dark"] .sx-btn.primary:hover:not(:disabled) {
  background: #dbe9ff !important; color: #05070d !important;
  box-shadow: 0 10px 28px rgba(47, 128, 255, 0.45) !important;
}
