:root {
    --bg-color: #0a192f;
    --text-color: #ffffff;
    --accent-color: #64ffda;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.2);
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --dial-size: min(300px, 76vw, 36vh);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.app {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

header h1 {
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.5rem;
    opacity: 0.8;
}

/* Wijzerplaat: de hele cirkel is de start/stop-knop */
.dial {
    position: relative;
    width: var(--dial-size);
    height: var(--dial-size);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.dial:active {
    transform: scale(0.97);
}

.dial:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 6px;
}

.ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring__track,
.ring__progress {
    fill: none;
    stroke-width: 8;
}

.ring__track {
    stroke: rgba(255, 255, 255, 0.1);
}

.ring__progress {
    stroke: var(--accent-color);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.12s linear;
}

.dial__time {
    position: relative;
    font-size: calc(var(--dial-size) * 0.24);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.dial__label {
    position: relative;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--accent-color);
}

.app[data-state="running"] .dial__label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.app[data-state="done"] .ring__progress {
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

/* Bediening */
.card {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--secondary-bg);
    padding: 1.25rem;
    border: none;
    border-radius: 20px;
    transition: opacity 0.2s ease;
}

.card:disabled {
    opacity: 0.35;
}

.presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 0 8px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
}

.preset small {
    font-size: 0.7rem;
    font-weight: 300;
    opacity: 0.7;
}

.preset.step {
    border-style: dashed;
    color: var(--accent-color);
    -webkit-touch-callout: none;
}

.preset.step:active {
    background: rgba(100, 255, 218, 0.15);
}

.preset.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-color);
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.row__label {
    flex: 0 0 100%;
    min-height: 28px;
    font-size: 1rem;
    font-weight: 500;
}

select {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

select option {
    color: #000;
}

.listen {
    flex: 0 0 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.row.off select,
.row.off .listen {
    opacity: 0.35;
    pointer-events: none;
}

/* Schakelaar */
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch__track {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.15s ease;
}

.switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.switch input:checked + .switch__track {
    background: var(--accent-color);
}

.switch input:checked + .switch__track::after {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.hint {
    font-size: 0.85rem;
    font-weight: 300;
    text-align: center;
    opacity: 0.6;
    line-height: 1.4;
}

@media (max-height: 640px) {
    .app {
        gap: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .hint {
        display: none;
    }
}
