:root {
    --bg: #0e0f12;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --card: #111827;
    --card-border: rgba(148,163,184,0.4);
    --card-shadow: 0 18px 45px rgba(0,0,0,0.65);
    --accent: #f97373;
    --accent-strong: #fb4b5c;
    --accent-soft: rgba(249,115,129,0.18);
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%) fixed;
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

/* Светлая тема */
body.light {
    --bg: #f3f4f6;
    --text: #111827;
    --muted: #6b7280;
    --card: #ffffff;
    --card-border: rgba(15,23,42,0.08);
    --card-shadow: 0 16px 40px rgba(15,23,42,0.12);
    --accent: #ef4444;
    --accent-strong: #dc2626;
    --accent-soft: rgba(248,113,113,0.16);
    background: radial-gradient(circle at top, #e5e7eb 0, #f9fafb 60%) fixed;
}

/* Убираем стандартный фокус браузера */
button, input {
    outline: none;
}

/* ------------ Глобальные утилиты ------------- */

.text-muted {
    color: var(--muted);
}

.text-accent {
    color: var(--accent);
}

/* ------------ Карточки ------------- */

.card {
    background: linear-gradient(135deg, rgba(15,23,42,0.9), rgba(15,23,42,0.8));
    border-radius: 1.25rem;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    backdrop-filter: blur(18px);
}

body.light .card {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(249,250,251,0.98));
}

/* ------------ Кнопки ------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    border-radius: 999px;
    padding: 0.55rem 1.15rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-strong), #fb7185);
    color: #f9fafb;
    box-shadow: 0 12px 30px rgba(248,113,113,0.45);
}

.btn-primary:hover {
    box-shadow: 0 18px 40px rgba(248,113,113,0.6);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(248,113,113,0.45);
}

.btn-secondary {
    background: rgba(15,23,42,0.85);
    color: var(--text);
    border-color: rgba(148,163,184,0.45);
}

body.light .btn-secondary {
    background: rgba(243,244,246,0.9);
}

.btn-secondary:hover {
    background: rgba(30,41,59,0.95);
}

.btn-secondary:active {
    transform: translateY(1px);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: rgba(148,163,184,0.35);
}

.btn-ghost:hover {
    background: rgba(15,23,42,0.6);
    color: var(--text);
}

body.light .btn-ghost:hover {
    background: rgba(243,244,246,0.9);
}

/* Переключатель темы */

.theme-toggle-btn {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.88);
    color: var(--text);
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

body.light .theme-toggle-btn {
    background: rgba(255,255,255,0.92);
}

/* ------------ Формы ------------- */

.input {
    width: 100%;
    border-radius: 0.9rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.9);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder {
    color: rgba(148,163,184,0.8);
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
    background: rgba(15,23,42,0.98);
}

body.light .input {
    background: rgba(249,250,251,0.98);
}

/* field wrapper */

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.field-label {
    color: var(--muted);
}

/* ------------ Таймер ------------- */

.timer-wrapper {
    position: relative;
    width: min(260px, 70vw);
    height: min(260px, 70vw);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--accent);
    filter: drop-shadow(0 0 25px rgba(248,113,113,0.4));
}

.timer-ring {
    stroke-dasharray: 691;
    stroke-dashoffset: 691;
    transition: stroke-dashoffset 0.35s ease-out;
}

.timer-center {
    position: relative;
    z-index: 1;
    text-align: center;
}

.timer-time {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.timer-label {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ------------ Заголовки секций ------------- */

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

/* ------------ Задачи ------------- */

.task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.9rem;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.3);
    font-size: 0.9rem;
}

body.light .task-row {
    background: rgba(249,250,251,0.96);
}

.task-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
}

.task-title {
    white-space: normal;
    word-break: break-word;
}

.task-title.done {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
}

/* Checkbox кастомный можно потом замутить, пока дефолт ок */

/* Кнопка удаления задачи */

.task-remove {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.4);
    background: transparent;
    color: var(--muted);
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.task-remove:hover {
    background: rgba(239,68,68,0.12);
    color: #fecaca;
    border-color: rgba(248,113,113,0.7);
}

/* ------------ Адаптив мелкий ------------- */

@media (max-width: 640px) {
    header {
        padding-top: 1rem;
    }
    .card {
        padding: 1.1rem 1.1rem 1.25rem;
    }
    .timer-time {
        font-size: 2.2rem;
    }
}
.share-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.share-btn {
    background: #0e0f12;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: .25s;
}

.share-btn:hover {
    opacity: .85;
}

.share-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: #1a1b1f;
    padding: 10px 12px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: .25s;
}

.share-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.share-panel .sh {
    color: #fff;
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    transition: .2s;
}

.share-panel .sh:hover {
    transform: scale(1.15);
}

.share-panel .vk { color: #4c75a3; }
.share-panel .tg { color: #2aabee; }
.share-panel .wa { color: #25d366; }
.share-panel .fb { color: #1877f2; }
.share-panel .tw { color: #fff; }
.share-panel .em { color: #f1c40f; }
