:root { color-scheme: light; --cream:#F3E6C6; --paper:#F9F5EC; --ink:#2B1F18; --soft:#6B5546; --teal:#1F6B5F; --line:#E4D9C6; }
* { box-sizing:border-box; }
html { min-height:100%; }
body { margin:0; background:var(--cream) url('/img/bg-screen.png') center top / cover fixed; color:var(--ink); font-family:'Lora',serif; font-size:16px; line-height:25px; }
#app { display:flex; flex-direction:column; width:min(100%, 520px); min-height:100vh; min-height:100dvh; margin:auto; padding:calc(20px + env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)); }
[data-screen] { display:flex; flex-direction:column; flex:1; }
#app > [data-screen] { min-height:calc(100dvh - 44px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.header { padding:10px 14px 12px 18px; margin-bottom:12px; background:var(--paper); border-radius:26px; color:var(--soft); font-size:12px; line-height:18px; }
.header-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.header p { margin:3px 0; }
.header-side { display:flex; align-items:center; gap:4px; }
.crystal { display:flex; align-items:center; color:var(--teal); font-weight:600; font-size:15px; transform-origin:center; }
.iconbtn { position:relative; display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--soft); opacity:.7; }
.iconbtn:hover { opacity:1; background:rgba(43,31,24,.06); }
.iconbtn svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.sr { position:absolute; right:0; top:0; white-space:nowrap; opacity:0; pointer-events:none; font-size:12px; }
.crystal img { width:28px; height:28px; object-fit:contain; }
.track { position:relative; height:8px; border-radius:8px; background:var(--line); margin:8px 0; }
.track span { display:block; height:100%; min-width:8px; background:linear-gradient(90deg,var(--teal),#4F9A8D); border-radius:inherit; transition:width .6s cubic-bezier(.3,.7,.2,1); position:relative; }
.track span::after { content:''; position:absolute; right:-2px; top:50%; width:14px; height:14px; margin-top:-7px; border-radius:50%; background:var(--apricot,#F3C97F); border:2px solid var(--paper); box-shadow:0 1px 4px rgba(43,31,24,.3); }
.spark { position:absolute; top:50%; width:7px; height:7px; border-radius:50%; pointer-events:none; }
.card { display:flex; flex-direction:column; flex:1; background:var(--paper); border-radius:26px; padding:22px 22px 20px; box-shadow:0 14px 30px rgba(43,31,24,.14); }
.card > .actions { margin-top:auto; padding-top:22px; }
.enter .header, .enter .card { animation:rise .45s cubic-bezier(.2,.8,.2,1) both; }
.enter .card { animation-delay:.05s; }
@keyframes rise { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
.hero { position:relative; display:grid; place-items:center; margin:0 0 14px; }
.hero .place { width:min(52vw,210px); height:auto; aspect-ratio:1; object-fit:cover; border-radius:50%; box-shadow:0 10px 24px rgba(43,31,24,.16); }
.hero-think .place, .hero-proc .place, .hero-rec .place, .hero-micerr .place { width:min(34vw,120px); }
.hero .leaf { position:absolute; width:min(26vw,96px); height:auto; border-radius:10px; box-shadow:0 8px 16px rgba(43,31,24,.2); }
.hero .leaf-a { left:2%; bottom:-6px; transform:rotate(-8deg); }
.hero .leaf-b { right:2%; bottom:-6px; transform:rotate(7deg); }
.hero-s01, .hero-s03 { height:150px; }
.hero-s01 .leaf, .hero-s03 .leaf { position:relative; grid-area:1/1; width:min(36vw,130px); }
.hero-s01 .leaf-a, .hero-s03 .leaf-a { justify-self:start; margin-left:14%; bottom:auto; }
.hero-s01 .leaf-b, .hero-s03 .leaf-b { justify-self:end; margin-right:14%; bottom:auto; margin-top:22px; }
@media (max-height:640px) { .hero .place { width:90px; } .hero .leaf { width:60px; } .hero-s01, .hero-s03 { height:84px; margin-bottom:8px; } .hero-s01 .leaf, .hero-s03 .leaf { width:64px; } }
@media (prefers-reduced-motion: no-preference) { .hero .place { animation:float 5s ease-in-out infinite; } }
@keyframes float { 50% { transform:translateY(-5px); } }
h1 { font-family:'Playfair Display',serif; font-size:28px; line-height:34px; font-weight:600; margin:0 0 20px; text-wrap:balance; }
h2 { font-family:'Playfair Display',serif; font-size:19px; line-height:25px; margin:24px 0 8px; }
p { margin:0 0 14px; }
.ring { position:relative; display:grid; place-items:center; width:150px; height:150px; margin:14px auto; }
.ring svg { position:absolute; inset:0; width:100%; height:100%; transform:rotate(-90deg); }
.ring circle { fill:none; stroke-width:7; }
.ring-back { stroke:var(--line); }
.ring-arc { stroke:var(--teal); stroke-linecap:round; transition:stroke-dashoffset .25s linear; }
.clock { position:relative; font:600 31px 'Playfair Display',serif; color:var(--teal); font-variant-numeric:tabular-nums; }
.reward { display:flex; align-items:center; justify-content:center; gap:8px; margin:6px auto 0; padding:10px 20px; border-radius:999px; background:#E9F3EE; color:var(--teal); font:600 18px 'Lora',serif; }
.reward img { width:34px; height:34px; object-fit:contain; }
.actions { display:grid; gap:10px; margin-top:24px; }
button { font:600 15px 'Lora',serif; min-width:44px; min-height:48px; padding:12px 18px; border:1px solid var(--teal); border-radius:12px; background:var(--teal); color:#F4EFE4; cursor:pointer; line-height:20px; }
button.secondary { background:transparent; color:var(--teal); }
button { transition:transform .12s ease, filter .12s ease; }
button:active { transform:scale(.97); }
button[data-btn="delete"].secondary { border-color:transparent; color:var(--soft); font-weight:400; text-decoration:underline; text-underline-offset:3px; }
button:focus-visible, textarea:focus-visible { outline:3px solid #94442A; outline-offset:3px; }
textarea { display:block; width:100%; min-height:110px; resize:vertical; border:1px solid #a9957e; border-radius:12px; background:#fffdf8; color:var(--ink); font:inherit; padding:12px; margin-top:8px; }
label { display:block; margin-top:20px; font-weight:600; }
audio { width:100%; margin:16px 0 0; }
.hint { color:#94442A; margin:12px 0 0; }
.overlay { position:fixed; inset:0; display:grid; place-items:center; padding:24px; background:rgba(43,31,24,.56); z-index:5; }
.overlay .card { max-width:390px; }
.overlay button { width:100%; }
::selection { background:#B8E0D5; color:var(--ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation:none !important; transition:none !important; } }
