:root {
    --bg-color: #050505;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #00d2ff;
    --secondary-color: #9d50bb;
    --accent-gold: #d4af37;
    --text-color: #f0f0f0;
    --danger-color: #ff4b2b;
    --safe-color: #00ff88;
}

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

body {
    font-family: 'Outfit', 'Noto Serif TC', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #050505 100%);
}

/* Background Effects */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 10% 20%, white, transparent),
                      radial-gradient(1px 1px at 30% 50%, white, transparent),
                      radial-gradient(2px 2px at 70% 80%, white, transparent),
                      radial-gradient(1px 1px at 90% 10%, white, transparent);
    background-size: 200px 200px;
    opacity: 0.3;
    z-index: 0;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.2;
}

#orb1 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
}

#orb2 {
    width: 250px;
    height: 250px;
    background: var(--secondary-color);
    bottom: -50px;
    left: -50px;
}

/* Header */
header {
    height: 60px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.player-info {
    display: flex;
    flex-direction: column;
}

#player-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.realm-badge {
    font-size: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    width: fit-content;
}

.currency {
    background: var(--glass-bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border: 1px solid var(--glass-border);
}

/* Main */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    z-index: 1;
    overflow-y: auto;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
}

/* Cultivation Section */
.cultivate-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.meditation-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.1);
}

.inner-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(0, 210, 255, 0.3);
    animation: rotate 10s linear infinite;
}

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

.character-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(157, 80, 187, 0.4);
    animation: float 4s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Progress Bar */
.progress-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-labels, .qi-digits {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #aaa;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.3s ease;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item .label {
    font-size: 0.8rem;
    color: #888;
}

.stat-item .value {
    font-weight: 600;
    color: var(--text-color);
}

/* Actions */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.btn {
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.btn-primary {
    background: linear-gradient(45deg, #d4af37, #b8860b);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.btn-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Log */
.log-container {
    height: 150px;
    display: flex;
    flex-direction: column;
}

.log-header {
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 4px;
    letter-spacing: 2px;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 4px;
    opacity: 0.9;
}

.log-entry.system { color: var(--safe-color); }
.log-entry.danger { color: var(--danger-color); }

/* Navigation */
nav {
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 10, 20, 0.95);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    padding-bottom: 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: #666;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

/* Spirit Particles */
.spirit-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    filter: blur(1px);
}

/* Hidden elements */
.hidden { display: none !important; }

/* Ascension Overlay */
#ascension-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.ascension-text {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px blue;
}
