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

:root {
    --primary: #ff6b9d;
    --primary-dark: #ff4081;
    --secondary: #00d4ff;
    --background: #1a1a2e;
    --surface: #16213e;
    --surface-light: #0f3460;
    --text: #e4f4f8;
    --text-secondary: #a0aec0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    color: var(--text);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    max-height: 932px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #ff4081 0%, #ff6b9d 100%);
    padding: 16px;
    text-align: center;
    color: #1a1a2e;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.3);
}

.nav-bottom {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border-top: 1px solid var(--surface-light);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    background: var(--surface-light);
    border: none;
    color: var(--text);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-btn:hover {
    background: var(--primary);
    color: #1a1a2e;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #1a1a2e;
    box-shadow: 0 8px 16px rgba(255, 107, 157, 0.4);
}

.container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
}

.screen {
    display: none;
    padding: 0;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.home-screen {
    padding: 20px;
}

.stats-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 2px solid var(--primary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.15);
}

.stat-item {
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.welcome-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.btn-start {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #1a1a2e;
    border: none;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(255, 107, 157, 0.3);
    margin-bottom: 12px;
}

.btn-start:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 107, 157, 0.4);
}

.exercise-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
}

.workout-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workout-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.workout-card:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
}

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

.workout-title {
    font-weight: 700;
    font-size: 16px;
}

.xp-badge {
    background: var(--warning);
    color: #1a1a2e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.workout-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 10px;
}

.workout-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.exercise-detail {
    padding: 20px;
}

.back-btn {
    background: var(--surface-light);
    border: none;
    color: var(--primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--surface);
    transform: translateX(-4px);
}

.exercise-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.benefit-item {
    display: flex;
    gap: 8px;
}

.benefit-item::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}

.timer-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.timer-display {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-timer {
    background: #1a1a2e;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-timer:hover {
    background: var(--primary);
    color: #1a1a2e;
}

.btn-complete {
    background: var(--success);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-complete:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.progress-screen {
    padding: 20px;
}

.progress-stat {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 2px solid var(--primary);
}

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

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.achievements {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.achievement {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 2px solid var(--surface-light);
}

.achievement.unlocked {
    border-color: var(--warning);
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 12px;
    font-weight: 700;
}

.settings-screen {
    padding: 20px;
}

.setting-item {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--surface-light);
}

.setting-label {
    font-weight: 600;
}

.toggle-switch {
    width: 48px;
    height: 24px;
    background: var(--surface-light);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.toggle-switch.active::after {
    left: 26px;
}

.btn-reset {
    background: var(--danger);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

.info-text {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 12px;
    text-align: center;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

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

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

@media (max-height: 600px) {
    .nav-bottom {
        padding: 8px;
    }

    .nav-btn {
        font-size: 11px;
        padding: 8px;
    }

    .container {
        padding-bottom: 70px;
    }
}
