/* Porterad från affectUI Number Ticker (motion), MIT, Copyright (c) 2026 Florian Höller */
/* Ändrat: räknar in från noll först när man klickar på Spela upp, inte när siffran syns */
.ui-nt {
  --ui-nt-lh: 1.15em;
  --ui-nt-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: inline-flex;
  line-height: var(--ui-nt-lh);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ui-nt__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ui-nt__track { display: inline-flex; align-items: flex-start; height: var(--ui-nt-lh); line-height: var(--ui-nt-lh); }
.ui-nt__col {
  display: inline-block;
  height: var(--ui-nt-lh);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.ui-nt__col[data-enter] { animation: ui-nt-in 450ms var(--ui-nt-ease) both; }
.ui-nt__stack { display: flex; flex-direction: column; will-change: transform; }
.ui-nt__cell, .ui-nt__static { display: block; height: var(--ui-nt-lh); text-align: center; }
.ui-nt__static { white-space: pre; }
@keyframes ui-nt-in { from { opacity: 0; transform: translateY(-35%); } }
@media (prefers-reduced-motion: reduce) {
  .ui-nt__col[data-enter] { animation: none; }
}

/* Kortet runt omkring */
.nnt-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 18px 18px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.88);
}
.nnt-card p { margin: 0; }
.nnt-label { font-size: 12px; line-height: 16px; font-weight: 500; color: rgba(0, 0, 0, 0.58); }
.nnt-big { margin-top: 6px !important; font-size: 38px; font-weight: 500; letter-spacing: -0.02em; color: #000; }
.nnt-sub { margin-top: 6px !important; color: rgba(0, 0, 0, 0.61); }
.nnt-delta { font-weight: 500; color: #1E7A4C; }
.nnt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.nnt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; margin: 0; border: 0; border-radius: 6px;
  background: #fff; color: rgba(0, 0, 0, 0.88);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font: 500 13px/20px var(--sans); cursor: pointer;
  transition: box-shadow 140ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nnt-btn:hover { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 1px 1px -1px rgba(0, 0, 0, 0.12), 0 1px 3px 0 rgba(0, 0, 0, 0.07); }
.nnt-btn:active { transform: scale(0.97); }
.nnt-btn:focus-visible { outline: 2px solid rgba(217, 96, 28, 0.4); outline-offset: 1px; }
.nnt-play { padding-left: 8px; background: rgba(0, 0, 0, 0.88); color: #fcfcfc; box-shadow: none; }
.nnt-play:hover { background: rgba(0, 0, 0, 0.8); box-shadow: none; }
.nnt-play svg { width: 12px; height: 12px; fill: #F0A274; }
.nnt-log { margin-top: 10px !important; font-size: 12px; line-height: 16px; color: rgba(0, 0, 0, 0.58); }
@media (max-width: 360px) { .nnt-big { font-size: 32px; } }

/* Mörkt läge, samma konvention som affectUI */
:where(.dark, [data-theme="dark"]) .nnt-card { background: #1C1B1A; box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.9); }
:where(.dark, [data-theme="dark"]) .nnt-label, :where(.dark, [data-theme="dark"]) .nnt-log { color: rgba(255, 255, 255, 0.58); }
:where(.dark, [data-theme="dark"]) .nnt-big { color: rgba(255, 255, 255, 0.94); }
:where(.dark, [data-theme="dark"]) .nnt-sub { color: rgba(255, 255, 255, 0.64); }
:where(.dark, [data-theme="dark"]) .nnt-delta { color: #3EC27A; }
:where(.dark, [data-theme="dark"]) .nnt-btn { background: #1C1B1A; color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4); }
:where(.dark, [data-theme="dark"]) .nnt-btn:hover { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 1px 3px rgba(0, 0, 0, 0.5); }
:where(.dark, [data-theme="dark"]) .nnt-play { background: rgba(255, 255, 255, 0.9); color: #161615; box-shadow: none; }
:where(.dark, [data-theme="dark"]) .nnt-play:hover { background: rgba(255, 255, 255, 0.8); box-shadow: none; }
:where(.dark, [data-theme="dark"]) .nnt-play svg { fill: #D9601C; }
