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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Setup Screen */
#setup-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.form-container {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.time-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.3s;
}

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

.time-input span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.85rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.color-pickers {
    display: flex;
    gap: 1rem;
}

.color-picker-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.color-picker-item label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.color-picker-item input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
}

.color-picker-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.start-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.start-button:active {
    transform: translateY(0);
}

.footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    color: #666;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Timer Screen */
#timer-screen {
    transition: background-color 0.5s ease;
    cursor: pointer;
    position: relative;
}

#timer-screen.work {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

#timer-screen.rest {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
}

.timer-display {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.round-counter {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 4rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-variant-numeric: tabular-nums;
}

.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flip-clock {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.flip-segment {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.flip-segment::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.2);
}

.flip-segment span {
    font-size: 12rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: block;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.separator {
    font-size: 8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem 4rem;
    border-radius: 16px;
    display: none;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pause-indicator.active {
    display: block;
}

/* Hidden states */
.time-display.hidden {
    opacity: 0;
    pointer-events: none;
}

.round-counter.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        width: 95%;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .time-input input {
        padding: 0.6rem;
        font-size: 1rem;
    }

    input[type="number"] {
        padding: 0.6rem;
        font-size: 1rem;
    }

    .start-button {
        padding: 0.875rem;
        font-size: 1.1rem;
    }

    .footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .footer p {
        font-size: 0.85rem;
    }

    .flip-segment {
        padding: 0.75rem 1.5rem;
    }

    .flip-segment span {
        font-size: 8rem;
    }

    .flip-clock {
        gap: 0.75rem;
    }

    .separator {
        font-size: 6rem;
    }

    .round-counter {
        font-size: 3rem;
        top: 1.5rem;
        right: 1.5rem;
    }

    .pause-indicator {
        font-size: 2.5rem;
        padding: 1.5rem 3rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1.25rem 1rem;
        width: 96%;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.35rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    label {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .time-input {
        gap: 0.35rem;
    }

    .time-input input {
        padding: 0.5rem;
        font-size: 0.95rem;
    }

    .time-input span {
        font-size: 1.25rem;
    }

    input[type="number"] {
        padding: 0.5rem;
        font-size: 0.95rem;
    }

    small {
        font-size: 0.8rem;
    }

    .color-picker-item input[type="color"] {
        height: 45px;
    }

    .start-button {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .flip-segment {
        padding: 0.4rem 0.8rem;
        border-radius: 10px;
    }

    .flip-segment span {
        font-size: 4.5rem;
    }

    .flip-clock {
        gap: 0.5rem;
    }

    .separator {
        font-size: 3.5rem;
    }

    .round-counter {
        font-size: 2rem;
        top: 1rem;
        right: 1rem;
    }

    .pause-indicator {
        font-size: 1.75rem;
        padding: 1rem 2rem;
        border-radius: 12px;
    }
}

@media (max-width: 375px) {
    .form-container {
        padding: 1rem 0.875rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    .flip-segment {
        padding: 0.3rem 0.6rem;
        border-radius: 8px;
    }

    .flip-segment span {
        font-size: 3.5rem;
    }

    .flip-clock {
        gap: 0.4rem;
    }

    .separator {
        font-size: 2.75rem;
    }

    .round-counter {
        font-size: 1.5rem;
        top: 0.75rem;
        right: 0.75rem;
    }

    .pause-indicator {
        font-size: 1.5rem;
        padding: 0.875rem 1.75rem;
    }
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
