* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px;
}
.header {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.2);
}
.header h1 {
    font-size: 24px;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
}
.page {
    display: none;
    padding: 15px;
    animation: fadeIn 0.3s;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-title {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 27, 75, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}
.nav-btn {
    background: none;
    border: none;
    color: white;
    padding: 5px 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    opacity: 0.6;
    transition: all 0.3s;
    font-size: 12px;
}
.nav-btn.active {
    opacity: 1;
    color: #ffd700;
}
.nav-btn span {
    font-size: 24px;
}
.balance-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.balance-display .stars-icon {
    font-size: 30px;
    margin-right: 10px;
}
.balance-display #balance {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}
.energy-bar {
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    height: 30px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255,255,255,0.1);
}
.energy-fill {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 13px;
}
.energy-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    z-index: 1;
}
.clicker-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 20px auto;
}
.clicker-button {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #ffd700, #ffed4e, #ffa500);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4), 
                inset 0 -10px 20px rgba(0,0,0,0.2),
                0 0 60px rgba(255,215,0,0.3);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    border: 5px solid rgba(255,255,255,0.2);
}
.clicker-button:active {
    transform: scale(0.95);
}
.clicker-button.shake {
    animation: shake 0.3s;
}
@keyframes shake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(0.98); }
    75% { transform: rotate(15deg) scale(0.98); }
}
.small-star {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    animation: float 1s ease-out forwards;
    z-index: 1000;
}
@keyframes float {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
    }
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}
.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}
.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.8;
}
.stat-card p {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
}
.x2-timer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}
.x2-timer.active {
    animation: pulse 1s infinite;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255,215,0,0.6);
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255,215,0,0.4); transform: scale(1); }
    50% { box-shadow: 0 0 40px rgba(255,215,0,0.8); transform: scale(1.02); }
}
.upgrade-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.upgrade-info h3 {
    margin-bottom: 8px;
    font-size: 18px;
}
.upgrade-info p {
    font-size: 14px;
    opacity: 0.7;
}
.upgrade-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
    transition: all 0.2s;
    font-size: 14px;
}
.upgrade-btn:active {
    transform: scale(0.95);
}
.upgrade-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.leaderboard-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}
.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0.05) 100%);
    border: 2px solid rgba(255,215,0,0.4);
}
.rank {
    font-size: 24px;
    font-weight: bold;
    width: 40px;
}
.rank.gold { color: #ffd700; }
.rank.silver { color: #c0c0c0; }
.rank.bronze { color: #cd7f32; }
.username {
    flex: 1;
    margin-left: 15px;
    font-weight: 500;
}
.user-stars {
    font-weight: bold;
    color: #ffd700;
    font-size: 16px;
}
.daily-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}
.daily-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}
.daily-item:active {
    transform: scale(0.95);
}
.daily-item.claimed {
    opacity: 0.4;
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}
.daily-item.current {
    border-color: #ffd700;
    animation: glow 2s infinite;
    background: rgba(255,215,0,0.1);
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.5); }
    50% { box-shadow: 0 0 25px rgba(255,215,0,0.8); }
}
.daily-item h4 {
    font-size: 14px;
    margin-bottom: 5px;
}
.daily-item p {
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
}
.missions-section {
    margin-top: 20px;
}
.mission-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}
.mission-info h3 {
    margin-bottom: 5px;
    font-size: 16px;
}
.mission-info p {
    font-size: 14px;
    opacity: 0.7;
}
.mission-progress {
    margin-top: 8px;
    font-size: 12px;
    color: #ffd700;
}
.claim-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.claim-btn:active {
    transform: scale(0.95);
}
.claim-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.5;
}
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
}
.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    border: 4px solid #ffd700;
    box-shadow: 0 0 30px rgba(255,215,0,0.3);
}
.profile-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.achievement-item {
    text-align: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}
.achievement-item.unlocked {
    border-color: #ffd700;
    background: rgba(255,215,0,0.1);
}
.achievement-item.locked {
    opacity: 0.4;
}
.achievement-icon {
    font-size: 40px;
    margin-bottom: 10px;
}
.achievement-item h4 {
    font-size: 14px;
    margin-bottom: 5px;
}
.achievement-item p {
    font-size: 12px;
    opacity: 0.7;
}
.stats-grid-profile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}
.stat-box {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}
.stat-box h4 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.8;
}
.stat-box p {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
}
.history-list {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
}
.history-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}
.history-item:last-child {
    border-bottom: none;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    border: 3px solid #ffd700;
    animation: modalPop 0.3s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.modal-content h2 {
    margin-bottom: 15px;
    color: #ffd700;
    font-size: 24px;
}
.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}
.modal-content button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}
.modal-content button:active {
    transform: scale(0.95);
}
.planet {
    background: radial-gradient(circle at 30% 30%, #4ade80, #22c55e, #15803d) !important;
    box-shadow: 0 10px 40px rgba(74, 222, 128, 0.4), 
                inset 0 -10px 20px rgba(0,0,0,0.2),
                0 0 60px rgba(74,222,128,0.3) !important;
}
.system {
    background: radial-gradient(circle at 30% 30%, #f87171, #ef4444, #b91c1c) !important;
    box-shadow: 0 10px 40px rgba(248, 113, 113, 0.4), 
                inset 0 -10px 20px rgba(0,0,0,0.2),
                0 0 60px rgba(248,113,113,0.3),
                0 0 100px rgba(255,215,0,0.2) !important;
}
.universe {
    border-radius: 50% !important;
    background: radial-gradient(circle at 30% 30%, #a78bfa, #8b5cf6, #6d28d9) !important;
    box-shadow: 0 10px 40px rgba(167, 139, 250, 0.4), 
                inset 0 -10px 20px rgba(0,0,0,0.2),
                0 0 80px rgba(139, 92, 246, 0.5),
                0 0 120px rgba(167,139,250,0.3) !important;
}