.streak-calendar {
  --streak-ink: #eefbf5;
  --streak-muted: #b7d1ca;
  --streak-gold: #ffe19a;
  --streak-green: #9cf2ca;
  --streak-line: #315453;
  position: relative;
  min-width: 0;
  color: var(--streak-ink);
  background: #0b242d;
  border: 1px solid var(--streak-line);
  border-radius: 1.3rem;
  overflow: hidden;
  box-shadow: 0 20px 55px rgb(3 25 30 / 18%);
}

.streak-calendar[hidden] { display: none !important; }
.streak-calendar * { box-sizing: border-box; }
.streak-calendar h2,
.streak-calendar h3,
.streak-calendar p { margin: 0; }

.streak-hero {
  background: #081b2a;
  border-bottom: 1px solid var(--streak-line);
  overflow: hidden;
}

.streak-art {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  max-height: 320px;
  object-fit: cover;
  object-position: center 58%;
  display: block;
}

.streak-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 3.6vw, 2rem);
  background: linear-gradient(120deg, #102935, #153e3b);
}

.streak-calendar .streak-eyebrow {
  margin-bottom: .45rem;
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--streak-gold);
}

.streak-intro h2 {
  color: var(--streak-ink);
  font-size: clamp(1.65rem, 4.2vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.streak-intro p:not(.streak-eyebrow) {
  margin-top: .64rem;
  color: var(--streak-muted);
  line-height: 1.5;
}

.streak-content { padding: clamp(.85rem, 3.6vw, 2rem); }

.streak-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
  margin: 0 0 1.15rem;
}

.streak-stats div {
  min-width: 0;
  padding: .8rem .75rem;
  background: #133039;
  border: 1px solid var(--streak-line);
  border-radius: .85rem;
}

.streak-stats dt {
  color: var(--streak-muted);
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.3;
}

.streak-stats dd {
  margin: .25rem 0 0;
  color: var(--streak-gold);
  font-size: clamp(.96rem, 2vw, 1.22rem);
  font-weight: 780;
}

.streak-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .52rem;
  padding: 0;
  margin: 1.15rem 0 0;
  list-style: none;
}

.streak-days li {
  min-width: 0;
  display: grid;
  gap: .2rem;
  padding: .68rem .62rem;
  background: linear-gradient(150deg, #15303d, #122a31);
  border: 1px solid var(--streak-line);
  border-radius: .78rem;
}

.streak-days li:nth-child(5n) {
  background: linear-gradient(150deg, #293e37, #243333);
  border-color: #746340;
}

.streak-days li.streak-day-paid { border-color: #40977c; }
.streak-days li.streak-day-next {
  background: linear-gradient(150deg, #224e43, #143b36);
  border-color: #e8c56a;
  box-shadow: inset 0 0 0 1px #e8c56a;
}

.streak-days li > span,
.streak-days li > small { color: var(--streak-muted); font-size: .73rem; }
.streak-days li > strong { color: var(--streak-ink); font-size: clamp(1.02rem, 2.3vw, 1.34rem); }
.streak-days li.streak-day-next > small,
.streak-days li.streak-day-next > strong { color: var(--streak-gold); }
.streak-days li.streak-day-paid > small { color: var(--streak-green); }

.streak-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--streak-line);
  border-radius: 1rem;
  background: #102f35;
}

.streak-action h3 { font-size: 1.06rem; color: var(--streak-ink); }
.streak-action p { margin-top: .25rem; color: var(--streak-muted); line-height: 1.4; }
.streak-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }

.streak-calendar button {
  min-height: 44px;
  padding: .58rem .9rem;
  border-radius: .65rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 780;
  line-height: 1.3;
  cursor: pointer;
}

.streak-calendar button:disabled { opacity: .63; cursor: default; }
.streak-calendar button:focus-visible,
.streak-rules summary:focus-visible { outline: 3px solid #ffdc80; outline-offset: 3px; }
.streak-calendar .streak-claim { color: #14231d; background: #ffdd85; border: 1px solid #ffdd85; }
.streak-calendar .streak-claim:not(:disabled):hover { background: #ffebb6; }
.streak-calendar .streak-sound,
.streak-calendar .streak-refresh { color: var(--streak-ink); background: #163a3e; border: 1px solid #5a827e; }
.streak-calendar .streak-sound:hover,
.streak-calendar .streak-refresh:not(:disabled):hover { background: #224c4e; }

.streak-action .streak-feedback {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--streak-green);
  font-weight: 720;
  min-height: 1.25em;
}

.streak-rules { color: var(--streak-muted); margin-top: .85rem; }
.streak-rules summary { color: var(--streak-ink); cursor: pointer; width: fit-content; }
.streak-rules p { margin-top: .55rem; line-height: 1.45; }

.streak-confetti {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: min(460px, 100%);
  pointer-events: none;
  z-index: 2;
}

.streak-shake .streak-art { animation: streak-celebrate .62s ease both; }

@keyframes streak-celebrate {
  0%, 100% { transform: translateX(0) scale(1); }
  22% { transform: translateX(-3px) scale(1.016); }
  46% { transform: translateX(3px) scale(1.011); }
  68% { transform: translateX(-2px) scale(1.006); }
}

@media (max-width: 660px) {
  .streak-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .streak-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .streak-action { grid-template-columns: minmax(0, 1fr); }
  .streak-art { aspect-ratio: 2.4 / 1; }
}

@media (max-width: 350px) {
  .streak-days { gap: .36rem; }
  .streak-days li { padding: .53rem .44rem; }
}

@media (prefers-reduced-motion: reduce) {
  .streak-shake .streak-art { animation: none; }
  .streak-confetti { display: none; }
}

html[data-reduced-motion="true"] .streak-shake .streak-art { animation: none; }
html[data-reduced-motion="true"] .streak-confetti { display: none; }

.streak-calendar {
  --streak-ink: #fff8e8;
  --streak-muted: #e0cdb7;
  --streak-gold: #ffdc91;
  --streak-green: #b5ead1;
  --streak-line: #6b5137;
  --streak-surface: #282018;
  --streak-tile: #321f16;
  --streak-tile-edge: #1f1813;
  --streak-button: #39271b;
  --streak-accent: #fff4c5;
  background: radial-gradient(ellipse at 82% 0%, #3b291e, #181310 70%);
  box-shadow: 0 20px 55px rgb(33 19 10 / 24%);
}

.streak-calendar[data-streak-palette="platinum"] {
  --streak-ink: #f6f7ff;
  --streak-muted: #c9d4e9;
  --streak-gold: #e1ebff;
  --streak-line: #566784;
  --streak-surface: #222c3e;
  --streak-tile: #2b3a52;
  --streak-tile-edge: #1b2433;
  --streak-button: #303e56;
  --streak-accent: #fff3cb;
  background: radial-gradient(ellipse at 78% 0%, #344052, #141b28 70%);
}

.streak-calendar [hidden] { display: none !important; }

.streak-hero {
  position: relative;
  display: grid;
  background: #211612;
  isolation: isolate;
}

.streak-hero .streak-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-position: center 52%;
  z-index: -2;
}

.streak-intro {
  min-height: clamp(220px, 28vw, 345px);
  gap: 1.1rem;
  padding: clamp(1.12rem, 4.2vw, 3.6rem);
  background: linear-gradient(90deg, rgb(20 13 10 / 98%) 0%, rgb(20 13 10 / 94%) 37%, rgb(20 13 10 / 68%) 56%, transparent 90%),
    linear-gradient(0deg, rgb(20 13 10 / 90%), transparent 52%);
}

.streak-intro > div { max-width: 32rem; }
.streak-intro h2 { font-size: clamp(2.15rem, 5.4vw, 3.7rem); }
.streak-intro .streak-tier {
  width: fit-content;
  padding: .28rem .59rem;
  border: 1px solid #ad8c5c;
  border-radius: 99px;
  color: #fff1c8;
  font-size: .76rem;
  font-weight: 760;
  background: rgb(27 21 15 / 83%);
}

.streak-calendar[data-streak-palette="platinum"] .streak-tier {
  color: #e6f2ff;
  border-color: #a0b6d8;
  background: rgb(18 24 37 / 88%);
}

.streak-stats div,
.streak-action { background: var(--streak-surface); }
.streak-days li,
.streak-days li:nth-child(5n) {
  background: linear-gradient(140deg, var(--streak-tile), var(--streak-tile-edge));
  border-color: var(--streak-line);
}
.streak-days li.streak-day-milestone {
  background: linear-gradient(148deg, #504326, var(--streak-tile-edge) 79%);
  border-color: #b18b50;
}
.streak-calendar[data-streak-palette="platinum"] .streak-day-milestone {
  background: linear-gradient(148deg, #4a5884, var(--streak-tile-edge) 79%);
  border-color: #9eafd7;
}
.streak-days li.streak-day-paid:not(.streak-day-milestone) { border-color: #50846f; }
.streak-days li.streak-day-next { border-color: #e8c56a; }
.streak-days li .streak-milestone {
  width: fit-content;
  margin-top: .3rem;
  padding: .24rem .4rem;
  border-radius: .35rem;
  color: #231709;
  background: linear-gradient(110deg, #ffd988, #fff0bf);
  font-size: .68rem;
  font-weight: 800;
}
.streak-calendar .streak-claim { color: #24180c; background: linear-gradient(115deg, #ffda84, var(--streak-accent)); border-color: #ffd884; }
.streak-calendar .streak-sound,
.streak-calendar .streak-refresh { background: var(--streak-button); border-color: var(--streak-line); }
.streak-calendar .streak-sound:hover,
.streak-calendar .streak-refresh:not(:disabled):hover { background: var(--streak-tile); }
.streak-rules p { max-width: 75ch; }

@media (max-width: 660px) {
  .streak-hero .streak-art { object-position: 61% 45%; }
  .streak-intro {
    min-height: 247px;
    background: linear-gradient(90deg, rgb(20 13 10 / 92%), rgb(20 13 10 / 62%)),
      linear-gradient(0deg, rgb(20 13 10 / 91%), transparent 85%);
  }
}
