/* ==================== 全局重置与变量 ==================== */
:root {
    --main: #587BFF;
    --sub: #9D65FF;
    --main-soft: rgba(88, 123, 255, 0.15);
    --sub-soft: rgba(157, 101, 255, 0.15);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e0e0e0;
    --text-secondary: #999;
    --text-tip: #666;
    --card-radius: 24px;
    --btn-radius: 16px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #0a0a1a;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 星云粒子背景 ==================== */
#particles-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== 页面容器 ==================== */
.page {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 0;
    padding-bottom: calc(70px + var(--safe-bottom));
}
.page.active { display: flex; }
.page.no-scroll { overflow: hidden; }
.page.has-tab { padding-bottom: calc(58px + var(--safe-bottom)); }
.page.page-init { align-items: center; }

/* 桌面端居中容器 */
@media (min-width: 540px) {
    .page-inner {
        max-width: 500px;
        width: 100%;
        margin: 0 auto;
    }
}

/* ==================== 卡片通用 ==================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s;
}
.card:hover { background: var(--card-hover); }

/* ==================== 按钮通用 ==================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--btn-radius);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    padding: 16px 32px;
    transition: all 0.3s;
    font-family: inherit;
    min-height: 52px;
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--main), var(--sub));
    color: #fff;
    box-shadow: 0 4px 20px rgba(88, 123, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 30px rgba(88, 123, 255, 0.5);
    transform: translateY(-1px);
}

.btn-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-height: 80px;
}
.btn-card:hover:not(:disabled) {
    background: var(--card-hover);
    border-color: var(--main);
}

.btn-card .btn-desc {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.btn-sm {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 14px;
    min-height: 44px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--main);
    color: var(--main);
}
.btn-outline:hover:not(:disabled) {
    background: var(--main-soft);
}

/* ==================== 输入框 ==================== */
.input {
    width: 100%;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--btn-radius);
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}
.input:focus { border-color: var(--main); }
.input::placeholder { color: var(--text-tip); }

/* ==================== 单选框 ==================== */
.radio-group {
    display: flex;
    gap: 12px;
}
.radio-item {
    flex: 1;
    padding: 16px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 17px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.radio-item.active {
    background: var(--main-soft);
    border-color: var(--main);
    color: var(--main);
    font-weight: 600;
}

/* ==================== 顶部导航栏 ==================== */
.nav-bar {
    display: flex;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
    position: relative;
}
.nav-back {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    z-index: 2;
}
.nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 700;
    pointer-events: none;
    max-width: 160px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-right {
    font-size: 12px;
    padding: 6px 12px;
    white-space: nowrap;
    margin-left: auto;
}
.tab-bar {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    z-index: 20;
    display: flex;
    background: rgba(10, 10, 26, 0.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-bottom: var(--safe-bottom);
}
.tab-bar.hidden { display: none; }
.tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 6px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    gap: 2px;
    user-select: none;
}
.tab-bar-item.active { color: var(--main); }
.tab-bar-item .tab-icon { font-size: 22px; line-height: 1; }
.tab-bar-item .tab-text { font-size: 10px; }

/* ===== Tab 红点系统 ===== */
.tab-icon-wrap {
    position: relative;
    display: inline-block;
}
.red-dot {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 8px;
    height: 8px;
    background: #FF4444;
    border-radius: 50%;
    border: 1px solid rgba(10, 10, 26, 0.95);
}
.red-dot.hidden { display: none; }
.red-dot-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #FF4444;
    border-radius: 8px;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    border: 1px solid rgba(10, 10, 26, 0.95);
}
.red-dot-badge.hidden { display: none; }

/* ===== 顶部双视图切换标签 ===== */
.top-switch-tabs {
    display: flex;
    margin: 0 16px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 3px;
}
.switch-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-tip);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.switch-tab.active {
    background: var(--main);
    color: #fff;
}
.switch-tab .red-dot-badge {
    position: static;
    border: none;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
}

/* ===== 图书视图容器 ===== */
.book-view { }
.book-view.hidden { display: none; }

/* ===== 会话列表 ===== */
.session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.session-item:hover {
    border-color: var(--main);
}
.session-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.session-item-info {
    flex: 1;
    min-width: 0;
}
.session-item-title {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 4px;
}
.session-item-preview {
    font-size: 12px;
    color: var(--text-tip);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.session-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.session-item-time {
    font-size: 11px;
    color: var(--text-tip);
}
.session-item-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #FF4444;
    border-radius: 9px;
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
}
.session-item-unread.hidden { display: none; }

.bottom-bar-3 {
    display: flex;
    gap: 10px;
}
.bottom-bar-3 .btn {
    flex: 1;
    padding: 14px 10px;
    font-size: 14px;
    border-radius: 14px;
    min-height: 48px;
}

/* ==================== 能量条 ==================== */
.energy-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.energy-bar .energy-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.energy-bar .energy-label {
    font-size: 15px;
    font-weight: 600;
}
.energy-bar .energy-num {
    font-size: 14px;
    color: var(--text-secondary);
}
.energy-bar .energy-num span {
    color: var(--main);
    font-weight: 700;
    font-size: 18px;
}
.energy-bar .progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.energy-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--main), var(--sub));
    transition: width 0.5s ease;
}
.energy-bar .energy-recover-text {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-tip);
}

/* ==================== 标签栏 ==================== */
.tab-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tab-scroll::-webkit-scrollbar { display: none; }
.tab-item {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}
.tab-item.active {
    background: var(--main-soft);
    border-color: var(--main);
    color: var(--main);
    font-weight: 600;
}

/* ==================== 宇宙卡片网格 ==================== */
.world-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
    flex: 1;
    align-content: start;
}
.world-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--card-radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}
.world-card.selected {
    border-color: var(--main);
    background: var(--main-soft);
    box-shadow: 0 0 20px rgba(88, 123, 255, 0.2);
}
.world-card .world-cover {
    width: 60px; height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--main-soft), var(--sub-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.world-card .world-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.world-card .world-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== 加载页 ==================== */
.loading-animation {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.loading-ring {
    width: 80px; height: 80px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--main);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin-bottom: 30px;
}
.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    animation: fadeText 2.5s ease-in-out infinite;
    text-align: center;
    min-height: 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeText {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ==================== 结果页 ==================== */
.result-info-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}
.result-info-panel .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}
.result-info-panel .info-row + .info-row {
    border-top: 1px solid var(--border);
}

.profile-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.result-actions {
    flex-shrink: 0;
    padding-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 手风琴折叠面板 */
.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    margin-bottom: 10px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s;
}
.accordion-item.open {
    border-color: var(--main);
}
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.accordion-header:hover { background: var(--card-hover); }
.accordion-header .acc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.accordion-header .acc-arrow {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 12px;
}
.accordion-item.open .acc-arrow {
    transform: rotate(180deg);
}
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    padding: 0 18px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-secondary);
}
.accordion-item.open .accordion-body {
    max-height: 3000px;
    padding: 0 18px 16px;
}

/* ==================== 图鉴列表 ==================== */
/* ==================== 筛选 ==================== */
.filter-bar {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.filter-btn {
    padding: 8px 18px;
    border-radius: 16px;
    font-size: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    min-height: 36px;
}
.filter-dropdown {
    position: absolute;
    right: 0;
    top: 36px;
    background: #1a1a35;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    z-index: 20;
    display: none;
    min-width: 200px;
}
.filter-dropdown.show { display: block; }
.filter-dropdown .filter-option {
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.filter-dropdown .filter-option:hover { background: var(--card-hover); }
.filter-dropdown .filter-option.active { color: var(--main); }

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(12px);
}
.contact-item:hover { background: var(--card-hover); border-color: var(--main); }
.contact-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--main), var(--sub));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.contact-info {
    flex: 1;
    min-width: 0;
}
.contact-info .contact-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}
.contact-info .contact-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.contact-info .contact-dynamic {
    font-size: 12px;
    color: var(--text-tip);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-chat-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--main-soft);
    border: 1px solid var(--main);
    color: var(--main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
}

/* ==================== 聊天页 ==================== */
.dynamic-tip-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    backdrop-filter: blur(12px);
}
.chat-header-right {
    margin-left: auto;
}
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    margin-bottom: 12px;
}

.chat-bubble {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}
.chat-bubble.ai { align-items: flex-start; }
.chat-bubble.player { align-items: flex-end; }
.chat-bubble .bubble-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.chat-bubble.ai .bubble-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    color: var(--text);
}
.chat-bubble.player .bubble-content {
    background: linear-gradient(135deg, var(--main), var(--sub));
    border-top-right-radius: 4px;
    color: #fff;
}
.chat-bubble .bubble-time {
    font-size: 10px;
    color: var(--text-tip);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding: 10px 0;
    padding-bottom: calc(10px + var(--safe-bottom));
}
.chat-input-area .input {
    flex: 1;
    border-radius: 24px;
    padding: 12px 18px;
}
.chat-input-area .btn-send {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--main);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==================== 弹窗 ==================== */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.popup-overlay.show { display: flex; }
.popup-box {
    background: #1a1a35;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 28px 24px;
    width: 85%;
    max-width: 360px;
    text-align: center;
}
.popup-box .popup-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.popup-box .popup-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}
.popup-box .popup-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.popup-box .btn { width: 100%; }

/* ==================== 通用文本 ==================== */
.page-title-large {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-top: 60px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
    margin-bottom: 40px;
}
.form-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}
.form-spacer { height: 24px; }

/* 滚动条 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ==================== 世界详情全屏弹窗 ==================== */
.popup-fullscreen {
    align-items: flex-start;
    overflow: hidden;
}
.popup-world-detail {
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    position: relative;
    display: flex;
    flex-direction: column;
}
.pwd-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 110;
    backdrop-filter: blur(8px);
}
.pwd-banner {
    width: 100%; height: 200px;
    background: linear-gradient(135deg, var(--main-soft), var(--sub-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    flex-shrink: 0;
}
.pwd-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.pwd-name {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
}
.pwd-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.pwd-tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--main-soft);
    color: var(--main);
    border: 1px solid rgba(88,123,255,0.3);
}
.pwd-modules {}
.pwd-module {
    margin-bottom: 4px;
}
.pwd-split {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}
.pwd-module-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--main);
    margin-bottom: 12px;
}
.pwd-module-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.pwd-module-content p {
    margin-bottom: 6px;
}
.pwd-bottom-bar {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: rgba(10, 10, 26, 0.95);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.pwd-bottom-bar .btn { flex: 1; }
.pwd-bottom-bar .btn .btn-desc { display: block; font-size: 11px; opacity: 0.6; }

/* ===== 祈福按钮 ===== */
.btn-pray {
    background: linear-gradient(135deg, var(--sub), #FF69B4);
    color: #fff;
    border: none;
    font-size: 15px;
    padding: 16px;
    border-radius: var(--btn-radius);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}
.btn-pray:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.btn-pray:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    transform: none;
}
.pray-info {
    font-size: 11px;
    opacity: 0.7;
    font-weight: normal;
}

/* ===== 分享浮动按钮 ===== */
.share-float {
    position: absolute;
    top: 12px;
    right: 12px;
}
.nav-icon-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-icon-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--main);
}
.nav-icon-btn:active {
    transform: scale(0.9);
}

/* ===== 世界详情弹窗分享按钮 ===== */
.pwd-share {
    position: absolute;
    top: 14px;
    right: 52px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: background 0.2s;
}
.pwd-share:hover {
    background: rgba(255,255,255,0.2);
}

/* ==================== 奇遇弹窗 ==================== */
.popup-adventure {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}
.popup-adventure.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.popup-adventure-card {
    background: linear-gradient(160deg, #1a1a3e 0%, #12122a 100%);
    border: 1px solid rgba(157, 101, 255, 0.3);
    border-radius: 24px;
    padding: 28px 22px 22px;
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: slideUp 0.35s ease;
    box-shadow: 0 0 60px rgba(88, 123, 255, 0.2), 0 0 120px rgba(157, 101, 255, 0.1);
}

.pa-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.pa-title {
    font-size: 20px;
    font-weight: 800;
    color: #e8d5ff;
    margin-bottom: 10px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--main), var(--sub));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pa-world-tip {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding: 8px 14px;
    background: rgba(157, 101, 255, 0.1);
    border-radius: 10px;
}

.pa-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
    text-align: left;
}

.pa-brief-panel {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 12px;
    text-align: left;
}

.pa-brief-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}
.pa-brief-row + .pa-brief-row {
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pa-label {
    color: var(--text-tip);
}
.pa-brief-row span:last-child {
    color: var(--text);
    font-weight: 600;
    max-width: 180px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pa-notice {
    font-size: 12px;
    color: var(--text-tip);
    margin-bottom: 16px;
    line-height: 1.5;
}

.pa-btn-group {
    display: flex;
    gap: 10px;
}

.pa-btn {
    flex: 1;
    padding: 14px 0;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-height: 50px;
}
.pa-btn:active { transform: scale(0.95); }

.pa-btn-refuse {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
}
.pa-btn-refuse:hover {
    background: rgba(255,255,255,0.1);
}

.pa-btn-accept {
    background: linear-gradient(135deg, var(--main), var(--sub));
    color: #fff;
    box-shadow: 0 4px 20px rgba(88, 123, 255, 0.3);
}
.pa-btn-accept:hover {
    box-shadow: 0 6px 28px rgba(88, 123, 255, 0.45);
    transform: translateY(-1px);
}
.pa-btn-accept:active {
    transform: scale(0.95);
}

/* 奇遇分身列表标识 */
.contact-badge-adventure {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(157,101,255,0.2), rgba(88,123,255,0.2));
    color: var(--sub);
    margin-left: 6px;
    font-weight: 600;
}
.contact-badge-rare {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(255,180,0,0.2), rgba(255,100,0,0.2));
    color: #ffb400;
    margin-left: 4px;
    font-weight: 600;
}

/* 档案页奇遇标识 */
.result-badge-adventure {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(157,101,255,0.15), rgba(88,123,255,0.15));
    color: #c4a0ff;
    margin-bottom: 10px;
}
.result-badge-rare {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255,180,0,0.12);
    color: #ffb400;
    margin-left: 6px;
}

/* ==================== Codex polish: cinematic glass UI ==================== */
:root {
    --main: #6D8CFF;
    --sub: #B36CFF;
    --accent: #36E2FF;
    --warm: #FFD166;
    --main-soft: rgba(109, 140, 255, 0.18);
    --sub-soft: rgba(179, 108, 255, 0.16);
    --accent-soft: rgba(54, 226, 255, 0.12);
    --card-bg: rgba(13, 18, 44, 0.58);
    --card-hover: rgba(30, 38, 82, 0.72);
    --border: rgba(184, 205, 255, 0.16);
    --strong-border: rgba(184, 205, 255, 0.28);
    --text: #F3F7FF;
    --text-secondary: #B8C2E6;
    --text-tip: #7E8AB6;
    --shadow-lg: 0 22px 70px rgba(0, 0, 0, 0.42);
    --shadow-glow: 0 0 34px rgba(109, 140, 255, 0.30), 0 0 72px rgba(179, 108, 255, 0.16);
}

html { background: #050817; }
body {
    background:
        radial-gradient(circle at 16% 12%, rgba(54, 226, 255, 0.16), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(179, 108, 255, 0.18), transparent 30%),
        radial-gradient(circle at 50% 95%, rgba(109, 140, 255, 0.13), transparent 32%),
        linear-gradient(145deg, #050817 0%, #080B21 42%, #0D1230 100%);
    letter-spacing: 0.01em;
}

.cosmic-aurora,
.cosmic-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.cosmic-aurora { z-index: 0; filter: blur(28px); opacity: 0.72; }
.cosmic-aurora-a {
    background: conic-gradient(from 180deg at 25% 20%, transparent, rgba(54,226,255,.12), transparent, rgba(179,108,255,.16), transparent);
    animation: auroraDrift 14s ease-in-out infinite alternate;
}
.cosmic-aurora-b {
    background: radial-gradient(closest-side at 78% 70%, rgba(109,140,255,.18), transparent 70%);
    animation: auroraDrift 18s ease-in-out infinite alternate-reverse;
}
.cosmic-grid {
    z-index: 0;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 42%, black, transparent 78%);
}
@keyframes auroraDrift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

#particles-bg { z-index: 1; opacity: .92; }
.page {
    z-index: 2;
    padding-top: max(18px, env(safe-area-inset-top, 0px));
    padding-left: max(20px, calc((100vw - 560px) / 2));
    padding-right: max(20px, calc((100vw - 560px) / 2));
    scroll-behavior: smooth;
}
.page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.045), transparent 18%, transparent 74%, rgba(5,8,23,.62));
    z-index: -1;
}

.card,
.energy-bar,
.result-info-panel,
.accordion-item,
.contact-item,
.session-item,
.dynamic-tip-bar,
.popup-box,
.popup-adventure-card,
.world-card,
.filter-btn,
.filter-dropdown,
.top-switch-tabs,
.input,
.radio-item,
.tab-item,
.nav-back,
.nav-icon-btn {
    background: linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.035));
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 12px 36px rgba(0,0,0,.22);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}
.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.20), transparent);
    transform: translateX(-120%);
    transition: transform .65s ease;
    pointer-events: none;
}
.btn:hover::before { transform: translateX(120%); }
.btn-primary,
.btn-glow {
    background: linear-gradient(135deg, #6D8CFF 0%, #A86CFF 48%, #36E2FF 120%);
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,.24);
}
.btn-primary:hover:not(:disabled),
.btn-glow:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(109,140,255,.35), 0 0 72px rgba(179,108,255,.20);
}
.btn-outline {
    border-color: rgba(109, 140, 255, .46);
    color: #C9D5FF;
    background: linear-gradient(145deg, rgba(109,140,255,.12), rgba(255,255,255,.035));
}
.btn-outline:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(54,226,255,.62);
    background: linear-gradient(145deg, rgba(54,226,255,.14), rgba(109,140,255,.12));
}
.input {
    min-height: 56px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -20px 50px rgba(109,140,255,.035);
}
.input:focus {
    border-color: rgba(54,226,255,.72);
    box-shadow: 0 0 0 4px rgba(54,226,255,.10), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Entry screen */
.page-init-screen { justify-content: center; }
.init-shell {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    min-height: calc(100vh - 118px - var(--safe-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.brand-orb {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.28), transparent 22%),
        conic-gradient(from 0deg, #36E2FF, #6D8CFF, #B36CFF, #FFD166, #36E2FF);
    box-shadow: 0 0 38px rgba(54,226,255,.32), 0 0 86px rgba(179,108,255,.22);
    animation: portalSpin 9s linear infinite;
}
.brand-orb::before {
    content: "";
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: inherit;
    background: #0B102D;
    box-shadow: inset 0 0 32px rgba(109,140,255,.34);
}
.orb-core {
    position: relative;
    z-index: 1;
    font-size: 46px;
    line-height: 1;
    text-shadow: 0 0 22px rgba(54,226,255,.85);
}
@keyframes portalSpin { to { transform: rotate(360deg); } }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(54,226,255,.24);
    border-radius: 999px;
    color: #AEEFFF;
    background: rgba(54,226,255,.08);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.page-title-large {
    margin: 14px 0 0;
    font-size: clamp(34px, 9vw, 52px);
    line-height: 1.03;
    font-weight: 900;
    letter-spacing: -.05em;
    background: linear-gradient(135deg, #fff 8%, #C9D5FF 42%, #8EEBFF 72%, #F5D0FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 10px 44px rgba(109,140,255,.22);
}
.page-subtitle {
    max-width: 360px;
    margin: 14px auto 24px;
    color: #B8C2E6;
    line-height: 1.7;
}
.init-card {
    width: 100%;
    padding: 22px;
    border: 1px solid var(--strong-border);
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.13);
    backdrop-filter: blur(22px) saturate(150%);
}
.form-field { text-align: left; }
.form-label {
    color: #DDE7FF;
    font-weight: 800;
    letter-spacing: .02em;
}
.radio-item {
    gap: 8px;
    color: #DCE5FF;
    font-weight: 700;
}
.radio-item span { color: var(--accent); }
.radio-item.active {
    color: #fff;
    border-color: rgba(54,226,255,.66);
    background: linear-gradient(145deg, rgba(54,226,255,.18), rgba(109,140,255,.18));
    box-shadow: 0 0 0 4px rgba(54,226,255,.08), 0 14px 34px rgba(54,226,255,.12);
}
.init-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.init-hints span {
    flex: 1 1 auto;
    padding: 7px 9px;
    border-radius: 999px;
    color: #AEBBDF;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    font-size: 11px;
}
.bottom-fixed {
    left: max(20px, calc((100vw - 560px) / 2));
    right: max(20px, calc((100vw - 560px) / 2));
    bottom: calc(18px + var(--safe-bottom));
}

/* Home dashboard */
.page-home-screen { padding-top: 20px; }
.home-shell {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.home-hero {
    position: relative;
    min-height: 210px;
    padding: 24px;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--strong-border);
    background:
        linear-gradient(145deg, rgba(109,140,255,.26), rgba(179,108,255,.12) 48%, rgba(54,226,255,.11)),
        radial-gradient(circle at 76% 28%, rgba(255,255,255,.24), transparent 24%);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.18);
}
.home-hero::before,
.home-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.home-hero::before {
    width: 250px;
    height: 250px;
    right: -96px;
    top: -74px;
    border: 1px solid rgba(255,255,255,.20);
    box-shadow: inset 0 0 45px rgba(54,226,255,.12), 0 0 38px rgba(54,226,255,.12);
}
.home-hero::after {
    inset: auto -30px -80px auto;
    width: 160px;
    height: 160px;
    background: rgba(54,226,255,.10);
    filter: blur(10px);
}
.hero-copy { position: relative; z-index: 1; max-width: 310px; }
.hero-copy h2 {
    margin: 12px 0 10px;
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.08;
    letter-spacing: -.05em;
}
.hero-copy p { color: #D4DEFF; line-height: 1.7; font-size: 14px; }
.hero-portal {
    position: absolute;
    right: 28px;
    top: 28px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: conic-gradient(from 90deg, #36E2FF, #6D8CFF, #B36CFF, #36E2FF);
    box-shadow: 0 0 35px rgba(54,226,255,.28);
    animation: portalSpin 7s linear infinite;
}
.hero-portal::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: inherit;
    background: #0C1232;
}
.hero-portal span { position: relative; z-index: 1; font-size: 28px; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.24); opacity: .72; } }

.energy-bar {
    padding: 18px 20px;
    border-radius: 24px;
}
.energy-bar .energy-label { color: #EAF0FF; }
.energy-bar .energy-num span { color: #8EEBFF; font-size: 22px; }
.energy-bar .progress-track {
    height: 10px;
    background: rgba(1, 5, 17, .55);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: inset 0 1px 8px rgba(0,0,0,.28);
}
.energy-bar .progress-fill {
    background: linear-gradient(90deg, #36E2FF, #6D8CFF 48%, #B36CFF);
    box-shadow: 0 0 18px rgba(54,226,255,.56);
}
.energy-bar .energy-recover-text { color: #94A3D3; }
.home-actions { display: grid; gap: 12px; }
.explore-card {
    min-height: 110px;
    padding: 18px !important;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    text-align: left;
    gap: 14px;
    border-radius: 26px;
}
.explore-card:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(54,226,255,.55);
    box-shadow: 0 18px 46px rgba(0,0,0,.28), 0 0 34px rgba(54,226,255,.12);
}
.explore-card-primary {
    background: linear-gradient(145deg, rgba(109,140,255,.23), rgba(179,108,255,.12));
}
.action-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
    border: 1px solid rgba(255,255,255,.13);
    font-size: 28px;
}
.action-copy { display: grid; gap: 6px; min-width: 0; }
.action-copy strong { font-size: 18px; color: #fff; letter-spacing: -.02em; }
.action-copy em { font-style: normal; font-size: 12px; color: #AEBBDF; line-height: 1.5; }
.cost-pill {
    min-width: 44px;
    padding: 7px 9px;
    border-radius: 999px;
    color: #10162E;
    background: linear-gradient(135deg, #8EEBFF, #FFD166);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}
.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 6px;
}
.home-stats div {
    padding: 13px 8px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    text-align: center;
    background: rgba(255,255,255,.045);
}
.home-stats strong {
    display: block;
    color: #fff;
    font-size: 18px;
    line-height: 1;
}
.home-stats span {
    display: block;
    margin-top: 6px;
    color: #8F9CCB;
    font-size: 11px;
}
.share-float {
    top: 22px;
    right: max(20px, calc((100vw - 560px) / 2));
    z-index: 5;
}

/* Navigation and tabs */
.nav-bar {
    min-height: 50px;
    padding: 4px 0 12px;
}
.nav-title {
    max-width: 260px;
    font-size: 17px;
    color: #F3F7FF;
}
.nav-back,
.nav-icon-btn {
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.nav-back:hover,
.nav-icon-btn:hover {
    border-color: rgba(54,226,255,.45);
    color: #fff;
    transform: translateY(-1px);
}
.tab-bar {
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 580px);
    border: 1px solid rgba(255,255,255,.10);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    background: rgba(8, 11, 33, .82);
    box-shadow: 0 -18px 60px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.09);
}
.tab-bar-item { padding-top: 10px; }
.tab-bar-item.active {
    color: #8EEBFF;
    text-shadow: 0 0 18px rgba(54,226,255,.32);
}
.tab-bar-item.active .tab-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 12px rgba(54,226,255,.4));
}
.top-switch-tabs {
    padding: 5px;
    border-radius: 20px;
    gap: 5px;
}
.switch-tab { border-radius: 16px; }
.switch-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(109,140,255,.44), rgba(179,108,255,.30));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 22px rgba(109,140,255,.16);
}

/* World gallery */
.tab-scroll { gap: 10px; padding: 2px 0 14px; }
.tab-item {
    padding: 10px 18px;
    color: #B8C2E6;
}
.tab-item.active {
    color: #fff;
    border-color: rgba(54,226,255,.52);
    background: linear-gradient(135deg, rgba(54,226,255,.16), rgba(109,140,255,.16));
}
.world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.world-card {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: 18px 14px;
}
.world-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    opacity: 0;
    background: radial-gradient(circle at 50% 0%, rgba(54,226,255,.25), transparent 45%);
    transition: opacity .3s ease;
}
.world-card:hover {
    transform: translateY(-4px);
    border-color: rgba(54,226,255,.52);
    box-shadow: 0 18px 46px rgba(0,0,0,.32), 0 0 36px rgba(54,226,255,.10);
}
.world-card:hover::before { opacity: 1; }
.world-card .world-cover {
    position: relative;
    width: 74px;
    height: 74px;
    margin-bottom: 14px;
    font-size: 34px;
    background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.26), transparent 28%), linear-gradient(135deg, rgba(54,226,255,.28), rgba(179,108,255,.20));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 12px 32px rgba(54,226,255,.12);
}
.world-card .world-name { position: relative; font-size: 15px; color: #fff; }
.world-card .world-desc { position: relative; color: #AEBBDF; font-size: 12px; }

/* Loading */
.loading-animation::before {
    content: "";
    width: 210px;
    height: 210px;
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(54,226,255,.18), transparent 62%);
    filter: blur(6px);
}
.loading-ring {
    width: 104px;
    height: 104px;
    border-width: 2px;
    border-color: rgba(255,255,255,.10);
    border-top-color: #8EEBFF;
    border-right-color: #B36CFF;
    box-shadow: 0 0 38px rgba(54,226,255,.20);
}
.loading-text {
    position: relative;
    color: #DCE5FF;
    font-weight: 700;
    letter-spacing: .04em;
}

/* Result / archive */
.result-info-panel {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-color: rgba(54,226,255,.22);
}
.result-info-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 95% 0%, rgba(54,226,255,.17), transparent 38%);
    pointer-events: none;
}
.result-info-panel .info-row {
    position: relative;
    padding: 9px 0;
    color: #DDE7FF;
}
.accordion-item {
    border-radius: 22px;
    overflow: hidden;
}
.accordion-item.open {
    border-color: rgba(54,226,255,.45);
    box-shadow: 0 18px 42px rgba(0,0,0,.24), 0 0 26px rgba(54,226,255,.08);
}
.accordion-header { padding: 17px 18px; }
.accordion-header .acc-title { color: #F4F7FF; }
.accordion-body { color: #BFC9EE; }
.result-actions {
    padding: 10px 0 14px;
}
.btn-pray {
    border: 1px solid rgba(255, 209, 102, .30);
    background: linear-gradient(135deg, rgba(255,209,102,.20), rgba(179,108,255,.12));
    color: #FFE5A6;
}
.btn-pray:hover { box-shadow: 0 10px 32px rgba(255,209,102,.14); }
.contact-item,
.session-item {
    border-radius: 22px;
    padding: 15px;
}
.contact-item:hover,
.session-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(0,0,0,.25), 0 0 28px rgba(54,226,255,.08);
}
.contact-avatar,
.session-item-avatar {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 24px rgba(109,140,255,.22);
}
.contact-chat-btn {
    color: #8EEBFF;
    border-color: rgba(54,226,255,.45);
    background: rgba(54,226,255,.10);
}
.filter-dropdown { box-shadow: 0 18px 46px rgba(0,0,0,.36); }

/* Chat */
.dynamic-tip-bar {
    color: #BFC9EE;
    border-color: rgba(54,226,255,.18);
}
.chat-container {
    padding: 14px 2px 18px;
}
.chat-bubble .bubble-content {
    max-width: min(82%, 420px);
    padding: 13px 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.chat-bubble.ai .bubble-content {
    background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    border-color: rgba(255,255,255,.12);
}
.chat-bubble.player .bubble-content {
    background: linear-gradient(135deg, #6D8CFF, #B36CFF);
    box-shadow: 0 14px 38px rgba(109,140,255,.24);
}
.chat-input-area {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(5,8,23,.74) 18%, rgba(5,8,23,.92));
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
}
.chat-input-area .btn-send {
    background: linear-gradient(135deg, #36E2FF, #6D8CFF 56%, #B36CFF);
    box-shadow: 0 14px 36px rgba(54,226,255,.22);
}

/* Popups and world detail */
.popup-overlay {
    background: rgba(3, 5, 18, 0.74);
    backdrop-filter: blur(14px) saturate(130%);
}
.popup-box {
    background: linear-gradient(160deg, rgba(20,28,64,.92), rgba(11,16,45,.94));
    border-color: rgba(184,205,255,.20);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(109,140,255,.18);
}
.popup-box .popup-title { color: #fff; font-size: 20px; }
.popup-world-detail {
    background:
        radial-gradient(circle at 50% 0%, rgba(109,140,255,.18), transparent 36%),
        #070A1E;
}
.pwd-banner {
    min-height: 230px;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.26), transparent 22%),
        conic-gradient(from 160deg, rgba(54,226,255,.22), rgba(109,140,255,.24), rgba(179,108,255,.24), rgba(54,226,255,.22));
    font-size: 74px;
    text-shadow: 0 0 34px rgba(255,255,255,.32);
}
.pwd-name {
    color: #fff;
    font-size: 30px;
    letter-spacing: -.04em;
}
.pwd-tag {
    color: #CBF7FF;
    border-color: rgba(54,226,255,.28);
    background: rgba(54,226,255,.10);
}
.pwd-module {
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 16px;
    margin-top: 14px;
}
.pwd-split { display: none; }
.pwd-module-title { color: #fff; }
.pwd-bottom-bar {
    background: rgba(8,11,33,.86);
    border-top: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
}
.pwd-close,
.pwd-share {
    background: rgba(8,11,33,.58);
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(12px);
}
.popup-adventure-card {
    background: linear-gradient(160deg, rgba(28,25,76,.95), rgba(10,14,42,.96));
    border-color: rgba(179,108,255,.34);
}

@media (min-width: 760px) {
    .world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-shell { max-width: 560px; }
}
@media (max-width: 390px) {
    .explore-card { grid-template-columns: 48px minmax(0, 1fr); }
    .cost-pill { grid-column: 2; justify-self: start; }
    .action-icon { width: 48px; height: 48px; border-radius: 16px; }
    .home-hero { min-height: 190px; padding: 20px; }
    .hero-portal { width: 70px; height: 70px; right: 18px; top: 18px; }
    .bottom-bar-3 { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Small layout fixes for the polished entry screen */
.brand-orb { position: relative; }
.bottom-fixed {
    position: fixed;
    z-index: 30;
    max-width: 560px;
    margin: 0 auto;
}

/* ==================== ÒôЧ¿ª¹Ø ==================== */
.sound-toggle {
    position: fixed;
    right: max(18px, calc((100vw - 560px) / 2));
    bottom: calc(86px + var(--safe-bottom));
    z-index: 120;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(184,205,255,.18);
    color: #fff;
    background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 34px rgba(0,0,0,.28), 0 0 30px rgba(54,226,255,.12);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    font-size: 20px;
    cursor: pointer;
    transition: transform .22s ease, opacity .22s ease, border-color .22s ease;
}
.sound-toggle:hover { transform: translateY(-2px) scale(1.04); border-color: rgba(54,226,255,.48); }
.sound-toggle.muted { opacity: .62; }
#page_init.active ~ .sound-toggle,
#page_loading.active ~ .sound-toggle { bottom: calc(24px + var(--safe-bottom)); }
