:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --panel: rgba(25, 30, 37, .82);
  --panel-solid: #191e25;
  --line: rgba(255, 255, 255, .09);
  --text: #f4f1e8;
  --muted: #9ba4ae;
  --accent: #e9ff70;
  --accent-dark: #151a08;
  --blue: #70d8ff;
  --danger: #ff8077;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--bg);
  background-size: 38px 38px;
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
.ambient { position: fixed; border-radius: 50%; filter: blur(120px); opacity: .13; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; background: var(--accent); top: -180px; right: 5%; }
.ambient-two { width: 340px; height: 340px; background: var(--blue); bottom: -180px; left: 0; }
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; position: relative; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-dark); font-weight: 900; letter-spacing: -.5px; transform: rotate(-4deg); }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 48px; align-items: end; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; max-width: 780px; }
h2 { margin-bottom: 14px; font-size: 24px; letter-spacing: -.025em; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 10px; }
.hero-copy { max-width: 620px; font-size: 18px; color: var(--muted); }
.muted { color: var(--muted); }
.storage-card { padding: 22px; }
.storage-heading, .storage-meta { display: flex; justify-content: space-between; gap: 12px; }
.storage-heading strong { color: var(--accent); }
.storage-track { height: 9px; margin: 16px 0 12px; background: #090b0e; border-radius: 20px; overflow: hidden; }
.storage-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.storage-meta { color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 20px; }
.grid-top { grid-template-columns: 1.25fr .75fr; }
.add-panel, .guide-panel { padding: 28px; }
.magnet-form { display: grid; gap: 12px; }
textarea, input, select { color: var(--text); background: #10141a; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; outline: none; }
textarea, input { padding: 13px 14px; width: 100%; }
textarea { min-height: 108px; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,255,112,.1); }
select { padding: 9px 34px 9px 11px; }
.button { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--text); background: #252b34; font-weight: 750; transition: transform .15s, border-color .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.25); }
.button:disabled { opacity: .45; cursor: wait; }
.button-primary { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }
.button-quiet { background: transparent; }
.button-small { padding: 7px 11px; font-size: 13px; }
.button-danger { color: var(--danger); background: rgba(255,128,119,.08); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps li > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); border: 1px solid rgba(233,255,112,.3); }
.steps strong, .steps small { display: block; }
.steps small { color: var(--muted); }
.section-heading { margin: 56px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.torrent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.torrent-card { padding: 22px; min-width: 0; }
.torrent-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.torrent-top > div { display: flex; gap: 9px; min-width: 0; align-items: center; }
.torrent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--muted); }
.status-4 { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.status-6 { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.badge { color: var(--muted); background: rgba(255,255,255,.055); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; font-size: 11px; white-space: nowrap; }
.badge-live { color: var(--accent); border-color: rgba(233,255,112,.25); }
.badge-muted { color: var(--muted); }
.progress { height: 6px; margin: 20px 0; background: #0c0f13; border-radius: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent)); border-radius: inherit; transition: width .4s; }
.torrent-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.torrent-metrics strong, .torrent-metrics small { display: block; }
.torrent-metrics small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.torrent-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.torrent-error, .error-text { color: var(--danger); }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { color: var(--muted); max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.link-form { display: flex; align-items: center; justify-content: end; gap: 9px; }
.search { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.search input { width: 240px; padding: 9px 11px; }
.empty-state { min-height: 130px; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 28px; }
.empty-state strong { color: var(--text); }
.notice { margin-top: 18px; padding: 12px 15px; border-radius: 11px; border: 1px solid var(--line); }
.notice-success { color: var(--accent); background: rgba(233,255,112,.07); }
.notice-error { color: var(--danger); background: rgba(255,128,119,.07); }
.fresh-link { margin-bottom: 20px; padding: 25px; border-color: rgba(233,255,112,.25); }
.fresh-link h2 { margin-bottom: 18px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.fresh-link .muted { margin: 10px 0 0; font-size: 12px; }
.login-wrap { min-height: calc(100vh - 87px); display: grid; place-items: center; padding: 40px 0 80px; }
.login-card { width: min(440px, 100%); padding: 36px; }
.login-card h1 { font-size: 46px; }
.stacked-form { display: grid; gap: 15px; margin-top: 28px; }
.stacked-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
footer { padding: 56px 0 36px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 820px) {
  .hero, .grid-top { grid-template-columns: 1fr; }
  .hero { padding-top: 50px; gap: 20px; }
  .torrent-grid { grid-template-columns: 1fr; }
  .files-heading { align-items: start; flex-direction: column; }
  .search, .search input { width: 100%; }
  .torrent-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1180px); }
  .brand small { display: none; }
  h1 { font-size: 42px; }
  .hero { padding-top: 36px; }
  .add-panel, .guide-panel, .login-card { padding: 21px; }
  .copy-row { grid-template-columns: 1fr; }
  th, td { padding: 12px; }
  .link-form { justify-content: start; }
}
