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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
}

.container {
    text-align: center;
    padding: 2rem;
    padding-top: 4rem;
    width: 100%;
    max-width: 100vw;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

h1.app-title {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.6rem;
    color: #666;
    margin-bottom: 0;
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.warning-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #ffffff;
    padding: 0.5rem;
    border-radius: 10px;
    border: 2px solid #444;
}

.warning-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.warning-item-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
}

.warning-btn {
    width: 28px;
    height: 28px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #ffffff;
    color: #000;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.warning-btn:hover {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.warning-btn.remove-btn:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
}

.setting-group input[type="number"] {
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #444;
    border-radius: 10px;
    background: #ffffff;
    color: #000;
    width: 100px;
    text-align: center;
    transition: border-color 0.3s;
}

.setting-group input[type="color"] {
    padding: 0;
    border: 2px solid #444;
    border-radius: 10px;
    background: transparent;
    color: transparent;
    width: 50px;
    height: 50px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.setting-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 10px;
}

.setting-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
    background: transparent;
}

.setting-group label {
    font-size: 0.9rem;
    color: #aaa;
}

.warning-label {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
    display: block;
}

.setting-group input {
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #444;
    border-radius: 10px;
    background: #ffffff;
    color: #000;
    width: 100px;
    text-align: center;
    transition: border-color 0.3s;
}

.setting-group input:focus {
    outline: none;
    border-color: #666;
}

.timer-display {
    margin-bottom: 2rem;
}

.timer {
    /* "00:00" in a monospace font is about 3em wide, so 30vw keeps it on screen.
       25rem is still the cap on big displays */
    font-size: min(25rem, 30vw);
    line-height: 1;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #000;
    transition: none;
}

.controls {
    margin-bottom: 1rem;
}

.primary-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #4CAF50;
    color: #fff;
}

.primary-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f44336;
    color: #fff;
    margin-left: 1rem;
}

.secondary-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.secondary-btn:active {
    transform: translateY(0);
}

.total-display {
    margin-bottom: 2rem;
    padding: 1rem;
    background: transparent;
    border-radius: 10px;
    font-size: 1.2rem;
}

/* Warning flash - yellow-orange, fade from 100% to 0% over 60 seconds */
.warning-flash {
    /* blink every two seconds (1s fade out, 1s back); JS shrinks --warning-intensity from 100% to 0% over the minute */
    animation: warningFlash 2s ease-in-out infinite;
}

@keyframes warningFlash {
    0%, 100% {
        background: #ffffff;
    }
    50% {
        background: color-mix(in srgb, var(--warning-color, #ffcc00) var(--warning-intensity, 100%), #ffffff);
    }
}

/* Red flash */
.red-flash {
    animation: redFlash 2s ease-in-out infinite;
}

@keyframes redFlash {
    0%, 100% {
        background: #ff0000;
    }
    50% {
        background: #ffffff;
    }
}

/* --- responsive tweaks: same look, just sized down for small screens --- */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
        padding-top: 2rem;
    }

    /* let the settings fill the width instead of hugging the left edge */
    .settings {
        align-items: center;
    }

    .setting-group {
        align-items: center;
    }

    .warning-item-controls {
        justify-content: center;
    }

    .primary-btn,
    .secondary-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .secondary-btn {
        margin-left: 0.5rem;
    }
}

/* short landscape screens (phone sideways): size the timer by height too */
@media (max-height: 500px) and (orientation: landscape) {
    .timer {
        font-size: min(25rem, 30vw, 45vh);
    }

    .timer-display,
    .settings {
        margin-bottom: 1rem;
    }
}
