/* =====================
   DEFAULT — three columns
   Blue accent, pure dark grey
   Body: #0d0d0d | Cards: #1a1a1a | Elevated: #1e1e1e
   Borders: #2a2a2a / #333
   Accent: #3b82f6 / #2563eb / #1e3a8a / #1e40af
   Links: #60a5fa / #93c5fd | Text: #c9c9c9 / #e0e0e0
===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #0d0d0d;
    color: #c9c9c9;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: #93c5fd;
}

img {
    max-width: 100%;
    height: auto;
}

/* =====================
   LAYOUT (three columns)
===================== */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 12px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 16px;
    padding: 16px 0;
    flex: 1;
}

@media (max-width: 1300px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .portal_sidebar {
        display: none;
    }
}

.portal_sidebar {
    min-width: 0;
}

.portalmain {
    min-width: 0;
}

/* =====================
   NAVBAR
===================== */
.tt_navbar {
    background: #121212;
    border-bottom: 1px solid #1e3a8a;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 12px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-brand img {
    height: 42px;
    display: block;
}

.nav-search {
    display: none;
}
@media (min-width: 768px) {
    .nav-search {
        display: block;
    }
}

.nav-search input {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 7px 14px;
    border-radius: 20px;
    width: 220px;
    outline: none;
}
.nav-search input:focus {
    border-color: #3b82f6;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    position: relative;
    color: #c9c9c9;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
}
.nav-icon:hover {
    color: #60a5fa;
}

/* Notification badge (positioned) */
.nav-icon .badge,
.badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    cursor: pointer;
    object-fit: cover;
}
.user-avatar:hover {
    border-color: #60a5fa;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #c9c9c9;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
}
@media (max-width: 767px) {
    .menu-toggle {
        display: block;
    }
}

/* =====================
   DROPDOWNS
===================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    min-width: 260px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
    overflow: hidden;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    color: #c9c9c9;
    border-bottom: 1px solid #2a2a2a;
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-item:hover {
    background: #2563eb;
    color: #fff;
}

.dropdown-header {
    padding: 12px 14px;
    font-weight: 500;
    color: #e0e0e0;
    border-bottom: 1px solid #2a2a2a;
}

/* =====================
   BLOCKS
===================== */
.tt_block {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    overflow: hidden;
}

.tt_blockhead {
    background: linear-gradient(90deg, #1e3a8a, #1e40af);
    color: #e0e0e0;
    padding: 10px 14px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #1e3a8a;
}

.tt_block > div:last-child {
    padding: 14px;
}

.tt_blockcenter {
    max-width: 900px;
    margin: 0 auto 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

/* =====================
   FORMS
===================== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #e0e0e0;
    font-weight: 500;
}

.form-control,
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: #1e1e1e !important;
    border: 1px solid #333;
    color: #e0e0e0 !important;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: #1e1e1e !important;
    color: #fff !important;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.form-row > * {
    flex: 1;
    min-width: 140px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* =====================
   BUTTONS
===================== */
.ttbtn {
    display: inline-block;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ttbtn:hover {
    background: #3b82f6;
    color: #fff;
}

.ttbtnactive {
    background: #2563eb;
    color: #fff;
    border: 1px solid #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
}

.ttbtn:disabled,
.ttbtn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #1e1e1e;
    color: #888;
}

.ttbtn-success {
    background: #14532d;
    border-color: #16a34a;
    color: #4ade80;
}
.ttbtn-success:hover {
    background: #16a34a;
    color: #fff;
}
.ttbtn-danger {
    background: #7f1d1d;
    border-color: #dc2626;
    color: #f87171;
}
.ttbtn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.appreciate-button {
    display: inline-block;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #3b82f6;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}
.appreciate-button:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.appreciate-button.active,
.appreciate-button.appreciated {
    background: #2563eb;
    color: #fff;
    border-color: #3b82f6;
}
.appreciate-button:disabled,
.appreciate-button.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* =====================
   TABLES
===================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e0e0;
}

.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    text-align: left;
}

.table th {
    background: #1e1e1e;
    font-weight: 600;
}

.table tr:nth-child(even) {
    background: #161616;
}

.tt-torrent-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.82rem;
    line-height: 1.25;
    color: #c9c9c9;
}

.tt-torrent-table th,
.tt-torrent-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #2a2a2a;
    vertical-align: middle;
    white-space: nowrap;
}

.tt-torrent-table th {
    background: #151515;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #aaa;
}

.tt-torrent-table tbody tr:hover {
    background: #1a1a1a;
}

.tt-torrent-table td.tt-col-name {
    white-space: normal;
    max-width: 280px;
    min-width: 140px;
    word-break: break-word;
}

.tt-torrent-table td.tt-col-name a {
    font-weight: 600;
}

.tt-torrent-table .tt-col-num,
.tt-torrent-table .tt-col-icon {
    text-align: center;
    width: 1%;
    padding-left: 4px;
    padding-right: 4px;
}

.tt-torrent-table .tt-col-icon i {
    font-size: 16px !important;
}

@media (max-width: 900px) {
    .tt-torrent-table th.tt-col-name,
    .tt-torrent-table td.tt-col-name {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #121212;
        box-shadow: 2px 0 6px rgba(0,0,0,0.35);
        max-width: 160px;
    }
    .tt-torrent-table thead th.tt-col-name {
        z-index: 2;
        background: #151515;
    }
}

@media (max-width: 600px) {
    .tt-torrent-table {
        font-size: 0.75rem;
    }
    .tt-torrent-table th,
    .tt-torrent-table td {
        padding: 3px 4px;
    }
    .tt-torrent-table td.tt-col-name {
        max-width: 120px;
    }
}

/* =====================
   ALERTS
===================== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert-success {
    background: #052e16;
    border-color: #16a34a;
    color: #4ade80;
}

.alert-error {
    background: #450a0a;
    border-color: #dc2626;
    color: #f87171;
}

.alert-warning {
    background: #422006;
    border-color: #d97706;
    color: #fbbf24;
}

.alert-info {
    background: #0c1a2e;
    border-color: #3b82f6;
    color: #60a5fa;
}

/* =====================
   BADGES (colour variants)
===================== */
.badge-primary { background: #1e3a8a; color: #93c5fd; }
.badge-success { background: #14532d; color: #4ade80; }
.badge-danger  { background: #7f1d1d; color: #f87171; }
.badge-warning { background: #713f12; color: #fbbf24; }
.badge-info    { background: #1e3a8a; color: #60a5fa; }

/* =====================
   PROGRESS
===================== */
.progress {
    background: #1e1e1e;
    border-radius: 6px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    background: #3b82f6;
    height: 100%;
    color: #fff;
    font-size: 12px;
    text-align: center;
    line-height: 20px;
}

/* =====================
   DIVIDER
===================== */
.divider {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 16px 0;
}

/* =====================
   FOOTER
===================== */
footer {
    margin-top: auto;
    padding: 0 12px 16px;
}

.footer-block {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 20px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* =====================
   PAGINATION
===================== */
.page-link {
    background-color: #1a1a1a;
    color: #c9c9c9;
    border: 1px solid #2a2a2a;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 4px;
    display: inline-block;
}
.page-link:hover {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.active > .page-link,
.page-link.active {
    background-color: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

ul.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

ul.pagination li {
    display: inline-block;
    margin: 0;
}

ul.pagination a,
ul.pagination span {
    display: block;
    min-width: 32px;
    padding: 5px 10px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    background: #1a1a1a;
    color: #c9c9c9;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.3;
}

ul.pagination a:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

ul.pagination li.active span {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: bold;
}

ul.pagination li.disabled span {
    opacity: 0.4;
    cursor: default;
}

/* =====================
   MODAL
===================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.open {
    display: flex;
}
.modal-dialog {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
    margin: 20px;
}
.modal-content {
    padding: 0;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-wide .modal-dialog,
.modal-dialog.modal-wide {
    max-width: 1100px;
}

/* =====================
   COLLAPSE
===================== */
.collapse {
    display: none;
    margin-top: 12px;
}
.collapse.open {
    display: block;
}

/* =====================
   UTILITIES
===================== */
.text-center { text-align: center; }
.text-end { text-align: right; }
.rounded { border-radius: 8px; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.p-3 { padding: 1rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.text-success { color: #4ade80; }
.text-danger { color: #f87171; }
.float-right { margin-left: auto; }

/* =====================
   ADMIN
===================== */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 58px);
}

.admin-sidebar {
    width: 280px;
    background: #121212;
    border-right: 1px solid #1e3a8a;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 12px 0;
}

.admin-sidebar .menu-section {
    margin-bottom: 4px;
}

.admin-sidebar .menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-weight: 600;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
}

.admin-sidebar .menu-header:hover {
    background: #1e1e1e;
    border-left-color: #3b82f6;
}

.admin-sidebar .menu-header.active {
    background: #1e3a8a;
    border-left-color: #60a5fa;
    color: #fff;
}

.admin-sidebar .menu-header i.arrow {
    transition: transform 0.2s ease;
    font-size: 12px;
}

.admin-sidebar .menu-header.active i.arrow {
    transform: rotate(90deg);
}

.admin-sidebar .menu-items {
    display: none;
    background: #0d0d0d;
    padding: 6px 0;
}

.admin-sidebar .menu-items.open {
    display: block;
}

.admin-sidebar .menu-items a {
    display: block;
    padding: 8px 16px 8px 28px;
    color: #c9c9c9;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.admin-sidebar .menu-items a:hover {
    background: #1e1e1e;
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.admin-sidebar .menu-items a.active {
    background: #1e3a8a;
    color: #fff;
    border-left-color: #60a5fa;
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
    background: #0d0d0d;
}

.admin-navbar {
    background: #121212;
    border-bottom: 1px solid #1e3a8a;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-navbar .brand img {
    height: 40px;
}

.admin-navbar .user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-navbar .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    cursor: pointer;
    object-fit: cover;
}

@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 58px;
        bottom: 0;
        z-index: 90;
        transition: left 0.25s ease;
    }
    .admin-sidebar.open {
        left: 0;
    }
    .admin-content {
        padding: 15px;
    }
}

/* =====================
   MISC
===================== */
.tticon {
    color: #c9c9c9 !important;
    padding: 0.2rem 0.4rem;
}

.tticon-red {
    color: #3b82f6 !important;
}

.fullwidth {
    width: 100%;
    background-color: #0d0d0d;
}

.scaleA {
    width: 100%;
    max-width: max-content;
}

/* =====================
   TOP 10 / PROFILE / TORRENT
===================== */
.topten-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 16px;
}

.topten-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.profile-layout {
    display: grid;
    grid-template-columns: 180px 1fr 1fr 1fr;
    gap: 20px;
}
.profile-avatar-img {
    max-width: 140px;
    height: auto;
    border-radius: 8px;
}
.profile-section {
    min-width: 0;
}
.profile-edit-grid,
.profile-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.profile-admin-grid {
    grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    .profile-edit-grid,
    .profile-admin-grid {
        grid-template-columns: 1fr;
    }
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 18px;
}

.profile-card h3 {
    margin: 0 0 14px;
    font-size: 1.15rem;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 8px;
    color: #e0e0e0;
}

.profile-avatar-wrap {
    text-align: center;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.profile-actions a {
    color: #60a5fa;
}

.profile-toolbar {
    text-align: right;
    margin: 10px 0 20px;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.torrent-layout {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 24px;
    margin-bottom: 20px;
}
.torrent-side,
.torrent-main,
.torrent-details {
    min-width: 0;
}
.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
}
.detail-list dt {
    font-weight: 600;
    color: #e0e0e0;
}
.detail-list dd {
    margin: 0;
}
.torrent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}
.torrent-admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.torrent-admin-bar a {
    margin-left: 12px;
    color: #c9c9c9;
}
.torrent-admin-bar a:hover {
    color: #60a5fa;
}
.torrent-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.torrent-poster-img {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
    display: block;
}
@media (max-width: 1000px) {
    .torrent-layout {
        grid-template-columns: 1fr;
    }
    .torrent-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================
   BBCode
===================== */
.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    padding: 6px 0;
}

.bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    width: 22px;
    cursor: pointer;
    color: #c9c9c9;
    vertical-align: middle;
    padding: 2px;
}
.bb-btn:hover {
    color: #60a5fa;
}
.bb-btn img {
    height: 20px;
    width: 20px;
    display: block;
}

.bb-select {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
    height: 26px;
    max-width: 120px;
}
.bb-select:focus {
    border-color: #3b82f6;
    outline: none;
}

.emoji-panel {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    margin-bottom: 10px;
    max-height: 180px;
    overflow-y: auto;
}
.emoji-panel a {
    display: inline-block;
    padding: 3px 5px;
    font-size: 18px;
    cursor: pointer;
}
.emoji-panel a:hover {
    background: #2563eb;
    border-radius: 4px;
}

.bbcode-textarea {
    margin-bottom: 10px;
}
.bbcode-textarea textarea {
    width: 100%;
}

.bbcode-actions {
    margin-top: 8px;
    margin-bottom: 12px;
}
.bbcode-actions .ttbtn {
    margin: 0 4px;
}

/* =====================
   SHOUTBOX / COMMENTS / MESSAGES
===================== */
.shout-bbcode {
    width: 100%;
}
.shout-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.shout-input-row .form-control {
    flex: 1;
}
.shout-input-row .ttbtn {
    flex-shrink: 0;
}

/* ========== shoutbox ========== */
.shoutbox-wrapper {
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.shoutbox-messages {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

.shoutbox-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;          /* important for controlled widths */
}

.shoutbox-table td {
    padding: 6px 8px;
    vertical-align: top;
    border-bottom: 1px solid #2a2a2a;
}

.shout-time {
    width: 110px;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #888;
}

.shout-user {
    width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shout-user img {
    vertical-align: middle;
    border-radius: 3px;
    margin-right: 4px;
}

.shout-msg {
    word-break: break-word;
}

/* ========== MOBILE FIX ========== */
@media (max-width: 600px) {
    .shoutbox-table,
    .shoutbox-table tbody,
    .shoutbox-table tr,
    .shoutbox-table td {
        display: block;
        width: 100% !important;
    }

    .shoutbox-table tr {
        padding: 8px 10px;
        border-bottom: 1px solid #2a2a2a;
        position: relative;
    }

    .shoutbox-table td {
        border: none;
        padding: 2px 0;
    }

    /* Time + User on the same line */
    .shout-time {
        display: inline-block;
        width: auto !important;
        margin-right: 8px;
        font-size: 0.75rem;
        color: #777;
    }

    .shout-user {
        display: inline-block;
        width: auto !important;
        max-width: calc(100% - 100px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    .shout-msg {
        display: block;
        margin-top: 4px;
        padding-left: 0;
        line-height: 1.4;
    }

    /* Optional: make action icons a bit tighter */
    .shout-msg a {
        margin-left: 6px;
        opacity: 0.7;
    }
}

.comment-item {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}
.comment-side {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
    text-align: center;
}
.comment-body {
    flex: 1;
    min-width: 0;
}
.comment-actions {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: 10px;
    align-items: center;
}
@media (max-width: 700px) {
    .comment-item {
        flex-direction: column;
    }
    .comment-side {
        width: 100%;
    }
}

.conversation {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

.message-me {
    background: #1e293b;
    border-left: 4px solid #3b82f6;
}

.message-other {
    background: #1a1a1a;
    border-left: 4px solid #4b5563;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.message-date {
    font-size: 12px;
    color: #64748b;
}

.message-body {
    color: #e0e0e0;
    line-height: 1.55;
    word-break: break-word;
}

/* =====================
   AJAX / TAGS
===================== */
#country-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    z-index: 9999;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    max-height: 220px;
    overflow-y: auto;
    min-width: 180px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

#country-list li {
    padding: 9px 12px;
    cursor: pointer;
    color: #c9c9c9;
    font-size: 0.95rem;
    border-bottom: 1px solid #2a2a2a;
}

#country-list li:last-child {
    border-bottom: none;
}

#country-list li:hover,
#country-list li:active {
    background: #2563eb;
    color: #fff;
}

.tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    background: #1e1e1e;
    border: 1px solid #333;
    color: #c9c9c9;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

.tag-badge:hover {
    border-color: var(--tag-color, #3b82f6);
    color: #fff;
}

.tag-badge.active {
    background: var(--tag-color, #3b82f6);
    border-color: var(--tag-color, #3b82f6);
    color: #fff;
    font-weight: 500;
}

/* =====================
   HOME / CAROUSEL / NFO / CATS
===================== */
.home-poster-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 4px 14px;
    scroll-snap-type: x mandatory;
}

.home-poster-item {
    flex: 0 0 auto;
    width: 110px;
    scroll-snap-align: start;
    text-align: center;
}

.home-poster-item img {
    width: 110px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
}

.home-poster-meta {
    font-size: 12px;
    margin-top: 4px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}

.home-grid-item img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
}

.poster-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.35s ease;
    gap: 12px;
}

.carousel-slide {
    flex: 0 0 calc(20% - 10px);
    max-width: calc(20% - 10px);
    text-align: center;
}

.carousel-slide img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
}

.carousel-meta {
    margin-top: 4px;
    font-size: 12px;
}

.carousel-btn {
    background: #1e1e1e;
    border: 1px solid #3b82f6;
    color: #e0e0e0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: #3b82f6;
    color: #fff;
}

@media (max-width: 1100px) {
    .carousel-slide {
        flex: 0 0 calc(25% - 9px);
        max-width: calc(25% - 9px);
    }
}
@media (max-width: 800px) {
    .carousel-slide {
        flex: 0 0 calc(33.333% - 8px);
        max-width: calc(33.333% - 8px);
    }
}
@media (max-width: 550px) {
    .carousel-slide {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
}

.nfo-view {
    margin: 0;
    padding: 12px;
    max-height: 70vh;
    overflow: auto;
    white-space: pre;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.2;
    background: #111;
    color: #c9c9c9;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

.browse-cats {
    font-size: 0.85rem;
    line-height: 1.5;
}

.browse-cat-row {
    margin-bottom: 2px;
}

.browse-cat-parent {
    font-weight: 600;
    color: #aaa;
    margin-right: 4px;
}

.browse-cat-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 8px 0 0;
    white-space: nowrap;
}

.browse-cat-item input {
    margin: 0;
    transform: scale(0.9);
}

.side-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.side-cat-list li {
    display: block;
    width: 100%;
    border-bottom: 1px solid #2a2a2a;
}

.side-cat-list li:last-child {
    border-bottom: 0;
}

.side-cat-list a {
    display: block;
    width: 100%;
    padding: 6px 10px;
    color: #c9c9c9;
    text-decoration: none;
    box-sizing: border-box;
}

.side-cat-list a:hover {
    background: #1a1a1a;
    color: #fff;
}

.side-cat-list,
.side-cat-list li {
    flex: 0 0 100%;
    max-width: 100%;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.catalog-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px;
}
.catalog-card-body {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.catalog-poster {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.friend-list {
    display: grid;
    gap: 10px;
}
.friend-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}
.friend-actions a {
    margin-right: 10px;
}

/* =====================
   POST / CODE
===================== */
.attachment-preview {
    max-width: 110px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.post-content {
    min-width: 0;
}

.post-body-text {
    min-width: 0;
    overflow-x: auto;
    flex: 1 1 0%;
}

.bb-code {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    overflow: auto;
    box-sizing: border-box;
    min-width: 0;
    white-space: pre;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #333;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 10px 0;
}

.bb-code code {
    display: block;
    white-space: pre;
}

/* =====================
   FAQ
===================== */
.faq-list {
    width: 100%;
    max-width: 960px;
    min-width: 0;
    margin: 0 auto;
    color: #c9c9c9;
}

.faq-section {
    width: 100%;
    min-width: 0;
    margin-bottom: 2.5rem;
}

.faq-section-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #e0e0e0;
    font-size: 1.35rem;
    margin: 0 0 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2a2a2a;
}

.faq-item {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    margin-bottom: 0.6rem;
    background: #121212;
    color: #c9c9c9;
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 12px;
    padding: 0.95rem 1.15rem;
    cursor: pointer;
    font-weight: 600;
    color: #c9c9c9;
    list-style: none;
    user-select: none;
    background: #1e1e1e;
    transition: background 0.15s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::marker {
    content: "";
}

.faq-question {
    flex: 1 1 auto;
    min-width: 0;
    color: #c9c9c9;
    overflow-wrap: anywhere;
    word-break: normal;
}

.faq-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

.faq-item-actions a {
    color: #60a5fa;
    opacity: 0.85;
    text-decoration: none;
}

.faq-item-actions a:hover {
    color: #93c5fd;
    opacity: 1;
}

.faq-item summary::after {
    content: "▸";
    flex: 0 0 auto;
    margin-left: 4px;
    font-size: 1.15em;
    color: #60a5fa;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(90deg);
}

.faq-item summary:hover {
    background: #252525;
}

.faq-answer {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 1rem 1.15rem 1.2rem;
    border-top: 1px solid #2a2a2a;
    line-height: 1.6;
    background: #121212;
    color: #c9c9c9;
    white-space: normal;
    overflow-wrap: anywhere;
}

.faq-answer p {
    color: #c9c9c9;
    margin: 0 0 1rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0 1rem;
}

.faq-answer a {
    color: #60a5fa;
}

.faq-answer a:hover {
    color: #93c5fd;
}

.faq-answer table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    color: #c9c9c9;
}

.faq-answer th,
.faq-answer td {
    padding: 0.65rem;
    border: 1px solid #2a2a2a;
    text-align: left;
    color: #c9c9c9;
}

.faq-answer th {
    background: #1e1e1e;
}

.faq-answer img {
    max-width: 100%;
    height: auto;
}

.faq-answer pre {
    max-width: 100%;
    overflow-x: auto;
    background: #1e1e1e;
    color: #c9c9c9;
    padding: 12px;
    border-radius: 5px;
}

.faq-answer code {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .faq-item summary {
        padding: 0.8rem;
        gap: 8px;
    }
    .faq-answer {
        padding: 0.8rem;
    }
    .faq-answer table {
        display: block;
        overflow-x: auto;
    }
}

/* =====================
   RATING
===================== */
/* Make clickable stars look like normal stars */
.rating-user.rate-stars form {
    display: inline-block;
    margin: 0 2px;
    vertical-align: middle;
}

.rating-user.rate-stars .star-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;          /* same color as other stars */
    font-size: inherit;      /* same size */
    line-height: 1;
    vertical-align: middle;
    box-shadow: none;
    outline: none;
}

/* Optional: hover effect */
.rating-user.rate-stars .star-btn:hover i,
.rating-user.rate-stars .star-btn:focus i {
    color: #f5c518;          /* or whatever gold/yellow you use */
}

/* Make sure the icon itself matches */
.rating-user.rate-stars .star-btn i {
    font-size: inherit;
    line-height: 1;
}

/* ========== Mobile Menu ========== */
.menu-toggle {
    display: none;               /* hidden on desktop */
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 10px;
    margin-right: 8px;
}

.mobile-nav {
    display: none;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav.open {
    display: block;
    max-height: 500px;           /* enough for all links */
}

.mobile-nav-inner {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav-inner a {
    color: #ddd;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.95rem;
}

.mobile-nav-inner a:last-child {
    border-bottom: none;
}

.mobile-nav-inner a:hover {
    color: #fff;
}

/* Show hamburger only on mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
    }

    /* Optional: hide desktop search on very small screens if needed */
    .nav-search {
        display: none;
    }
}