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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --rest-color: #ff6b6b;
    --work-color: #4ecdc4;
    --background: #1a1a2e;
    --surface: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-radius: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-primary);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 420px;
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    box-shadow: var(--shadow);
}

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

header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.time-circle {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 816.814;
    stroke-dashoffset: 816.814;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.progress-ring-circle.work {
    stroke: var(--work-color);
}

.progress-ring-circle.rest {
    stroke: var(--rest-color);
}

.time-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.time {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.phase {
    font-size: 18px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.round-info {
    text-align: center;
    margin-bottom: 30px;
}

.round-display {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    background: var(--surface);
    padding: 15px 30px;
    border-radius: 50px;
}

.round-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.round-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.round-separator {
    font-size: 20px;
    color: var(--text-secondary);
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.settings {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--border-radius);
}

.settings h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.setting-group input[type="number"]::-webkit-inner-spin-button,
.setting-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.setting-group label[for="soundEnabled"] {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 28px;
    }

    .time-circle {
        width: 240px;
        height: 240px;
    }

    .progress-ring {
        width: 240px;
        height: 240px;
    }

    .progress-ring-circle {
        stroke-dasharray: 700;
        stroke-dashoffset: 700;
    }

    .time {
        font-size: 56px;
    }

    .phase {
        font-size: 16px;
    }

    .btn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Prevent text selection during timer */
.timer-display {
    user-select: none;
    -webkit-user-select: none;
}

/* Animation for phase changes */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.time-circle.pulse {
    animation: pulse 0.3s ease;
}

