/* Heritage Online / Rankings - Mythic layout v1 */
:root {
    --bg: #050403;
    --panel: rgba(10, 8, 5, 0.93);
    --panel2: rgba(20, 15, 9, 0.90);
    --gold: #c8943f;
    --gold2: #ffe0a0;
    --text: #f2e8d0;
    --muted: #ad9d80;
    --border: rgba(200, 148, 63, 0.42);
    --green: #68c774;
    --red: #e06a54;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: #050403;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
}

body { padding-top: 78px; }

a { color: var(--gold2); text-decoration: none; }

.hm-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 78px;
    z-index: 1000;
    background: rgba(0,0,0,.91);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 260px 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 52px;
    box-shadow: 0 14px 42px rgba(0,0,0,.55);
}

.hm-brand { display: flex; align-items: center; gap: 14px; color: var(--gold2); }

.hm-brand-mark {
    width: 48px; height: 48px; border: 2px solid var(--gold);
    display: grid; place-items: center; color: var(--gold2);
    font-size: 28px; font-weight: 700; background: rgba(200,148,63,.08);
}

.hm-brand-text {
    font-size: 26px; line-height: .85; letter-spacing: 3px;
    text-transform: uppercase; color: var(--gold2);
}

.hm-brand-text small {
    display: block; font-size: 10px; letter-spacing: 5px;
    color: var(--muted); margin-top: 6px;
}

.hm-nav {
    display: flex; justify-content: center; align-items: center;
    gap: 30px; text-transform: uppercase; letter-spacing: 1px; font-size: 14px;
}

.hm-nav a {
    color: var(--text); padding: 29px 0 25px;
    border-bottom: 2px solid transparent; white-space: nowrap; transition: .18s ease;
}

.hm-nav a:hover, .hm-nav a.active {
    color: var(--gold2); border-bottom-color: var(--gold);
    text-shadow: 0 0 16px rgba(200,148,63,.30);
}

.hm-actions { display: flex; align-items: center; gap: 12px; }

.hm-lang { display: flex; gap: 6px; margin-right: 6px; }
.hm-lang a { color: var(--muted); font-size: 12px; }
.hm-lang a.active { color: var(--gold2); }

.hm-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 11px 20px; border: 1px solid var(--border);
    color: var(--gold2); text-transform: uppercase; letter-spacing: 1px;
    background: rgba(0,0,0,.54); font-family: Georgia, "Times New Roman", serif;
    transition: .18s ease; cursor: pointer;
}

.hm-btn:hover {
    transform: translateY(-1px); border-color: var(--gold2);
    box-shadow: 0 0 24px rgba(200,148,63,.25);
}

.hm-btn.gold {
    background: linear-gradient(180deg, #be8532 0%, #6b4318 100%);
    border-color: var(--gold);
}

.hm-page {
    min-height: calc(100vh - 78px);
    background:
        linear-gradient(90deg, rgba(0,0,0,.75), rgba(0,0,0,.34) 50%, rgba(0,0,0,.75)),
        linear-gradient(rgba(0,0,0,.52), rgba(0,0,0,.88)),
        url("../img/heritage_dashboard_hero.png") center top / cover fixed no-repeat;
    padding: 50px 22px 62px;
}

.hm-wrap { max-width: 1180px; margin: 0 auto; }

.hm-title {
    text-align: center; margin-bottom: 28px; text-shadow: 0 5px 20px #000;
}

.hm-title h1 {
    margin: 0; color: var(--gold2);
    font-size: clamp(44px, 5vw, 72px); letter-spacing: 5px; text-transform: uppercase;
}

.hm-title p {
    max-width: 760px; margin: 12px auto 0; color: var(--text); line-height: 1.55;
}

.hm-status-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.hm-status-card,
.hm-card {
    background: linear-gradient(180deg, rgba(17,13,8,.96), rgba(6,5,4,.94));
    border: 1px solid var(--border);
    box-shadow: 0 22px 70px rgba(0,0,0,.48);
}

.hm-status-card { padding: 18px; }

.hm-status-card span {
    display: block; color: var(--muted); text-transform: uppercase;
    font-size: 12px; letter-spacing: 1px; margin-bottom: 8px;
}

.hm-status-card strong {
    color: var(--gold2); font-size: 24px;
}

.hm-online { color: #9ff0a6 !important; }
.hm-offline { color: #ffafa0 !important; }

.hm-card {
    padding: 26px;
    margin-bottom: 20px;
}

.hm-card h2 {
    color: var(--gold2);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.hm-card h2 small {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1.4px;
}

.hm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hm-badge {
    display: inline-flex; align-items: center; padding: 6px 10px;
    border: 1px solid rgba(200,148,63,.28); background: rgba(0,0,0,.28);
    color: var(--gold2); font-size: 13px;
}

.hm-search input {
    min-width: 280px;
    background: rgba(0,0,0,.56);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    font-size: 14px;
}

.hm-search input:focus {
    outline: none;
    border-color: var(--gold2);
    box-shadow: 0 0 0 2px rgba(200,148,63,.14);
}

.hm-alert {
    padding: 14px 16px;
    border: 1px solid rgba(214,91,74,.68);
    background: rgba(96, 22, 14, .88);
    color: #ffe1dc;
    margin-bottom: 16px;
}

.hm-table-wrap {
    overflow-x: hidden;
    border: 1px solid rgba(200,148,63,.18);
    background: rgba(0,0,0,.24);
}

.hm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
}

.hm-table th,
.hm-table td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(200,148,63,.16);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.hm-table th {
    color: var(--gold2);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.hm-table td {
    color: var(--text);
    font-size: 14px;
}

.hm-table tr:hover td {
    background: rgba(200,148,63,.06);
}

.hm-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #68c774;
    box-shadow: 0 0 0 3px rgba(104,199,116,.14);
    margin-right: 10px;
    vertical-align: middle;
}

.hm-dot.offline {
    background: #e0a84c;
    box-shadow: 0 0 0 3px rgba(224,168,76,.16);
}

.hm-muted { color: var(--muted) !important; }

.hm-footer {
    max-width: 1180px; margin: 32px auto 0; padding-top: 24px;
    border-top: 1px solid var(--border); display: flex; justify-content: space-between;
    color: var(--muted); font-size: 13px;
}

@media (max-width: 1100px) {
    body { padding-top: 0; }
    .hm-topbar { position: relative; height: auto; grid-template-columns: 1fr; padding: 18px; }
    .hm-nav { justify-content: flex-start; overflow-x: auto; gap: 18px; }
    .hm-nav a { padding: 10px 0; }
    .hm-actions { justify-content: flex-start; }
    .hm-status-strip { grid-template-columns: 1fr; }
    .hm-search input { min-width: 100%; }
    .hm-footer { display: block; }
}

/* Public Rankings page */
.hm-rank-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.hm-rank-server-card {
    display: block;
    padding: 22px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(17,13,8,.96), rgba(6,5,4,.94));
    box-shadow: 0 22px 70px rgba(0,0,0,.42);
    transition: .18s ease;
}

.hm-rank-server-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold2);
    box-shadow: 0 0 28px rgba(200,148,63,.20);
}

.hm-rank-server-card span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    margin-bottom: 8px;
}

.hm-rank-server-card strong {
    display: block;
    color: var(--gold2);
    font-size: 28px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hm-rank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.hm-rank-card h2 {
    align-items: flex-start;
}

.hm-rank-value {
    color: var(--gold2);
    font-weight: bold;
}

.hm-rank-empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px solid rgba(200,148,63,.18);
    background: rgba(0,0,0,.25);
}

.hm-rank-anchor {
    scroll-margin-top: 96px;
}

@media (max-width: 900px) {
    .hm-rank-grid,
    .hm-rank-nav {
        grid-template-columns: 1fr;
    }
}

/* Dense public ranking tables: no horizontal scrolling */
.hm-rank-card {
    padding: 18px;
}

.hm-rank-card h2 {
    margin-bottom: 10px;
    font-size: 18px;
}

.hm-rank-table th:first-child,
.hm-rank-table td:first-child {
    width: 44px;
    text-align: center;
}

.hm-rank-table th:last-child,
.hm-rank-table td:last-child {
    width: 96px;
    text-align: right;
}

.hm-rank-pos {
    color: var(--gold2);
    font-weight: bold;
}

.hm-rank-name strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-rank-subline {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-rank-value {
    color: var(--gold2);
    font-weight: bold;
    font-size: 13px;
}

.hm-rank-grid {
    gap: 16px;
}

@media (max-width: 520px) {
    .hm-rank-card {
        padding: 14px 10px;
    }

    .hm-table th,
    .hm-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .hm-rank-table th:first-child,
    .hm-rank-table td:first-child {
        width: 34px;
    }

    .hm-rank-table th:last-child,
    .hm-rank-table td:last-child {
        width: 74px;
    }
}

/* Rankings editorial layout v3 */
body.nf-unified .hm-page .hm-title {
    max-width: 760px !important;
    margin: 0 0 22px !important;
    padding: 0 0 18px !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    letter-spacing: normal !important;
    text-align: left !important;
    text-shadow: none !important;
    border-bottom: 1px solid rgba(208, 184, 117, .28);
}

body.nf-unified .hm-page .hm-title h1 {
    margin: 0 0 7px !important;
    color: #e2d6b6 !important;
    font: 600 clamp(28px, 4vw, 42px)/1.08 Georgia, "Times New Roman", serif !important;
    letter-spacing: 1.5px !important;
    text-transform: none !important;
}

body.nf-unified .hm-page .hm-title p {
    max-width: 68ch !important;
    margin: 0 !important;
    color: #aaa495 !important;
    font: 13px/1.7 Verdana, Arial, sans-serif !important;
    letter-spacing: 0 !important;
}

body.nf-unified .hm-rank-nav {
    gap: 12px;
    margin-bottom: 24px;
}

body.nf-unified .hm-rank-server-card {
    padding: 15px 17px !important;
    border-color: rgba(168, 141, 78, .38) !important;
    background: linear-gradient(135deg, rgba(48, 51, 44, .92), rgba(20, 22, 19, .98)) !important;
}

body.nf-unified .hm-rank-server-card:hover {
    transform: none;
    border-color: #a88d4e !important;
}

body.nf-unified .hm-rank-server-card span {
    margin-bottom: 4px;
    font-size: 9px;
    letter-spacing: 1px;
}

body.nf-unified .hm-rank-server-card strong {
    color: #d9c78f;
    font-size: 20px;
    letter-spacing: 1px;
}

body.nf-unified .hm-rank-anchor {
    margin-top: 28px;
    scroll-margin-top: 18px;
}

body.nf-unified .hm-rank-anchor > .hm-title {
    max-width: none !important;
    margin: 0 0 10px !important;
    padding: 12px 15px !important;
    border: 1px solid rgba(168, 141, 78, .34);
    border-left: 3px solid #a88d4e;
    background: linear-gradient(90deg, rgba(168, 141, 78, .14), rgba(20, 22, 19, .3));
}

body.nf-unified .hm-rank-anchor > .hm-title h1 {
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
}

body.nf-unified .hm-rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.nf-unified .hm-rank-card {
    min-width: 0;
    padding: 15px !important;
}

body.nf-unified .hm-rank-card h2 {
    margin: 0 0 9px;
    padding-bottom: 8px;
    color: #d8cfb8 !important;
    font-size: 14px !important;
    line-height: 1.3;
    border-bottom: 1px solid rgba(168, 141, 78, .2);
}

body.nf-unified .hm-rank-card h2 small {
    font-size: 8px;
    letter-spacing: .5px;
}

body.nf-unified .hm-rank-table {
    table-layout: fixed;
    font-size: 10px;
}

body.nf-unified .hm-rank-table th,
body.nf-unified .hm-rank-table td {
    padding: 6px 5px !important;
}

body.nf-unified .hm-rank-name strong,
body.nf-unified .hm-rank-subline {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.nf-unified .hm-rank-value {
    font-size: 10px;
}

body.nf-unified .hm-rank-empty {
    padding: 18px;
    font-size: 11px;
}

@media (max-width: 820px) {
    body.nf-unified .hm-rank-grid,
    body.nf-unified .hm-rank-nav {
        grid-template-columns: 1fr !important;
    }
}