* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #111827;
    color: #e5e7eb;
}

.site-header {
    background: #020617;
    border-bottom: 1px solid #1f2937;
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #f9fafb;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

.main-nav a:hover {
    color: #60a5fa;
}

.page {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 14px;
}

.stat-label {
    color: #9ca3af;
    font-size: 13px;
}

.stat-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: bold;
    color: #f9fafb;
}

/* Character Overview */
.character-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34%),
        linear-gradient(135deg, #1f2937, #111827);
}

.character-hero h1 {
    margin: 5px 0;
    font-size: 34px;
}

.character-hero p {
    margin: 0;
    color: #94a3b8;
}

.character-kicker {
    color: #67e8f9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.character-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 10px;
    min-width: min(430px, 100%);
}

.character-hero-stats > div,
.character-stat-box,
.character-equipment-card {
    border: 1px solid #2f3b52;
    border-radius: 10px;
    background: #111827;
}

.character-hero-stats > div {
    padding: 14px;
}

.character-hero-stats span,
.character-section-title span,
.character-stat-box span,
.character-stat-box small,
.character-skill-row span,
.character-skill-row small,
.character-equipment-meta,
.character-equipment-slot,
.character-equipment-empty {
    color: #94a3b8;
}

.character-hero-stats strong {
    display: block;
    margin-top: 5px;
    color: #f8fafc;
    font-size: 20px;
}

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

.character-panel {
    min-width: 0;
}

.character-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.character-section-title h2 {
    margin: 0;
}

.character-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.character-stat-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-utility-groups {
    display: grid;
    gap: 16px;
}

.character-utility-group {
    padding: 12px;
    border: 1px solid #293852;
    border-radius: 12px;
    background: #0f172a;
}

.character-utility-group h3 {
    margin: 0 0 10px;
    color: #93c5fd;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-stat-box {
    position: relative;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.character-stat-box strong {
    color: #f8fafc;
    font-size: 20px;
}

.character-stat-box small {
    font-size: 12px;
}

.character-breakdown {
    display: none;
    position: absolute;
    left: 10px;
    top: calc(100% - 4px);
    z-index: 60;
    width: min(260px, calc(100vw - 40px));
    padding: 11px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #07101f;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
}

.character-stat-box:hover .character-breakdown,
.character-stat-box:focus-within .character-breakdown {
    display: grid;
    gap: 6px;
}

.character-breakdown strong {
    margin-bottom: 4px;
    color: #e2e8f0;
    font-size: 13px;
}

.character-breakdown div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-top: 5px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 12px;
}

.character-breakdown span {
    color: #94a3b8;
}

.character-breakdown em {
    color: #f8fafc;
    font-style: normal;
    font-weight: 700;
}

.character-empty-note {
    margin: 0;
    color: #94a3b8;
}

.character-buff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.character-buff-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
}

.character-buff-card.character-buff-quest {
    border-color: #7c3aed;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.18), transparent 42%),
        #0f172a;
}

.character-buff-card.character-buff-global {
    border-color: #22c55e;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 42%),
        #0f172a;
}

.character-buff-card > span {
    color: #93c5fd;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.character-buff-card strong {
    color: #f8fafc;
}

.character-buff-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.character-buff-card em {
    color: #c084fc;
    font-style: normal;
    font-weight: 900;
}

.character-buff-card time {
    color: #c9d6e8;
    font-size: 12px;
}

.character-skill-list {
    display: grid;
    gap: 10px;
}

.character-skill-row {
    display: grid;
    grid-template-columns: 120px minmax(120px, 1fr) 110px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #2f3b52;
    border-radius: 9px;
    background: #111827;
}

.character-skill-row strong,
.character-skill-row span {
    display: block;
}

.character-skill-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #0f172a;
}

.character-skill-progress > div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0284c7, #67e8f9);
}

.character-equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.character-equipment-card {
    min-height: 180px;
    padding: 13px;
}

.character-equipment-card.empty {
    display: grid;
    place-content: center;
    text-align: center;
}

.character-equipment-slot {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-equipment-name {
    font-weight: 800;
}

.character-equipment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
}

.character-equipment-stats {
    display: grid;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.character-equipment-stats li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 13px;
}

.character-equipment-stats li:last-child {
    border-bottom: 0;
}

.character-equipment-stats span {
    color: #cbd5e1;
}

.character-equipment-stats strong {
    color: #f8fafc;
}

.character-equipment-action {
    margin-top: 12px;
}

.character-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.action-box {
    border-top: 1px solid #374151;
    padding: 16px 0;
}

.action-box:first-child {
    border-top: none;
}

h1, h2, h3 {
    color: #f9fafb;
}

a {
    color: #60a5fa;
}

button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background: #1d4ed8;
}

.side-navigation {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: 220px;
    padding: 18px 12px;
    border-right: 1px solid #334155;
    background:
        linear-gradient(rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.96)),
        radial-gradient(circle at 15% 20%, #1e3a8a 0, transparent 45%);
}

.side-logo {
    margin-bottom: 22px;
    padding: 0 10px 16px;
    border-bottom: 1px solid #334155;
}

.side-logo a {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
}

.side-menu {
    display: grid;
    gap: 5px;
}

.side-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    color: #94a3b8;
    text-decoration: none;
}

.side-menu a:hover,
.side-menu a.active {
    color: #f8fafc;
    background: rgba(59, 130, 246, 0.18);
}

.side-menu a.active {
    box-shadow: inset 3px 0 #38bdf8;
}

.side-menu-icon {
    display: inline-grid;
    width: 22px;
    place-items: center;
    color: #60a5fa;
}

.side-menu .side-menu-logout {
    margin-top: 18px;
    border-top: 1px solid #334155;
    border-radius: 0;
}

.has-side-navigation .global-hud {
    width: calc(100% - 220px);
    margin-left: 220px;
}

.has-side-navigation .page {
    width: calc(100% - 470px);
    max-width: 1140px;
    margin: 30px auto 30px 220px;
}

.has-side-navigation .site-footer {
    width: calc(100% - 470px);
    margin-left: 220px;
}

.has-side-navigation {
    padding-bottom: 285px;
}

.global-hud {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 44px;
    border-bottom: 1px solid #334155;
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(8px);
}

.global-hud-values {
    display: grid;
    grid-template-columns: 140px minmax(420px, 1fr) minmax(520px, 1.25fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 7px 14px;
    min-height: 24px;
    font-size: 0.82rem;
    box-sizing: border-box;
}

.global-hud-character {
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-hud-character:hover {
    color: #67e8f9;
}

.global-hud-group {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    gap: 8px;
    min-width: 0;
}

.global-hud-group span {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(58px, 1fr);
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    color: #94a3b8;
    white-space: nowrap;
}

.global-hud-group strong {
    display: inline-block;
    min-width: 58px;
    margin-left: 0;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.global-hud-primary strong {
    color: #67e8f9;
}

.global-hud-gold strong {
    color: #facc15;
}

.global-hud-crystals strong {
    color: #c084fc;
}

.global-action {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    text-decoration: none;
}

.global-action:hover {
    background: transparent;
}

.global-action-track {
    position: relative;
    height: 20px;
    overflow: hidden;
    border-top: 1px solid #475569;
    background: #0f172a;
}

.global-action.inactive {
    pointer-events: none;
}

.global-action.inactive .global-action-track {
    border-top-color: transparent;
    background: transparent;
}

.global-action.inactive .global-action-fill,
.global-action.inactive .global-action-track span {
    opacity: 0;
}

.global-action-fill {
    height: 100%;
    background: linear-gradient(90deg, #9f2d22, #d17a24);
    will-change: width;
}

.global-action-track span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}

.active-buffs-panel {
    position: fixed;
    top: 72px;
    right: 12px;
    z-index: 45;
    width: 230px;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #293852;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.active-buffs-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.active-buffs-title span {
    color: #67e8f9;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.active-buffs-title strong {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #ffffff;
    text-align: center;
}

.active-buffs-panel p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.active-buffs-list {
    display: grid;
    gap: 8px;
}

.active-buff-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px;
    border: 1px solid #334155;
    border-radius: 9px;
    background: #0f172a;
}

.active-buff-entry.active-buff-quest {
    border-color: #7c3aed;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.22), transparent 42%),
        #0f172a;
}

.active-buff-entry.active-buff-global {
    border-color: #22c55e;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.2), transparent 42%),
        #0f172a;
}

.active-buff-entry.active-buff-premium {
    border-color: #f59e0b;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), transparent 42%),
        #0f172a;
}

.active-buff-entry.expired {
    opacity: 0.45;
}

.active-buff-entry strong {
    display: block;
    color: #f8fafc;
    font-size: 13px;
}

.active-buff-entry span {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.active-buff-entry span b {
    color: #dbeafe;
}

.active-buff-entry em {
    flex: 0 0 auto;
    color: #c084fc;
    font-style: normal;
    font-weight: 900;
}

@media (max-width: 800px) {
    .global-hud-values {
        display: grid;
        gap: 4px;
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .global-hud-group {
        gap: 3px 10px;
    }

    .side-navigation {
        position: static;
        width: 100%;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid #334155;
    }

    .side-logo {
        margin: 0 0 8px;
        padding: 0 6px 8px;
    }

    .side-menu {
        display: flex;
        overflow-x: auto;
    }

    .side-menu a {
        flex: 0 0 auto;
        padding: 8px 10px;
    }

    .side-menu .side-menu-logout {
        margin: 0;
        border: 0;
    }

    .has-side-navigation .global-hud,
    .has-side-navigation .page,
    .has-side-navigation .site-footer {
        width: 100%;
        margin-left: 0;
    }

    .active-buffs-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 10px;
    }

    .has-side-navigation {
        padding-bottom: 330px;
    }
}

.button-link {
    display: inline-block;
    background: #2563eb;
    color: #ffffff;
    border-radius: 6px;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: bold;
}

.button-link:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.button-secondary {
    background: #475569;
}

.button-secondary:hover {
    background: #334155;
}

.button-danger {
    background: #b91c1c;
}

.button-danger:hover {
    background: #991b1b;
}

.button-market {
    background: #7c3aed;
}

input {
    width: 100%;
    max-width: 360px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #e5e7eb;
}

.message-success {
    background: #064e3b;
    border: 1px solid #10b981;
    color: #d1fae5;
    padding: 12px;
    border-radius: 8px;
}

.message-error {
    background: #7f1d1d;
    border: 1px solid #ef4444;
    color: #fee2e2;
    padding: 12px;
    border-radius: 8px;
}

.flash-toast-overlay {
    position: fixed;
    top: 58px;
    right: 18px;
    z-index: 250;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 36px));
    pointer-events: none;
}

.flash-toast {
    position: relative;
    padding: 12px 42px 12px 14px;
    border-radius: 10px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.38);
    color: #ffffff;
    font-weight: 700;
    pointer-events: auto;
    transition: opacity 250ms ease, transform 250ms ease;
}

.global-exp {
    height: 14px;
    background: #050b16;
    border-top: 1px solid #182438;
}

.global-exp.inactive {
    display: none;
}

.global-exp-track {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.global-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #15803d, #22c55e);
}

.global-exp-track span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px #000000;
    pointer-events: none;
}

.flash-toast.success {
    border: 1px solid #10b981;
    background: rgba(6, 78, 59, 0.96);
}

.flash-toast.error {
    border: 1px solid #ef4444;
    background: rgba(127, 29, 29, 0.96);
}

.flash-toast.fade-out {
    opacity: 0;
    transform: translateY(-8px);
}

.flash-toast button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.12);
    line-height: 1;
}

.game-update-notice {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
}

.game-update-notice-box {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid #38bdf8;
    border-radius: 16px;
    background: linear-gradient(145deg, #101b2e, #17243a);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    color: #e5f3ff;
    text-align: center;
}

.game-update-notice-box strong {
    display: block;
    margin-bottom: 8px;
    color: #67e8f9;
    font-size: 1.25rem;
}

.game-update-notice-box p {
    margin: 0 0 16px;
    color: #cbd5e1;
}

.game-update-notice-box button {
    width: 100%;
    border: 0;
    background: linear-gradient(90deg, #7c3aed, #2563eb);
}

/* Guild */
.guild-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.guild-heading h1,
.guild-heading p {
    margin: 0;
}

.guild-heading p,
.guild-list-row span,
.guild-list-row small,
.guild-subpanel h3 {
    color: #9fb0c6;
}

.guild-badge {
    display: grid;
    gap: 4px;
    min-width: 180px;
    padding: 12px;
    border: 1px solid #2f7df6;
    border-radius: 10px;
    background: rgba(47, 125, 246, 0.12);
}

.guild-badge span {
    color: #67e8f9;
    font-weight: 700;
}

.guild-badge strong {
    color: #ffffff;
}

.guild-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.guild-tabs a {
    padding: 9px 12px;
    border: 1px solid #2d3a50;
    border-radius: 8px;
    color: #c9d6e8;
    background: #111b2a;
    text-decoration: none;
}

.guild-tabs a:hover,
.guild-tabs a.active {
    color: #ffffff;
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.16);
}

.guild-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 16px;
    margin-top: 16px;
}

.guild-panel {
    min-width: 0;
}

.guild-form {
    display: grid;
    gap: 12px;
}

.guild-form label {
    display: grid;
    gap: 6px;
    color: #9fb0c6;
    font-size: 12px;
    text-transform: uppercase;
}

.guild-form input {
    max-width: none;
}

.guild-form select {
    width: 100%;
    max-width: none;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #e5e7eb;
}

.guild-deposit-form {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    margin-top: 14px;
}

.guild-bank-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.guild-bank-grid div,
.guild-upgrade-card {
    border: 1px solid #223049;
    border-radius: 9px;
    background: #111b2a;
}

.guild-bank-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.guild-bank-grid span,
.guild-upgrade-card span,
.guild-upgrade-card small {
    color: #9fb0c6;
}

.guild-bank-grid strong {
    color: #ffffff;
}

.guild-upgrade-list {
    display: grid;
    gap: 8px;
}

.guild-upgrade-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.guild-upgrade-card > div {
    display: grid;
    gap: 4px;
}

.guild-upgrade-card strong {
    color: #ffffff;
}

.guild-task-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #223049;
    border-radius: 10px;
    background: #111b2a;
}

.guild-boss-preview {
    display: grid;
    grid-column: 1 / -1;
    gap: 12px;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
}

.guild-boss-preview-header {
    display: grid;
    gap: 4px;
}

.guild-boss-preview-header span {
    color: #93c5fd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guild-boss-preview-header strong {
    color: #ffffff;
    font-size: 18px;
    line-height: 1.15;
}

.guild-boss-preview-main {
    display: grid;
    grid-template-columns: minmax(180px, 1.15fr) minmax(0, 1.85fr);
    gap: 10px;
    align-items: stretch;
}

.guild-boss-preview-power,
.guild-boss-preview-rewards > div {
    border: 1px solid #24334e;
    border-radius: 10px;
    background: rgba(7, 16, 31, 0.72);
}

.guild-boss-preview-power {
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 12px;
}

.guild-boss-preview-power span,
.guild-boss-preview-rewards span {
    color: #9fb0c6;
    font-size: 12px;
}

.guild-boss-preview-power strong {
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
}

.guild-boss-preview-rewards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.guild-boss-preview-rewards > div {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 64px;
    padding: 10px;
}

.guild-boss-preview-rewards strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.15;
}

.guild-boss-start-button {
    grid-column: 1 / -1;
}

.guild-task-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #c9d6e8;
}

.guild-task-topline strong {
    color: #ffffff;
}

.guild-task-progress {
    position: relative;
    height: 28px;
    overflow: hidden;
    border: 1px solid #2d3a50;
    border-radius: 999px;
    background: #07101f;
}

.guild-task-progress div {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    min-width: 0;
    transition: width 0.25s ease;
}

.boss-hp-progress div {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

.guild-task-progress > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 12px;
    color: #ffffff;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 1px 2px #020617;
}

.guild-task-form {
    grid-template-columns: minmax(180px, 260px) auto;
    align-items: end;
    margin-top: 14px;
}

.guild-task-hint {
    margin: 8px 0 0;
    color: #9fb0c6;
    font-size: 13px;
}

.quest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.quest-type-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.quest-type-tab {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid #26364f;
    border-radius: 12px;
    background: #111827;
    color: #c9d6e8;
    text-decoration: none;
}

.quest-type-tab span {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.quest-type-tab strong {
    color: #9fb0c6;
    font-size: 12px;
}

.quest-type-tab.combat.active {
    border-color: #ef4444;
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.22), transparent 42%),
        #111827;
}

.quest-type-tab.farming.active {
    border-color: #22c55e;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.22), transparent 42%),
        #111827;
}

.quest-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #223049;
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 36%),
        #111b2a;
}

.quest-card.claimed {
    opacity: 0.72;
}

.quest-card.not-started {
    background:
        radial-gradient(circle at top right, rgba(148, 163, 184, 0.12), transparent 36%),
        #111827;
}

.quest-card.queued {
    border-color: #7c3aed;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 36%),
        #111827;
}

.quest-section-battle .quest-card:not(.not-started):not(.queued) {
    border-color: #7f1d1d;
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.14), transparent 36%),
        #111b2a;
}

.quest-section-gathering .quest-card:not(.not-started):not(.queued) {
    border-color: #14532d;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.16), transparent 36%),
        #111b2a;
}

.quest-section + .quest-section {
    margin-top: 14px;
}

.quest-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.quest-card-header > div {
    display: grid;
    gap: 3px;
}

.quest-card-header span {
    color: #60a5fa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quest-card-header strong {
    color: #ffffff;
    font-size: 18px;
}

.quest-reward {
    align-self: start;
    padding: 5px 8px;
    border: 1px solid #7c3aed;
    border-radius: 999px;
    color: #d8b4fe;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.quest-card p {
    margin: 0;
    color: #c9d6e8;
}

.quest-progress {
    position: relative;
    height: 26px;
    overflow: hidden;
    border: 1px solid #2d3a50;
    border-radius: 999px;
    background: #07101f;
}

.quest-progress div {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #2563eb);
    min-width: 0;
}

.quest-progress > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 2px #020617;
}

.quest-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.quest-shop-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quest-shop-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #293852;
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 38%),
        #111827;
}

.quest-shop-card.active {
    border-color: #7c3aed;
}

.quest-shop-card span {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.quest-shop-card strong {
    display: block;
    color: #ffffff;
    font-size: 19px;
}

.quest-shop-card p {
    margin: 0;
    color: #c9d6e8;
}

.quest-shop-active {
    color: #c4b5fd !important;
    font-weight: 800;
}

.quest-shop-hint {
    color: #94a3b8;
    font-size: 12px;
}

.quest-package-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.quest-package-row button,
.quest-shop-card > form button {
    width: 100%;
    padding: 9px 8px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
}

.quest-package-row button:disabled,
.quest-shop-card > form button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.quest-package-row small {
    display: block;
    color: #dbeafe;
    font-size: 11px;
}

.shop-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.shop-package-card {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid #3b2f62;
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(192, 132, 252, 0.2), transparent 42%),
        #111b2a;
}

.shop-package-card span {
    display: block;
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.shop-package-card strong {
    display: block;
    margin-top: 6px;
    color: #ffffff;
    font-size: 24px;
}

.shop-package-card small {
    display: block;
    margin-top: 6px;
    color: #9fb0c6;
}

.shop-package-card button {
    width: 100%;
    background: linear-gradient(90deg, #7c3aed, #2563eb);
}

.shop-package-card-disabled {
    opacity: 0.58;
}

.shop-package-card-disabled button,
.shop-package-card button:disabled {
    cursor: not-allowed;
    background: #334155;
}

.shop-reset-form {
    margin-top: 14px;
}

.shop-qol-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}

.shop-qol-main {
    min-width: 0;
}

.shop-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.shop-qol-buff-grid {
    grid-template-columns: minmax(260px, 420px);
}

.shop-compact-card {
    min-height: 0;
    padding: 14px;
}

.shop-compact-card strong {
    font-size: 20px;
}

.shop-action-pack-card {
    border-color: #1d4ed8;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.2), transparent 42%),
        #111b2a;
}

.shop-benefit-list {
    display: grid;
    gap: 5px;
    margin: 10px 0 0;
    padding-left: 18px;
    color: #c9d6e8;
    font-size: 13px;
}

.shop-benefit-list li::marker {
    color: #a78bfa;
}

.shop-auto-panel {
    align-self: start;
}

.character-section-title.compact {
    margin-bottom: 10px;
}

.character-section-title.compact h2 {
    font-size: 20px;
}

.shop-form-label {
    display: block;
    margin-bottom: 8px;
    color: #9fb0c6;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.auto-dismantle-form {
    margin-top: 10px;
}

.auto-dismantle-form.compact {
    gap: 10px;
}

.auto-dismantle-form.compact button {
    width: 100%;
}

.auto-toggle {
    border-color: #334155;
    background: #0f172a;
}

.rarity-checkbox-list.compact {
    grid-template-columns: 1fr;
    gap: 5px;
}

.rarity-checkbox-list.compact .rarity-checkbox {
    padding: 6px 8px;
}

.auto-level-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auto-level-row label {
    display: grid;
    gap: 5px;
    color: #9fb0c6;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.auto-level-row input {
    width: 100%;
    min-width: 0;
}

@media (max-width: 1000px) {
    .shop-qol-layout {
        grid-template-columns: 1fr;
    }
}

.guild-list {
    display: grid;
    gap: 8px;
}

.guild-list.compact {
    gap: 4px;
}

.guild-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #223049;
    border-radius: 9px;
    background: #111b2a;
}

.guild-list-row > div {
    display: grid;
    gap: 3px;
}

.guild-list-row a {
    color: #67e8f9;
    text-decoration: none;
}

.guild-list-row a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.guild-online-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9fb0c6;
    font-size: 12px;
    font-weight: 700;
}

.guild-online-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #64748b;
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.6);
}

.guild-online-status.online {
    color: #86efac;
}

.guild-online-status.online::before {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.75);
}

.guild-online-status.offline {
    color: #94a3b8;
}

.guild-actions {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
}

.guild-subpanel {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.guild-subpanel h3 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .guild-heading,
    .guild-layout,
    .guild-list-row,
    .guild-deposit-form,
    .guild-bank-grid,
    .guild-upgrade-card {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.site-footer {
    max-width: 1100px;
    margin: 40px auto 20px auto;
    padding: 0 20px;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 700px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .grid,
    .stat-grid,
    .character-layout,
    .character-stat-grid,
    .character-stat-grid.compact,
    .character-equipment-grid,
    .character-hero-stats,
    .equipment-set-grid {
        grid-template-columns: 1fr;
    }

.equipment-set-card {
    align-items: stretch;
    flex-direction: column;
}

.equipment-set-actions,
.equipment-set-rename-form {
    grid-template-columns: 1fr;
    flex-direction: column;
}

.equipment-set-rename-form input {
    max-width: none;
}

    .character-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .character-skill-row {
        grid-template-columns: 1fr;
    }
}
/* =========================
   Inventory / Equipment UI
   ========================= */

.item-card {
    position: relative;
    border: 1px solid #2f3b52;
    background: linear-gradient(180deg, #182033 0%, #111827 100%);
}

.item-card.equipped {
    border-color: #4ade80;
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-name {
    margin: 0;
    font-size: 18px;
}

.item-meta {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
}

.item-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.rarity-common {
    background: #374151;
    color: #e5e7eb;
}

.rarity-uncommon {
    background: #14532d;
    color: #bbf7d0;
}

.rarity-rare {
    background: #1e3a8a;
    color: #bfdbfe;
}

.rarity-epic {
    background: #581c87;
    color: #e9d5ff;
}

.rarity-legendary {
    background: #78350f;
    color: #fde68a;
}

.equipped-label {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
    font-size: 12px;
    font-weight: 700;
}

.item-stats {
    list-style: none;
    padding: 0;
    margin: 10px 0 14px 0;
}

.item-stats li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

.item-stats li:last-child {
    border-bottom: none;
}

.item-stat-name {
    opacity: 0.85;
}

.item-stat-value {
    font-weight: 700;
}

.item-actions {
    margin-top: 12px;
}

.item-actions button {
    width: 100%;
}
/* =========================
   Inventory List UI
   ========================= */

.inventory-table-wrap {
    width: 100%;
    overflow: visible;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.inventory-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #374151;
    color: #e5e7eb;
    font-weight: 700;
}

.inventory-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2f3747;
    vertical-align: middle;
}

.inventory-row {
    background: #111827;
}

.inventory-row:hover {
    background: #172033;
}

.locked-row {
    box-shadow: inset 3px 0 0 #fbbf24;
}

.equipped-row {
    background: rgba(74, 222, 128, 0.06);
}

.item-name-wrap {
    position: relative;
    display: inline-block;
}

.item-name-list {
    font-weight: 700;
    cursor: help;
}

.rarity-text-common {
    color: #e5e7eb;
}

.rarity-text-uncommon {
    color: #22c55e;
}

.rarity-text-rare {
    color: #3b82f6;
}

.rarity-text-epic {
    color: #a855f7;
}

.rarity-text-legendary {
    color: #f97316;
}

.item-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 24px;
    z-index: 50;
    min-width: 260px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #0b1020;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color: #e5e7eb;
}

.item-name-wrap:hover .item-tooltip {
    display: block;
}

.comparison-tooltip {
    width: min(620px, calc(100vw - 60px));
}

.inventory-table .comparison-tooltip {
    top: auto;
    bottom: 24px;
}

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

.comparison-item {
    min-width: 0;
    padding-right: 14px;
}

.comparison-item + .comparison-item {
    padding-right: 0;
    padding-left: 14px;
    border-left: 1px solid #374151;
}

.comparison-label {
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.comparison-stats {
    display: grid;
    gap: 5px;
    font-size: 12px;
}

.comparison-stats > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.comparison-stats span {
    color: #cbd5e1;
}

.comparison-better {
    color: #4ade80;
}

.comparison-worse {
    color: #f87171;
}

.comparison-equal {
    color: #e5e7eb;
}

.tooltip-title {
    font-weight: 800;
    margin-bottom: 8px;
}

.tooltip-meta {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tooltip-stats {
    font-size: 13px;
    line-height: 1.6;
}

.inventory-equipped-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
    font-size: 12px;
    font-weight: 700;
}

.small-button {
    padding: 5px 10px;
    font-size: 13px;
}

.small-button.button-link {
    padding: 5px 10px;
}
/* =========================
   Inventory Page Layout
   ========================= */

.page-title-center {
    text-align: center;
    margin: 20px 0 24px 0;
    font-size: 32px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.equipment-slot-box {
    min-height: 95px;
    padding: 12px;
    border: 1px solid #2f3747;
    border-radius: 8px;
    background: #111827;
}

.equipment-slot-box:hover {
    background: #172033;
}

.equipment-slot-title {
    margin-bottom: 8px;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
}

.equipment-empty {
    color: #6b7280;
    font-style: italic;
}

.equipment-slot-action {
    margin-top: 10px;
}

.equipment-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: #9ca3af;
    font-size: 12px;
}

.equipment-set-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.equipment-set-card {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid #2f3b52;
    border-radius: 9px;
    background: #111827;
}

.equipment-set-card strong,
.equipment-set-card span,
.equipment-set-card small {
    display: block;
}

.equipment-set-card span,
.equipment-set-card small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.equipment-set-info {
    min-width: 130px;
}

.equipment-set-actions {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto auto auto;
    gap: 6px;
    align-items: end;
    min-width: 0;
}

.equipment-set-actions form {
    margin: 0;
}

.equipment-set-rename-form {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.equipment-set-rename-form input {
    min-width: 130px;
    max-width: none;
    padding: 6px 8px;
}

.equipment-set-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.equipment-set-badges span {
    padding: 2px 6px;
    border: 1px solid #0ea5e9;
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.16);
    font-size: 11px;
    font-weight: 800;
}

.equipment-set-card.compact {
    display: grid;
    grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 12px;
    overflow: hidden;
}

.equipment-set-card.compact .equipment-set-info {
    min-width: 0;
}

.inventory-collapsible-section {
    padding: 0;
    overflow: hidden;
}

.inventory-section-toggle {
    width: 100%;
    padding: 18px 20px;
    border: 0;
    color: #ffffff;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.inventory-section-toggle:hover {
    background: rgba(47, 125, 246, 0.08);
}

.inventory-section-toggle .inventory-heading-text {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}

.inventory-section-toggle h2 {
    margin: 0;
}

.inventory-collapsible-section > [data-collapsible-content] {
    margin: 0 20px 20px;
}

.inventory-collapsible-section > [data-collapsible-content][hidden] {
    display: none;
}

.inventory-collapsible-section.open > .inventory-section-toggle .equipment-set-chevron {
    color: #facc15;
    font-size: 0;
}

.inventory-collapsible-section.open > .inventory-section-toggle .equipment-set-chevron::before {
    content: "-";
    font-size: 14px;
}

.equipment-set-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 0;
    color: #ffffff;
    background: transparent;
    text-align: left;
}

.equipment-set-toggle:hover {
    background: rgba(47, 125, 246, 0.12);
}

.equipment-set-chevron {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid #334155;
    border-radius: 999px;
    color: #67e8f9;
    font-weight: 900;
}

.equipment-set-card.open .equipment-set-chevron {
    color: #facc15;
}

.equipment-set-card.open .equipment-set-chevron::before {
    content: "-";
}

.equipment-set-card.open .equipment-set-chevron {
    font-size: 0;
}

.equipment-set-card.open .equipment-set-chevron::before {
    font-size: 14px;
}

.equipment-set-details {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    gap: 6px;
    align-items: end;
    padding: 0;
}

.equipment-set-details[hidden] {
    display: none;
}

.equipment-set-details form {
    margin: 0;
}

.set-row {
    box-shadow: inset 3px 0 0 #38bdf8;
}

@media (max-width: 700px) {
    .equipment-set-card {
        grid-template-columns: 1fr;
    }

    .equipment-set-actions,
    .equipment-set-rename-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .equipment-set-rename-form input {
        max-width: none;
    }

    .equipment-set-details {
        grid-template-columns: 1fr;
    }
}

.inventory-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.inventory-section-heading h2 {
    margin: 0;
}

.inventory-storage-count {
    margin-right: auto;
    color: #91a0b7;
    font-size: 13px;
}

.inventory-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr)) repeat(2, auto) auto auto;
    gap: 10px;
    align-items: end;
    margin: 14px 0;
    padding: 12px;
    border: 1px solid #28384d;
    border-radius: 8px;
    background: #111a29;
}

.inventory-filter-bar label {
    display: grid;
    gap: 5px;
    color: #8f9bad;
    font-size: 12px;
    text-transform: uppercase;
}

.inventory-range-filter {
    display: grid;
    gap: 5px;
    width: 118px;
}

.inventory-range-filter > span {
    color: #8f9bad;
    font-size: 12px;
    text-transform: uppercase;
}

.inventory-range-filter > div {
    display: grid;
    grid-template-columns: 56px 56px;
    gap: 5px;
}

.inventory-filter-bar input,
.inventory-filter-bar select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #2c3b50;
    border-radius: 6px;
    color: #e6edf7;
    background: #0d1625;
}

.inventory-filter-reset {
    align-self: center;
    text-align: center;
}

.inventory-filter-empty {
    color: #95a0b3;
}

.inventory-item-heading {
    display: flex;
    align-items: center;
    gap: 7px;
}

.item-lock-button {
    min-width: 30px;
    padding: 4px 6px;
    border: 1px solid #475569;
    background: #1e293b;
    font-size: 15px;
    line-height: 1;
}

.item-lock-button:hover {
    background: #334155;
}

.item-lock-button.locked {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.2);
}

.inventory-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.inventory-action-group form {
    margin: 0;
}

.inventory-modal[hidden] {
    display: none;
}

.inventory-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.inventory-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
}

.inventory-modal-panel {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    padding: 22px;
    border: 1px solid #475569;
    border-radius: 10px;
    background: #1f2937;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.inventory-modal-panel h2 {
    margin-top: 0;
}

.modal-safety-note {
    color: #fbbf24;
    font-size: 14px;
}

.rarity-checkbox-list {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.rarity-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 7px;
    background: #111827;
    font-weight: 700;
    cursor: pointer;
}

.rarity-checkbox input {
    width: auto;
}

.inventory-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-open {
    overflow: hidden;
}

/* =========================
   Forge
   ========================= */

.forge-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
    gap: 20px;
}

.forge-main-card {
    max-width: 850px;
    margin-right: auto;
    margin-left: auto;
}

.forge-item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forge-item-link {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
    text-decoration: none;
    font-weight: 700;
}

.forge-item-link:hover,
.forge-item-link.selected {
    border-color: #3b82f6;
    background: #172033;
}

.forge-item-link small {
    color: #9ca3af;
    font-weight: 400;
    white-space: nowrap;
}

.forge-selected-item h3 {
    margin-bottom: 6px;
}

.forge-meta {
    margin-top: 0;
    color: #9ca3af;
}

.forge-stat-list {
    margin: 0 0 18px;
    padding: 0;
}

.forge-stat-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(190px, auto);
    align-items: center;
    gap: 20px;
    padding: 9px 0;
    border-bottom: 1px solid #374151;
}

.forge-stat-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forge-stat-row small {
    color: #9ca3af;
}

.forge-stat-row > strong {
    color: #86efac;
}

.forge-upgrade-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.forge-inline-cost {
    font-size: 11px;
    text-align: right;
}

.forge-warning {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #92400e;
    border-radius: 8px;
    background: rgba(146, 64, 14, 0.18);
    color: #fde68a;
    font-size: 14px;
}

.forge-rarity-panel {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #6d28d9;
    border-radius: 9px;
    background: rgba(88, 28, 135, 0.15);
}

.forge-rarity-panel h3 {
    margin-top: 0;
}

.forge-chance {
    color: #fbbf24;
    font-weight: 700;
}

.forge-use-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 20px;
    padding: 10px 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
}

.forge-rarity-bonus {
    margin: -10px 0 20px;
    color: #c4b5fd;
    font-size: 14px;
}

.forge-rarity-bonus strong {
    color: #ddd6fe;
}

.forge-lock-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
}

.forge-lock-options legend {
    padding: 0 6px;
    color: #e5e7eb;
    font-weight: 700;
}

.forge-lock-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.forge-lock-options input {
    width: auto;
}

.forge-cost-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.forge-cost-box span,
.forge-cost-box strong {
    padding: 6px 9px;
    border-radius: 6px;
    background: #111827;
}

.forge-cost-value {
    display: inline-block;
}

.forge-cost-missing,
.forge-cost-missing span {
    color: #f87171 !important;
}

.forge-remaining,
.forge-limit-message {
    display: block;
    margin-top: 8px;
    color: #9ca3af;
}

button:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.65;
}

.forge-balances {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.forge-balances div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
}

.forge-balances span {
    color: #9ca3af;
    font-size: 13px;
}

.forge-balances strong {
    color: #f9fafb;
    font-size: 18px;
}

@media (max-width: 700px) {
    .inventory-table-wrap {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .forge-layout {
        grid-template-columns: 1fr;
    }

    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .forge-item-link {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .forge-stat-row {
        grid-template-columns: 1fr auto;
    }

    .forge-upgrade-form {
        grid-column: 1 / -1;
        align-items: stretch;
    }

    .forge-inline-cost {
        text-align: left;
    }

    .forge-balances {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comparison-tooltip {
        left: -40px;
    }

    .comparison-columns {
        grid-template-columns: 1fr;
    }

    .comparison-item + .comparison-item {
        margin-top: 12px;
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid #374151;
        border-left: none;
    }

    .inventory-section-heading,
    .inventory-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .inventory-filter-bar {
        grid-template-columns: 1fr;
    }
}
/* Battle */
.battle-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.battle-monster-overview {
    max-width: 620px;
    margin: 0 auto;
}

.battle-top-section {
    margin: 0 auto 20px;
    max-width: 900px;
}

.battle-monster-select {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.battle-monster-select input {
    width: 150px;
}

.battle-monster-select select {
    min-width: 190px;
}

.combat-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.combat-stat-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.battle-progress-heading,
.battle-log-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.battle-progress-track {
    position: relative;
    height: 42px;
    overflow: hidden;
    border: 1px solid #7c5d2d;
    border-radius: 8px;
    background: #130f0b;
}

.battle-running-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 8px;
}

.battle-balance-note {
    text-align: center;
    color: #9ca3af;
}

.battle-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8d251f, #d3852b);
    will-change: width;
}

.battle-progress-track > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 1px 3px #000;
}

.battle-log-list {
    display: grid;
    gap: 8px;
}

.battle-log-entry {
    display: grid;
    grid-template-columns: 100px repeat(6, minmax(90px, 1fr));
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-left: 4px solid;
    background: rgba(255, 255, 255, 0.025);
}

.battle-log-entry.victory {
    border-color: #4caf72;
}

.battle-log-entry.victory > strong {
    color: #6bd18f;
}

.battle-log-entry.defeat {
    border-color: #d04f4f;
}

.battle-log-entry.defeat > strong {
    color: #ef6b6b;
}

.gathering-log-entry {
    grid-template-columns: 130px repeat(4, minmax(100px, 1fr));
    border-color: #6b8e46;
}

.gathering-log-entry.critical {
    border-color: #e6b84a;
    background: rgba(230, 184, 74, 0.08);
}

.gathering-log-entry.critical > strong {
    color: #f2cc67;
}

@media (max-width: 900px) {
    .battle-comparison {
        grid-template-columns: 1fr;
    }

    .battle-monster-select,
    .battle-running-meta {
        flex-wrap: wrap;
    }

    .battle-log-entry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Market */
.market-heading,
.market-panel-title,
.market-item-top,
.market-item-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.market-heading {
    margin-bottom: 18px;
}

.market-heading h1,
.market-heading p {
    margin: 0;
}

.market-heading p,
.market-panel-title small,
.market-item-top span,
.market-item-meta,
.market-empty {
    color: #95a0b3;
}

.market-balance,
.market-message {
    padding: 10px 14px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #172132;
}

.market-balance strong,
.market-gold {
    color: #f1c86a;
}

.market-message {
    margin-bottom: 16px;
}

.market-message.success {
    border-color: #2f7d58;
    color: #70d69d;
}

.market-message.error {
    border-color: #8f3d43;
    color: #f08087;
}

.market-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.market-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.market-tabs a {
    padding: 10px 15px;
    border: 1px solid #273549;
    border-radius: 9px;
    color: #9ca8bc;
    background: #111827;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
}

.market-tabs a:hover,
.market-tabs a.active {
    color: #66b7ff;
    border-color: #66b7ff;
    background: #17243a;
}

.market-content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.market-panel {
    padding: 15px;
    border: 1px solid #273549;
    border-radius: 10px;
    background: linear-gradient(135deg, #182536, #171f2d);
}

.market-panel-title {
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid #34455e;
    color: #69b9f7;
    font-weight: 700;
    text-transform: uppercase;
}

.market-sell-panel .market-panel-title {
    color: #e7b95f;
}

.market-buy-panel .market-panel-title {
    color: #97d36e;
}

.market-order-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.market-form-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.market-form-grid-stacked {
    grid-template-columns: 1fr;
}

.market-form-grid.equipment {
    grid-template-columns: minmax(250px, 2fr) 1fr auto;
}

.market-form-grid label {
    display: grid;
    gap: 6px;
    color: #8f9bad;
    font-size: 12px;
    text-transform: uppercase;
}

.market-quantity-field {
    position: relative;
}

.market-percent-buttons {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.market-percent-buttons button {
    flex: 1;
    padding: 3px 5px;
    border: 1px solid #34465f;
    border-radius: 4px;
    color: #8fb8df;
    background: #142033;
    font-size: 10px;
}

.market-percent-buttons button:hover {
    border-color: #66b7ff;
    color: #d8ecff;
}

.market-form-grid input,
.market-form-grid select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #2c3b50;
    border-radius: 6px;
    color: #e6edf7;
    background: #111a29;
}

.market-sell-button,
.market-buy-button,
.market-buy-order-button {
    border-color: #b88938;
    color: #f1c86a;
    background: rgba(184, 137, 56, 0.12);
}

.market-buy-order-button {
    border-color: #7aa957;
    color: #b9ed90;
    background: rgba(122, 169, 87, 0.12);
}

.market-sell-button {
    min-height: 39px;
}

.market-table-wrap {
    overflow-x: auto;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
}

.market-table th,
.market-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #253245;
    white-space: nowrap;
}

.market-table th {
    color: #8f9bad;
    font-size: 12px;
    text-transform: uppercase;
}

.market-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.market-pagination a,
.market-pagination span {
    min-width: 34px;
    padding: 7px 10px;
    border: 1px solid #2c3b50;
    border-radius: 6px;
    color: #9ca8bc;
    text-align: center;
    text-decoration: none;
    background: #111c2b;
}

.market-pagination a:hover,
.market-pagination .active {
    border-color: #66b7ff;
    color: #d8ecff;
    background: #17243a;
}

.market-pagination span:not(.active) {
    opacity: 0.55;
}

.market-own {
    color: #7f8ba0;
    font-size: 12px;
}

.market-item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.market-item-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #2d3c51;
    border-radius: 8px;
    background: #111a28;
}

.market-item-top > div {
    display: grid;
    gap: 4px;
}

.market-item-level {
    padding: 5px 8px;
    border-radius: 5px;
    color: #dbe7f7 !important;
    background: #213149;
}

.market-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.market-item-stats span {
    padding: 4px 7px;
    border-radius: 4px;
    color: #b9c9dc;
    background: #1b283a;
    font-size: 12px;
}

.market-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

.market-status {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    color: #aeb8c8;
    background: #2a3547;
    font-size: 11px;
    text-transform: uppercase;
}

.market-status.active,
.market-status.sold {
    color: #78d9a1;
    background: rgba(47, 125, 88, 0.22);
}

.market-status.cancelled,
.market-status.expired {
    color: #e1878b;
    background: rgba(143, 61, 67, 0.22);
}

.market-activity-list {
    display: grid;
}

.market-activity-entry {
    display: grid;
    grid-template-columns: 90px 1.5fr 1fr 130px 150px;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #253245;
}

.market-inline-trade-form {
    display: inline-grid;
    grid-template-columns: 76px auto auto;
    gap: 6px;
    align-items: center;
}

.market-inline-trade-form input {
    width: 76px;
    min-width: 0;
    padding: 6px 8px;
}

.market-max-quantity {
    padding-inline: 8px;
}

.market-price-fill {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: inherit;
}

.market-price-fill:hover,
.market-price-fill:focus-visible {
    color: #ffe08a;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .market-layout {
        grid-template-columns: 1fr;
    }

    .market-tabs {
        flex-direction: row;
        overflow-x: auto;
    }

    .market-form-grid,
    .market-form-grid.equipment,
    .market-order-grid,
    .market-item-grid,
    .market-activity-entry {
        grid-template-columns: 1fr;
    }
}

/* Chat */
.chat-page {
    display: grid;
    gap: 16px;
}

.chat-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.chat-heading h1,
.chat-heading p {
    margin: 0;
}

.chat-heading p,
.chat-cooldown-note,
.chat-panel-title span {
    color: #9fb0c6;
}

.chat-layout {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
}

.chat-channel-list {
    display: grid;
    gap: 8px;
    align-self: start;
}

.chat-channel-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #2d3a50;
    border-radius: 8px;
    color: #c9d6e8;
    text-decoration: none;
    background: #111b2a;
}

.chat-channel-list a:hover,
.chat-channel-list a.active {
    color: #ffffff;
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.16);
}

.chat-channel-list a.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-channel-list small {
    color: #f2c46d;
    font-size: 11px;
}

.chat-panel {
    min-width: 0;
}

.chat-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #2d3a50;
}

.chat-panel-title h2 {
    margin: 0;
}

.chat-system-note {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #cbd5e1;
    background: #111827;
}

.chat-messages {
    display: grid;
    align-content: start;
    gap: 8px;
    height: 420px;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid #2d3a50;
    border-radius: 10px;
    background: #0d1522;
}

.chat-message {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid #223049;
    border-radius: 8px;
    background: #111b2a;
}

.chat-message.own {
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.13);
}

.chat-message-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 0;
    color: #9fb0c6;
    font-size: 12px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.chat-message-meta strong,
.chat-player-name {
    color: #67e8f9;
}

.chat-player-name {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    font: inherit;
    font-weight: 700;
    background: transparent;
    cursor: pointer;
}

.chat-player-name:hover {
    color: #ffffff;
    text-decoration: underline;
}

.chat-message-text {
    color: #e7eef9;
    overflow-wrap: anywhere;
    min-width: 0;
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}

.chat-form label {
    display: grid;
    gap: 5px;
    color: #9fb0c6;
    font-size: 12px;
    text-transform: uppercase;
}

.chat-form input {
    max-width: none;
}

.chat-feedback {
    margin-top: 10px;
    color: #86efac;
}

.chat-feedback.error {
    color: #f87171;
}

.persistent-chat {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 220px;
    z-index: 80;
    --persistent-chat-message-height: 150px;
    max-height: min(72vh, 720px);
    border-top: 1px solid #334155;
    background: rgba(7, 12, 22, 0.98);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.persistent-chat-resizer {
    position: absolute;
    top: -7px;
    right: 0;
    left: 0;
    width: 100%;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: ns-resize;
}

.persistent-chat-resizer::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    width: 72px;
    height: 3px;
    border-radius: 999px;
    background: rgba(111, 143, 190, 0.55);
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 160ms ease;
}

.persistent-chat:hover .persistent-chat-resizer::before,
.persistent-chat.resizing .persistent-chat-resizer::before {
    opacity: 1;
}

.persistent-chat-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #223049;
}

.persistent-chat-tabs button {
    width: auto;
    padding: 6px 12px;
    border: 1px solid #2d3a50;
    border-radius: 999px;
    color: #c9d6e8;
    background: #111b2a;
}

.persistent-chat-tabs button:hover,
.persistent-chat-tabs button.active {
    color: #ffffff;
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.18);
}

.persistent-chat-tabs button.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.persistent-chat-tabs small {
    margin-left: 4px;
    color: #f2c46d;
}

.persistent-chat-tabs #chat-status {
    margin-left: auto;
    color: #78d9a1;
    font-size: 12px;
}

.persistent-chat-body {
    padding: 10px 12px 12px;
}

.persistent-chat .chat-messages {
    height: var(--persistent-chat-message-height);
    padding: 8px;
}

.persistent-chat .chat-message {
    padding: 5px 8px;
}

.persistent-chat .chat-message-meta {
    margin-bottom: 0;
}

.persistent-chat .chat-form {
    margin-top: 8px;
}

.chat-player-menu {
    position: fixed;
    z-index: 120;
    display: grid;
    min-width: 130px;
    overflow: hidden;
    border: 1px solid #334155;
    border-radius: 9px;
    background: #0f172a;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
}

.chat-player-menu[hidden] {
    display: none;
}

.chat-player-menu button {
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #223049;
    border-radius: 0;
    color: #dbe7f7;
    background: transparent;
    text-align: left;
}

.chat-player-menu button:last-child {
    border-bottom: 0;
}

.chat-player-menu button:hover {
    color: #ffffff;
    background: rgba(47, 125, 246, 0.18);
}

.achievement-layout {
    display: grid;
    gap: 18px;
}

.achievement-section {
    display: grid;
    gap: 16px;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px;
}

.achievement-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #0f172a;
}

.achievement-card.complete {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.16) inset;
}

.achievement-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.achievement-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.achievement-card span {
    color: #aab7cc;
}

.achievement-card strong {
    color: #67e8f9;
    white-space: nowrap;
}

.achievement-progress {
    height: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    border-radius: 999px;
    background: #020617;
}

.achievement-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #2f7df6, #22d3ee);
}

.achievement-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.achievement-targets span {
    padding: 4px 8px;
    border: 1px solid #334155;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.82rem;
}

.achievement-targets span.done {
    border-color: rgba(34, 197, 94, 0.65);
    color: #86efac;
}

.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ranking-tabs a {
    padding: 9px 12px;
    border: 1px solid #334155;
    border-radius: 999px;
    color: #cbd5e1;
    background: #0f172a;
    text-decoration: none;
}

.ranking-tabs a.active,
.ranking-tabs a:hover {
    border-color: #38bdf8;
    color: #ffffff;
    background: rgba(47, 125, 246, 0.22);
}

.ranking-card {
    display: grid;
    gap: 14px;
}

.ranking-table {
    display: grid;
    overflow: hidden;
    border: 1px solid #253247;
    border-radius: 12px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 90px 1fr 180px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #253247;
}

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

.ranking-head {
    color: #93c5fd;
    background: rgba(47, 125, 246, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ranking-row strong {
    color: #ffffff;
}

.ranking-row span:last-child {
    color: #67e8f9;
    text-align: right;
}

.ranking-score {
    color: #67e8f9;
    text-align: right;
}

@media (max-width: 700px) {
    .ranking-row {
        grid-template-columns: 62px 1fr 100px;
    }
}

@media (max-width: 900px) {
    .chat-heading,
    .chat-layout,
    .chat-form {
        grid-template-columns: 1fr;
    }

    .chat-heading {
        display: grid;
    }

    .chat-channel-list {
        display: flex;
        overflow-x: auto;
    }

    .persistent-chat {
        left: 0;
    }

    .persistent-chat-tabs {
        overflow-x: auto;
    }

    .persistent-chat .chat-messages {
        height: 180px;
    }
}

@media (max-width: 760px) {
    .guild-boss-preview-main,
    .guild-boss-preview-rewards {
        grid-template-columns: 1fr;
    }
}

.pet-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.18), transparent 34%),
        linear-gradient(135deg, #1f2937, #111827);
}

.pet-dragon {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border: 1px solid #6d28d9;
    border-radius: 18px;
    background: rgba(88, 28, 135, 0.28);
    font-size: 42px;
}

.pet-level-badge {
    display: grid;
    gap: 4px;
    min-width: 120px;
    padding: 12px 16px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: rgba(7, 16, 31, 0.72);
    text-align: center;
}

.pet-level-badge span,
.pet-summary-grid span,
.pet-skill-card span {
    color: #9fb0c6;
}

.pet-level-badge strong {
    color: #ffffff;
    font-size: 24px;
}

.pet-panel {
    display: grid;
    gap: 14px;
}

.pet-exp-progress div {
    background: linear-gradient(90deg, #7c3aed, #22d3ee);
}

.pet-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pet-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.pet-skill-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid #223049;
    border-radius: 12px;
    background: #111b2a;
}

.pet-skill-card strong {
    color: #ffffff;
}

.pet-skill-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.pet-skill-card form {
    margin: 0;
}

.pet-skill-card button {
    width: 100%;
}

.pet-evolution-panel {
    border-color: #7c3aed;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 32%),
        #1f2937;
}

.pet-evolution-costs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.pet-evolution-costs > div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #24334e;
    border-radius: 10px;
    background: rgba(7, 16, 31, 0.72);
}

.pet-evolution-costs span {
    color: #9fb0c6;
    font-size: 12px;
}

.pet-evolution-costs strong {
    color: #ffffff;
}

.pet-evolution-costs .insufficient {
    border-color: #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
}

.pet-evolution-costs .insufficient strong {
    color: #fca5a5;
}

.pet-evolution-note {
    margin: 0;
    color: #c4b5fd;
}

@media (max-width: 760px) {
    .pet-hero,
    .pet-summary-grid {
        grid-template-columns: 1fr;
    }
}

.poll-create-card,
.poll-card,
.poll-list {
    display: grid;
    gap: 14px;
}

.poll-create-form textarea {
    width: 100%;
    max-width: none;
    resize: vertical;
}

.poll-card {
    border-color: #223049;
}

.poll-card.closed {
    opacity: 0.78;
}

.poll-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.poll-admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.poll-card-header h2 {
    margin: 4px 0;
}

.poll-card-header p {
    margin: 0;
    color: #9fb0c6;
}

.poll-options {
    display: grid;
    gap: 10px;
}

.poll-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #24334e;
    border-radius: 12px;
    background: #111b2a;
}

.poll-option.selected {
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.12);
}

.poll-option input {
    width: auto;
}

.poll-option-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.poll-option-main strong {
    color: #ffffff;
}

.poll-option-main em {
    color: #9fb0c6;
    font-style: normal;
    white-space: nowrap;
}

.poll-result-bar {
    grid-column: 2;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #07101f;
}

.poll-result-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f7df6, #22d3ee);
}

.feedback-create-card,
.feedback-card,
.feedback-list {
    display: grid;
    gap: 14px;
}

.feedback-form-row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 14px;
}

.feedback-create-form textarea,
.feedback-reply-form textarea {
    width: 100%;
    max-width: none;
    resize: vertical;
}

.feedback-card {
    border-left: 3px solid #2f7df6;
}

.feedback-card.closed {
    border-left-color: #64748b;
    opacity: 0.82;
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    border-bottom: 1px solid #223049;
    padding-bottom: 12px;
}

.feedback-card-header h2 {
    margin: 4px 0;
}

.feedback-card-header p {
    margin: 0;
    color: #9fb0c6;
}

.feedback-body {
    line-height: 1.55;
    padding: 14px;
    border: 1px solid #24334e;
    border-radius: 12px;
    background: #111b2a;
}

.feedback-replies {
    display: grid;
    gap: 10px;
}

.feedback-reply {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
}

.feedback-reply > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #9fb0c6;
    font-size: 0.85rem;
}

.feedback-reply strong {
    color: #22d3ee;
}

.feedback-reply p {
    margin: 0;
    line-height: 1.45;
}

.feedback-reply-form {
    display: grid;
    gap: 8px;
}

.feedback-reply-form label {
    display: grid;
    gap: 6px;
    color: #9fb0c6;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 760px) {
    .poll-card-header,
    .poll-option-main,
    .feedback-card-header,
    .feedback-form-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.rules-card {
    display: grid;
    gap: 14px;
}

.rules-card article {
    padding: 14px;
    border: 1px solid #223049;
    border-radius: 12px;
    background: #111b2a;
}

.rules-card h2 {
    margin: 0 0 6px;
    color: #ffffff;
}

.rules-card p {
    margin: 0;
    color: #c9d6e8;
}

.achievement-reward-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    color: #9fb0c6;
    font-size: 13px;
}

.achievement-reward-row form {
    margin: 0;
}

.achievement-reward-row em {
    color: #86efac;
    font-style: normal;
}
