:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --glass-bg: rgba(26, 26, 37, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --accent-lime: #c8ff00;
    --accent-purple: #6366f1;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-usd: #c8ff00;
    --accent-rub: #6366f1;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --shadow-glow: 0 0 40px rgba(200, 255, 0, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
    touch-action: manipulation;
}

.app-container {
    position: relative;
    min-height: 100vh;
    padding-bottom: 40px;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(200, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.bg-glow.green {
    background: var(--accent-lime);
    top: -100px;
    right: -100px;
}

.bg-glow.purple {
    background: var(--accent-purple);
    bottom: 20%;
    left: -150px;
}

.glass-header {
    position: relative;
    z-index: 10;
    padding: 20px;
    background: linear-gradient(180deg, rgba(26, 26, 37, 0.8) 0%, transparent 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.emoji-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    height: 100px;
    align-items: center;
    perspective: 1000px;
}

.emoji-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.money-emoji {
    font-size: 70px;
    display: block;
    transition: transform 0.15s ease-out;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transform-style: preserve-3d;
    position: relative;
    filter: drop-shadow(0 10px 30px rgba(200, 255, 0, 0.4));
}

.money-emoji::before {
    content: '🤑';
    position: absolute;
    top: 0;
    left: 0;
    transform: translateZ(-4px);
    filter: brightness(0.7) blur(0.5px);
    opacity: 0.6;
}

.money-emoji::after {
    content: '🤑';
    position: absolute;
    top: 0;
    left: 0;
    transform: translateZ(-8px);
    filter: brightness(0.5) blur(1px);
    opacity: 0.3;
}

.emoji-depth-1,
.emoji-depth-2,
.emoji-depth-3 {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 70px;
    pointer-events: none;
}

.emoji-depth-1 {
    transform: translateZ(-2px);
    filter: brightness(0.85) blur(0.3px);
    opacity: 0.8;
}

.emoji-depth-2 {
    transform: translateZ(-6px);
    filter: brightness(0.6) blur(0.8px);
    opacity: 0.5;
}

.emoji-depth-3 {
    transform: translateZ(-10px);
    filter: brightness(0.4) blur(1.5px);
    opacity: 0.25;
}

.emoji-highlight {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translateZ(2px);
}

.emoji-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotateX(90deg);
    width: 60px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
    transition: all 0.15s ease-out;
}

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

.money-emoji {
    animation: float 4s ease-in-out infinite;
}

.money-emoji:hover {
    filter: drop-shadow(0 15px 40px rgba(200, 255, 0, 0.6));
}

.money-emoji.jump {
    animation: jump 0.5s ease;
}

@keyframes jump {
    0% { transform: translateZ(0) scale(1) rotateY(var(--rotateY, 0)) rotateX(var(--rotateX, 0)); }
    30% { transform: translateZ(50px) scale(1.2) rotateY(var(--rotateY, 0)) rotateX(var(--rotateX, 0)); }
    60% { transform: translateZ(-10px) scale(0.95) rotateY(var(--rotateY, 0)) rotateX(var(--rotateX, 0)); }
    100% { transform: translateZ(0) scale(1) rotateY(var(--rotateY, 0)) rotateX(var(--rotateX, 0)); }
}

.totals-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.total-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.total-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.total-card.usd::before {
    background: var(--accent-usd);
    box-shadow: 0 0 10px var(--accent-usd);
}

.total-card.rub::before {
    background: var(--accent-rub);
    box-shadow: 0 0 10px var(--accent-rub);
}

.total-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.total-amount {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

@media (max-width: 380px) {
    .total-amount {
        font-size: 18px;
    }
}

.total-card.usd .total-amount {
    color: var(--accent-usd);
}

.total-card.rub .total-amount {
    color: var(--accent-rub);
}

.total-count {
    font-size: 12px;
    color: var(--text-muted);
}

.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-lime);
    border: none;
    color: #000;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(200, 255, 0, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(200, 255, 0, 0.6);
}

.fab-btn:active {
    transform: scale(0.95);
}

.goals-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 5;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-glow {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 255, 0, 0.2) 0%, transparent 70%);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-hint {
    font-size: 14px;
}

.goal-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-card);
}

.goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-color, var(--accent-lime));
    opacity: 0.8;
}

.goal-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.goal-card.currency-usd::before {
    background: var(--accent-usd);
}

.goal-card.currency-rub::before {
    background: var(--accent-rub);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.goal-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.goal-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.goal-currency-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    font-weight: 600;
}

.goal-card.currency-usd .goal-currency-badge {
    color: var(--accent-usd);
    border-color: rgba(200, 255, 0, 0.3);
    background: rgba(200, 255, 0, 0.1);
}

.goal-card.currency-rub .goal-currency-badge {
    color: var(--accent-rub);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
}

.goal-progress-section {
    margin-bottom: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.progress-current {
    font-size: 24px;
    font-weight: 700;
}

.goal-card.currency-usd .progress-current {
    color: var(--accent-usd);
}

.goal-card.currency-rub .progress-current {
    color: var(--accent-rub);
}

.progress-target {
    font-size: 14px;
    color: var(--text-muted);
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px var(--card-color, var(--accent-lime));
}

.goal-card.currency-usd .progress-bar-fill {
    background: var(--accent-usd);
    box-shadow: 0 0 10px var(--accent-usd);
}

.goal-card.currency-rub .progress-bar-fill {
    background: var(--accent-rub);
    box-shadow: 0 0 10px var(--accent-rub);
}

.progress-percentage {
    position: absolute;
    right: 0;
    top: -24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.goal-actions {
    display: flex;
    gap: 10px;
}

.goal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.goal-btn.primary {
    color: #000;
}

.goal-card.currency-usd .goal-btn.primary {
    background: var(--accent-usd);
}

.goal-card.currency-rub .goal-btn.primary {
    background: var(--accent-rub);
    color: #fff;
}

.goal-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    width: 40px;
    flex: none;
}

.goal-btn:hover {
    transform: scale(1.02);
}

.goal-btn:active {
    transform: scale(0.98);
}

.goal-card.completed {
    opacity: 0.9;
}

.goal-card.completed .progress-bar-fill {
    background: var(--accent-lime) !important;
    box-shadow: 0 0 20px rgba(200, 255, 0, 0.5) !important;
}

.completed-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    background: var(--accent-lime);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 14px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-sheet {
    position: relative;
    background: var(--bg-card);
    border-radius: 32px 32px 0 0;
    padding: 20px 24px 40px;
    border-top: 1px solid var(--glass-border);
    animation: slideUp 0.3s ease;
}

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

.sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 24px;
}

.modal-sheet h2 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
}

.input-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-lime);
    background: rgba(200, 255, 0, 0.05);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrapper input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.flex-1 {
    flex: 1;
}

.currency-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
}

.currency-option {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.currency-option.active[data-curr="USD"] {
    background: var(--accent-usd);
    color: #000;
}

.currency-option.active[data-curr="RUB"] {
    background: var(--accent-rub);
    color: #fff;
}

.color-picker {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color);
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.color-option.active {
    border-color: #fff;
    transform: scale(1.1);
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 16px;
    font-weight: bold;
}

.action-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.action-btn.primary {
    background: var(--accent-lime);
    color: #000;
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(200, 255, 0, 0.4);
}

.goal-preview {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.goal-preview-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.goal-preview-amount {
    font-size: 18px;
    font-weight: 600;
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
    padding-left: 16px;
}

.currency-symbol {
    font-size: 24px;
    font-weight: 700;
    margin-right: 8px;
}

.currency-symbol[data-curr="USD"] {
    color: var(--accent-usd);
}

.currency-symbol[data-curr="RUB"] {
    color: var(--accent-rub);
}

.amount-input-wrapper input {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    padding: 20px;
}

.amount-input-wrapper input::-webkit-outer-spin-button,
.amount-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-input-wrapper input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.quick-amounts {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: rgba(200, 255, 0, 0.1);
    color: var(--accent-lime);
    border-color: var(--accent-lime);
}

.hidden {
    display: none !important;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

@keyframes particle-fly {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(720deg);
        opacity: 0;
    }
}