:root {
  --tile: clamp(220px, 15.8vw, 300px);
  --tile-gap: 8px;
  --t10-size: clamp(120px, 11vw, 190px);
}

.rows { gap: clamp(26px, 3vw, 44px); }
.row-wrap { position: relative; }
.row-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  max-width: var(--maxw); margin: 0 auto 10px; padding: 0 var(--gutter);
}
.row-title { margin: 0; font: 700 clamp(18px, 1.5vw, 22px)/1.25 "Montserrat", sans-serif; letter-spacing: -0.015em; color: #e5e5e5; }
.row-pages { display: flex; gap: 2px; padding-bottom: 6px; opacity: 0; transition: opacity 0.2s var(--ease); }
.row-pages i { display: block; width: 12px; height: 2px; background: #4d4d4d; transition: background 0.2s var(--ease); }
.row-pages i.on { background: #fff; }
.row-wrap:hover .row-pages { opacity: 1; }

.row-body { position: relative; max-width: var(--maxw); margin: 0 auto; }
.track {
  display: flex; gap: var(--tile-gap); overflow-x: auto; overflow-y: hidden;
  max-width: none; margin: 0; padding: 4px var(--gutter);
  scroll-behavior: smooth; scroll-padding-inline: var(--gutter); scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }

.rail-btn {
  position: absolute; top: 4px; bottom: 4px; z-index: 6; width: max(44px, var(--gutter));
  display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  color: #fff; background: rgba(20, 20, 20, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.rail-btn.left { left: 0; right: auto; border-radius: 0 4px 4px 0; transform: none; }
.rail-btn.right { right: 0; left: auto; border-radius: 0 4px 4px 0; transform: scaleX(-1); }
.rail-btn svg { width: 30px; height: 30px; transition: transform 0.18s var(--ease); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.rail-btn:hover { background: rgba(20, 20, 20, 0.72); }
.rail-btn:hover svg { transform: scale(1.3); }
.row-wrap:hover .rail-btn { opacity: 1; pointer-events: auto; }
.row-wrap.at-start .rail-btn.left, .row-wrap.at-end .rail-btn.right { opacity: 0; pointer-events: none; }

.card {
  position: relative; flex: 0 0 auto; display: block; width: var(--tile); aspect-ratio: 16 / 9;
  border-radius: 4px; overflow: hidden; cursor: pointer;
  background: #181818; box-shadow: none; transform: none; transition: none;
  color: #fff; text-decoration: none;
}
.card:hover { transform: none; box-shadow: none; z-index: auto; }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.card .fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 14px; text-align: center;
  background: radial-gradient(120% 90% at 20% 0%, #26303f 0%, #161b23 55%, #0d1015 100%);
}
.card .fallback span { font: 800 16px/1.2 "Montserrat", sans-serif; letter-spacing: -0.01em; color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .fallback small { font-size: 12px; font-weight: 600; color: #8c8c8c; }

.card-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 34px 12px 10px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.42) 48%, transparent 100%);
  pointer-events: none;
}
.card-title {
  font: 700 15px/1.2 "Montserrat", sans-serif; letter-spacing: -0.01em; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 12px rgba(0, 0, 0, 0.55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-ep { font: 600 12px/1 "Montserrat", sans-serif; color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); letter-spacing: 0.01em; }
.card.is-fallback .card-title { display: none; }
.card.is-fallback .card-cap { background: none; }
.card:has(.card-bar) .card-cap { padding-bottom: 20px; }
.card-bar { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 3; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.3); }
.card-bar > i { display: block; height: 100%; background: var(--accent); }

.t10 { position: relative; flex: 0 0 auto; width: var(--tile); display: flex; justify-content: flex-end; }
.t10-num {
  position: absolute; left: 0; bottom: 0; z-index: 0;
  font: 900 var(--t10-size)/0.74 "Montserrat", sans-serif; letter-spacing: -0.09em;
  color: #000; -webkit-text-stroke: 8px #595959; paint-order: stroke fill;
  user-select: none; pointer-events: none;
}
.t10:nth-child(10) .t10-num { letter-spacing: -0.16em; left: -0.06em; }
.t10 .card-poster { position: relative; z-index: 1; width: 50%; aspect-ratio: 2 / 3; }
.card-poster img { object-position: center; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(14px, 1.6vw, 24px) var(--tile-gap);
  max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter) 60px;
}
.grid .card { width: 100%; }

.sk-card {
  flex: 0 0 auto; width: var(--tile); aspect-ratio: 16 / 9; border-radius: 4px;
  background: linear-gradient(100deg, #141414 30%, #232323 50%, #141414 70%); background-size: 220% 100%;
}
.row-sk .row-title.skeleton { border-radius: 4px; background: linear-gradient(100deg, #141414 30%, #232323 50%, #141414 70%); background-size: 220% 100%; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: none; box-shadow: none; }
}

@media (hover: none) {
  .rail-btn, .row-pages { display: none; }
}

@media (max-width: 699px) {
  :root { --tile: 42vw; --tile-gap: 6px; --t10-size: clamp(80px, 30vw, 150px); }
  .row-title { font-size: 17px; }
  .row-head { margin-bottom: 8px; }
  .rail-btn, .row-pages { display: none; }
  .card-cap { padding: 26px 8px 7px; }
  .card-title { font-size: 13px; }
  .card-ep { font-size: 11px; }
  .card:has(.card-bar) .card-cap { padding-bottom: 15px; }
  .card-bar { left: 8px; right: 8px; bottom: 7px; }
  .t10-num { -webkit-text-stroke-width: 6px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .track { scroll-behavior: auto; }
  .rail-btn svg { transition: none; }
}
