: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: clamp(10px, 4vw, 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: clamp(12px, 3vw, 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: var(--bg-modal);
    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: none;
    background: transparent;
    color: rgba(168, 139, 250, 0.9);
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.footer-overlay__close:hover {
    opacity: 0.8;
}

.footer-overlay__close:active {
    opacity: 0.6;
}

.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: 12px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

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

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

.footer-overlay__category {
    grid-column: 1 / -1;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    margin: -4px 0 -6px;
    padding: 0;
    line-height: 1;
}

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

.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: none;
    background: transparent;
    padding: 0;
    margin-top: -8px;
}

.enchant-modal__preview-title {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.enchant-modal__preview {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.enchant-modal__preview > div {
    width: 100%;
    max-width: 260px;
    justify-content: space-between !important;
}

.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;
    justify-content: center;
}

.enchant-modal__actions .modal-btn,
.enchant-modal__actions .enchant-ui-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: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    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;
    justify-content: center;
    gap: 14px;
}

.hero-portrait-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.hero-portrait-row {
    --hero-avatar-size: clamp(180px, 45vw, 240px);
    --hero-avatar-font: clamp(2.8rem, 6vw, 4.2rem);
    --beast-portrait-size: clamp(32px, 8vw, 40px);
    position: relative;
    width: 100%;
    height: var(--hero-avatar-size);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hero-portrait-row .hero-avatar {
    width: var(--hero-avatar-size);
    height: var(--hero-avatar-size);
    font-size: var(--hero-avatar-font);
    position: relative;
    z-index: 2;
}

.hero-portrait-row .hero-avatar:hover {
    transform: scale(1.03);
}

.beast-portrait {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

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

.beast-portrait.is-empty {
    opacity: 0.6;
}

.beast-portrait.is-clickable {
    cursor: pointer;
}

.hero-resources {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.hero-resources__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 90px;
}

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

.hero-resources__item strong {
    font-size: 1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.avatar-compact {
    width: clamp(180px, 45vw, 240px);
    height: clamp(180px, 45vw, 240px);
    border-radius: 40%;
    background: transparent;
    display: grid;
    place-items: center;
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: 700;
    color: #f3f1ff;
    cursor: pointer;
    transition: transform 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.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: clamp(8px, 2vw, 16px);
    margin-bottom: clamp(8px, 2vw, 16px);
    align-items: center;
}

.combat-portrait {
    width: clamp(80px, 15vw, 180px);
    height: clamp(80px, 15vw, 180px);
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.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: clamp(6px, 2vw, 12px);
    }
    .combat-portrait {
        width: clamp(60px, 18vw, 120px);
        height: clamp(60px, 18vw, 120px);
    }
}

.core-stats {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.core-stat {
    flex: 0 0 auto;
    min-width: 110px;
    max-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    /* background: var(--bg-stat); */
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.section-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

#attrPointsStat,
#attrPointsStat * {
    display: inline;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font: inherit !important;
    color: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
}

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

/* legacy meters removed */
.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);
}

/* Ensure overlay positioning for XP ring */
.hero-card {
    position: relative;
    overflow: hidden;
}

/* XP edge removed */

.class-xp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.xp-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.class-bars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 260px;
    margin-top: 6px;
}

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

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

.class-bar-track {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.class-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

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

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

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

/* 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;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.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;
    white-space: nowrap;
}

#heroCardCombatStats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

#heroCardCombatStats .stat-item {
    border: none;
    padding: 0;
    gap: 2px;
    border-radius: 0;
    background: transparent;
    padding-right: 12px;
}

#heroCardCombatStats .stat-item:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    margin-right: 10px;
    padding-right: 18px;
}

#heroCardCombatStats .stat-item span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
}

#heroCardCombatStats .stat-item strong {
    font-size: 0.95rem;
}

#heroCardResists {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    margin-top: 8px;
}

#heroCardResists .stat-item {
    border: none;
    padding: 0;
    gap: 2px;
    background: transparent;
}

#heroCardResists .stat-item span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
}

#heroCardResists .stat-item strong {
    font-size: 0.95rem;
    white-space: nowrap;
}

#damageStat {
    font-size: 0.95rem;
    letter-spacing: 0;
}

#critStat {
    font-size: 0.9rem;
    letter-spacing: 0;
}

/* Attributes List */
.attributes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 10px;
}

.attr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.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;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.attr-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
    display: inline-block;
}

#attrPointsStat {
    margin-left: 6px;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    padding: 0;
    background: none;
    border: none;
}


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

.tower-layout {
    position: relative;
    overflow: hidden;
}

.tower-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.tower-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) brightness(0.9);
}

.tower-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 10, 20, 0.7) 0%, rgba(7, 10, 20, 0.88) 65%, rgba(7, 10, 20, 0.96) 100%);
}

.tower-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.tower-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.tower-shell h2 {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tower-shell p {
    margin: 0 0 8px 0;
}

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

.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: 1fr;
    gap: 8px;
}

/* Collapsible sections */
.collapsible-section {
    margin-bottom: 12px;
}

.collapsible-header {
    user-select: none;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-section.collapsed .collapsible-content {
    display: none;
}

.collapsible-section.collapsed .collapsible-icon {
    transform: rotate(-90deg);
}

.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(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.shop-grid .item-card {
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 12px;
    box-sizing: border-box;
}

.combat-log {
    background: var(--bg-combat-log);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(6px);
}

.combat-log__header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
    background: linear-gradient(120deg, rgba(146, 254, 157, 0.08), rgba(0, 201, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}

.combat-log__title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fdf7ff;
}

.combat-log__action {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(120deg, #ffd85b, #ff9671);
    color: #1d1532;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.combat-log__action:active {
    transform: translateY(1px);
}

.combat-log__body {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 10px;
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
    line-height: 1.55;
    font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", monospace;
}

.combat-log__entry {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
}

.combat-log__detail {
    margin: 0;
    padding: 0;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

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

.buy-btn {
    padding: 10px 12px;
    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;
    min-height: 40px;
    white-space: nowrap;
    flex: 1;
    margin-top: auto;
}

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

/* Horizontal tabs at top */
.shop-tabs-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-tab {
    flex: 1 1 auto;
    min-width: 90px;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(243, 241, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

/* Mobile: stack tabs 2-3 per row */
@media (max-width: 600px) {
    .shop-tab {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    /* Guild tabs: fit 3 tabs in one row */
    .shop-tabs-horizontal[data-guild-tabs] .shop-tab {
        flex: 1 1 calc(33.333% - 6px);
        font-size: 0.75rem;
        padding: 8px 8px;
    }
}

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

/* Guild tabs: no transform on active state */
.shop-tabs-horizontal[data-guild-tabs] .shop-tab.active {
    transform: none;
}

/* Guild panel transparent background */
#guildPanel .panel {
    background: transparent;
    border: none;
}

/* Guild controls single row */
#guildLeaderControls,
#guildMemberControls {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

#guildLeaderControls button,
#guildMemberControls button {
    flex: 1;
    margin-bottom: 0 !important;
}

/* Guild video background */
.guild-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.guild-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) brightness(0.9);
}

.guild-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 10, 20, 0.7) 0%, rgba(7, 10, 20, 0.88) 65%, rgba(7, 10, 20, 0.96) 100%);
    pointer-events: none;
}

/* Guild info header mobile layout */
@media (max-width: 600px) {
    .guild-info-header {
        gap: 8px !important;
        align-items: stretch !important;
    }

    .guild-info-header > div:first-child {
        flex: 0 0 auto;
        min-width: 80px;
    }

    .guild-info-header > div:last-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .guild-info-header > div:last-child > div:first-child {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }

    .guild-info-header > div:last-child > div:last-child {
        gap: 6px !important;
    }

    .guild-info-header > div:last-child > div:last-child > div {
        flex: 1 1 calc(50% - 3px);
        min-width: 0;
    }

    .guild-info-header > div:last-child > div:last-child > div > div:first-child {
        font-size: 0.6rem !important;
    }

    .guild-info-header > div:last-child > div:last-child > div > div:last-child {
        font-size: 0.85rem !important;
    }
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

/* Premium tab gold gradient */
.shop-tab-premium {
    background: linear-gradient(135deg, #ffd85b, #ff9671);
    color: #1d1532;
    font-weight: 800;
}

.shop-tab-premium.active {
    background: linear-gradient(135deg, #ffe680, #ffb399);
    color: #1d1532;
    border: 1px solid rgba(255, 215, 91, 0.5);
    box-shadow: 0 4px 12px rgba(255, 215, 91, 0.3);
}

.shop-tab-premium:hover {
    background: linear-gradient(135deg, #ffe680, #ffb399);
}

.shop-content {
    flex: 1;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.shop-gold {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 215, 91, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 91, 0.2);
}

.shop-gold__label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.shop-gold__value {
    font-size: 1.2rem;
    color: #ffd85b;
}

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

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

    .shop-tabs {
        padding: 8px;
    }

    .shop-tab {
        width: 100%;
        text-align: left;
    }

    .shop-content {
        padding: 12px;
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .shop-grid .item-card {
        min-height: 260px;
    }
}

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

/* Premium Shop Styles */
#eternaContent {
    display: flex;
    justify-content: center;
    width: 100%;
}

.premium-shop-container {
    width: 100%;
    max-width: 1200px;
    padding: 16px;
}

.premium-shop-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
    max-width: 100% !important;
    margin: 0 auto;
}

/* Override any shop-grid restrictions for premium */
.premium-shop-container .premium-shop-grid {
    width: 100% !important;
}

/* Mobile: keep 2 columns */
@media (max-width: 768px) {
    .premium-shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

.premium-status {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    min-height: 80px;
}

.premium-status h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #ffd700;
}

.premium-status p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.premium-benefits {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.premium-benefits h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #ffd700;
}

.premium-benefits ul {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.premium-benefits li {
    padding: 4px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.premium-benefits li::before {
    content: "✓ ";
    color: #92fe9d;
    font-weight: bold;
}

.premium-eterna {
    background: rgba(255, 215, 0, 0.15);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.premium-eterna .balance-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.premium-eterna .balance-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
}

.premium-offer {
    background: linear-gradient(135deg, rgba(146, 254, 157, 0.15), rgba(0, 201, 255, 0.15));
    padding: 24px;
    border-radius: 16px;
    border: 2px solid rgba(146, 254, 157, 0.3);
    display: flex;
    flex-direction: column;
    grid-column: span 2;
}

@media (max-width: 768px) {
    .premium-offer {
        grid-column: span 1;
    }
}

.premium-offer h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
    color: #92fe9d;
}

.premium-offer .price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffd700;
    text-align: center;
    margin-bottom: 12px;
}

.premium-offer .buy-btn {
    margin-top: auto;
}

/* Premium packages (Eterna purchase cards) */
.premium-package {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 91, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

@media (max-width: 768px) {
    .premium-package {
        grid-column: span 1;
    }

    .premium-offer h4 {
        font-size: 1rem;
    }

    .premium-offer .price {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .premium-shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .premium-shop-grid .item-card {
        max-width: 100%;
        min-height: 140px;
    }
}

/* 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));
    }
}

/* Campaign Styles */
.campaign-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.campaign-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.campaign-group-title {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
}

.campaign-group-toggle {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-tab);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.campaign-group-toggle:hover {
    background: var(--bg-tab-hover);
}

.campaign-group-content {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.campaign-group-content.is-collapsed {
    display: none;
}

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

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

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

.campaign-missions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mission-card {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.mission-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.mission-card.completed {
    border-color: rgba(146, 254, 157, 0.3);
    background: rgba(146, 254, 157, 0.05);
}

.mission-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Landscape adjustments for campaign */
@media (orientation: landscape) {
    .campaign-group-content {
        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);
}

.rarity-filter-btn.active {
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

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

/* 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);
    }
}

/* Legendary item purple glow animation */
@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.6), 0 0 30px rgba(168, 85, 247, 0.3);
        border-color: #a855f7;
    }
    50% {
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.9), 0 0 50px rgba(168, 85, 247, 0.5);
        border-color: #c084fc;
    }
}

.legendary-glow {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
    border-color: #a855f7;
}

@keyframes wishCostGlow {
    0% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 3px rgba(168, 85, 247, 0.55));
    }
    50% {
        background-position: 100% 50%;
        filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.6));
    }
    100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.55));
    }
}

.wish-cost-glow {
    font-weight: 700;
    background: linear-gradient(90deg, #a855f7, #ffffff, #facc15, #f97316, #22c55e, #38bdf8, #ec4899, #a855f7);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.65),
                 0 0 8px rgba(168, 85, 247, 0.55);
    animation: wishCostGlow 8s linear infinite;
}

/* Ultra item white/silver border */
.ultra-glow {
    border-color: #f0f0f0 !important;
}

/* Unique item mandarin/peach border with subtle glow */
.unique-glow {
    border-color: #ff8c61 !important;
    box-shadow: 0 0 15px rgba(255, 140, 97, 0.6), 0 0 25px rgba(255, 107, 53, 0.3);
}

.poop-glow {
    border-color: #8B4513 !important;
}

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

/* Very Small Screens (320-400dp) */
@media (max-width: 400px) {
    .app-shell {
        --app-shell-padding-x: clamp(8px, 3vw, 12px);
        gap: clamp(8px, 2vw, 16px);
    }

    .shop-layout {
        grid-template-columns: 1fr;
        gap: clamp(12px, 3vw, 16px);
    }

    .shop-content {
        padding: clamp(10px, 2.5vw, 14px);
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: clamp(8px, 2vw, 12px);
    }

    .shop-grid .item-card {
        max-width: clamp(140px, 35vw, 160px);
        min-height: 240px;
    }

    .hero-card {
        padding: clamp(12px, 3vw, 20px);
        gap: clamp(10px, 2vw, 16px);
    }

    .avatar-compact {
        width: clamp(220px, 60vw, 320px);
        height: clamp(220px, 60vw, 320px);
        font-size: clamp(3.4rem, 7vw, 5rem);
    }

    .hero-portrait-row {
        --hero-avatar-size: clamp(220px, 60vw, 320px);
        --hero-avatar-font: clamp(3.4rem, 7vw, 5rem);
    }

    .combat-portraits {
        gap: clamp(4px, 1.5vw, 8px);
        margin-bottom: clamp(4px, 1.5vw, 8px);
    }

    .combat-portrait {
        width: clamp(50px, 14vw, 80px);
        height: clamp(50px, 14vw, 80px);
    }

    .core-stats {
        gap: clamp(4px, 1vw, 8px);
    }

    .core-stat {
        padding: clamp(4px, 1vw, 8px);
    }

    .core-stat span {
        font-size: clamp(0.55rem, 2vw, 0.7rem);
    }

    .core-stat strong {
        font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    }

    .stats-compact {
        gap: clamp(4px, 1vw, 8px);
    }

    .stat-item {
        padding: clamp(6px, 1.5vw, 10px);
    }

    .stat-item span {
        font-size: clamp(0.6rem, 2vw, 0.7rem);
    }

    .stat-item strong {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
    }

    .nav-btn {
        padding: clamp(8px, 2vw, 12px);
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        min-width: clamp(80px, 20vw, 100px);
    }

    .panel {
        padding: clamp(12px, 3vw, 18px);
        gap: clamp(8px, 2vw, 14px);
    }

    .panel h2 {
        font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    }

    .modal {
        width: min(280px, 90vw);
        padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 24px);
    }

    .modal h2 {
        font-size: clamp(1rem, 3vw, 1.3rem);
    }

    .footer-nav {
        padding: clamp(8px, 2vw, 12px) 0;
    }

    .footer-btn {
        padding: clamp(6px, 1.5vw, 10px) 0;
        font-size: clamp(0.6rem, 2vw, 0.74rem);
    }

    .header {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
        padding: calc(env(safe-area-inset-top) + 8px) clamp(12px, 3vw, 18px) clamp(8px, 2vw, 12px);
    }

    .filter-tab {
        padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 16px);
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
        min-width: clamp(60px, 15vw, 80px);
    }
}

/* Ultra Small Screens (320dp and below) */
@media (max-width: 360px) {
    .avatar-compact {
        width: clamp(200px, 75vw, 240px);
        height: clamp(200px, 75vw, 240px);
        font-size: clamp(3rem, 7vw, 4.4rem);
    }

    .hero-portrait-row {
        --hero-avatar-size: clamp(200px, 75vw, 240px);
        --hero-avatar-font: clamp(3rem, 7vw, 4.4rem);
    }

    .combat-portrait {
        width: clamp(40px, 12vw, 60px);
        height: clamp(40px, 12vw, 60px);
    }

    .stats-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: clamp(4px, 1.5vw, 6px);
    }

    .stats-compact.two-row {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        flex: 1 1 calc(50% - 4px);
        font-size: clamp(0.65rem, 2.5vw, 0.75rem);
        padding: clamp(6px, 1.5vw, 10px);
    }

    #viewShopBtn,
    #viewEnchantBtn {
        flex: 1 1 calc(100% - 4px);
    }

    .equipment-grid {
        grid-template-columns: 1fr;
        gap: clamp(6px, 1.5vw, 10px);
    }

    .modal {
        width: min(260px, 95vw);
        padding: clamp(16px, 4vw, 24px) clamp(12px, 3vw, 20px);
    }

    .footer-overlay__panel {
        max-width: min(100%, 480px);
        padding: clamp(16px, 4vw, 22px);
    }

    .item-slot {
        min-height: clamp(140px, 35vw, 180px);
        padding: clamp(10px, 2.5vw, 16px);
    }

    .item-slot strong {
        font-size: clamp(0.85rem, 2.5vw, 1rem);
    }

    .item-slot {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
    }
}

/* Medium screens - keep portrait at max size */
@media (min-width: 401px) and (max-width: 1199px) {
    .avatar-compact {
        width: clamp(220px, 60vw, 320px);
        height: clamp(220px, 60vw, 320px);
    }

    .hero-portrait-row {
        --hero-avatar-size: clamp(220px, 60vw, 320px);
        --hero-avatar-font: clamp(2.8rem, 6vw, 4.2rem);
    }
}

@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 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 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.25);
    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.25);
    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;
}

/* Mail Page Tabs */
.mail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.mail-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mail-tab:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}

.mail-tab.active {
    color: #92fe9d;
    border-bottom-color: #92fe9d;
}

.mail-tab__badge {
    background: #ff6b6b;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.mail-tab-content {
    display: none;
}

.mail-tab-content.active {
    display: block;
}

.mail-compose__field {
    margin-bottom: 12px;
}

.mail-compose__field label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 6px;
    font-weight: 500;
}

#mailList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

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

.mail-modal__item:hover {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

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

.mail-modal__item.unread {
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.mail-modal__subject {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

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

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

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

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

    .mail-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

.compare-modal {
    gap: 12px;
}

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

.compare-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* force two columns side-by-side */
    gap: 8px;
}

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

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

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

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

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

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

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

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

.compare-modal__section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 8px;
}

.compare-modal__section > summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-modal__section > summary::-webkit-details-marker {
    display: none;
}

.compare-modal__section > summary::after {
    content: '+';
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.compare-modal__section[open] > summary::after {
    content: '–';
}

.compare-modal__section-body {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
}

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

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

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

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


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

/* Title System Styles */
.title-card {
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.title-card-locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.title-card-unlocked {
    border-color: rgba(76, 175, 80, 0.5);
}

.title-card-unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.title-card-equipped {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.title-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 8px;
}

.title-requirement {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin: 12px 0;
    min-height: 40px;
}

.title-equip-btn {
    padding: 10px 20px;
    background: rgba(146, 254, 157, 0.2);
    border: 1px solid rgba(146, 254, 157, 0.3);
    border-radius: 6px;
    color: #92fe9d;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
}

.title-equip-btn:hover:not(:disabled) {
    background: rgba(146, 254, 157, 0.3);
    transform: scale(1.05);
}

.title-equip-btn:disabled,
.title-equip-btn.equipped {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.title-locked-badge {
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    padding: 10px;
}

.title-filter-btn {
    transition: all 0.2s ease;
}

.title-filter-btn:hover {
    background: rgba(146, 254, 157, 0.15) !important;
}

.title-filter-btn.active {
    background: rgba(146, 254, 157, 0.2) !important;
    border-color: rgba(146, 254, 157, 0.3) !important;
    color: #92fe9d !important;
}

/* Arena */
#arenaView {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.arena-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.arena-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) brightness(0.9);
}

.arena-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 8, 16, 0.65) 0%, rgba(5, 8, 16, 0.85) 60%, rgba(5, 8, 16, 0.95) 100%);
}

/* Mail Video Background */
.mail-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.mail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) brightness(0.9);
}

.mail-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 8, 16, 0.65) 0%, rgba(5, 8, 16, 0.85) 60%, rgba(5, 8, 16, 0.95) 100%);
}

.mail-content {
    position: relative;
    z-index: 1;
}

/* Beast Summon */
.beast-summon-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.beast-summon-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

/* Boss Video Backgrounds (Weekly & World Boss) */
.boss-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.boss-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) brightness(0.85);
}

.boss-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 8, 16, 0.6) 0%, rgba(5, 8, 16, 0.8) 60%, rgba(5, 8, 16, 0.9) 100%);
}

.boss-content {
    position: relative;
    z-index: 1;
}

.arena-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.arena-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(3px);
}

.arena-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.arena-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.arena-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, auto));
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.arena-status {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

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

.arena-vs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.arena-crit-pulse {
    position: fixed;
    inset: 0;
    background: rgba(255, 0, 0, 0.04);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    z-index: 9999;
}

.arena-crit-pulse.is-active {
    opacity: 1;
    animation: arenaCritPulse 240ms ease;
}

@keyframes arenaCritPulse {
    0% { opacity: 0.1; }
    50% { opacity: 0.18; }
    100% { opacity: 0; }
}

.arena-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.arena-card--bare {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
}

.arena-card__header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

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

.arena-card__name {
    font-weight: 700;
    font-size: 1.1rem;
}

.arena-card__meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.arena-card__power {
    text-align: right;
}

.arena-card__value {
    font-size: 1.6rem;
    font-weight: 800;
}

.arena-card__stats {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.arena-card__stats--stacked {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.arena-card__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
}

.arena-card--right {
    align-items: flex-end;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-self: end;
}

.arena-card--right .arena-card__header {
    justify-content: flex-end;
    width: 100%;
}

.arena-card--right .arena-card__info {
    align-items: flex-end;
    text-align: right;
    width: 100%;
}

.arena-card--right .arena-card__stats--stacked {
    text-align: right;
    align-items: flex-end;
    justify-items: end;
    width: 100%;
}

.arena-card--right .arena-portrait {
    margin-left: auto;
}

.arena-card--right .footer-btn {
    align-self: flex-end;
}


.arena-portrait {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.arena-leaderboard-card {
    margin-bottom: 10px;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
}

.arena-leaderboard__controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.arena-leaderboard__status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.arena-chip-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.arena-chip-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.arena-chip-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.arena-leaderboard__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    padding: 0;
    margin: 0;
}

.arena-leaderboard__row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.arena-leaderboard__rank {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffd85b;
}

.arena-leaderboard__avatar-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.arena-leaderboard__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arena-leaderboard__name {
    font-weight: 700;
}

.arena-leaderboard__meta {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

.arena-leaderboard__power {
    text-align: right;
    font-weight: 800;
    font-size: 1rem;
}

.arena-leaderboard__empty {
    text-align: center;
    padding: 10px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

@media (max-width: 540px) {
    .arena-leaderboard__row {
        grid-template-columns: auto auto 1fr auto;
        gap: 6px;
    }

    .arena-leaderboard__power {
        font-size: 0.95rem;
    }
}

.arena-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 16px;
    overflow: auto;
}

.arena-profile-card {
    position: relative;
    width: min(480px, 96vw);
    background: rgba(8, 10, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.arena-profile-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.arena-profile-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.arena-profile-portrait {
    width: 78px;
    height: 78px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.arena-profile-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.arena-profile-meta {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.arena-profile-rating {
    color: #ffd85b;
    font-weight: 700;
}

.arena-profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

.arena-profile-stats div {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0;
}

.arena-profile-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.arena-log {
    min-height: 180px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.arena-replay-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.arena-replay-buttons {
    display: flex;
    gap: 6px;
}

.arena-return {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.arena-wide-pane .arena-card {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.arena-wide-pane .arena-leaderboard__row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

@media (max-width: 768px) {
    #titlesList {
        grid-template-columns: 1fr !important;
    }
}

.loading-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background: #23212f url('assets/loadingscreen.png') center/cover no-repeat;
}

.loading-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) brightness(0.9);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.loading-video.is-ready {
    opacity: 1;
}

.loading-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 10, 20, 0.7) 0%, rgba(7, 10, 20, 0.88) 65%, rgba(7, 10, 20, 0.96) 100%);
    pointer-events: none;
}

.daily-quest-milestones {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.daily-quest-milestone {
    flex: 1;
    min-width: 0;
}

.daily-quest-milestone-chest {
    width: 50px;
    height: 50px;
}


.daily-quest-milestone-connector {
    margin: 0 4px 42px 4px;
    height: 4px;
}

@media (max-width: 360px) {
    .daily-quest-milestones {
        gap: 4px;
    }

    .daily-quest-milestone-chest {
        width: 36px;
        height: 36px;
    }


    .daily-quest-milestone-connector {
        margin: 0 2px 30px 2px;
        height: 3px;
    }
}

/* Animated glowing portrait borders */
@keyframes portraitGlow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(146, 254, 157, 0.8), 0 0 10px rgba(146, 254, 157, 0.6), 0 0 14px rgba(146, 254, 157, 0.4);
        border-color: rgba(146, 254, 157, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(146, 254, 157, 1), 0 0 12px rgba(146, 254, 157, 0.8), 0 0 18px rgba(146, 254, 157, 0.6);
        border-color: rgba(146, 254, 157, 1);
    }
}

@keyframes portraitGlowPurple {
    0%, 100% {
        box-shadow: 0 0 6px rgba(147, 51, 234, 0.8), 0 0 10px rgba(147, 51, 234, 0.6), 0 0 14px rgba(147, 51, 234, 0.4);
        border-color: rgba(147, 51, 234, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(147, 51, 234, 1), 0 0 12px rgba(147, 51, 234, 0.8), 0 0 18px rgba(147, 51, 234, 0.6);
        border-color: rgba(147, 51, 234, 1);
    }
}

@keyframes portraitGlowGold {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.6), 0 0 14px rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 1), 0 0 12px rgba(255, 215, 0, 0.8), 0 0 18px rgba(255, 215, 0, 0.6);
        border-color: rgba(255, 215, 0, 1);
    }
}

@keyframes portraitGlowRed {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 69, 58, 0.8), 0 0 10px rgba(255, 69, 58, 0.6), 0 0 14px rgba(255, 69, 58, 0.4);
        border-color: rgba(255, 69, 58, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(255, 69, 58, 1), 0 0 12px rgba(255, 69, 58, 0.8), 0 0 18px rgba(255, 69, 58, 0.6);
        border-color: rgba(255, 69, 58, 1);
    }
}

@keyframes portraitGlowCyan {
    0%, 100% {
        box-shadow: 0 0 6px rgba(100, 210, 255, 0.8), 0 0 10px rgba(100, 210, 255, 0.6), 0 0 14px rgba(100, 210, 255, 0.4);
        border-color: rgba(100, 210, 255, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(100, 210, 255, 1), 0 0 12px rgba(100, 210, 255, 0.8), 0 0 18px rgba(100, 210, 255, 0.6);
        border-color: rgba(100, 210, 255, 1);
    }
}

@keyframes portraitGlowTricolorMove {
    0% {
        background-position: 0% 0%, 0% 0%;
    }
    100% {
        background-position: 0% 0%, 300% 0%;
    }
}

@keyframes portraitGlowTricolor {
    0%, 100% {
        box-shadow: 0 0 6px rgba(138, 198, 209, 0.8), 0 0 10px rgba(255, 69, 69, 0.6), 0 0 14px rgba(102, 120, 153, 0.4);
    }
    50% {
        box-shadow: 0 0 8px rgba(138, 198, 209, 1), 0 0 12px rgba(255, 69, 69, 0.8), 0 0 18px rgba(102, 120, 153, 0.6);
    }
}

@keyframes portraitGlowNatureMove {
    0% {
        background-position: 0% 0%, 0% 0%;
    }
    100% {
        background-position: 0% 0%, 300% 0%;
    }
}

@keyframes portraitGlowNeonMove {
    0% {
        background-position: 0% 0%, 0% 0%;
    }
    100% {
        background-position: 0% 0%, 300% 0%;
    }
}

@keyframes portraitGlowNature {
    0%, 100% {
        box-shadow: 0 0 6px rgba(34, 139, 34, 0.8), 0 0 10px rgba(154, 205, 50, 0.6), 0 0 14px rgba(0, 100, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 8px rgba(34, 139, 34, 1), 0 0 12px rgba(154, 205, 50, 0.8), 0 0 18px rgba(0, 100, 0, 0.6);
    }
}

@keyframes portraitGlowNeon {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 20, 147, 0.8), 0 0 10px rgba(0, 191, 255, 0.6), 0 0 14px rgba(57, 255, 20, 0.4);
    }
    50% {
        box-shadow: 0 0 8px rgba(255, 20, 147, 1), 0 0 12px rgba(0, 191, 255, 0.8), 0 0 18px rgba(57, 255, 20, 0.6);
    }
}

@keyframes portraitGlowPink {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 105, 180, 0.8), 0 0 10px rgba(255, 105, 180, 0.6), 0 0 14px rgba(255, 105, 180, 0.4);
        border-color: rgba(255, 105, 180, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(255, 105, 180, 1), 0 0 12px rgba(255, 105, 180, 0.8), 0 0 18px rgba(255, 105, 180, 0.6);
        border-color: rgba(255, 105, 180, 1);
    }
}

@keyframes portraitGlowBronze {
    0%, 100% {
        box-shadow: 0 0 6px rgba(205, 127, 50, 0.8), 0 0 10px rgba(205, 127, 50, 0.6), 0 0 14px rgba(205, 127, 50, 0.4);
        border-color: rgba(205, 127, 50, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(205, 127, 50, 1), 0 0 12px rgba(205, 127, 50, 0.8), 0 0 18px rgba(205, 127, 50, 0.6);
        border-color: rgba(205, 127, 50, 1);
    }
}

@keyframes portraitGlowSilver {
    0%, 100% {
        box-shadow: 0 0 6px rgba(192, 192, 192, 0.8), 0 0 10px rgba(192, 192, 192, 0.6), 0 0 14px rgba(192, 192, 192, 0.4);
        border-color: rgba(192, 192, 192, 0.9);
    }
    50% {
        box-shadow: 0 0 8px rgba(192, 192, 192, 1), 0 0 12px rgba(192, 192, 192, 0.8), 0 0 18px rgba(192, 192, 192, 0.6);
        border-color: rgba(192, 192, 192, 1);
    }
}

@keyframes premiumHeaderShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Portrait border - default */
.default {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Apply animated glow classes */
.portrait-glow-green {
    box-shadow: inset 0 0 0 3px rgba(146, 254, 157, 1), 0 0 15px rgba(146, 254, 157, 0.8);
}

.portrait-glow-purple {
    box-shadow: inset 0 0 0 3px rgba(147, 51, 234, 1), 0 0 15px rgba(147, 51, 234, 0.8);
}

.portrait-glow-gold {
    box-shadow: inset 0 0 0 3px rgba(255, 215, 0, 1), 0 0 15px rgba(255, 215, 0, 0.8);
}

.portrait-glow-red {
    box-shadow: inset 0 0 0 3px rgba(255, 69, 58, 1), 0 0 15px rgba(255, 69, 58, 0.8);
}

.portrait-glow-cyan {
    box-shadow: inset 0 0 0 3px rgba(100, 210, 255, 1), 0 0 15px rgba(100, 210, 255, 0.8);
}

.portrait-glow-tricolor {
    position: relative;
    border: 3px solid transparent;
    background:
        linear-gradient(#1a1d29, #1a1d29) padding-box,
        linear-gradient(90deg, #8AC6D1, #FF4545, #667899, #8AC6D1, #8AC6D1) border-box;
    background-size: 100% 100%, 300% 300%;
    animation: portraitGlowTricolorMove 3s linear infinite;
}


.portrait-glow-pink {
    box-shadow: inset 0 0 0 3px rgba(255, 105, 180, 1), 0 0 15px rgba(255, 105, 180, 0.8);
}

.portrait-glow-bronze {
    box-shadow: inset 0 0 0 3px rgba(205, 127, 50, 1), 0 0 15px rgba(205, 127, 50, 0.8);
}

.portrait-glow-silver {
    box-shadow: inset 0 0 0 3px rgba(192, 192, 192, 1), 0 0 15px rgba(192, 192, 192, 0.8);
}

.portrait-glow-nature {
    position: relative;
    border: 3px solid transparent;
    background:
        linear-gradient(#1a1d29, #1a1d29) padding-box,
        linear-gradient(90deg, #228B22, #9ACD32, #006400, #228B22, #228B22) border-box;
    background-size: 100% 100%, 300% 300%;
    animation: portraitGlowNatureMove 3s linear infinite;
}

.portrait-glow-neon {
    position: relative;
    border: 3px solid transparent;
    background:
        linear-gradient(#1a1d29, #1a1d29) padding-box,
        linear-gradient(90deg, #FF1493, #00BFFF, #39FF14, #FF1493, #FF1493) border-box;
    background-size: 100% 100%, 300% 300%;
    animation: portraitGlowNeonMove 3s linear infinite;
}

/* Disable pulse animations when no-pulse class is applied */
.no-pulse.portrait-glow-green,
.no-pulse.portrait-glow-purple,
.no-pulse.portrait-glow-gold,
.no-pulse.portrait-glow-red,
.no-pulse.portrait-glow-cyan,
.no-pulse.portrait-glow-pink,
.no-pulse.portrait-glow-bronze,
.no-pulse.portrait-glow-silver {
    animation: none !important;
}

.no-pulse.portrait-glow-tricolor {
    animation: portraitGlowTricolorMove 3s linear infinite !important;
}

.no-pulse.portrait-glow-nature {
    animation: portraitGlowNatureMove 3s linear infinite !important;
}

.no-pulse.portrait-glow-neon {
    animation: portraitGlowNeonMove 3s linear infinite !important;
}

.premium-gradient-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.premium-gradient-group {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

.premium-gradient-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
}

.premium-gradient-item.selected {
    border-color: rgba(255, 255, 255, 0.45);
}

.premium-gradient-swatch {
    width: 48px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Portrait Border Shop Styles */
.portrait-border-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.portrait-border-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.portrait-border-card.equipped {
    border-color: #92fe9d;
    background: rgba(146, 254, 157, 0.1);
}

.portrait-border-card.locked {
    opacity: 0.7;
}

.portrait-border-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.portrait-border-info {
    flex: 1;
}

.portrait-border-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f1ff;
    margin-bottom: 4px;
}

.portrait-border-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.portrait-border-cost {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 8px;
}

.portrait-border-actions {
    display: flex;
    gap: 8px;
}

.portrait-border-actions .modal-btn {
    flex: 1;
}

.portrait-border-actions .modal-btn.equipped {
    background: rgba(146, 254, 157, 0.2);
    color: #92fe9d;
    cursor: default;
}

.portrait-border-actions .modal-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Swipe Indicator Animation */
@keyframes chatSwipeWave {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-8px);
        opacity: 1;
    }
}

#chatSwipeIndicator {
    animation: chatSwipeWave 2s ease-in-out infinite;
}

/* Native app - Android: zero out safe-area since status bar is hidden */
body.native-app.native-android .header {
    padding-top: 12px;
}
body.native-app.native-android .hero-card {
    top: 24px;
}

/* ─── Combat Map ─── */
.combat-map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 100;
    touch-action: none;
    overscroll-behavior: none;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(79,172,254,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(255,77,109,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 25% 75%, rgba(255,216,91,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 80%, rgba(167,139,250,0.05) 0%, transparent 45%),
        #0a0913;
}

.growth-map {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,216,91,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(79,172,254,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 25% 70%, rgba(255,150,113,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 80%, rgba(81,207,102,0.05) 0%, transparent 45%),
        #0a0913;
}
.hub-map {
    background:
        radial-gradient(ellipse at 25% 20%, rgba(255,216,91,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 35%, rgba(79,172,254,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 60%, rgba(81,207,102,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 80%, rgba(167,139,250,0.06) 0%, transparent 45%),
        #0a0913;
}
body.true-dark .combat-map {
    background: #000000;
}
body.dark-plus .combat-map {
    background:
        radial-gradient(ellipse at 25% 25%, rgba(79,172,254,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(255,77,109,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 25% 75%, rgba(255,216,91,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 80%, rgba(167,139,250,0.05) 0%, transparent 45%),
        #0a0913;
}
body.dark-plus .growth-map {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,216,91,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(79,172,254,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 25% 70%, rgba(255,150,113,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 80%, rgba(81,207,102,0.05) 0%, transparent 45%),
        #0a0913;
}
body.dark-plus .hub-map {
    background:
        radial-gradient(ellipse at 25% 20%, rgba(255,216,91,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 35%, rgba(79,172,254,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 60%, rgba(81,207,102,0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 80%, rgba(167,139,250,0.06) 0%, transparent 45%),
        #0a0913;
}
#changelogBody { font-size: 13px; }
#changelogBody h1 { font-size: 1.15em; margin: 14px 0 6px; color: #fff; }
#changelogBody h2 { font-size: 1em; margin: 12px 0 4px; color: rgba(255,255,255,0.9); border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 3px; }
#changelogBody h3 { font-size: 0.9em; margin: 10px 0 3px; color: rgba(255,255,255,0.8); }
#changelogBody ul { padding-left: 16px; margin: 4px 0; }
#changelogBody li { margin: 3px 0; color: rgba(255,255,255,0.75); }
#changelogBody p { margin: 4px 0; color: rgba(255,255,255,0.7); }

.changelog-bubble {
    position: fixed;
    bottom: calc(52px + env(safe-area-inset-bottom));
    right: 8px;
    background: #ff4d6d;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    animation: bubbleBounce 2s ease-in-out infinite;
    z-index: 1000;
}
.changelog-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 16px;
    border: 5px solid transparent;
    border-top-color: #ff4d6d;
}
@keyframes bubbleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

