@media (prefers-color-scheme: dark) {
    /* Main Layout and Backgrounds */
    body {
        background-color: #121212 !important;
        color: #e0e0e0 !important;
    }

    .latest-discussions .topic-time {
        color: #e0e0e0 !important;
    }

    #container, #main-content, .main-container, .main .interior-page, .realgm-recirc, .ui-widget-content {
        background-color: #131314 !important;
        color: #e0e0e0 !important;
        border-color: #333 !important;
    }

    .portal.widget .content, .page-navigation, .overall-leader .category-container {
        background-color: #1E1F20 !important;
    }

    /* Sidebar and Content Wrappers */
    #left-column, #right-column, .module, .content-box {
        background-color: #1a1a1a !important;
        border-color: #333 !important;
    }

    /* Tables (Stats, Rosters, Scores) */
    table.compact, table.stat-table, .tablesorter {
        background-color: #1a1a1a !important;
        color: #ddd !important;
    }

    table.compact tr:nth-child(even), tr.even {
        background-color: #222 !important;
    }

    table.compact tr:hover, tr.hover {
        background-color: #2c2c2c !important;
    }

    th {
        background-color: #2c3e50 !important;
        color: #ffffff !important;
        border-bottom: 2px solid #444 !important;
    }

    /* Trade Checker Specifics */
    #trade-checker-container, .trade-summary {
        background-color: #1e1e1e !important;
        border: 1px solid #444 !important;
    }

    /* News Articles and Summaries */
    .article-lead, .article-body {
        color: #ccc !important;
    }

    .news-item, .list-item {
        border-bottom: 1px solid #333 !important;
    }

    /* Links and Navigation */
    a {
        color: #58a6ff;
    }

    .nav-menu, #top-nav {
        background-color: #000 !important;
        border-bottom: 1px solid #444 !important;
    }

    /* Input fields and Dropdowns */
    select, input, textarea, a.button1, a.button2, input.button1, input.button2, input.button3 {
        background-color: #252525 !important;
        color: #eee !important;
        border: 1px solid #eee !important;
        background-image: none;
    }

    .top-nav-container, #top-level-nav ul.primary-nav { background-color: #dfdfdf; }
    .widget { box-shadow: 5px 5px 5px #000; }
    .interior-column-right .headlines, .small-column-right .headlines, .other-sports-news .headlines { background-color: #1E1F20 !important; }
    .portal.widget .content { border: 1px solid #222; border-radius: 0; }
    .portal.widget h3, .portal.widget .fakeh3 { background-color: #0F5681; }
    .table-striped tbody tr:nth-of-type(odd) { background-color: #121212 !important; }
    .table-bordered th, .table-bordered td, .portal .secondary-story, .portal .tertiary-story, .lead-analysis, .portal-analysis, .portal .secondary-story-container, .portal .tertiary-story-container, .other-sports-news .headlines { border-color: #333 !important; }
    #container, #main-content, .main-container {  border-bottom: 1px solid #333; }
    .profile-highlight-box { background: #d7b634; }



    /* forums */
    /* RealGM Dark Mode Base */
    body, #wrap {
        background-color: #121212 !important;
        color: #e0e0e0 !important;
        border-color: #333 !important;
    }

    ul.topiclist li { color: #e0e0e0 !important; }

    /* Header and Navigation */
    #page-header {
        background-color: #1a1a1a !important;
    }

    .navbar {
        background-color: #252525 !important;
        border-color: #333 !important;
    }

    /* Forum Categories and List */
    .forabg, .forumbg {
        background-color: #1e1e1e !important;
        background-image: none !important;
        border: 1px solid #333 !important;
    }

    li.header {
        background-color: #369 !important; /* Dark blue/grey header bars */
        background-image: none !important;
    }

    ul.forums, ul.topics {
        background-color: #1a1a1a !important;
    }

    /* Individual Post Containers */
    .post, #wrap .bg1, .post, #wrap .bg2, .panel, table.zebra-list tr:nth-child(odd) td, ul.zebra-list li:nth-child(odd) {
        background-color: #1e1e1e !important;
        border-color: #333 !important;
        color: #ccc !important;
    }

    /* Individual Post Containers */
    .post, #wrap .bg2 {
        background-color: #252525 !important;
        border-color: #333 !important;
        color: #ccc !important;
    }

    .post:nth-child(even) {
        background-color: #252525 !important;
    }

    li.row:hover {
        background-color: #252525 !important;
    }

    #wrap .bg2 ul.post-buttons, #wrap .bg1 ul.post-buttons {
        background-color: transparent !important;
    }

    /* Post Content & Text */
    .content, .postbody, #wrap h2, label, .postprofile strong, #wrap, #wrap h3, li.row strong {
        color: #d1d1d1 !important;
    }

    .postprofile {
        border-color: #333 !important;
        color: #aaa !important;
    }

    li.row, ul.topiclist dd{
        border-color: #333 !important;
    }

    /* Links */
    #wrap a, .realgm-text a {
        color: #f7f7f7; /* Brighter blue for visibility */
    }

    /* Links */
    .realgm-text a {
        color: #f7f7f7 !important; /* Brighter blue for visibility */
    }

    #wrap a:hover, .realgm-text a:hover {
        color: #80c1ff !important;
    }

    /* Quote and Code Blocks */
    blockquote {
        background-color: #2a2a2a !important;
        border-color: #444 !important;
        color: #bbb !important;
    }

   .pagination li a { background-color: transparent; }
   .pagination li.ellipsis span { color: #f7f7f7; }
   span.prettytopic {
       display: inline-block;
       margin: 0px 4px 0px 0;
       padding: 0px 5px;
       color: #f7f7f7;
       background-color: #a54c19;
       border: 1px solid #CCC;
       border-radius: 4px;
       -moz-border-radius: 4px;
       -webkit-border-radius: 4px;
   }
   .button { background-image: none; background: #111; border: 0 } 
   .search-adv-icon { height: 20px; }
   input::placeholder, textarea::placeholder { color: #CCC !important; }
}

.username, .username-coloured { font-size: 1.0em; }
.username-coloured { font-weight: normal; }
dd.info, dd.lastpost, dd.moderation, dd.redirect, dd.time { white-space: nowrap; }

@media only screen and (min-width: 701px), only screen and (min-device-width: 701px) {
   ul.forums dl.icon dd, ul.forums dl.icon dt { min-height: 42px; }
   ul.forums li.row dl.icon dd.topics, ul.forums li.row dl.icon dd.posts, ul.forums li.row dt { line-height: 42px; }

   ul.topics li.row dl.icon dd.views, ul.topics li.row dl.icon dd.posts { line-height: 38px; }
   ul.topics li.row dl.icon dd.lastpost { line-height: 2em; }
   ul.topics dt { line-height: 2em; }
}