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

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;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: white;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
}

.container {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    color: white;
    font-weight: 700;
    flex: 1;
    text-align: center;
    letter-spacing: -0.025em;
}

header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.btn-settings {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.btn-settings:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-panel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.settings-panel.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    max-height: 500px;
}

.settings-panel h3 {
    margin: 0 0 1rem 0;
    color: white;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.workout-summary {
    margin: 0 0 1.5rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.5px;
    text-align: center;
}

.setting-item input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    padding-right: 30px;
    flex: 1;
}

.input-suffix {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    pointer-events: none;
    background-color: #f5f5f5;
    padding: 0 8px;
    border-radius: 0 4px 4px 0;
    border-left: 1px solid #e0e0e0;
}

.setting-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-item input:hover {
    border-color: #cbd5e0;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-actions .btn {
    min-width: 100px;
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
}

.timer-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 10px;
}

.timer-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem 2rem;
    border: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.timer-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.timer-display.work {
    background: white;
    color: #333;
    border-color: #ff5252;
    animation: pulse 1s infinite;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

body.work-phase {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.timer-display.rest {
    background: white;
    color: #333;
    border-color: #44c9a1;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

body.rest-phase {
    background: linear-gradient(135deg, #4ecdc4, #44c9a1);
}

body.get-ready-phase {
    background: #f59e0b;
}

body.complete-phase {
    background: #8b5cf6;
}

.timer-display.complete {
    background: #8b5cf6 !important;
    color: white !important;
    animation: pulse 1s ease-in-out;
}

.timer-display.complete .time,
.timer-display.complete .phase {
    color: white !important;
}

.timer-display.complete .time {
    font-size: 1.75rem;
    font-weight: 600;
}

.timer-display.get-ready {
    background: white;
    color: #333;
    border-color: #ff9800;
    animation: pulse 1s infinite;
    box-shadow: 0 0 20px rgba(255, 167, 38, 0.3);
}

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

@keyframes pulse-modern {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

.timer-display.complete {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: white !important;
    border: none !important;
    animation: pulse 1s ease-in-out;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.4) !important;
}

.timer-display.complete .time,
.timer-display.complete .phase {
    color: white !important;
}

@keyframes celebration {
    0% { 
        transform: scale(1) rotate(0deg);
        background: linear-gradient(135deg, #4ecdc4, #44c9a1);
    }
    25% { 
        transform: scale(1.1) rotate(5deg);
        background: linear-gradient(135deg, #ffd700, #ff6b6b);
    }
    50% { 
        transform: scale(1.2) rotate(-5deg);
        background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    }
    75% { 
        transform: scale(1.1) rotate(3deg);
        background: linear-gradient(135deg, #4ecdc4, #ffd700);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        background: linear-gradient(135deg, #ffd700, #ff6b6b);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}



/* Attribution footer */
.attribution {
    margin-top: 1.5rem;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 400;
}

.attribution a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.attribution a:hover {
    color: white;
    text-decoration: underline;
}

.shortcuts {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 400;
}

.time {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    transition: all 0.5s ease;
    text-align: center;
    color: #1a202c;
    letter-spacing: -0.05em;
}

.phase {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.5s ease;
    text-align: center;
    line-height: 1.4;
    color: #4a5568;
}

.round-info {
    text-align: center;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.9);
}

.round-counter {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.round-counter .label {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.round-counter .current-round {
    font-weight: 700;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.round-counter .current-round.active {
    color: white;
}

.round-counter .total-rounds {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* Round progress boxes */
.round-boxes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 400px;
    margin: 0 auto;
}

.round-box {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.round-box.completed {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.round-box.current {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
    animation: pulse-modern 2s infinite;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.round-box.current.rest {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
    animation: pulse-modern 2s infinite;
}

@keyframes pulse-red-box {
    0% { 
        border-color: #e53e3e;
        background: #fed7d7;
        box-shadow: 0 0 0 rgba(229, 62, 62, 0.7);
        transform: scale(1);
    }
    50% { 
        border-color: #c53030;
        background: #fc8181;
        box-shadow: 0 0 8px rgba(229, 62, 62, 0.4);
        transform: scale(1.02);
    }
    100% { 
        border-color: #e53e3e;
        background: #fed7d7;
        box-shadow: 0 0 0 rgba(229, 62, 62, 0.7);
        transform: scale(1);
    }
}

@keyframes pulse-green-box {
    0% { 
        border-color: #4ecdc4;
        background: #b2f5ea;
        box-shadow: 0 0 0 rgba(78, 205, 196, 0.7);
        transform: scale(1);
    }
    50% { 
        border-color: #44c9a1;
        background: #81e6d9;
        box-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
        transform: scale(1.02);
    }
    100% { 
        border-color: #4ecdc4;
        background: #b2f5ea;
        box-shadow: 0 0 0 rgba(78, 205, 196, 0.7);
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .settings-grid {
        grid-template-columns: 1fr;
        max-width: 250px;
    }
    
    .round-boxes {
        gap: 6px;
        max-width: 320px;
    }
    
    .round-box {
        width: 20px;
        height: 20px;
    }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 4px;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 100px;
    backdrop-filter: blur(10px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.9);
    color: #1a202c;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    border: 2px solid #ff5252;
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.workout-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-item .label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.info-item .value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        margin: 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .time {
        font-size: 3rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .workout-info {
        grid-template-columns: 1fr;
    }
}