:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #101018;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #12121a;
  --bg-hover: #22222e;

  --accent: #d4a843;
  --accent-light: #e8c76a;
  --accent-dark: #b08930;
  --accent-glow: rgba(212, 168, 67, 0.12);

  --text-primary: #e8e6e3;
  --text-secondary: #9a9a9a;
  --text-muted: #5a5a6a;

  --border: #1e1e2a;
  --border-light: #2e2e3a;

  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  --sidebar-width: 260px;
  --header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(212, 168, 67, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(212, 168, 67, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.logo-icon { font-size: 26px; }

.logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo .accent { color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 16px 10px 42px;
  outline: none;
  transition: border-color 0.2s;
}

.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search input::placeholder { color: var(--text-muted); }

.header-stats {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-filter-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.header-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.header-stats span {
  color: var(--accent);
  font-weight: 600;
}

.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 140;
}

.sidebar.open ~ .sidebar-overlay,
.sidebar-overlay.active {
  display: block;
}

.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  align-items: center;
  gap: 8px;
}

.sidebar-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-group {}

.filter-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chips.scrollable {
  max-height: 200px;
  overflow-y: auto;
}

.chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.chip.active {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}

.filter-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
}

.filter-select option { background: var(--bg-card); }

.btn-clear-filters {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-filters:hover {
  color: var(--error);
  border-color: var(--error);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 28px;
  min-width: 0;
}

.view { display: none; }
.view.active { display: block; }

.catalog-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
}

.result-count {
  font-size: 13px;
  color: var(--text-muted);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}

.card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.card-poster {
  aspect-ratio: 2 / 3;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.card-poster-img {
  padding: 0;
}

.card-poster-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-poster-fallback {
  padding: 16px;
}

.card-poster-icon {
  font-size: 40px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.card-poster-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-poster-year {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.card-nota {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-body {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-meta span {
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0 8px;
}

.page-btn:hover {
  border-color: var(--accent-dark);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-ellipsis {
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.btn-back:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.detail-content {
  animation: fadeIn 0.3s ease;
}

.detail-hero {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
}

.detail-poster {
  width: 220px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.detail-poster-img {
  padding: 0;
}

.detail-poster-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-poster-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.detail-poster-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.3;
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-info h1 {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-original {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-glow);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 20px;
  color: var(--accent-light);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.meta-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.meta-item-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-item-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-trailer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #cc0000;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-trailer:hover {
  background: #e00;
  transform: translateY(-1px);
}

.downloads-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  margin-bottom: 14px;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: all 0.2s;
}

.download-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.download-version {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.download-hash {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-stream {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-stream:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-magnet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-magnet:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.torrent-progress-wrapper {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.torrent-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-light));
  border-radius: 2px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.player-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  background: #000;
  flex-shrink: 0;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.seek-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.seek-bar:hover {
  height: 8px;
}

.seek-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s linear;
  pointer-events: none;
}

.seek-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.audio-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  max-width: 140px;
}

.audio-select option {
  background: #1a1a26;
  color: #fff;
}

@media (max-width: 600px) {
  .volume-wrap { display: none; }
  .audio-select { max-width: 80px; font-size: 10px; }
  .seek-time { min-width: 60px; font-size: 11px; }
}

.video-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.3s;
}

.player-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-state .loading-spinner {
  margin: 0 auto 16px;
}

.hidden { display: none !important; }

.torrent-info-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.info-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.info-value {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-stats {
  display: flex;
  gap: 20px;
}

.mode-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.mode-webrtc {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.mode-http {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-icon { font-size: 13px; }

.stat-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.file-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.file-item:hover { background: var(--bg-hover); }

.file-item.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.file-item-icon { font-size: 18px; }

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 11px;
  color: var(--text-muted);
}

.file-item-progress {
  width: 50px;
  height: 3px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.file-item-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.trailer-frame {
  width: 100%;
  height: 100%;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.5s forwards;
  max-width: 340px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(30px); } }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 150;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .sidebar.open { left: 0; }
  .sidebar-toggle { display: none; }
  .header-filter-btn { display: flex; }
  .main { margin-left: 0; }

  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .detail-hero {
    flex-direction: column;
    align-items: center;
  }

  .detail-poster { width: 180px; }
  .detail-info h1 { font-size: 22px; text-align: center; }
  .detail-original { text-align: center; }
  .detail-tags { justify-content: center; }
  .detail-actions { justify-content: center; }

  .torrent-info-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .info-stats {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 10px; gap: 8px; }
  .logo-icon { font-size: 20px; }
  .logo h1 { font-size: 15px; }
  .header-stats { display: none; }
  .header-search input { font-size: 12px; padding: 8px 12px 8px 36px; }
  .search-icon { left: 10px; }

  .main { padding: 12px; }

  .catalog-header h2 { font-size: 18px; }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-poster { padding: 12px; }
  .card-poster-icon { font-size: 30px; }
  .card-poster-title { font-size: 11px; }
  .card-badge { font-size: 8px; padding: 2px 5px; }
  .card-poster-year { font-size: 10px; padding: 2px 6px; }
  .card-nota { font-size: 10px; padding: 2px 6px; }
  .card-body { padding: 6px 8px 8px; }
  .card-title { font-size: 11px; }
  .card-meta { font-size: 9px; gap: 4px; }

  .player-wrapper { border-radius: var(--radius-sm); }

  .player-controls {
    padding: 6px 8px;
    gap: 6px;
  }

  .ctrl-btn { font-size: 16px; padding: 4px; }
  .seek-bar { height: 8px; }
  .seek-time { min-width: 50px; font-size: 10px; }
  .audio-select { max-width: 70px; font-size: 10px; padding: 3px 5px; }

  .torrent-progress-wrapper { height: 3px; }

  .torrent-info-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .info-value { font-size: 12px; }
  .info-stats { gap: 10px; flex-wrap: wrap; }
  .stat-value { font-size: 11px; }
  .stat-label { font-size: 9px; }

  .detail-hero { gap: 16px; }
  .detail-poster { width: 140px; }
  .detail-poster-icon { font-size: 40px; }
  .detail-poster-title { font-size: 13px; }
  .detail-info h1 { font-size: 18px; }
  .detail-meta-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .meta-item { padding: 8px 10px; }
  .meta-item-value { font-size: 12px; }

  .download-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .download-hash { display: none; }
  .download-version { font-size: 11px; }
  .btn-stream, .btn-magnet { font-size: 11px; padding: 6px 12px; }

  .btn-back { font-size: 12px; padding: 6px 12px; margin-bottom: 16px; }

  .pagination { gap: 4px; }
  .page-btn { min-width: 32px; height: 32px; font-size: 12px; }

  .file-item { padding: 8px 10px; gap: 8px; }
  .file-item-name { font-size: 11px; }
  .file-item-size { font-size: 10px; }

  .sidebar { width: 260px; }
  .sidebar-body { padding: 16px 12px; gap: 18px; }
  .filter-title { font-size: 10px; }
  .chip { font-size: 11px; padding: 4px 10px; }
  .filter-select { font-size: 12px; }

  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: 100%; font-size: 12px; padding: 10px 14px; }

  .modal-content { width: 96%; }
}

@media (max-width: 380px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .logo h1 { font-size: 13px; }
  .header-search { display: none; }
  .card-poster-title { display: none; }
  .detail-meta-grid { grid-template-columns: 1fr; }
}
