/* Torrent UI Stage 1 — append AFTER original search-torrents/css/style.css */
.torrent-ui {
  --tor-bg: #080d12;
  --tor-surface: #0d151c;
  --tor-line: #1a2932;
  --tor-green: #36c76a;
  --tor-muted: #9baab8;
  width: 100%;
  min-width: 0;
  margin: 24px 0;
  color: #f5f8fc;
  font: 15px/1.5 Arial, Helvetica, sans-serif;
}
.torrent-ui *, .torrent-ui *::before, .torrent-ui *::after { box-sizing: border-box; }
/* Original table is retained for existing DLE filtering and links, but hidden visually. */
#restable_sort.torrent-ui__source { display: none !important; }
.torrent-ui__heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.torrent-ui__heading h2 { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 0; color: #fff; }
.torrent-ui__symbol { color: var(--tor-green); font-size: 26px; }
.torrent-ui__total { margin-left: auto; color: var(--tor-muted); font-size: 13px; }
.torrent-ui__filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.torrent-ui__filter { appearance: none; border: 1px solid transparent; background: #121b24; color: #a9bac8; border-radius: 10px; padding: 9px 13px; cursor: pointer; font: inherit; font-size: 14px; }
.torrent-ui__filter:hover { color: #fff; border-color: #2a404a; }
.torrent-ui__filter.is-active { background: var(--tor-green); color: #04100a; font-weight: 700; }
.torrent-ui__sort { color: var(--tor-muted); text-align: right; margin: 0 3px 10px; font-size: 13px; }
.torrent-ui__list { background: var(--tor-bg); border: 1px solid var(--tor-line); border-radius: 15px; overflow: hidden; }
.torrent-ui__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 16px; min-height: 68px; border-bottom: 1px solid #142029; }
.torrent-ui__row:last-child { border-bottom: 0; }
.torrent-ui__row:hover { background: #101b20; }
.torrent-ui__row.has-ad { background: #171714; }
.torrent-ui__main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.torrent-ui__quality { flex: 0 0 70px; text-align: center; font-size: 13px; font-weight: 700; border: 1px solid #285443; border-radius: 9px; color: #3ce38c; background: #06331f; padding: 4px 5px; }
.torrent-ui__quality--4k { color: #cf92ff; background: #27123e; border-color: #7135a5; }
.torrent-ui__quality--720p, .torrent-ui__quality--480p, .torrent-ui__quality--other { color: #b5c2d0; background: #1c222b; border-color: #3c4550; }
.torrent-ui__description { min-width: 0; }
.torrent-ui__name { color: #f0f4fa; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.torrent-ui__ad { display: inline-block; white-space: nowrap; margin-left: 7px; padding: 2px 7px; color: #ffae73; background: #3a2019; border-radius: 5px; font-size: 12px; font-weight: 700; }
.torrent-ui__stats { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; font-size: 14px; }
.torrent-ui__size { color: #afbfcd; }
.torrent-ui__seeds { color: #36d978; }
.torrent-ui__peers { color: #96a6b6; }
.torrent-ui__actions { display: flex; align-items: center; gap: 8px; }
.torrent-ui__actions a { text-decoration: none; }
.torrent-ui__download { background: #37bf58; color: #041308 !important; font-weight: 700; font-size: 14px; border-radius: 9px; padding: 9px 12px; white-space: nowrap; }
.torrent-ui__download:hover { background: #4ee071; }
.torrent-ui__magnet { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; font-size: 19px; }
.torrent-ui__more { width: 100%; background: transparent; color: #aebdcc; border: 1px solid var(--tor-line); border-radius: 0 0 12px 12px; padding: 13px; font: inherit; cursor: pointer; }
.torrent-ui__more:hover { color: white; background: #111b22; }
.torrent-ui__more[hidden] { display: none; }
.torrent-ui__empty { padding: 25px; color: var(--tor-muted); text-align: center; }
@media (max-width: 900px) {
  .torrent-ui__row { grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .torrent-ui__stats { grid-column: 1; justify-content: flex-start; padding-left: 82px; }
  .torrent-ui__actions { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 600px) {
  .torrent-ui__heading h2 { font-size: 21px; }
  .torrent-ui__row { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .torrent-ui__main { gap: 8px; }
  .torrent-ui__quality { flex-basis: 65px; }
  .torrent-ui__stats { grid-column: 1; padding-left: 0; }
  .torrent-ui__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .torrent-ui__download { padding: 8px 12px; }
}

/* Stage 1.1: compact release names and expandable technical information */
.torrent-ui__row { grid-template-columns: minmax(0,1fr) auto auto; }
.torrent-ui__details-toggle { display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:30px;padding:0 6px;border:0;background:transparent;color:#9aabb9;font:700 19px Arial;cursor:pointer; }
.torrent-ui__details-toggle:hover { color:#fff; }
.torrent-ui__details { grid-column:1 / -1; padding:12px 0 4px 0; border-top:1px solid #1a2932; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 22px; }
.torrent-ui__details[hidden] { display:none !important; }
.torrent-ui__detail { min-width:0; font-size:12px;line-height:1.55;overflow-wrap:anywhere; }
.torrent-ui__detail span { color:#9baab8;margin-right:7px; }
.torrent-ui__detail strong { color:#e9f0f5;font-weight:500; }
.torrent-ui__detail:first-child { grid-column:1 / -1; }
.torrent-ui__name { font-size:13px;line-height:1.4; }
.torrent-ui__row { padding-top:11px;padding-bottom:11px;min-height:56px; }
.torrent-ui__filter { font-size:12px;padding:7px 11px; }
.torrent-ui__quality { font-size:12px; }
.torrent-ui__stats { font-size:12px; }
.torrent-ui__download { font-size:12px;padding:7px 10px; }
@media(max-width:900px) { .torrent-ui__details { grid-template-columns:1fr; } .torrent-ui__details {grid-column:1 / -1;} }
@media(max-width:600px) { .torrent-ui__details {grid-template-columns:1fr;} }

/* Season and episode metadata retained in compact release title */
.torrent-ui__season { display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 5px; background: #17283a; color: #b9d6f7; font-size: 0.86em; font-weight: 600; vertical-align: baseline; white-space: nowrap; }

/* v1.3 — Stable action slots and crisp inline SVG icons */
.torrent-ui__row { grid-template-columns: minmax(0, 1fr) auto 172px; column-gap: 14px; }
.torrent-ui__actions { display: grid; grid-template-columns: 94px 30px 28px; align-items: center; justify-items: center; gap: 8px; width: 172px; min-width: 172px; }
.torrent-ui__download { display: inline-flex; justify-content: center; align-items: center; gap: 5px; width: 94px; height: 34px; padding: 0 7px; line-height: 1; white-space: nowrap; }
.torrent-ui__magnet, .torrent-ui__action-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 34px; min-width: 30px; min-height: 34px; }
.torrent-ui__action-placeholder { visibility: hidden; pointer-events: none; }
.torrent-ui__magnet { color: #c4d0da; transition: color .15s ease; }
.torrent-ui__magnet:hover { color: #36c76a; }
.torrent-ui__icon { display: block; width: 17px; height: 17px; flex-shrink: 0; }
.torrent-ui__details-toggle { width: 28px; height: 34px; min-width: 28px; min-height: 34px; padding: 0; }
.torrent-ui__details-toggle .torrent-ui__icon { transition: transform .18s ease; }
.torrent-ui__details-toggle[aria-expanded="true"] .torrent-ui__icon { transform: rotate(180deg); }
@media (max-width: 900px) { .torrent-ui__row { grid-template-columns: minmax(0,1fr) 172px; } .torrent-ui__actions { grid-column: 2; grid-row: 1 / 3; } }
@media (max-width: 600px) { .torrent-ui__row { grid-template-columns: minmax(0,1fr); } .torrent-ui__actions { grid-column: 1; grid-row: auto; width: 172px; } }
/* ==========================================
   TORRENT UI v1.4 — ICON POLISH
   ========================================== */

/* Красный магнит */
.torrent-ui__magnet {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 34px;
    min-width: 30px;

    text-decoration: none;
    cursor: pointer;
}

.torrent-ui__magnet-emoji {
    display: block;

    font-size: 21px;
    line-height: 1;

    transition: transform 0.18s ease;
}

.torrent-ui__magnet:hover .torrent-ui__magnet-emoji {
    transform: scale(1.15);
}

/* Кнопка скачать */
.torrent-ui__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.torrent-ui__download .torrent-ui__icon {
    width: 16px;
    height: 16px;
}

/* Кнопка раскрытия подробностей */
.torrent-ui__details-toggle .torrent-ui__icon {
    width: 17px;
    height: 17px;

    transition: transform 0.18s ease;
}

.torrent-ui__details-toggle[aria-expanded="true"] .torrent-ui__icon {
    transform: rotate(180deg);
}

/* Показать ещё */
.torrent-ui__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.torrent-ui__more[hidden] {
    display: none;
}

.torrent-ui__more .torrent-ui__icon {
    width: 17px;
    height: 17px;

    transition: transform 0.2s ease;
}

.torrent-ui__more.is-expanded .torrent-ui__icon {
    transform: rotate(180deg);
}