
:root {
    --night: #0A0E1A;
    --panel: rgba(26, 31, 53, 0.75);
    --moon: #C7D0E8;
    --purple: #7B68EE;
    --teal: #4ECDC4;
    --gold: #FFB86C;
    --muted: #929BB8;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--moon);
    background: var(--night);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: 0;
}

.hidden {
    display: none !important;
}

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--night);
    z-index: 100;
    gap: 20px;
}

.loading-moon {
    font-size: 72px;
    animation: moonFloat 2s infinite ease-in-out;
    filter: drop-shadow(0 0 30px #7B68EE);
}

.loading-title {
    letter-spacing: 3px;
    color: var(--moon);
}

.loading-line {
    width: 170px;
    height: 3px;
    background: #252B45;
    border-radius: 10px;
    overflow: hidden;
}

.loading-line span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--purple);
    animation: loading 1.3s infinite ease-in-out;
}

.app {
    position: relative;
    min-height: 100vh;
    padding-bottom: 105px;
    isolation: isolate;
    animation: fadeIn .7s ease;
}

#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -5;
    pointer-events: none;
}

.fog {
    position: fixed;
    width: 120vw;
    height: 250px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .12;
    pointer-events: none;
    z-index: -3;
    animation: fogMove 18s infinite alternate ease-in-out;
}

.fog-one {
    background: #7766DD;
    bottom: 10%;
    left: -40%;
}

.fog-two {
    background: #35AFAF;
    bottom: 25%;
    right: -50%;
    animation-delay: -8s;
}

.city {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 75px;
    height: 190px;
    opacity: .35;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(to top, #080C18, transparent),
        repeating-linear-gradient(
            90deg,
            transparent 0 18px,
            #202640 19px 38px,
            transparent 39px 50px
        );
    clip-path: polygon(
        0 60%, 5% 60%, 5% 40%, 10% 40%,
        10% 68%, 17% 68%, 17% 28%,
        24% 28%, 24% 60%, 32% 60%,
        32% 42%, 40% 42%, 40% 70%,
        50% 70%, 50% 20%, 58% 20%,
        58% 65%, 66% 65%, 66% 40%,
        74% 40%, 74% 65%, 83% 65%,
        83% 35%, 91% 35%, 91% 62%,
        100% 62%, 100% 100%, 0 100%
    );
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 34px;
    color: var(--gold);
    filter: drop-shadow(0 0 12px var(--gold));
}

.brand-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 8px;
    color: var(--muted);
    margin-top: 5px;
    letter-spacing: 1px;
}

.energy-box {
    display: flex;
    gap: 7px;
    padding: 9px 12px;
    background: var(--panel);
    border: 1px solid #ffffff12;
    border-radius: 30px;
    font-size: 12px;
}

.screen {
    display: none;
    padding: 12px 20px 30px;
    animation: screenIn .35s ease;
}

.screen.active {
    display: block;
}

.location-label {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 15px;
}

.moon-area {
    height: 245px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 5px;
}

.moon-glow {
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: #B9C8FF;
    opacity: .12;
    filter: blur(45px);
    animation: pulse 3s infinite alternate;
}

.moon {
    position: relative;
    z-index: 2;
    font-size: 118px;
    background: transparent;
    filter: drop-shadow(0 0 30px #C7D0E8AA);
    animation: moonFloat 4s infinite ease-in-out;
    transition: transform .15s, filter .15s;
}

.moon:active {
    transform: scale(.88);
    filter: drop-shadow(0 0 40px var(--gold));
}

.moon-orbit {
    position: absolute;
    width: 210px;
    height: 210px;
    border: 1px solid #C7D0E822;
    border-radius: 50%;
    animation: orbit 18s linear infinite;
}

.orbit-two {
    width: 250px;
    height: 250px;
    border-color: #7B68EE22;
    animation-direction: reverse;
}

.dust-panel {
    text-align: center;
    padding: 15px;
}

.dust-caption, .eyebrow {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--muted);
    font-weight: 700;
}

.dust-number {
    font-size: clamp(40px, 12vw, 58px);
    font-weight: 800;
    margin: 10px 0;
    color: #FFF0D6;
    text-shadow: 0 0 25px #FFB86C66;
    font-variant-numeric: tabular-nums;
}

.dust-power {
    color: var(--gold);
    font-size: 13px;
}

.tap-hint {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 10px 0 22px;
}

.progress-panel, .settings-card, .profile-card {
    background: var(--panel);
    backdrop-filter: blur(18px);
    border: 1px solid #ffffff14;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 15px 40px #00000030;
}

.progress-heading {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.progress-track {
    height: 8px;
    background: #ffffff13;
    border-radius: 20px;
    overflow: hidden;
    margin: 13px 0 8px;
}

.progress-fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--purple), var(--teal));
    transition: width .4s ease;
}

.energy-note {
    color: var(--muted);
    font-size: 10px;
}

.daily-button {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 16px;
    border-radius: 15px;
    color: white;
    font-weight: 700;
    background: linear-gradient(120deg, #6955D5, #3A9E9D);
    box-shadow: 0 8px 25px #6955D544;
    transition: transform .2s;
    animation: gentlePulse 3s infinite;
}

.daily-button:active {
    transform: scale(.96);
}

.section-heading {
    margin: 20px 0 24px;
}

.section-heading h1 {
    font-size: 30px;
    margin: 9px 0;
}

.section-heading p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.upgrade-card, .location-card, .stat-card {
    background: var(--panel);
    border: 1px solid #ffffff15;
    backdrop-filter: blur(15px);
    border-radius: 19px;
    padding: 16px;
    animation: fadeIn .4s ease;
}

.upgrade-icon {
    font-size: 34px;
}

.upgrade-card h3 {
    font-size: 13px;
}

.upgrade-card p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    min-height: 32px;
}

.upgrade-card button, .location-card button {
    width: 100%;
    padding: 11px 5px;
    border-radius: 11px;
    background: #7B68EE30;
    color: #C7BDFF;
    font-size: 11px;
    font-weight: 700;
}

.upgrade-card button:active, .location-card button:active {
    transform: scale(.95);
}

.location-list {
    display: grid;
    gap: 14px;
}

.location-card {
    padding: 20px;
    background: linear-gradient(135deg, #252A48AA, #131B30CC);
}

.location-card h3 {
    font-size: 17px;
    margin: 5px 0;
}

.location-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.location-card.locked {
    opacity: .55;
}

.profile-card {
    text-align: center;
    margin-bottom: 15px;
}

.avatar {
    font-size: 54px;
    filter: drop-shadow(0 0 20px var(--purple));
}

.profile-card h2 {
    margin: 10px 0 5px;
}

.profile-card p {
    color: var(--muted);
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card span {
    font-size: 24px;
}

.stat-card strong {
    font-size: 23px;
}

.stat-card small {
    color: var(--muted);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 14px;
}

.setting-row + .setting-row {
    border-top: 1px solid #ffffff12;
}

.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    padding: 10px 4px;
    background: #151A2BE8;
    backdrop-filter: blur(22px);
    border: 1px solid #ffffff18;
    border-radius: 22px;
    box-shadow: 0 10px 40px #0008;
}

.nav-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: #747D9B;
    padding: 7px 0;
    border-radius: 14px;
    transition: .25s;
}

.nav-button span {
    font-size: 20px;
}

.nav-button small {
    font-size: 9px;
}

.nav-button.active {
    color: var(--teal);
    background: #4ECDC415;
    text-shadow: 0 0 15px var(--teal);
}

.toast {
    position: fixed;
    z-index: 50;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-15px);
    padding: 12px 20px;
    background: #292F4D;
    border: 1px solid #ffffff22;
    border-radius: 30px;
    color: white;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .3s;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.particle {
    position: fixed;
    z-index: 30;
    pointer-events: none;
    color: var(--gold);
    font-weight: 800;
    animation: particleFly .8s ease-out forwards;
}

@keyframes particleFly {
    to {
        transform: translateY(-85px) scale(.4);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes screenIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes moonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes pulse {
    from { transform: scale(.9); opacity: .1; }
    to { transform: scale(1.2); opacity: .22; }
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

@keyframes fogMove {
    from { transform: translateX(-8%); }
    to { transform: translateX(8%); }
}

@keyframes loading {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 8px 25px #6955D544; }
    50% { box-shadow: 0 8px 32px #4ECDC466; }
}

@media (max-width: 360px) {
    .nav-button small { font-size: 8px; }
    .nav-button span { font-size: 17px; }
    .moon { font-size: 100px; }
    .upgrade-grid { gap: 8px; }
}
