/* Tharvik - "Hoy" / "Today" (js/hoy.js, 2026-10-27): the header rings button and the Today panel. Theme tokens + the colour zones from premium.css. */

/* ---- header button: three live rings ---- */
/* It also carries the day streak, so the old flame badge hides while this one is there (same number, one control instead of two) */
#hoyBtn{
  flex:0 0 auto; min-width:38px; height:38px; margin-left:2px; padding:0 7px; gap:6px; border-radius:19px; border:1px solid var(--line); background:transparent; color:var(--text);
  display:none; align-items:center; justify-content:center; cursor:pointer; -webkit-tap-highlight-color:transparent;
}
#menuBtn.show ~ #hoyBtn{ display:inline-flex; }
#menuBtn.show ~ #streakBadge{ display:none !important; }
.hy-n{ display:none; font:700 14px/1 var(--font-ui); font-variant-numeric:tabular-nums; color:var(--gold); padding-right:2px; }
.hy-n::before{ content:''; display:inline-block; width:13px; height:16px; margin-right:3px; vertical-align:-2px; background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.4 2.2c.5 3.2-1.7 4.9-3.2 6.9C7.7 11.1 6.7 12.8 6.7 14.8a5.3 5.3 0 0 0 10.6 0c0-2-.9-3.6-1.9-4.8-.2 1.6-1 2.5-2.1 2.8.7-3-.3-5.9-1.7-8-.5-.7-.7-1.5-.5-2.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.4 2.2c.5 3.2-1.7 4.9-3.2 6.9C7.7 11.1 6.7 12.8 6.7 14.8a5.3 5.3 0 0 0 10.6 0c0-2-.9-3.6-1.9-4.8-.2 1.6-1 2.5-2.1 2.8.7-3-.3-5.9-1.7-8-.5-.7-.7-1.5-.5-2.6Z'/%3E%3C/svg%3E") center / contain no-repeat; }
#hoyBtn.has-streak .hy-n{ display:inline-block; }
@media (max-width:420px){ header{ gap:8px; padding-left:16px; padding-right:16px; } }
@media (max-width:370px){ header .emblem{ display:none; } }
@media (max-width:330px){ #themeBtn{ display:none; } }
#hoyBtn:active{ transform:scale(.94); }
#hoyBtn:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
#hoyBtn svg{ width:26px; height:26px; display:block; overflow:visible; }
.hy-g-track{ stroke:var(--line-strong, var(--line)); opacity:.9; }
.hy-g-arc{ transition:stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.hy-g-train{ stroke:var(--z-train, var(--gold)); } .hy-g-food{ stroke:var(--z-food, #4FD29A); } .hy-g-prot{ stroke:var(--z-body, #5AA8FF); }
#hoyBtn.over .hy-g-food{ stroke:var(--ember, #FF4B26); }

/* ---- panel (same slide-in as the other full-screen panels; sits just under them so anything opened from it lands on top) ---- */
#hoyPanel{
  position:absolute; inset:0; z-index:14; display:flex; flex-direction:column; background:var(--bg);
  visibility:hidden; opacity:0; pointer-events:none; transform:translate3d(0,18px,0);
  transition:opacity .18s ease, transform .2s ease, visibility 0s linear .2s;
}
#hoyPanel.show{ visibility:visible; opacity:1; pointer-events:auto; transform:none; transition:opacity .24s ease, transform .3s ease, visibility 0s; }
#hoyBody{ display:flex; flex-direction:column; gap:14px; padding-bottom:calc(28px + env(safe-area-inset-bottom)); }
.hy-date{ font:600 13px var(--font-ui); letter-spacing:.04em; color:var(--text-dim); margin-top:-2px; }
.hy-eyebrow{ font:700 10.5px var(--font-ui); letter-spacing:.15em; text-transform:uppercase; color:var(--z-train, var(--gold)); }

.hy-hero{ display:flex; align-items:center; gap:16px; padding:18px 16px; border-radius:24px; border:1px solid var(--zl-train, var(--line));
  background:linear-gradient(155deg, var(--zt-train, rgba(255,178,56,.14)) 0%, var(--zt-food, rgba(79,210,154,.1)) 50%, transparent 88%), var(--panel);
  box-shadow:inset 0 1px 0 var(--hi, rgba(255,255,255,.06)), 0 20px 36px -26px var(--zg-train, transparent); }
.hy-ringbox{ position:relative; flex:0 0 150px; width:150px; height:150px; }
.hy-rings{ width:100%; height:100%; display:block; }
.hy-track{ stroke:var(--line-strong, var(--line)); opacity:.85; }
.hy-arc{ transition:stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.hy-streak{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; pointer-events:none; }
.hy-streak b{ font:700 26px/1 var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text); }
.hy-streak small{ margin-top:2px; font:600 9px/1.1 var(--font-ui); letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); max-width:58px; }
.hy-legend{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:12px; }
.hy-leg{ display:flex; align-items:flex-start; gap:10px; min-width:0; }
.hy-leg i{ flex:0 0 auto; width:10px; height:10px; margin-top:5px; border-radius:50%; }
.hy-leg-t{ display:flex; flex-direction:column; min-width:0; }
.hy-leg-t small{ font:600 10.5px var(--font-ui); letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); }
.hy-leg-t b{ font:700 16px/1.25 var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text); overflow-wrap:anywhere; }
.hy-leg-t em{ font:500 11.5px var(--font-ui); font-style:normal; color:var(--text-dim); }
.hy-insight{ margin:0; padding:0 4px; font:600 15px/1.4 var(--font-ui); color:var(--text); text-wrap:balance; }

.hy-card{ padding:16px; border-radius:20px; border:1px solid var(--line); background:var(--panel); box-shadow:inset 0 1px 0 var(--hi, rgba(255,255,255,.05)); display:flex; flex-direction:column; gap:8px; }
.hy-session{ border-color:var(--zl-train, var(--line)); background-image:linear-gradient(155deg, var(--zt-train, transparent) 0%, transparent 70%); }
/* the streak card: flame, the number, what it needs today, the best one, and Share */
.hy-strk{ flex-direction:row; flex-wrap:wrap; align-items:center; gap:12px 14px; }
.hy-strk-ico{ flex:0 0 46px; width:46px; height:46px; border-radius:50%; display:grid; place-items:center; color:var(--gold); border:1px solid var(--zl-train, var(--line)); background:var(--zt-train, transparent); }
.hy-strk-ico svg{ width:24px; height:24px; display:block; }
.hy-strk.off .hy-strk-ico{ color:var(--text-dim); border-color:var(--line); background:transparent; }
.hy-strk-txt{ flex:1 1 140px; min-width:0; display:flex; flex-direction:column; gap:3px; }
.hy-strk-n{ font:600 14px/1.2 var(--font-ui); color:var(--text-dim); }
.hy-strk-n b{ font:700 26px/1.1 var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text); }
.hy-strk-best{ font:600 11.5px var(--font-ui); letter-spacing:.04em; color:var(--gold); }
.hy-strk-share{ flex:0 0 auto; margin-left:auto; }
.hy-card-t{ font:700 20px/1.2 var(--font-ui); color:var(--text); }
.hy-card-s{ font:500 13px/1.4 var(--font-ui); color:var(--text-dim); }
.hy-next{ color:var(--text); font-weight:600; margin-top:2px; }
.hy-food-empty{ margin:2px 0 4px; font:500 13.5px/1.4 var(--font-ui); color:var(--text-dim); }
.hy-go{ width:100%; margin-top:8px; }
.hy-ghost{ min-height:44px; padding:0 14px; border-radius:14px; border:1px solid var(--line-strong, var(--line)); background:transparent; color:var(--text); font:700 13.5px var(--font-ui); cursor:pointer; }
.hy-ghost:active{ transform:scale(.98); }
.hy-session .hy-ghost{ margin-top:6px; }
.hy-ghost:focus-visible, .hy-chip:focus-visible, .hy-day:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }

.hy-wk-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.hy-wk-head small{ font:600 12px var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text-dim); }
.hy-week{ border-color:var(--zl-body, var(--line)); background-image:linear-gradient(155deg, var(--zt-body, transparent) 0%, transparent 70%); }
.hy-week .hy-eyebrow{ color:var(--z-body, var(--gold)); }
.hy-days{ display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; margin-top:4px; }
.hy-day{ position:relative; display:flex; flex-direction:column; align-items:center; gap:7px; padding:8px 0 4px; border:0; background:transparent; cursor:pointer; color:var(--text-dim); }
.hy-day i{ font:700 11px var(--font-ui); font-style:normal; letter-spacing:.06em; }
.hy-day s{ width:30px; height:30px; border-radius:50%; border:2px solid var(--line-strong, var(--line)); display:flex; align-items:center; justify-content:center; box-sizing:border-box; text-decoration:none; }
.hy-day.done s{ background-image:var(--btn-grad, linear-gradient(180deg, #FBE3A6, #F4B04A)); border-color:transparent; box-shadow:0 6px 14px -8px var(--zg-train, transparent); }
.hy-day.done s::after{ content:''; width:6px; height:11px; margin-top:-2px; border:solid var(--ink, #170F09); border-width:0 2.5px 2.5px 0; transform:rotate(45deg); }
.hy-day.partial s{ border-color:var(--z-train, var(--gold)); background:conic-gradient(var(--z-train, var(--gold)) 0 50%, transparent 50% 100%); }
.hy-day.missed s{ border-style:dashed; border-color:color-mix(in srgb, var(--ember, #FF4B26) 55%, transparent); }
.hy-day.planned s{ border-color:var(--z-train, var(--gold)); }
.hy-day.rest s{ border-color:var(--line); opacity:.55; }
.hy-day.today i{ color:var(--text); }
.hy-day.today::after{ content:''; position:absolute; bottom:-2px; width:5px; height:5px; border-radius:50%; background:var(--z-train, var(--gold)); }

.hy-food{ border-color:var(--zl-food, var(--line)); background-image:linear-gradient(155deg, var(--zt-food, transparent) 0%, transparent 70%); }
.hy-food .hy-eyebrow{ color:var(--z-food, var(--gold)); }
.hy-ktxt{ display:flex; align-items:baseline; gap:2px; margin-top:2px; }
.hy-ktxt b{ font:700 28px/1 var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text); }
.hy-ktxt span{ font:600 13px var(--font-ui); color:var(--text-dim); }
.hy-kbar, .hy-mb-bar{ height:8px; border-radius:6px; background:var(--panel-2); overflow:hidden; }
.hy-kbar i, .hy-mb-bar i{ display:block; height:100%; border-radius:6px; background:var(--z-food, #4FD29A); transition:width .8s cubic-bezier(.2,.8,.2,1); }
.hy-macros{ display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.hy-mb-top{ display:flex; justify-content:space-between; gap:10px; margin-bottom:5px; font:600 12px var(--font-ui); color:var(--text-dim); }
.hy-mb-top b{ font:700 12px var(--font-ui); font-variant-numeric:tabular-nums; color:var(--text); }
.hy-mb-bar{ height:6px; }
.hy-mb.p i{ background:var(--z-body, #5AA8FF); } .hy-mb.c i{ background:var(--z-train, var(--gold)); } .hy-mb.f i{ background:var(--z-team, #A58BFF); }
.hy-row{ display:flex; gap:8px; margin-top:8px; }
.hy-row .hy-ghost{ flex:1 1 0; min-width:0; }
.hy-short{ display:flex; flex-wrap:wrap; gap:8px; }
.hy-chip{ min-height:42px; padding:0 16px; border-radius:var(--r-pill, 999px); border:1px solid var(--line-strong, var(--line)); background:var(--panel); color:var(--text); font:700 13px var(--font-ui); cursor:pointer; }
.hy-chip:active{ transform:scale(.97); }

@media (max-width:360px){ .hy-ringbox{ flex-basis:124px; width:124px; height:124px; } .hy-hero{ gap:12px; padding:14px 12px; } .hy-streak b{ font-size:21px; } }
@media (prefers-reduced-motion:reduce){ .hy-arc, .hy-g-arc, .hy-kbar i, .hy-mb-bar i, #hoyPanel, #hoyPanel.show{ transition:none; } }
