/* Due Maglie — daily streak panel, header counter, next-grid box, result image dialog, milestone celebration (streak.js) */

/* ---------- header counter ---------- */
.streak-pill {
  display: inline-flex; align-items: center; gap: 3px; height: 34px; padding: 0 9px 0 6px; margin-right: 2px;
  border: 1px solid rgba(240, 138, 36, .45); border-radius: 99px; background: rgba(240, 138, 36, .1);
  color: #ffd34a; font: 800 17px/1 var(--display); letter-spacing: .02em;
}
.streak-pill:hover { background: rgba(240, 138, 36, .18); }
.sk-pill-flame { width: 15px; height: 18px; display: block; }
.streak-pill.is-risk { border-color: #f08a24; animation: sk-pulse 1.6s ease-in-out infinite; }
@keyframes sk-pulse { 50% { box-shadow: 0 0 0 4px rgba(240, 138, 36, .25); } }

/* ---------- "at risk" line under today's date ---------- */
.sk-risk-line {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 0; padding: 6px 10px; border-radius: 10px;
  background: rgba(240, 138, 36, .12); border: 1px solid rgba(240, 138, 36, .5); color: #ffe2b8; font-size: 14px; font-weight: 600;
}
.sk-risk-line b { color: #ffd34a; font-variant-numeric: tabular-nums; }
.sk-risk-flame { width: 14px; height: 17px; flex: none; }

/* ---------- streak panel ---------- */
.sk { margin-bottom: 16px; }
.sk.is-risk { border-color: rgba(240, 138, 36, .7); box-shadow: 0 0 0 1px rgba(240, 138, 36, .25), 0 10px 30px rgba(240, 138, 36, .08); }
.sk-top { display: flex; align-items: center; gap: 12px; }
.sk-flame { width: 45px; height: 55px; flex: none; image-rendering: pixelated; }
.sk:not(.is-zero) .sk-flame { filter: drop-shadow(0 0 10px rgba(240, 138, 36, .35)); }
.sk-count { display: flex; align-items: center; gap: 8px; margin: 0; }
.sk-n { font: 800 58px/.9 var(--display); color: #ffd34a; text-shadow: 3px 3px 0 #5a2a0a; font-variant-numeric: tabular-nums; }
.is-zero .sk-n { color: var(--muted); text-shadow: 3px 3px 0 #06100b; }
.sk-unit { font: 800 15px/1.05 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--chalk-2); }
.sk-meta { margin-left: auto; display: grid; justify-items: end; gap: 2px; text-align: right; min-width: 0; }
.sk-title { margin: 0; font: 800 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--oro-1); }
.sk-best { font-size: 14px; font-weight: 700; color: var(--chalk); }
.sk-total { font-size: 12.5px; color: var(--muted); }
.sk-status { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(241, 245, 239, .05); font-size: 14.5px; color: var(--chalk-2); }
.sk-status.is-done { background: rgba(143, 224, 168, .1); color: var(--prim); font-weight: 600; }
.sk-status.is-risk { background: rgba(240, 138, 36, .14); color: #ffe2b8; }
.sk-status.is-risk b { display: block; color: #fff; }
.sk-clock { color: #ffd34a; font-variant-numeric: tabular-nums; }
.sk-h3 { margin: 14px 0 6px; font: 800 13px/1.1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* 30-day strip: 15 x 2 pixel squares, oldest first */
.sk-cal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.sk-d { aspect-ratio: 1; background: #06100b; box-shadow: inset 0 0 0 1px #173225; position: relative; }
.sk-d.is-p { box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .25), inset -2px -2px 0 rgba(0, 0, 0, .3); }
.sk-d.lv-1 { background: #1d5a34; }
.sk-d.lv-2 { background: #26804a; }
.sk-d.lv-3 { background: #34a95f; }
.sk-d.lv-4 { background: #e0b43a; }
.sk-d.is-today { outline: 2px dashed var(--oro-2); outline-offset: 1px; }
.sk-d.is-today.is-p { outline-style: solid; }
.sk-d.is-m1::before { content: ""; position: absolute; left: -3px; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.sk-cal-lbl { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px; color: var(--muted); }

/* milestone badges */
.sk-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sk-b { display: grid; place-items: center; }
.sk-b-svg { width: 100%; max-width: 46px; height: auto; display: block; }
.sk-b.is-on .sk-b-svg { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .45)); }
.sk-next { margin: 10px 0 0; font-size: 14px; color: var(--chalk-2); }

/* ---------- next grid box (end panel) ---------- */
.sk-next-box {
  display: grid; justify-items: center; gap: 4px; margin: 14px 0 0; padding: 14px 12px 12px; text-align: center;
  border-radius: 12px; border: 1px solid rgba(224, 180, 58, .45);
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .25)), repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 4px);
}
.sk-next-lbl { font: 800 14px/1 var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--chalk-2); }
.sk-next-clock {
  font: 800 46px/1 var(--display); color: #ffd34a; letter-spacing: .06em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 211, 74, .35), 3px 3px 0 #3a2a05;
}
.sk-next-teaser { font-size: 14px; color: var(--chalk); }
.sk-next-keep { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: #ffd34a; }
.sk-keep-flame { display: inline-block; width: 13px; height: 16px; margin-right: 6px; vertical-align: -2px; }

/* ---------- result image dialog ---------- */
.sk-img-dlg { width: min(440px, calc(100vw - 24px)); }
.sk-img { display: block; width: 100%; height: auto; border-radius: 6px; image-rendering: pixelated; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.sk-img-note { margin: 10px 0 12px; font-size: 13.5px; color: var(--muted); }
.sk-img-btns { justify-content: center; }

/* ---------- milestone celebration ---------- */
.sk-cel { width: min(360px, calc(100vw - 32px)); text-align: center; overflow: hidden; position: relative; }
.sk-cel .btn { position: relative; }
.sk-cel-badge { position: relative; display: grid; place-items: center; margin: 6px 0 10px; }
.sk-cel-svg { width: 112px; height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .5)); animation: sk-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.sk-cel-h { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--oro-1); }
.sk-cel-flame { width: 22px; height: 27px; }
.sk-cel-sub { position: relative; margin: 8px 0 16px; color: var(--chalk-2); }
@keyframes sk-pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
.sk-confetti { position: absolute; inset: 0; pointer-events: none; opacity: .8; }
.sk-confetti i { position: absolute; top: -12px; width: 6px; height: 6px; animation: sk-fall 2.4s linear infinite; }
@keyframes sk-fall { to { transform: translate(var(--dx, 0), 460px); } }
@media (prefers-reduced-motion: reduce) {
  .streak-pill.is-risk, .sk-cel-svg { animation: none; }
}
