* {
    box-sizing: border-box;
}

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #111827;
    color: #e5e7eb;
    min-width: 0;
}

body.auth-page,
body.landing-page {
    min-height: 100vh;
    background-color: #020617;
    background-image:
        linear-gradient(135deg, rgba(2, 6, 23, 0.90) 0%, rgba(15, 23, 42, 0.84) 48%, rgba(2, 6, 23, 0.92) 100%),
        radial-gradient(circle at 18% 20%, rgba(34, 211, 238, 0.18), transparent 30%),
        radial-gradient(circle at 82% 8%, rgba(124, 58, 237, 0.20), transparent 32%),
        url("../marketing/idle-hero-ascension-thumbnail.png");
    background-position:
        center,
        center,
        center,
        center;
    background-repeat:
        no-repeat,
        no-repeat,
        no-repeat,
        no-repeat;
    background-size:
        cover,
        cover,
        cover,
        auto min(115vh, 1180px);
    background-attachment:
        fixed,
        fixed,
        fixed,
        fixed;
    color: #e5f4ff;
}

body.landing-page .site-header {
    background: rgba(2, 6, 23, 0.76);
    border-bottom-color: rgba(96, 165, 250, 0.22);
    backdrop-filter: blur(14px);
}

body.auth-page .auth-shell,
body.landing-page .page {
    position: relative;
    z-index: 1;
}

.auth-shell {
    width: min(1120px, calc(100% - 32px));
    min-height: 100svh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 28px;
    align-items: center;
    padding: max(42px, calc(24px + var(--safe-area-top))) 0 max(42px, calc(24px + var(--safe-area-bottom)));
}

.auth-hero,
.auth-card {
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.auth-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: clamp(34px, 5vw, 64px);
}

.auth-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 310px;
    height: 310px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.32), transparent 68%);
    pointer-events: none;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(8, 47, 73, 0.45);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-hero h1 {
    margin: 22px 0 14px;
    max-width: 620px;
    color: #f8fafc;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.auth-hero p {
    max-width: 620px;
    margin: 0;
    color: #bfdbfe;
    font-size: 18px;
    line-height: 1.6;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 560px;
    margin: 26px 0;
}

.auth-feature-grid span {
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.44);
    font-weight: 800;
}

.auth-hero .auth-alpha-note {
    max-width: 620px;
    color: #93c5fd;
    font-size: 14px;
}

.auth-card {
    border-radius: 22px;
    padding: 28px;
}

.auth-card-header {
    margin-bottom: 22px;
}

.auth-card-header span {
    display: block;
    color: #67e8f9;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-card-header h2 {
    margin: 8px 0 0;
    color: #f8fafc;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-form input {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 13px 14px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.72);
    font: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-form input:focus {
    border-color: #22d3ee;
    background: rgba(2, 6, 23, 0.92);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.auth-primary-button {
    width: 100%;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #2563eb 58%, #0891b2);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.auth-primary-button:hover {
    filter: brightness(1.08);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-links a {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 800;
}

.auth-link-form {
    margin: 0;
}

.auth-link-form button {
    border: 0;
    padding: 0;
    color: #67e8f9;
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-links a:hover,
.auth-link-form button:hover {
    color: #bfdbfe;
}

.auth-message {
    border-radius: 12px;
    padding: 11px 13px;
    margin-bottom: 14px;
    font-weight: 800;
}

.auth-message-error {
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.34);
}

.auth-message-warning {
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fde68a;
    background: rgba(120, 53, 15, 0.34);
}

.auth-message-success {
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #bbf7d0;
    background: rgba(6, 78, 59, 0.34);
}

.auth-message-info {
    border: 1px solid rgba(34, 211, 238, 0.42);
    color: #cffafe;
    background: rgba(8, 47, 73, 0.38);
}

.landing-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 24px;
    padding: clamp(30px, 4vw, 54px);
    background:
        radial-gradient(circle at 85% 85%, rgba(34, 211, 238, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.76));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.landing-hero h1 {
    max-width: 680px;
    margin: 22px 0 16px;
    color: #f8fafc;
    font-size: clamp(44px, 6vw, 78px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.landing-hero p {
    max-width: 700px;
    margin: 0;
    color: #bfdbfe;
    font-size: 18px;
    line-height: 1.6;
}

.landing-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 30px 0 22px;
}

.landing-guest-form {
    display: inline-flex;
    margin: 0;
}

.landing-primary-link,
.landing-secondary-link,
.landing-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 900;
    text-decoration: none;
}

.landing-primary-link {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #2563eb 58%, #0891b2);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.landing-secondary-link {
    border: 1px solid rgba(34, 211, 238, 0.34);
    color: #67e8f9;
    background: rgba(2, 6, 23, 0.45);
    font: inherit;
    cursor: pointer;
}

.landing-primary-link:hover,
.landing-secondary-link:hover,
.landing-button-link:hover {
    filter: brightness(1.08);
}

.landing-alpha-box {
    display: grid;
    gap: 6px;
    max-width: 720px;
    margin-top: 24px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 16px;
    padding: 14px 16px;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.24);
}

.landing-alpha-box strong {
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.landing-alpha-box span {
    color: #fef3c7;
}

.landing-login-card {
    align-self: stretch;
}

.landing-card-text {
    color: #bfdbfe;
    line-height: 1.55;
}

.landing-button-link {
    margin-top: 16px;
}

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

.landing-info-card h2 {
    margin-top: 0;
}

.landing-info-card ul {
    margin-bottom: 0;
    color: #dbeafe;
    line-height: 1.55;
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .auth-hero {
        padding: 28px;
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
    }

    .landing-shell,
    .landing-card-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: 0;
    }
}

.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-title-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0.2rem 0 0.35rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    color: #67e8f9;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.player-title-alpha-legend {
    border-color: rgba(251, 191, 36, 0.75);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.08));
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.player-title-test {
    border-color: rgba(248, 113, 113, 0.75);
    background: rgba(248, 113, 113, 0.08);
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.player-title-alpha-supporter {
    border-color: rgba(216, 180, 254, 0.75);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(251, 191, 36, 0.08));
    color: #d8b4fe;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.player-title-bug-hunter {
    border-color: rgba(74, 222, 128, 0.75);
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.player-title-balance-breaker {
    border-color: rgba(251, 146, 60, 0.75);
    background: rgba(251, 146, 60, 0.08);
    color: #fb923c;
    text-shadow: 0 0 8px rgba(251, 146, 60, 0.35);
}

.player-title-arena-champion {
    border-color: rgba(248, 113, 113, 0.8);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(251, 191, 36, 0.08));
    color: #fca5a5;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.player-title-elite-fighter {
    border-color: rgba(96, 165, 250, 0.75);
    background: rgba(59, 130, 246, 0.08);
    color: #93c5fd;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
}

.player-title-master-gatherer {
    border-color: rgba(45, 212, 191, 0.75);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(34, 197, 94, 0.08));
    color: #5eead4;
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.4);
}

.player-title-elite-gatherer {
    border-color: rgba(134, 239, 172, 0.75);
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.player-title-dragon-tamer {
    border-color: rgba(192, 132, 252, 0.75);
    background: rgba(147, 51, 234, 0.1);
    color: #c084fc;
    text-shadow: 0 0 8px rgba(147, 51, 234, 0.4);
}

.player-title-monster-slayer {
    border-color: rgba(248, 113, 113, 0.75);
    background: rgba(220, 38, 38, 0.08);
    color: #f87171;
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.35);
}

.player-title-resource-lord {
    border-color: rgba(52, 211, 153, 0.75);
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.player-title-guild-pillar {
    border-color: rgba(125, 211, 252, 0.75);
    background: rgba(14, 165, 233, 0.08);
    color: #7dd3fc;
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.35);
}

.player-title-mystic-finder {
    border-color: rgba(229, 231, 235, 0.75);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.6), rgba(147, 51, 234, 0.18));
    color: #e5e7eb;
    text-shadow: 0 0 10px rgba(229, 231, 235, 0.45);
}

.chat-player-title {
    color: #67e8f9;
    font-weight: 900;
}

.chat-player-title.player-title-test {
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.45);
}

.chat-player-title.player-title-alpha-legend {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.chat-player-title.player-title-alpha-supporter { color: #d8b4fe; text-shadow: 0 0 8px rgba(168, 85, 247, 0.45); }
.chat-player-title.player-title-bug-hunter { color: #4ade80; text-shadow: 0 0 8px rgba(34, 197, 94, 0.45); }
.chat-player-title.player-title-balance-breaker { color: #fb923c; text-shadow: 0 0 8px rgba(251, 146, 60, 0.45); }
.chat-player-title.player-title-arena-champion { color: #fca5a5; text-shadow: 0 0 8px rgba(239, 68, 68, 0.45); }
.chat-player-title.player-title-elite-fighter { color: #93c5fd; text-shadow: 0 0 8px rgba(59, 130, 246, 0.45); }
.chat-player-title.player-title-master-gatherer { color: #5eead4; text-shadow: 0 0 8px rgba(20, 184, 166, 0.45); }
.chat-player-title.player-title-elite-gatherer { color: #86efac; text-shadow: 0 0 8px rgba(34, 197, 94, 0.45); }
.chat-player-title.player-title-dragon-tamer { color: #c084fc; text-shadow: 0 0 8px rgba(147, 51, 234, 0.45); }
.chat-player-title.player-title-monster-slayer { color: #f87171; text-shadow: 0 0 8px rgba(220, 38, 38, 0.45); }
.chat-player-title.player-title-resource-lord { color: #34d399; text-shadow: 0 0 8px rgba(16, 185, 129, 0.45); }
.chat-player-title.player-title-guild-pillar { color: #7dd3fc; text-shadow: 0 0 8px rgba(14, 165, 233, 0.45); }
.chat-player-title.player-title-mystic-finder { color: #e5e7eb; text-shadow: 0 0 10px rgba(229, 231, 235, 0.5); }

.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-gear-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.character-gear-status-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #2f3b52;
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 40%),
        #111827;
}

.character-gear-status-card.full {
    border-color: rgba(34, 197, 94, 0.55);
}

.character-gear-status-card.mixed {
    border-color: rgba(250, 204, 21, 0.48);
}

.character-gear-status-card.penalty {
    border-color: rgba(248, 113, 113, 0.65);
}

.character-gear-status-card > div:first-child {
    display: grid;
    gap: 4px;
}

.character-gear-status-card span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-gear-status-card strong {
    color: #f8fafc;
    font-size: 20px;
}

.character-gear-status-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.character-gear-status-meta span,
.character-gear-status-meta em {
    padding: 3px 8px;
    border: 1px solid #334155;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    font-size: 12px;
    font-style: normal;
    letter-spacing: 0;
    text-transform: none;
}

.character-gear-status-meta em {
    color: #cbd5e1;
}

.character-gear-status-card.penalty .character-gear-status-meta em {
    border-color: rgba(248, 113, 113, 0.55);
    color: #fecaca;
}

.character-gear-status-card p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.4;
}

.character-gear-status-card small {
    color: #67e8f9;
    line-height: 1.35;
}

.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(340px, 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 p {
    margin: 0 0 6px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.35;
}

.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;
    overflow: visible;
    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 {
    position: relative;
    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 a.side-menu-alert {
    color: #d1fae5;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), rgba(15, 23, 42, 0.22));
    box-shadow:
        inset 3px 0 rgba(34, 197, 94, 0.95),
        0 0 14px rgba(34, 197, 94, 0.16);
}

.side-menu a.side-menu-alert.active {
    box-shadow:
        inset 3px 0 #38bdf8,
        0 0 16px rgba(34, 197, 94, 0.20);
}

.side-menu a.side-menu-alert::after {
    content: '!';
    margin-left: auto;
    min-width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(134, 239, 172, 0.85);
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.72);
    color: #bbf7d0;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
}

.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;
}

.side-online-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 10px 12px 0;
    padding: 7px 9px;
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: #94a3b8;
    font-size: 0.75rem;
}

.side-online-count strong {
    color: #86efac;
    font-variant-numeric: tabular-nums;
}

.side-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}

.revision-button {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: none;
}

.side-revision-button {
    display: inline-flex;
    margin: 4px 12px 0;
    text-align: left;
}

.side-legal-links {
    display: grid;
    gap: 8px;
    margin: 10px 12px 0;
}

.side-legal-links a {
    width: fit-content;
    color: #94a3b8;
    font-size: 0.82rem;
    text-decoration: none;
}

.side-legal-links a:hover,
.side-legal-links a:focus {
    color: #67e8f9;
    text-decoration: underline;
}

.revision-button:hover {
    color: #94a3b8;
    background: transparent;
    text-decoration: underline;
}

.revision-modal[hidden] {
    display: none;
}

.revision-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 26px;
}

.revision-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
}

.revision-modal-panel {
    position: relative;
    width: min(1180px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 52px));
    overflow-y: auto;
    padding: 16px 18px;
    border: 1px solid #334155;
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 34%),
        #0f172a;
    color: #dbe7f7;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62);
}

.revision-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.88);
    color: #e5e7eb;
}

.revision-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.revision-pager.top {
    margin-bottom: 10px;
}

.revision-pager.bottom {
    margin-top: 14px;
}

.revision-pager button,
.revision-pager strong {
    min-width: 28px;
    height: 25px;
    padding: 0 8px;
    border: 1px solid #334155;
    border-radius: 5px;
    background: #111827;
    color: #93c5fd;
    font-size: 12px;
}

.revision-pager button:hover:not(:disabled) {
    border-color: #38bdf8;
    color: #e0f2fe;
    background: rgba(47, 125, 246, 0.18);
}

.revision-pager button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.revision-pager strong {
    display: inline-grid;
    place-items: center;
    border-color: #38bdf8;
    border-radius: 5px;
    color: #e0f2fe;
    background: rgba(47, 125, 246, 0.18);
}

.revision-entry {
    min-height: 270px;
    padding: 14px 12px 12px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.58);
}

.revision-entry h2 {
    margin: 0 0 10px;
    color: #67e8f9;
    font-size: 1.1rem;
}

.revision-entry h3 {
    margin: 16px 0 5px;
    color: #f8fafc;
    font-size: 0.92rem;
}

.revision-entry ul {
    margin: 0;
    padding-left: 20px;
    color: #cbd5e1;
    line-height: 1.45;
}

.revision-entry li + li {
    margin-top: 3px;
}

.revision-posted {
    margin: 18px 0 0;
    color: #64748b;
    font-size: 0.75rem;
}

.has-side-navigation .global-hud {
    left: 220px;
    right: 0;
    width: auto;
    margin-left: 0;
}

.has-side-navigation .page {
    width: calc(100% - 470px);
    max-width: none;
    margin: 30px auto 30px 220px;
    min-width: 0;
}

.has-side-navigation .site-footer {
    width: calc(100% - 470px);
    margin-left: 220px;
}

.has-side-navigation {
    padding-top: var(--global-hud-height, 78px);
    padding-bottom: 285px;
    min-width: 520px;
}

.global-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 95;
    min-height: 44px;
    border-bottom: 1px solid #334155;
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    overflow-y: hidden;
}

.global-hud-values {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-width: max-content;
    max-width: none;
    margin: 0;
    padding: 7px 14px;
    min-height: 24px;
    font-size: 0.82rem;
    box-sizing: border-box;
}

.global-hud-character {
    display: block;
    flex: 0 0 auto;
    min-width: 78px;
    padding-right: 8px;
    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);
    flex: 0 0 auto;
    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-skills,
.global-hud-economy {
    grid-auto-columns: max-content;
    gap: 6px;
}

.global-hud-skills span,
.global-hud-economy span {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    grid-template-columns: none;
    padding: 3px 9px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.global-hud-skills span {
    min-width: 88px;
}

.global-hud-skills strong,
.global-hud-economy strong {
    min-width: 0;
    text-align: left;
}

.global-hud-economy {
    grid-auto-columns: max-content;
}

.global-hud-economy span {
    min-width: 0;
}

.global-hud-economy strong {
    min-width: 0;
}

.global-hud-primary strong {
    color: #67e8f9;
}

.global-hud-gold strong {
    color: #facc15;
}

.global-hud-crystals strong {
    color: #c084fc;
}

.global-notification-shell {
    position: fixed;
    top: calc(7px + var(--safe-area-top));
    right: calc(14px + var(--safe-area-right));
    z-index: 30001;
    flex: 0 0 auto;
    margin-left: 0;
}

.global-notification-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.82);
    color: #bfdbfe;
    font-size: 15px;
    line-height: 1;
}

.global-notification-shell.has-unread .global-notification-toggle {
    border-color: rgba(34, 211, 238, 0.7);
    color: #67e8f9;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.16);
}

.global-notification-toggle strong {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    padding: 2px 5px;
    border: 1px solid #06111f;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
}

.global-notification-panel {
    position: fixed;
    top: calc(44px + var(--safe-area-top));
    right: calc(278px + var(--safe-area-right));
    z-index: 30000;
    width: min(360px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid #2b3a57;
    border-radius: 14px;
    background: rgba(8, 13, 26, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}

.global-notification-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    border-bottom: 1px solid #1f2d44;
}

.global-notification-panel-head strong {
    color: #67e8f9;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.global-notification-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.global-notification-panel-head button {
    padding: 4px 8px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #1e293b;
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 800;
}

.global-notification-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 9px 10px;
    border-bottom: 1px solid #1f2d44;
    background: rgba(15, 23, 42, 0.78);
}

.global-notification-settings label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid #273549;
    border-radius: 999px;
    color: #cbd5e1;
    background: #0b1220;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.global-notification-settings input {
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: #22d3ee;
}

.global-notification-settings span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-notification-list {
    display: grid;
    max-height: min(360px, 55vh);
    overflow-y: auto;
}

.global-notification-list p {
    margin: 0;
    padding: 14px;
    color: #94a3b8;
}

.global-notification-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.global-notification-row.unread {
    background: rgba(34, 211, 238, 0.08);
}

.global-notification-row.read {
    opacity: 0.72;
}

.global-notification-item {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 11px 10px 11px 13px;
    color: #dbeafe;
    text-decoration: none;
}

.global-notification-row:hover {
    background: rgba(37, 99, 235, 0.14);
}

.global-notification-delete {
    align-self: start;
    margin: 9px 9px 0 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    font-size: 16px;
    font-weight: 900;
    line-height: 18px;
}

.global-notification-delete:hover {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(127, 29, 29, 0.8);
    color: #fecaca;
}

.global-notification-type {
    color: #67e8f9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.global-notification-item strong {
    color: #ffffff;
    font-size: 13px;
}

.global-notification-item small,
.global-notification-item em {
    color: #9fb0c6;
    font-size: 12px;
    font-style: normal;
    line-height: 1.35;
}

.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 {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #9f2d22, #d17a24);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.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: calc(var(--global-hud-height, 72px) + 12px);
    right: calc(12px + var(--safe-area-right));
    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 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    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;
    cursor: help;
}

.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;
}

.floating-active-buff-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 12px;
    background: #08111f;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    color: #dbeafe;
    pointer-events: none;
}

.floating-active-buff-tooltip.visible {
    display: block;
}

.floating-active-buff-tooltip strong {
    display: block;
    margin: 0 0 5px;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 900;
}

.floating-active-buff-tooltip p {
    margin: 0;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .global-notification-panel {
        right: calc(12px + var(--safe-area-right));
    }
}

@media (max-width: 800px) {
    .global-hud-values {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 4px;
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .global-hud-character {
        flex-basis: auto;
    }

    .global-hud-group {
        gap: 3px 10px;
    }

    .active-buffs-panel {
        position: fixed;
        top: calc(58px + var(--safe-area-top));
        right: calc(8px + var(--safe-area-right));
        width: 190px;
        max-height: min(34vh, 240px);
        margin: 0;
        padding: 9px;
    }

    .global-notification-panel {
        top: calc(44px + var(--safe-area-top));
        right: calc(8px + var(--safe-area-right));
        width: min(360px, calc(100vw - 16px));
    }

    body.notifications-open .active-buffs-panel {
        display: none;
    }

    body:has(.global-notification-panel:not([hidden])) .active-buffs-panel {
        display: none;
    }

    .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;
    right: 18px;
    bottom: calc(var(--persistent-chat-message-height, 150px) + 112px);
    z-index: 90;
    display: grid;
    gap: 10px;
    width: min(360px, 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: none;
    transition: opacity 250ms ease, transform 250ms ease;
}

.global-exp {
    height: 14px;
    background: #050b16;
    border-top: 1px solid #182438;
}

.global-exp.inactive {
    opacity: 0;
    pointer-events: 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;
    pointer-events: auto;
}

.game-update-notice {
    position: fixed;
    right: calc(18px + var(--safe-area-right));
    bottom: calc(var(--persistent-chat-message-height, 150px) + 126px + var(--safe-area-bottom));
    z-index: 120;
    display: block;
    width: min(380px, calc(100vw - 32px));
    padding: 0;
    pointer-events: auto;
}

.game-update-notice-box {
    width: 100%;
    padding: 16px;
    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: left;
    pointer-events: auto;
}

.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 {
    position: relative;
    z-index: 2;
    width: 100%;
    border: 0;
    background: linear-gradient(90deg, #7c3aed, #2563eb);
    pointer-events: auto;
}

/* 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 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    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-tabs a.has-guild-tab-indicator {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.75);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 52%),
        #111b2a;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.guild-tabs a.has-guild-tab-indicator.active,
.guild-tabs a.has-guild-tab-indicator:hover {
    color: #ffffff;
    border-color: #f59e0b;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.28), transparent 52%),
        rgba(47, 125, 246, 0.16);
}

.guild-tabs a.guild-tab-indicator-ready {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.75);
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.20), transparent 52%),
        #0d1f1a;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.10);
}

.guild-tabs a.guild-tab-indicator-ready.active,
.guild-tabs a.guild-tab-indicator-ready:hover {
    color: #ffffff;
    border-color: #22c55e;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.32), transparent 52%),
        rgba(22, 101, 52, 0.34);
}

.guild-tabs a.guild-tab-indicator-ready .guild-tab-badge {
    color: #052e16;
    background: #22c55e;
}

.guild-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #111827;
    background: #fbbf24;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
}

.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-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.guild-overview-card {
    display: grid;
    gap: 6px;
    min-height: 104px;
}

.guild-overview-card span {
    color: #93c5fd;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.guild-overview-card strong {
    color: #ffffff;
    font-size: 1.55rem;
    line-height: 1;
}

.guild-overview-card small {
    color: #9fb3cd;
}

.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-select-card {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.guild-bank-select-card:hover,
.guild-bank-select-card:focus-visible {
    border-color: #2f7df6;
    background: rgba(47, 125, 246, 0.12);
    outline: none;
}

.guild-bank-select-card.is-selected {
    border-color: #22d3ee;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 54%),
        #0e1c2e;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.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-goal-panel {
    border-color: rgba(34, 211, 238, 0.35);
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.13), rgba(17, 24, 39, 0.95));
}

.guild-goal-hint {
    margin: 6px 0 0;
    color: #8aa3c3;
}

.guild-goal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #263650;
    border-radius: 10px;
    background: #0b1424;
}

.guild-goal-summary > div {
    display: grid;
    gap: 4px;
}

.guild-goal-summary strong {
    color: #67e8f9;
    font-size: 1.05rem;
}

.guild-goal-summary span {
    color: #adc0d8;
}

.guild-goal-summary.is-ready {
    border-color: rgba(34, 197, 94, 0.75);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
}

.guild-goal-summary.is-ready > span {
    color: #22c55e;
    font-weight: 800;
}

.guild-goal-upgrade-button {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #052e16;
}

.guild-goal-upgrade-button:hover {
    filter: brightness(1.08);
}

.guild-goal-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.guild-goal-resource {
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid #223049;
    border-radius: 10px;
    background: rgba(7, 16, 31, 0.82);
}

.guild-goal-resource.is-complete {
    border-color: rgba(34, 197, 94, 0.5);
}

.guild-goal-resource-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #dbeafe;
    font-size: 0.9rem;
}

.guild-goal-resource-head span,
.guild-goal-resource small {
    color: #9fb0c6;
}

.guild-goal-progress {
    height: 9px;
    overflow: hidden;
    border: 1px solid #2d3a50;
    border-radius: 999px;
    background: #020617;
}

.guild-goal-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #22d3ee);
}

.guild-goal-resource.is-complete .guild-goal-progress span {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.guild-upgrade-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.guild-goal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(34, 211, 238, 0.55);
    border-radius: 999px;
    background: rgba(8, 145, 178, 0.16);
    color: #67e8f9;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

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

.guild-task-board-title {
    margin-top: 18px;
}

.guild-task-offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.guild-task-offer {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f1b2b;
}

.guild-task-offer-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #bfdbfe;
    font-size: 13px;
}

/* Today overview */
.today-heading p {
    margin-top: 6px;
}

.today-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.today-stat-card {
    min-height: auto;
    padding: 12px 14px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent 58%),
        #0b1626;
    border-color: #26364f;
}

.today-stat-card span {
    display: block;
    color: #9fb0c6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.today-stat-card strong {
    display: block;
    margin-top: 5px;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.15;
}

.today-stat-card strong.gold {
    color: #facc15;
}

.today-stat-card strong.crystal {
    color: #c084fc;
}

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

.today-grid.secondary {
    margin-top: 16px;
}

.today-card {
    display: grid;
    gap: 10px;
    color: #dbeafe;
    text-decoration: none;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 40%),
        #111827;
    border-color: #26364f;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.today-card:hover,
.today-card:focus-visible {
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.today-card.ready {
    border-color: #22c55e;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 42%),
        #102033;
}

.today-card.active {
    border-color: #f59e0b;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 42%),
        #111827;
}

.today-card-label {
    color: #67e8f9;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.today-card strong {
    color: #ffffff;
    font-size: 18px;
    line-height: 1.2;
}

.today-card small {
    color: #9fb0c6;
}

.today-progress {
    position: relative;
    min-height: 22px;
    overflow: hidden;
    border: 1px solid #26364f;
    border-radius: 999px;
    background: #07111f;
}

.today-progress > div {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee, #22c55e);
}

.today-progress span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.guild-task-goal {
    margin: 0;
    color: #f8fafc;
    font-weight: 700;
}

.guild-task-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid #38bdf8;
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(14, 165, 233, 0.14);
    font-size: 12px;
    font-weight: 800;
}

.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-start-form {
    grid-template-columns: 1fr;
}

.guild-boss-start-controls {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(120px, 170px) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.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);
}

.dungeon-party-progress div {
    background: linear-gradient(90deg, #06b6d4, #22c55e);
}

.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;
    overflow: hidden;
    text-overflow: ellipsis;
    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.gathering.active,
.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;
}

.rarity-mystic {
    background: radial-gradient(circle at 20% 20%, #1f2937 0%, #020617 55%, #000 100%);
    color: #a5f3fc;
    border: 1px solid rgba(168, 85, 247, 0.85);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.65), inset 0 0 10px rgba(168, 85, 247, 0.35);
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.95);
}

.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 {
    padding: 0;
    border: 0;
    background: transparent;
    font-weight: 700;
    cursor: help;
    text-align: left;
}

.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;
}

.rarity-text-mystic {
    color: #a5f3fc;
    text-shadow: 0 0 7px rgba(34, 211, 238, 0.85), 0 0 12px rgba(168, 85, 247, 0.65);
}

.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;
}

.item-name-wrap.tooltip-portal-active > .item-tooltip {
    display: none !important;
}

.floating-item-tooltip {
    display: block !important;
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 20000;
    max-width: min(620px, calc(100vw - 24px));
    max-height: min(620px, calc(100vh - 24px));
    overflow-y: auto;
    pointer-events: none;
}

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

.equipped-item-tooltip-wrap .item-tooltip {
    left: calc(100% + 12px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 5000;
    max-width: min(320px, calc(100vw - 48px));
    max-height: min(420px, calc(100vh - 120px));
    overflow-y: auto;
}

.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-value-group {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    color: #e5e7eb;
    white-space: nowrap;
}

.comparison-base-value {
    color: #e5e7eb;
    font-weight: 800;
}

.comparison-delta {
    font-style: normal;
    font-weight: 900;
}

.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;
}

.simulation-form {
    display: grid;
    gap: 14px;
}

.simulation-form .feedback-form-row {
    align-items: end;
}

.simulation-stat-grid .stat-card small {
    color: #9fb0c6;
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .simulation-form .feedback-form-row {
        grid-template-columns: 1fr;
    }
}
/* =========================
   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;
}

.item-system-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    vertical-align: middle;
}

.item-system-badges span {
    padding: 2px 7px;
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(8, 47, 73, 0.42);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.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-page-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.inventory-page-heading .page-title-center {
    margin: 0;
}

.inventory-info-button {
    width: auto;
    white-space: nowrap;
}

.admin-help-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 999px;
    color: #67e8f9;
    font-size: 12px;
    font-weight: 800;
    cursor: help;
    vertical-align: middle;
}

.admin-help-tooltip-content {
    display: none;
    position: absolute;
    z-index: 1000;
    left: 24px;
    top: 50%;
    width: min(360px, calc(100vw - 80px));
    padding: 12px 14px;
    transform: translateY(-50%);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 12px;
    background: #08111f;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    text-transform: none;
}

.admin-help-tooltip:hover .admin-help-tooltip-content,
.admin-help-tooltip:focus .admin-help-tooltip-content {
    display: block;
}

.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;
}

.item-system-modal-panel {
    width: min(980px, calc(100vw - 44px));
    max-height: min(82vh, 820px);
    overflow-y: auto;
    padding: 22px;
    border-color: #334155;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 34%),
        #0f172a;
}

.item-system-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #334155;
}

.item-system-modal-header h2 {
    margin: 2px 0 8px;
    color: #67e8f9;
}

.item-system-modal-header p {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
}

.item-system-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.item-system-guide-grid.gathering {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-system-guide-card,
.item-system-note {
    padding: 14px;
    border: 1px solid #26364f;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.78);
}

.item-system-guide-card h3,
.item-system-note h3 {
    margin: 0 0 8px;
    color: #f8fafc;
}

.item-system-guide-card p,
.item-system-guide-card small,
.item-system-note p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.45;
}

.item-system-guide-card ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #cbd5e1;
    line-height: 1.45;
}

.item-system-guide-card.mage {
    border-color: rgba(192, 132, 252, 0.48);
}

.item-system-guide-card.hunter,
.item-system-guide-card.hunting {
    border-color: rgba(34, 197, 94, 0.42);
}

.item-system-guide-card.warrior {
    border-color: rgba(248, 113, 113, 0.42);
}

.item-system-guide-card.mining {
    border-color: rgba(148, 163, 184, 0.5);
}

.item-system-guide-card.woodcutting {
    border-color: rgba(132, 204, 22, 0.42);
}

.item-system-guide-card.herbalist {
    border-color: rgba(45, 212, 191, 0.42);
}

.item-system-note {
    margin: 14px 0;
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(8, 47, 73, 0.28);
}

.item-system-note.soft {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.42);
}

.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;
}

.shop-anonymous-global-toggle {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 7px 10px;
    color: #cfe3ff;
    font-size: 13px;
    line-height: 1;
}

.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-page-heading,
    .item-system-modal-header,
    .inventory-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .item-system-guide-grid,
    .item-system-guide-grid.gathering {
        grid-template-columns: 1fr;
    }

    .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: auto minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    padding: 7px 10px;
    border-left: 4px solid;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.battle-log-result {
    font-size: 0.98rem;
}

.battle-log-time {
    color: #8fa5bf;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.battle-log-text {
    min-width: 0;
    color: #c6d3e4;
    line-height: 1.35;
}

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

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

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

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

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

@media (max-width: 900px) {
    .battle-comparison {
        grid-template-columns: 1fr;
    }

    .battle-monster-select,
    .battle-running-meta {
        flex-wrap: wrap;
    }

    .battle-log-heading {
        flex-wrap: wrap;
    }

    .battle-log-entry {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 2px;
    }
}

/* 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);
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.inline-control-form {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.inline-control-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inline-control-form input {
    min-width: 0;
}

.muted-small {
    color: var(--muted);
    font-size: 0.78rem;
    margin-left: 4px;
}

.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 minmax(110px, 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-inline-total {
    color: #facc15;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.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;
}

.market-item-detail-trigger {
    cursor: pointer;
}

.market-item-detail-trigger:hover,
.market-item-detail-trigger:focus-visible {
    text-decoration: underline;
}

.market-item-modal-panel {
    max-width: min(920px, calc(100vw - 32px));
}

.market-item-modal-body {
    margin-top: 14px;
}

.market-item-modal-tooltip {
    width: 100%;
    border-color: #334155;
}

.market-modal-comparison {
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #0b1020;
}

.market-item-modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.market-item-modal-summary div {
    padding: 10px;
    border: 1px solid #26364d;
    border-radius: 9px;
    background: #101a2a;
}

.market-item-modal-summary span {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
}

.market-item-modal-summary strong {
    color: #facc15;
    font-size: 18px;
}

@media (max-width: 760px) {
    .market-modal-comparison {
        grid-template-columns: 1fr;
    }

    .market-item-modal-summary {
        grid-template-columns: 1fr;
    }
}

@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-system-name,
.chat-system-name:hover {
    cursor: default;
    color: #fbbf24;
    text-decoration: none;
}

.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: var(--safe-area-bottom);
    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-toggle {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 92px;
    padding: 6px 12px;
    border: 1px solid rgba(56, 189, 248, 0.65);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 0 0 1px rgba(47, 125, 246, 0.12) inset;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: auto;
    touch-action: manipulation;
}

.persistent-chat-toggle:hover {
    color: #ffffff;
    border-color: #22d3ee;
    background: rgba(47, 125, 246, 0.28);
}

.persistent-chat.chat-collapsed {
    right: calc(18px + var(--safe-area-right));
    bottom: calc(18px + var(--safe-area-bottom));
    left: auto;
    width: auto;
    max-height: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.persistent-chat.chat-collapsed .persistent-chat-toggle {
    position: static;
    min-width: 118px;
    padding: 10px 16px;
    border-color: rgba(34, 211, 238, 0.72);
    background: rgba(8, 15, 28, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), 0 0 18px rgba(34, 211, 238, 0.12);
}

.persistent-chat.chat-collapsed .persistent-chat-resizer,
.persistent-chat.chat-collapsed .persistent-chat-tabs,
.persistent-chat.chat-collapsed .persistent-chat-body {
    display: none;
}

.persistent-chat-resizer {
    position: absolute;
    top: -7px;
    right: 132px;
    left: 0;
    width: auto;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: ns-resize;
    z-index: 2;
}

.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 118px 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.has-unread:not(.active) {
    color: #ffffff;
    border-color: #fbbf24;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.22);
}

.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: 760px) {
    .guild-boss-start-controls {
        grid-template-columns: 1fr;
    }
}

@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: 220px;
        max-height: min(64vh, 520px);
    }

    .persistent-chat-tabs {
        overflow-x: auto;
    }

    .persistent-chat .chat-messages {
        height: var(--persistent-chat-message-height);
    }
}

@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-filter-card,
.feedback-card,
.feedback-list {
    display: grid;
    gap: 14px;
}

.feedback-filter-row {
    display: grid;
    gap: 12px;
}

.feedback-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #334155;
    border-radius: 999px;
    background: #0f172a;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
    border-color: #3b82f6;
    background: #1e3a8a;
    color: #ffffff;
}

.filter-pill.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.feedback-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.feedback-pagination span {
    color: #c9d6e8;
    font-size: 13px;
    font-weight: 800;
}

.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.has-new-replies {
    border-left-color: #22c55e;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.feedback-card > summary {
    list-style: none;
    cursor: pointer;
}

.feedback-card > summary::-webkit-details-marker {
    display: none;
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    border-bottom: 0;
    padding-bottom: 0;
    position: relative;
    padding-left: 20px;
}

.feedback-card[open] .feedback-card-header {
    border-bottom: 1px solid #223049;
    padding-bottom: 12px;
}

.feedback-card-header::before {
    content: '▸';
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 24px;
    color: #60a5fa;
    font-size: 0.9rem;
    font-weight: 900;
}

.feedback-card[open] .feedback-card-header::before {
    content: '▾';
}

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

.feedback-card-content {
    display: grid;
    gap: 14px;
    padding-top: 14px;
}

.feedback-card-actions {
    justify-content: flex-end;
}

.feedback-owner-badge,
.feedback-new-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.feedback-owner-badge {
    border: 1px solid rgba(96, 165, 250, 0.5);
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

.feedback-new-badge {
    border: 1px solid rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.feedback-body {
    line-height: 1.55;
    padding: 14px;
    border: 1px solid #24334e;
    border-radius: 12px;
    background: #111b2a;
}

.feedback-edit-panel {
    padding: 12px;
    border: 1px solid #24334e;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
}

.feedback-edit-panel summary {
    cursor: pointer;
    color: #60a5fa;
    font-weight: 700;
}

.feedback-edit-panel[open] summary {
    margin-bottom: 12px;
}

.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.new {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}

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

.feedback-reply-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feedback-reply-actions form {
    margin: 0;
}

.feedback-reply strong {
    color: #22d3ee;
}

.feedback-reply p {
    margin: 0;
    line-height: 1.45;
}

.feedback-reply-edit-panel {
    margin-top: 10px;
}

.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;
}

.settings-tabs {
    margin-bottom: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.settings-card {
    min-height: 100%;
}

.settings-account-list {
    display: grid;
    gap: 10px;
}

.settings-account-list div {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
    align-items: start;
    gap: 16px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #263954;
    border-radius: 10px;
    background: #101b2b;
}

.settings-account-list span {
    color: #9fb3cc;
    min-width: 0;
}

.settings-account-list strong {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 520px) {
    .settings-account-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .settings-account-list strong {
        text-align: left;
    }
}

.guide-hero-card {
    display: grid;
    gap: 16px;
}

.guide-hero-card p {
    max-width: 900px;
    margin: 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.guide-path {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guide-path span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 13px;
    border: 1px solid rgba(34, 211, 238, 0.32);
    border-radius: 999px;
    color: #cffafe;
    background: rgba(8, 47, 73, 0.32);
    font-size: 0.9rem;
    font-weight: 800;
}

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

.guide-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 10px;
    border-color: rgba(96, 165, 250, 0.24);
}

.guide-card::after {
    content: "";
    position: absolute;
    right: -45px;
    top: -45px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 70%);
    pointer-events: none;
}

.guide-step {
    width: fit-content;
    padding: 5px 9px;
    border: 1px solid rgba(34, 211, 238, 0.42);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(8, 47, 73, 0.42);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.guide-card h2 {
    margin: 0;
    color: #f8fafc;
}

.guide-card ul {
    margin: 0;
    padding-left: 18px;
    color: #dbeafe;
    line-height: 1.5;
}

.guide-card li + li {
    margin-top: 5px;
}

.item-result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
    max-width: 420px;
}

.item-result-stats small {
    display: inline-flex;
    padding: 2px 7px;
    border: 1px solid #31435f;
    border-radius: 999px;
    background: #101a2a;
    color: #b8c7dc;
    white-space: nowrap;
}

.dungeon-result-item {
    display: inline-block;
}

.dungeon-result-item .item-tooltip {
    left: calc(100% + 12px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 5000;
    max-width: min(360px, calc(100vw - 48px));
    max-height: min(520px, calc(100vh - 24px));
    overflow-y: auto;
}

.dungeon-create-summary,
.dungeon-create-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dungeon-create-reward {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 10px;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 56%),
        #0b1424;
}

.dungeon-create-summary div,
.dungeon-create-preview div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #223049;
    border-radius: 10px;
    background: #0b1424;
}

.dungeon-create-summary span,
.dungeon-create-preview span,
.dungeon-create-reward span {
    color: #9fb0c6;
}

.dungeon-create-summary strong,
.dungeon-create-preview strong,
.dungeon-create-reward strong {
    color: #ffffff;
}

.dungeon-create-modal-panel {
    width: min(720px, calc(100vw - 44px));
    background:
        radial-gradient(circle at top right, rgba(47, 125, 246, 0.10), transparent 38%),
        #111827;
}

.dungeon-create-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dungeon-create-form {
    gap: 14px;
}

@media (max-width: 760px) {
    .dungeon-create-summary,
    .dungeon-create-preview,
    .dungeon-create-fields {
        grid-template-columns: 1fr;
    }
}

.mobile-nav-toggle,
.side-navigation-backdrop {
    display: none;
}

.card,
.guild-panel,
.market-panel,
.inventory-table-wrap,
.market-table-wrap,
.ranking-table,
.chat-shell,
.persistent-chat,
.global-hud,
.active-buffs-panel {
    max-width: 100%;
}

.card,
.guild-panel,
.market-panel,
.inventory-filter-bar,
.market-form-grid,
.market-order-grid,
.guild-layout,
.grid,
.stat-grid,
.market-content,
.market-item-card,
.equipment-set-card,
.item-card {
    min-width: 0;
}

.inventory-table-wrap,
.market-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.inventory-table,
.market-table {
    min-width: max-content;
}

@media (max-width: 1540px) {
    .global-hud {
        overflow-x: hidden;
    }

    .global-hud-values {
        flex-wrap: wrap;
        min-width: 0;
        gap: 6px 10px;
        padding: 6px 62px 6px 14px;
    }

    .global-notification-panel {
        right: 12px;
    }

    .global-hud-character {
        min-width: 62px;
    }

    .global-hud-group,
    .global-hud-skills,
    .global-hud-economy {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        gap: 5px 6px;
        min-width: 0;
    }

    .global-hud-skills span,
    .global-hud-economy span {
        min-width: 0;
        padding: 3px 8px;
        gap: 6px;
    }

    .has-side-navigation .page {
        width: calc(100% - 220px);
        max-width: none;
        margin: 22px 0 30px 220px;
        padding: 0 16px;
    }

    .has-side-navigation .site-footer {
        width: calc(100% - 220px);
        margin-left: 220px;
    }

    .active-buffs-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 12px 16px 0 236px;
        overflow: visible;
    }

    .active-buffs-list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .inventory-filter-bar,
    .guild-tabs,
    .market-tabs,
    .ranking-tabs {
        overflow-x: auto;
        max-width: 100%;
    }

    .inventory-filter-bar {
        grid-template-columns: repeat(3, minmax(150px, 1fr)) repeat(2, minmax(118px, auto)) auto;
    }

    .market-order-grid,
    .market-item-grid {
        grid-template-columns: 1fr;
    }

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

    .market-form-grid button,
    .market-form-grid .market-sell-button,
    .market-form-grid .market-buy-button,
    .market-form-grid .market-buy-order-button {
        width: 100%;
    }
}

@media (max-width: 1280px) {
    body.has-side-navigation {
        min-width: 0;
    }

    .mobile-nav-toggle {
        position: fixed;
        top: calc(6px + var(--safe-area-top));
        left: calc(10px + var(--safe-area-left));
        z-index: 120;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 44px;
        height: 34px;
        padding: 0;
        border: 1px solid rgba(96, 165, 250, 0.45);
        border-radius: 12px;
        background:
            radial-gradient(circle at top left, rgba(103, 232, 249, 0.18), transparent 55%),
            rgba(15, 23, 42, 0.96);
        color: #dbeafe;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .mobile-nav-toggle:hover {
        background: rgba(30, 41, 59, 0.98);
        border-color: rgba(103, 232, 249, 0.75);
    }

    .mobile-nav-toggle span {
        display: block;
        width: 21px;
        height: 2px;
        border-radius: 999px;
        background: #67e8f9;
        box-shadow: 0 0 8px rgba(103, 232, 249, 0.38);
    }

    .mobile-nav-toggle strong {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .side-navigation {
        z-index: 115;
        width: min(82vw, 270px);
        padding-left: var(--safe-area-left);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 16px 0 42px rgba(0, 0, 0, 0.45);
    }

    .side-navigation-backdrop {
        position: fixed;
        inset: 0;
        z-index: 110;
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(2, 6, 23, 0.62);
        backdrop-filter: blur(2px);
    }

    .side-navigation-backdrop:hover,
    .side-navigation-backdrop:focus {
        background: rgba(2, 6, 23, 0.62);
    }

    .side-navigation-open .side-navigation {
        transform: translateX(0);
    }

    .side-navigation-open .side-navigation-backdrop {
        display: block;
    }

    .has-side-navigation .global-hud {
        left: 0;
        right: 0;
        width: auto;
        margin-left: 0;
    }

    .global-hud-values {
        padding-left: 62px;
        padding-right: 62px;
        align-items: flex-start;
    }

    .global-hud-character {
        order: -2;
    }

    .global-hud-skills {
        order: -1;
        flex-basis: calc(100% - 90px);
    }

    .global-hud-economy {
        flex-basis: 100%;
    }

    .has-side-navigation .page,
    .has-side-navigation .site-footer {
        width: auto;
        max-width: none;
        margin-left: 0;
    }

    .has-side-navigation .page {
        margin-top: 18px;
        padding: 0 12px;
    }

    .has-side-navigation .site-footer {
        padding: 0 12px;
    }

    .active-buffs-panel {
        margin: 10px 12px 0;
    }

    .persistent-chat {
        left: var(--safe-area-left);
        right: var(--safe-area-right);
    }

    .inventory-filter-bar {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .market-form-grid,
    .market-form-grid.equipment,
    .market-activity-entry {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .global-hud-values {
        padding-left: 58px;
        padding-right: 58px;
        font-size: 0.75rem;
    }

    .global-hud-character {
        max-width: 112px;
    }

    .global-hud-skills,
    .global-hud-economy {
        gap: 4px;
    }

    .global-hud-skills span,
    .global-hud-economy span {
        padding: 2px 7px;
        border-radius: 7px;
    }

    .persistent-chat {
        max-height: min(58vh, 460px);
    }

    .persistent-chat.chat-collapsed {
        right: calc(12px + var(--safe-area-right));
        bottom: calc(12px + var(--safe-area-bottom));
    }

    .grid,
    .stat-grid,
    .guild-layout,
    .market-order-grid,
    .market-form-grid,
    .inventory-filter-bar {
        grid-template-columns: 1fr;
    }
}

.offline-reward-modal {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: grid;
    place-items: center;
    padding: 24px;
}

.offline-reward-modal.closing {
    opacity: 0;
    pointer-events: none;
}

.offline-reward-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 6, 18, 0.78);
    backdrop-filter: blur(6px);
}

.offline-reward-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    border: 1px solid rgba(81, 214, 255, 0.45);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(45, 112, 255, 0.22), transparent 34%),
        linear-gradient(145deg, #101c31, #07111f);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
    padding: 24px;
}

.offline-reward-panel h2 {
    margin: 0 0 6px;
    color: #67e8ff;
}

.offline-reward-panel > p {
    margin: 0 0 18px;
    color: #a9bdd8;
}

.offline-reward-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.offline-reward-grid div,
.offline-reward-items {
    border: 1px solid rgba(94, 129, 172, 0.35);
    border-radius: 12px;
    background: rgba(5, 15, 30, 0.78);
    padding: 12px;
}

.offline-reward-grid span,
.offline-reward-items span {
    display: block;
    color: #9fb5d1;
    font-size: 0.82rem;
}

.offline-reward-grid strong {
    display: block;
    margin-top: 4px;
    color: #ffffff;
    font-size: 1.25rem;
}

.offline-reward-items {
    margin-top: 12px;
}

.offline-reward-items p {
    margin: 6px 0 0;
    color: #dbeafe;
}

.offline-reward-dismantle-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(81, 214, 255, 0.25);
    border-radius: 10px;
    background: rgba(8, 21, 42, 0.9);
}

.offline-reward-dismantle-summary strong,
.offline-reward-item-section > strong {
    color: #67e8ff;
}

.offline-reward-dismantle-summary span {
    display: inline-flex;
    width: fit-content;
    color: #ffffff;
    font-weight: 800;
}

.offline-reward-item-section,
.offline-reward-all-items {
    margin-top: 12px;
}

.offline-reward-item-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.offline-reward-item {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(94, 129, 172, 0.28);
    border-radius: 10px;
    background: rgba(10, 21, 38, 0.88);
}

.offline-reward-item .item-name-list {
    font-weight: 900;
}

.offline-reward-item small {
    color: #9fb5d1;
    font-size: 0.75rem;
}

.offline-reward-item-state {
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 999px;
    padding: 1px 7px;
    color: #fbbf24 !important;
    background: rgba(120, 53, 15, 0.25);
}

.offline-reward-all-items summary {
    cursor: pointer;
    color: #67e8ff;
    font-weight: 900;
}

#offline-reward-close {
    width: 100%;
    margin-top: 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #ffffff;
    font-weight: 800;
    padding: 12px 16px;
    cursor: pointer;
}

.system-error-log {
    max-height: 420px;
    overflow: auto;
    margin: 0;
    border: 1px solid rgba(94, 129, 172, 0.35);
    border-radius: 12px;
    background: #050b16;
    color: #dbeafe;
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.82rem;
    line-height: 1.45;
}

.system-health-success {
    border-color: rgba(34, 197, 94, 0.45);
}

.system-health-warning {
    border-color: rgba(251, 191, 36, 0.55);
}

.system-health-danger {
    border-color: rgba(248, 113, 113, 0.65);
}

.ascension-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
    gap: 20px;
    align-items: center;
}

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

.ascension-summary-grid > div,
.ascension-upgrade-card,
.ascension-path-card {
    background: rgba(8, 18, 34, 0.72);
    border: 1px solid rgba(94, 129, 172, 0.42);
    border-radius: 12px;
    padding: 14px;
}

.ascension-summary-grid span,
.ascension-upgrade-card small {
    color: #a8c3e8;
    font-size: 0.82rem;
}

.ascension-summary-grid strong {
    display: block;
    color: #67e8f9;
    font-size: 1.35rem;
    margin-top: 4px;
}

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

.ascension-path-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
}

.ascension-path-card,
.ascension-path-section {
    border-color: color-mix(in srgb, var(--ascension-color, #38bdf8) 55%, rgba(94, 129, 172, 0.4));
}

.ascension-path-card h3,
.ascension-path-section h2 {
    color: var(--ascension-color, #67e8f9);
}

.ascension-control-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 520px);
    gap: 18px;
    align-items: start;
}

.ascension-control-actions {
    display: grid;
    gap: 10px;
}

.ascension-control-actions form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ascension-control-actions select {
    min-width: 180px;
}

.ascension-upgrade-layout {
    display: grid;
    gap: 16px;
}

.ascension-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(94, 129, 172, 0.35);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.ascension-section-heading p {
    color: #a8c3e8;
    margin: 4px 0 0;
}

.ascension-section-heading span {
    border: 1px solid rgba(94, 129, 172, 0.45);
    border-radius: 999px;
    color: #cbd5e1;
    padding: 4px 10px;
    font-size: 0.78rem;
}

.ascension-path-section.unlocked .ascension-section-heading span {
    border-color: var(--ascension-color, #67e8f9);
    color: var(--ascension-color, #67e8f9);
}

.ascension-path-section.main-path {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ascension-color, #67e8f9) 45%, transparent),
        0 0 24px color-mix(in srgb, var(--ascension-color, #67e8f9) 12%, transparent);
}

.ascension-path-details {
    color: #dbeafe;
    font-size: 0.92rem;
    max-width: 900px;
}

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

.ascension-upgrade-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.ascension-upgrade-card h3 {
    margin: 0 0 6px;
}

.ascension-upgrade-card p {
    margin: 0 0 4px;
}

.ascension-upgrade-description {
    color: #bdd7ff;
    font-size: 0.88rem;
    line-height: 1.35;
}

.ascension-path-section.locked {
    opacity: 0.68;
}

@media (max-width: 900px) {
    .ascension-hero,
    .ascension-control-card {
        grid-template-columns: 1fr;
    }
}
