/* Shared pieces: buttons, chips, rows of posters, ranked cards, stars, sheets content. */

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px;
  font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .12s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn svg.i { width: 20px; height: 20px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn.primary:hover { background: linear-gradient(110deg, #1979b6, #515fc9 38%, #8a48c6 70%, #ae357f); }
.btn.white { background: #fff; color: #0b0d16; }
.btn.white:hover { background: #e6e8f5; }
.btn.glass { background: rgba(255, 255, 255, .13); color: #fff; border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.btn.glass:hover { background: rgba(255, 255, 255, .2); }
.btn.ghost { background: var(--panel-2); color: var(--ink); }
.btn.ghost:hover { background: var(--panel-3); }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.danger { background: rgba(255, 107, 129, .12); color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.round { width: 46px; padding: 0; border-radius: 50%; }
.link { color: var(--cyan); font-weight: 500; }

/* ---- chips & segmented ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px var(--gutter); margin: 0 calc(-1 * var(--gutter)); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 15px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--ink-2); font-weight: 500; font-size: 14px; border: 1px solid transparent; transition: .2s;
}
.chip:hover { background: var(--panel-3); }
.chip.active { background: #203b5b; border-color: #649bf7; color: #eaf6ff; }
.chip small { color: var(--muted); font-size: 12px; }
.chip.active small { color: #a9cdfa; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 34px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: .2s; }
.seg button.active { background: var(--panel-3); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; justify-content: center; }
.seg .count { font-size: 11px; background: rgba(255, 255, 255, .1); padding: 1px 6px; border-radius: 6px; }

/* ---- sections & horizontal rows ---- */
.section { margin: 30px 0 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 36px; }
.section-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.section-head .more { margin-left: auto; white-space: nowrap; flex: none; color: var(--muted); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }
.section-head .more:hover { color: #fff; }
.section-head .more svg.i { width: 16px; height: 16px; }
@media (min-width: 760px) { .section-head h2 { font-size: 24px; } }
.row {
  /* Sideways only: overflow-y hidden stops rows wobbling up/down under a finger on iOS. */
  display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 4px var(--gutter) 10px; margin: 0 calc(-1 * var(--gutter)); scroll-padding: 0 var(--gutter);
}
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
@media (min-width: 760px) { .row { gap: 16px; } }

/* service row header: wordmark + Movies/Shows switch */
.svc-logo { height: 26px; width: auto; max-width: 120px; object-fit: contain; object-position: left center; }
.svc-logo.mono { filter: brightness(0) invert(1); }
.svc-switch { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.svc-switch button { height: 28px; padding: 0 11px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--faint); transition: .2s; }
.svc-switch button.active { color: #fff; background: var(--panel-3); }

/* ---- poster card ---- */
.poster { position: relative; flex: none; width: 96px; display: block; }
@media (min-width: 760px) { .poster { width: 156px; } }
.poster .art-box { position: relative; }
.poster .art {
  position: relative; display: block; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #1d2136, #10121e);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .05); transition: transform .2s;
}
.poster .art img { width: 100%; height: 100%; object-fit: cover; }
.poster .art .noart { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; color: var(--ink-2); }
.poster:hover .art { transform: translateY(-3px); }
.poster .cap { margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .cap small { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }
.pct { color: var(--pc); font-weight: 700; }
.pct.hot { text-shadow: 0 0 10px rgba(255, 204, 77, .45); }
.cap .dot { font-style: normal; color: var(--faint); }
.poster .badge-date { position: absolute; left: 8px; top: 8px; background: rgba(8, 9, 16, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.poster .stars-mini { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.poster .who { position: absolute; left: 7px; bottom: 7px; display: flex; }
.poster .who .avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--bg); }
.qadd {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: rgba(16, 18, 30, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .15s, background .2s;
}
.qadd svg.i { width: 19px; height: 19px; stroke-width: 2.6; }
.qadd:hover { transform: scale(1.08); }
.qadd.saved { background: var(--brand); border-color: rgba(255, 255, 255, .25); }
.qadd.pop { animation: qpop .35s ease; }
@keyframes qpop { 50% { transform: scale(1.25); } }

/* ranked (Top 10) card: big number behind the poster */
.ranked { position: relative; flex: none; display: flex; align-items: flex-end; padding-left: 26px; }
.ranked .num {
  position: absolute; left: -3px; bottom: -10px; font-size: 96px; line-height: 1; font-weight: 800; letter-spacing: -.06em; z-index: 0;
  background: linear-gradient(180deg, #6a70a3, #2b2f50 85%); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none;
}
.ranked.wide { padding-left: 46px; }
.ranked.wide .num { left: -6px; }
.ranked .poster { z-index: 1; }
@media (min-width: 760px) { .ranked { padding-left: 46px; } .ranked.wide { padding-left: 80px; } .ranked .num { font-size: 158px; } }

/* poster grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
.grid .poster { width: auto; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 18px; } }

/* ---- stars ---- */
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars svg { width: 16px; height: 16px; }
.stars .off { color: #3a3f5c; }
.star-picker { display: flex; justify-content: center; gap: 6px; margin: 10px 0 6px; touch-action: none; }
.star-picker button { position: relative; width: 50px; height: 50px; color: #363b58; }
.star-picker svg { width: 50px; height: 50px; }
.star-picker .lit { color: var(--gold); filter: drop-shadow(0 0 10px rgba(255, 207, 92, .35)); }
.star-picker .half { position: absolute; inset: 0; width: 50%; overflow: hidden; color: var(--gold); }
.rating-word { text-align: center; color: var(--muted); font-weight: 500; min-height: 22px; }

/* ---- progress ---- */
.bar { height: 7px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--glow); transition: width .5s ease; }

/* ---- forms ---- */
.field { display: block; margin: 0 0 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, textarea.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); outline: none; transition: border .2s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: #6b78ff; }
.form-error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* ---- list rows (sheets/menus) ---- */
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu button, .menu a { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; font-weight: 500; font-size: 16px; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--panel-2); }
.menu .on { background: var(--panel-2); }
.menu .on::after { content: "✓"; margin-left: auto; color: var(--cyan); font-weight: 700; }
.menu .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--panel-3); display: grid; place-items: center; flex: none; }
.menu .desc { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

/* ---- empty / loading ---- */
.empty { text-align: center; padding: 50px 24px; border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(120, 60, 179, .18), transparent 70%), var(--panel); border: 1px solid var(--line); }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.empty h3 { font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 360px; margin: 0 auto 18px; }
.skel { background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; border-radius: 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel-row { display: flex; gap: 12px; overflow: hidden; }
.skel-row .skel { width: 96px; aspect-ratio: 2/3; flex: none; }
.error-box { padding: 18px; border-radius: 16px; background: rgba(255, 107, 129, .08); border: 1px solid rgba(255, 107, 129, .25); color: #ffc2cc; }

/* ---- hero carousel (Trending) ---- */
.hero-car { position: relative; margin: 0 calc(-1 * var(--gutter)); }
.hero-track { display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  position: relative; flex: none; width: 100%; aspect-ratio: 4/5; border-radius: 22px; overflow: hidden; scroll-snap-align: center;
  background: #10121e; box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.hero-slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 6, 10, .96) 0%, rgba(5, 6, 10, .55) 38%, transparent 65%); }
.hero-info { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 22px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.hero-info .logo { max-width: 72%; max-height: 92px; object-fit: contain; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6)); }
.hero-info h2 { font-size: 30px; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.hero-info .meta { color: var(--ink-2); font-size: 14px; }
.hero-info .actions { display: flex; gap: 10px; margin-top: 4px; }
.hero-tag { position: absolute; z-index: 1; top: 16px; left: 16px; background: rgba(8, 9, 16, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--panel-3); transition: .3s; }
.hero-dots i.on { width: 20px; background: var(--glow); }
@media (min-width: 760px) {
  .hero-slide { aspect-ratio: 21/9; }
  .hero-info { align-items: flex-start; text-align: left; padding: 40px; max-width: 620px; }
  .hero-slide::after { background: linear-gradient(90deg, rgba(5, 6, 10, .92), rgba(5, 6, 10, .4) 50%, transparent 75%), linear-gradient(0deg, rgba(5, 6, 10, .7), transparent 40%); }
  .hero-info .logo { max-height: 120px; object-position: left; }
}
