body { 
    background: #0b0b0b; 
    color: #eee; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 20px; 
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100vw;
}

@media (min-width: 769px) {
    html, body {
        overflow-x: hidden;
    }
}

.container { 
    max-width: 900px; 
    margin: 0 auto; 
    width: 100%;
    box-sizing: border-box;
}

.search-box, .torrent-card, .torrent-info, .torrent-title {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

header { text-align: center; margin-bottom: 30px; }
h1 { font-size: 3rem; margin: 0; color: white; letter-spacing: -1px; }
h1 span { color: #f1c40f; }

.search-box { 
    width: 100%; 
    padding: 12px; 
    background: #1a1a1a; 
    border: 1px solid #333; 
    border-radius: 8px; 
    color: white; 
    font-size: 1.2rem; 
    margin-bottom: 20px; 
    box-sizing: border-box; 
}
.search-box:focus { outline: none; border-color: #f1c40f; }

.filter-buttons { 
    display: flex; 
    gap: 6px; 
    margin-bottom: 30px; 
    justify-content: center; 
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

.filter-btn { 
    background: #1a1a1a; 
    border: 1px solid #333; 
    color: #aaa; 
    padding: 8px 12px; 
    border-radius: 20px; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.85rem; 
    white-space: nowrap;
    min-width: fit-content;
    flex: 1 1 auto;
    justify-content: center;
}

.filter-btn:hover { border-color: #f1c40f; color: white; }
.filter-btn.active { background: #f1c40f; color: black; border-color: #f1c40f; font-weight: bold; }
.bg-icon { width: 20px; height: 14px; object-fit: contain; }

#btn-bgarena.active { background: #e67e22; border-color: #e67e22; color: black !important; }
#btn-bgarena:hover:not(.active) { border-color: #e67e22; color: white; }
.arena-card { border-left-color: #e67e22 !important; }

#btn-zelka.active { background: #b3db86; border-color: #b3db86; color: black !important; }
#btn-zelka:hover:not(.active) { border-color: #b3db86; color: white; }
.zelka-card { border-left-color: #b3db86 !important; }

.torrent-card { 
    background: #161616; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    border-left: 4px solid #333; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px; 
}
.torrent-card:hover { border-left-color: #f1c40f; background: #1c1c1c; }
.torrent-info { 
    flex-grow: 1; 
    min-width: 0;
    max-width: calc(100% - 120px);
}

.torrent-title { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #44aaff; 
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.title-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.torrent-desc { 
    font-size: 0.85rem; 
    color: #bbb; 
    margin-bottom: 10px; 
    font-style: italic; 
    line-height: 1.3; 
    display: block !important; 
}

.torrent-meta {
    font-size: 0.8rem; 
    color: #555; 
    display: flex; 
    gap: 6px; 
    align-items: center;
    max-width: 100%;
    flex-wrap: wrap;
}

.meta-tag { 
    background: #222; 
    border: 1px solid #333; 
    border-radius: 4px; 
    height: 24px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    font-family: 'Consolas', 'Monaco', monospace; 
    padding: 0 5px; 
    box-sizing: border-box; 
    white-space: nowrap; 
}

.torrent-meta .meta-tag:nth-child(1) { min-width: 110px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; color: #aaa; }
.size-tag { width: 85px; color: #f1c40f !important; border-color: #f1c40f44 !important; font-weight: bold; }
.torrent-meta .meta-tag:last-child { width: 90px; color: #666; }

.magnet-btn { 
    background: #1a1a1a; 
    color: #f1c40f; 
    border: 1px solid #f1c40f; 
    padding: 8px 15px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: bold; 
    transition: 0.3s; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    white-space: nowrap; 
    min-width: 120px; 
    justify-content: center; 
}

.magnet-btn:hover { 
    background: #f1c40f; 
    color: black; 
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.4); 
}

.arena-btn { 
    color: #e67e22 !important; 
    border-color: #e67e22 !important; 
    min-width: 120px !important; 
    justify-content: center !important; 
}
.arena-btn:hover { background: #e67e22 !important; color: black !important; }

.zelka-btn { 
    color: #b3db86 !important; 
    border-color: #b3db86 !important; 
    min-width: 120px !important; 
    justify-content: center !important; 
}
.zelka-btn:hover { background: #b3db86 !important; color: black !important; }

.magnet-btn .bg-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 3px;
}

#loading { text-align: center; color: #666; padding: 20px; display: none; }
.empty-state { text-align: center; color: #444; margin-top: 50px; font-style: italic; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.85); backdrop-filter: blur(5px); }
.modal-content { background-color: #1a1a1a; margin: 5% auto; padding: 30px; border: 1px solid #333; width: 90%; max-width: 600px; border-radius: 12px; position: relative; box-shadow: 0 0 50px rgba(0,0,0,0.8); text-align: center; color: #eee; }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; position: absolute; right: 20px; top: 10px; }
.close-btn:hover { color: #fff; }
.modal h2 { margin-top: 0; color: #f1c40f; }
.modal-desc { color: #888; margin-bottom: 20px; font-size: 0.9rem; }
.modal h2 .save-icon { width: 32px; height: 32px; vertical-align: middle; margin-right: 10px; margin-bottom: 6px; }

.stats-bar {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap; 
    gap: 4px;
    margin-top: 15px;
    padding: 4px;
    background: transparent;
    border: none;
    overflow-x: auto;
    max-width: 100%;
}

.stat-item {
    display: flex;
    align-items: center;
    background: #111;
    padding: 2px 6px; 
    border-radius: 4px;
    border: 1px solid #333;
    transition: all 0.2s;
    cursor: default;
    height: 18px;
    flex-shrink: 0;
    position: relative;
}
.stat-item:hover { border-color: #666; background: #222; }
.stat-item img { width: 12px; height: 12px; object-fit: contain; margin-right: 5px; opacity: 0.8; }
.stat-item:hover img { opacity: 1; }
.stat-text { display: flex; flex-direction: row; align-items: center; gap: 3px; line-height: 1; }
.stat-label { font-size: 0.65rem; color: #888; text-transform: uppercase; white-space: nowrap; }
.stat-label::after { content: ":"; }
.stat-count { font-size: 0.7rem; font-weight: bold; color: #ccc; font-family: monospace; white-space: nowrap; }

.footer-links {
    color: #888;
    font-size: 0.9em;
    margin: 10px 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}
.footer-links a { color: #888; text-decoration: none; margin: 0 5px; }
.footer-links a:hover { color: #f1c40f; }

.crypto-wallets { margin: 15px 0; }
.crypto-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #222;
    border-radius: 6px;
    border: 1px solid #333;
}
.crypto-icon { width: 24px; height: 24px; margin-right: 8px; flex-shrink: 0; }
.crypto-info { flex: 1; min-width: 0; }
.crypto-name { font-weight: bold; color: #f1c40f; margin-bottom: 2px; font-size: 0.8em; }
.crypto-address {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.7em;
    color: #ccc;
    word-break: break-all;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 3px;
    background: #1a1a1a;
    border: 1px solid #444;
    transition: all 0.2s ease;
}
.crypto-address:hover { background: #333; border-color: #f1c40f; color: white; }

.qr-tooltip {
    position: absolute;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.search-instructions { background-color: #111; border: 1px solid #333; border-radius: 8px; padding: 15px 20px; margin-top: 20px; text-align: left; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.search-instructions ol { margin: 0; padding-left: 20px; color: #bbb; font-size: 0.9rem; font-family: 'Segoe UI', sans-serif; }
.search-instructions li { margin-bottom: 8px; line-height: 1.5; }
.search-instructions li:last-child { margin-bottom: 0; }
.search-instructions strong { color: #c0392b; font-weight: 600; }

.trocador-section {
    margin: 15px 0 5px 0;
    text-align: center;
    line-height: 1;
    overflow: hidden;
}
.trocador-section p { margin: 0; padding: 0; color: #ccc; position: relative; z-index: 1; }
.trocador-section iframe {
    border-radius: 1px;
    background: #1a1a1a;
    width: 290px;
    height: 285px;
    margin: -30px auto -40px auto;
    display: block;
    border: none;
    outline: none;
    overflow: hidden;
    max-width: 100%;
}

.thank-you-gif { text-align: center; margin: 30px 0 0 0; }
.thank-you-gif img { max-width: 150px; height: auto; border-radius: 8px; opacity: 0.8; }

@media (max-width: 768px) {
    body { 
        padding: 10px; 
        margin: 0;
        width: 100%;
        max-width: 100%;
        overscroll-behavior-y: none;
    }

    .container { width: 100%; padding: 0 10px; max-width: 100%; }

    .search-box { width: 100%; font-size: 1rem; padding: 8px; box-sizing: border-box; margin: 0 auto 20px auto; }

    header { margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; }
    h1 { font-size: 2.2rem; margin-top: 10px; }

    .stats-bar { gap: 3px; margin-top: 10px; justify-content: center; padding-bottom: 8px; overflow: visible; }
    .stat-label { display: none; }
    .stat-item { padding: 1px 4px; height: 16px; cursor: pointer; position: relative; z-index: 1; }
    .stat-item::before { content: ''; position: absolute; top: -6px; left: -6px; right: -6px; bottom: -6px; z-index: -1; }
    .stat-item img { margin-right: 3px; width: 10px; height: 10px; pointer-events: none; }
    .stat-count { font-size: 0.65rem; pointer-events: none; }

    .stat-item::after {
        content: attr(data-label);
        position: absolute;
        top: 115%;
        left: 50%;
        transform: translateX(-50%);
        background: #f1c40f;
        color: #000;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.7rem;
        font-weight: bold;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s;
        z-index: 9999;
        pointer-events: none;
    }
    .stat-item.show-tooltip::after { opacity: 1; visibility: visible; }
    .stat-item:first-child::after { left: 0; transform: translateX(0); }
    .stat-item:last-child::after { left: auto; right: 0; transform: translateX(0); }

    .filter-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 20px; }
    .filter-btn { justify-content: center; padding: 4px 2px; font-size: 0.7rem; border-radius: 8px; height: 28px; min-width: 0; flex: none; width: 100%; }
    .filter-btn img { display: block !important; width: 14px; height: 10px; margin-right: -2px; }

    .torrent-card { flex-direction: column; align-items: flex-start; padding: 12px; gap: 12px; border-left-width: 3px; overflow: hidden; }
    .torrent-info { width: 100%; max-width: 100% !important; overflow: hidden; }
    .torrent-title { font-size: 1rem; line-height: 1.4; margin-bottom: 8px; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 100% !important; hyphens: auto; display: flex; align-items: flex-start; gap: 4px; min-width: 0; flex: 1; width: 100%; overflow: hidden; }
    .torrent-title img { flex-shrink: 0; margin-top: 2px; }
    .torrent-desc { font-size: 0.8rem; margin-bottom: 8px; word-wrap: break-word; overflow-wrap: break-word; }
    .torrent-meta { flex-wrap: wrap; gap: 6px; width: 100%; }
    .meta-tag { font-size: 0.75rem; height: 22px; flex-grow: 1; text-align: center; padding: 0 4px; }
    .torrent-meta .meta-tag:nth-child(1), .size-tag, .torrent-meta .meta-tag:last-child { width: auto; min-width: auto; max-width: none; }
    .torrent-actions { width: 100%; }
    .magnet-btn { display: flex; width: 100%; justify-content: center; padding: 12px; font-size: 1rem; box-sizing: border-box; }

    .modal-content { width: 90%; margin: 5% auto; padding: 15px; max-height: 90vh; overflow-y: auto; }

    .crypto-item { flex-direction: row; text-align: left; }
    .crypto-icon { margin-right: 10px; margin-bottom: 0; }
    .crypto-address { font-size: 0.7em; padding: 6px; }

    .trocador-section iframe { width: 100%; max-width: 280px; height: 320px; }
    .qr-tooltip { display: none !important; }
}

#online-counter {
    position: fixed;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
header h1 a {
    color: inherit;
    text-decoration: none;
}

header h1 a:hover {
    color: inherit;
    text-decoration: none;
}
