/* pomodoro.css 20261018.8 — scene backgrounds, glass panels, progress art, stickers */
:root{background:#3a2a22}
body[data-tool=pomodoro]{--glass:#fffcf8e6;--ink:#3b2a22;--muted:#7a6a60;--line:#eadfd5;min-height:100vh;background:transparent;color:var(--ink)}
.bg-layer{position:fixed;inset:0;z-index:-2;background:var(--scene-img,none) center/cover no-repeat #3a2a22;transition:background-image .3s}
body[data-scene=study]{--scene-img:url(img/bg-study.webp)}body[data-scene=rain]{--scene-img:url(img/bg-rain.webp)}body[data-scene=forest]{--scene-img:url(img/bg-forest.webp)}body[data-scene=beach]{--scene-img:url(img/bg-beach.webp)}body[data-scene=night]{--scene-img:url(img/bg-night.webp)}body[data-scene=zen]{--scene-img:url(img/bg-zen.webp)}body[data-scene=snow]{--scene-img:url(img/bg-snow.webp)}body[data-scene=sakura]{--scene-img:url(img/bg-sakura.webp)}
.bg-layer::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#1b100a14,#1b100a52)}
body[data-scene=plain] .bg-layer{background:linear-gradient(180deg,#fff2e8,#eef1f8)}body[data-scene=plain] .bg-layer::after{display:none}
body[data-tool=pomodoro] header{background:transparent;border:0}
body[data-tool=pomodoro] .header{max-width:1280px;padding:12px 22px}
body[data-tool=pomodoro] .brand,body[data-tool=pomodoro] .header a{background:var(--glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:999px;padding:6px 16px 6px 8px;min-height:44px;color:var(--ink)}
body[data-tool=pomodoro] .header a{padding:0 16px;display:inline-flex;align-items:center;color:#b24a35}
body[data-tool=pomodoro] .brand span{padding:5px 8px;font-size:20px}
body[data-tool=pomodoro] main{max-width:1280px;padding:6px 22px 40px}
.board{display:grid;grid-template-columns:300px minmax(0,1fr) 340px;gap:18px;align-items:start}
body[data-tool=pomodoro] .panel{background:var(--glass);backdrop-filter:blur(14px) saturate(1.15);-webkit-backdrop-filter:blur(14px) saturate(1.15);border:1px solid #ffffff99;border-radius:22px;padding:20px;box-shadow:0 14px 38px #25120a38;margin:0}
@supports not (backdrop-filter:blur(1px)){body[data-tool=pomodoro] .panel{background:#fffcf8f5}}
body[data-tool=pomodoro] h2{font-size:18px;margin:0 0 12px}body[data-tool=pomodoro] h3{font-size:14px;margin:16px 0 8px;color:var(--muted)}
.btn.ghost{background:#ffffffb3}.btn[aria-pressed=true]:not(.preset){background:#ffe9e1;border-color:var(--accent)}

/* today */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}.stats div{background:#fff7f1;border:1px solid var(--line);border-radius:14px;padding:10px 4px}.stats b{display:block;font-size:26px;line-height:1.2;font-variant-numeric:tabular-nums;color:#b24a35}.stats span{font-size:12px;color:var(--muted)}
.week{display:flex;gap:6px;align-items:flex-end;height:96px;padding:4px 0}.week .d{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:3px;font-size:11px;color:var(--muted)}.week i{display:block;width:100%;max-width:26px;border-radius:6px 6px 3px 3px;background:#ecd9cc;min-height:4px}.week .d.on i{background:linear-gradient(180deg,#f08a5d,#d65b43)}.week .d.today{font-weight:800;color:#b24a35}
.stickers{display:flex;flex-wrap:wrap;gap:6px;min-height:44px}.stickers:empty::before{content:attr(data-empty);font-size:13px;color:var(--muted);line-height:1.6}
.stk{display:inline-block;width:var(--s,44px);height:var(--s,44px);flex:none;background:url(img/stickers.webp) no-repeat;background-size:600% 600%;background-position:calc(var(--c)*20%) calc(var(--r)*20%)}
.stk-icon{display:inline-block;width:64px;height:64px;flex:none;background:url(img/stickers.webp) no-repeat;background-size:600% 600%;background-position:calc(var(--c,0)*20%) calc(var(--r,0)*20%)}
.wall-box{margin-top:14px}.wall-box summary{font-weight:700}.wall{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}.wall .s{aspect-ratio:1;border-radius:10px;background:#fff7f1;border:1px solid var(--line);display:grid;place-items:center}.wall .s.lock .stk{filter:grayscale(1) opacity(.22)}.wall .s.new{outline:3px solid #f0c36b}.wall .stk{--s:100%}

/* stage */
.stage{text-align:center;padding:22px 22px 18px}
.stage-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:4px}.stage .timer-label{font-size:clamp(16px,3.6vw,21px);color:#462b1a;font-weight:800;text-align:left}
.art-wrap{width:100%;max-width:440px;margin:0 auto}
.stage .timer-face{position:relative;background:transparent;padding:0!important;width:100%;margin:0 auto;isolation:isolate;border-radius:0;display:flex;flex-direction:column;align-items:center}
.stage[data-shape=tomato][data-phase=focus] .timer-face{aspect-ratio:400/370}
.tomato-art{display:none;position:absolute;inset:0;width:100%;height:100%;z-index:-1;filter:drop-shadow(0 8px 7px #92402220)}
.stage[data-shape=tomato][data-phase=focus] .tomato-art{display:block}
.sprite-art{display:none;width:min(62%,250px);aspect-ratio:1;background:url(img/stages.webp) no-repeat;background-size:600% 600%;background-position:calc(var(--c)*20%) calc(var(--r)*20%);filter:drop-shadow(0 10px 10px #2a140a30);transition:background-position .6s}
.stage[data-phase=focus]:not([data-shape=tomato]) .sprite-art{display:block}
.rest-art{display:none;width:100%;justify-content:center;padding:6px 0}.stage:not([data-phase=focus]) .rest-art{display:flex}
.breath{width:clamp(150px,44vw,210px);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 35% 30%,#e3f8dc,#8dd29a 62%,#58a672);box-shadow:0 12px 30px #2b6b4040,inset 0 -10px 24px #2b6b4033;display:grid;place-items:center;color:#fff;font-weight:800;font-size:17px;text-shadow:0 1px 6px #1d4a2f88;animation:breathe 8s ease-in-out infinite}
@keyframes breathe{0%,100%{transform:scale(.82)}50%{transform:scale(1)}}
.tomato-content{width:100%;display:flex;flex-direction:column;align-items:center;min-width:0;margin-top:6px}
.stage[data-shape=tomato][data-phase=focus] .tomato-content{position:absolute;inset:34% 16% 13%;width:auto;justify-content:center;margin:0}
.tomato-content #taskDisplay{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;color:#462b1a;margin:6px 0}
.tomato-content .clock{font-size:clamp(46px,12vw,84px);letter-spacing:-2px;line-height:1.15;color:#402b24;background:#ffffffed;border-radius:18px;padding:4px 14px;margin:4px 0;min-width:60%;box-shadow:0 3px 9px #62341918;font-variant-numeric:tabular-nums}
.stage[data-shape=tomato][data-phase=focus] .tomato-content .clock{width:100%;font-size:clamp(40px,12vw,82px);padding:5px 9px}
.tomato-content .timer-track{width:min(88%,330px);flex-shrink:0;height:10px;margin:10px 0 0;background:#ffffffa8;border:1px solid #0000000d}.tomato-content .timer-progress{background:#643827}
.stage:not([data-phase=focus]) #taskDisplay{display:none}
.color-guide{text-align:center;font-size:14px;line-height:1.6;color:var(--muted);margin:12px 0 6px}
.rest-tips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0}.rest-tips div{background:#eef8ee;border:1px solid #cfe5d0;border-radius:14px;padding:8px 4px;font-size:13px;line-height:1.4;color:#2e5a3a;display:flex;flex-direction:column;align-items:center;gap:4px}
.stage .timer-actions{margin:12px 0 6px}.stage .btn.big{min-height:62px;font-size:21px;border-radius:16px;box-shadow:0 8px 18px #d65b4340}
.reward{display:flex;gap:12px;align-items:center;justify-content:center;text-align:left;background:linear-gradient(135deg,#fff7dc,#ffe8c0);border:2px solid #f0c36b;border-radius:16px;padding:10px 16px;margin:10px 0;animation:pop .5s}.reward b{display:block;font-size:16px}.reward span:not(.stk-icon){font-size:13px;color:#7a5a1e}
@keyframes pop{0%{transform:scale(.8);opacity:0}70%{transform:scale(1.04)}100%{transform:scale(1);opacity:1}}
.stage .hint{margin:8px 0 0}

/* settings */
.settings{padding:10px 18px}.sec{border-top:1px solid var(--line);padding:0;margin:0}.sec:first-child{border-top:0}.sec>summary{font-weight:800;min-height:52px;display:flex;align-items:center;font-size:15px}.sec>summary::marker{color:#b24a35}.sec[open]>summary{margin-bottom:2px}.sec>*:last-child{margin-bottom:14px}
.presets{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn.preset{justify-content:flex-start;padding:8px 10px}.btn.preset[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:#fff}
.settings .field{margin:12px 0 6px}.settings .check{display:flex;align-items:center;gap:10px;min-height:44px;margin-top:6px;font-size:14px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.chip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:4px 14px 4px 6px;border:1px solid #d9cfc4;border-radius:999px;background:#fff;font-weight:700;font-size:14px;color:#4b382d}.chip:hover{background:#fff0e9}.chip[aria-pressed=true]{background:#ffe9e1;border-color:var(--accent)}.chips.recent .chip{padding:4px 14px;font-weight:600;color:var(--muted)}.chips.recent:empty{display:none}
.ic{display:inline-block;width:32px;height:32px;flex:none;background:url(img/icons.webp) no-repeat;background-size:600% 600%;background-position:calc(var(--c)*20%) calc(var(--r)*20%)}
.thumbs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.th{position:relative;aspect-ratio:3/2;min-height:60px;border-radius:12px;border:3px solid transparent;padding:0;overflow:hidden;background:#d8c7b8 center/cover no-repeat;box-shadow:0 2px 6px #25120a30}.th span{position:absolute;inset:auto 0 0 0;background:#000000a6;color:#fff;font-size:11.5px;line-height:1.3;padding:3px 3px 4px}.th[aria-pressed=true]{border-color:var(--accent);box-shadow:0 0 0 2px #fff,0 3px 10px #d65b4360}.th.plain{background-image:linear-gradient(160deg,#fff2e8,#e6ecf8)}.th.plain span{background:#0000008c}
.shapes,.amb{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.shp,.ab{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:44px;padding:8px 2px 6px;border:1.5px solid #d9cfc4;border-radius:14px;background:#fff;font-size:12px;font-weight:700;color:#4b382d}.shp:hover,.ab:hover{background:#fff0e9}.shp[aria-pressed=true],.ab[aria-pressed=true]{border-color:var(--accent);background:#ffe9e1}.shp .stg{display:block;width:42px;height:42px;background:url(img/stages.webp) no-repeat;background-size:600% 600%;background-position:calc(var(--c)*20%) calc(var(--r)*20%)}.shp .stk{--s:42px}.ab .ic{width:36px;height:36px}.ab .off{width:36px;height:36px;display:grid;place-items:center;font-size:22px}
.inline{display:flex;gap:8px;align-items:center}.inline select{flex:1}.settings input[type=range]{width:100%;min-height:32px}
.settings ol{padding-left:20px}.settings p{margin:8px 0}
body[data-tool=pomodoro] .notice{background:var(--glass);border:1px solid #ffffff99;color:#3b4b66;border-radius:14px;margin:18px 0 0;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}body[data-tool=pomodoro] .notice.error{background:#fff0ed;color:#9a3e36;border-color:#efc9c2}
.backup-panel{margin-top:18px!important}
body[data-tool=pomodoro] footer{background:var(--glass);border-radius:16px;padding:14px 12px;margin-top:20px;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#5b4d44}

body[data-tool=pomodoro] footer a{display:inline-flex;align-items:center;min-height:44px;padding:0 10px}
/* focus mode */
body.focus header,body.focus .today,body.focus .settings,body.focus .backup-panel,body.focus footer,body.focus #notice:not(.error),body.focus .hint,body.focus .color-guide{display:none!important}
body.focus .board{grid-template-columns:minmax(0,620px);justify-content:center;margin-top:3vh}body.focus .art-wrap{max-width:520px}

@media(max-width:1100px){.board{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"stage stage" "today settings"}.stage{grid-area:stage}.today{grid-area:today}.settings{grid-area:settings}}
@media(max-width:760px){body[data-tool=pomodoro] main{padding:4px 12px 32px}body[data-tool=pomodoro] .header{padding:8px 12px}.board{grid-template-columns:minmax(0,1fr);grid-template-areas:"stage" "today" "settings"}body[data-tool=pomodoro] .panel{padding:16px;border-radius:18px}.stage{padding:16px 14px 14px}.presets{grid-template-columns:1fr 1fr}.thumbs{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:380px){.shapes,.amb{grid-template-columns:repeat(3,minmax(0,1fr))}.rest-tips{gap:5px}.tomato-content .clock{font-size:44px}.stage[data-shape=tomato][data-phase=focus] .tomato-content{inset:34% 14% 12%}.stage[data-shape=tomato][data-phase=focus] .tomato-content .clock{font-size:40px}.stage[data-shape=tomato][data-phase=focus] #taskDisplay{margin:5px 0;font-size:12px}}
@media(prefers-reduced-motion:reduce){.breath{animation:none;transform:scale(.92)}.reward{animation:none}*{transition:none!important}}
