/* Pomodoro Timer · pastel theme by Noya Adivi */
:root {
  --ink: #2C2668;
  --muted: #7A6B88;
  --card: rgba(255, 255, 255, .72);
  --card-border: rgba(255, 255, 255, .9);
  --track: rgba(111, 96, 240, .12);
  --shadow: 0 18px 50px rgba(85, 72, 200, .14);
  --bg1: #FFE6DE; --bg2: #E8E4FF; --bg3: #D9F3E7;
  --a: #E36E57; --a2: #F5A08C; --soft: #FFE6DE; --deep: #A8483A;
  --radius: 28px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
html[data-mode="short"] { --a: #2E9A6C; --a2: #7FD3B0; --soft: #D9F3E7; --deep: #1F7350; }
html[data-mode="long"]  { --a: #6F60F0; --a2: #B3A9FA; --soft: #E8E4FF; --deep: #5548C8; }
html[data-theme="dark"] {
  --ink: #EFEAFF; --muted: #B7ADD6;
  --card: rgba(38, 33, 68, .72); --card-border: rgba(179, 169, 250, .18);
  --track: rgba(179, 169, 250, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --bg1: #2A2140; --bg2: #1E1A33; --bg3: #17302A;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed; transition: color .4s;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--deep); }
html[data-theme="dark"] a { color: var(--a2); }

/* animated background */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; transition: background .8s; }
.b1 { width: 420px; height: 420px; background: var(--a2); top: -120px; inset-inline-start: -100px; }
.b2 { width: 360px; height: 360px; background: #B3A9FA; bottom: -120px; inset-inline-end: -80px; animation-duration: 18s; animation-direction: alternate-reverse; }
.b3 { width: 280px; height: 280px; background: #A9E3CD; top: 40%; inset-inline-start: 45%; animation-duration: 22s; }
.spark { position: absolute; font-size: 22px; color: var(--a2); animation: twinkle 3.2s ease-in-out infinite; }
.s1 { top: 14%; left: 12%; } .s2 { top: 70%; left: 8%; animation-delay: -1s; color: #B3A9FA; }
.s3 { top: 22%; right: 10%; animation-delay: -2s; color: #F5B8C8; } .s4 { bottom: 12%; right: 30%; animation-delay: -.5s; color: #A9E3CD; }
@keyframes drift { to { transform: translate(60px, -40px) scale(1.15); } }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }

/* header */
.top { max-width: 1180px; margin: 0 auto; padding: 22px 20px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { animation: bob 3.4s ease-in-out infinite; filter: drop-shadow(0 6px 12px rgba(227, 110, 87, .3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 1.3rem; font-weight: 800; background: linear-gradient(90deg, #E36E57, #6F60F0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { color: var(--muted); }
.top-actions { display: flex; gap: 10px; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--card-border); background: var(--card); backdrop-filter: blur(10px); box-shadow: var(--shadow); font-weight: 800; font-size: 1rem; transition: transform .25s, background .3s; }
.icon-btn:hover { transform: translateY(-3px) rotate(-6deg); }
.icon-btn:active { transform: scale(.92); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* layout */
.layout { max-width: 1180px; margin: 0 auto; padding: 14px 20px 30px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.card { background: var(--card); border: 2px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px); padding: 24px; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.timer-card { grid-row: span 2; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tasks-card { animation-delay: .12s; } .stats-card { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
h2 { margin: 0 0 16px; font-size: 1.2rem; display: flex; gap: 8px; align-items: center; }

/* tabs */
.tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--track); border-radius: 999px; padding: 5px; width: 100%; max-width: 460px; }
.tab { position: relative; z-index: 1; border: 0; background: none; padding: 10px 8px; border-radius: 999px; font-weight: 700; color: var(--muted); transition: color .3s; }
.tab.active { color: var(--deep); }
html[data-theme="dark"] .tab.active { color: #2C2668; }
.tab-pill { position: absolute; top: 5px; bottom: 5px; border-radius: 999px; background: linear-gradient(135deg, #fff, var(--soft)); box-shadow: 0 6px 16px rgba(0, 0, 0, .08); transition: left .45s cubic-bezier(.3, 1.4, .5, 1), width .45s, background .5s; }

/* ring */
.ring-wrap { position: relative; width: min(360px, 82vw); aspect-ratio: 1; margin: 26px 0 18px; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 18; }
.ring-bar { fill: none; stroke: url(#ringGrad); stroke-width: 18; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 160px 160px; transition: stroke-dashoffset .35s linear; }
.g1 { stop-color: var(--a); } .g2 { stop-color: var(--a2); }
.ring-dot { fill: #fff; stroke: var(--a); stroke-width: 5; transform-origin: 160px 160px; transition: transform .35s linear; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .18)); }
.ring-wrap::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle, var(--soft), transparent 70%); opacity: .8; transition: background .6s; }
.ring-wrap.running::before { animation: breathe 4s ease-in-out infinite; }
.ring-wrap.running .ring { animation: glow 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: 1; } }
@keyframes glow { 50% { filter: drop-shadow(0 0 18px var(--a2)); } }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mode-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--muted); }
.time { font-size: clamp(3.2rem, 13vw, 5.2rem); font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; direction: ltr; background: linear-gradient(135deg, var(--deep), var(--a)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="dark"] .time { background: linear-gradient(135deg, #fff, var(--a2)); -webkit-background-clip: text; background-clip: text; }
.time.tick { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.05); } }
.round { color: var(--muted); font-weight: 600; }

/* controls */
.controls { display: flex; align-items: center; gap: 18px; }
.ctrl { border: 0; border-radius: 999px; font-weight: 800; transition: transform .2s, box-shadow .3s, background .4s; }
.ctrl:active { transform: scale(.94); }
.ctrl.main { min-width: 170px; padding: 18px 34px; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--a), var(--a2)); box-shadow: 0 12px 26px color-mix(in srgb, var(--a) 40%, transparent); position: relative; overflow: hidden; }
.ctrl.main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite; }
.ctrl.main:hover { transform: translateY(-3px); }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.ctrl.ghost { width: 58px; height: 58px; font-size: 1.4rem; background: var(--card); border: 2px solid var(--card-border); box-shadow: var(--shadow); color: var(--deep); }
html[data-theme="dark"] .ctrl.ghost { color: var(--a2); }
.ctrl.ghost:hover { transform: rotate(-20deg) scale(1.06); }
.ctrl.small { min-width: 0; width: auto; height: auto; padding: 11px 22px; font-size: 1rem; }
.current-task { min-height: 1.4em; margin: 18px 0 4px; font-weight: 700; color: var(--deep); }
html[data-theme="dark"] .current-task { color: var(--a2); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }

/* tasks */
.task-form { display: flex; gap: 8px; }
.task-form input { border: 2px solid transparent; background: var(--track); border-radius: 16px; padding: 12px 14px; outline: none; transition: border .25s, background .25s; }
.task-form input:focus { border-color: var(--a2); background: transparent; }
#taskInput { flex: 1; min-width: 0; }
#taskEst { width: 64px; text-align: center; }
.add-btn { width: 48px; border: 0; border-radius: 16px; color: #fff; font-size: 1.4rem; font-weight: 800; background: linear-gradient(135deg, var(--a), var(--a2)); transition: transform .2s; }
.add-btn:hover { transform: rotate(90deg); }
.task-list { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; flex-direction: column; gap: 8px; max-height: 290px; overflow-y: auto; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--track); border: 2px solid transparent; cursor: pointer; animation: slideIn .4s cubic-bezier(.2, .9, .3, 1.3) both; transition: border .25s, transform .2s, opacity .3s; }
.task:hover { transform: translateX(var(--nudge, -4px)); }
html[dir="ltr"] .task:hover { --nudge: 4px; }
.task.active { border-color: var(--a); background: color-mix(in srgb, var(--soft) 70%, transparent); }
html[data-theme="dark"] .task.active { background: color-mix(in srgb, var(--a) 22%, transparent); }
.task.done .task-text { text-decoration: line-through; opacity: .55; }
.task.leaving { opacity: 0; transform: scale(.9); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px) scale(.95); } }
.task-check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--a); background: none; display: grid; place-items: center; color: #fff; font-size: .8rem; transition: background .25s; }
.task.done .task-check { background: var(--a); }
.task-text { flex: 1; overflow-wrap: anywhere; }
.task-count { font-size: .85rem; font-weight: 700; color: var(--muted); direction: ltr; white-space: nowrap; }
.task-del { border: 0; background: none; font-size: 1rem; opacity: .45; transition: opacity .2s, transform .2s; }
.task-del:hover { opacity: 1; transform: scale(1.2); }
.empty { color: var(--muted); font-size: .92rem; margin: 10px 0; }
.text-btn { border: 0; background: none; color: var(--deep); font-weight: 700; padding: 6px 2px; text-decoration: underline; text-underline-offset: 4px; }
html[data-theme="dark"] .text-btn { color: var(--a2); }
.text-btn.danger { color: #A03A5C; }
html[data-theme="dark"] .text-btn.danger { color: #F5B8C8; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--track); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.8rem; color: var(--deep); }
html[data-theme="dark"] .stat b { color: var(--a2); }
.stat b.bump { animation: pop .5s ease; }
.stat small { color: var(--muted); font-weight: 600; }
.week-title { font-size: 1rem; margin: 18px 0 10px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 130px; direction: ltr; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: .75rem; color: var(--muted); }
.bar i { display: block; width: 100%; max-width: 34px; border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, var(--a2), var(--a)); min-height: 6px; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .9, .3, 1.2) both; transition: height .6s; }
.bar.today span { color: var(--deep); font-weight: 800; }
.bar b { font-size: .75rem; color: var(--ink); }
@keyframes grow { from { transform: scaleY(0); } }

/* footer */
.foot { text-align: center; padding: 6px 20px 30px; color: var(--muted); display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-weight: 600; }

/* dialog */
.dialog { border: 0; border-radius: var(--radius); padding: 26px; width: min(520px, 92vw); background: var(--card); color: var(--ink); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
html[data-theme="dark"] .dialog { background: #262144; }
.dialog[open] { animation: rise .4s cubic-bezier(.2, .9, .3, 1.2); }
.dialog::backdrop { background: rgba(44, 38, 104, .3); backdrop-filter: blur(4px); }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dialog label span { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.dialog input[type="number"] { width: 100%; border: 2px solid transparent; background: var(--track); border-radius: 14px; padding: 10px; outline: none; }
.dialog input[type="number"]:focus { border-color: var(--a2); }
.field { display: block; margin: 14px 0; }
.switch { display: flex; align-items: center; gap: 12px; margin: 12px 0; cursor: pointer; }
.switch span:last-child { margin: 0; color: var(--ink); font-size: .95rem; }
.switch input { position: absolute; opacity: 0; }
.slider { width: 48px; height: 28px; flex: none; border-radius: 999px; background: var(--track); position: relative; transition: background .3s; margin: 0 !important; }
.slider::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--a), var(--a2)); }
.switch input:checked + .slider::after { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + .slider::after { transform: translateX(-20px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--a2); outline-offset: 2px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dialog-actions.end { justify-content: flex-end; margin-top: 18px; }

/* toast + confetti */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 160%); opacity: 0; visibility: hidden; background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s, visibility .3s; z-index: 20; }
html[data-theme="dark"] .toast { background: #B3A9FA; color: #2C2668; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 15; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

:focus-visible { outline: 3px solid var(--a2); outline-offset: 3px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .timer-card { grid-row: auto; }
}
@media (max-width: 480px) {
  .brand-text small { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .ctrl.main { min-width: 140px; padding: 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shared look: Fredoka for titles, Rubik for text ---------- */
h1,h2,h3,.brand{font-family:"Fredoka","Rubik",system-ui,sans-serif}

/* consistency fixes: one font everywhere, no sideways scroll on mobile */
button,input,select,textarea{font-family:inherit}
html,body{overflow-x:clip;max-width:100%}

/* ===== Mobile stability: no sideways drift, pinch-zoom stays allowed ===== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{max-width:100%;overflow-x:hidden;overflow-x:clip;overscroll-behavior-x:none}
:where(img,svg,video,canvas,iframe,table){max-width:100%}
:where(img,video){height:auto}
:where(h1,h2,h3,h4,p,li,a,span,td,th,label,button){overflow-wrap:break-word}
@media (pointer:coarse){input,select,textarea{font-size:max(16px,1em)}}

/* ===== v3 upgrades ===== */
/* presets */
.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.preset { border: 2px solid var(--card-border); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: transform .25s cubic-bezier(.3,1.4,.5,1), background .3s, color .3s, border-color .3s; }
.preset small { opacity: .7; font-weight: 600; direction: ltr; display: inline-block; }
.preset:hover { transform: translateY(-2px); color: var(--deep); }
.preset.on { background: linear-gradient(135deg, var(--soft), #fff); border-color: var(--a2); color: var(--deep); box-shadow: 0 6px 16px color-mix(in srgb, var(--a) 22%, transparent); }
html[data-theme="dark"] .preset.on { background: color-mix(in srgb, var(--a) 30%, transparent); color: #fff; }

/* +1 / -1 and end time */
.adjust { display: flex; gap: 8px; margin-top: 8px; opacity: .0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.ring-wrap:hover .adjust, .ring-wrap:focus-within .adjust, .is-running .adjust { opacity: 1; transform: none; }
@media (hover: none) { .adjust { opacity: 1; transform: none; } }
.mini { border: 0; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; background: var(--track); color: var(--deep); direction: ltr; transition: transform .2s, background .25s; }
html[data-theme="dark"] .mini { color: var(--a2); }
.mini:hover { transform: scale(1.1); background: color-mix(in srgb, var(--a2) 35%, transparent); }
.ends { min-height: 1.2em; margin-top: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ripple on main button */
.ripple { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: rgba(255,255,255,.6); pointer-events: none; animation: ripple .7s ease-out forwards; }
@keyframes ripple { to { transform: scale(16); opacity: 0; } }
.is-running .ctrl.main { animation: pulseBtn 2.4s ease-in-out infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 12px 34px color-mix(in srgb, var(--a) 60%, transparent); } }

/* break tip */
.current-task.tip { padding: 10px 18px; border-radius: 999px; background: var(--track); animation: fadeUp .5s ease both; }

/* background sounds */
.sound-box { width: 100%; max-width: 480px; margin-top: 14px; padding: 14px 16px; border-radius: 22px; background: var(--track); text-align: start; }
.sound-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq i { width: 4px; height: 4px; border-radius: 2px; background: var(--a); transition: height .3s; }
.sound-box.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.sound-box.playing .eq i:nth-child(2) { animation-delay: -.3s; } .sound-box.playing .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.snd-row { display: flex; flex-wrap: wrap; gap: 6px; }
.snd { border: 2px solid transparent; background: var(--card); border-radius: 14px; padding: 7px 11px; font-weight: 700; font-size: .85rem; transition: transform .2s, border-color .25s, background .25s; }
.snd:hover { transform: translateY(-2px); }
.snd.on { border-color: var(--a); background: color-mix(in srgb, var(--soft) 80%, #fff); }
html[data-theme="dark"] .snd.on { background: color-mix(in srgb, var(--a) 28%, transparent); }
.snd-opts { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.vol { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.vol input { accent-color: var(--a); width: 120px; }
.switch.tiny { margin: 0; font-size: .85rem; }
.switch.tiny .slider { width: 40px; height: 24px; }
.switch.tiny .slider::after { width: 16px; height: 16px; }
.switch.tiny input:checked + .slider::after { transform: translateX(16px); }
html[dir="rtl"] .switch.tiny input:checked + .slider::after { transform: translateX(-16px); }

/* tasks extras */
.task-count { display: inline-flex; align-items: center; gap: 4px; }
.cnt { border: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--card); font-weight: 800; line-height: 1; padding: 0; opacity: 0; transition: opacity .2s; }
.task:hover .cnt, .task:focus-within .cnt { opacity: 1; }
@media (hover: none) { .cnt { opacity: 1; } }
.task-up { border: 0; background: none; opacity: 0; font-weight: 800; transition: opacity .2s, transform .2s; }
.task:hover .task-up { opacity: .6; } .task-up:hover { opacity: 1 !important; transform: translateY(-2px); }
.task-text[contenteditable="true"] { outline: 2px dashed var(--a2); border-radius: 8px; padding: 2px 6px; background: var(--card); cursor: text; }
.task.pop { animation: taskPop .35s ease; }
@keyframes taskPop { 50% { transform: scale(1.04); } }
.tasks-left { margin: 4px 0; font-size: .85rem; font-weight: 700; color: var(--muted); }

/* daily goal */
.goal { padding: 14px; border-radius: 18px; background: var(--track); margin-bottom: 10px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; margin-bottom: 8px; }
.goal-top span { color: var(--muted); font-weight: 700; }
.goal-track { height: 12px; border-radius: 999px; background: var(--card); overflow: hidden; }
.goal-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--a), var(--a2)); transition: width .8s cubic-bezier(.2,.9,.3,1.2); position: relative; }
.goal-track span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); animation: shine 2.8s ease-in-out infinite; }
.goal-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.goal-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--card); transition: background .4s var(--d); }
.goal-dots i.on { background: var(--a); animation: pop .5s ease both; animation-delay: var(--d); }
.goal.reached { background: linear-gradient(135deg, color-mix(in srgb, #FFE29A 55%, transparent), var(--track)); }
.goal.reached .goal-top b::after { content: " 🏆"; }
.bar.hit i { background: linear-gradient(180deg, #FFE29A, var(--a)); }
.week-sum { margin: 10px 0 0; font-size: .85rem; font-weight: 700; color: var(--muted); }

/* today's log */
.log { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.log li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--track); font-size: .88rem; animation: slideIn .4s ease both; }
.log li.muted { color: var(--muted); }
.log time { font-weight: 800; color: var(--deep); direction: ltr; }
html[data-theme="dark"] .log time { color: var(--a2); }
.log span { color: var(--muted); font-weight: 700; white-space: nowrap; }
.log em { font-style: normal; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* zen mode */
.zen-exit { display: none; }
.zen-bar { position: fixed; top: 0; inset-inline: 0; height: 5px; z-index: 30; pointer-events: none; }
.zen-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--a), var(--a2)); transform: scaleX(0); transform-origin: left; transition: transform .35s linear; }
html[dir="rtl"] .zen-bar span { transform-origin: right; }
html.zen .top, html.zen .tasks-card, html.zen .stats-card, html.zen .foot, html.zen .presets, html.zen .hint, html.zen .sound-box { display: none; }
html.zen .layout { grid-template-columns: 1fr; min-height: 100vh; align-content: center; }
html.zen .timer-card { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; }
html.zen .ring-wrap { width: min(520px, 86vw, 62vh); }
html.zen .time { font-size: clamp(4rem, 15vw, 7.5rem); }
html.zen .zen-exit { display: inline-block; margin-top: 18px; border: 0; background: none; color: var(--muted); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
html.zen .blob { opacity: .35; }

/* ===== phone fit ===== */
.layout > * { min-width: 0; }
.sound-box .switch { margin: 0; font-size: .85rem; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .layout { padding: 10px 12px 24px; gap: 16px; }
  .top-actions { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .tab { font-size: .85rem; padding-inline: 6px; }
  .vol input { width: 96px; }
  .controls { gap: 12px; }
}


/* ---------- upgrade: hero, spotlight, ripple, footer in one line ---------- */
html { scroll-behavior: smooth; scrollbar-color: #C9C1FF transparent; }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: linear-gradient(#FFB4A2, #B3A9FA); border-radius: 99px; }
.top { position: sticky; top: 0; z-index: 20; border-radius: 0 0 24px 24px; transition: box-shadow .3s, padding .3s, background .3s; }
.top.scrolled { background: var(--card); backdrop-filter: blur(16px); box-shadow: 0 8px 28px rgba(111, 96, 240, .14); padding-block: 10px; }

.hero { text-align: center; max-width: 760px; margin: 0 auto; padding: 18px 20px 10px; animation: rise .8s ease both; }
.hero-badge { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 30px; background: var(--card); box-shadow: 0 14px 34px rgba(111, 96, 240, .22); animation: bob 3.6s ease-in-out infinite; }
.hero-badge img { width: 62px; height: 62px; }
.hero-badge::before { content: ""; position: absolute; inset: -4px; border-radius: 34px; padding: 4px; background: conic-gradient(from var(--ang, 0deg), #FFB4A2, #B3A9FA, #A9E3CD, #FFB4A2); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinAng 5s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spinAng { to { --ang: 360deg; } }
.orbit { position: absolute; inset: -18px; animation: orbit 9s linear infinite; pointer-events: none; }
.orbit i { position: absolute; width: 10px; height: 10px; border-radius: 50%; }
.orbit i:nth-child(1) { top: 0; left: 50%; background: #FFB4A2; }
.orbit i:nth-child(2) { bottom: 10%; left: 4%; background: #B3A9FA; width: 8px; height: 8px; }
.orbit i:nth-child(3) { bottom: 10%; right: 4%; background: #A9E3CD; width: 12px; height: 12px; }
@keyframes orbit { to { transform: rotate(360deg); } }
.hero-title { margin: 0; font-family: "Fredoka", "Rubik", system-ui, sans-serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.15; }
.grad { background: linear-gradient(90deg, #E36E57, #6F60F0, #E36E57); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 6s linear infinite; }
@keyframes flow { to { background-position: 200% center; } }
.sub { color: var(--muted); margin: 10px 0 0; font-size: 1.08rem; }
.pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pills a { font-size: .9rem; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--card); backdrop-filter: blur(8px); border: 1px solid rgba(179, 169, 250, .45); padding: 7px 15px; border-radius: 999px; position: relative; overflow: hidden; animation: rise .6s ease both; transition: transform .25s, box-shadow .25s, background .25s; }
.pills a:nth-child(2) { animation-delay: .08s; } .pills a:nth-child(3) { animation-delay: .16s; } .pills a:nth-child(4) { animation-delay: .24s; }
.pills a:hover, .pills a:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); background: linear-gradient(90deg, #FFE6DE, #E8E4FF); color: #2C2668; }
html[data-theme="dark"] .pills a { color: var(--ink); }
#timerCard, #tasksCard, #statsCard, #soundBox { scroll-margin-top: 90px; }
.flash { animation: flash 1.2s ease !important; }
@keyframes flash { 30% { box-shadow: 0 0 0 4px var(--a2), var(--shadow); } }

/* spotlight that follows the cursor */
.card { position: relative; transition: box-shadow .3s, transform .3s; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(179, 169, 250, .22), transparent 70%); }
.card:hover::after { opacity: 1; }
.tasks-card:hover, .stats-card:hover { box-shadow: 0 22px 54px rgba(111, 96, 240, .2); }
html[data-theme="dark"] .card::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(155, 140, 255, .16), transparent 70%); }

/* ripple on buttons */
.ctrl, .preset, .snd, .tab, .icon-btn, .add-btn { position: relative; overflow: hidden; }
.ripple { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .7); transform: translate(-50%, -50%) scale(0); animation: rippleOut .6s ease-out forwards; pointer-events: none; }
html[data-theme="dark"] .ripple { background: rgba(194, 185, 255, .35); }
@keyframes rippleOut { to { transform: translate(-50%, -50%) scale(30); opacity: 0; } }

/* footer: everything on one line */
.foot { display: block; padding: 10px 20px 30px; }
.foot::before { content: ""; display: block; width: 120px; height: 4px; margin: 0 auto 18px; border-radius: 99px; background: linear-gradient(90deg, #FFB4A2, #B3A9FA, #A9E3CD); }
.foot-line { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 10px; white-space: nowrap; font-size: clamp(.78rem, 2.6vw, 1rem); }
.foot .built-by { display: inline-flex; margin: 0; }
.foot .dot { opacity: .6; }
.foot-link { font-weight: 700; text-decoration: none; transition: color .2s, transform .2s; display: inline-block; }
.foot-link:hover { text-decoration: underline; transform: translateY(-2px); }

html.zen .hero { display: none; }
@media (max-width: 380px) { .foot-line { gap: 6px; } .foot .built-by a { padding: .2em .55em; } }

/* ---------- heatmap, achievements, backup, floating timer ---------- */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; min-width: calc(var(--weeks, 18) * 14px); }
.heat i, .heat-legend i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--track); animation: heatIn .5s ease both; animation-delay: calc(var(--i, 0) * 4ms); transition: transform .2s; }
.heat i:hover { transform: scale(1.35); position: relative; z-index: 1; }
.heat .l1, .heat-legend .l1 { background: color-mix(in srgb, var(--a) 28%, transparent); }
.heat .l2, .heat-legend .l2 { background: color-mix(in srgb, var(--a) 50%, transparent); }
.heat .l3, .heat-legend .l3 { background: color-mix(in srgb, var(--a) 75%, transparent); }
.heat .l4, .heat-legend .l4 { background: linear-gradient(135deg, var(--a), #6F60F0); }
.heat .today { outline: 2px solid var(--a); outline-offset: 1px; }
@keyframes heatIn { from { opacity: 0; transform: scale(.4); } }
.heat-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.heat-legend { display: inline-flex; align-items: center; gap: 4px; }
.heat-legend i { width: 12px; animation: none; }
.ach-sub { color: var(--muted); font-weight: 600; font-size: .8rem; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 18px; background: var(--track); opacity: .55; filter: grayscale(.8); animation: rise .5s ease both; animation-delay: calc(var(--i) * 40ms); transition: transform .25s, box-shadow .25s; }
.badge.on { opacity: 1; filter: none; background: linear-gradient(135deg, #FFE6DE, #E8E4FF); color: #2C2668; box-shadow: 0 8px 20px rgba(111, 96, 240, .14); }
html[data-theme="dark"] .badge.on { background: linear-gradient(135deg, #4A3048, #322A5C); color: var(--ink); }
.badge:hover { transform: translateY(-4px) rotate(-1deg); }
.b-ico { font-size: 1.6rem; }
.badge.on .b-ico { animation: bob 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.badge b { font-size: .88rem; }
.badge small { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.badge.new { animation: unlock 1s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes unlock { 0% { transform: scale(.6) rotate(-10deg); } 60% { transform: scale(1.15) rotate(4deg); box-shadow: 0 0 0 6px var(--a2); } }
.backup-row { display: flex; gap: 16px; flex-wrap: wrap; }
#pipBtn.on { background: linear-gradient(135deg, var(--a), var(--a2)); color: #fff; }

/* ---------- stats tabs, back to top, colour wave, splash, reveal ---------- */
.stabs { position: relative; display: flex; gap: 4px; padding: 5px; margin: 4px 0 16px; border-radius: 999px; background: var(--track); }
.stab { position: relative; z-index: 1; flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); transition: color .3s; white-space: nowrap; }
.stab.on { color: var(--deep); }
html[data-theme="dark"] .stab.on { color: #2C2668; }
.stabs-pill { position: absolute; top: 5px; bottom: 5px; border-radius: 999px; background: linear-gradient(135deg, #fff, var(--soft)); box-shadow: 0 6px 16px rgba(111, 96, 240, .16); transition: left .45s cubic-bezier(.3, 1.3, .5, 1), width .45s cubic-bezier(.3, 1.3, .5, 1); }
.spanel.enter { animation: panelIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } }
.spanel > .week-title:first-child { margin-top: 0; }

.to-top { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 30; width: 48px; height: 48px; border: 0; border-radius: 50%; font-size: 1.3rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--a), #6F60F0); box-shadow: 0 10px 24px rgba(111, 96, 240, .3); opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .3s, transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }
html.zen .to-top { display: none; }

.wash { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--soft); opacity: .7; clip-path: circle(0 at var(--x) var(--y)); animation: wash 1.2s cubic-bezier(.3, .7, .3, 1) forwards; }
@keyframes wash { 70% { opacity: .5; } to { clip-path: circle(150vmax at var(--x) var(--y)); opacity: 0; } }
.top, .hero, .layout, .foot { position: relative; z-index: 1; }
.top { z-index: 20; }
#startBtn { transition: translate .25s ease-out, transform .2s, box-shadow .2s; }

.rv { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.rv.in { opacity: 1; transform: none; }

.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3)); animation: splashOut .5s ease .95s forwards; }
.splash img { width: 110px; height: 110px; animation: splashLogo .9s cubic-bezier(.3, 1.5, .5, 1) both; grid-area: 1 / 1; }
.splash span { grid-area: 1 / 1; width: 110px; height: 110px; border-radius: 50%; border: 3px solid var(--a2); animation: splashRing 1s ease-out .2s both; }
@keyframes splashLogo { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
@keyframes splashRing { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
