/* Pomodoro Timer - Eye-catching UI with Original Purple Theme */

/* ===== BASE STYLES ===== */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    position: relative;
    z-index: 1;
}

.pomodoro-wrapper h1,
.pomodoro-wrapper h2,
.pomodoro-wrapper h3,
.pomodoro-wrapper h4 {
    font-family: "Syne", "Zen Dots", sans-serif;
}

.container {
    position: relative;
    z-index: 1;
}

/* ===== BACKGROUND VIDEO (UNCHANGED) ===== */
.background-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

[data-theme="light"] .background-video {
    filter: brightness(1.5) saturate(0.3) opacity(0.7);
}

.background-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 0;
    pointer-events: none;
}

/* ===== MAIN WRAPPER - ONE PAGE FIT ===== */
.pomodoro-wrapper {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

/* ===== TITLE ===== */
.pomodoro-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--purple-lighter) 50%, var(--primary-purple) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    animation: shimmer 3s linear infinite;
    letter-spacing: 2px;
    margin: 0;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ===== TIMER DISPLAY ===== */
.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
            radial-gradient(circle at 30% 25%, rgba(216, 180, 254, 0.22) 0%, rgba(216, 180, 254, 0) 38%),
            radial-gradient(circle at center, rgba(147, 51, 234, 0.16) 0%, rgba(147, 51, 234, 0.04) 58%, transparent 75%);
    border-radius: 50%;
    border: 1px solid rgba(147, 51, 234, 0.35);
    box-shadow:
            inset 0 0 30px rgba(147, 51, 234, 0.2),
            0 0 24px rgba(147, 51, 234, 0.22);
    isolation: isolate;
}

/* Rotating glow ring */
.timer-circle::before {
    content: '';
    position: absolute;
    width: calc(100% + 18px);
    height: calc(100% + 18px);
    border-radius: 50%;
    background: conic-gradient(
            from 0deg,
            transparent 0%,
            var(--primary-purple) 25%,
            transparent 50%,
            var(--purple-light) 75%,
            transparent 100%
    );
    animation: rotate-glow 6s linear infinite;
    opacity: 0.38;
    filter: blur(1px);
}

.timer-circle::after {
    content: '';
    position: absolute;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border-radius: 50%;
    background:
            radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 50%),
            var(--card-bg, rgba(0, 0, 0, 0.5));
    box-shadow: inset 0 0 36px rgba(147, 51, 234, 0.12);
    z-index: 0;
}

@keyframes rotate-glow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-ring {
    position: absolute;
    width: 102%;
    height: 102%;
    transform: rotate(-90deg);
    inset: -1%;
    z-index: 1;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 7;
    opacity: 0.32;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--primary-purple);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s ease, filter 0.35s ease, stroke-width 0.35s ease;
    filter: drop-shadow(0 0 10px rgba(147, 51, 234, 0.85));
}

.timer-text {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow:
            0 0 20px rgba(147, 51, 234, 0.5),
            0 0 40px rgba(147, 51, 234, 0.22);
    background: linear-gradient(180deg, #ffffff 0%, #f3e8ff 42%, #dcc2ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 2;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--purple-lighter);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.22), rgba(147, 51, 234, 0.12));
    border-radius: 20px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.2), inset 0 0 10px rgba(147, 51, 234, 0.14);
}

/* ===== TIMER CONTROLS ===== */
.timer-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(147, 51, 234, 0.1);
    border: 2px solid var(--primary-purple);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.3), transparent);
    transition: left 0.5s ease;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover:not(:disabled) {
    background: rgba(147, 51, 234, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.4);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== PRESET SECTION ===== */
.time-setup-section {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.presets-section,
.custom-time-section {
    width: 100%;
    max-width: 100%;
}

.time-setup-subtitle {
    font-size: 0.68rem;
    color: var(--purple-lighter);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 700;
    text-align: left;
}

.section-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 6px;
    background: rgba(147, 51, 234, 0.08);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.preset-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preset-btn:hover {
    border-color: var(--purple-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.3);
}

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

.preset-btn.active {
    border-color: var(--primary-purple);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(147, 51, 234, 0.1));
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.4), inset 0 0 15px rgba(147, 51, 234, 0.1);
}

.preset-time {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.preset-label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* ===== CUSTOM TIME INPUT ===== */
.custom-time-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.input-group input {
    width: 70px;
    padding: 10px 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(147, 51, 234, 0.08);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.set-custom-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-purple), var(--purple-light));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.set-custom-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.set-custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
}

.set-custom-btn:hover::before {
    left: 100%;
}

/* ===== SESSION COUNTER ===== */
.session-panel {
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-top: 6px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(147, 51, 234, 0.06));
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(147, 51, 234, 0.18);
}

.session-counter {
    padding: 9px 16px;
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.26);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.session-counter p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
}

.session-counter span {
    font-weight: 800;
    color: var(--purple-lighter);
    font-size: 1.08rem;
}

#session-reset {
    padding: 9px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.4px;
    background: linear-gradient(135deg, var(--primary-purple), var(--purple-light));
    border: none;
    color: #fff;
    min-height: 38px;
}

/* ===== BACK BUTTON (UNCHANGED FUNCTIONALITY) ===== */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(147, 51, 234, 0.1);
    border: 2px solid var(--primary-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.back-btn button {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.back-btn button a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.back-btn button span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn button img {
    width: 20px;
    height: 20px;
    display: block;
}

.back-btn:hover {
    background: rgba(147, 51, 234, 0.25);
    transform: translateX(-3px) scale(1.05);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

[data-theme="light"] .back-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="light"] .back-btn:hover {
    border-color: var(--primary-purple);
}

[data-theme="dark"] .back-btn-icon {
    filter: invert(1);
}

/* ===== THEME TOGGLE (UNCHANGED) ===== */
.btn-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(147, 51, 234, 0.1);
    color: var(--text-primary);
    border: 2px solid var(--primary-purple);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

[data-theme="light"] .theme-toggle {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="light"] .theme-toggle svg {
    stroke: var(--primary-purple);
    fill: var(--primary-purple);
}

[data-theme="dark"] .theme-toggle svg {
    stroke: var(--purple-lighter);
    fill: none;
}

.theme-toggle:hover {
    background: rgba(147, 51, 234, 0.25);
    transform: rotate(15deg) scale(1.05);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

/* ===== ANIMATION FOR TIMER RUNNING ===== */
@keyframes pulse-ring {
    0%, 100% {
        filter: drop-shadow(0 0 10px var(--primary-purple));
        stroke-width: 7;
    }
    50% {
        filter: drop-shadow(0 0 22px var(--primary-purple));
        stroke-width: 8;
    }
}

.timer-circle.running .progress-ring-circle {
    animation: pulse-ring 2s ease-in-out infinite;
}

.timer-circle.running::before {
    animation: rotate-glow 3s linear infinite;
    opacity: 0.7;
    filter: blur(1.5px);
}

@media (prefers-reduced-motion: reduce) {
    .timer-circle::before,
    .timer-circle.running::before,
    .timer-circle.running .progress-ring-circle {
        animation: none;
    }
}

/* ===== CURSOR (UNCHANGED) ===== */
.cursor-dot,
.cursor-outline {
    pointer-events: none;
}

/* ===== RESPONSIVE DESIGN - MOBILE ===== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .pomodoro-wrapper {
        height: calc(100dvh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 52px 8px 8px;
        gap: 14px;
        justify-content: flex-start;
    }

    .pomodoro-title {
        font-size: clamp(1.04rem, 2.8vh, 1.3rem);
        letter-spacing: 1px;
    }

    .timer-display {
        gap: 14px;
    }

    .timer-circle {
        width: clamp(150px, 24vh, 190px);
        height: clamp(150px, 24vh, 190px);
    }

    .timer-text {
        font-size: clamp(2.08rem, 5.8vh, 3rem);
    }

    .timer-label {
        padding: 4px 10px;
        font-size: 0.62rem;
        letter-spacing: 1.6px;
    }

    .timer-controls {
        gap: 6px;
    }

    .control-btn {
        padding: 7px 11px;
        font-size: 0.68rem;
        min-height: 32px;
        border-width: 1.5px;
    }

    .control-btn svg {
        width: 14px;
        height: 14px;
    }

    .shortcut-hint {
        display: none;
    }

    .time-setup-section {
        gap: 8px;
    }

    .section-title {
        font-size: 0.54rem;
        margin-bottom: 5px;
    }

    .time-setup-subtitle {
        font-size: 0.5rem;
        margin-bottom: 5px;
    }

    .preset-buttons {
        gap: 6px;
    }

    .preset-btn {
        min-height: 56px;
        padding: 7px 4px;
        border-radius: 10px;
    }

    .preset-time {
        font-size: 0.96rem;
    }

    .preset-label {
        font-size: 0.44rem;
    }

    .custom-time-input {
        gap: 5px;
    }

    .input-group input {
        width: 52px;
        padding: 6px 4px;
        font-size: 0.78rem;
    }

    .input-group label {
        font-size: 0.48rem;
    }

    .set-custom-btn {
        padding: 7px 11px;
        font-size: 0.64rem;
    }

    .session-panel {
        gap: 7px;
        padding: 7px;
    }

    .session-counter {
        padding: 7px 11px;
    }

    .session-counter p {
        font-size: 0.66rem;
    }

    #session-reset {
        min-height: 32px;
        padding: 7px 11px;
        font-size: 0.64rem;
    }
}

@media (max-width: 768px) and (max-height: 700px) {
    .pomodoro-wrapper {
        padding-top: 48px;
        gap: 6px;
    }

    .timer-circle {
        width: 146px;
        height: 146px;
    }

    .timer-text {
        font-size: 1.95rem;
    }
}

/* ===== LARGER SCREENS ===== */
@media (min-height: 850px) {
    .pomodoro-wrapper {
        gap: 24px;
    }

    .timer-circle {
        width: 240px;
        height: 240px;
    }

    .timer-text {
        font-size: 4rem;
    }

    .pomodoro-title {
        font-size: 2.5rem;
    }

    .preset-btn {
        padding: 16px 10px;
    }

    .preset-time {
        font-size: 1.6rem;
    }
}

@media (min-height: 950px) {
    .pomodoro-wrapper {
        gap: 28px;
    }

    .timer-circle {
        width: 260px;
        height: 260px;
    }
}
/* ===== DESKTOP LEFT/RIGHT LAYOUT OVERRIDE ===== */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pomodoro-wrapper {
    width: min(1200px, 100%);
    min-height: calc(100vh - 40px);
    display: grid;
    grid-template-columns: minmax(380px, 460px) minmax(380px, 460px);
    grid-template-areas:
        "title title"
        "timer setup"
        "controls setup";
    column-gap: 40px;
    row-gap: 18px;
    align-items: start;
    justify-content: center;
    padding: 32px 24px;
    box-sizing: border-box;
    overflow: visible;
}

/* title */
.pomodoro-title {
    grid-area: title;
    text-align: center;
    margin: 0 0 8px 0;
}

/* LEFT SIDE */
.timer-display {
    grid-area: timer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
    gap: 14px;
}

.timer-controls {
    grid-area: controls;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    justify-self: center;
}

/* RIGHT SIDE */
.time-setup-section {
    grid-area: setup;
    width: 100%;
    max-width: 460px;
    justify-self: start;
    align-self: start;
}

.presets-section,
.custom-time-section {
    max-width: 460px;
}

.presets-section,
.custom-time-section {
    justify-self: start;
}

/* make right side use space better */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 1fr));
    gap: 10px;
}

.preset-btn {
    min-height: 84px;
    padding: 12px 8px;
}

.custom-time-input {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
}

.section-title {
    text-align: center;
}

/* keep left side visually balanced */
.timer-circle {
    width: 240px;
    height: 240px;
}

.timer-text {
    font-size: clamp(2.8rem, 5vw, 3.8rem);
}

.timer-label {
    font-size: 0.85rem;
}

/* laptop / tablet */
@media (max-width: 980px) {
    .pomodoro-wrapper {
        width: min(760px, 100%);
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 80px 16px 24px;
    }

    .pomodoro-title,
    .timer-display,
    .timer-controls,
    .time-setup-section,
    .session-panel {
        width: 100%;
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }

    .timer-display,
    .timer-controls,
    .time-setup-section,
    .session-panel {
        justify-self: center;
        align-self: center;
    }

    .session-panel {
        align-items: center;
        justify-content: space-between;
        margin-top: 4px;
    }

    .presets-section,
    .custom-time-section {
        max-width: 100%;
    }

    .time-setup-subtitle,
    .section-title {
        text-align: center;
    }

    .custom-time-input {
        justify-content: center;
    }

    .session-counter,
    #session-reset {
        align-self: center;
    }

    .timer-circle {
        width: 190px;
        height: 190px;
    }
}

/* mobile */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .pomodoro-wrapper {
        height: calc(100dvh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 52px 8px 8px;
        gap: 8px;
        justify-content: flex-start;
    }

    .pomodoro-title {
        font-size: clamp(1.04rem, 2.8vh, 1.3rem);
        letter-spacing: 1px;
    }

    .timer-display {
        gap: 8px;
    }

    .timer-circle {
        width: clamp(150px, 24vh, 190px);
        height: clamp(150px, 24vh, 190px);
    }

    .timer-text {
        font-size: clamp(2.08rem, 5.8vh, 3rem);
    }

    .timer-label {
        padding: 4px 10px;
        font-size: 0.62rem;
        letter-spacing: 1.6px;
    }

    .timer-controls {
        gap: 6px;
    }

    .control-btn {
        padding: 7px 11px;
        font-size: 0.68rem;
        min-height: 32px;
        border-width: 1.5px;
    }

    .control-btn svg {
        width: 14px;
        height: 14px;
    }

    .shortcut-hint {
        display: none;
    }

    .time-setup-section {
        gap: 8px;
    }

    .section-title {
        font-size: 0.54rem;
        margin-bottom: 5px;
    }

    .time-setup-subtitle {
        font-size: 0.5rem;
        margin-bottom: 5px;
    }

    .preset-buttons {
        gap: 6px;
    }

    .preset-btn {
        min-height: 56px;
        padding: 7px 4px;
        border-radius: 10px;
    }

    .preset-time {
        font-size: 0.96rem;
    }

    .preset-label {
        font-size: 0.44rem;
    }

    .custom-time-input {
        gap: 5px;
    }

    .input-group input {
        width: 52px;
        padding: 6px 4px;
        font-size: 0.78rem;
    }

    .input-group label {
        font-size: 0.48rem;
    }

    .set-custom-btn {
        padding: 7px 11px;
        font-size: 0.64rem;
    }

    .session-panel {
        gap: 7px;
        padding: 7px;
    }

    .session-counter {
        padding: 7px 11px;
    }

    .session-counter p {
        font-size: 0.66rem;
    }

    #session-reset {
        min-height: 32px;
        padding: 7px 11px;
        font-size: 0.64rem;
    }
}

@media (max-width: 768px) and (max-height: 700px) {
    .pomodoro-wrapper {
        padding-top: 48px;
        gap: 6px;
    }

    .timer-circle {
        width: 146px;
        height: 146px;
    }

    .timer-text {
        font-size: 1.95rem;
    }
}

/* ===== FINAL VIEWPORT-FIT OVERRIDES ===== */
html,
body {
    height: 100%;
    overflow: hidden;
}

.container {
    min-height: 100dvh;
    height: 100dvh;
    padding: clamp(8px, 1.5vh, 16px);
    overflow: hidden;
}

.pomodoro-wrapper {
    height: calc(100dvh - clamp(16px, 3vh, 32px));
    max-height: calc(100dvh - clamp(16px, 3vh, 32px));
    padding: clamp(8px, 1.8vh, 20px) clamp(10px, 1.8vw, 20px);
    row-gap: clamp(6px, 1.3vh, 14px);
    overflow: hidden;
}

.pomodoro-title {
    font-size: clamp(1.2rem, 3.6vh, 2rem);
    margin-bottom: 0;
}

.timer-circle {
    width: clamp(166px, 29vh, 265px);
    height: clamp(166px, 29vh, 265px);
}

.timer-text {
    font-size: clamp(2.35rem, 6.8vh, 4.1rem);
}

.timer-controls {
    gap: clamp(6px, 1vh, 10px);
}

.control-btn {
    padding: clamp(7px, 1.1vh, 10px) clamp(12px, 1.3vw, 18px);
}

.time-setup-section {
    gap: clamp(8px, 1.1vh, 14px);
}

.preset-btn {
    min-height: clamp(64px, 9vh, 82px);
}

.session-panel {
    margin-top: clamp(2px, 0.7vh, 6px);
}

@media (max-width: 980px) {
    .container {
        min-height: 100dvh;
        height: 100dvh;
    }

    .pomodoro-wrapper {
        min-height: 0;
        height: calc(100dvh - 18px);
        max-height: calc(100dvh - 18px);
        gap: clamp(8px, 1.3vh, 12px);
        padding: 62px 10px 10px;
        overflow: hidden;
    }

    .timer-circle {
        width: clamp(146px, 24vh, 205px);
        height: clamp(146px, 24vh, 205px);
    }

    .time-setup-section {
        max-width: 440px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .pomodoro-wrapper {
        height: calc(100dvh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 52px 8px 8px;
        gap: 8px;
        justify-content: flex-start;
    }

    .pomodoro-title {
        font-size: clamp(1.04rem, 2.8vh, 1.3rem);
        letter-spacing: 1px;
    }

    .timer-display {
        gap: 8px;
    }

    .timer-circle {
        width: clamp(150px, 24vh, 190px);
        height: clamp(150px, 24vh, 190px);
    }

    .timer-text {
        font-size: clamp(2.08rem, 5.8vh, 3rem);
    }

    .timer-label {
        padding: 4px 10px;
        font-size: 0.62rem;
        letter-spacing: 1.6px;
    }

    .timer-controls {
        gap: 6px;
    }

    .control-btn {
        padding: 7px 11px;
        font-size: 0.68rem;
        min-height: 32px;
        border-width: 1.5px;
    }

    .control-btn svg {
        width: 14px;
        height: 14px;
    }

    .shortcut-hint {
        display: none;
    }

    .time-setup-section {
        gap: 8px;
    }

    .section-title {
        font-size: 0.54rem;
        margin-bottom: 5px;
    }

    .time-setup-subtitle {
        font-size: 0.5rem;
        margin-bottom: 5px;
    }

    .preset-buttons {
        gap: 6px;
    }

    .preset-btn {
        min-height: 56px;
        padding: 7px 4px;
        border-radius: 10px;
    }

    .preset-time {
        font-size: 0.96rem;
    }

    .preset-label {
        font-size: 0.44rem;
    }

    .custom-time-input {
        gap: 5px;
    }

    .input-group input {
        width: 52px;
        padding: 6px 4px;
        font-size: 0.78rem;
    }

    .input-group label {
        font-size: 0.48rem;
    }

    .set-custom-btn {
        padding: 7px 11px;
        font-size: 0.64rem;
    }

    .session-panel {
        gap: 7px;
        padding: 7px;
    }

    .session-counter {
        padding: 7px 11px;
    }

    .session-counter p {
        font-size: 0.66rem;
    }

    #session-reset {
        min-height: 32px;
        padding: 7px 11px;
        font-size: 0.64rem;
    }
}

@media (max-width: 768px) and (max-height: 700px) {
    .pomodoro-wrapper {
        padding-top: 48px;
        gap: 6px;
    }

    .timer-circle {
        width: 146px;
        height: 146px;
    }

    .timer-text {
        font-size: 1.95rem;
    }
}
