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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
}

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

.add-timer-btn, .clear-all-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.add-timer-btn:hover, .clear-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.clear-all-btn {
    background: #f44336;
    color: white;
}

.timers-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.timer-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.timer-card.timer-complete {
    animation: shake 0.5s ease-in-out;
    background: #e8f5e9;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timer-name {
    flex: 1;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    padding: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: border-color 0.3s;
}

.timer-name:focus {
    outline: none;
    border-bottom-color: #667eea;
}

.timer-delete {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.3s;
}

.timer-delete:hover {
    background: #f44336;
    color: white;
}

.timer-type-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.timer-type-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.timer-type-selector input[type="radio"] {
    cursor: pointer;
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.time-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.milliseconds {
    font-size: 1.5rem;
    color: #666;
    margin-left: 2px;
}

.countdown-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.countdown-input input {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

.countdown-input input:focus {
    outline: none;
    border-color: #667eea;
}

.countdown-input span {
    font-size: 1.5rem;
    color: #666;
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.timer-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.timer-start {
    background: #4CAF50;
    color: white;
}

.timer-start:hover {
    background: #45a049;
}

.timer-pause {
    background: #ff9800;
    color: white;
}

.timer-pause:hover {
    background: #e68900;
}

.timer-reset {
    background: #f44336;
    color: white;
}

.timer-reset:hover {
    background: #da190b;
}

.lap-times {
    margin-top: 20px;
}

.lap-times h4 {
    margin-bottom: 10px;
    color: #666;
}

.lap-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.lap-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.lap-list li:hover {
    background: #f5f5f5;
}

.lap-number {
    color: #666;
}

.lap-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: white;
    opacity: 0.8;
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    opacity: 0.8;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .timers-container {
        grid-template-columns: 1fr;
    }
    
    .time-display {
        font-size: 2rem;
    }
    
    .milliseconds {
        font-size: 1.2rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}