/* Rebuilt from design/reference (mobile 390 x 844, web 1440 x 900). Mobile first; the "tablet" step is 768 px
   and the "desktop" step 1024 px. Sizes between the two artboards scale with the viewport. */

@font-face {
  font-family: "Tanker";
  src: url("/assets/fonts/tanker-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  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+FEFF, U+FFFD;
}

:root {
  --purple: #5145b0;
  --pink: #ffafb0;
  --mint: #7dd3b5;
  /* Mint text on purple needs to be a touch lighter than the design's mint to reach 4.5:1 contrast. */
  --mint-text: #8fdcc1;
  --ink: #111111;
  --white: #ffffff;
  --lilac: #e8e6fa;
  --line: #e2e2e2;
  --text-soft: #555555;
  --text-muted: #6b6b6b;
  --disabled: #bdbdbd;
  --display: "Tanker", Impact, "Arial Narrow", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--purple);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
p,
ol,
ul,
fieldset {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  min-width: 0;
}

ol,
ul {
  list-style: none;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

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

.screen :focus-visible,
.pick__header :focus-visible {
  outline-color: var(--white);
}

.screen .signin__form :focus-visible,
.screen .message__card :focus-visible {
  outline-color: var(--ink);
}

h1:focus {
  outline: none;
}

.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
}

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

/* Visibility helpers for the differences between the mobile and the web artboards. */
@media (max-width: 767.98px) {
  .from-tablet {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .until-tablet {
    display: none !important;
  }
}

@media (max-width: 1023.98px) {
  .from-desktop {
    display: none !important;
  }
}

.noscript {
  padding: 24px;
  color: var(--white);
  font-weight: 700;
  text-align: center;
}

/* The page for an address that does not exist. */
.not-found__box {
  padding: 48px 24px;
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.not-found__box a {
  color: var(--white);
}

/* "+1 minute added": shown for a few seconds when the organisers extend the vote. Below the connection notice when
   both are visible. */
.extra-time {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 21;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  padding: 10px 18px 9px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

.notice:not([hidden]) ~ .extra-time {
  top: calc(max(12px, env(safe-area-inset-top)) + 56px);
}

/* ---------- Shared pieces ---------- */

.screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--purple);
  color: var(--white);
}

.dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 175, 176, 0.5) 2.4px, transparent 2.9px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 85% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 90% 60% at 85% 0%, #000 0%, transparent 70%);
}

/* The big outlined title with the stacked shadow. */
.poster {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--white);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    2px 2px 0 var(--ink),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--ink),
    8px 8px 0 var(--ink),
    10px 10px 0 var(--ink),
    14px 14px 0 var(--pink);
}

.button {
  display: block;
  width: 100%;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
}

.button:disabled {
  cursor: not-allowed;
}

.button--mint {
  min-height: 56px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--mint);
  color: var(--ink);
  font-size: 24px;
  box-shadow: 4px 4px 0 var(--ink);
}

.button--mint:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button--send {
  min-height: 56px;
  border: none;
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
  font-size: 24px;
}

.button--send:disabled {
  background: var(--disabled);
}

.button--outline {
  display: inline-block;
  width: auto;
  min-height: 52px;
  padding: 0 28px;
  border: 3px solid var(--white);
  border-radius: 14px;
  background: transparent;
  color: var(--white);
  font-size: 22px;
}

.button--outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.message__change {
  margin-top: 22px;
}

.link-button {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--lilac);
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button--dark {
  color: var(--purple);
}

.action-bar__keep {
  display: block;
  width: fit-content;
  margin: 0 auto 6px;
  padding: 8px 16px;
  border-radius: 999px;
  /* The bar fades in from transparent on phones; the link gets its own background so it stays readable. */
  background: var(--white);
}

.eyebrow {
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-error {
  margin-top: 10px;
  color: #a4161a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.notice {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  padding: 10px 16px 9px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--pink);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Sign in ---------- */

.signin__layout {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px max(22px, env(safe-area-inset-left), env(safe-area-inset-right)) 26px;
  padding-bottom: max(26px, env(safe-area-inset-bottom));
}

.signin__logo {
  flex: none;
  width: 118px;
}

.signin__title {
  margin-top: auto;
  padding-top: 34px;
  font-size: 74px;
  line-height: 0.88;
}

.signin__form {
  margin-top: 34px;
  padding: 18px 16px 16px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.signin__label {
  display: block;
  font-size: 22px;
}

.signin__input {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #f7f7f7;
  font-size: 17px;
}

.signin__input::placeholder {
  color: #6b6b6b;
}

.signin__input:focus-visible {
  outline-color: var(--purple);
  outline-offset: 2px;
}

.signin__button {
  margin-top: 24px;
}

.signin__rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  margin-bottom: auto;
  padding-bottom: 10px;
}

.rules li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.rules__number {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  font-size: 16px;
}

/* ---------- Message screens: waiting, thank you, already voted, closed ---------- */

.message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  text-align: center;
}

.message > * {
  position: relative;
}

.message > .dots {
  position: absolute;
}

.message--thanks > .dots {
  display: none;
}

.message__logo {
  width: 150px;
}

/* The same outlined, stacked look as the sign-in title, at phone size; wider screens make it larger below. */
.message__title {
  margin-top: 34px;
  color: var(--white);
  font-family: var(--display);
  font-weight: 400;
  font-size: 58px;
  /* Room for the stacked shadow: the first line's shadow must not run into the second line. */
  line-height: 1.06;
  text-transform: uppercase;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    2px 2px 0 var(--ink),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--ink),
    8px 8px 0 var(--ink),
    10px 10px 0 var(--ink),
    14px 14px 0 var(--pink);
}

/* The countdown number in the title's outlined, stacked look, in mint. */
.message__countdown {
  /* Clear of the title's shadow. */
  margin-top: 22px;
  color: var(--mint);
  font-family: var(--display);
  font-size: 132px;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    2px 2px 0 var(--ink),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--ink),
    8px 8px 0 var(--ink),
    10px 10px 0 var(--ink),
    14px 14px 0 var(--pink);
}

.message__lead {
  /* Clear of the title's 14 px shadow. */
  margin-top: 24px;
  color: var(--lilac);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

/* The same framed card on every screen size: outlined, with the solid shadow of the other cards. */
.message__card {
  width: 100%;
  max-width: 420px;
  margin-top: 26px;
  padding: 16px 18px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 7px 7px 0 var(--ink);
}

.message__identity {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.message__footnote {
  margin-top: 22px;
  font-size: 14px;
  font-weight: 700;
}

.message__footnote--mint {
  color: var(--mint-text);
}

.message__footnote--small {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 28px;
  color: var(--lilac);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pick-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 6px 0;
}

.pick-summary__check {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mint);
  color: var(--ink);
}

.pick-summary__check svg {
  width: 16px;
  height: 16px;
}

.pick-summary__photo {
  position: relative;
  flex: none;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--purple);
}

.pick-summary__photo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.pick-summary__name {
  min-width: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

/* ---------- Pick a team ---------- */

.pick {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
}

.pick__header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo timer"
    "title title"
    "hint hint"
    "pick pick";
  align-items: center;
  padding: 20px var(--gutter) 16px;
  background: var(--purple);
  color: var(--white);
}

.pick__logo {
  grid-area: logo;
  width: 78px;
}

.pick__status {
  display: contents;
}

.timer {
  grid-area: timer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.timer__icon {
  width: 16px;
  height: 16px;
}

.timer--floating {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: var(--gutter);
  z-index: 11;
  box-shadow: 3px 3px 0 var(--ink);
  /* Taps go through to the team card underneath. */
  pointer-events: none;
}

.pick__title {
  grid-area: title;
  margin-top: 14px;
  font-size: 40px;
  line-height: 0.95;
}

.pick__hint {
  grid-area: hint;
  margin-top: 6px;
  color: var(--lilac);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.your-pick {
  grid-area: pick;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 12px 7px;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  color: var(--white);
}

.your-pick__label {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.your-pick__name {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick.is-picked .timer {
  background: var(--mint);
}

.pick.is-picked .your-pick {
  border: 2px solid var(--ink);
  background: var(--mint);
  color: var(--ink);
}

.teams__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 120px;
}

.team__card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 64px minmax(0, 1fr) 32px;
  grid-template-areas:
    "number photo name check"
    "number photo product check"
    "number photo idea check";
  align-content: center;
  align-items: center;
  column-gap: 10px;
  min-height: 80px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  touch-action: manipulation;
  scroll-margin-top: 16px;
  scroll-margin-bottom: 120px;
}

.team__card:has(.team__input:focus-visible) {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
}

.team__number {
  grid-area: number;
  color: var(--purple);
  font-size: 22px;
}

.team__photo {
  grid-area: photo;
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--purple);
}

/* Team pictures are square designs from the event team: shown whole in a square box. */
.team__photo img,
.pick-summary__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team__photo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: var(--white);
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.team__name {
  grid-area: name;
  min-width: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.team__product {
  grid-area: product;
  justify-self: start;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 7px 2px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--purple);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.team__idea {
  grid-area: idea;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.team__check {
  grid-area: check;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  color: var(--white);
}

.team__check svg {
  width: 18px;
  height: 18px;
  opacity: 0;
}

.team.is-selected .team__card {
  border-color: var(--ink);
  background: var(--mint);
  box-shadow: 4px 4px 0 var(--ink);
}

.team.is-selected .team__number {
  color: var(--ink);
}

.team.is-selected .team__product {
  background: var(--ink);
}

.team.is-selected .team__idea {
  color: #333333;
}

.team.is-selected .team__check {
  background: var(--ink);
}

.team.is-selected .team__check svg {
  opacity: 1;
}

.action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 14px var(--gutter) 26px;
  padding-bottom: max(26px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--white) 30%);
}

.action-bar__status {
  display: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.action-bar__status.is-warning {
  display: block;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 2px solid #a4161a;
  border-radius: 12px;
  background: var(--white);
  color: #a4161a;
  font-size: 14px;
  text-align: center;
}

/* ---------- Tablet and up: the web artboard ---------- */

@media (min-width: 768px) {
  :root {
    --gutter: clamp(28px, 3.9vw, 56px);
    /* Keeps full-width bars aligned with the 1440 px content column on larger screens. */
    --wide-gutter: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter)));
  }

  .dots {
    background-image: radial-gradient(circle, rgba(255, 175, 176, 0.5) 3.4px, transparent 4px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 100% 0%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse 60% 70% at 100% 0%, #000 0%, transparent 70%);
  }

  .poster,
  .message__title {
    -webkit-text-stroke: 7px var(--ink);
    text-shadow:
      3px 3px 0 var(--ink),
      6px 6px 0 var(--ink),
      9px 9px 0 var(--ink),
      12px 12px 0 var(--ink),
      20px 20px 0 var(--pink);
  }

  .signin__title {
    font-size: 104px;
  }

  /* Message screens */
  .message--thanks > .dots {
    display: block;
  }

  .message__logo {
    width: 170px;
  }

  .message__title {
    margin-top: 36px;
    color: var(--white);
    paint-order: stroke fill;
    font-size: clamp(72px, 8.4vw, 120px);
    line-height: 0.88;
  }

  .message__lead {
    margin-top: 26px;
    font-size: 22px;
  }

  .message__card {
    max-width: 560px;
    margin-top: 30px;
    padding: 22px 28px;
    border: 4px solid var(--ink);
    border-radius: 26px;
    box-shadow: 10px 10px 0 var(--ink);
  }

  .message__card .eyebrow {
    font-size: 13px;
  }

  .message__identity {
    font-size: 20px;
  }

  .message__footnote {
    margin-top: 30px;
    font-size: 18px;
  }

  .link-button {
    font-size: 17px;
  }

  .pick-summary {
    gap: 14px;
    margin-top: 14px;
    padding: 0;
  }

  .pick-summary__check {
    width: 40px;
    height: 40px;
    background: var(--mint);
    color: var(--ink);
  }

  .pick-summary__check svg {
    width: 18px;
    height: 18px;
  }

  .pick-summary__name {
    font-size: 26px;
  }

  .pick-summary__photo {
    width: 72px;
    height: 72px;
  }

  .pick-summary__photo--initials {
    font-size: 30px;
  }

  /* Pick a team */
  .pick__header {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "logo status"
      "title status"
      "hint status";
    align-items: end;
    column-gap: 40px;
    padding: 26px var(--wide-gutter) 24px;
  }

  .pick__status {
    grid-area: status;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
  }

  .pick__logo {
    width: 92px;
  }

  .timer {
    padding: 7px 16px 5px;
    font-size: 22px;
  }

  .timer__icon {
    width: 20px;
    height: 20px;
  }

  .pick__title {
    margin-top: 16px;
    font-size: clamp(44px, 4.2vw, 60px);
    line-height: 0.92;
  }

  .pick__hint {
    margin-top: 8px;
    font-size: 18px;
  }

  .your-pick {
    display: block;
    width: 100%;
    margin-top: 0;
    padding: 9px 16px 8px;
    border-radius: 14px;
  }

  .your-pick__label {
    display: block;
    font-size: 12px;
  }

  .your-pick__name {
    display: block;
    margin-top: 4px;
    font-size: 24px;
  }

  /* Rows of --cols cards; a last row with fewer cards sits in the middle instead of at the left edge. */
  .teams__list {
    --cols: 3;
    --list-gap: 18px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--list-gap);
    max-width: 1440px;
    margin: 0 auto;
    padding: 26px var(--gutter) 124px;
  }

  .teams__list > .team {
    flex: 0 0 calc((100% - (var(--cols) - 1) * var(--list-gap)) / var(--cols));
    min-width: 0;
  }

  /* Everything on a card is centred: the photo, the number with the name, the product and the idea. The outer
     columns share the free space, so the number and name sit in the middle as one line. */
  .team__card {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, max-content) minmax(0, 1fr);
    grid-template-areas:
      "photo photo photo photo"
      ". number name ."
      "product product product product"
      "idea idea idea idea";
    align-content: start;
    align-items: baseline;
    column-gap: 0;
    text-align: center;
    height: 100%;
    padding: 10px;
    border-radius: 18px;
  }

  /* As wide as the card, square, but never larger than the design needs. */
  .team__photo {
    justify-self: center;
    width: 100%;
    max-width: 224px;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .team__photo--initials {
    font-size: 64px;
  }

  .team__number {
    margin-top: 12px;
    margin-right: 8px;
    font-size: 20px;
  }

  .team__name {
    margin-top: 12px;
    font-size: 24px;
  }

  .team__product {
    justify-self: center;
    margin-top: 8px;
  }

  .team__idea {
    margin-top: 6px;
    font-size: 14px;
  }

  .team__check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }

  .team.is-selected .team__card {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .team__card {
    scroll-margin-bottom: 130px;
  }

  .action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px var(--wide-gutter) 18px;
    border-top: 2px solid var(--line);
    background: var(--white);
  }

  .action-bar__status,
  .action-bar__status.is-warning {
    display: block;
    flex: 1 1 auto;
    margin: 0;
    font-size: 16px;
    text-align: left;
  }

  .action-bar__keep {
    margin: 0;
  }

  .action-bar__status.is-picked {
    color: var(--ink);
  }

  .button--send {
    width: auto;
    min-width: 340px;
    min-height: 64px;
    font-size: 28px;
  }
}

/* ---------- Desktop: two-column sign in, wider grid ---------- */

@media (min-width: 1024px) {
  .signin__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    grid-template-rows: auto 1fr auto auto 1fr;
    grid-template-areas:
      "logo logo"
      ". ."
      "title form"
      "rules form"
      ". .";
    column-gap: clamp(40px, 6vw, 120px);
    max-width: 1440px;
    padding: 70px clamp(48px, 8.3vw, 120px) 60px;
  }

  .signin__logo {
    grid-area: logo;
    width: 150px;
  }

  .signin__title {
    grid-area: title;
    margin: 0;
    padding: 0;
    font-size: clamp(80px, calc(23vw - 150px), 150px);
    line-height: 0.86;
  }

  .signin__rules {
    grid-area: rules;
    gap: 14px;
    margin: 44px 0 0;
    padding: 0;
  }

  .rules li {
    gap: 14px;
    font-size: 22px;
  }

  .rules__number {
    width: 44px;
    height: 44px;
    border-width: 3px;
    font-size: 22px;
  }

  .signin__form {
    grid-area: form;
    align-self: center;
    margin: 0;
    padding: 36px 34px 34px;
    border-width: 4px;
    border-radius: 32px;
    box-shadow: 12px 12px 0 var(--ink);
  }

  .signin__form-title {
    font-size: 40px;
  }

  .signin__form-text {
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
  }

  .signin__label {
    margin-top: 26px;
  }

  .signin__input {
    min-height: 60px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 18px;
  }

  .signin__button {
    min-height: 64px;
    margin-top: 22px;
    border-width: 3px;
    border-radius: 16px;
    font-size: 28px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .teams__list {
    --cols: 4;
  }
}

@media (min-width: 1280px) {
  .teams__list {
    --cols: 5;
  }

  /* A long one-word name ("Pitchuationship") shrinks to fit a narrow card instead of breaking in the middle of
     the word. */
  .team__card {
    container-type: inline-size;
  }

  .teams__list .team__name {
    font-size: clamp(16px, calc(15.5cqi - 4px), 24px);
  }
}

/* A tie-break lists two or three teams: keep the cards at their usual size and centre them, instead of leaving
   most of the row empty. */
@media (min-width: 768px) {
  .pick.is-tie-break .teams__list > .team {
    flex-basis: 264px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .team__card,
  .timer,
  .your-pick,
  .button {
    transition:
      background-color 120ms ease,
      border-color 120ms ease,
      box-shadow 120ms ease,
      transform 80ms ease;
  }
}

/* Who is signed in, above the team list: a wrong account must be visible and fixable before voting. */
.pick__identity {
  margin: 0;
  padding: 12px 16px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pick__identity .link-button {
  min-height: 0;
  padding: 0;
  font-size: 13px;
}

@media (min-width: 768px) {
  .pick__identity {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px var(--gutter) 0;
    font-size: 14px;
  }
}

/* A link that looks like a button (Google sign-in is a plain link to the sign-in start). */
a.button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* "Vote saved" in three groups: what happened (title, the sentence and the timer it names), the vote (the card and
   the button that changes it), and where things go from here (ceremony, account). Inside a group the gaps are
   small; between groups they are larger. */
.timer--inline {
  margin: 16px auto 0;
  width: fit-content;
}

.message--thanks .timer--inline:not([hidden]) + .message__card {
  margin-top: 26px;
}

.message--thanks .message__change {
  margin-top: 16px;
}

.message--thanks .message__footnote--mint {
  margin-top: 34px;
}

.message--thanks .message__footnote--small {
  margin-top: 16px;
}

@media (min-width: 768px) {
  .timer--inline {
    margin-top: 22px;
  }

  .message--thanks .timer--inline:not([hidden]) + .message__card {
    margin-top: 28px;
  }

  .message--thanks .message__change {
    margin-top: 28px;
  }

  .message--thanks .message__footnote--mint {
    margin-top: 44px;
  }

  .message--thanks .message__footnote--small {
    margin-top: 20px;
  }

  /* On wider screens "Voted as <address> Sign out" fits on one line, within the column of the card. */
  .message__footnote--small {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    column-gap: 8px;
    max-width: 560px;
  }
}

/* Laptops are wide but short, and the browser's own bars take another 100 px or more: tighten the screen in two
   steps so everything, down to "Sign out", fits without scrolling. */
@media (min-width: 768px) and (max-height: 860px) {
  .message__logo {
    width: 124px;
  }

  .message__title {
    margin-top: 22px;
  }

  .message--thanks .message__footnote--mint {
    margin-top: 32px;
  }
}

@media (min-width: 768px) and (max-height: 799px) {
  .message {
    padding-block: 20px;
  }

  .message__logo {
    width: 96px;
  }

  .message__title {
    margin-top: 18px;
    font-size: clamp(64px, 12vh, 120px);
  }

  .timer--inline {
    margin-top: 16px;
  }

  .message--thanks .timer--inline:not([hidden]) + .message__card {
    margin-top: 22px;
  }

  .message__card {
    padding: 16px 24px;
  }

  .message--thanks .message__change {
    margin-top: 20px;
  }

  .message--thanks .message__footnote--mint {
    margin-top: 24px;
  }

  .message--thanks .message__footnote--small {
    margin-top: 12px;
  }
}

/* The ballot on a laptop: the browser leaves about 1440 x 800, and all ten teams (two rows of five) should fit above
   the send bar without scrolling. Header, cards and bar get tighter in two steps; nothing is left out. */
@media (min-width: 1024px) and (max-height: 900px) {
  .pick__header {
    padding-block: 16px 14px;
  }

  .pick__logo {
    width: 72px;
  }

  .pick__title {
    margin-top: 10px;
    font-size: clamp(40px, 3.8vw, 56px);
  }

  .pick__hint {
    margin-top: 4px;
    font-size: 16px;
  }

  .pick__identity {
    padding-top: 10px;
  }

  .teams__list {
    --list-gap: 14px;
    padding-top: 12px;
    padding-bottom: 100px;
  }

  /* Smaller photo steps, chosen by the page (fitBallot in app.js) only when the cards would reach the send bar. */
  .teams__list.fit-192 .team__photo {
    max-width: 192px;
  }

  .teams__list.fit-160 .team__photo {
    max-width: 160px;
  }

  .teams__list.fit-144 .team__photo {
    max-width: 144px;
  }

  .teams__list.fit-128 .team__photo {
    max-width: 128px;
  }

  .teams__list.fit-112 .team__photo {
    max-width: 112px;
  }

  .teams__list.fit-96 .team__photo {
    max-width: 96px;
  }

  .team__number,
  .team__name {
    margin-top: 8px;
  }

  .team__product {
    margin-top: 6px;
  }

  .team__idea {
    margin-top: 4px;
  }

  .action-bar {
    padding-block: 10px 12px;
  }

  .button--send {
    min-height: 56px;
  }

  .team__card {
    scroll-margin-bottom: 100px;
  }
}

@media (min-width: 1024px) and (max-height: 760px) {
  .pick__title {
    font-size: 40px;
  }

  .pick__hint {
    font-size: 15px;
  }

  .team__name {
    font-size: 22px;
  }
}

/* Short phones (an iPhone with Safari's bars leaves about 390 x 664). */
@media (max-width: 767px) and (max-height: 700px) {
  .message {
    padding-block: 20px;
  }

  .message__logo {
    width: 88px;
  }

  .message__title {
    margin-top: 18px;
  }

  .message__card {
    padding: 12px 16px;
  }

  .message--thanks .timer--inline:not([hidden]) + .message__card {
    margin-top: 20px;
  }

  .message--thanks .message__footnote--mint {
    margin-top: 22px;
  }
}

@media (max-width: 767px) {
  .team--bare .team__name {
    grid-row: 1 / -1;
    align-self: center;
  }
}

/* "Sign in with Google": Google's mark on a white disc, as Google's sign-in branding asks. */
.google-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--white);
  flex: none;
}

/* Below desktop width the sign-in box holds only the Google button: no gap above it, so the frame sits evenly. */
@media (max-width: 1023.98px) {
  #signin-google {
    margin-top: 0;
  }

  #signin-error:not([hidden]) {
    margin: 0 0 14px;
  }
}
