:root {
    color-scheme: light dark;
    font-family: "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

    /* Default Theme (Gradient) */
    --bg-main: radial-gradient(circle at top, #23212f, #0a0913 55%, #03030a);
    --bg-shell: rgba(15, 14, 26, 0.82);
    --bg-hero-card: linear-gradient(140deg, rgba(71, 55, 142, 0.22), rgba(28, 24, 68, 0.7));
    --bg-panel: rgba(255, 255, 255, 0.05);
    --bg-stat: rgba(255, 255, 255, 0.04);
    --bg-quest: rgba(16, 19, 34, 0.7);
    --bg-log: rgba(6, 7, 14, 0.62);
    --bg-combat-log: rgba(0, 0, 0, 0.4);
    --bg-item: rgba(255, 255, 255, 0.06);
    --bg-header: rgba(10, 9, 19, 0.95);
    --bg-modal: rgba(15, 14, 26, 0.95);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-select: rgba(0, 0, 0, 0.3);
    --bg-tab: rgba(255, 255, 255, 0.08);
    --bg-tab-hover: rgba(255, 255, 255, 0.12);
    --bg-tab-active: rgba(255, 255, 255, 0.15);
    
    /* Button gradients - colorful for gradient theme */
    --btn-primary: linear-gradient(120deg, #ffd85b, #ff9671);
    --btn-primary-shadow: rgba(255, 152, 113, 0.28);
    --btn-secondary: linear-gradient(120deg, #4facfe, #00c6ff);
    --btn-secondary-shadow: rgba(79, 172, 254, 0.25);
    --btn-tertiary: linear-gradient(120deg, #845ec2, #d65db1);
    --btn-tertiary-shadow: rgba(132, 94, 194, 0.26);
    --btn-danger: linear-gradient(120deg, #ff4d6d, #c9184a);
    --btn-danger-shadow: rgba(255, 77, 109, 0.3);
}

/* True Dark Theme */
body.true-dark {
    --bg-main: #000000;
    --bg-shell: rgba(0, 0, 0, 0.9);
    --bg-hero-card: linear-gradient(140deg, rgba(20, 20, 20, 0.9), rgba(10, 10, 10, 0.95));
    --bg-panel: rgba(15, 15, 15, 0.8);
    --bg-stat: rgba(25, 25, 25, 0.6);
    --bg-quest: rgba(10, 10, 10, 0.9);
    --bg-log: rgba(5, 5, 5, 0.85);
    --bg-combat-log: rgba(0, 0, 0, 0.7);
    --bg-item: rgba(30, 30, 30, 0.5);
    --bg-header: rgba(0, 0, 0, 0.98);
    --bg-modal: rgba(10, 10, 10, 0.98);
    --bg-input: rgba(30, 30, 30, 0.8);
    --bg-select: rgba(20, 20, 20, 0.8);
    --bg-tab: rgba(40, 40, 40, 0.6);
    --bg-tab-hover: rgba(50, 50, 50, 0.7);
    --bg-tab-active: rgba(60, 60, 60, 0.8);
    
    /* Button styles - white/light for dark mode */
    --btn-primary: rgba(255, 255, 255, 0.9);
    --btn-primary-shadow: rgba(255, 255, 255, 0.2);
    --btn-secondary: rgba(230, 230, 230, 0.9);
    --btn-secondary-shadow: rgba(200, 200, 200, 0.2);
    --btn-tertiary: rgba(245, 245, 245, 0.9);
    --btn-tertiary-shadow: rgba(220, 220, 220, 0.2);
    --btn-danger: rgba(255, 200, 200, 0.9);
    --btn-danger-shadow: rgba(255, 150, 150, 0.2);
}

:root {
    color-scheme: light dark;
    font-family: "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
@@
}

html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE & Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 0;
    background: var(--bg-main);
    color: #f3f1ff;
    overflow-x: hidden;
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.app-shell {
    --app-shell-padding-x: 18px;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0 var(--app-shell-padding-x);
    border-radius: 0;
    border: none;
    background: var(--bg-shell);
    backdrop-filter: blur(18px);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: calc(100% + (var(--app-shell-padding-x) * 2));
    margin-left: calc(-1 * var(--app-shell-padding-x));
    margin-right: calc(-1 * var(--app-shell-padding-x));
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.95rem;
    color: rgba(243, 241, 255, 0.78);
    padding: calc(env(safe-area-inset-top) + 12px) 18px 12px 18px;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    z-index: 1000;
    box-sizing: border-box;
}

.header-mail-btn {
    display: none;
    border: none;
    background: transparent;
    color: rgba(243, 241, 255, 0.78);
    padding: 0;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.header-mail-btn:hover {
    color: rgba(243, 241, 255, 1);
}

.footer-nav {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: calc(100% + (var(--app-shell-padding-x) * 2));
    margin-left: calc(-1 * var(--app-shell-padding-x));
    margin-right: calc(-1 * var(--app-shell-padding-x));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom)) 0;
    background: var(--bg-header);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    z-index: 950;
    margin-top: auto;
}

.footer-btn {
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 0;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-btn:hover {
    color: rgba(255, 255, 255, 1);
}

.footer-btn:active {
    opacity: 0.7;
}

.footer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 15, 0.82);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    z-index: 4000;
}

.footer-overlay__panel {
    width: 100%;
    max-width: 520px;
    background: rgba(15, 14, 26, 0.96);
    border-radius: 28px 28px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 22px 22px calc(22px + env(safe-area-inset-bottom)) 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.footer-overlay__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    margin: 0 0 6px 0;
}

.footer-overlay__subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.footer-overlay__close {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-overlay__body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

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

.footer-overlay__item {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-overlay__item:hover {
    color: #fff;
}

.footer-overlay__item:active {
    opacity: 0.75;
}

.auto-adventure-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.auto-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.auto-btn__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 6px;
    display: block;
    background: linear-gradient(120deg, rgba(146,254,157,0.9), rgba(0,201,255,0.9));
    width: 0%;
    transition: width 0.1s linear, opacity 0.1s linear;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
    border-radius: 0 0 8px 8px;
}

.auto-btn__label {
    position: relative;
    z-index: 2;
}

.auto-btn__baseline {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
    pointer-events: none;
}

.auto-progress-bar {
    display: none;
}

.auto-progress-fill {
    display: none;
}

.enchant-modal {
    gap: 16px;
}

.enchant-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.enchant-modal__card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
}

.enchant-modal__item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #92fe9d;
    margin-bottom: 6px;
    text-align: center;
}

.enchant-modal__item-stats {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.enchant-modal__stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enchant-modal__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.enchant-modal__row strong {
    color: #fdf7ff;
}

.enchant-modal__preview-card {
    border-color: rgba(146, 254, 157, 0.3);
    background: rgba(146, 254, 157, 0.08);
}

.enchant-modal__preview-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #92fe9d;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: 0.15em;
}

.enchant-modal__preview {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.enchant-modal__warning {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    margin: 0;
}

.enchant-modal__actions {
    display: flex;
    gap: 12px;
}

.enchant-modal__actions .modal-btn {
    flex: 1;
}

.enchant-modal__result {
    margin-top: 4px;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

.hero-card {
    background: var(--bg-hero-card);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Hero Header - Avatar + Core Stats */
.hero-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-compact {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: transparent;
    display: grid;
    place-items: center;
    font-size: 4rem;
    font-weight: 700;
    color: #f3f1ff;
    cursor: pointer;
    transition: transform 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-compact:hover {
    transform: scale(1.05);
}

.avatar-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Adventure portraits responsive sizing */
.combat-portraits {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}

.combat-portrait {
    width: clamp(120px, 18vw, 236px);
    height: clamp(120px, 18vw, 236px);
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.combat-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .combat-portraits {
        grid-template-columns: 1fr auto 1fr;
        gap: 12px;
    }
    .combat-portrait {
        width: clamp(96px, 28vw, 150px);
        height: clamp(96px, 28vw, 150px);
    }
}

.core-stats {
    display: flex;
    gap: 12px;
    flex: 1;
}

.core-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    background: var(--bg-stat);
    padding: 8px 10px;
    border-radius: 10px;
}

.core-stat span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(243, 241, 255, 0.5);
}

.core-stat strong {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

/* Meters Compact */
.meters-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(243, 241, 255, 0.6);
}

.meter {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
}

.meter-fill.hp {
    background: linear-gradient(90deg, #ff4d6d, #ff7eb3);
}

.meter-fill.xp {
    background: linear-gradient(90deg, #00c9ff, #92fe9d);
}

.meter-fill.energy {
    background: linear-gradient(90deg, #00c9ff, #845ec2);
}

.meter-fill.fame {
    background: linear-gradient(90deg, #ffd85b, #fbab7e);
}

/* Stats Sections */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(243, 241, 255, 0.4);
    font-weight: 600;
}

.stats-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stats-compact.two-row {
    grid-template-columns: repeat(1, 1fr);
    margin-top: 6px;
}
.stat-item.wide {
    grid-column: span 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: var(--bg-stat);
    border-radius: 10px;
    text-align: center;
}

.stat-item span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(243, 241, 255, 0.5);
}

.stat-item strong {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* Attributes List */
.attributes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-stat);
    border-radius: 10px;
}

.attr-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(243, 241, 255, 0.5);
    min-width: 32px;
}

.attr-row strong {
    font-size: 1rem;
    letter-spacing: 0.02em;
    flex: 1;
}

.attr-controls {
    display: flex;
    gap: 6px;
}

.attr-btn-mini {
    min-width: 38px;
    padding: 0 8px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: grid;
    place-items: center;
}

.attr-btn-mini:hover {
    background: rgba(255, 255, 255, 0.15);
}

.attr-btn-mini:active {
    transform: scale(0.95);
    background: linear-gradient(120deg, #845ec2, #d65db1);
}

#navButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-btn {
    flex: 1 1 calc(33.333% - 7px);
    min-width: 100px;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Force specific buttons to appear in second row */
#viewShopBtn,
#viewEnchantBtn {
    flex: 1 1 calc(50% - 5px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn:active {
    transform: scale(0.98);
}

.nav-btn.active {
    background: var(--btn-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

body:not(.true-dark) .nav-btn.active {
    color: #1d1532;
}

body.true-dark .nav-btn.active {
    color: #000000;
}

.back-btn {
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #f5f4ff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: transform 0.12s ease, background 0.12s ease;
    display: none;
}

.back-btn:active {
    transform: translateY(2px);
    background: rgba(255, 255, 255, 0.2);
}

/* Legal footer links */

.hidden {
    display: none !important;
}

.layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 0;
    overflow: hidden;
}

#characterView {
    min-height: 0;
}

.home-logo-placeholder {
    flex: 1;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.home-logo-placeholder img {
    max-width: 70%;
    height: auto;
    opacity: 0.18;
}

.app-logo {
    display: block;
    margin: 0 auto 10px;
    width: 200px;
    max-width: 80%;
    height: auto;
    opacity: 0.18;
}

.panel {
    background: var(--bg-panel);
    border-radius: 22px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.panel h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quest-list {
    display: grid;
    gap: 12px;
}

.quest-card {
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--bg-quest);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quest-card strong {
    letter-spacing: 0.05em;
}

.quest-card span {
    font-size: 0.8rem;
    color: rgba(243, 241, 255, 0.7);
}

.quest-card button {
    align-self: flex-start;
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: var(--btn-tertiary);
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 10px 16px var(--btn-tertiary-shadow);
}

body:not(.true-dark) .quest-card button {
    color: #fdf7ff;
}

body.true-dark .quest-card button {
    color: #000000;
}

.quest-card button:active {
    transform: translateY(2px);
    box-shadow: 0 4px 8px rgba(132, 94, 194, 0.3);
}

.log-panel {
    flex: 1;
    overflow: hidden;
}

.log-entries {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
}

.log-line {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-log);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
    line-height: 1.4;
}

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

.action-btn {
    padding: 14px 16px;
    border-radius: 16px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    background: var(--btn-primary);
    box-shadow: 0 12px 20px var(--btn-primary-shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

body:not(.true-dark) .action-btn {
    color: #1d1532;
}

body.true-dark .action-btn {
    color: #000000;
}

/* Make adventure/fight buttons white in dark mode */
body.true-dark #startAdventureBtn,
body.true-dark #startCombatBtn,
body.true-dark #enterDungeonBtn,
body.true-dark button[id^="selectDungeon"] {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #000000 !important;
}

.action-btn.secondary {
    background: var(--btn-secondary);
    box-shadow: 0 12px 20px var(--btn-secondary-shadow);
}

body:not(.true-dark) .action-btn.secondary {
    color: #fdf7ff;
}

body.true-dark .action-btn.secondary {
    color: #000000;
}

.action-btn.tertiary {
    background: var(--btn-tertiary);
    box-shadow: 0 12px 20px var(--btn-tertiary-shadow);
}

body:not(.true-dark) .action-btn.tertiary {
    color: #fdf7ff;
}

body.true-dark .action-btn.tertiary {
    color: #000000;
}
    background: linear-gradient(120deg, #845ec2, #54d2ff);
    box-shadow: 0 12px 20px rgba(84, 210, 255, 0.25);
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
}

.inventory {
    background: var(--bg-log);
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: grid;
    gap: 12px;
}

.inventory h3 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.item-slot {
    border-radius: 14px;
    min-height: 200px;
    background: var(--bg-item);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8rem;
    text-align: left;
    padding: 16px;
}

.item-slot strong {
    font-size: 1rem;
}

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

.equip-slot {
    border-radius: 14px;
    background: var(--bg-item);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 70px;
}

.equip-slot span {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(243, 241, 255, 0.65);
}

.equip-empty {
    font-size: 0.85rem;
    color: rgba(243, 241, 255, 0.4);
    font-style: italic;
}

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

.comparison-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    line-height: 1.6;
}

.comparison-panel.hidden {
    display: none;
}

.comparison-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-value {
    font-weight: 600;
}

.comparison-value.better {
    color: #92fe9d;
}

.comparison-value.worse {
    color: #ff7eb3;
}

.shop-item {
    border-radius: 16px;
    padding: 16px;
    background: var(--bg-quest);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.buy-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(120deg, #00c9ff, #845ec2);
    color: #fdf7ff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 14px rgba(0, 201, 255, 0.22);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.buy-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 8px rgba(0, 201, 255, 0.3);
}

.unequip-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 77, 109, 0.2);
    color: #ff7eb3;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.12s ease, background 0.12s ease;
}

.unequip-btn:active {
    transform: translateY(2px);
    background: rgba(255, 77, 109, 0.35);
}

.player-name-clickable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.player-name-clickable:hover {
    color: #ff7eb3;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    overflow-y: auto;
    padding: 20px;
}

.modal {
    background: var(--bg-modal);
    border-radius: 24px;
    padding: 32px 24px;
    width: min(340px, 90vw);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    margin: 0;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.modal h2 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    text-align: center;
}

.modal input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-input);
    color: #f3f1ff;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.modal input:focus {
    outline: none;
    border-color: #ff7eb3;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.modal-btn:active {
    transform: translateY(2px);
}

.modal-btn.primary {
    background: var(--btn-tertiary);
}

body:not(.true-dark) .modal-btn.primary {
    color: #fdf7ff;
}

body.true-dark .modal-btn.primary {
    color: #000000;
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f1ff;
}

.modal-btn.danger {
    background: linear-gradient(120deg, #ff4d6d, #c9184a);
    color: #ffffff;
}

.modal-btn.danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.avatar-option:hover {
    transform: scale(1.05);
    border-color: #ff7eb3;
}

.avatar-option.selected {
    border-color: #845ec2;
    box-shadow: 0 0 20px rgba(132, 94, 194, 0.5);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.shop-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.shop-tab {
    flex: 0 0 auto;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(243, 241, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-tab.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fdf7ff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.shop-tab:active {
    transform: translateY(1px);
}

.refresh-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(120deg, #ffd85b, #ff9671);
    color: #1d1532;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.refresh-btn:active {
    transform: translateY(2px);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.accordion-section {
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0;
    padding: 16px;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    user-select: none;
    transition: background 0.2s ease;
    border-radius: 12px;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-header:active {
    background: rgba(255, 255, 255, 0.08);
}

.accordion-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.6);
}

.accordion-header.active .accordion-icon {
    transform: rotate(0deg);
}

.accordion-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding-top: 14px;
}

.accordion-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

/* Hide navButtonsContainer in portrait mode */
#navButtonsContainer {
    display: none;
}

/* Dungeon Styles */
.dungeon-select-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.dungeon-card {
    border-radius: 16px;
    padding: 18px;
    background: var(--bg-quest);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dungeon-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.dungeon-card.locked {
    opacity: 0.6;
    background: var(--bg-log);
}

.dungeon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dungeon-enter-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(120deg, #ff4d6d, #ff7eb3);
    color: #fdf7ff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 8px 14px rgba(255, 77, 109, 0.3);
}

.dungeon-enter-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 8px rgba(255, 77, 109, 0.4);
}

.dungeon-enter-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

.dungeon-enter-btn.disabled:active {
    transform: none;
}

/* Landscape adjustments for dungeons */
@media (orientation: landscape) {
    .dungeon-select-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Unified Equipment & Inventory Styles */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.filter-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.filter-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: var(--bg-tab);
    color: rgba(243, 241, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Mobile-first touch targets */
    min-width: 80px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tab:hover {
    background: var(--bg-tab-hover);
    color: rgba(243, 241, 255, 0.8);
}

.filter-tab.active {
    background: var(--bg-tab-active);
    color: #fdf7ff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.filter-tab:active {
    transform: scale(0.98);
}

#itemSortSelect {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-select);
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    /* Mobile-first touch targets */
    min-height: 44px;
}

#itemSortSelect:focus {
    outline: none;
    border-color: #845ec2;
}

#unifiedItemList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Item cards within unified list are styled inline in createItemCard() */
/* Additional utility classes for consistent styling */
.item-card-button {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    /* Mobile-first touch targets */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card-button:active {
    transform: scale(0.98);
}

@media (orientation: landscape) {
    .filter-tabs {
        justify-content: flex-start;
    }

    #unifiedItemList {
        max-height: calc(100vh - 350px);
        overflow-y: auto;
    }
}

/* Startup Screen / Save Slot Selection */
.startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    overflow-y: auto;
    box-sizing: border-box;
}

.startup-container {
    width: min(450px, 100%);
    max-width: 100%;
    margin: 0 auto;
}

.auth-field {
    width: 100%;
    max-width: 360px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.auth-label {
    display: block;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.save-slot-card {
    background: var(--bg-hero-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.save-slot-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.save-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-slot-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.save-slot-info {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.save-slot-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: var(--btn-tertiary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 16px var(--btn-tertiary-shadow);
}

body:not(.true-dark) .save-slot-btn {
    color: #fdf7ff;
}

body.true-dark .save-slot-btn {
    color: #000000;
}

.save-slot-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px var(--btn-tertiary-shadow);
}

.save-slot-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 8px var(--btn-tertiary-shadow);
}

.delete-slot-btn {
    transition: all 0.2s ease;
}

.delete-slot-btn:hover {
    background: rgba(255, 77, 109, 0.3) !important;
    border-color: rgba(255, 77, 109, 0.7) !important;
}

.delete-slot-btn:active {
    transform: scale(0.95);
}

/* Dungeon card and button styles */
.dungeon-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
}

.dungeon-card.locked {
    opacity: 0.6;
}

.dungeon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dungeon-enter-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: var(--btn-tertiary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 16px var(--btn-tertiary-shadow);
}

body:not(.true-dark) .dungeon-enter-btn {
    color: #fdf7ff;
}

body.true-dark .dungeon-enter-btn {
    color: #000000;
}

.dungeon-enter-btn:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px var(--btn-tertiary-shadow);
}

.dungeon-enter-btn:active:not(.disabled) {
    transform: translateY(1px);
}

.dungeon-enter-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.3);
    box-shadow: none;
}

/* Low HP avatar pulse animation */
@keyframes lowHpPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 77, 109, 0.8);
        border-color: #ff4d6d;
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 77, 109, 1);
        border-color: #ff2d4d;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.discord-btn {
    display: block;
    width: fit-content;
    margin: 24px auto 0;
    padding: 10px 24px;
    border-radius: 9999px;
    background: #5865F2;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(88, 101, 242, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.discord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(88, 101, 242, 0.35);
}

.discord-btn:active {
    transform: translateY(1px);
    box-shadow: 0 6px 12px rgba(88, 101, 242, 0.2);
}

.pwa-banner {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    transform: translateX(-50%);
    width: min(100% - 32px, 440px);
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(18, 16, 31, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(10, 8, 20, 0.45);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 5000;
    backdrop-filter: blur(20px);
}

.pwa-banner__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.pwa-banner__content strong {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.pwa-banner__content span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.pwa-banner__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner__install {
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(120deg, #92fe9d, #00c9ff);
    color: #0a0913;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(0, 201, 255, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pwa-banner__install:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(0, 201, 255, 0.3);
}

.pwa-banner__install:active {
    transform: translateY(1px);
    box-shadow: 0 6px 12px rgba(0, 201, 255, 0.2);
}

.pwa-banner__dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
}

.pwa-banner__dismiss:hover {
    color: rgba(255, 255, 255, 0.8);
}

.pwa-banner--ios .pwa-banner__dismiss {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 520px) {
    .pwa-banner {
        bottom: calc(env(safe-area-inset-bottom) + 12px);
        padding: 14px 16px;
        width: min(100% - 16px, 420px);
    }

    .pwa-banner__content strong {
        font-size: 0.9rem;
    }

    .pwa-banner__content span {
        font-size: 0.75rem;
    }

    .footer-btn {
        padding: 8px 0;
        font-size: 0.65rem;
    }

    .footer-overlay__grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media (min-width: 1200px) {
    .app-shell {
        --app-shell-padding-x: clamp(24px, 3vw, 48px);
        display: grid;
        grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        align-items: flex-start;
        gap: 24px;
        padding: 0 var(--app-shell-padding-x);
    }

    .header {
        grid-column: 1 / -1;
        position: sticky;
        top: 0;
        z-index: 1200;
    }

    .hero-card {
        grid-column: 1;
        grid-row: 2;
        position: sticky;
        top: calc(env(safe-area-inset-top) + 24px);
        align-self: flex-start;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        padding-right: 6px;
    }

    .hero-card::-webkit-scrollbar {
        width: 6px;
    }

    .hero-card::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 999px;
    }

    .layout {
        grid-column: 2;
        min-width: 0;
        overflow: visible;
        flex: 1;
    }

    .home-logo-placeholder {
        display: flex;
    }

    .equipment-grid,
    .inventory-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .shop-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .header-mail-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    .footer-overlay__panel.mail-modal {
        max-width: 1100px;
        width: 100%;
    }

    .mail-modal__body {
        grid-template-columns: minmax(280px, 360px) 1fr;
        min-height: 500px;
    }

    .mail-modal__list {
        max-height: calc(100vh - 320px);
    }

    .footer-nav {
        grid-column: 1 / -1;
    }
}

/* Desktop Layout - screens wider than 600px */
.hp-highlight {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(146, 254, 157, 0.2), rgba(84, 210, 255, 0.2));
    border: 1px solid rgba(146, 254, 157, 0.4);
    color: #e3fff0;
    font-weight: 600;
    margin-bottom: 6px;
}
.reroll-modal__list {
    max-height: 240px;
    overflow-y: auto;
    gap: 12px;
}

.reroll-modal__affixes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reroll-modal__affix-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.reroll-modal__affix-btn span:last-child {
    color: #92fe9d;
    font-weight: 600;
}

.reroll-modal__affix-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.reroll-modal__cost {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.reroll-modal__cost strong {
    color: #ffd85b;
    font-weight: 600;
}

.socket-modal {
    gap: 16px;
}

.socket-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.socket-modal__card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.socket-modal__item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 6px;
    text-align: center;
}

.socket-modal__item-stats {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.socket-modal__section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    text-align: center;
}

.socket-modal__slots {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.socket-modal__gems-card {
    max-height: 240px;
    overflow-y: auto;
    border-color: rgba(167, 139, 250, 0.25);
    background: rgba(167, 139, 250, 0.08);
}

.socket-modal__gems {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.socket-modal__message {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.socket-modal__actions {
    display: flex;
    justify-content: center;
}

.mail-modal {
    gap: 16px;
}

.mail-modal__body {
    display: grid;
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 16px;
    min-height: 320px;
}

.mail-modal__compose {
    grid-column: 1 / -1;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.3);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mail-compose__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mail-compose__field label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

.mail-compose__field input,
.mail-compose__field textarea {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.25);
    color: #fff;
}

.mail-compose__error {
    font-size: 0.85rem;
    color: #ff7eb3;
}

.mail-compose__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.mail-modal__list {
    max-height: 360px;
    overflow-y: auto;
    border-radius: 16px;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.mail-modal__item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    background: rgba(0,0,0,0.25);
}

.mail-modal__item:last-child {
    margin-bottom: 0;
}

.mail-modal__item.unread {
    background: rgba(255, 215, 91, 0.08);
}

.mail-modal__item.active {
    background: rgba(146, 254, 157, 0.12);
}

.mail-modal__subject {
    font-weight: 600;
    color: #fdf7ff;
    margin-bottom: 4px;
}

.mail-modal__meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}

.mail-modal__content {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.35);
    padding: 16px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mail-modal__content h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #fdf7ff;
}

.mail-modal__content time {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

.mail-modal__header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mail-compose-btn {
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: #fdf7ff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.mail-modal__actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .mail-modal__body {
        display: flex;
        flex-direction: column;
    }

    .mail-modal__list {
        max-height: 220px;
    }

    .mail-modal__content {
        min-height: 220px;
    }
}

.compare-modal {
    gap: 16px;
}

.compare-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.compare-modal__column {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compare-modal__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.compare-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    image-rendering: crisp-edges;
}

.compare-modal__item-name {
    font-weight: 600;
    text-align: center;
    font-size: 0.92rem;
}

.compare-modal__rarity {
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.compare-modal__stats {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.compare-modal__affixes {
    font-size: 0.72rem;
    color: #92fe9d;
    line-height: 1.4;
}

.compare-modal__affix {
    margin-bottom: 2px;
}

.compare-modal__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.compare-modal__diff {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 18px;
    padding: 16px;
}

.compare-modal__diff-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.compare-modal__diff-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.compare-modal__diff-line {
    font-weight: 600;
}

.compare-modal__diff-none {
    color: rgba(255, 255, 255, 0.5);
}
.hero-toolbar {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.hero-toolbar__btn {
    text-align: center;
}

.hero-toolbar__btn--theme {
    grid-column: 1;
    grid-row: 1;
}

.hero-toolbar__btn--sound {
    grid-column: 2;
    grid-row: 1;
}

.hero-toolbar__btn--assets {
    grid-column: 1;
    grid-row: 2;
}

.hero-toolbar__btn--logout {
    grid-column: 2;
    grid-row: 2;
}

.form-modal {
    gap: 16px;
}

.form-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-modal__error {
    font-size: 0.8rem;
    color: #ff7eb3;
    text-align: center;
}

.form-modal__input {
    width: min(360px, 100%);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.95rem;
}

.form-modal__input:focus {
    outline: none;
    border-color: rgba(146, 254, 157, 0.6);
    box-shadow: 0 0 0 2px rgba(146, 254, 157, 0.2);
}

.form-modal__actions {
    display: flex;
    gap: 10px;
}

.form-modal__actions .modal-btn {
    flex: 1;
}

.avatar-modal {
    gap: 16px;
}

.avatar-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.avatar-modal__note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.avatar-modal__gallery {
    width: 100%;
}
.mail-modal__content {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.35);
    padding: 16px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@@
.mail-modal__content h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #fdf7ff;
    word-break: break-word;
}

.mail-modal__content time {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    word-break: break-word;
}
