
[hidden] {
    display: none !important;
}


.account-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 5%;
}

.account-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

.account-grid--guest {
    grid-template-columns: minmax(0, 1fr);
}

.account-grid--guest .account-sidebar {
    display: none;
}

.account-sidebar {
    background: var(--shop-surface-gradient, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)));
    border: 1px solid var(--shop-surface-border, #e5e7eb);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 120px;
    z-index: 10;
}

.user-profile {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 24px;
}

.user-avatar-shell {
    --avatar-size: 80px;
    --avatar-frame-size: 112px;
    --shop-frame-accent: transparent;
    --shop-frame-gradient: linear-gradient(135deg, transparent, transparent);
    --shop-frame-width: 0px;
    --shop-effect-glow: transparent;
    --shop-effect-shadow: transparent;
    --shop-effect-blur: 0px;
    --shop-effect-animation: none;
    width: fit-content;
    margin: 0 auto 16px;
    position: relative;
    isolation: isolate;
}

.user-avatar-shell::before {
    content: "";
    position: absolute;
    inset: -16px;
    border-radius: 999px;
    background: radial-gradient(circle at center, var(--shop-effect-glow) 0%, transparent 68%);
    filter: blur(var(--shop-effect-blur));
    animation: var(--shop-effect-animation);
    z-index: 0;
    pointer-events: none;
}

.user-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    background: #111827;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    z-index: 2;
    box-shadow:
        0 0 0 var(--shop-frame-width) var(--shop-frame-accent),
        0 0 0 calc(var(--shop-frame-width) * 2) rgba(255, 255, 255, 0.78),
        0 0 20px var(--shop-effect-glow),
        0 14px 28px rgba(15, 23, 42, 0.16);
}

.user-avatar.has-photo {
    background: #e2e8f0;
    color: transparent;
}

.user-avatar img,
.user-avatar video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-shell > .shop-frame-media-layer {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--avatar-frame-size);
    height: var(--avatar-frame-size);
    transform: translate(-50%, -50%);
    object-fit: cover;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
}

.avatar-badge-marker {
    position: absolute;
    left: -4px;
    bottom: -4px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 3px solid #ffffff;
    background: var(--badge-surface, #fffbeb);
    color: var(--badge-accent, #b45309);
    box-shadow:
        0 10px 22px var(--badge-shadow, rgba(180, 83, 9, 0.22)),
        0 0 0 0 var(--badge-glow, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.avatar-badge-marker svg {
    width: 14px;
    height: 14px;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #111827;
}

.user-email {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.sidebar-badge-cta {
    margin-top: 14px;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--badge-ring, #fcd34d);
    border-radius: 14px;
    background: var(--badge-surface, #fffbeb);
    color: var(--badge-accent, #b45309);
    box-shadow:
        0 12px 26px var(--badge-shadow, rgba(180, 83, 9, 0.16)),
        0 0 0 0 var(--badge-glow, transparent);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
}

.sidebar-badge-cta:hover {
    transform: translateY(-1px);
}

.sidebar-badge-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-badge-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sidebar-badge-copy strong {
    font-size: 13px;
    color: #111827;
    white-space: normal;
    overflow-wrap: anywhere;
}

.sidebar-badge-copy span {
    font-size: 12px;
    color: #6b7280;
}

.membership-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    color: #b45309;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: #f9fafb;
    color: #111827;
}

.sidebar-nav a.active {
    background: #111827;
    color: white;
}

.account-content {
    background: var(--shop-surface-gradient, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)));
    border: 1px solid var(--shop-surface-border, #e5e7eb);
    color: var(--shop-accent-color, #111827);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 500px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.account-content > * {
    position: relative;
    z-index: 1;
}

.account-content .shop-background-media-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.overview-guest-panel {
    margin-bottom: 32px;
    padding: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
}

.overview-guest-kicker {
    margin: 0 0 10px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-guest-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1.1;
}

.overview-guest-copy {
    margin: 14px 0 0;
    max-width: 760px;
    color: #475569;
    line-height: 1.75;
}

.overview-guest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.overview-guest-primary,
.overview-guest-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
}

.overview-guest-primary {
    background: #111827;
    color: #ffffff;
}

.overview-guest-secondary {
    border: 1px solid #cbd5e1;
    color: #0f172a;
    background: #ffffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    min-width: 0;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    color: #111827;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.stat-icon-image {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.challenge-reward-reveal-card {
    margin: 0 0 28px;
    padding: 22px;
    border-radius: 20px;
    border: 1px solid #fde68a;
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 34%),
        linear-gradient(180deg, #fffdf5 0%, #fff7ed 100%);
    box-shadow: 0 18px 36px rgba(217, 119, 6, 0.08);
}

.challenge-reward-reveal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.challenge-reward-reveal-kicker {
    margin: 0 0 6px 0;
    color: #b45309;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.challenge-reward-reveal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.challenge-reward-reveal-copy {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    max-width: 56ch;
}

.challenge-reward-reveal-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(255, 255, 255, 0.82);
    color: #b45309;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.challenge-reward-reveal-stage {
    position: relative;
    min-height: 250px;
    display: grid;
    place-items: center;
}

.challenge-reward-gift-box {
    width: 178px;
    height: 152px;
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.28s ease;
}

.challenge-reward-gift-box:hover {
    transform: translateY(-3px) scale(1.02);
}

.challenge-reward-gift-body,
.challenge-reward-gift-lid,
.challenge-reward-gift-ribbon,
.challenge-reward-gift-bow,
.challenge-reward-gift-spark {
    position: absolute;
}

.challenge-reward-gift-body {
    left: 28px;
    right: 28px;
    bottom: 18px;
    height: 96px;
    border-radius: 20px;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    box-shadow:
        0 16px 28px rgba(194, 65, 12, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.challenge-reward-gift-lid {
    left: 16px;
    right: 16px;
    top: 16px;
    height: 48px;
    border-radius: 18px;
    transform-origin: 50% 88%;
    background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
    box-shadow:
        0 10px 18px rgba(194, 65, 12, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.challenge-reward-gift-ribbon {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.challenge-reward-gift-ribbon-v {
    top: 16px;
    bottom: 18px;
    left: 50%;
    width: 18px;
    transform: translateX(-50%);
    border-radius: 999px;
}

.challenge-reward-gift-ribbon-h {
    left: 28px;
    right: 28px;
    top: 54px;
    height: 18px;
    border-radius: 999px;
}

.challenge-reward-gift-bow {
    left: 50%;
    top: -2px;
    width: 56px;
    height: 30px;
    transform: translateX(-50%);
}

.challenge-reward-gift-bow::before,
.challenge-reward-gift-bow::after {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 24px;
    border: 8px solid #fde68a;
    border-radius: 999px 999px 999px 0;
    box-sizing: border-box;
}

.challenge-reward-gift-bow::before {
    left: 0;
    transform: rotate(-28deg);
}

.challenge-reward-gift-bow::after {
    right: 0;
    border-radius: 999px 999px 0 999px;
    transform: rotate(28deg);
}

.challenge-reward-gift-spark {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.82);
    opacity: 0;
}

.challenge-reward-gift-spark.spark-a {
    top: 18px;
    left: 18px;
}

.challenge-reward-gift-spark.spark-b {
    top: 6px;
    right: 34px;
}

.challenge-reward-gift-spark.spark-c {
    right: 8px;
    bottom: 54px;
}

.challenge-reward-reveal-content {
    width: 100%;
    max-width: 760px;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.challenge-reward-reveal-stage[data-state="opening"] .challenge-reward-gift-lid {
    animation: challengeRewardGiftLidOpen 0.95s cubic-bezier(0.2, 0.9, 0.22, 1) forwards;
}

.challenge-reward-reveal-stage[data-state="opening"] .challenge-reward-gift-spark {
    animation: challengeRewardGiftSpark 0.9s ease-out forwards;
}

.challenge-reward-reveal-stage[data-state="open"] .challenge-reward-gift-box {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
    pointer-events: none;
}

.challenge-reward-reveal-stage[data-state="open"] .challenge-reward-reveal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.challenge-reward-summary {
    border: 1px solid rgba(251, 191, 36, 0.26);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    padding: 20px;
    box-shadow: 0 18px 32px rgba(148, 64, 0, 0.08);
}

.challenge-reward-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.challenge-reward-summary-kicker {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c2410c;
}

.challenge-reward-summary-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.challenge-reward-summary-date {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #fde68a;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 800;
}

.challenge-reward-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.challenge-reward-item {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #f3f4f6;
    background: #ffffff;
}

.challenge-reward-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #111827;
    overflow: hidden;
}

.challenge-reward-item-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.challenge-reward-item-icon svg {
    width: 22px;
    height: 22px;
}

.challenge-reward-item-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.challenge-reward-item-copy strong {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.challenge-reward-item-copy span {
    font-size: 13px;
    line-height: 1.45;
    color: #6b7280;
}

.challenge-reward-item[data-reward-kind="xp"] .challenge-reward-item-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.challenge-reward-item[data-reward-kind="evcoin"] .challenge-reward-item-icon {
    background: #ffedd5;
    color: #c2410c;
}

.challenge-reward-item[data-reward-kind="badge"] .challenge-reward-item-icon {
    background: var(--badge-surface, #fffbeb);
    color: var(--badge-accent, #b45309);
    border: 1px solid var(--badge-ring, #fcd34d);
    box-shadow:
        0 12px 22px var(--badge-shadow, rgba(180, 83, 9, 0.12)),
        0 0 0 0 var(--badge-glow, transparent);
}

.challenge-reward-item[data-reward-kind="badge"] .challenge-reward-item-icon[data-badge-effect="mythic"] {
    animation: badgeMythicPulse 2.8s ease-in-out infinite;
}

.challenge-reward-reveal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

@keyframes challengeRewardGiftLidOpen {
    0% {
        transform: rotate(0deg) translateY(0);
    }
    55% {
        transform: rotate(-18deg) translateY(-6px);
    }
    100% {
        transform: rotate(-34deg) translateY(-20px);
    }
}

@keyframes challengeRewardGiftSpark {
    0% {
        opacity: 0;
        transform: scale(0.2) translateY(0);
    }
    40% {
        opacity: 1;
        transform: scale(1) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.2) translateY(-26px);
    }
}

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

.info-item {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.info-subvalue {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.form-group-account {
    margin-bottom: 20px;
}

.form-group-account label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.form-group-account input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.contact-email-card {
    margin-top: 24px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.contact-email-head {
    margin-bottom: 16px;
}

.contact-email-kicker {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.contact-email-title {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.contact-email-copy {
    margin: 8px 0 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
}

.contact-email-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.contact-email-summary {
    display: grid;
    gap: 6px;
}

.contact-email-summary-label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.contact-email-summary-value {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.contact-email-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-email-toolbar-actions button[hidden],
#contactEmailAccountEditWrap[hidden],
.contact-email-verify-panel[hidden] {
    display: none !important;
}

.contact-email-verify-panel {
    margin-top: 8px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.contact-email-verify-note {
    margin: 0 0 14px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #1d4ed8;
}

.contact-email-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.contact-email-code-group {
    margin-bottom: 0;
}

.contact-email-status {
    margin: 12px 2px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.contact-email-status[data-tone="success"] {
    color: #047857;
}

.contact-email-status[data-tone="error"] {
    color: #b91c1c;
}

.contact-email-status[data-tone="info"] {
    color: #1d4ed8;
}

.edit-btn,
.save-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.edit-btn {
    background: #1f2937;
    color: white;
    transition: background 0.3s;
}

.edit-btn:hover {
    background: #111827;
}

.save-btn {
    background: #1f2937;
    color: white;
    transition: background 0.3s;
}

.save-btn:hover {
    background: #111827;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #9ca3af;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111827;
}

.empty-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.notification-settings-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.notification-permission-row,
.notification-pref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
}

.notification-permission-row {
    padding-top: 0;
    border-bottom: 1px solid #e5e7eb;
}

.notification-pref-row + .notification-pref-row,
.notification-inline-field + .notification-pref-row {
    border-top: 1px solid #e5e7eb;
}

.notification-permission-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notification-pref-title {
    margin: 0 0 4px 0;
    color: #111827;
    font-weight: 700;
    font-size: 14px;
}

.notification-pref-copy,
#notificationSettingsHint {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

.notification-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-toggle input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.notification-inline-field {
    display: grid;
    gap: 10px;
    padding: 14px 0;
}

.notification-inline-field label {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.notification-inline-field select {
    width: min(220px, 100%);
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    background: #fff;
}

.notification-inline-field select:disabled,
.notification-toggle input:disabled,
.notification-permission-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.badge-collection-card {
    margin-top: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.badge-collection-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.badge-collection-kicker {
    margin: 0 0 6px 0;
    color: #b45309;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-collection-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.badge-collection-copy {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    max-width: 62ch;
}

.equipped-badge-panel {
    min-height: 126px;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    padding: 18px;
}

.equipped-badge-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.equipped-badge-visual,
.badge-card-visual {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 1px solid var(--badge-ring, #fcd34d);
    background: var(--badge-surface, #fffbeb);
    color: var(--badge-accent, #b45309);
    box-shadow:
        0 12px 26px var(--badge-shadow, rgba(180, 83, 9, 0.16)),
        0 0 0 0 var(--badge-glow, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.equipped-badge-visual svg,
.badge-card-visual svg {
    width: 24px;
    height: 24px;
}

.equipped-badge-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.equipped-badge-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 800;
}

.equipped-badge-name {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    line-height: 1.15;
}

.equipped-badge-copy p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.equipped-badge-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge-link-btn,
.badge-action-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.badge-action-btn.primary {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.badge-action-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

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

.badge-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
    display: grid;
    gap: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.badge-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.badge-card.is-equipped {
    border-color: var(--badge-ring, #fcd34d);
    box-shadow: 0 16px 32px var(--badge-shadow, rgba(180, 83, 9, 0.12));
}

.avatar-badge-marker[data-badge-effect="mythic"],
.sidebar-badge-cta[data-badge-effect="mythic"],
.equipped-badge-visual[data-badge-effect="mythic"],
.badge-card-visual[data-badge-effect="mythic"] {
    box-shadow:
        0 12px 26px var(--badge-shadow, rgba(220, 38, 38, 0.34)),
        0 0 22px var(--badge-glow, rgba(251, 113, 133, 0.34));
    animation: badgeMythicPulse 2.8s ease-in-out infinite;
}

.badge-card[data-badge-effect="mythic"].is-equipped {
    box-shadow:
        0 16px 32px var(--badge-shadow, rgba(220, 38, 38, 0.28)),
        0 0 24px var(--badge-glow, rgba(251, 113, 133, 0.3));
}

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

.badge-state-pill,
.badge-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}

.badge-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.badge-card-copy {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.badge-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.compact-empty-state {
    padding: 28px 18px;
}

.hidden {
    display: none !important;
}

@keyframes shopAuraPulse {
    0%,
    100% {
        transform: scale(0.96);
        opacity: 0.72;
    }
    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

@keyframes shopAuraFloat {
    0%,
    100% {
        transform: translateY(0px);
        opacity: 0.78;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.avatar-edit-button {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 38px;
    height: 38px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px) scale(0.94);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    pointer-events: none;
    z-index: 4;
}

.avatar-edit-button:hover {
    background: #0f172a;
}

.avatar-edit-button:focus-visible,
.user-avatar-shell:hover .avatar-edit-button,
.user-avatar-shell:focus-within .avatar-edit-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.avatar-edit-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    pointer-events: none;
}

.avatar-edit-button.is-busy {
    background: #374151;
}

.avatar-edit-button.is-busy i {
    opacity: 0;
}

.avatar-edit-button.is-busy::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #ffffff;
    animation: avatarSpin 0.75s linear infinite;
}

.avatar-edit-button svg {
    width: 17px;
    height: 17px;
}

.avatar-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.user-details-compact {
    min-width: 0;
    flex: 1 1 0;
    display: grid;
    gap: 6px;
}

.avatar-upload-help {
    margin: 10px 0 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

.avatar-upload-help[data-state="info"] {
    color: #1d4ed8;
}

.avatar-upload-help[data-state="success"] {
    color: #047857;
}

.avatar-upload-help[data-state="error"] {
    color: #b91c1c;
}

.avatar-upload-help[data-state="muted"] {
    color: #6b7280;
}

@keyframes badgeMythicPulse {
    0%,
    100% {
        box-shadow:
            0 12px 26px var(--badge-shadow, rgba(220, 38, 38, 0.34)),
            0 0 18px var(--badge-glow, rgba(251, 113, 133, 0.34));
    }
    50% {
        box-shadow:
            0 12px 28px var(--badge-shadow, rgba(220, 38, 38, 0.38)),
            0 0 28px var(--badge-glow, rgba(251, 113, 133, 0.42));
    }
}

@keyframes avatarSpin {
    to {
        transform: rotate(360deg);
    }
}


@media (max-width: 920px) {
    .nav-link span,
    .nav-a span {
        display: none !important;
    }
    
    .sidebar-nav a,
    .nav-bottom a {
        justify-content: center;
    }
    
    .account-container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .account-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        width: 100%;
    }
    
    .account-sidebar {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 20px 20px 0 20px;
        position: static;
        z-index: 1;
        box-sizing: border-box;
    }
    
    .user-profile {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 16px;
        text-align: left;
        padding-bottom: 20px;
        border: none;
        margin-bottom: 0;
    }
    
    .user-avatar {
        margin: 0;
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .user-avatar-shell {
        --avatar-size: 64px;
        --avatar-frame-size: 92px;
        margin: 0;
    }

    .avatar-badge-marker {
        width: 28px;
        height: 28px;
    }

    .avatar-edit-button {
        width: 34px;
        height: 34px;
    }

    .membership-badge {
        margin-top: 4px;
    }

    .user-details-compact {
        width: calc(100% - 80px);
    }

    .sidebar-badge-cta {
        width: 100%;
        justify-self: stretch;
    }

    .contact-email-toolbar {
        align-items: stretch;
    }

    .contact-email-toolbar-actions {
        width: 100%;
    }

    .contact-email-toolbar-actions button {
        flex: 1 1 180px;
        justify-content: center;
    }

    .contact-email-actions {
        grid-template-columns: 1fr;
    }

    .challenge-reward-reveal-card {
        padding: 18px;
    }

    .challenge-reward-reveal-head,
    .challenge-reward-summary-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .challenge-reward-reveal-stage {
        min-height: 220px;
    }

    .challenge-reward-gift-box {
        width: 160px;
        height: 138px;
    }

    .challenge-reward-items {
        grid-template-columns: 1fr;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        justify-content: space-between;
        gap: 0;
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid transparent;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-nav a {
        background: transparent !important;
        color: #6b7280;
        border-radius: 0;
        padding: 12px 0;
        width: 25%;
        display: flex;
        justify-content: center;
        border: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        font-size: 15px;
    }
    
    .sidebar-nav a.active {
        color: #111827;
        border-bottom: 2px solid #111827;
        font-weight: 600;
    }
    
    .account-content {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 24px 20px;
        border: none;
        min-height: auto;
        box-sizing: border-box;
    }
    
    .section-header {
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 20px;
    }

    .overview-guest-panel {
        margin-bottom: 24px;
        padding: 22px 18px;
        border-radius: 20px;
    }

    .overview-guest-title {
        font-size: clamp(24px, 7vw, 32px);
    }

    .overview-guest-copy {
        line-height: 1.65;
    }

    .stats-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(136px, 1fr);
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-bottom: 32px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .stats-grid::-webkit-scrollbar {
        display: none;
    }

    .stats-grid .stat-card {
        scroll-snap-align: start;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }

    .equipped-badge-shell {
        grid-template-columns: 1fr;
    }

    .equipped-badge-actions {
        justify-content: flex-start;
    }

    .notification-permission-row,
    .notification-pref-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-permission-actions {
        width: 100%;
        justify-content: stretch;
    }

    .notification-permission-actions button {
        flex: 1 1 180px;
        justify-content: center;
    }
}

@media (hover: none) {
    .avatar-edit-button {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}



.history-card{
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    background: #ffffff;
}

.history-top{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.history-title{
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.history-subtitle{
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
}

.history-controls{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-select{
    appearance: none;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    color: #111827;
    cursor: pointer;
}

.history-refresh{
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 13px;
    color: #111827;
}

.history-refresh:hover{
    background: #f9fafb;
}

.history-clear{
    padding: 10px 12px;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    background: #fff1f2;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 13px;
    color: #be123c;
}

.history-clear:hover{
    background: #ffe4e6;
}

.history-select:disabled,
.history-refresh:disabled,
.history-clear:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

.history-list{
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-row{
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #f3f4f6;
    border-radius: 14px;
    background: #fff;
}

.history-icon{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
}

.history-main{
    min-width: 0;
}

.history-name{
    margin: 0;
    font-weight: 800;
    font-size: 14px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta{
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-pill{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}

.history-right{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.history-score{
    font-size: 14px;
    font-weight: 900;
    color: #111827;
}

.history-time{
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

@media (max-width: 520px){
    .user-profile {
        gap: 12px;
    }

    .user-details-compact {
        width: calc(100% - 76px);
    }

    .history-row{
        grid-template-columns: 44px 1fr;
        grid-auto-rows: auto;
    }
    .history-right{
        grid-column: 1 / -1;
        align-items: flex-start;
        padding-left: 56px;
    }

    .badge-collection-card {
        padding: 18px;
    }

    .sidebar-badge-cta {
        max-width: 100%;
        padding: 10px 11px;
        gap: 8px;
    }

    .sidebar-badge-icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .sidebar-badge-copy strong {
        font-size: 12.5px;
    }

    .sidebar-badge-copy span {
        font-size: 11px;
    }

    .badge-card {
        padding: 14px;
    }
}
