:root{
  --bg0:#04040a;
  --bg1:#070717;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.08);
  --stroke:rgba(255,255,255,.10);
  --text:#f2f3ff;
  --muted:rgba(242,243,255,.72);

  --accent:#a855f7;   /* lila */
  --accent2:#7c3aed;  /* deep purple */
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;

  --r16:16px;
  --r20:20px;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(168,85,247,.20), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(124,58,237,.14), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.wrap{
  min-height:100%;
  padding: clamp(12px, 2.5vw, 20px);
}

.container{
  max-width: 980px;
  margin: 0 auto;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px;
  border:1px solid var(--stroke);
  border-radius: var(--r20);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
}

.brand{display:flex; align-items:center; gap:10px}
.brand img{
  width:44px; height:44px; border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}
.title{display:flex; flex-direction:column; line-height:1.15}
.title strong{font-size:14px; letter-spacing:.2px}
.title span{font-size:12px; color:var(--muted)}

.hero{
  margin-top:14px;
  padding:18px;
  border-radius: var(--r20);
  border:1px solid var(--stroke);
  background:
    radial-gradient(700px 240px at 30% 0%, rgba(168,85,247,.18), transparent 65%),
    rgba(255,255,255,.04);
  box-shadow: var(--shadow);
}

.h1{
  margin:0;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: .2px;
}
.sub{
  margin:8px 0 0 0;
  color:var(--muted);
  font-size: 13px;
}

.card{
  margin-top: 0;
  padding:18px;
  border-radius: var(--r20);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.045);
  box-shadow: var(--shadow);
}

.notice{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(168,85,247,.25);
  background: rgba(168,85,247,.10);
}
.err{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(239,68,68,.35);
  background: rgba(239,68,68,.10);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 11px 14px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  cursor:pointer;
  font-weight: 650;
  letter-spacing:.2px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn:hover{background: rgba(255,255,255,.07)}
.btn.primary{
  border-color: rgba(168,85,247,.45);
  background: linear-gradient(180deg, rgba(168,85,247,.25), rgba(124,58,237,.18));
}
.btn.primary:hover{
  border-color: rgba(168,85,247,.75);
  background: linear-gradient(180deg, rgba(168,85,247,.32), rgba(124,58,237,.22));
}
.btn.ghost{background: transparent}
.btn[disabled]{opacity:.55; cursor:not-allowed}

.input{
  width:100%;
  padding: 13px 14px;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(168,85,247,.55);
  box-shadow: 0 0 0 4px rgba(168,85,247,.12);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 12px;
}

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (min-width: 860px){
  .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tile{
  border-radius: var(--r20);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  overflow:hidden;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.tile:hover{
  transform: translateY(-1px);
  border-color: rgba(168,85,247,.35);
  background: rgba(255,255,255,.05);
}
.poster{
  aspect-ratio: 2 / 3;
  background: rgba(0,0,0,.25);
}
.poster img{width:100%; height:100%; object-fit:cover}
.meta{padding:12px}
.name{
  margin:0;
  font-weight: 750;
  font-size: 14px;
  letter-spacing:.2px;
}
.info{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color: var(--muted);
  font-size: 12px;
}

.footer{
  margin: 18px 0 0 0;
  text-align:center;
  color: rgba(242,243,255,.55);
  font-size: 12px;
}

/* ===== Details page ===== */
.detail-shell{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media(min-width: 860px){
  .detail-shell{ grid-template-columns: 340px 1fr; }
}

.detail-poster{
  border-radius: var(--r20);
  border:1px solid var(--stroke);
  overflow:hidden;
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
}
.detail-poster img{width:100%; height:100%; object-fit:cover}
.poster-fallback{
  padding:20px;
  color: var(--muted);
}

.detail-main{
  padding:18px;
  border-radius: var(--r20);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
}

.detail-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.meta-line{
  margin-top:8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.desc{
  margin: 14px 0 0 0;
  color: rgba(242,243,255,.78);
  font-size: 14px;
  line-height: 1.55;
}

.divider{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 16px 0;
}

.section-title{
  font-weight: 800;
  letter-spacing:.2px;
}
.hintline{
  margin-top:10px;
  color: var(--muted);
  font-size: 12px;
}

.actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.btn-state{
  color: var(--muted);
  font-size: 12px;
}
.btn-state.ok{ color: rgba(34,197,94,.9); }

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  white-space:nowrap;
}
.pill.ok{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); color: rgba(34,197,94,.95); }
.pill.warn{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12); color: rgba(245,158,11,.95); }
.pill.new{ border-color: rgba(168,85,247,.40); background: rgba(168,85,247,.12); color: rgba(242,243,255,.92); }
.pill.info{ border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.12); color: rgba(59,130,246,.95); }

/* Seasons */
.season-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
@media(min-width: 560px){
  .season-grid{ grid-template-columns: 1fr 1fr; }
}
.season{
  width:100%;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  color: var(--text);
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.season:hover{
  border-color: rgba(168,85,247,.35);
  background: rgba(0,0,0,.22);
}
.season:active{ transform: translateY(1px); }

.season-title{ font-weight: 800; font-size: 13px; }
.season-sub{ color: var(--muted); font-size: 12px; margin-top:3px; }

.switch{
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  position:relative;
}
.switch span{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  transition: left .15s ease, background .15s ease;
}
.season.on{
  border-color: rgba(168,85,247,.55);
  background: rgba(168,85,247,.10);
}
.season.on .switch{
  border-color: rgba(168,85,247,.55);
  background: rgba(168,85,247,.18);
}
.season.on .switch span{
  left: 22px;
  background: rgba(242,243,255,.92);
}
