/* Credit wallet page and streak card. Colours follow the operator brand
   (--accent / --on-accent) and the player theme tokens in both themes. */

.credits-page {
  /* Accent text that keeps contrast on the card in light and dark. */
  --sc-gold: color-mix(in srgb, var(--accent) 72%, var(--ink));
  --sc-line2: color-mix(in srgb, var(--line) 78%, var(--ink));
  --sc-accent-light: color-mix(in srgb, var(--accent) 55%, #ffffff);
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.credits-page button,
.credits-page input {
  font-family: inherit;
}

.credits-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.credits-header {
  margin-top: 16px;
}

.credits-kicker {
  margin: 0;
  color: var(--sc-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.credits-header h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.credits-layout {
  margin-top: 24px;
}

.credits-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.credits-skeleton {
  height: 520px;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--soft), var(--line), var(--soft));
  background-size: 200% 100%;
  animation: sc-shimmer 1.3s ease-in-out infinite;
}

@keyframes sc-shimmer {
  to {
    background-position: -200% 0;
  }
}

.credits-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.credits-message p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.credits-message button,
.sc-cta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* Card */
.sc-card {
  box-sizing: border-box;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
}

.sc-card *,
.sc-card *::before,
.sc-card *::after {
  box-sizing: border-box;
}

.sc-card :focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: 2px;
}

.sc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.sc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sc-flame {
  flex: 0 0 auto;
}

.sc-flame path {
  fill: url(#sc-flame-fill);
}

/* The flame keeps the design's warm colours on every brand. */
.sc-flame-low {
  stop-color: #ef6a4c;
}

.sc-flame-high {
  stop-color: var(--sun, #ffcb52);
}

.sc-flame-muted path {
  fill: var(--muted);
}

.sc-kicker {
  margin: 0;
  color: var(--sc-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sc-headline {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sc-chip,
.sc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.sc-chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
}

.sc-status {
  height: 24px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 12px;
}

.sc-status-icon {
  stroke-width: 2.4;
}

[data-tone="neutral"].sc-chip,
[data-tone="neutral"].sc-status,
[data-tone="locked"].sc-status,
[data-tone="neutral"].sc-note,
[data-tone="locked"].sc-note {
  background: var(--soft);
  color: var(--ink);
}

[data-tone="locked"].sc-status {
  color: var(--sc-gold);
}

[data-tone="credited"].sc-chip,
[data-tone="credited"].sc-status,
[data-tone="credited"].sc-note {
  background: var(--yes-soft);
  color: var(--yes);
}

[data-tone="forfeited"].sc-chip,
[data-tone="forfeited"].sc-status,
[data-tone="forfeited"].sc-note {
  background: var(--no-soft);
  color: var(--no);
}

/* Tier switch */
.sc-plan {
  display: inline-flex;
  gap: 2px;
  margin-top: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.sc-plan button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sc-plan button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.sc-intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

/* Day strip */
.sc-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.sc-d30 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px 6px;
}

.sc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sc-day-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.sc-d30 .sc-day-label {
  font-size: 10px;
}

.sc-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--sc-line2);
  border-radius: 50%;
}

.sc-d30 .sc-circle {
  width: 34px;
  height: 34px;
}

.sc-day[data-state="done"] .sc-circle {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--sc-accent-light));
  color: var(--on-accent);
}

.sc-day[data-faded] .sc-circle {
  opacity: 0.5;
}

.sc-day[data-state="today"] .sc-circle {
  border: 2px dashed var(--sc-gold);
  animation: sc-ring 2s ease-in-out infinite;
}

.sc-day[data-state="missed"] .sc-circle {
  border-color: var(--no);
  color: var(--no);
}

@keyframes sc-ring {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }

  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

.sc-check {
  stroke-width: 3;
}

.sc-cross {
  stroke-width: 2.6;
}

.sc-now {
  color: var(--sc-gold);
  font-size: 11px;
  font-weight: 700;
}

.sc-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--sc-line2);
}

.sc-amt {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sc-day[data-state="done"] .sc-amt {
  color: var(--ink);
}

.sc-day[data-state="missed"] .sc-amt {
  color: var(--no);
}

.sc-d30 .sc-amt {
  display: none;
}

/* Progress */
.sc-progress {
  margin-top: 20px;
}

.sc-progress-text {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.sc-progress-count {
  color: var(--ink);
  font-weight: 600;
}

.sc-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.sc-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--sc-accent-light));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc-card[data-phase="forfeited"] .sc-bar {
  background: var(--muted);
}

/* Figures */
.sc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 20px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.sc-stats > div {
  padding: 14px 16px;
  background: var(--card);
}

.sc-stats dt,
.sc-stat-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.sc-stats dd {
  margin: 0;
}

.sc-stats .sc-stat-value {
  margin-top: 4px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.sc-struck {
  text-decoration: line-through;
}

.sc-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
}

.sc-note p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 20px;
}

@media (hover: hover) {
  .sc-cta:hover,
  .credits-message button:hover,
  .sc-plan button:not([aria-pressed="true"]):hover {
    filter: brightness(1.08);
  }
}

@media (max-width: 560px) {
  .credits-page {
    padding: 16px 16px 40px;
  }

  .credits-header h1 {
    font-size: 26px;
    line-height: 32px;
  }

  .sc-card {
    padding: 20px 16px;
  }

  .sc-days {
    gap: 4px;
  }

  .sc-d30 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 4px;
  }

  .sc-circle {
    width: 34px;
    height: 34px;
  }

  .sc-amt {
    display: none;
  }

  .sc-day-label {
    font-size: 11px;
  }

  .sc-now {
    font-size: 10px;
    letter-spacing: -0.02em;
  }

  .sc-plan button {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .credits-skeleton,
  .sc-day[data-state="today"] .sc-circle {
    animation: none;
  }

  .sc-bar {
    transition: none;
  }
}
