/* ttoppen: 80s print, not 80s neon.
   A chart sheet on newsprint: flat Memphis colour, condensed grotesque type,
   label-tape headings, printout-striped rows and amber LCD readouts.
   Deliberately no gradients, no shadows, no rounded cards, no hover
   effects and no borders: things change when pressed, not when pointed at. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+25B2, U+25BC, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin-ext.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "VT323";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/vt323-latin.woff2) format("woff2");
}

/* Tokens ------------------------------------------------------------------ */

:root {
  color-scheme: light;

  --paper: #f3ecda;
  --paper-band: #e7ddc4;
  --field: #fffaee;
  --ink: #18150f;
  --ink-soft: #5c5446;
  --ink-fixed: #18150f;
  --paper-fixed: #fffaee;

  --red: #cf3a22;
  --blue: #2442b5;
  --yellow: #f3b519;
  --mint: #45b796;
  --pink: #f2a0b9;
  --text-red: #b8311b;
  --text-blue: #2442b5;

  --lcd-bg: #18150f;
  --lcd-fg: #ffb547;
  --lcd-dim: #8a6427;

  --focus: #2442b5;

  --font: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-lcd: "VT323", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 16px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15130f;
    --paper-band: #211e18;
    --field: #24211b;
    --ink: #f1e7cf;
    --ink-soft: #b3a88f;
    --text-red: #ff7a5f;
    --text-blue: #93a6ff;
    --lcd-bg: #0b0a08;
    --focus: #f3b519;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15130f;
  --paper-band: #211e18;
  --field: #24211b;
  --ink: #f1e7cf;
  --ink-soft: #b3a88f;
  --text-red: #ff7a5f;
  --text-blue: #93a6ff;
  --lcd-bg: #0b0a08;
  --focus: #f3b519;
}

/* Base -------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1;
  font-stretch: 70%;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  margin-bottom: 0.4em;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

strong {
  font-weight: 800;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--yellow);
  color: var(--ink-fixed);
  padding: 0.6rem 1rem;
  font-weight: 800;
}

.skip:focus {
  top: 8px;
}

/* Label tape: section headings like an embossing label maker's ------------ */

.label {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3em 0.6em 0.25em;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  font-stretch: 85%;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-0.6deg);
}

.label.red {
  background: var(--red);
  color: var(--paper-fixed);
}

.label.blue {
  background: var(--blue);
  color: var(--paper-fixed);
}

/* Top bar and masthead ---------------------------------------------------- */

.topbar {
  background: var(--ink-fixed);
  color: var(--paper-fixed);
  --focus: var(--yellow);
}

.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  min-height: 2.75rem;
}

.topbar nav {
  flex: 1;
}

.topbar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topbar a {
  display: inline-block;
  padding: 0.65rem 0;
  font-size: 0.85rem;
  font-stretch: 80%;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.topbar a[aria-current="page"] {
  color: var(--yellow);
}

.topbar .tools {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.topbar .lang-link {
  color: var(--yellow);
}

.masthead {
  background: var(--yellow);
  color: var(--ink-fixed);
  overflow: hidden;
}

.masthead .wrap {
  position: relative;
  padding-top: 1.2rem;
  padding-bottom: 1.1rem;
}

.wordmark {
  display: inline-block;
  margin: 0;
  color: var(--ink-fixed);
  font-size: clamp(3.6rem, 17vw, 9.5rem);
  font-stretch: 62%;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 0.82;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark .tt {
  color: var(--red);
}

.masthead .tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.8rem;
}

.masthead .tagline strong {
  background: var(--ink-fixed);
  color: var(--yellow);
  padding: 0.2em 0.55em;
  font-stretch: 80%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead .tagline span {
  font-stretch: 85%;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
}


/* Four stacked stripes, like a cassette inlay. */
.stripes {
  display: grid;
  grid-template-rows: 5px 5px 5px 5px;
}

.stripes i:nth-child(1) {
  background: var(--red);
}

.stripes i:nth-child(2) {
  background: var(--pink);
}

.stripes i:nth-child(3) {
  background: var(--mint);
}

.stripes i:nth-child(4) {
  background: var(--blue);
}

/* Page sections ------------------------------------------------------------ */

.page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.section {
  margin-top: 2.5rem;
}

.lede {
  max-width: var(--measure);
  font-size: 1.15rem;
}

.prose {
  max-width: var(--measure);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose h2.label {
  margin-top: 1.6rem;
}

.muted {
  color: var(--ink-soft);
}

.small {
  font-size: 0.9rem;
}

/* Chart head: issue line and LCD readouts --------------------------------- */

.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.25rem;
}

.issue {
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.issue .number {
  display: inline-block;
  background: var(--red);
  color: var(--paper-fixed);
  padding: 0.15em 0.5em;
  margin-right: 0.5em;
}

.issue h1 {
  margin: 0.35rem 0 0;
}

.readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lcd {
  display: inline-grid;
  gap: 0.1rem;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  padding: 0.45rem 0.8rem 0.35rem;
  min-width: 9rem;
}

.lcd .caption {
  color: var(--lcd-dim);
  font-family: var(--font);
  font-size: 0.68rem;
  font-stretch: 80%;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lcd .value {
  font-family: var(--font-lcd);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.lcd .value b {
  font-weight: 400;
  color: var(--lcd-dim);
  margin-right: 0.15em;
}

.lcd .sub {
  font-family: var(--font-lcd);
  font-size: 1rem;
  color: var(--lcd-dim);
}

.callout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  background: var(--blue);
  color: var(--paper-fixed);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  --focus: var(--yellow);
}

.callout p {
  margin: 0;
  flex: 1 1 18rem;
}

/* The chart --------------------------------------------------------------- */

.chart {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: 3.6rem 3.4rem 64px minmax(0, 1fr) auto;
  grid-template-areas: "pos move cover info actions";
  align-items: center;
  gap: 0 14px;
  padding: 10px 12px;
}

.entry:nth-child(even) {
  background: var(--paper-band);
}

.entry .pos {
  grid-area: pos;
  font-size: 3rem;
  font-stretch: 62%;
  font-weight: 900;
  line-height: 0.9;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entry .move {
  grid-area: move;
  justify-self: start;
}

.entry .cover {
  grid-area: cover;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--paper-band);
}

.entry .info {
  grid-area: info;
  min-width: 0;
}

.entry .actions {
  grid-area: actions;
}

.entry .title {
  display: block;
  font-size: 1.2rem;
  font-stretch: 78%;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.entry a.title {
  text-decoration: none;
}

.entry .artist {
  display: block;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-stretch: 80%;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Number one gets the red block. */
.entry.first {
  grid-template-columns: 3.6rem 3.4rem 112px minmax(0, 1fr) auto;
  padding-top: 14px;
  padding-bottom: 14px;
}

.entry.first .pos {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--paper-fixed);
  font-size: 3.6rem;
  text-align: center;
}

.entry.first .cover {
  width: 112px;
  height: 112px;
}

.entry.first .title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

@media (max-width: 680px) {
  .entry,
  .entry.first {
    grid-template-columns: 2.6rem 56px minmax(0, 1fr);
    grid-template-areas:
      "pos cover info"
      "move actions actions";
    gap: 4px 12px;
    padding: 10px 8px;
  }

  .entry .pos {
    font-size: 2.3rem;
  }

  .entry .cover,
  .entry.first .cover {
    width: 56px;
    height: 56px;
    align-self: start;
  }

  .entry .move {
    justify-self: end;
  }

  .entry .actions {
    justify-content: start;
  }

  .entry.first .pos {
    font-size: 2.6rem;
  }
}

/* Movement: typeset, not icons. */
.move {
  display: inline-block;
  font-size: 0.8rem;
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.move.up {
  color: var(--text-blue);
}

.move.down {
  color: var(--text-red);
}

.move.same {
  color: var(--ink-soft);
}

.move.new,
.move.re {
  padding: 0.3em 0.45em 0.25em;
  color: var(--ink-fixed);
}

.move.new {
  background: var(--yellow);
}

.move.re {
  background: var(--pink);
}

/* Buttons ----------------------------------------------------------------- */

button {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.btn.red {
  background: var(--red);
  color: var(--paper-fixed);
}

.btn.yellow {
  background: var(--yellow);
  color: var(--ink-fixed);
}

.btn.plain {
  background: var(--paper-band);
  color: var(--ink);
}

.btn:active,
.vote:active,
.play:active {
  background: var(--yellow);
  color: var(--ink-fixed);
}

.btn:disabled,
.vote:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn:disabled:active,
.vote:disabled:active {
  background: var(--ink);
  color: var(--paper);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Vote and listen buttons say what they do: "− Down", "+ Up", "▶ Listen". */
.vote,
.play {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-width: 44px;
  height: 44px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 0;
  font-size: 0.85rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.vote b {
  font-size: 1.35rem;
  font-weight: 900;
}

.play b {
  font-size: 0.85rem;
}

.vote.plus {
  background: var(--blue);
  color: var(--paper-fixed);
}

.vote.minus {
  background: var(--red);
  color: var(--paper-fixed);
}

.vote.plus:disabled:active {
  background: var(--blue);
  color: var(--paper-fixed);
}

.vote.minus:disabled:active {
  background: var(--red);
  color: var(--paper-fixed);
}

.play {
  min-width: 6.6rem;
  background: var(--ink);
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.play[aria-pressed="true"] {
  background: var(--mint);
  color: var(--ink-fixed);
}

/* How you've voted on the song today: "+2 from you". Only shown once you have. */
.mine {
  display: inline-grid;
  place-items: center;
  height: 44px;
  padding: 0 0.55rem;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  font-family: var(--font-lcd);
  font-size: 1.3rem;
  white-space: nowrap;
}

.btn.blue {
  background: var(--blue);
  color: var(--paper-fixed);
}

.rank {
  color: var(--text-red);
  font-stretch: 62%;
  font-weight: 900;
}

/* Forms: input fields are lit displays, which keeps them unmistakable. ---- */

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label,
.field .label-text {
  font-size: 0.8rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input[type="email"],
input[type="search"],
input[type="text"],
input[inputmode="numeric"],
select {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  font-family: var(--font-lcd);
  font-size: 1.6rem;
  line-height: 1.2;
  --focus: var(--blue);
}

select {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
}

input::placeholder {
  color: var(--lcd-dim);
}

input.code {
  max-width: 12rem;
  letter-spacing: 0.4em;
  font-size: 2.2rem;
}

.inline-form {
  display: flex;
  gap: 0;
  max-width: 40rem;
}

.inline-form input {
  flex: 1;
  min-width: 0;
}

.form-narrow {
  max-width: 28rem;
}

/* Lists of songs (search, my votes) --------------------------------------- */

.songs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.song-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 12px;
}

.song-row:nth-child(even) {
  background: var(--paper-band);
}

.song-row .cover {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: var(--paper-band);
}

.song-row .title {
  display: block;
  font-size: 1.05rem;
  font-stretch: 78%;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.song-row .artist {
  display: block;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0.1em 0.4em;
  background: var(--mint);
  color: var(--ink-fixed);
  font-size: 0.65rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

.tag.dark {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 760px) {
  .song-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .song-row .cover {
    width: 48px;
    height: 48px;
  }

  .song-row .actions {
    grid-column: 2;
  }
}

/* Notices and toasts ------------------------------------------------------- */

.notice {
  max-width: var(--measure);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: var(--yellow);
  color: var(--ink-fixed);
  font-weight: 600;
}

.notice.error {
  background: var(--red);
  color: var(--paper-fixed);
}

.empty {
  padding: 2rem 1.2rem;
  background: var(--paper-band);
}

.empty strong {
  display: block;
  font-size: 1.6rem;
  font-stretch: 70%;
  font-weight: 900;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  width: min(32rem, calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.toast.error {
  background: var(--red);
  color: var(--paper-fixed);
}

/* How-it-works strip -------------------------------------------------------- */

.how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how li {
  counter-increment: how;
  padding: 1rem 1.1rem 1.2rem;
  background: var(--paper-band);
}

.how li:nth-child(2) {
  background: var(--mint);
  color: var(--ink-fixed);
}

.how li:nth-child(3) {
  background: var(--pink);
  color: var(--ink-fixed);
}

.how li::before {
  content: counter(how);
  display: block;
  font-size: 2.6rem;
  font-stretch: 62%;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.3rem;
}

/* Tables ------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--paper-band);
}

td.num,
th.num {
  text-align: right;
}

.formula {
  display: block;
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  font-family: var(--font-lcd);
  font-size: clamp(1.2rem, 3.6vw, 1.7rem);
  line-height: 1.2;
}

/* Archive ------------------------------------------------------------------ */

.months {
  list-style: none;
  padding: 0;
  margin: 0;
}

.month + .month {
  margin-top: 2rem;
}

.days {
  list-style: none;
  padding: 0;
  margin: 0;
}

.days a {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.2rem 1rem;
  padding: 0.6rem 0.8rem;
  text-decoration: none;
}

.days li:nth-child(even) a {
  background: var(--paper-band);
}

.days .date {
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 560px) {
  .days a {
    grid-template-columns: 1fr;
  }
}

/* Song page ---------------------------------------------------------------- */

.song-head {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.song-head .cover {
  width: 240px;
  height: 240px;
  object-fit: cover;
  background: var(--paper-band);
}

.song-head h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  overflow-wrap: anywhere;
}

.song-head .artist {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

@media (max-width: 640px) {
  .song-head {
    grid-template-columns: 1fr;
  }

  .song-head .cover {
    width: 160px;
    height: 160px;
  }
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.history-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  margin-bottom: 1rem;
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  margin-top: 3rem;
  background: var(--ink-fixed);
  color: var(--paper-fixed);
  --focus: var(--yellow);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-top: 1.6rem;
  padding-bottom: 2rem;
  font-size: 0.9rem;
}

.site-footer .mark {
  font-size: 2rem;
  font-stretch: 62%;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.3rem;
}

@media (max-width: 640px) {
  .site-footer .wrap {
    grid-template-columns: 1fr;
  }
}

/* Admin -------------------------------------------------------------------- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.subnav a {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  background: var(--paper-band);
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.subnav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0;
}

.tile {
  padding: 0.9rem 1rem;
  background: var(--paper-band);
}

.tile:nth-child(4n + 1) {
  background: var(--yellow);
  color: var(--ink-fixed);
}

.tile:nth-child(4n + 3) {
  background: var(--mint);
  color: var(--ink-fixed);
}

.tile .n {
  display: block;
  font-size: 2.4rem;
  font-stretch: 62%;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tile .k {
  font-size: 0.75rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bars {
  display: block;
  width: 100%;
  height: 160px;
}

.bars .plus {
  fill: var(--blue);
}

.bars .minus {
  fill: var(--red);
}

.bars .axis {
  fill: var(--ink-soft);
  font: 600 10px var(--font);
}

.legend {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.legend i {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.35em;
  vertical-align: -0.05em;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.detail {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--paper-band);
}

td .btn {
  min-height: 36px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

td code,
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 160ms steps(4);
  }

  @keyframes toast-in {
    from {
      transform: translate(-50%, 1rem);
    }
  }
}


.wordmark,
.masthead .tagline {
  position: relative;
  z-index: 1;
}

.history-chart .grid-line {
  stroke: var(--paper-band);
  stroke-width: 2;
}

.history-chart .axis-label {
  fill: var(--ink-soft);
  font: 700 12px var(--font);
}

.history-chart .history-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linejoin: miter;
}

.history-chart .history-point {
  fill: var(--ink);
}

.swatch-plus {
  background: var(--blue);
}

.swatch-minus {
  background: var(--red);
}

.vote.unavailable {
  visibility: hidden;
}

@media (max-width: 560px) {
  .topbar .wrap {
    gap: 0 0.9rem;
  }

  .topbar nav {
    flex: 1 1 100%;
  }

  .topbar ul,
  .topbar .tools {
    gap: 0 0.9rem;
  }

  .topbar a {
    font-size: 0.8rem;
    letter-spacing: 0.07em;
    padding: 0.55rem 0;
  }

  .topbar .tools {
    margin-left: auto;
  }
}

#days td:first-child,
#audit td:first-child,
#users td:nth-child(2),
#users td:nth-child(3) {
  white-space: nowrap;
}

/* The masthead's cassette: flat colours, the site's stripes on its label.
   Its reels turn while a preview plays (body.is-playing, set by player.js). */
.cassette {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  width: min(36vw, 300px);
  height: auto;
  transform: translateY(-50%) rotate(-7deg);
  pointer-events: none;
}

@media (max-width: 900px) {
  .cassette {
    width: 26vw;
    top: 1rem;
    transform: rotate(-7deg);
  }
}

@media (max-width: 640px) {
  .wordmark {
    font-size: 15vw;
  }
}

.c-shell {
  fill: var(--ink-fixed);
}

.c-screw,
.c-head {
  fill: #3b352b;
}

.c-label {
  fill: #e9e4d8;
}

.c-line {
  stroke: #b3ab9b;
  stroke-width: 1.5;
}

.c-red {
  fill: var(--red);
}

.c-pink {
  fill: var(--pink);
}

.c-mint {
  fill: var(--mint);
}

.c-blue {
  fill: var(--blue);
}

.c-brand {
  fill: var(--paper-fixed);
  font: 800 8px var(--font);
  font-stretch: 80%;
  letter-spacing: 0.08em;
}

.c-box,
.c-side {
  fill: var(--ink-fixed);
}

.c-box-text {
  fill: #e9e4d8;
  font: 900 12px var(--font);
  font-stretch: 70%;
}

.c-side-text {
  fill: #e9e4d8;
  font: 900 18px var(--font);
  font-stretch: 70%;
}

.c-band {
  fill: #2a251d;
}

.c-socket {
  fill: #15130f;
}

.c-window {
  fill: #4a443a;
}

.c-tape {
  fill: #5a3a22;
}

.c-hub {
  fill: #f3ecda;
}

.c-hole {
  fill: #15130f;
}

.c-gap {
  fill: var(--yellow);
}

@media (prefers-reduced-motion: no-preference) {
  /* Each reel turns on its own hub (its group is centred on 0,0), at a
     tape deck's leisurely pace; the cassette sways a little. */
  .reel {
    transform-origin: 0 0;
  }

  .is-playing .reel {
    animation: reel-spin 3.2s linear infinite;
  }

  .is-playing .cassette {
    animation: cassette-sway 5s ease-in-out infinite alternate;
  }

  @keyframes reel-spin {
    to {
      transform: rotate(-360deg);
    }
  }

  @keyframes cassette-sway {
    from {
      rotate: 0deg;
      translate: 0 0;
    }

    to {
      rotate: 2deg;
      translate: 0 -4px;
    }
  }
}

/* Fold-out for the details most visitors don't need (how the score works). */
.fold {
  margin: 1.6rem 0;
  max-width: var(--measure);
}

.fold summary {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  background: var(--paper-band);
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary::before {
  content: "+ ";
}

.fold[open] summary::before {
  content: "− ";
}

.fold[open] summary {
  background: var(--ink);
  color: var(--paper);
  margin-bottom: 1rem;
}

/* Group switcher: which chart you're looking at and voting in. */
.group-bar {
  background: var(--paper-band);
}

.group-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.group-bar-label {
  font-size: 0.72rem;
  font-stretch: 80%;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.group-bar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-bar a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: var(--paper);
  font-stretch: 80%;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.group-bar a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

.group-bar .manage-groups a {
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.group-bar .manage-groups a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.group-name {
  display: inline-block;
  background: var(--blue);
  color: var(--paper-fixed);
  padding: 0.15em 0.5em;
  margin-right: 0.5em;
}

/* Lists of groups and members. */
.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0.9rem;
}

.group-row:nth-child(even) {
  background: var(--paper-band);
}

.group-row .title {
  display: block;
  font-size: 1.15rem;
  font-stretch: 78%;
  font-weight: 800;
  text-transform: uppercase;
}

.invite-link {
  display: block;
  max-width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  font-family: var(--font-lcd);
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

/* Weekly lists: the points take the place of the movement column. */
.move.points {
  color: var(--ink);
  white-space: nowrap;
}

.month-label {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-stretch: 80%;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
