:root {
    --bg: #0f1724;
    --card: #0b1220;
    --accent: #7c3aed;
    --muted: #94a3b8;
    --glass: rgba(255,255,255,0.03);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, #071029 0%, #0b1220 100%);
    color: #e6eef8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wrap {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    align-items: center;
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 30px rgba(2,6,23,0.6);
    border: 1px solid rgba(255,255,255,0.03);
}

h1 {
    font-size: 18px;
    margin: 0 0 12px 0;
    color: var(--muted);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

label {
    font-size: 13px;
    color: var(--muted);
}

input[type=number] {
    width: 50%;
    padding: 10px 10px;
    border-radius: 10px;
    background: var(--glass);
    border: 1px solid rgba(255,255,255,0.03);
    color: inherit;
    font-size: 15px;
    outline: none;
}

.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent), #5b21b6);
    color: white;
    box-shadow: 0 6px 18px rgba(124,58,237,0.18);
}

.btn.secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--muted);
    font-weight: 600;
}

.btn.warn {
    background: #ef4444;
}

.clock-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 360px;
}

.flip-card {
    width: 100%;
    max-width: 480px;
    height: 320px;
    perspective: 1200px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.9s cubic-bezier(.2,.9,.3,1);
    transform-style: preserve-3d;
}

.flip-inner.is-flipped {
    transform: rotateY(180deg);
}

.face {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.front {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.03);
}

.back {
    transform: rotateY(180deg);
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.025);
}

.time-large {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 8px;
}

.controls .actions {
    display: flex;
    gap: 8px;
}

.progress-ring {
    width: 200px;
    height: 200px;
    margin-bottom: 8px;
}

.stat {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat strong {
    font-size: 20px;
}

footer {
    font-size: 12px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
}

@media (max-width: 840px) {
    .wrap {
        grid-template-columns: 1fr;
    }
    .flip-card {
        max-width: 420px;
    }
}