:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #8e8e93;
    --accent: #3478f6;
    --accent-hover: #2860d8;
    --accent-light: rgba(52, 120, 246, 0.08);
    --accent-gradient: linear-gradient(135deg, #3478f6, #7c3aed);
    --success: #34c759;
    --success-light: rgba(52, 199, 89, 0.1);
    --warning: #ff9500;
    --warning-light: rgba(255, 149, 0, 0.1);
    --danger: #ff3b30;
    --danger-light: rgba(255, 59, 48, 0.1);
    --border: #e8e8ed;
    --divider: #f0f0f5;

    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

    --transition: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --pyro: #ef7938;
    --cryo: #99d5e5;
    --electro: #af8ec1;
    --hydro: #4cc2f1;
    --anemo: #74c2a8;
    --geo: #f0b232;
    --dendro: #a0c83b;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 16px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 16px;
    transition: color var(--transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    transition: all var(--transition);
}

.nav-tab.active {
    color: var(--accent);
}

.nav-tab.active svg {
    stroke-width: 2.2;
}

.nav-tab-create {
    position: relative;
}

.nav-tab-create .nav-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -18px;
    box-shadow: 0 4px 12px rgba(52, 120, 246, 0.35);
    transition: transform var(--transition), box-shadow var(--transition);
}

.nav-tab-create .nav-icon-wrap svg {
    color: white;
    stroke: white;
    width: 22px;
    height: 22px;
}

.nav-tab-create:active .nav-icon-wrap {
    transform: scale(0.92);
}

.nav-tab-create span {
    margin-top: 2px;
}

.page-header {
    padding: 20px 0 16px;
}

.page-header.center {
    text-align: center;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
}

.section-title h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-title a {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tg-emoji {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
}

.tg-emoji-sm {
    width: 16px;
    height: 16px;
}

.tg-emoji-lg {
    width: 28px;
    height: 28px;
}

.tg-emoji-xl {
    width: 40px;
    height: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-gradient {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 120, 246, 0.3);
}

.btn-secondary {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius);
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform var(--transition);
}

.card-sm {
    padding: 16px;
    border-radius: var(--radius-md);
}

.card:active {
    transform: scale(0.985);
}

.card-static:active {
    transform: none;
}

.balance-card {
    background: var(--accent-gradient);
    border-radius: var(--radius);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(52, 120, 246, 0.25);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.balance-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
    line-height: 1.1;
}

.balance-amount small {
    font-size: 20px;
    font-weight: 600;
}

.balance-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.balance-footer .btn {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-full);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.quick-action {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    text-align: center;
}

.quick-action:active {
    transform: scale(0.96);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.quick-action-icon.accent {
    background: var(--accent-light);
    color: var(--accent);
}

.quick-action-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.quick-action-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.quick-action-title {
    font-size: 13px;
    font-weight: 600;
}

.deal-card {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}

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

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.deal-game {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.deal-card-price {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.deal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-waiting   { background: var(--warning-light); color: #b45309; }
.badge-info      { background: var(--accent-light); color: var(--accent); }
.badge-warning   { background: var(--warning-light); color: #b45309; }
.badge-success   { background: var(--success-light); color: #15803d; }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-muted     { background: #f3f4f6; color: #6b7280; }

.tabs {
    display: flex;
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 120, 246, 0.25);
}

.profile-header {
    text-align: center;
    padding: 24px 0 8px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 16px rgba(52, 120, 246, 0.25);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.profile-username {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.review-item {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

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

.review-author {
    font-weight: 600;
    font-size: 14px;
}

.review-stars {
    color: var(--warning);
    font-size: 14px;
    letter-spacing: 1px;
}

.review-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.balance-compact {
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(52, 120, 246, 0.2);
    margin-bottom: 16px;
}

.balance-compact-amount {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.balance-compact-label {
    font-size: 12px;
    opacity: 0.8;
}

.game-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.game-card {
    background: var(--card);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.game-card:active {
    transform: scale(0.96);
}

.game-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.game-card-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.game-card-title {
    font-size: 14px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input-lg {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    padding: 18px;
    letter-spacing: -0.5px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 12px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.selected-count {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.element-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.element-filters::-webkit-scrollbar { display: none; }

.filter-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.filter-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.element-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.filter-pill .tg-emoji {
    width: 16px;
    height: 16px;
}

.element-pyro { background: var(--pyro); }
.element-cryo { background: var(--cryo); }
.element-electro { background: var(--electro); }
.element-hydro { background: var(--hydro); }
.element-anemo { background: var(--anemo); }
.element-geo { background: var(--geo); }
.element-dendro { background: var(--dendro); }

.characters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.char-card {
    background: var(--card);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 4px 8px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    box-shadow: var(--shadow);
}

.char-card:active {
    transform: scale(0.95);
}

.char-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.char-card .char-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 20px;
}

.char-card.selected .char-check {
    display: flex;
}

.char-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    overflow: hidden;
    position: relative;
}

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

.char-icon.rarity-5 {
    background: linear-gradient(135deg, #b68529, #e5a84b);
    box-shadow: 0 2px 8px rgba(182, 133, 41, 0.3);
    border: 2px solid #e5a84b;
}

.char-icon.rarity-s {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    border: 2px solid #a855f7;
}

.char-initial {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.char-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.char-constellation, .char-rank-select {
    margin-top: 4px;
}

.constellation-select {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--card);
    color: var(--accent);
    cursor: pointer;
}

.preview-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
    box-shadow: var(--shadow-md);
}

.preview-header {
    margin-bottom: 16px;
}

.preview-game {
    font-size: 16px;
    font-weight: 700;
}

.preview-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.preview-stat {
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}

.preview-stat span {
    font-size: 11px;
    color: var(--text-secondary);
}

.preview-stat strong {
    font-size: 15px;
}

.preview-tag {
    display: inline-block;
    background: var(--success-light);
    color: #065f46;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.preview-chars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.preview-char-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.preview-char-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5a84b;
}

.preview-char-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.preview-char-const {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
}

.submit-notice {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.submit-notice strong {
    color: var(--text);
}

.element-bg-pyro { background: var(--pyro); }
.element-bg-cryo { background: var(--cryo); }
.element-bg-electro { background: var(--electro); }
.element-bg-hydro { background: var(--hydro); }
.element-bg-anemo { background: var(--anemo); }
.element-bg-geo { background: var(--geo); }
.element-bg-dendro { background: var(--dendro); }
.rank-bg { background: linear-gradient(135deg, #7c3aed, #a855f7); }

.preview-extra-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.deal-status-banner {
    text-align: center;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.deal-header-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.deal-game-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.deal-price-big {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}

.deal-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.deal-parties-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.party-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.party-row + .party-row {
    border-top: 1px solid var(--divider);
}

.party-role {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 90px;
}

.party-name {
    font-weight: 600;
    flex: 1;
}

.party-rating {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
}

.party-row.muted {
    color: var(--text-secondary);
    font-style: italic;
}

.deal-account-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.deal-account-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-stat {
    background: var(--bg);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.detail-tag {
    display: inline-block;
    background: var(--success-light);
    color: #065f46;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin: 2px;
}

.detail-section {
    margin-top: 16px;
}

.detail-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

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

.char-display-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 60px;
}

.char-display-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    border: 2px solid;
    overflow: hidden;
}

.rank-display {
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
    border-color: #7c3aed !important;
    color: white;
}

.char-display-name {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.char-display-const {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

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

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.loading-spinner {
    text-align: center;
    padding: 48px 20px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

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

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 14px;
}

.welcome-section {
    padding: 20px 0 4px;
}

.welcome-greeting {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.welcome-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8ed 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-card {
    height: 100px;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: 0.05s; }
.animate-in:nth-child(3) { animation-delay: 0.1s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }
.animate-in:nth-child(5) { animation-delay: 0.2s; }
.animate-in:nth-child(6) { animation-delay: 0.25s; }

@media (max-width: 380px) {
    .characters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .balance-amount {
        font-size: 28px;
    }
}

.toggle-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.toggle-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
}

.toggle-card:active {
    transform: scale(0.96);
}

.toggle-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.toggle-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toggle-card-icon.moon {
    background: linear-gradient(135deg, #1a1a4e, #3b2f80);
}

.toggle-card-icon.bp {
    background: linear-gradient(135deg, #b45309, #eab308);
}

.toggle-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.toggle-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.toggle-card-sub {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.toggle-card .toggle-check {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.toggle-card.active .toggle-check {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.toggle-card.active .toggle-check::after {
    content: '✓';
    font-size: 12px;
    font-weight: 700;
}

.party-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.party-card + .party-card {
    border-top: 1px solid var(--divider);
}

.party-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.party-avatar.seller-avatar {
    background: linear-gradient(135deg, #3478f6, #7c3aed);
}

.party-avatar.buyer-avatar {
    background: linear-gradient(135deg, #34c759, #0ea5e9);
}

.party-avatar.empty-avatar {
    background: var(--border);
    color: var(--text-secondary);
}

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

.party-info-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.party-info-tag {
    font-size: 13px;
    color: var(--accent);
    line-height: 1.2;
}

.party-info-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.party-rating-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--warning-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    flex-shrink: 0;
}

.sub-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.sub-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

.sub-badge.luna {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #c4b5fd;
}

.sub-badge.bp {
    background: linear-gradient(135deg, #78350f, #a16207);
    color: #fde68a;
}

.sub-badge .tg-emoji {
    width: 18px;
    height: 18px;
}

.deal-actions {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 12px;
    box-shadow: var(--shadow);
}

.deal-actions .action-hint {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.4;
}

.deal-actions .action-hint strong {
    color: var(--text);
}

.deal-actions .btn + .btn {
    margin-top: 8px;
}

.deal-actions .action-row {
    display: flex;
    gap: 8px;
}

.deal-actions .action-row .btn {
    flex: 1;
}

.invite-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.invite-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.invite-section .invite-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.invite-link-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 13px;
    font-family: monospace;
    word-break: break-all;
    color: var(--accent);
    margin-bottom: 12px;
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.invite-link-box:active {
    background: var(--accent-light);
}

.dispute-toggle {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm);
    background: var(--danger-light);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
}

.dispute-toggle:active {
    transform: scale(0.97);
}

.dispute-form {
    margin-top: 12px;
    display: none;
}

.dispute-form.show {
    display: block;
}

.account-overview-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.account-overview-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.account-stat-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    text-align: center;
}

.account-stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1;
}

.account-stat-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.account-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.subs-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.sub-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.sub-card.luna {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #c4b5fd;
}

.sub-card.bp {
    background: linear-gradient(135deg, #78350f, #a16207);
    color: #fde68a;
}

.sub-card .tg-emoji {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.chars-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chars-scroll::-webkit-scrollbar { display: none; }

.char-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
}

.char-gallery-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.char-gallery-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-gallery-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.char-gallery-const {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.account-note {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 14px;
    color: #92400e;
    line-height: 1.5;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--card);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 480px;
    padding: 24px 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.modal-close:active {
    background: var(--border);
}

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    z-index: 3000;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

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

.star-rating {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    transform: scale(1.15);
}

.game-select-v2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-card-v2 {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-height: 120px;
}

.game-card-v2:active {
    transform: scale(0.97);
}

.game-card-v2-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.game-card-v2-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    color: white;
}

.game-card-v2-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.game-card-v2-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.game-card-v2-info {
    flex: 1;
    min-width: 0;
}

.game-card-v2-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.game-card-v2-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
    line-height: 1.3;
}

.game-card-v2-arrow {
    flex-shrink: 0;
    color: rgba(255,255,255,0.7);
}

.game-card-v2.selected {
    box-shadow: 0 0 0 3px var(--primary), 0 4px 20px rgba(0,0,0,0.15);
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
