:root {
    --bg-color: #0d1117;
    --container-bg: rgba(22, 27, 34, 0.65);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-hover: #3182ce;
    --danger-color: #f85149;
    --danger-hover: #da3633;
    --secondary-bg: #21262d;
    --secondary-hover: #30363d;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    background: radial-gradient(circle at center, #1f2430 0%, #0d1117 100%);
}

html {
    height: -webkit-fill-available;
}

body::before, body::after {
    content: '';
    position: absolute;
    width: 80vmin;
    height: 80vmin;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
    animation: drift 20s infinite alternate ease-in-out;
}

body::before {
    top: -10vmin;
    left: -10vmin;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.2) 0%, transparent 70%);
}

body::after {
    bottom: -10vmin;
    right: -10vmin;
    background: radial-gradient(circle, rgba(163, 113, 247, 0.2) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.timer-container {
    background: var(--container-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

.hidden {
    display: none !important;
}

.panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.panel-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    width: 100%;
    gap: 15px;
}

.input-row .input-group {
    flex: 1;
}

label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    text-align: center;
}

input:focus {
    border-color: var(--accent-color);
}

#round-display {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ring-container {
    position: relative;
    width: 70vw;
    height: 70vw;
    max-width: 250px;
    max-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
    opacity: 0.8;
}

.progress-ring__circle.bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring__circle.fg {
    stroke: var(--accent-color);
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 0;
}

.timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(3rem, 12vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -2px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
    position: relative;
    z-index: 2;
}

.timer-display span:not(.colon) {
    display: inline-block;
    width: 2ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.colon {
    color: var(--text-secondary);
    margin: 0 4px;
    transform: translateY(-5px);
    display: inline-block;
}

.timer-container.paused .colon {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.controls {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.btn {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 0;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.94);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(88, 166, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

@media (max-width: 900px) and (orientation: landscape) {
    .timer-container {
        padding: 15px 25px;
        flex-direction: row;
        max-width: 90%;
        gap: 25px;
    }
    .panel {
        width: 60%;
        margin-bottom: 0 !important;
    }
    .controls {
        flex-direction: column;
        justify-content: center;
        width: 35%;
    }
    .ring-container {
        width: 45vmin !important;
        height: 45vmin !important;
        max-width: none;
        max-height: none;
    }
    .timer-display {
        font-size: 3rem !important;
    }
    .input-row {
        flex-direction: column;
        gap: 10px;
    }
    .input-group {
        margin-bottom: 10px;
    }
}
