:root {
    --bg: #090b0f;
    --bg2: #0e1117;
    --panel: #12161d;
    --panel2: #171c24;
    --line: rgba(255, 255, 255, .08);
    --text: #e8e3d7;
    --muted: #858b95;
    --gold: #c99b45;
    --gold2: #f0c66d;
    --green: #62c98a;
    --red: #d97070;
    --shadow: 0 25px 70px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    background-color: rgba(12, 5, 3, 1);
    background-image:
        linear-gradient(to bottom,
            transparent 55%,
            rgba(12, 5, 3, 1) 100%),
        url("images/background.png");

    background-position: top center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.muted {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--gold2);
    font-weight: 800;
    margin: 0 0 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    padding: 13px 20px;
    border-radius: 4px;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: .12em;
}

.btn-gold {
    background: linear-gradient(135deg, #b77f2c, #e0b65d);
    color: #161108;
    box-shadow: 0 8px 25px rgba(201, 155, 69, .16);
}

.btn-gold:hover {
    filter: brightness(1.1);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(98, 201, 138, .8);
    display: inline-block;
}

.login-page {
    min-height: 10vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 380px 20px 60px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.login-glow {
    position: fixed;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: rgba(169, 117, 37, .07);
    filter: blur(90px);
    right: -180px;
    top: -180px;
    pointer-events: none;
}

.login-shell {
    width: min(1060px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    background: rgba(12, 5, 3, 0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    min-height: 540px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.brand-panel {
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.crest,
.mini-crest {
    display: grid;
    place-items: center;
    color: var(--gold2);
    text-shadow: 0 0 25px rgba(240, 198, 109, .35);
}

.crest {
    font-size: 60px;
    width: 100px;
    height: 100px;
    border: 1px solid rgba(201, 155, 69, .35);
    clip-path: polygon(50% 0, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
    margin-bottom: 35px;
}

.brand-panel h1 {
    font-family: Georgia, serif;
    font-size: 50px;
    line-height: .98;
    margin: 0 0 20px;
    font-weight: 500;
}

.brand-panel h1 span {
    color: var(--gold2);
}

.login-card {
    margin: auto;
    width: min(400px, calc(100% - 40px));
    padding: 34px 0;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8e939d;
    font-size: 10px;
    letter-spacing: .16em;
    font-weight: 800;
    margin-bottom: 22px;
}

.login-card h2 {
    font: 500 32px Georgia, serif;
    margin: 0 0 6px;
}

.login-card form {
    margin-top: 20px;
}

label {
    display: block;
    color: #9ea3ac;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-bottom: 14px;
}

input {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: #130b0b;
    border: 1px solid var(--line);
    padding: 12px 14px;
    color: var(--text);
    outline: none;
    border-radius: 3px;
}

input:focus {
    border-color: rgba(201, 155, 69, .65);
    box-shadow: 0 0 0 3px rgba(201, 155, 69, .06);
}

.login-card .btn {
    width: 100%;
    margin-top: 8px;
}

.alert {
    padding: 12px 14px;
    background: rgba(217, 112, 112, .08);
    border: 1px solid rgba(217, 112, 112, .2);
    color: #efaaaa;
    font-size: 12px;
    margin-top: 16px;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 11px;
    color: #777d87;
}

.login-links a:hover {
    color: var(--gold2);
}

/* Registration & Enhanced Form Elements */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrap input {
    margin-top: 0;
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #727885;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s ease;
}

.toggle-password:hover {
    color: var(--gold2);
}

/* Referral Banner in Registration */
.referral-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(201, 155, 69, 0.12), rgba(18, 22, 29, 0.8));
    border: 1px solid rgba(201, 155, 69, 0.35);
    border-radius: 4px;
    margin: 18px 0 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.referral-banner .ref-icon {
    font-size: 18px;
    color: var(--gold2);
    text-shadow: 0 0 10px rgba(240, 198, 109, 0.5);
}

.referral-banner .ref-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.referral-banner .ref-text small {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #8e939d;
    font-weight: 700;
}

.referral-banner .ref-text strong {
    font-size: 13px;
    color: var(--gold2);
    font-weight: 700;
}

.field-hint {
    display: block;
    font-size: 10px;
    color: #6a717d;
    margin-top: 5px;
    font-weight: 400;
    letter-spacing: normal;
}

.field-hint.valid {
    color: var(--green);
}

.field-hint.invalid {
    color: var(--red);
}

/* Password Strength Indicator */
.password-meter {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meter-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 2px;
}

.meter-fill.weak {
    width: 33%;
    background: #d97070;
}

.meter-fill.medium {
    width: 66%;
    background: #e0b65d;
}

.meter-fill.strong {
    width: 100%;
    background: #62c98a;
}

.meter-text {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #727885;
    display: flex;
    justify-content: space-between;
}

.meter-text span.weak {
    color: #d97070;
}

.meter-text span.medium {
    color: #e0b65d;
}

.meter-text span.strong {
    color: #62c98a;
}

/* Security / Captcha Box */
.captcha-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.captcha-img {
    height: 46px;
    width: 140px;
    border-radius: 3px;
    cursor: pointer;
    display: block;
    user-select: none;
    border: 1px solid rgba(201, 155, 69, 0.35);
    background: #12161d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.captcha-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(201, 155, 69, 0.12), rgba(18, 22, 29, 0.95));
    border: 1px solid rgba(201, 155, 69, 0.3);
    border-radius: 3px;
    color: var(--gold2);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .12em;
    user-select: none;
    min-width: 130px;
    text-shadow: 0 0 10px rgba(240, 198, 109, 0.25);
}

.captcha-refresh {
    background: transparent;
    border: 1px solid var(--line);
    color: #858b95;
    height: 46px;
    width: 44px;
    cursor: pointer;
    border-radius: 3px;
    display: grid;
    place-items: center;
    transition: all .2s;
    flex-shrink: 0;
}

.captcha-refresh:hover {
    color: var(--gold2);
    border-color: rgba(201, 155, 69, 0.4);
    background: rgba(201, 155, 69, 0.08);
}

.captcha-container input {
    margin-top: 0;
    flex: 1;
}

/* Checkbox & Terms */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    margin-bottom: 22px;
    cursor: pointer;
    font-size: 11px;
    color: #9ea3ac;
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    accent-color: var(--gold);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--gold2);
    text-decoration: underline;
}

/* Success Card */
.success-banner {
    padding: 30px 20px;
    text-align: center;
    background: rgba(98, 201, 138, 0.06);
    border: 1px solid rgba(98, 201, 138, 0.25);
    border-radius: 4px;
    margin: 20px 0;
}

.success-icon {
    font-size: 42px;
    color: var(--green);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(98, 201, 138, 0.4);
}

.success-banner h3 {
    margin: 0 0 10px;
    font: 500 24px Georgia, serif;
    color: #e8e3d7;
}

.success-banner p {
    margin: 0 0 20px;
    color: #858b95;
    font-size: 12px;
    line-height: 1.6;
}

.success-banner strong.highlight {
    color: var(--gold2);
}

.redirect-countdown {
    font-size: 11px;
    color: #6a717d;
    margin-top: 14px;
}

.alert-success {
    padding: 12px 14px;
    background: rgba(98, 201, 138, .08);
    border: 1px solid rgba(98, 201, 138, .2);
    color: #a4e6bd;
    font-size: 12px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .login-page {
        padding: 40px 15px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .brand-panel {
        padding: 40px 30px 20px;
        text-align: center;
        align-items: center;
    }

    .login-card {
        padding: 20px 0 40px;
    }
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 255px;
    background: rgba(11, 14, 19, .96);
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
    border-bottom: 1px solid var(--line);
}

.mini-crest {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(201, 155, 69, .35);
    font-size: 20px;
}

.sidebar-brand strong {
    display: block;
    font: 700 15px Georgia, serif;
    letter-spacing: .12em;
}

.sidebar-brand small {
    display: block;
    color: #6e747e;
    font-size: 8px;
    letter-spacing: .25em;
    margin-top: 3px;
}

.server-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
}

.server-state strong {
    display: block;
    font-size: 9px;
    letter-spacing: .1em;
}

.server-state small {
    display: block;
    color: #666c75;
    font-size: 9px;
    margin-top: 3px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-title {
    font-size: 8px;
    color: #555b65;
    letter-spacing: .2em;
    font-weight: 900;
    margin: 20px 10px 5px;
}

.nav a {
    padding: 11px 12px;
    color: #858b94;
    font-size: 12px;
    border-radius: 3px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav a span {
    width: 17px;
    text-align: center;
    color: #676d77;
}

.nav a:hover,
.nav a.active {
    background: rgba(201, 155, 69, .09);
    color: #eee6d5;
}

.nav a.active {
    border-left: 2px solid var(--gold);
    padding-left: 10px;
}

.nav a.active span {
    color: var(--gold2);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 17px 8px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #5c4725, #1c1d20);
    border: 1px solid rgba(201, 155, 69, .35);
    color: var(--gold2);
    font-weight: 800;
}

.avatar.small {
    width: 27px;
    height: 27px;
    font-size: 10px;
}

.sidebar-footer strong {
    display: block;
    font-size: 11px;
}

.sidebar-footer small {
    color: #5f6570;
    font-size: 9px;
}

.content {
    margin-left: 255px;
    width: calc(100% - 255px);
    padding: 36px 48px 60px;
    max-width: 1500px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar h1 {
    font: 500 30px Georgia, serif;
    margin: 0;
    text-transform: capitalize;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: #a9adb4;
    border-radius: 4px;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 5px 12px 5px 5px;
    border-radius: 30px;
    font-size: 11px;
}

.hero-card {
    min-height: 270px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 85% 50%, rgba(201, 155, 69, .16), transparent 30%),
        linear-gradient(135deg, #151a21, #0e1218);
    padding: 42px 45px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0 65%, rgba(255, 255, 255, .018) 65% 66%, transparent 66%);
    pointer-events: none;
}

.hero-card h2 {
    font: 500 37px Georgia, serif;
    line-height: 1.1;
    margin: 14px 0;
}

.hero-card h2 span {
    color: var(--gold2);
}

.hero-card p {
    color: #858b95;
    font-size: 12px;
    max-width: 490px;
    margin-bottom: 25px;
}

.badge {
    font-size: 9px;
    letter-spacing: .16em;
    color: #18130a;
    background: var(--gold2);
    padding: 6px 9px;
    font-weight: 900;
}

.hero-symbol {
    font-size: 150px;
    color: rgba(201, 155, 69, .12);
    margin-right: 8%;
    transform: rotate(-8deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 15px 0;
}

.stat-card,
.panel-card {
    background: linear-gradient(145deg, #12161d, #101319);
    border: 1px solid var(--line);
}

.stat-card {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(201, 155, 69, .2);
    display: grid;
    place-items: center;
    color: var(--gold2);
    font-size: 17px;
}

.stat-card small {
    display: block;
    color: #696f79;
    font-size: 8px;
    letter-spacing: .13em;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: 17px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 15px;
    margin-bottom: 15px;
}

.panel-card {
    padding: 25px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.section-head h3 {
    font: 500 23px Georgia, serif;
    margin: 0;
}

.section-head a {
    font-size: 10px;
    color: var(--gold2);
}

.character-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    gap: 12px;
}

.character-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #4d3a1e, #18191c);
    color: var(--gold2);
    font: 500 18px Georgia, serif;
    border: 1px solid rgba(201, 155, 69, .25);
}

.character-avatar.mage {
    background: linear-gradient(145deg, #25344c, #16191e);
}

.character-info {
    flex: 1;
}

.character-info strong {
    display: block;
    font-size: 12px;
}

.character-info span {
    display: block;
    color: #666d77;
    font-size: 9px;
    margin-top: 4px;
}

.online-tag,
.offline-tag {
    font-size: 8px;
    letter-spacing: .1em;
    font-weight: 800;
}

.online-tag {
    color: var(--green);
}

.offline-tag {
    color: #666c75;
}

.server-meter {
    height: 6px;
    background: #080a0d;
    margin: 18px 0 8px;
    overflow: hidden;
}

.server-meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #846225, var(--gold2));
}

.meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #696f79;
}

.meter-label strong {
    color: #bfc1c4;
}

.server-list {
    margin-top: 20px;
}

.server-list div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    font-size: 10px;
    color: #8b9098;
}

.server-list b {
    color: var(--green);
    font-size: 9px;
}

.live {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 6px;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.timeline-dot {
    width: 7px;
    height: 7px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(201, 155, 69, .4);
}

.activity-row div {
    flex: 1;
}

.activity-row strong {
    display: block;
    font-size: 11px;
}

.activity-row small {
    display: block;
    color: #626873;
    font-size: 9px;
    margin-top: 4px;
}

.activity-row>b {
    font-size: 9px;
    color: var(--gold2);
}

.page-card {
    min-height: 500px;
}

.character-table {
    border: 1px solid var(--line);
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 1fr;
    gap: 12px;
    padding: 15px 16px;
    align-items: center;
}

.table-head {
    font-size: 8px;
    color: #5f6670;
    letter-spacing: .14em;
    border-bottom: 1px solid var(--line);
}

.table-row {
    font-size: 11px;
    border-bottom: 1px solid var(--line);
}

.table-row:last-child {
    border-bottom: 0;
}

.table-row strong {
    font-weight: 600;
}

.empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #575e68;
}

.empty-state strong {
    font: 500 20px Georgia, serif;
    color: #999fa8;
}

.empty-state:first-letter {
    color: var(--gold2);
}