:root {
    color-scheme: dark;
    --mt-ink: #080706;
    --mt-night: #100d09;
    --mt-wood: #25180f;
    --mt-panel: #201b15;
    --mt-panel-2: #2b251c;
    --mt-stone: #4a4337;
    --mt-parchment: #f1e6c9;
    --mt-muted: #c2b7a1;
    --mt-gold: #c89b48;
    --mt-gold-bright: #e3c986;
    --mt-magic: #72c9c2;
    --mt-danger: #b64f43;
    --mt-success: #87aa6d;
    --mt-line: rgba(190, 153, 88, .28);
    --mt-display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --mt-body: Georgia, Cambria, serif;
    --bs-body-color: var(--mt-parchment);
    --bs-body-bg: var(--mt-ink);
    --bs-primary: #b98438;
    --bs-primary-rgb: 185, 132, 56;
    --bs-secondary: #62543b;
    --bs-secondary-rgb: 98, 84, 59;
    --bs-border-color: #5b4a31;
    --bs-link-color: #e0bd70;
    --bs-link-hover-color: #f0d99d;
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body.moontower-theme {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--mt-parchment);
    background:
        radial-gradient(circle at 50% -12rem, rgba(161, 113, 49, .2), transparent 38rem),
        radial-gradient(circle at 85% 18%, rgba(64, 121, 116, .08), transparent 28rem),
        repeating-linear-gradient(92deg, rgba(255,255,255,.014) 0 1px, transparent 1px 7px),
        linear-gradient(180deg, #17120d, #090806 58%, #0d0a07);
    font-family: var(--mt-body);
    line-height: 1.6;
}

body.moontower-theme::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .32;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(225,196,135,.08) 0 1px, transparent 1.5px),
        radial-gradient(circle at 70% 65%, rgba(225,196,135,.045) 0 1px, transparent 1.5px),
        repeating-linear-gradient(7deg, transparent 0 15px, rgba(255,255,255,.012) 16px 17px);
    background-size: 37px 41px, 53px 47px, auto;
}

a { color: #e0bd70; text-decoration: none; }
a:hover { color: #f1dca6; }
img { max-width: 100%; }
h1, h2, h3, h4, h5, h6 { color: #f1dfb2; font-family: var(--mt-display); }

:focus-visible {
    outline: 3px solid var(--mt-magic) !important;
    outline-offset: 4px;
}

.mt-skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 9999;
    padding: .65rem .9rem;
    color: #221609;
    background: var(--mt-gold-bright);
    transform: translateY(-180%);
}
.mt-skip-link:focus { transform: translateY(0); }

.mt-app-shell { flex: 1 0 auto; }
.mt-site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 4px ridge #6d4e2a;
    background:
        linear-gradient(90deg, rgba(0,0,0,.36), transparent 12%, transparent 88%, rgba(0,0,0,.36)),
        repeating-linear-gradient(4deg, #25180f 0 4px, #2d1e13 5px 11px, #20150e 12px 15px);
    box-shadow: 0 8px 0 #0a0806, 0 13px 22px rgba(0,0,0,.48), inset 0 -1px #b38647;
}
.mt-site-header::after {
    content: "";
    position: absolute;
    inset: auto 0 -9px;
    height: 6px;
    background: repeating-linear-gradient(90deg, #4d3925 0 28px, #20170f 28px 31px);
    border-bottom: 1px solid #8a6637;
    pointer-events: none;
}

.mt-navbar { min-height: 88px; padding: .35rem 0; }
.mt-brand { margin-right: 1.4rem; }
.mt-brand img { width: 190px; max-height: 68px; object-fit: contain; filter: sepia(.12) drop-shadow(0 5px 2px rgba(0,0,0,.75)); }
.mt-main-nav { gap: .28rem; align-items: stretch; }
.mt-main-nav .nav-item { display: flex; }
.mt-nav-link {
    min-width: 70px;
    min-height: 62px;
    padding: .38rem .52rem !important;
    display: grid !important;
    place-items: center;
    align-content: center;
    gap: .1rem;
    border: 1px solid #514633;
    color: #cbbda1 !important;
    background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 44%), linear-gradient(#28251f, #181612);
    box-shadow: inset 0 0 0 2px #11100d, inset 0 1px rgba(235,209,155,.12), 0 3px 5px rgba(0,0,0,.45);
    clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
    font: 700 .65rem/1 var(--mt-display);
    letter-spacing: .055em;
    text-transform: uppercase;
    transition: color .16s ease, background .16s ease, transform .16s ease;
}
.mt-nav-link img { width: 27px; height: 27px; object-fit: contain; filter: sepia(.2) drop-shadow(0 3px 0 rgba(0,0,0,.7)); }
.mt-nav-link:hover, .mt-nav-link.active {
    color: #f4dfaa !important;
    border-color: #a77c3e;
    background: radial-gradient(circle at 50% 100%, rgba(114,201,194,.14), transparent 48%), linear-gradient(#403522, #221a11);
    transform: translateY(-2px);
}
.mt-account-nav { margin-left: .75rem; gap: .5rem; }
.mt-account-link, .mt-menu-toggle {
    min-height: 52px;
    padding: .7rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid #e0bd70;
    color: #251708 !important;
    background: linear-gradient(#d7b86e, #a8732d 58%, #80521e);
    box-shadow: inset 0 0 0 2px rgba(53,31,9,.34), inset 0 2px rgba(255,238,186,.38), 0 6px 0 #251508;
    clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
    font: 700 .92rem var(--mt-display);
}
.mt-account-link img { width: 25px; height: 25px; }
.mt-account-link-secondary {
    border-color: #756343;
    color: #e7d6ae !important;
    background: linear-gradient(#42382a, #282117 58%, #17120d);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 2px rgba(255,239,194,.08), 0 6px 0 #0b0806;
}
.mt-account-link:hover, .mt-account-link:focus-visible { filter: brightness(1.1); transform: translateY(-1px); }
.mt-menu-toggle { color: #251708; border-radius: 0; }
.mt-dropdown {
    border: 2px ridge #735a37;
    color: var(--mt-parchment);
    background: #191510;
    box-shadow: 0 15px 30px rgba(0,0,0,.6), inset 0 0 0 2px #090806;
}
.mt-dropdown .dropdown-item { color: #d8c9a9; }
.mt-dropdown .dropdown-item:hover, .mt-dropdown .dropdown-item.active { color: #241608; background: #c49a52; }

.mt-hero {
    position: relative;
    min-height: 690px;
    display: grid;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid #6c4d28;
    isolation: isolate;
}
.mt-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 50% 31%, rgba(190,145,73,.18), transparent 21rem),
        radial-gradient(circle at 50% 35%, rgba(78,148,143,.1), transparent 14rem),
        linear-gradient(180deg, rgba(13,10,7,.18), rgba(9,7,5,.98)),
        repeating-linear-gradient(135deg, rgba(200,164,98,.018) 0 2px, transparent 2px 22px);
}
.mt-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 430px;
    height: 430px;
    left: 50%;
    top: 43%;
    translate: -50% -50%;
    border: 1px solid rgba(182,146,79,.28);
    border-radius: 50%;
    box-shadow: 0 0 95px rgba(114,201,194,.08), inset 0 0 75px rgba(200,155,72,.07);
}
.mt-hero-inner { padding: 5.6rem 1rem 4rem; text-align: center; }
.mt-eyebrow { margin: 0 0 .75rem; color: #d1ad66; font: 700 .78rem/1.2 var(--mt-display); letter-spacing: .2em; text-transform: uppercase; }
.mt-hero-logo { display: block; width: min(100%, 1000px); margin: 0 auto -1rem; filter: drop-shadow(0 26px 48px rgba(0,0,0,.62)); }
.mt-hero-copy { max-width: 710px; margin: 0 auto; color: #cec1a7; font-size: clamp(1rem, 1.6vw, 1.16rem); text-shadow: 0 2px 2px #000; }
.mt-hero-actions { margin-top: 1.75rem; display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: .85rem; }
.mt-btn-primary, .btn-primary {
    padding: .78rem 1.15rem;
    border: 1px solid #e0bd70;
    border-radius: 0;
    color: #251708 !important;
    background: linear-gradient(#d7b86e, #a8732d 58%, #80521e);
    box-shadow: inset 0 0 0 2px rgba(53,31,9,.34), inset 0 2px rgba(255,238,186,.38), 0 7px 0 #251508;
    clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
    font-family: var(--mt-display);
    font-weight: 700;
}
.mt-btn-primary:hover, .btn-primary:hover { border-color: #f0d38e; background: linear-gradient(#e3c986, #b98438 58%, #8b5d25); transform: translateY(-2px); }
.mt-btn-secondary, .btn-secondary { border: 1px solid #706044; border-radius: 0; color: #eadcb8 !important; background: linear-gradient(#2d2921, #17140f); box-shadow: inset 0 0 0 2px #0d0c09, 0 4px 0 #090806; }
.mt-server-address {
    min-width: 245px;
    padding: .63rem .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    border: 1px solid #6b5c42;
    color: var(--mt-parchment);
    background: linear-gradient(#28251f, #12110e);
    box-shadow: inset 0 0 0 2px #0b0a08, 0 6px 0 #070605;
    clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
    text-align: left;
}
.mt-server-address small { display: block; color: #ad9e82; font: .62rem var(--mt-display); text-transform: uppercase; }
.mt-server-address strong { display: block; font-family: ui-monospace, Consolas, monospace; }
.mt-world-ledger { max-width: 900px; margin: 2.5rem auto 0; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); border: 2px ridge #80643b; background: #231b12; box-shadow: 0 10px 24px rgba(0,0,0,.5), inset 0 0 16px rgba(0,0,0,.7); }
.mt-world-ledger > div { padding: .82rem 1rem; border: 1px solid #473b29; background: linear-gradient(105deg, #1d1913, #292116); text-align: left; }
.mt-world-ledger span { display: block; color: #a9997d; font-size: .7rem; text-transform: uppercase; }
.mt-world-ledger strong { display: block; color: #ead9b1; font: 700 1.12rem var(--mt-display); }
.is-online { color: #b9d09d !important; }
.is-offline { color: #d8867d !important; }
.is-unavailable { color: #c0aa82 !important; }

.mt-home-content { padding-bottom: 3rem; }
.mt-section { position: relative; padding: 5.3rem 0; }
.mt-section + .mt-section::before {
    content: "◆";
    position: absolute;
    top: -8px;
    left: 50%;
    width: min(68%, 680px);
    translate: -50% 0;
    color: #8f6e38;
    border-top: 1px solid #58452c;
    line-height: 0;
    text-align: center;
    text-shadow: -11px 0 #090806, 11px 0 #090806;
}
.mt-section-heading { max-width: 780px; margin-bottom: 2rem; }
.mt-section-heading h2, .mt-feature h2 { margin: .2rem 0 .65rem; color: #f1dfb2; font: 600 clamp(2.1rem, 5vw, 4rem)/1 var(--mt-display); letter-spacing: -.02em; text-shadow: 0 3px 0 #21150a; }
.mt-section-heading > p:last-child, .mt-feature > div > p { color: #bfb197; font-size: 1.05rem; }
.mt-announcement { margin: 2rem 0 0; padding: 1rem 1.2rem; border: 2px ridge #765a32; color: #e7d6af; background: #221b13; }
.mt-path-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.mt-path-card, .card, .modal-content, .list-group-item, .dropdown-menu {
    border: 2px ridge #665238;
    border-radius: 0;
    color: var(--mt-parchment);
    background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 35%), linear-gradient(155deg, #29251e, #12110e);
    box-shadow: inset 0 0 0 3px #0d0c09, inset 0 0 24px rgba(0,0,0,.45), 0 10px 22px rgba(0,0,0,.3);
}
.text-muted { color: #b8aa91 !important; }
.pixel-character-card { position: relative; overflow: hidden; }
.pixel-character-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c89848, #72c9c2, transparent);
}
.pixel-character-kicker { color: #b99454; font: 700 .72rem/1.2 var(--mt-display); letter-spacing: .12em; text-transform: uppercase; }
.pixel-character-level { display: flex; align-items: baseline; gap: .65rem; color: #cbbda1; }
.pixel-character-level strong { color: #f1dfb2; font: 700 2.25rem/1 var(--mt-display); }
.pixel-character-details dt { color: #ad9e82; font-weight: 500; }
.pixel-character-details dd { color: #ead9b1; }
.pixel-character-updated { color: #b8aa91; }
.mt-path-card { min-height: 245px; padding: 1.25rem; display: flex; flex-direction: column; align-items: flex-start; clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px); }
.mt-path-card img { width: 46px; height: 46px; object-fit: contain; }
.mt-path-card h3 { margin: auto 0 .35rem; color: #ead7aa; font-size: 1.35rem; }
.mt-path-card p { margin: 0; color: #b8aa91; }
.mt-feature { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 3rem; }
.mt-feature-art { margin: 0; padding: 8px; border: 3px ridge #765a32; background: linear-gradient(145deg, #332719, #15110c); box-shadow: 0 16px 30px rgba(0,0,0,.45), inset 0 0 0 3px #100d09; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.mt-feature-art img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; filter: sepia(.08) contrast(1.05); }
.mt-rune-list { display: grid; gap: .75rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.mt-rune-list li { display: grid; grid-template-columns: 32px 1fr; gap: .8rem; align-items: center; color: #d7c9aa; }
.mt-rune-list li::before { content: "✦"; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(114,201,194,.4); color: var(--mt-magic); background: #171b18; rotate: 45deg; box-shadow: 0 0 10px rgba(114,201,194,.15); }
.mt-rune-list li::after { content: ""; }
.mt-server-card h3, .mt-news-card h3 { font-size: 1.45rem; }
.mt-server-code { margin: 1rem 0 0; color: #d7c9aa; font-family: ui-monospace, Consolas, monospace; }
.progress { height: 9px; border: 1px solid #584a34; border-radius: 0; background: #0e0c09; }
.progress-bar { background: linear-gradient(90deg, #3d817d, #72c9c2); }
.mt-news-card .card-img-top { height: 190px; border-radius: 0; object-fit: cover; filter: sepia(.12); }
.mt-news-date { color: #b99454; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }

.mt-content { min-height: 62vh; padding-top: 4rem; padding-bottom: 5rem; }
.mt-content > h1, .mt-content .page-title {
    margin: 0 0 1.6rem;
    padding: 1.25rem 1.4rem;
    border: 3px double #6c4f2e;
    color: #f1dfb2;
    background: linear-gradient(90deg, #21180f, #17120d 65%, #21180f);
    font: 600 clamp(2rem, 5vw, 3.5rem)/1 var(--mt-display);
    text-transform: none;
    box-shadow: inset 0 0 0 2px #090806;
}
.card-header, .card-footer, .modal-header, .modal-footer { border-color: #564328; background: rgba(81,59,31,.24); }
.table { --bs-table-color: #e6d8b8; --bs-table-bg: transparent; --bs-table-border-color: #55452f; --bs-table-striped-color: #e6d8b8; --bs-table-striped-bg: rgba(200,155,72,.055); --bs-table-hover-color: #fff0c8; --bs-table-hover-bg: rgba(114,201,194,.07); }
.form-control, .form-select {
    border: 1px solid #62543b;
    border-radius: 0;
    color: #ebddbc;
    background-color: #0e0c09;
    box-shadow: inset 2px 2px 7px #000;
}
.form-control:focus, .form-select:focus { border-color: var(--mt-magic); color: #fff3d2; background-color: #100e0b; box-shadow: 0 0 0 .2rem rgba(114,201,194,.14), inset 2px 2px 7px #000; }
.form-label { color: #d7bc83; font-family: var(--mt-display); }
.nav-tabs { border-color: #665238; }
.nav-tabs .nav-link { border-radius: 0; color: #c7b99e; }
.nav-tabs .nav-link.active { border-color: #7d623d; color: #f2dfb4; background: #251d14; }
.pagination { --bs-pagination-color: #d8bd82; --bs-pagination-bg: #17130f; --bs-pagination-border-color: #5d4c34; --bs-pagination-hover-color: #241608; --bs-pagination-hover-bg: #c49a52; --bs-pagination-hover-border-color: #d5b06b; --bs-pagination-active-color: #241608; --bs-pagination-active-bg: #c49a52; --bs-pagination-active-border-color: #e0bd70; }
.alert { border-radius: 0; border-width: 1px 1px 1px 5px; color: #efe1bf; background: #211b14; }

.mt-footer { border-top: 4px ridge #6b4e2d; background: repeating-linear-gradient(3deg, #17110b 0 5px, #1d150e 6px 13px), #120e0a; box-shadow: inset 0 8px 18px rgba(0,0,0,.5); }
.mt-footer-grid { padding: 3rem 0 2rem; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.mt-footer-logo { width: 210px; }
.mt-footer h2 { margin: 0 0 .7rem; color: #d6b56f; font-size: 1.15rem; }
.mt-footer p { margin: .3rem 0; color: #a99b83; }
.mt-footer a { display: block; margin: .32rem 0; color: #b9aa90; }
.mt-socials { padding: 0 0 2rem; display: flex; gap: .6rem; }
.mt-socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #6b5433; color: #d7ba7f; background: #17130f; }

@media (max-width: 1199px) {
    .mt-brand img { width: 160px; }
    .mt-nav-link { min-width: 60px; font-size: .57rem; }
    .mt-path-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    .mt-navbar { min-height: 74px; }
    .mt-brand img { width: 155px; max-height: 56px; }
    .mt-navbar .navbar-collapse { margin-top: .7rem; padding: 1rem; border: 2px ridge #715636; background: #17120e; box-shadow: 0 15px 30px rgba(0,0,0,.65); }
    .mt-main-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
    .mt-main-nav .nav-item { display: block; }
    .mt-nav-link { min-height: 80px; }
    .mt-account-nav { margin: .8rem 0 0; }
    .mt-account-link { width: 100%; justify-content: center; }
    .mt-feature { grid-template-columns: 1fr; }
    .mt-footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .mt-hero { min-height: 610px; }
    .mt-hero-inner { padding-top: 4rem; }
    .mt-hero::after { width: 300px; height: 300px; }
    .mt-hero-actions > * { width: 100%; }
    .mt-world-ledger { grid-template-columns: 1fr; }
    .mt-path-grid, .mt-footer-grid { grid-template-columns: 1fr; }
    .mt-path-card { min-height: 205px; }
    .mt-section { padding: 3.8rem 0; }
    .mt-section-heading h2, .mt-feature h2 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
