/* Add universal box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    background-color: #ffffff;
    color: #000000;
    height: 100%;
}

a {
    color: #0000cd;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    border: none;
    vertical-align: middle;
    display: inline-block;
}

/* Layout Containers */
.container {
    max-width: 1200px; /* Increased from 1024px */
    margin: 0 auto;
    padding: 0 5px; /* Reduced padding */
    background-color: transparent;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Block */
.header-block {
    background: var(--header-bg);
    border: 1px solid var(--header-border);
    padding: var(--header-padding-top) var(--header-padding-sides) var(--header-padding-bottom);
    position: relative;
    height: auto;
    min-height: 10px; /* Increased from 190px to accommodate the moved filters */
    z-index: 2;
}

/* Adjust right section positioning */
.right-section {
    position: absolute;
    top: 58px; /* Reduced from 60px to move ad up 2px */
    right: 3px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    z-index: 3;
}

/* Style for the top-right ad */
.right-ad {
    width: 468px;
    height: 60px;
}

.right-ad img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-nav {
    margin-bottom: 10px;
    text-align: left;
}

.top-nav a {
    color: #003366;
    text-decoration: none;
    font-size: 12px;
    margin: 0 3px;
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: space-between;
}

.left-section {
    display: flex;
    gap: 15px;
}

.left-content {
    display: flex;
    gap: 15px;
}

.top-logo {
    width: 120px;
    height: auto;
    flex-shrink: 0;
}

/* Set logo height explicitly */
.site-logo {
    width: auto;
    height: var(--logo-height);
    object-fit: contain;
}

.right-of-logo {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: var(--logo-height);
    gap: 5px;
    padding-top: 15px; /* Reduced padding to fit content better */
}

/* Styles for Nav/Search Stack */
.nav-search-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    justify-content: space-between;
}

.header-nav-links {
    text-align: left;
    margin-bottom: 5px;
}

.header-nav-links a {
    margin-right: 8px;
    color: #0000cd;
    font-weight: normal;
    font-size: 11px;
}

.header-nav-links a.selected {
    color: #d2691e;
    text-decoration: none;
}

.nav-links {
    margin: 0;
    margin-bottom: -20px; /* Increased from 3px to push content down */
    margin-top: 0px;   /* Added to create more space above */
}

.search-form {
    display: flex;
    gap: 5px;
    justify-content: center;
    width: auto;
}

.search-container {
    display: flex;
    gap: 10px;
    margin: 0;
    margin-top: 20px; /* Reduced from 40px */
    margin-bottom: -60px; /* Adjusted from -90px */
}

.search-form input[type="text"] {
    width: 400px; /* Adjust width as needed */
    padding: 5px 10px;
    border: 1px solid #999;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.search-input {
    width: 407px;
    padding: 2px 5px;
    border: 1px solid #999;
    height: 30px; /* Adjust this value to make the search bar taller or shorter */
    padding: 5px 10px; /* Adjust padding to fine-tune the internal spacing */
    line-height: 30px; /* Match this to height for vertical centering */
}

.search-form input[type="submit"] {
    padding: 4px 15px;
    background: linear-gradient(to bottom, #f0f0f0, #e5e5e5);
    border: 1px solid #999;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
}

.pirate-search-btn {
    padding: 0px 4px;
    background: #F0F0F0;
    border: 1px solid #999;
    cursor: pointer;
    height: 30px; /* Match this to the search-input height */
    line-height: 30px; /* Match this to the height */
}

.search-form input[type="submit"]:hover {
    background: linear-gradient(to bottom, #e5e5e5, #d5d5d5);
}

/* Category Filters Section */
.category-filters {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 15px */
    padding: 6px 10px; /* Reduced from 8px 15px */
    background: linear-gradient(to bottom, #f9f9f9, #f6f6f6);
    border-bottom: 1px solid #ccc;
}

/* Position the category select dropdown */
.category-select {
    position: relative;
    right: auto;
    top: 35px; /* Reduced from 63px */
    margin: 0 10px;
    height: 20px;
    padding: 1px 5px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 11px;
    z-index: 1;
}

/* Adjust filter row to make space for dropdown */
.filter-row {
    display: flex;
    gap: 12px;
    margin-left: -5px;
    margin-top: 85px; /* Reduced from 105px */
}

.category-filters label {
    display: flex;
    align-items: center;
    gap: 2px; /* Reduced from 4px */
    font-size: 11px;
    color: #444;
    cursor: pointer;
}

.filter-row label {
    display: flex;
    align-items: center;
    gap: 0px;
    font-size: 11px;
    color: #555;
    white-space: nowrap;
}

.category-filters input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

.category-filters img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.filter-row img {
    width: 16px;
    height: 16px;
}

/* Main 3-Column Layout */
.main-wrapper {
    display: flex;
    gap: 5px; /* Reduced from 10px */
    align-items: flex-start;
    flex-grow: 1;
    padding-top: 15px;
    min-height: auto;
    max-height: none;
}

.sidebar {
    position: sticky;
    top: 10px;
    z-index: 1;
    background: #ffffff;
    border: 1px solid #cccccc;
    padding: 5px;
    width: 160px;
    overflow: hidden;
    box-sizing: border-box;
    text-align: center;
    flex-shrink: 0;

    /* Add fallback */
    @supports not (position: sticky) {
        position: relative;
        top: 0;
    }
}

.left-sidebar {
    order: 1;
}

.right-sidebar {
    order: 3;
}

/* Styles for the sidebar ad images */
.sidebar-ad-link {
    display: block;
}
.sidebar-ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid #cccccc;
     margin: 0 auto;
}

.main-content {
    flex-grow: 1;
    order: 2;
    background-color: #ffffff;
    padding: 8px;
    border: 1px solid #cccccc;
    overflow-y: visible;
    max-height: none;
    min-width: 0; /* Allow content to shrink if needed */
}

/* Styles for Info Boxes */
.info-box {
    border: 1px solid #c9c4b9;
    background-color: #f2efe9;
    padding: 6px 8px;
    margin-bottom: 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #333;
}

.info-box.warning {
    text-align: center;
    font-weight: normal;
}

.info-box.privacy {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-box.privacy div {
    flex-grow: 1;
    margin-right: 10px;
}

.info-box.privacy small {
    font-size: 10px;
    color: #666;
    display: block;
    margin-top: 2px;
}

.hide-ip-button {
    background-color: #e59400;
    color: #ffffff;
    padding: 5px 10px;
    border: 1px solid #c07d00;
    border-radius: 3px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
}

.hide-ip-button:hover {
    background-color: #d48800;
    text-decoration: none;
    color: #ffffff;
}

/* Main Content Headings */
.main-content h2 {
    font-size: 14px;
    margin: -5px 0;
    color: #333333;
    font-weight: bold;
}

.results-info {
    font-size: 10px;
    color: #555555;
    margin-bottom: 10px;
    text-align: right;
}

/* Results Table Styling */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: -5px;
    border: 1px solid #B3B3B3;
}

.results-table th,
.results-table td {
    border: 1px solid #B3B3B3;
    padding: 3px 4px;
    text-align: left;
    font-size: 11px;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 300px;
}

.results-table thead th {
    background: -webkit-linear-gradient(top, #f6f6f6, #eaeaea);
    background: -moz-linear-gradient(top, #f6f6f6, #eaeaea);
    background: linear-gradient(to bottom, #f6f6f6, #eaeaea);
    font-weight: bold;
    color: #000000;
    text-align: left;
    padding: 4px;
}
.results-table thead th:nth-child(3), /* Uploaded */
.results-table thead th:nth-child(4), /* DL */
.results-table thead th:nth-child(6), /* SE */
.results-table thead th:nth-child(7) { /* LE */
     text-align: center;
}
.results-table thead th:nth-child(5) { /* Size */
    text-align: center;
}
.results-table td:nth-child(4) { /* DL */
    text-align: center;
}
.results-table td:nth-child(5) { /* Size */
    text-align: center;
}
.results-table td:nth-child(6), /* SE */
.results-table td:nth-child(7) { /* LE */
    text-align: center;
}

.results-table td:nth-child(6), /* PL (Plays) */
.results-table td:nth-child(7) { /* CM (Comments) */
    text-align: center;
    font-family: 'Verdana', sans-serif;
    color: #004E98;
    cursor: pointer;
}

.results-table td:nth-child(6):hover, /* PL hover */
.results-table td:nth-child(7):hover { /* CM hover */
    text-decoration: underline;
    background-color: #f0f0f0;
}

/* Add this for play count formatting */
.play-count {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #004E98;
    font-weight: normal;
    transition: opacity 0.3s;
    text-align: center;
}

/* Add this for comment count formatting */
.comment-count {
    color: #004E98;
    font-weight: normal;
    transition: opacity 0.3s;
    text-align: center;
}

.results-table td:nth-child(2) a { /* Name */
   font-weight: normal;
   color: #0000cd;
}

.results-table td:nth-child(1) { /* Type */
    color: #004E98;
    font-weight: normal;
}
.results-table td:nth-child(1) a {
    color: #004E98;
}
.results-table td:nth-child(1) br {
    display: none;
}

.dl-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.results-table tbody tr {
    background-color: #ffffff;
}
.results-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
.results-table tbody tr:hover {
    background-color: #eeeeee;
}

/* Footer */
.site-footer {
    margin-top: 20px;
    text-align: center;
    clear: both;
    flex-shrink: 0;
}

/* Bottom banner styling */
.bottom-banner {
    margin: 20px auto 15px auto;
    background-color: #ffffff;
    padding: 5px;
    border: 1px solid #cccccc;
    text-align: center;
    display: block;
    flex-shrink: 0;
}
.bottom-banner img#bottom-ad-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
     width: 728px;
     height: auto;
    border: none;
}

.footer-links {
    font-size: 10px;
    line-height: 1.5;
    color: #333333;
    margin: 15px auto 20px auto;
    padding-top: 10px;
    max-width: 80%;
    text-align: center;
}
.footer-links a {
    color: #0000cd;
    margin: 0 3px;
}
.footer-links br {
    margin-bottom: 2px;
}

/* --- Responsiveness --- */
@media (max-width: 1200px) {
    .search-form input[type="text"] {
        width: 300px;
    }
}

@media (max-width: 992px) {
     .search-form input[type="text"] {
        width: 250px;
    }
     .top-right-ad { /* Adjust ad size if 468 is still too wide */
         width: 100%; /* Let it fill space but respect max-width */
         max-width: 468px; /* Ensure it doesn't exceed this */
         height: auto;
     }
     .category-select {
         position: static;
         width: 100%;
         margin: 10px 0;
     }
    
    .right-section {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .right-of-logo {
        height: auto;
        min-height: 150px;
    }
}

@media (max-width: 768px) {
    .search-section {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .left-section {
        flex-direction: column;
        align-items: center;
        order: 2;
        width: 100%;
    }
     .nav-search-stack {
         align-items: center;
         width: 100%;
     }
    .header-nav-links {
        text-align: center;
        width: 100%;
    }
    .search-form {
        justify-content: center;
        width: auto;
    }
    .search-form input[type="text"] {
        width: calc(100% - 80px);
        max-width: 200px;
    }

    .right-section {
        width: 100%;
        justify-content: center;
        order: 1;
    }
     .top-right-ad {
        max-width: 100%;
        width: 320px;
        height: auto;
    }

    .category-filters {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .category-select {
        margin-left: 0;
        flex-basis: 100%;
        text-align: center;
    }

    .main-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    .sidebar {
        width: 100%;
        position: static;
        order: 0;
        margin-bottom: 10px;
    }
    .left-sidebar { order: 1; }
    .main-content { order: 2; }
    .right-sidebar { order: 3; }

    .header-block {
        height: auto;
        min-height: auto;
        padding: 10px 5px;
    }
    
    .results-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        
        td, th {
            min-width: 60px;
        }
        
        td:nth-child(2) {
            min-width: 200px;
        }
    }
}

/* Update logo container styles - simplify to just show logo1 */
.logo-container {
    position: relative;
    width: 175px;
    height: 120px; /* Reduced from 150px */
}

/* Fix 4: Add fallback for sticky positioning */
@supports not (position: sticky) {
    .sidebar {
        position: relative;
    }
}

/* Add CSS Custom Properties for consistent values */
:root {
    --primary-color: #0000cd;
    --border-color: #cccccc;
    --background-light: #f6f6f6;
    --text-color: #333333;
    --link-color: #003366;
    --header-height: 150px;
    --header-padding-top: 10px; /* Reduced from 20px */
    --header-padding-bottom: 10px; /* Reduced from 20px */
    --header-min-height: 150px; /* Reduced from 190px */
    --logo-height: 120px; /* Reduced from 150px */
    --header-bg: #F6F6F6;
    --header-border: #CCCCCC;
}

/* Add print styles */
@media print {
    .sidebar,
    .top-right-ad,
    .bottom-banner,
    .category-filters {
        display: none;
    }
    
    .main-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Audio Player Styles */
.audio-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #dfdfdf;
    padding: 10px;
    border-radius: 3px;
    z-index: 9999;
    width: 300px;
    height: 40px;
    display: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.audio-popup.active {
    display: block !important;
}

.progress-container {
    width: 100%;
    height: 100%;
    background: #e9e9e9;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s;
    padding-right: 60px; /* Make room for both buttons */
}

.progress-bar {
    height: 100%;
    background: #1a1a1a;
    width: 0%;
    transition: width 0.05s linear;
    position: relative;
    pointer-events: none;
}

.track-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #da2626;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90%;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

.player-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

/* Make sure table cell maintains proper size */
.results-table td:nth-child(6) { /* PL column */
    width: 30px;
    text-align: center;
    vertical-align: middle;
}

/* Add this to your existing audio player styles */
.audio-popup iframe {
    display: none; /* Hide the SoundCloud widget */
}

.player-controls {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 3px;
    z-index: 2;
    background: #e9e9e9; /* Match progress container background */
    padding-left: 5px;
}

.player-play-pause-icon,
.restart-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.player-play-pause-icon:hover,
.restart-icon:hover {
    opacity: 1;
}

/* --- POPUP CLOSE BUTTON --- */
.audio-popup { position: relative; }
.audio-popup .popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.audio-popup .popup-close:hover {
    background: #ff3366;
    border-color: #ff3366;
    transform: scale(1.1);
}

/* Improve nav links visibility */
.nav-links a { color: #063b64; }
.nav-links a:first-child { font-weight: 700; color: #ff3366; }
.nav-links a:first-child:hover { text-decoration: underline; }

/* =============================================== */
/* --- READABILITY + HOVER + ZEBRA (fixes #2, #4, #5, #7) --- */
/* =============================================== */
body, html { font-size: 13px; } /* bumped from 11px for readability */

/* Zebra striping + row hover */
.results-table tbody tr:nth-child(even) { background-color: #f7f7f7; }
.results-table tbody tr {
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.results-table tbody tr:hover {
    background-color: #fff2f8 !important; /* subtle pink tint — brand nod */
    box-shadow: inset 3px 0 0 #ff3366;
}
.results-table tbody tr:focus-within {
    outline: 2px solid #ff3366;
    outline-offset: -2px;
}

/* Track name column: truncate + tooltip on overflow */
.results-table td:nth-child(2) {
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.results-table td:nth-child(2) a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* Readable column headers (fix #20) */
.results-table thead th { font-size: 12px; letter-spacing: 0.5px; }

/* =============================================== */
/* --- GREY OUT DEAD NAV + FILTERS (#11, #12) --- */
/* =============================================== */
.nav-links a[href^="/"] {
    color: #9a9a9a !important;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: line-through;
    opacity: 0.5;
}
.filter-row label {
    color: #999 !important;
    cursor: not-allowed;
}
.filter-row input[type="checkbox"] {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

/* =============================================== */
/* --- BIGGER, BETTER POPUP PLAYER (#6) --- */
/* =============================================== */
.audio-popup {
    width: 420px;
    max-width: calc(100vw - 30px);
    height: auto;
    min-height: 88px;
    padding: 34px 12px 12px 12px;
    background: #1a1a1a;
    border: 1px solid #ff3366;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(255,51,102,0.3);
}
.audio-popup .progress-container {
    height: 40px;
    background: #2a2a2a;
    padding-right: 70px;
    border-radius: 3px;
}
.audio-popup .progress-bar { background: #ff3366; }
.audio-popup .track-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.audio-popup .player-controls {
    background: transparent;
    right: 10px;
    gap: 8px;
}
.audio-popup .player-play-pause-icon,
.audio-popup .restart-icon {
    width: 18px; height: 18px;
    filter: invert(100%);
}

/* =============================================== */
/* --- BACK TO MAIN SITE BUTTON (#22) --- */
/* =============================================== */
.nav-links .back-to-main {
    display: inline-block;
    color: #ff3366 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: 1px solid #ff3366;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    letter-spacing: 0.5px;
    margin-right: 8px;
    transition: all 0.2s;
    opacity: 1 !important;
    cursor: pointer;
    pointer-events: auto !important;
}
.nav-links .back-to-main:hover {
    background: #ff3366;
    color: #fff !important;
    box-shadow: 0 0 8px rgba(255,51,102,0.4);
    text-decoration: none !important;
}

/* =============================================== */
/* --- BACK TO TOP BUTTON (#16) --- */
/* =============================================== */
#pb-back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid #999;
    background: #fff;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s, background 0.2s, color 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#pb-back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#pb-back-to-top:hover { background: #ff3366; color: #fff; border-color: #ff3366; }

/* Row loading state (#15) */
.results-table tr.track-loading {
    background-color: #fff9cc !important;
}
.results-table tr.track-loading td:nth-child(6) a::after {
    content: ' ...';
    color: #ff3366;
    font-weight: bold;
}

/* =============================================== */
/* --- MOBILE RESPONSIVE (#1) --- */
/* =============================================== */
@media (max-width: 900px) {
    .main-wrapper { flex-direction: column; gap: 10px; }
    .sidebar { width: 100%; position: static; }
    .sidebar-ad-image { max-height: 90px; object-fit: contain; }
    .right-section { position: static; margin-top: 10px; }
    .right-ad { width: 100%; height: auto; }
    .search-section { flex-direction: column; gap: 10px; }
    .search-input { width: 100%; }
    .results-table td:nth-child(2) { max-width: 50vw; }
}
@media (max-width: 600px) {
    .container { padding: 0 8px; }
    .results-table { font-size: 12px; }
    .results-table th, .results-table td { padding: 4px 5px; }
    /* Hide less critical columns on narrow screens */
    .results-table th:nth-child(1), .results-table td:nth-child(1),
    .results-table th:nth-child(3), .results-table td:nth-child(3),
    .results-table th:nth-child(4), .results-table td:nth-child(4),
    .results-table th:nth-child(5), .results-table td:nth-child(5),
    .results-table th:nth-child(7), .results-table td:nth-child(7) { display: none; }
    .info-box.privacy { flex-direction: column; align-items: stretch; gap: 8px; }
    .audio-popup { left: 10px; right: 10px; bottom: 10px; width: auto; }
    .filter-row { flex-wrap: wrap; }
}

/* --- BOTTOM BANNER CROSSFADE --- */
.bottom-banner a {
    position: relative;
    display: block;
    line-height: 0;
}
/* Both overlayed images absolutely fill container, neither leaves a gap */
.bottom-banner img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.4s linear;
}
.bottom-banner img#bottom-ad-image-b {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}



/* =============================================== */
/* --- 404 Error Page (404.html) ----------------- */
/* Matches the site's Verdana/11px + blue-link     */
/* aesthetic rather than the pink theme.           */
/* =============================================== */
.error-block {
    padding: 40px 20px 55px 20px;
    text-align: center;
}

.error-code {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 72px;
    line-height: 1;
    font-weight: bold;
    color: #063b64;
    margin: 0;
    letter-spacing: -2px;
}

.error-heading {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
    margin: 6px 0 22px 0;
}

.error-text {
    font-size: 11px;
    color: #444444;
    line-height: 1.7;
    max-width: 430px;
    margin: 0 auto 10px auto;
}

.error-mono {
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    color: #999999;
    letter-spacing: 0.08em;
}

.error-actions {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #dddddd;
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
}

.error-link {
    display: inline-block;
    font-size: 11px;
    color: #0000cd;
    padding: 5px 12px;
    margin: 0 4px;
    border: 1px solid #cccccc;
    background: linear-gradient(to bottom, #f9f9f9, #f0f0f0);
}

.error-link:hover {
    background: linear-gradient(to bottom, #f0f0f0, #e5e5e5);
    border-color: #999999;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .error-code { font-size: 54px; }
    .error-block { padding: 28px 12px 40px 12px; }
    .error-link { display: block; margin: 6px auto; max-width: 220px; }
}

/* ================================================================ */
/* --- MOBILE SAFETY NET ------------------------------------------ */
/* This layout uses fixed pixel widths for the ad banners (468px,
   728px, 407px, 400px...) which overflow a phone screen and cause
   sideways scrolling. Cap everything to the viewport instead of
   hunting down each rule.                                          */
/* ================================================================ */
@media (max-width: 560px) {
    html, body { max-width: 100%; overflow-x: hidden; }

    /* Any element that declared a fixed px width shrinks to fit. */
    .container,
    .header-block,
    .main-wrapper,
    .main-content,
    .sidebar,
    .right-ad,
    .bottom-ad-container,
    .sidebar-ad-link,
    .search-container { max-width: 100%; }

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

    /* Stack the 3-column layout into one column. */
    .main-wrapper { display: block; }
    .sidebar { display: none; }   /* side ad rails have no room on a phone */

    /* The results table is the actual content -- let it scroll on its
       own rather than stretching the whole page. */
    .search-results-panel,
    .results-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    table { min-width: 520px; }   /* keeps columns legible while scrolling */

    /* Bigger tap targets for the nav row. */
    .nav-links a { display: inline-block; padding: 6px 4px; }
}
