body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #111827;
    color: #fff;
    overflow: hidden;
}

.timer-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-sizing: border-box;
    transition: background 0.3s ease;
}

.timer-app.red {
    background: #7f1d1d;
}

.timer-app.green {
    background: #14532d;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-header h1 {
    margin: 0;
    font-size: 2rem;
}

.timer-main {
    flex: 1;
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: 1.5rem;
}

.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-phase {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.timer-count {
    font-size: 12rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer-cycle {
    font-size: 2.8rem;
    font-weight: 700;
    margin-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
}

.timer-presets,
.timer-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

button {
    border: none;
    border-radius: 14px;
    padding: 1rem 1.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255,255,255,0.16);
    color: #fff;
}

button:hover {
    background: rgba(255,255,255,0.28);
}

button.active {
    background: #fff;
    color: #111827;
}

.timer-screen {
    display: none;
}

.timer-screen.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.timer-selection {
    justify-content: center;
}

.timer-selection h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.timer-running {
    justify-content: space-between;
}

.timer-presets button strong {
    font-size: 1.4em;
}

.timer-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0 1rem;
}

.timer-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
}

.fullscreen-btn.discreet {
    display: block;
    margin: 1.5rem auto 0;
    width: 30%;
    min-width: 220px;
    text-align: center;
    opacity: 0.85;
}

.fullscreen-btn.discreet:active {
    opacity: 1;
}

@media (max-width: 700px) {
    .timer-selection h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .timer-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .timer-presets button {
        min-height: 90px;
        font-size: 1.05rem;
    }

    .timer-controls {
        grid-template-columns: repeat(3, 1fr);
    }

    .timer-controls button {
        min-height: 90px;
        font-size: 1.4rem;
        font-weight: 700;
        border-radius: 20px;
        padding: 1rem 1.5rem;
    }

    .timer-app {
        padding: 1rem;
    }

    .timer-header h1 {
        font-size: 1.2rem;
    }

    #fullscreenBtn {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }

    .timer-main {
        gap: 0.8rem;
    }

    .timer-phase {
        font-size: 1.5rem;
        letter-spacing: 0.04em;
    }

    .timer-count {
        font-size: clamp(5rem, 28vw, 8rem);
    }

    .timer-cycle {
        font-size: 1rem;
        margin-top: 0.3rem;
    }

    .timer-presets {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .timer-presets button {
        min-height: 64px;
        padding: 0.9rem 0.6rem;
        font-size: 1rem;
        border-radius: 16px;
    }

    .timer-controls {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .timer-controls button {
        min-height: 100px;
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .timer-display {
        margin-top: 10vh;
    }

    .timer-logo {
        height: 90px;
    }

    #timerScreen{margin-bottom: 35px;}

    .fullscreen-btn.discreet {
        width: 30%;
        max-width: 320px;
        min-height: 64px;
        font-size: 1rem;
    }

    #fullscreenBtnTimer {
        font-size: 1rem;
    }
}