﻿/*
  ECHO 回聲 v3 — Kid RPG Game UI
  Enhanced: idle anims, battle FX, lucky wheel, Google auth
*/
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Noto+Sans+TC:wght@500;700;900&display=swap');

:root {
    /* Soft, elegant Indigo/Royal Blue theme */
    --bg: #F4F6FC;
    --bg2: #FFFFFF;
    --bg3: #E8EDF8;
    --surface: #FFFFFF;
    --surface2: rgba(255, 255, 255, 0.95);
    --border: #E2E8F0;
    --glow: rgba(99, 102, 241, 0.15);
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --secondary: #00B1D2;
    --pink: #F472B6;
    --green: #10B981;
    --red: #FF4D4F;
    --orange: #F59E0B;
    --text: #1E293B;
    --text2: #64748B;
    --text3: #94A3B8;
    --radius: 20px;
    --radius-sm: 12px;
    --font: 'Nunito', 'PingFang TC', 'Noto Sans TC', sans-serif;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent
}

html,
body {
    height: 100%;
    overflow: hidden
}

body {
    font-family: var(--font);
    background: #E2E8F0;
    /* Darker backdrop */
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

#app {
    width: 100%;
    max-width: 480px;
    height: 100%;
    position: relative;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    z-index: 1;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    color: inherit
}

input,
textarea,
select {
    font-family: var(--font);
    background: var(--bg2);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    width: 100%;
    font-weight: 700
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(255, 215, 0, .3)
}

textarea {
    resize: vertical;
    min-height: 70px
}

select {
    appearance: none
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(99, 102, 241, .1), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(99, 102, 241, .05), transparent),
        radial-gradient(2px 2px at 80% 20%, rgba(245, 158, 11, .1), transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px;
    z-index: 0;
    pointer-events: none
}

/* SCREENS */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .25s;
    z-index: 1;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: calc(80px + var(--safe-b))
}

.screen.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    z-index: 0
}

/* TOPBAR - UI/UX Refined */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    min-height: 56px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.topbar h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    margin: 0;
    line-height: 1.2;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Ensure left content (like back buttons) exist in flex space even if empty */
.topbar::before {
    content: '';
    display: block;
    width: 40px;
    /* balances the right icon area */
}

/* Remove default before if there is an actual button on the left */
.topbar:has(> .icon-btn:first-child)::before {
    display: none;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 50%;
    background: transparent;
    color: var(--text2);
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.04);
    transform: scale(0.92);
    color: var(--text);
}

/* BOTTOM NAV */
.bottomnav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.05);
    padding: 8px 16px calc(8px + var(--safe-b));
    z-index: 50;
    justify-content: space-between;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 800;
    color: var(--text3);
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: .5px;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-btn i {
    font-size: 24px;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.nav-btn span {
    position: relative;
    z-index: 2;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) scale(0);
    width: 48px;
    height: 32px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 1;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn.active::before {
    transform: translate(-50%, -70%) scale(1);
    opacity: 1;
}

.nav-btn.active i {
    transform: translateY(-8px) scale(1.15);
    color: var(--primary);
}

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

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: .5px;
    color: var(--text);
}

.btn:active {
    transform: scale(.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    border: none;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

.btn-primary:active {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text2);
    box-shadow: none;
}

.btn-magic {
    background: linear-gradient(135deg, #F472B6, #FB7185);
    color: white;
    border: none;
    box-shadow: 0 6px 16px rgba(244, 114, 182, 0.25);
}

.btn-green {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
    border: none;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm)
}

.btn-block {
    width: 100%
}

.btn-google {
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    font-weight: 800
}

.btn-google img,
.btn-google svg {
    width: 20px;
    height: 20px
}

/* CARDS */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.card:active {
    transform: scale(.985)
}

.card+.card {
    margin-top: 12px
}

/* Override card spacing inside grid layouts (rewards grid, etc.) */
[style*="display:grid"]>.card+.card,
[style*="display: grid"]>.card+.card {
    margin-top: 0
}

/* TASK CARD */
.task-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.task-card:active {
    transform: scale(.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    opacity: 1;
}

.task-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    margin-bottom: 6px
}

.task-card h3 {
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.task-card .task-desc {
    font-size: 14px;
    color: var(--text2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    line-height: 1.6;
}

.task-meta {
    font-size: 12px;
    color: var(--text3);
    display: flex;
    gap: 12px;
    margin-top: 12px;
    font-weight: 700;
    align-items: center;
}

.task-meta-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.reward-chip {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 3px
}

.task-publisher {
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}

.status-badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.status-published {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-claimed {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.status-completed_pending_confirm {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-completed_confirmed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* HOME PROFILE HEADER */
.home-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.home-avatar {
    width: 56px;
    height: 56px;
    background: rgba(99, 102, 241, 0.05);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.char-dialogue-bubble {
    position: absolute;
    top: -24px;
    left: 80px;
    background: #ffffff;
    border: 2px solid var(--border);
    padding: 8px 12px;
    border-radius: 16px 16px 16px 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 200px;
    z-index: 10;
}

.home-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.home-greeting {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.home-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.home-stat-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    background: var(--bg);
    border: 1px solid var(--border);
    width: 100%;
    color: var(--text2);
}

.home-stat-badge.level {
    color: var(--secondary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.home-stat-badge.points {
    color: var(--primary);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* XP BAR */
.xp-section {
    margin: -1px 0 20px;
    padding: 24px 20px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 24px 24px;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.02);
}

.xp-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    color: var(--text);
}

.xp-header .xp-lvl {
    color: var(--primary);
    font-size: 14px;
    font-weight: 900;
}

.xp-track {
    height: 14px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #F472B6, var(--primary));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* CUSTOM AVATAR ANIMATIONS */
.avatar-animated {
    animation: avatarIdle 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-animated.talking {
    animation: avatarTalk 0.5s ease-in-out infinite !important;
}

@keyframes avatarIdle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

@keyframes avatarTalk {

    0%,
    100% {
        transform: scale(1) translateY(-8px);
    }

    50% {
        transform: scale(1.05) translateY(-12px);
    }
}

.char-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
    border: 3px solid rgba(255, 255, 255, .2);
}

.char-avatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--pink), var(--primary)) border-box;
    mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ringRotate 4s linear infinite;
    opacity: 0
}

.char-option.selected .char-avatar::after {
    opacity: 1
}

/* Character IDLE animation — subtle breathing+bob */
@keyframes charIdle {

    0%,
    100% {
        transform: scale(1) translateY(0)
    }

    30% {
        transform: scale(1.03) translateY(-2px)
    }

    60% {
        transform: scale(0.98) translateY(1px)
    }
}

@keyframes ringRotate {
    100% {
        transform: rotate(360deg)
    }
}

/* Per-class avatar gradients */
.char-avatar.class-warrior {
    background: linear-gradient(135deg, #B8860B, #FF6B00, #DAA520)
}

.char-avatar.class-mage {
    background: linear-gradient(135deg, #7C5CFC, #4A1A8A, #9B59B6)
}

.char-avatar.class-ranger {
    background: linear-gradient(135deg, #228B22, #00C853, #2E7D32)
}

.char-avatar.class-healer {
    background: linear-gradient(135deg, #FF69B4, #4CAF50, #00BFA5)
}

.char-avatar.class-ninja {
    background: linear-gradient(135deg, #1a237e, #0d47a1, #263238)
}

.char-avatar.class-dragon {
    background: linear-gradient(135deg, #FF6B00, #D50000, #FF9800)
}

.char-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover
}

.char-option .char-name {
    font-size: 13px;
    font-weight: 900;
    color: var(--text)
}

.char-option .char-class {
    font-size: 10px;
    color: var(--secondary);
    font-weight: 800
}

/* CHARACTER PROFILE REDESIGN */
.char-profile {
    text-align: center;
    padding: 32px 16px;
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    border-bottom: 1px solid var(--border);
}

.char-profile-avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
}

.char-profile-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.char-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* v1.001 Consolidated Avatar Edit Badge */
.avatar-edit-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.char-profile-avatar-container:active .avatar-edit-badge {
    transform: scale(0.9) rotate(5deg);
}

.char-profile-avatar .char-big {
    font-size: 80px;
}

/* v1.001 Consolidated Avatar Edit Badge */
.avatar-edit-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.char-profile-avatar-container:active .avatar-edit-badge {
    transform: scale(0.9) rotate(5deg);
}

.avatar-edit-badge i {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Dual-Neon Glow Ring */
.avatar-neon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from var(--angle), var(--primary), #a855f7, #ec4899, #f43f5e, var(--primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateRing 4s linear infinite;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateRing {
    to {
        --angle: 360deg;
    }
}

.avatar-neon-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(from var(--angle), var(--primary), #a855f7, #ec4899, #f43f5e, var(--primary));
    filter: blur(15px);
    opacity: 0.4;
    animation: rotateRing 4s linear infinite;
    z-index: 1;
}

/* Sparkle particles for idle */
.sparkle-container {
    position: absolute;
    inset: -15px;
    pointer-events: none
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    animation: sparkleFloat 2.5s ease-in-out infinite;
    opacity: 0
}

.sparkle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s
}

.sparkle:nth-child(2) {
    left: 80%;
    top: 15%;
    animation-delay: .5s
}

.sparkle:nth-child(3) {
    left: 85%;
    top: 70%;
    animation-delay: 1s
}

.sparkle:nth-child(4) {
    left: 15%;
    top: 75%;
    animation-delay: 1.5s
}

.sparkle:nth-child(5) {
    left: 50%;
    top: 5%;
    animation-delay: 2s
}

@keyframes sparkleFloat {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(0)
    }

    50% {
        opacity: 1;
        transform: translateY(-8px) scale(1.2)
    }
}

.char-big {
    font-size: 56px;
    filter: drop-shadow(0 4px 16px rgba(255, 215, 0, .4));
    animation: charFloat 3s ease-in-out infinite
}

@keyframes charFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-6px)
    }
}

.char-big.tier-2 {
    filter: drop-shadow(0 4px 20px rgba(57, 255, 20, .5)) drop-shadow(0 0 30px rgba(0, 229, 255, .3))
}

.char-big.tier-3 {
    filter: drop-shadow(0 4px 24px rgba(255, 215, 0, .6)) drop-shadow(0 0 40px rgba(255, 107, 0, .4));
    animation: charFloat 2s ease-in-out infinite, tierGlow 2s ease-in-out infinite alternate
}

@keyframes tierGlow {
    0% {
        filter: drop-shadow(0 4px 24px rgba(255, 215, 0, .6))
    }

    100% {
        filter: drop-shadow(0 4px 30px rgba(255, 215, 0, .9))
    }
}

.char-title {
    font-size: 22px;
    font-weight: 900;
    margin-top: 8px
}

.char-subtitle {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 800;
    margin-top: 2px
}

.char-class-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 900;
    padding: 5px 12px;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(255, 215, 0, .2), rgba(255, 107, 0, .2));
    color: var(--primary);
    border: 1px solid rgba(255, 215, 0, .3);
    margin-top: 8px
}

/* PROFILE STATS */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border)
}

.profile-stats .p-stat {
    background: var(--bg);
    padding: 14px 8px;
    text-align: center
}

.p-stat .p-val {
    font-size: 20px;
    font-weight: 900;
    display: block;
    color: var(--primary)
}

.p-stat .p-label {
    font-size: 9px;
    color: var(--text2);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .3px;
    margin-top: 2px
}

/* ACHIEVEMENT WALL */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 16px
}

.ach-item {
    text-align: center;
    padding: 12px 4px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px
}

.ach-item.locked {
    opacity: .35;
    filter: grayscale(1)
}

.ach-item .ach-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 2px
}

.ach-item .ach-name {
    font-size: 9px;
    font-weight: 800;
    color: var(--text2)
}

/* SECTION */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 10px
}

.section-header h2 {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .5px
}

.section-header a {
    font-size: 12px;
    color: var(--primary);
    font-weight: 900;
    text-decoration: none
}

.section-pad {
    padding: 0 16px
}

/* DETAIL VIEW */
.detail-header {
    padding: 20px 16px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 215, 0, .05), transparent)
}

.detail-header h2 {
    font-size: 20px;
    font-weight: 900;
    margin-top: 6px;
    margin-bottom: 6px
}

.detail-body {
    padding: 16px
}

.detail-body p {
    color: var(--text2);
    margin-bottom: 16px;
    line-height: 1.7;
    font-weight: 600
}

.reward-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 900
}

.reward-chip .val {
    color: var(--primary)
}

.detail-rewards {
    display: flex;
    gap: 10px;
    margin-bottom: 16px
}

.detail-actions {
    padding: 16px;
    position: sticky;
    bottom: 80px;
    background: linear-gradient(transparent, var(--bg) 30%)
}

/* MODAL / PAYWALL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto
}

.modal-sheet {
    background: linear-gradient(180deg, #2e1a6e, #1a1040);
    border: 2px solid var(--border);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 430px;
    padding: 24px 24px calc(24px + var(--safe-b));
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1)
}

.modal-overlay.show .modal-sheet {
    transform: translateY(0)
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--text3);
    border-radius: 2px;
    margin: 0 auto 20px
}

.modal-title {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px
}

.modal-desc {
    font-size: 13px;
    color: var(--text2);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600
}

.paywall-price {
    text-align: center;
    margin-bottom: 20px
}

.paywall-price .price {
    font-size: 40px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 16px rgba(255, 215, 0, .3)
}

.paywall-price .period {
    font-size: 14px;
    color: var(--text2);
    font-weight: 700
}

.paywall-features {
    list-style: none;
    margin-bottom: 20px
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    font-size: 13px;
    font-weight: 700
}

.paywall-features li i {
    color: var(--green);
    font-size: 18px
}

/* AUTH */
.auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center
}

.auth-logo {
    font-size: 72px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 24px rgba(255, 215, 0, .4));
    animation: charFloat 3s ease-in-out infinite
}

.auth-title {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px
}

.auth-subtitle {
    color: var(--text2);
    margin-bottom: 32px;
    font-size: 13px;
    font-weight: 700
}

.auth-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    color: var(--text3);
    font-size: 11px;
    font-weight: 700
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border)
}

/* TOAST */
.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: var(--bg3);
    border: 2px solid var(--primary);
    color: var(--text);
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 900;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 200;
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 0 16px rgba(255, 215, 0, .15);
    white-space: nowrap;
    max-width: 92%
}

.toast.show {
    transform: translateX(-50%) translateY(0)
}

.toast i {
    font-size: 20px;
    color: var(--primary)
}

/* CELEBRATION STYLES CONSOLIDATED BELOW */


/* ECHO AUDIO */
.echo-player {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px
}

.echo-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #1a1040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    font-weight: 900
}

.echo-wave {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 28px
}

.echo-wave .bar {
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite alternate
}

.echo-wave .bar:nth-child(2) {
    animation-delay: .1s
}

.echo-wave .bar:nth-child(3) {
    animation-delay: .2s
}

.echo-wave .bar:nth-child(4) {
    animation-delay: .3s
}

.echo-wave .bar:nth-child(5) {
    animation-delay: .4s
}

.echo-wave .bar:nth-child(6) {
    animation-delay: .5s
}

.echo-wave .bar:nth-child(7) {
    animation-delay: .6s
}

.echo-wave .bar:nth-child(8) {
    animation-delay: .7s
}

@keyframes wave {
    0% {
        height: 4px
    }

    100% {
        height: 24px
    }
}

.echo-wave.paused .bar {
    animation-play-state: paused
}

/* RECORD */
.record-area {
    text-align: center;
    padding: 16px
}

.record-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(255, 56, 96, .4);
    transition: .3s
}

.record-btn.recording {
    animation: pulse-rec 1.5s infinite;
    background: #FF1744
}

@keyframes pulse-rec {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 56, 96, .5)
    }

    70% {
        box-shadow: 0 0 0 18px rgba(255, 56, 96, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 56, 96, 0)
    }
}

.record-timer {
    font-size: 22px;
    font-weight: 900;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
    color: var(--primary)
}

.record-hint {
    font-size: 12px;
    color: var(--text2);
    margin-top: 6px;
    font-weight: 700
}

/* MENU LIST */
.menu-list {
    padding: 16px
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: .15s
}

.menu-item:active {
    background: var(--surface)
}

.menu-item i {
    font-size: 22px;
    color: var(--text2);
    width: 28px;
    text-align: center
}

.menu-item .menu-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text3);
    font-size: 12px
}

/* SUBSCRIPTION */
.sub-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(244, 114, 182, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.sub-card .sub-badge-big {
    font-size: 56px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.3));
}

.sub-card h3 {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--text);
}

/* FORM */
.form-group {
    margin-bottom: 16px
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--text3);
    margin-bottom: 8px;
    letter-spacing: .5px
}

input,
textarea,
select {
    width: 100%;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text3);
    font-weight: 600;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #FFFFFF;
    outline: none;
}

/* ===== ENDLESS TOWER BANNER ===== */
.battle-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(139, 92, 246, 0.3);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.battle-banner:active {
    transform: scale(.98);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.battle-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 16, 64, 0.8), rgba(74, 26, 138, 0.8)), url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="20" height="20" fill="none"/><path d="M0 20L20 0ZM20 20L0 0Z" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></svg>');
    background-size: cover, 20px 20px;
}

.battle-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px
}

.battle-left {
    flex: 1
}

.battle-label {
    font-size: 11px;
    font-weight: 900;
    color: #00E5FF;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.battle-monster-name {
    font-size: 20px;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.battle-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.battle-monster-emoji {
    font-size: 56px;
    filter: drop-shadow(0 4px 16px rgba(0, 229, 255, 0.5));
    animation: monsterBob 2s ease-in-out infinite
}

@keyframes monsterBob {

    0%,
    100% {
        transform: translateY(0) scale(1)
    }

    50% {
        transform: translateY(-5px) scale(1.05)
    }
}

/* ===== BATTLE ARENA — ENHANCED ===== */
.battle-arena {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

.battle-hud {
    display: flex;
    justify-content: space-between;
    padding: 24px 20px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    border-radius: 0 0 24px 24px;
}

.battle-card {
    flex: 1;
    background: var(--bg);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.battle-monster-area,
.battle-player-area {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .3s, box-shadow .3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.battle-monster-sprite,
.battle-player-sprite {
    font-size: 56px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform .3s
}

.battle-monster-sprite {
    animation: monsterBob 2s ease-in-out infinite
}

.battle-player-sprite {
    animation: charIdle 3s ease-in-out infinite
}

.battle-monster-info,
.battle-player-info {
    flex: 1
}

.battle-name {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--text);
}

.battle-hp-bar {
    height: 14px;
    background: var(--bg);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.battle-hp-fill {
    height: 100%;
    border-radius: 7px;
    transition: width .5s cubic-bezier(.16, 1, .3, 1)
}

.battle-hp-fill.monster-hp {
    background: linear-gradient(90deg, #FF4D4F, #FB7185);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.battle-hp-fill.player-hp {
    background: linear-gradient(90deg, #10B981, #34D399);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.battle-hp-text {
    font-size: 11px;
    font-weight: 800;
    color: var(--text3);
    margin-top: 6px;
    font-variant-numeric: tabular-nums
}

.battle-vs {
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}

.battle-log {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    min-height: 80px;
    max-height: 140px;
    overflow-y: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
    line-height: 1.8;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.battle-log .log-atk {
    color: var(--orange)
}

.battle-log .log-skill {
    color: var(--pink)
}

.battle-log .log-heal {
    color: var(--green)
}

.battle-log .log-enemy {
    color: var(--red)
}

.battle-log .log-win {
    color: var(--primary);
    font-weight: 900
}

.battle-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px
}

.battle-actions .btn {
    flex: 1;
    padding: 14px 8px;
    font-size: 13px
}

/* Battle FX animations */
@keyframes shakeHit {

    0%,
    100% {
        transform: translateX(0)
    }

    20% {
        transform: translateX(-8px)
    }

    40% {
        transform: translateX(8px)
    }

    60% {
        transform: translateX(-4px)
    }

    80% {
        transform: translateX(4px)
    }
}

.shake-hit {
    animation: shakeHit .4s ease-out
}

@keyframes attackRush {
    0% {
        transform: translateX(0)
    }

    30% {
        transform: translateX(40px) scale(1.1)
    }

    50% {
        transform: translateX(60px) scale(1.15)
    }

    70% {
        transform: translateX(30px)
    }

    100% {
        transform: translateX(0)
    }
}

.attack-rush {
    animation: attackRush .5s cubic-bezier(.16, 1, .3, 1)
}

@keyframes dmgFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1)
    }

    60% {
        opacity: 1;
        transform: translateY(-30px) scale(1.3)
    }

    100% {
        opacity: 0;
        transform: translateY(-50px) scale(.8)
    }
}

.damage-float {
    position: absolute;
    font-size: 22px;
    font-weight: 900;
    color: var(--red);
    text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
    animation: dmgFloat .8s ease-out forwards;
    pointer-events: none;
    z-index: 10
}

.damage-float.heal {
    color: var(--green)
}

.damage-float.crit {
    color: var(--pink);
    font-size: 28px
}

@keyframes monsterHurt {
    0% {
        filter: brightness(1)
    }

    20% {
        filter: brightness(2) saturate(0)
    }

    60% {
        filter: brightness(1.5)
    }

    100% {
        filter: brightness(1)
    }
}

.monster-hurt {
    animation: monsterHurt .4s ease-out
}

/* ===== LUCKY WHEEL ===== */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.wheel-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 16px 0 24px;
    border-radius: 50%;
    /* Outer rim */
    background: linear-gradient(135deg, #e0e7ff, #ffffff);
    padding: 8px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15), inset 0 4px 12px rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheel-canvas {
    border-radius: 50%;
    display: block;
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    color: var(--primary);
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.4));
    line-height: 1;
}

.wheel-spin-btn {
    margin-top: 16px
}

/* UTILITY */
.mt-2 {
    margin-top: 8px
}

.mt-3 {
    margin-top: 12px
}

.mt-4 {
    margin-top: 16px
}

.mb-2 {
    margin-bottom: 8px
}

.flex {
    display: flex
}

.items-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.gap-2 {
    gap: 8px
}

.w-full {
    width: 100%
}

.text-primary {
    color: var(--primary)
}

.text-green {
    color: var(--green)
}

.text-red {
    color: var(--red)
}

.text-secondary {
    color: var(--secondary)
}

.text-muted {
    color: var(--text2)
}

.text-sm {
    font-size: 12px
}

.text-xs {
    font-size: 10px
}

.font-bold {
    font-weight: 900
}

.text-center {
    text-align: center
}

.flex-wrap {
    flex-wrap: wrap
}

::-webkit-scrollbar {
    width: 4px
}

::-webkit-scrollbar-thumb {
    background: var(--text3);
    border-radius: 2px
}

/* ===== DASHBOARD ===== */
.dash-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dash-tab {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text3);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-tab.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dash-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0
}

.dash-stat {
    text-align: center;
    padding: 14px 4px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--surface)
}

.dash-stat .ds-val {
    font-size: 28px;
    font-weight: 900;
    display: block
}

.dash-stat .ds-label {
    font-size: 10px;
    color: var(--text2);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .3px;
    margin-top: 2px
}

.dash-stat.stat-done .ds-val {
    color: var(--green)
}

.dash-stat.stat-fail .ds-val {
    color: var(--red)
}

.dash-stat.stat-total .ds-val {
    color: var(--primary)
}

.dash-type-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px
}

.dash-type-icon {
    font-size: 28px;
    flex-shrink: 0
}

.dash-type-info {
    flex: 1
}

.dash-type-name {
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px
}

.dash-type-bar {
    height: 8px;
    background: rgba(0, 0, 0, .3);
    border-radius: 4px;
    overflow: hidden
}

.dash-type-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease
}

.dash-type-count {
    font-size: 11px;
    color: var(--text3);
    font-weight: 700;
    margin-top: 2px
}

.dash-ach-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.dash-ach-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255, 215, 0, .1);
    border: 1px solid rgba(255, 215, 0, .2);
    color: var(--primary)
}

/* ===== TOAST (was missing — root cause of stuck toast!) ===== */
.toast {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 9999;
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    color: #1a1040;
    padding: 10px 24px;
    border-radius: 0 0 16px 16px;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, .4);
    opacity: 0;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease;
    pointer-events: none;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto
}

/* ===== CELEBRATION (was missing) ===== */
.celebration {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 5, 30, .85);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    overflow: hidden
}

.celebration.show {
    opacity: 1;
    pointer-events: auto
}

.cel-icon {
    font-size: 72px;
    animation: celBounce .6s cubic-bezier(.34, 1.56, .64, 1)
}

.cel-title {
    font-size: 24px;
    font-weight: 900;
    color: #FFD700;
    margin-top: 12px;
    text-shadow: 0 2px 8px rgba(255, 215, 0, .5)
}

.cel-sub {
    font-size: 14px;
    color: var(--text2);
    margin-top: 8px;
    font-weight: 700
}

@keyframes cFall {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1
    }

    100% {
        transform: translateY(120vh) rotate(720deg);
        opacity: 0
    }
}


@keyframes celBounce {
    0% {
        transform: scale(0) rotate(-20deg)
    }

    60% {
        transform: scale(1.3) rotate(5deg)
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

/* ===== UX IMPROVEMENTS — COMPREHENSIVE POLISH ===== */

/* Bigger XP bar for better progress visibility */
.xp-track {
    height: 8px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, .08) !important
}

.xp-fill {
    height: 8px !important;
    border-radius: 4px !important
}

/* Larger touch targets for back buttons */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: background .2s
}

.icon-btn:active {
    background: rgba(255, 255, 255, .1)
}

/* Better task card hover/active states */
.task-card {
    transition: transform .15s ease, box-shadow .15s ease !important
}

.task-card:active {
    transform: scale(.98) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3) !important
}

/* Publisher badge in task cards — more prominent */
.task-creator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    font-size: 11px;
    font-weight: 800
}

/* Bottom nav active state with underline indicator */
.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 25%;
    right: 25%;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--orange))
}

.nav-btn {
    position: relative
}

/* Reward cost badge — larger and more visible */
.reward-cost {
    font-size: 14px !important;
    font-weight: 900 !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    background: rgba(255, 215, 0, .12) !important;
    border: 1px solid rgba(255, 215, 0, .25) !important
}

/* Smoother screen transitions */
.screen {
    animation: screenFadeIn .25s ease
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Better section headers */
.section-header h2 {
    font-size: 15px !important
}

/* Menu item hover states */
.menu-item:active {
    background: rgba(255, 255, 255, .05);
    transform: scale(.99)
}

/* HUD chips — better visual weight */
.hud-chip {
    backdrop-filter: blur(8px)
}

/* Profile stats — add subtle separators */
.profile-stats {
    position: relative
}

.p-stat {
    position: relative
}

.p-stat+.p-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, .1)
}

/* Battle arena — better visual hierarchy */
.battle-arena {
    padding: 16px !important
}

/* Lucky wheel canvas — add glow */
#wheel-canvas {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, .15))
}

/* ===== CHARACTER SELECTION — ANIMATED FEEL ===== */
.char-option {
    transition: transform .2s ease, box-shadow .2s ease
}

.char-option:hover,
.char-option:active {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(124, 92, 252, .3)
}

.char-option.selected {
    box-shadow: 0 0 20px rgba(255, 215, 0, .4), 0 4px 16px rgba(124, 92, 252, .3)
}

/* Idle bob animation for character images */
.char-avatar img {
    animation: charSelectBob 2.5s ease-in-out infinite;
    will-change: transform
}

.char-option:nth-child(1) .char-avatar img {
    animation-delay: 0s
}

.char-option:nth-child(2) .char-avatar img {
    animation-delay: .4s
}

.char-option:nth-child(3) .char-avatar img {
    animation-delay: .8s
}

.char-option:nth-child(4) .char-avatar img {
    animation-delay: .2s
}

.char-option:nth-child(5) .char-avatar img {
    animation-delay: .6s
}

.char-option:nth-child(6) .char-avatar img {
    animation-delay: 1s
}

@keyframes charSelectBob {

    0%,
    100% {
        transform: translateY(0) scale(1)
    }

    30% {
        transform: translateY(-6px) scale(1.04)
    }

    60% {
        opacity: 1;
        transform: scale(1.1)
    }
}

.char-avatar {
    position: relative;
    overflow: visible
}

/* Base animation for ALL character images */
.char-avatar img,
.char-big img,
.hud-chip img,
.battle-player-sprite img {
    mix-blend-mode: normal;
    transform-origin: bottom center;
}

/* Idle select bob animation with squash and stretch to mimic body movement */
.char-avatar img {
    animation: charSelectOrganic 3s ease-in-out infinite;
    will-change: transform
}

.char-option:nth-child(1) .char-avatar img {
    animation-delay: 0s
}

.char-option:nth-child(2) .char-avatar img {
    animation-delay: .5s
}

.char-option:nth-child(3) .char-avatar img {
    animation-delay: 1s
}

.char-option:nth-child(4) .char-avatar img {
    animation-delay: .3s
}

.char-option:nth-child(5) .char-avatar img {
    animation-delay: .8s
}

.char-option:nth-child(6) .char-avatar img {
    animation-delay: 1.3s
}

@keyframes charSelectOrganic {

    0%,
    100% {
        transform: translateY(0) scaleY(1) scaleX(1)
    }

    25% {
        transform: translateY(-4px) scaleY(1.03) scaleX(0.97) rotate(2deg)
    }

    50% {
        transform: translateY(-7px) scaleY(1) scaleX(1) rotate(0deg)
    }

    75% {
        transform: translateY(-3px) scaleY(0.98) scaleX(1.02) rotate(-2deg)
    }
}

/* Profile char image deep breathing animation */
.char-big img {
    animation: charProfileBreathe 4s ease-in-out infinite
}

@keyframes charProfileBreathe {

    0%,
    100% {
        transform: scale(1.1) translateY(0) scaleY(1)
    }

    50% {
        transform: scale(1.1) translateY(-6px) scaleY(1.04) scaleX(0.98)
    }
}

/* HUD character icon — subtle pulse */
.hud-chip img {
    animation: hudCharPulse 4s ease-in-out infinite
}

@keyframes hudCharPulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

/* Battle sprite animation override for player with image */
.battle-player-sprite img {
    animation: charCombatIdle 2s ease-in-out infinite
}

@keyframes charCombatIdle {

    0%,
    100% {
        transform: translateY(0) scaleY(1) scaleX(1)
    }

    50% {
        transform: translateY(2px) scaleY(0.95) scaleX(1.05)
    }
}

/* Glow aura behind the avatar circle (kept for active selection) */
.char-avatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, .15) 0%, transparent 70%);
    animation: charAuraGlow 3s ease-in-out infinite;
    z-index: -1
}

.char-option.selected .char-avatar::after {
    background: radial-gradient(circle, rgba(255, 215, 0, .35) 0%, transparent 70%)
}

@keyframes charAuraGlow {

    0%,
    100% {
        opacity: .4;
        transform: scale(.95)
    }

    50% {
        opacity: 1;
        transform: scale(1.1)
    }
}

.char-avatar {
    position: relative;
    overflow: visible
}

/* Profile char image breathing animation */
.char-big img {
    animation: charProfileBreathe 3s ease-in-out infinite
}

@keyframes charProfileBreathe {

    0%,
    100% {
        transform: scale(1) translateY(0)
    }

    50% {
        transform: scale(1.05) translateY(-4px)
    }
}

/* HUD character icon — subtle pulse */
.hud-chip img {
    animation: hudCharPulse 4s ease-in-out infinite
}

@keyframes hudCharPulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

/* Battle sprite animation override for player with image */
.battle-player-sprite img {
    animation: charIdle 2s ease-in-out infinite
}

/* ===== REWARD SECTION REDESIGN ===== */
#custom-reward-panel {
    animation: rewardSlideDown .3s ease
}

@keyframes rewardSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes charFloat {

    0%,
    100% {
        transform: scale(1.1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-6px);
    }
}

/* ===== MODAL & PAYWALL OVERHAUL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: var(--bg2);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-b));
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 22px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.modal-desc {
    text-align: center;
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.paywall-price {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 24px;
}

.paywall-price .price {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary);
}

.paywall-price .period {
    color: var(--text3);
    font-weight: 800;
}

.paywall-features {
    list-style: none;
    margin-bottom: 24px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.paywall-features li {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.paywall-features li:last-child {
    margin-bottom: 0;
}

.paywall-features li i {
    color: var(--primary);
    font-size: 20px;
}

/* Character Humorous Dialogue Bubble */
.char-dialogue-bubble {
    position: absolute;
    top: 60px;
    /* Under the header */
    left: 80px;
    /* Next to avatar */
    background: #ffffff;
    border: 2px solid var(--primary);
    padding: 12px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text);
    max-width: 240px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.char-dialogue-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.char-dialogue-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 12px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
    transform: rotate(-45deg);
}

/* ===== GUILD FEATURE ===== */
.guild-icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.guild-icon-option {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.guild-icon-option:hover,
.guild-icon-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.guild-header-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(244, 114, 182, 0.06));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.guild-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--pink), var(--secondary));
    border-radius: 20px 20px 0 0;
}

.guild-icon-big {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(244, 114, 182, 0.1));
    border: 3px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 12px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}

.guild-name-big {
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.guild-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.guild-code-badge:hover {
    background: rgba(99, 102, 241, 0.08);
}

.guild-info-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.guild-info-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 800;
    color: var(--text2);
}

.guild-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.guild-member-card:active {
    transform: scale(0.98);
}

.guild-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.guild-member-info {
    flex: 1;
    min-width: 0;
}

.guild-member-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.guild-member-role {
    font-size: 11px;
    font-weight: 800;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 4px;
}

.guild-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
}

.guild-role-badge.owner {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.guild-role-badge.vice {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.guild-role-badge.member {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text3);
    border: 1px solid rgba(100, 116, 139, 0.15);
}

.guild-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    transition: all 0.2s;
    flex: 1;
}

.guild-action-btn:hover {
    background: var(--bg);
}

.guild-action-btn.danger {
    color: var(--red);
    border-color: rgba(255, 77, 79, 0.2);
}

.guild-action-btn.danger:hover {
    background: rgba(255, 77, 79, 0.05);
}

/* ===== AUTH FLOW - PREMIUM REDESIGN ===== */
.auth-step1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 24px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4338ca 60%, #6366f1 100%);
    position: relative;
    overflow: hidden;
}

.auth-step1::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(244, 114, 182, 0.15), transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(99, 102, 241, 0.2), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(129, 140, 248, 0.1), transparent 60%);
    animation: authBgPulse 8s ease-in-out infinite;
}

@keyframes authBgPulse {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-3%, -3%) scale(1.05);
    }
}

/* Floating Particles */
.auth-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: authFloat linear infinite;
}

.auth-particle:nth-child(1) {
    width: 6px;
    height: 6px;
    left: 10%;
    animation-duration: 12s;
    animation-delay: 0s;
}

.auth-particle:nth-child(2) {
    width: 8px;
    height: 8px;
    left: 30%;
    animation-duration: 15s;
    animation-delay: -3s;
}

.auth-particle:nth-child(3) {
    width: 4px;
    height: 4px;
    left: 50%;
    animation-duration: 10s;
    animation-delay: -6s;
}

.auth-particle:nth-child(4) {
    width: 10px;
    height: 10px;
    left: 70%;
    animation-duration: 18s;
    animation-delay: -2s;
}

.auth-particle:nth-child(5) {
    width: 5px;
    height: 5px;
    left: 85%;
    animation-duration: 14s;
    animation-delay: -5s;
}

.auth-particle:nth-child(6) {
    width: 7px;
    height: 7px;
    left: 20%;
    animation-duration: 16s;
    animation-delay: -8s;
}

@keyframes authFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Logo Section */
.auth-logo-section {
    text-align: center;
    z-index: 1;
    margin-bottom: 32px;
    animation: authLogoFadeIn 1s ease-out;
}

@keyframes authLogoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.15);
    animation: authRingPulse 3s ease-in-out infinite;
    backdrop-filter: blur(8px);
}

@keyframes authRingPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.15);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 8px 40px rgba(99, 102, 241, 0.6), 0 0 80px rgba(244, 114, 182, 0.2);
        transform: scale(1.05);
    }
}

.auth-logo-icon {
    font-size: 42px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.auth-brand-title {
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 6px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
    line-height: 1.2;
}

.auth-brand-sub {
    font-size: 20px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 4px;
    margin-left: 4px;
}

.auth-tagline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
}

.auth-tagline-line {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 700;
}

.auth-tagline-highlight {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(90deg, #fbbf24, #f472b6, #818cf8, #fbbf24);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: authGradientText 4s linear infinite;
}

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

    100% {
        background-position: 300% 50%;
    }
}

.auth-tagline-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 8px;
}

/* Login Form Card */
.auth-form-card {
    width: 100%;
    max-width: 360px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 24px;
    animation: authFormSlideUp 0.8s ease-out 0.3s both;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

@keyframes authFormSlideUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-inner .form-group label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 800;
}

.auth-form-inner input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
}

.auth-form-inner input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-form-inner input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.auth-login-btn {
    margin-top: 8px;
    padding: 14px;
    font-size: 15px;
    border-radius: 14px;
    letter-spacing: 1px;
}

.auth-divider {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-weight: 800;
    margin: 16px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.btn-google {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 14px;
}

.btn-google:hover {
    background: #fff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-footer {
    z-index: 1;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    animation: authFormSlideUp 0.8s ease-out 0.6s both;
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
}

/* Auth Step 2: Profile Setup */
.auth-step2 {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 20px 40px;
    background: var(--bg);
    overflow-y: auto;
}

.auth-step2-header {
    text-align: center;
    margin-bottom: 24px;
    animation: authLogoFadeIn 0.6s ease-out;
}

.auth-step2-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.auth-step2-subtitle {
    font-size: 13px;
    color: var(--text2);
    font-weight: 700;
}

.auth-step2-form {
    max-width: 400px;
    margin: 0 auto;
    animation: authFormSlideUp 0.6s ease-out 0.2s both;
}

.auth-step2-form .form-group {
    margin-bottom: 12px;
}

.auth-step2-form .mb-0 {
    margin-bottom: 0 !important;
}

/* Profile Guild Card (Promoted) */
.profile-guild-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: rgba(99, 102, 241, 0.15);
    /* Increased opacity for more prominence */
    border: 1px solid rgba(99, 102, 241, 0.2);
    /* Added subtle border for definition */
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.profile-guild-card:active {
    transform: scale(0.97);
    background-color: rgba(99, 102, 241, 0.25);
}

.profile-guild-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.profile-guild-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.profile-guild-info {
    flex: 1;
    min-width: 0;
}

.profile-guild-name {
    font-size: 15px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 2px;
}

.profile-guild-desc {
    font-size: 11px;
    font-weight: 700;
    color: var(--text2);
}

/* Guild badge displayed inline in HUD/profile */
.guild-inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}

/* No-guild banner for task feed */
.no-guild-banner {
    text-align: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(244, 114, 182, 0.04));
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    margin: 0 16px 16px;
}

.no-guild-banner .no-guild-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.no-guild-banner .no-guild-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.no-guild-banner .no-guild-desc {
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Unified coin icon color across all screens */
.ph-bold.ph-coin,
.ph-fill.ph-coin {
    color: var(--primary) !important;
}

/* v1.001 Version Tag */
.version-tag {
    position: fixed;
    bottom: 85px;
    right: 15px;
    font-size: 10px;
    font-weight: 900;
    color: var(--text3);
    opacity: 0.4;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 1000;
}