body {
    font-family: Arial, sans-serif;
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 800px;
    width: 100%;
}

.timetable {
    display: grid;
    grid-template-columns: auto repeat(6, 1fr);
    gap: 2px;
    margin: 20px 0;
    overflow-x: auto;
}

.header {
    background: #333;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
    min-width: fit-content;
}

.time-slot {
    background: #f0f0f0;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    min-width: 40px;
}

.time-slot:hover {
    background: #e0e0e0;
}

.time-slot.selected {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

.results {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.place {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border-radius: 3px;
}

.controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

select, button {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
}

@media (max-width: 768px) {
    body {
        margin: 10px;
    }
    
    .timetable {
        font-size: 14px;
    }
    
    .header, .time-slot {
        padding: 8px 4px;
        min-width: 35px;
    }
    
    select, button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .place {
        margin: 3px;
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .results {
        padding: 10px;
    }
}