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

:root {
    /* Colores FileKings - dorado/violeta */
    --gold: #d4af37;
    --gold-light: #f5d976;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --violet: #8b5cf6;
    --violet-glow: rgba(139, 92, 246, 0.3);

    /* macOS dark */
    --bg: #050505;
    --bg-window: rgba(28, 28, 30, 0.7);
    --bg-titlebar: rgba(40, 40, 42, 0.9);
    --bg-card: rgba(44, 44, 46, 0.65);
    --bg-input: rgba(58, 58, 60, 0.8);
    --bg-hover: rgba(255, 255, 255, 0.06);

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);
    --separator: rgba(255, 255, 255, 0.06);

    --text: #f5f5f7;
    --text-dim: #98989d;
    --text-faded: #636366;

    --primary: var(--gold);
    --primary-dark: #b89530;
    --danger: #ff453a;
    --success: #30d158;
    --seeders: #30d158;
    --leechers: #ff9f0a;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-window: 14px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow-window: 0 30px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #000;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Glow background */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.10), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.10), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.02), transparent 70%),
        #000;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===== AUTH PAGE ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-window);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-window);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-window);
    overflow: hidden;
}

/* Title bar */
.titlebar {
    height: 38px;
    background: var(--bg-titlebar);
    border-bottom: 1px solid var(--separator);
    display: flex;
    align-items: center;
    padding: 0 14px;
    position: relative;
}
.flags { display: flex; gap: 8px; align-items: center; }
.flag {
    width: 22px;
    height: 15px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 1px 3px rgba(0,0,0,0.4);
    cursor: default;
    transition: transform 0.15s;
    display: block;
}
.flag:hover { transform: translateY(-1px) scale(1.05); }
.flag svg { display: block; width: 100%; height: 100%; }

.titlebar-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 600;
    pointer-events: none;
}

.auth-body {
    padding: 32px 36px 36px;
    text-align: center;
}

.brand-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}
.brand-lg .crown {
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
}
.crown-logo-sm {
    width: 60px;
    height: 42px;
    filter: drop-shadow(0 0 12px var(--gold-glow));
}
.brand-lg h1 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.brand-lg h1 span {
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
}

.subtitle {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 28px;
}

.brand-sm {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.brand-sm .crown { color: var(--gold); font-size: 18px; }
.brand-sm span { color: var(--gold); }

/* ===== FORM ===== */
.field {
    margin-bottom: 14px;
    text-align: left;
}
.field label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 500;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.hint { font-size: 11px; color: var(--text-faded); margin-top: 4px; }
.hint-ok { color: var(--success); }
.hint-err { color: var(--danger); }

.remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 2px 4px;
    cursor: pointer;
}
.remember-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.remember-row input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}
.remember-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.remember-row span { font-size: 13px; color: var(--text-dim); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s;
    line-height: 1;
}
.btn-primary {
    background: var(--gold);
    color: #000;
    width: 100%;
    margin-top: 14px;
    box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}
.btn-sm { padding: 6px 12px; font-size: 12px; width: auto; margin: 0; }
.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-danger {
    background: var(--danger);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}
.btn-danger:hover { background: #d83b30; }
.btn-icon {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }

.error {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 10px;
    min-height: 18px;
    text-align: center;
}

.auth-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-dim);
}

/* ===== HEADER COMPLETO ===== */
.header {
    background: var(--bg-window);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px 12px;
    gap: 24px;
    max-width: 1300px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.crown-logo {
    width: 70px;
    height: 50px;
    filter: drop-shadow(0 0 16px var(--gold-glow));
    flex-shrink: 0;
}
.brand-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
}
.brand-text h1 span {
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
}
.brand-text small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ===== USER PANEL (estilo FileList) ===== */
.user-panel {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(20, 20, 22, 0.6);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.1), 0 4px 16px rgba(0,0,0,0.4);
    min-width: 380px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.up-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #b89530);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #000;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--gold-glow);
}
.up-info { flex: 1; min-width: 0; }
.up-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}
.up-greet { color: var(--text-dim); }
.up-line strong { color: var(--gold); font-size: 14px; }
.up-role {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 1px;
}

.up-stats {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}
.up-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
}
.up-stat:hover { color: var(--gold); }
.up-stat svg { flex-shrink: 0; }
.up-stat b { color: var(--gold); margin-left: 2px; }

.up-bars {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.up-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}
.up-bar svg { flex-shrink: 0; }
.up-bar span { color: var(--text-dim); }
.up-bar strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.up-up strong { color: #22c55e; }
.up-down strong { color: #ef4444; }
.up-ratio strong { color: var(--gold); }

/* ===== NAV ===== */
.topnav {
    display: flex;
    gap: 4px;
    padding: 0 24px 12px;
    max-width: 1300px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.nav-link {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active {
    background: var(--gold);
    color: #000;
    box-shadow: 0 2px 8px var(--gold-glow);
}

/* ===== MAIN ===== */
.main {
    padding: 28px 24px;
    max-width: 1300px;
    margin: 0 auto;
}
.view-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ===== BROWSE ===== */
.browse-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.select {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.torrents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.torrent-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-window);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}
.torrent-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
    transform: translateX(2px);
}
.tr-icon { font-size: 28px; flex-shrink: 0; }
.tr-info { flex: 1; min-width: 0; }
.tr-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tr-meta {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.tr-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.tr-size {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.tr-peers {
    display: flex;
    gap: 10px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.tr-peers .seeders { color: var(--seeders); }
.tr-peers .leechers { color: var(--leechers); }
.tr-peers .snatched { color: var(--text-dim); }

.loading, .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 13px;
}
.pagination button {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 16px;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-window);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header h3 { margin: 0; }

/* ===== UPLOAD ===== */
.file-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--bg-input);
}
.file-drop:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.05); }
.file-drop input[type="file"] { display: none; }
.file-drop-label { cursor: pointer; color: var(--text-dim); font-size: 14px; }
.file-drop-icon { font-size: 36px; margin-bottom: 8px; }
.file-drop small {
    display: block;
    margin-top: 8px;
    color: var(--gold);
    font-weight: 600;
}

/* ===== LEADERBOARD ===== */
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-window);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.lb-medal {
    font-size: 28px;
    width: 50px;
    text-align: center;
}
.lb-pos { color: var(--text-dim); font-size: 16px; font-weight: 700; }
.lb-info { flex: 1; }
.lb-name { font-weight: 600; font-size: 15px; }
.lb-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.lb-stats {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.lb-stats strong {
    font-size: 16px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.lb-stats span { font-size: 11px; color: var(--text-dim); }

/* ===== PROFILE ===== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--separator);
    font-size: 14px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--text-dim); }
.stat-row strong { color: var(--gold); font-variant-numeric: tabular-nums; }

.passkey-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}
.passkey-box code {
    flex: 1;
    font-size: 11px;
    color: var(--gold);
    word-break: break-all;
    font-family: monospace;
}

/* ===== HELP ===== */
.help-card {
    margin-bottom: 14px;
}
.help-card h3 {
    color: var(--gold);
    font-size: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.help-card p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 12px;
}
.help-card ul, .help-card ol {
    padding-left: 22px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.8;
}
.help-card ul li, .help-card ol li {
    margin-bottom: 6px;
}
.help-card code {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    word-break: break-all;
}
.help-card strong { color: var(--gold-light); }
.help-card a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.help-card a:hover { color: var(--gold-light); }

/* ===== ADMIN ===== */
.invite-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.invite-code {
    font-family: monospace;
    font-size: 12px;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}
.invite-status { font-size: 12px; color: var(--text-dim); }
.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
}
.switch input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 22px;
    background: rgba(120, 120, 128, 0.4);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch input[type="checkbox"]:checked { background: var(--gold); }
.switch input[type="checkbox"]:checked::after { transform: translateX(14px); }

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.open { display: flex; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--bg-window);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-window);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-window);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-content.modal-wide { max-width: 720px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--separator);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px 24px; overflow-y: auto; }

.td-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--text-dim);
}
.td-cat {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.td-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.td-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}
.td-stat strong {
    display: block;
    font-size: 18px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}
.td-stat.seeders strong { color: var(--seeders); }
.td-stat.leechers strong { color: var(--leechers); }
.td-stat span {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.td-description {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
}
.td-actions { display: flex; gap: 12px; }
.td-actions .btn { width: auto; margin: 0; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
    background-clip: content-box;
    border: 2px solid transparent;
}

/* MOBILE */
@media (max-width: 900px) {
    .header-main {
        padding: 14px 14px 10px;
        gap: 14px;
        flex-direction: column;
    }
    .brand-block { width: 100%; }
    .crown-logo { width: 50px; height: 36px; }
    .brand-text h1 { font-size: 1.3rem; }
    .brand-text small { font-size: 10px; }

    .user-panel {
        min-width: 0;
        width: 100%;
        padding: 12px 14px;
        gap: 10px;
    }
    .up-avatar { width: 44px; height: 44px; font-size: 22px; }
    .up-line { font-size: 12px; }
    .up-stats { gap: 10px; flex-wrap: wrap; }
    .up-bars { gap: 8px; }
    .up-bar { font-size: 10px; }

    .topnav {
        padding: 0 14px 10px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .nav-link { font-size: 12px; padding: 7px 12px; flex-shrink: 0; }

    .main { padding: 18px 14px 80px; }

    .browse-toolbar { flex-direction: column; }
    .browse-toolbar .select { width: 100%; }

    .torrent-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .tr-stats { flex-direction: row; align-items: center; justify-content: space-between; }

    .profile-grid { grid-template-columns: 1fr; }
    .td-stats { grid-template-columns: 1fr 1fr; }

    .modal-content { max-width: 100%; }
    .modal { padding: 12px; align-items: flex-end; }
    .modal-content {
        max-height: 92vh;
        border-radius: var(--radius-window) var(--radius-window) 0 0;
        animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes slideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .field input, .field select, .field textarea, .search-input { font-size: 16px; }
}
