:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --primary-color: #4dabf7;
    --secondary-color: #fa5252;
    --dim-text: #888;
}

body.pastel-theme {
    background-color: #fdf2f8;
    color: #555;
}

body.pastel-theme .mode-btn {
    color: #888;
}

body.pastel-theme .mode-btn.active {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

body.pastel-theme .progress-ring__circle {
    stroke: #ffb7b2;
}

body.pastel-theme .control-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #555;
}

body.pastel-theme .control-btn.primary {
    background: #ffb7b2;
    color: #fff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding-top: 3vh;
    padding-bottom: 60px;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.mode-switch {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 2rem;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--dim-text);
    padding: 0.5rem 1.5rem;
    border-radius: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-weight: 600;
}

.timer-display {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-display svg {
    width: 100%;
    height: 100%;
}

.character-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    margin-top: 0.5rem;
    -webkit-touch-callout: none;
}

.char-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    pointer-events: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: transparent;
    pointer-events: auto;
    -webkit-touch-callout: none;
    user-select: none;
}

.character-container img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.copyright-img {
    position: absolute;
    bottom: -20px;
    right: 0;
    width: 60px !important;
    height: auto !important;
    border-radius: 0 !important;
    z-index: 101;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 1s linear;
    stroke-dasharray: 880;
    stroke-dashoffset: 0;
    stroke-linecap: round;
}

.time {
    position: absolute;
    font-size: 5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    z-index: 20;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

body.pastel-theme .time {
    text-shadow: none;
}

.controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-color);
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn.primary {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.control-btn.primary:hover {
    background: #3b8dc4;
}

.ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 60px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 100;
}

.ad-slot {
    width: 320px;
    height: 50px;
    background: #fff;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== Mobile Responsive ========== */
@media screen and (max-width: 480px) {
    body {
        padding-top: 1.5vh;
    }

    .container {
        gap: 0.5rem;
    }

    .timer-display {
        width: 260px;
        height: 260px;
    }

    .time {
        font-size: 3.8rem;
    }

    .character-container {
        width: 140px;
        height: 140px;
        margin-top: 0.3rem;
    }

    .copyright-img {
        width: 40px !important;
        bottom: -14px;
    }

    .mode-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .control-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .controls {
        gap: 0.5rem;
    }
}

/* Extra small screens (iPhone SE etc.) */
@media screen and (max-height: 667px) {
    body {
        padding-top: 1vh;
    }

    .container {
        gap: 0.3rem;
    }

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

    .time {
        font-size: 3.5rem;
    }

    .character-container {
        width: 120px;
        height: 120px;
        margin-top: 0.2rem;
    }

    .copyright-img {
        width: 35px !important;
        bottom: -12px;
    }

    .mode-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
