/*
 * The public landing and the demo, on the same visual system as the private
 * app ("Afis de meci", `docs/design.md`) — the same tokens, the same display
 * face, the same bib block at the top of the screen. It stays a standalone
 * stylesheet with no dependency on the private bundle: a visitor without the
 * group cookie loads this file, `demo.js` and the two public font files, and
 * nothing else. Nothing here names or reaches anything private.
 */

@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/big-shoulders-display-900-latin.woff2') format('woff2');
  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 {
  color-scheme: light;

  --paper: #f4f3ee;
  --card: #ffffff;
  --ink: #0f1013;
  --ink-2: #6b6e76;
  --line: #dcdad3;
  --line-strong: #c3bfb6;

  /* Team *text* on the page ground: dark enough to read on paper. */
  --galben: #5a6a00;
  --mov: #6d28d9;
  --portocaliu: #b8321f;

  /* The solid shirt colour, the same in both themes. */
  --galben-bib: #d5fc22;
  --mov-bib: #6d28d9;
  --portocaliu-bib: #fb524e;
  /* The ink each shirt carries: white on galben or portocaliu cannot be read. */
  --galben-on: #15161a;
  --mov-on: #ffffff;
  --portocaliu-on: #15161a;
  --on-bib: #ffffff;

  --sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', 'Courier New', monospace;
  --display: 'Big Shoulders Display', var(--sans);

  /* The corner of every control (revision 2): the bib block is square. */
  --r: 3px;
  --tap: 46px;
  --gutter: 20px;

  font-family: var(--sans);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --paper: #0f1013;
    --card: #15171c;
    --ink: #f4f3ee;
    --ink-2: #8e929b;
    --line: #24262c;
    --line-strong: #3c424e;

    --galben: #d5fc22;
    --mov: #a78bfa;
    --portocaliu: #fb524e;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

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

.public-shell {
  max-width: 620px;
  margin: auto;
  padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------- bib block */

/*
 * The same block the app opens every screen with: full-bleed, painted in the
 * colour of whoever the moment is about — ink on the landing, because it is
 * about nobody's team, and the team on the clock inside the demo.
 */
.bib-block {
  container-type: inline-size;
  margin: 0 calc(-1 * var(--gutter)) 18px;
  padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 20px;
  background: var(--bib-solid, var(--ink));
  color: var(--on-bib);
  transition: background 0.35s ease;
}

.bib-block.ink {
  background: var(--ink);
  color: var(--paper);
}

.bib-eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Set to fill the block, exactly as the app's headline is: 56px is the
   ceiling, and the widest line — `--headline-chars` — decides the size. */
.bib-headline {
  margin: 0;
  padding: 0.14em 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: min(56px, calc(100cqw / (var(--headline-chars, 10) * 0.72)));
  line-height: 0.88;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.bib-sub {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

/* --------------------------------------------------------------- landing */

.eyebrow {
  margin: 18px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* The three shirts, as small marks on the ground — the one thing the landing
   shows rather than says. The only colour below the block. */
.bib-mark {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.bib-mark span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.bib-mark span:nth-child(1) {
  color: var(--galben);
}
.bib-mark span:nth-child(2) {
  color: var(--mov);
}
.bib-mark span:nth-child(3) {
  color: var(--portocaliu);
}

.welcome-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

/* The primary slab (revision 2): ink fill with paper text, so it is paper-on-dark
   at night and ink-on-paper by day. Display face, capitals, no shadow. A forward
   step ends in `→`, kept out of the accessible name by the `/ ''` alt form. */
.action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: left;
}

a.action::after {
  content: '→';
  content: '→' / '';
}

/* Not yet: a dashed outline and no fill, never a faded copy of the live slab. */
.action.unavailable {
  background: transparent;
  color: var(--ink-2);
  border-style: dashed;
  border-color: var(--ink-2);
  cursor: not-allowed;
}

.unavailable span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.small-note {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 13px;
}

/* ------------------------------------------------------------------ demo */

/* The pool, on the app's own row: one name, the whole row the tap, the `+` on
   the right in the display face. */
.choices {
  display: flex;
  flex-direction: column;
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
}

.player:first-child {
  border-top: 0;
}

.player-name {
  flex: 1;
  overflow-wrap: break-word;
}

.player-plus {
  flex: none;
  width: 24px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.last-pick {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

/* The teams: one line each, as on the app's draft board — never cards. */
.demo-teams {
  margin-top: 22px;
}

.demo-team {
  padding: 10px 0;
  font-size: 15px;
}

.demo-team + .demo-team {
  border-top: 1px solid var(--line);
}

.demo-team h2 {
  display: inline;
  margin: 0;
  color: var(--team);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.demo-team ul {
  display: inline;
  padding: 0;
  margin: 0;
  list-style: none;
}

.demo-team li {
  display: inline;
  font-weight: 600;
  overflow-wrap: break-word;
}

.demo-team li::before {
  content: ' · ';
  color: var(--ink-2);
  font-weight: 400;
}

.demo-team .vacant {
  color: var(--ink-2);
  font-weight: 400;
}

.demo-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

/* The label link (revision 2): tracked capitals, underlined, full ink. */
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
