:root {
    --bg-color: #0d0d12;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8e8e93;
    
    /* Новые градиенты и цвета */
    --cyan: #00f2fe;
    --blue: #4facfe;
    --accent-gradient: linear-gradient(90deg, var(--cyan) 0%, var(--blue) 100%);
    --accent-glow: rgba(0, 242, 254, 0.4);
    
    --green: #00e676;
    --green-glow: rgba(0, 230, 118, 0.4);
    
    --empty-square: #1c1c1e;
    --done-square: var(--green);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 20px;
    padding-bottom: 40px;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    text-align: center;
    margin-bottom: 10px;
}

.title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--cyan);
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Инфографика */
.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.info-header h2 {
    font-size: 18px;
    font-weight: 600;
}
.info-days {
    font-size: 12px;
    color: var(--cyan);
    background: rgba(0, 242, 254, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.info-content {
    display: flex;
    align-items: center;
    gap: 24px;
}
.ring-container {
    position: relative;
    width: 100px;
    height: 100px;
}
.progress-ring__circle {
    transition: stroke-dashoffset 1s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-linecap: round;
}
.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}
.info-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

/* Метрики и Инпуты */
.metric-section {
    margin-bottom: 24px;
}
.metric-section:last-child {
    margin-bottom: 0;
}
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.metric-header h2 {
    font-size: 18px;
    font-weight: 600;
}
.goal {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 12px;
}
.input-group {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
}
input[type="number"] {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 32px;
    font-weight: 800;
    width: 160px;
    outline: none;
}
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
.unit {
    color: var(--text-muted);
    font-size: 16px;
    margin-left: 8px;
}

/* Custom Slider */
.styled-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    margin-bottom: 12px;
}
.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    border: 3px solid var(--cyan);
}

/* Progress Bars */
.progress-container {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: var(--accent-gradient);
    transition: width 0.3s ease, box-shadow 0.3s ease;
}
.progress-bar.glow {
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Main Button */
.primary-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
}
.primary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.2);
}

/* Calendar */
.calendar-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
    gap: 4px;
    margin-bottom: 16px;
}
.square {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--empty-square);
}
.square.done { background: var(--done-square); box-shadow: 0 0 8px var(--green-glow); }

.calendar-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Habit Toggle */
.habit-card { margin-bottom: 20px; border: 1px solid var(--cyan); box-shadow: 0 0 20px rgba(0, 242, 254, 0.1); }
.habit-header h2 { font-size: 18px; font-weight: 600; margin-bottom: 15px; }
.habit-toggle-container { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.05); padding: 15px 20px; border-radius: 16px; }
.habit-label { font-size: 20px; font-weight: 800; color: var(--cyan); }
.habit-label.failed { color: #ff3b30; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ff3b30; transition: .4s; border-radius: 34px; }
.switch .slider:before { position: absolute; content: ''; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
.switch input:checked + .slider { background: var(--accent-gradient); }
.switch input:checked + .slider:before { transform: translateX(26px); }

/* Трофеи */
.trophies-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    text-align: center;
}
.trophy-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 8px 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
}
.trophy-icon {
    font-size: 24px;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    transition: all 0.5s ease;
}
.trophy-title {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}
.trophy-item.locked {
    opacity: 0.3;
    border-color: transparent;
}
.trophy-item.locked .trophy-icon {
    filter: grayscale(100%);
}

/* Trophy Popup Overlay */
.trophy-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}
.trophy-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.trophy-popup {
    text-align: center;
    padding: 40px 20px;
    width: 90%;
    max-width: 350px;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.trophy-overlay.active .trophy-popup {
    transform: scale(1);
}
.trophy-popup-icon {
    font-size: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Эволюция Стрика (10 уровней) */
.streak-glow-3 { border: 1px solid rgba(76, 217, 100, 0.4) !important; box-shadow: 0 0 10px rgba(76, 217, 100, 0.2) !important; }
.streak-glow-7 { border: 1px solid rgba(255, 204, 0, 0.5) !important; box-shadow: 0 0 15px rgba(255, 204, 0, 0.3) !important; }
.streak-glow-14 { border: 1px solid rgba(255, 149, 0, 0.6) !important; box-shadow: 0 0 20px rgba(255, 149, 0, 0.4) !important; }
.streak-glow-21 { border: 1px solid rgba(255, 59, 48, 0.7) !important; box-shadow: 0 0 25px rgba(255, 59, 48, 0.5) !important; }

.streak-glow-30 { border: 1px solid rgba(205, 127, 50, 0.8) !important; animation: pulse30 2s infinite alternate !important; }
@keyframes pulse30 {
    0% { box-shadow: 0 0 10px rgba(205, 127, 50, 0.4); }
    100% { box-shadow: 0 0 25px rgba(205, 127, 50, 0.8), inset 0 0 10px rgba(205, 127, 50, 0.2); }
}

.streak-glow-45 { border: 1px solid rgba(90, 200, 250, 0.8) !important; animation: pulse45 2s infinite alternate !important; }
@keyframes pulse45 {
    0% { box-shadow: 0 0 10px rgba(90, 200, 250, 0.4); }
    100% { box-shadow: 0 0 30px rgba(90, 200, 250, 0.8), inset 0 0 10px rgba(90, 200, 250, 0.3); }
}

.streak-glow-60 { border: 1px solid rgba(0, 122, 255, 0.8) !important; animation: pulse60 2s infinite alternate !important; }
@keyframes pulse60 {
    0% { box-shadow: 0 0 15px rgba(0, 122, 255, 0.5); }
    100% { box-shadow: 0 0 35px rgba(0, 122, 255, 0.9), inset 0 0 15px rgba(0, 122, 255, 0.4); }
}

.streak-glow-75 { border: 1px solid rgba(255, 215, 0, 0.9) !important; animation: pulse75 1.5s infinite alternate !important; }
@keyframes pulse75 {
    0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 45px rgba(255, 215, 0, 1), inset 0 0 25px rgba(255, 215, 0, 0.5); }
}

.streak-glow-85 { border: 1px solid rgba(0, 255, 255, 1) !important; animation: pulse85 1.5s infinite alternate !important; }
@keyframes pulse85 {
    0% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.6), inset 0 0 10px rgba(0, 255, 255, 0.3); }
    100% { box-shadow: 0 0 50px rgba(0, 255, 255, 1), inset 0 0 30px rgba(0, 255, 255, 0.6); }
}

.streak-glow-92 { border: 1px solid rgba(199, 36, 177, 1) !important; animation: pulse92 1.5s infinite alternate !important; }
@keyframes pulse92 {
    0% { box-shadow: 0 0 20px rgba(138, 43, 226, 0.6), inset 0 0 10px rgba(138, 43, 226, 0.3); }
    100% { box-shadow: 0 0 60px rgba(199, 36, 177, 1), inset 0 0 40px rgba(199, 36, 177, 0.7); }
}
