:root {
  --bg: #000;
  --fg: #d8d8d8;
  --dim: #7a7a7a;
  --line: #2a2a2a;
  --accent: #e8e8e8;
  color-scheme: dark
}
* {
  box-sizing: border-box
}
[hidden] {
  display: none!important
}
body,
html {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  overflow: hidden
}
canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: 0
}
body.running canvas {
  cursor: none
}
body:not(.running) canvas {
  visibility: hidden
}
body.running #screen {
  display: none
}
#screen {
  position: fixed;
  inset: 0;
  display: flex;
  padding: 16px;
  overflow-y: auto
}
.panel {
  width: min(420px,100%);
  margin: auto
}
h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent)
}
.head {
  position: relative;
  margin-bottom: 28px
}
.sub {
  margin: 2px 0 0;
  color: var(--dim)
}
:root {
  --watched: #3fa3b4;
  --stopped: #5f5f5f;
  --card: #0b0b0b
}
.stats-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  text-align: left;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--dim);
  border: 1px solid var(--line);
  background: 0 0
}
.stats-toggle strong {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums
}
.stats-toggle .sep {
  margin: 0 8px
}
.stats-toggle:focus-visible,
.stats-toggle:hover,
.stats-toggle[aria-expanded=true] {
  border-color: var(--dim);
  color: var(--fg)
}
.spark {
  width: 64px;
  height: 18px;
  overflow: visible
}
.spark polyline {
  fill: none;
  stroke: var(--watched);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round
}
.chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
  margin-left: auto;
  flex: none
}
.stats-toggle[aria-expanded=true] .chevron {
  transform: rotate(45deg) translate(-2px,-2px)
}
.stats {
  position: relative;
  margin-top: 10px;
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim)
}
.stats.opening {
  animation: stats-open 180ms ease-out
}
@keyframes stats-open {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }
  to {
    opacity: 1;
    transform: none
  }
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line)
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0
}
.tile-label {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}
.tile-value {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums
}
.tile-sub {
  font-size: 11px;
  color: var(--dim)
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 12px;
  font-size: 11px
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px
}
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px
}
.key.finished {
  background: var(--watched)
}
.key.stopped {
  background: var(--stopped)
}
.stats-head {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--fg)
}
.stats-head span {
  margin-left: 6px;
  color: var(--dim)
}
.days {
  display: flex;
  align-items: flex-end;
  height: 92px;
  padding-top: 16px;
  border-bottom: 1px solid var(--line)
}
.day {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  outline: 0;
  cursor: default
}
.day .stack {
  width: min(18px,64%);
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  transform-origin: bottom
}
.day .stack > i {
  display: block
}
.day .stack > i:last-child {
  border-radius: 3px 3px 0 0
}
.day .finished {
  background: var(--watched)
}
.day .stopped {
  background: var(--stopped)
}
.day:focus-visible .stack,
.day:hover .stack {
  filter: brightness(1.35)
}
.stats.opening .day .stack {
  animation: grow 360ms cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--i) * 18ms)
}
@keyframes grow {
  from {
    transform: scaleY(0)
  }
  to {
    transform: scaleY(1)
  }
}
.day .value {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--fg);
  white-space: nowrap;
  font-variant-numeric: tabular-nums
}
.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px
}
.countries {
  list-style: none;
  margin: 0;
  padding: 0
}
.countries li {
  display: grid;
  grid-template-columns: 9.5em 1fr 3.5em;
  align-items: center;
  gap: 10px;
  padding: 3px 0
}
.countries .name {
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}
.countries .bar {
  display: flex;
  gap: 2px;
  height: 8px
}
.countries .bar > i {
  display: block;
  height: 100%
}
.countries .bar > i:last-child {
  border-radius: 0 3px 3px 0
}
.countries .finished {
  background: var(--watched)
}
.countries .stopped {
  background: var(--stopped)
}
.countries .count {
  text-align: right;
  font-variant-numeric: tabular-nums
}
.tip {
  position: absolute;
  z-index: 1;
  padding: 6px 9px;
  background: #151515;
  border: 1px solid #333;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none
}
.tip strong {
  display: block;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600
}
.viewer {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 13px
}
@media (prefers-reduced-motion:reduce) {
  .stats.opening,
  .stats.opening .day .stack {
    animation: none
  }
  .chevron {
    transition: none
  }
}
@media (max-width:460px) {
  .tile-value {
    font-size: 18px
  }
  .countries li {
    grid-template-columns: 9em 1fr 2.5em;
    gap: 8px
  }
  .stats-toggle .spark {
    display: none
  }
}
.bar {
  height: 2px;
  background: var(--line);
  overflow: hidden
}
#bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 120ms linear
}
#status {
  margin: 10px 0 0;
  color: var(--dim);
  min-height: 1.5em
}
.buttons {
  display: flex;
  gap: 12px;
  margin: 16px 0
}
#ended,
#question {
  text-align: center
}
#ended .buttons,
#question .buttons {
  justify-content: center
}
button {
  font: inherit;
  color: var(--fg);
  background: 0 0;
  border: 1px solid var(--line);
  padding: 8px 22px;
  cursor: pointer
}
button:focus-visible,
button:hover {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0
}
.keys {
  color: var(--dim);
  font-size: 13px
}
.credit {
  margin: 28px 0 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.8;
  text-align: center
}
.credit .by {
  display: block;
  margin-top: 12px
}
.credit a {
  color: var(--dim);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px
}
.credit a:focus-visible,
.credit a:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
  outline: 0
}
#error {
  color: #ff8a80;
  white-space: pre-wrap
}
