* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Alata', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #d35400, #e67e22);
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-family: 'Alata', Arial, sans-serif;
    text-align: center;
    margin-top: 10px;
}

.content {
    padding: 30px;
}

.controls {
    background: #fef9f3;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 2px solid #d35400;
    box-shadow: 4px 4px 0 #d35400;
    transition: all 0.25s ease-in-out;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.controls:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #d35400;
}

button {
    font-size: 1rem;
    padding: 14px 25px;
    border-radius: 12px;
    border: 2px solid #d35400;
    background: #fff;
    color: #000000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0 #d35400;
    position: relative;
    overflow: hidden;
    min-width: 180px;
    font-family: 'Alata', Arial, sans-serif;
}

button:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #d35400;
}

button:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 #d35400;
}

.generate-btn {
    background: linear-gradient(to bottom, #f39c12, #f1c40f);
    border: 2px solid #d35400;
    color: #000000;
    font-size: 1.1em;
    padding: 16px 30px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 0px #d35400;
    transition: all 0.2s ease-in-out;
}

.toggle-btn {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    color: white;
    border: 2px solid #d35400;
}

.download-btn {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    color: white;
    border: 2px solid #d35400;
}

.back-home-container {
    text-align: center;
    margin-bottom: 20px;
}

.back-home-btn {
    background: linear-gradient(to bottom, #f39c12, #f1c40f);
    border: 2px solid #d35400;
    color: #000000;
    font-weight: bold;
    font-family: 'Alata', Arial, sans-serif;
    font-size: 1rem;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #d35400;
    transition: all 0.2s ease;
}

.back-home-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #d35400;
    background: linear-gradient(to bottom, #f1c40f, #f39c12);
}

#wrapper {
    position: relative;
    width: 794px;
    height: 1123px;
    background: white;
    border: 2px solid #000000;
    border-radius: 12px;
    box-shadow: 3px 3px 0 #d35400;
    margin: 20px auto;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
}

input.time-field {
    position: absolute;
    width: 90px;
    text-align: center;
    font-size: 17px;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 8px;
    background: #fef9f3;
    font-family: 'Alata', Arial, sans-serif;
    box-shadow: 2px 2px 0 #000000;
    transition: all 0.3s ease;
}

input.time-field:focus {
    border-color: #e67e22;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.time-text {
    position: absolute;
    width: 90px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    font-family: 'Alata', Arial, sans-serif;
}

.header {
    position: absolute;
    top: 30px;
    left: 40px;
    right: 40px;
    font-size: 18px;
    font-family: 'Alata', Arial, sans-serif;
    color: #000000;
}

.header input {
    border: none;
    border-bottom: 2px solid #000000;
    width: 200px;
    font-size: 16px;
    margin-left: 5px;
    outline: none;
    background: transparent;
    font-family: 'Alata', Arial, sans-serif;
    padding: 5px;
    color: #000000;
}

.title {
    position: absolute;
    top: 90px;
    width: 100%;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #000000;
    font-family: 'Alata', Arial, sans-serif;
}

.subtitle {
    position: absolute;
    top: 130px;
    width: 100%;
    text-align: center;
    font-size: 16px;
    color: #000000;
    font-family: 'Alata', Arial, sans-serif;
}

.footer {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #000000;
    font-family: 'Alata', Arial, sans-serif;
}

.footer a {
    color: #d35400;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

.download-section {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.download-section.visible {
    display: block;
}

.simple-download-btn {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    color: white;
    border: 2px solid #d35400;
    border-radius: 12px;
    padding: 16px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 0 #d35400;
    transition: all 0.2s ease;
    font-family: 'Alata', Arial, sans-serif;
    margin-bottom: 15px;
    min-width: 200px;
}

.simple-download-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #d35400;
}

.simple-download-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 3px 3px 0 #d35400;
}

.simple-countdown {
    font-size: 1.1rem;
    color: #e74c3c;
    font-weight: bold;
    margin-top: 10px;
    padding: 8px 15px;
    background: #fef9f3;
    border-radius: 8px;
    border: 1px solid #fadbd8;
    display: inline-block;
}

.status-message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.status-message.success {
    background: #e8f5e9;
    color: #4ba924;
    border: 1px solid #4ba924;
    display: block;
}

.status-message.error {
    background: #ffebee;
    color: #b93f05;
    border: 1px solid #b93f05;
    display: block;
}

.loading {
    display: none;
    margin: 15px 0;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #d35400;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.recommendation-box {
    margin-top: 25px;
    background: linear-gradient(to bottom right, #fef9f3, #fbeee6);
    border: 2px solid #d35400;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 3px 3px 0 #d35400;
    color: #222;
    font-family: 'Alata', Arial, sans-serif;
    line-height: 1.6;
}

.recommendation-box h3 {
    font-size: 1.15rem;
    color: #d35400;
    margin-bottom: 10px;
    text-align: center;
}

.recommendation-box ul {
    list-style-type: "✔ ";
    margin: 10px 0 10px 20px;
    padding: 0;
}

.recommendation-box li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* Manual Times Input */
.manual-times-container {
    background: #fef9f3;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #d35400;
    box-shadow: 4px 4px 0 #d35400;
}

.manual-times-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #d35400;
    text-align: center;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #d35400;
    font-weight: bold;
}

.time-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #d35400;
    border-radius: 8px;
    font-family: 'Alata', Arial, sans-serif;
    font-size: 1rem;
    text-align: center;
    background: #fff;
    box-shadow: 2px 2px 0 #d35400;
}

.time-input:focus {
    border-color: #e67e22;
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.manual-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.manual-btn {
    padding: 10px 15px;
    background: #f39c12;
    border: 2px solid #d35400;
    border-radius: 8px;
    color: #000000;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Alata', Arial, sans-serif;
    box-shadow: 2px 2px 0 #d35400;
    transition: all 0.2s ease;
}

.manual-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #d35400;
    background: #e67e22;
}

@media (max-width: 900px) {
    #wrapper {
        width: 100%;
        height: auto;
        min-height: 1123px;
    }
    
    .times-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        min-width: 100%;
        width: 100%;
    }
    
    .simple-download-btn {
        min-width: 100%;
    }
    
    .times-grid {
        grid-template-columns: 1fr;
    }
    
    .manual-controls {
        flex-direction: column;
    }
    
    .manual-btn {
        width: 100%;
    }
}