/*
  Visual direction "Wycinanka" (paper cut-out).
  White paper and coloured paper cut with scissors: green strips with a zigzag edge, snowflakes, red buttons.
  Headings sit on the symmetry axis, because a cut-out is cut from folded paper.
  No JavaScript and no inline styles (CSP). The snowflake and the zigzag edge are SVG files used as masks,
  so CSS sets their colour.
  Mobile first: the base styles are for a narrow screen, wider screens are added in @media (min-width).
*/

/* ---------- Font (OFL, served from ../fonts, licence next to the files) ---------- */

/* Fira Sans (Erik Spiekermann, Ralph du Carrois for Mozilla): a humanist sans for screens, open shapes,
   a plain zero without slash or dot. Only two weights, 400 and 700, so the sheet never uses 600:
   the browser would take 700 anyway. */
@font-face {
  font-family: "Fira Sans";
  src: url("../fonts/fira-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  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;
}
@font-face {
  font-family: "Fira Sans";
  src: url("../fonts/fira-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  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;
}
@font-face {
  font-family: "Fira Sans";
  src: url("../fonts/fira-sans-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fira Sans";
  src: url("../fonts/fira-sans-latin-ext-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  --paper: #ffffff;
  --ink: #1a2b22;               /* text, 14.9:1 on white */
  --ink-light: #4f5f55;         /* secondary text and field borders, 6.8:1 */
  --green: #17663f;             /* strips, ribbons, snowflakes, 7.0:1 on white */
  --green-dark: #0f4d2e;
  --green-pale: #eef4ec;        /* sheet background, text on it 13.3:1 */
  --red: #c42127;               /* buttons, "no", 5.8:1 with white */
  --red-dark: #9e1b21;
  --yellow: #f7c531;            /* notices and focus on green, 4.3:1 on green */

  --focus: var(--ink);

  --font: "Fira Sans", "Segoe UI", Verdana, sans-serif;

  --column: 44rem;
  --column-wide: 72rem;
  --gutter: 1rem;

  /* The thin snowflake for small sizes (header, titles), the bold one for large sizes and on red, where the thin
     one got lost. */
  --snowflake: url("../img/snowflake.svg");
  --snowflake-bold: url("../img/snowflake-bold.svg");
  /* One long strip of teeth instead of a repeated gradient,
     because Chrome drew a light line on fractional pixels with the repeated gradient. */
  --zigzag: url("../img/zigzag.svg") 50% 0 / 2800px 15px no-repeat;
  --zigzag-small: url("../img/zigzag.svg") 50% 0 / 2000px 10.75px no-repeat;
}

/* ---------- Basics ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1875rem;         /* 19 px: some of the family see less well */
  line-height: 1.5;
}

h1, h2, h3 {
  margin: 0 0 0.75rem;
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}
h2 { font-size: 1.3125rem; }

p { margin: 0 0 1rem; text-wrap: pretty; }

a { color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--green-dark); text-decoration-thickness: 3px; }

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

/* A hyphenated word that must not break into "e-" and "mail" in a narrow column. */
.nowrap { white-space: nowrap; }

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

/* ---------- Page frame ---------- */

/* A low green strip with a cut edge: the title on one line, the menu below it, both on the symmetry axis
   (about 105 px with the teeth). Wide screens keep it that way, the axis is the character of this direction. */
.site {
  --focus: var(--yellow);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  padding: 0.25rem var(--gutter);
  background: var(--green);
  color: var(--paper);
  text-align: center;
}
/* The strip goes on upward above the page, so a bounce past the top (macOS and iOS scrolling) shows green there
   instead of the page's white. It lies above the document's start, which is never scrollable, so it adds no scrolling. */
.site::before {
  content: "";
  position: absolute;
  inset: auto 0 100%;
  height: 100vh;
  background: var(--green);
}
/* The teeth overlap the strip by 1 px, so no gap shows through on a fractional pixel.
   Their box is a fraction of a pixel lower than the mask (the SVG's empty bottom row), because at a fractional
   position Chrome painted the box's last partial row despite the mask and a pale line showed under the teeth. */
.site::after {
  content: "";
  position: absolute;
  inset: calc(100% - 1px) 0 auto;
  height: 10px;
  background: var(--green);
  -webkit-mask: var(--zigzag-small);
  mask: var(--zigzag-small);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--paper);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  /* the admin's game name has up to 40 characters: on a phone it wraps between the snowflakes */
  overflow-wrap: anywhere;
}
.brand:hover { color: var(--paper); text-decoration: none; }
.brand::before,
.brand::after {
  content: "";
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--paper);
  -webkit-mask: var(--snowflake) center / contain no-repeat;
  mask: var(--snowflake) center / contain no-repeat;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a,
.site-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--paper);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav button:hover { color: var(--paper); text-decoration: underline 2px; text-underline-offset: 0.35em; }
.site-nav a[aria-current="page"] {
  text-decoration: underline 4px var(--yellow);
  text-underline-offset: 0.35em;
}
/* Signing out is a POST, so it is a form whose button looks like the other menu links. */
.site-nav form { margin: 0; }
.site-nav button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font);
  line-height: inherit;
  cursor: pointer;
}

/* Account switcher, only with at least two accounts to switch between: one white frame with segments
   between the title and the menu. The active account is filled white, every other one is a green button. The lines
   between segments are the frame's white background showing through a 2 px gap. With three or more accounts the
   segments wrap inside the frame and stretch over the whole row, so the header grows downwards but never off screen.
   Names are white or green, not yellow, because yellow on green (4.3:1) is too weak for normal text. */
.accounts { margin: 0; }
.accounts-frame {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border: 2px solid var(--paper);
  border-radius: 0.375rem;
  background: var(--paper);
  overflow: hidden;
}
.account {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.25rem 1rem;
  border: 0;
  border-radius: 0;
  background: var(--green);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.account[aria-current] { background: var(--paper); color: var(--green); }
button.account { cursor: pointer; }
button.account:hover { background: var(--green-dark); }
/* The focus ring sits inside the segment, because the rounded frame clips everything that sticks out. */
button.account:focus-visible,
.account-unlink:focus-visible { outline-offset: -5px; }
/* An account linked from another e-mail: an X to unlink in the same segment as the name, no line between them.
   The X has a 44 px touch area and the name loses its right padding, so the segment grows by only about 28 px.
   The X itself is small. */
.account-linked { flex: 1 1 auto; display: flex; }
.account-linked .account { padding-right: 0; }
.account-unlink {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--green);
  color: var(--paper);
  cursor: pointer;
}
/* The name and its X are one segment: the pointer on either lights the whole segment, and on the X a light circle
   behind it also says that this click forgets the account instead of switching to it. */
.account-linked:hover .account,
.account-linked:hover .account-unlink { background: var(--green-dark); }
.account-unlink:hover svg { background: rgb(255 255 255 / 0.22); }
/* content-box: the padding is the circle around the 12 px X, the X keeps its size */
.account-unlink svg {
  box-sizing: content-box;
  width: 0.75rem;
  height: 0.75rem;
  padding: 0.375rem;
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}

.main {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin-inline: auto;
  padding-block: 1.5rem 3rem;
}
.main--wide { width: min(100% - 2 * var(--gutter), var(--column-wide)); }

/* The page title on the symmetry axis, with a small snowflake above it. Running text stays left-aligned. */
.page-title {
  font-size: 1.875rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.page-title::before,
.greeting::before {
  content: "";
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 auto 0.5rem;
  background: var(--red);
  -webkit-mask: var(--snowflake) center / contain no-repeat;
  mask: var(--snowflake) center / contain no-repeat;
}

/* The dashboard greeting with a pencil to change the name in place. The pencil is the <summary> of a <details>,
   so the form opens without JavaScript. A <details> cannot be inside an <h1>, so the greeting frame is a wrapping
   flex row and the <details> has display: contents: the <summary> stands in the row next to the <h1>, and the form
   (flex-basis 100%) falls into a new row below the greeting once opened. Not display: inline, because Firefox draws
   such a <details> like an inline-block (the form next to the name, the pencil gone). Checked in Chromium, WebKit
   and Firefox. The snowflake of this title belongs to the frame, not the <h1>, so it stands on the page axis and
   not above the text alone. Once opened, the name turns into a field on the same line (below, at .rename-form). */
.greeting {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.greeting::before { flex-basis: 100%; }
/* max-width leaves room for the pencil, so with a long name it does not drop alone into a second row: the name
   breaks inside the <h1> instead and the pencil stays next to it. Bottom to bottom (flex-end), so the pencil sits
   at the last line of the name. */
.greeting .page-title { max-width: calc(100% - 3rem); margin: 0; overflow-wrap: anywhere; }
.greeting .page-title::before { content: none; }
.rename { display: contents; }
/* A 44 px touch area, and the vertical margins together leave exactly the title's line height (1.2em), so the pencil
   does not make the row taller. The greeting frame aligns bottom to bottom (flex-end), i.e. to the last line of the
   name, also after it wraps. The bottom margin puts the pencil's centre 0.66em above the bottom of that line: the
   Fira Sans baseline is 0.265em above the line bottom, the middle of the capitals 0.345em above the baseline, plus a
   little more, because a pencil centred exactly on the capitals looked too low (checked at 320, 375 and 1280 px).
   font-size only makes em the title size, the <summary> has no text. The pencil itself is small and thin-lined,
   so it does not weigh the title down. */
.rename > summary {
  position: relative;           /* for the tooltip below */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: calc(0.54em - 1.375rem) 0 calc(0.66em - 1.375rem) 0.25rem; /* left: the circle does not touch the last letter */
  border-radius: 50%;
  font-size: 1.875rem;          /* as .page-title */
  color: var(--green);
  cursor: pointer;
}
.rename > summary:hover { background: var(--green-pale); color: var(--green-dark); }
/* The "Edit name" tooltip without JavaScript, on hover and on keyboard focus. The text comes from aria-label, so it
   exists once. After "/" an empty alternative text, so a screen reader does not read it a second time after the
   button's name. The first declaration is for browsers without that syntax. Below the pencil, aligned to its right
   edge: the pencil always stands right of the name, so the tooltip grows to the left and stays on screen even at
   320 px with a wrapped name. Compromise: title (for readers without CSS and as the browser's hint) also shows the
   system tooltip after a moment. */
.rename > summary::after {
  content: attr(aria-label);
  content: attr(aria-label) / "";
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 1;
  padding: 0.25rem 0.5rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
}
.rename > summary:hover::after,
.rename > summary:focus-visible::after { visibility: visible; }
/* The focus ring inside the touch area, so it does not overlap the last letter of the name. */
.rename > summary:focus-visible { outline-offset: -3px; }
/* No default <summary> triangle: ::marker in Chrome and Firefox (gone with a display other than list-item),
   ::-webkit-details-marker in Safari. Also for "See hints" and the chat on a person's card. */
.rename > summary,
.recipient-hints > summary,
.chat > summary { list-style: none; }
.rename > summary::-webkit-details-marker,
.recipient-hints > summary::-webkit-details-marker,
.chat > summary::-webkit-details-marker { display: none; }
/* 0.6 of the title size, like the pencil inside the <h1> used to be. */
.rename > summary svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The open name editor: the name leaves the view but stays in the <h1> for screen readers, the pencil hides,
   and in their place on the same line stand a field in the title size and small "Save" and "Cancel", which move
   below the field on a narrow screen. :has(), because the name is in the <h1> before the <details>. Compromise: the
   hidden <summary> loses focus, but Tab continues from its place, i.e. to the field. A shared baseline, so the greeting
   and the name in the field stand on one line of type. */
.greeting:has(.rename[open]) { align-items: baseline; column-gap: 0.5rem; }
.greeting:has(.rename[open]) .greeting-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.rename[open] > summary { display: none; }
/* The row item is ::details-content in Chrome and Safari and the form itself in Firefox, so both get the same sizes.
   Separate rules, because an unknown pseudo-element would invalidate the whole selector list. The 10rem basis keeps
   the field on the greeting line even at 320 px, max-width stops it from spreading on a wide screen. */
.rename[open]::details-content { flex: 1 1 10rem; min-width: 0; max-width: 28rem; }
.rename-form {
  display: flex;
  flex: 1 1 10rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
  max-width: 28rem;
}
/* The field looks almost like the title text: the same size and weight, a thin border. With [type] in the selector,
   because the general field rule further down has the same weight. The height with border and padding is about
   46 px, so the 44 px touch target holds. A fixed width, because a field with width: auto reports its default of
   about 20 characters as minimum and the whole would not fit next to the greeting at 320 px. Flex stretches it anyway. */
.rename-form input[type="text"] {
  flex: 1 1 8rem;
  width: 8rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.25rem 0.375rem;
  border-width: 1px;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}
.rename-buttons { display: flex; align-items: center; gap: 0.75rem; }
/* "Cancel" and the other standalone text links ("Enter a different address", the error pages) are plain links,
   but with a 44 px touch area like the buttons (2j, 10). */
.rename-form a,
.cancel a,
a.standalone { display: inline-flex; align-items: center; min-height: 2.75rem; }
.cancel { margin: 0.75rem 0 0; }

.lead { font-size: 1.25rem; }

/* ---------- Sheet: pale paper with a green zigzag strip at the top ---------- */

.panel {
  position: relative;
  margin-block: 2rem;
  padding: 1.75rem 1.25rem 1.5rem;
  border-top: 6px solid var(--green);
  background: var(--green-pale);
}
.panel::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 10px;                 /* lower than the mask, for the same reason as the header teeth */
  background: var(--green);
  -webkit-mask: var(--zigzag-small);
  mask: var(--zigzag-small);
}
.panel > :last-child { margin-bottom: 0; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.375rem;
  border: 2px solid var(--green);
  border-radius: 0.375rem;
  background: var(--paper);
  color: var(--green);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--green-pale); color: var(--green-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { border-color: var(--red); background: var(--red); color: var(--paper); }
.btn-primary:hover { border-color: var(--red-dark); background: var(--red-dark); color: var(--paper); }

.btn-small { min-height: 2.75rem; padding: 0.375rem 1rem; font-size: 1rem; }

/* "Remove" looks different from "Edit", so nobody hits it by accident. */
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--red);
  text-decoration: underline 2px;
  text-underline-offset: 0.2em;
}
.btn-quiet:hover { background: transparent; color: var(--red-dark); }

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

/* On a phone the main buttons take the full width: easier to hit with a thumb. From 36rem they shrink to their content. */
.form .btn,
.actions .btn,
.recipient-hints > summary,
.chat > summary,
.admin-actions > *,
.admin-actions .btn,
.alert .btn,
.mode .btn,
.new-edition .btn,
.draw .btn-secondary,
.confirm .btn { width: 100%; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 0.375rem; }

label, legend { font-weight: 700; font-size: 1.0625rem; }
.optional { font-weight: 400; color: var(--ink-light); }

input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 3.25rem;
  margin-bottom: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--ink-light);
  border-radius: 0.375rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; min-height: 6rem; }
/* the language and the gift date: as wide as their content, not the whole column */
select,
input[type="date"] { width: auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; border-color: var(--ink); }
/* A disabled field is dimmed like a locked mode, but its value stays readable (6.1:1 on pale green).
   Without opacity and text-fill-color Safari on iOS lightens it beyond that. */
input:disabled {
  background: var(--green-pale);
  color: var(--ink-light);
  -webkit-text-fill-color: var(--ink-light);
  opacity: 1;
  cursor: not-allowed;
}

.form .btn { margin-top: 0.5rem; }

.help { font-size: 0.9375rem; color: var(--ink-light); margin: 0.25rem 0 0; }
/* A field's help stands between the label and the field, so it keeps close to the label. */
.form .help { margin: -0.25rem 0 0.125rem; }
/* A heading that is also the label of the first field (h2 > label, h1 > label on the edit page): it looks like the
   heading, not like a label. */
h1 > label,
h2 > label { font-size: inherit; }

/* A message: a yellow note. */
.notice {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--yellow);
  color: var(--ink);
}
.notice p { margin: 0; }
.notice .notice-main { font-weight: 700; font-size: 1.1875rem; margin-bottom: 0.25rem; }
/* alone (somebody who sits out, on the dashboard) it sits in the middle of the box */
.notice .notice-main:last-child { margin-bottom: 0; }
.notice .actions { margin-top: 1rem; }

/* The admin's text for participants at the end of the dashboard: white paper in a green frame with a second,
   thin line inside, like a cut-out label, and a diamond on the axis at the top. No heading. The text is left-aligned
   like any running text. A long link breaks anywhere, so it does not widen the page at 320 px. */
.info {
  position: relative;
  margin-top: 2.5rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border: 3px solid var(--green);
  background: var(--paper);
  overflow-wrap: anywhere;
}
.info::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--green);
  pointer-events: none;
}
.info::after {
  content: "";
  position: absolute;
  top: -0.5625rem;              /* the diamond's centre on the centre of the thick frame */
  left: calc(50% - 0.5rem);
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--green);
  background: var(--paper);
  transform: rotate(45deg);
}
.info p { margin: 0 0 0.75rem; }
.info p:last-child { margin-bottom: 0; }

/* ---------- 1. Sign in ---------- */

.landing .panel { max-width: 32rem; margin-inline: auto; }

/* ---------- 2 and 4. Dashboard ---------- */

/* The chosen person: a red sheet with two white snowflakes in the corners, symmetric. */
.recipient {
  --focus: var(--paper);
  position: relative;
  overflow: hidden;
  padding-top: 3rem;            /* room for the snowflakes above the heading, see ::before below */
  border-top: 0;
  background: var(--red);
  color: var(--paper);
  text-align: center;
}
/* Size and offset outside the card as variables, so a wider screen changes them in one place for both corners.
   The snowflake's centre stays inside the card, and its arms end at least 4 px before the letters of the heading
   and the name (checked on pixels at 320, 375, 600 and 1280 px). On a phone the heading takes almost the whole
   width at 375 px, so the card has a higher top padding there: without it the snowflake would have to be smaller
   than the old thin one, and white letters on it fall below 4.5:1. */
.recipient::before {
  --corner: 7.5rem;
  --corner-x: -3rem;
  --corner-y: -3.25rem;
  height: auto;
  inset: 0;
  background: var(--paper);
  opacity: 0.22;
  -webkit-mask: var(--snowflake-bold) var(--corner-x) var(--corner-y) / var(--corner) no-repeat,
    var(--snowflake-bold) calc(100% - var(--corner-x)) var(--corner-y) / var(--corner) no-repeat;
  mask: var(--snowflake-bold) var(--corner-x) var(--corner-y) / var(--corner) no-repeat,
    var(--snowflake-bold) calc(100% - var(--corner-x)) var(--corner-y) / var(--corner) no-repeat;
}
/* The card's content above the snowflakes, which are an absolutely positioned ::before. */
.recipient > * { position: relative; }
.recipient h2 { font-size: 1.25rem; font-weight: 400; }
.recipient-name {
  margin: 0 0 1.25rem;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.recipient .actions { justify-content: center; }
/* On the red sheet the buttons invert their colours. The empty state (below) keeps the normal ones. */
.recipient:not(.recipient--empty) .btn-primary { border-color: var(--paper); background: var(--paper); color: var(--red); }
.recipient:not(.recipient--empty) .btn-primary:hover { background: var(--green-pale); color: var(--red-dark); }
.recipient:not(.recipient--empty) .btn-secondary { border-color: var(--paper); background: transparent; color: var(--paper); }
.recipient:not(.recipient--empty) .btn-secondary:hover { background: var(--red-dark); }

/* Nobody yet: an empty place outlined with a cutting line. */
.recipient--empty {
  --focus: var(--ink);
  padding-top: 1.75rem;         /* no snowflakes, so the sheet's normal padding */
  border: 3px dashed var(--green);
  background: var(--paper);
  color: var(--ink);
}
.recipient--empty::before { content: none; }

/* The admin's gift date, a line of its own between the cards and the admin's text. */

/* Several people to gift: one heading above the cards and smaller gaps than with a single card,
   so both cards stay close together on a phone. */
.recipients { margin-block: 2rem; }
.recipients h2 { text-align: center; }
.recipient-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
/* The result sheets of several people (draw mode, or right after "Draw a name") keep the list's 1rem gap like the cards,
   the sheet's own margins leave room for its teeth. */
.recipient-list .panel,
.recipient-list .drawn { margin: 0; }
.recipient-list .recipient--empty { padding-block: 1.25rem; }

/* The state after a hint request instead of the request button, always at the end of the card, so no bottom
   margin. The tick inline with the text, so it does not stick out to the left edge with centred text on two lines. */
.recipient .reminder-sent {
  display: block;
  color: var(--paper);
  text-wrap: balance;
}
.recipient .reminder-sent::before { display: inline-block; margin: 0 0.75rem 0 0.25rem; vertical-align: 0.15em; }

/* A short line right above a button, smaller than text, not a heading: above every hint request (card and 4b),
   above "Change your choice" and "Draw again" during the change window and above "Draw a name" on the
   choose list (3). */
.action-lead { margin-bottom: 0.5rem; font-size: 1rem; text-wrap: balance; }
/* The change during its window, below the hints and the hint request (owner 2026-11-30): a separate matter. */
.card-change { margin-top: 1.5rem; }
/* A waiting change request's "Cancel request", then the change on the list once somebody got free (choose mode):
   two separate choices, so the second lead keeps its distance from the first buttons. */
.actions + .action-lead { margin-top: 1.5rem; }
/* The chat's helper text is full sentences, so normal wrapping without balancing the line lengths
   ("balance" broke the longer sentence in the middle). "pretty" only avoids a single word on the last line. */
.chat-intro { margin: 0 0 0.5rem; font-size: 1rem; text-wrap: pretty; }

/* Hints and Secret Santa Czat open in place on the card through <details>, without JavaScript.
   The <summary> looks like a button, and an arrow made of two border lines turns when open, so the state does not
   depend on colour alone. Full width on a phone like the card's other buttons.
   Narrower sides than a normal button, so "See hints (3)", longer in Polish, with the arrow fits on one line on a card at
   320 px. A non-breaking space before the number in the HTML, so the number never wraps alone. */
.recipient-hints > summary,
.chat > summary { padding-inline: 1rem; }
.recipient-hints > summary::after,
.chat > summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 0.75rem;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.recipient-hints[open] > summary::after,
.chat[open] > summary::after { margin-top: 0.25rem; transform: rotate(-135deg); }
.recipient-hints > :last-child { margin-bottom: 0; }

/* Secret Santa Czat: the same button as "See hints", below it a white note like the hint list.
   Messages without avatars or bubbles: the author above the text, own messages indented from the left on pale green,
   the others without background, so they differ by position and background, not by colour alone. */
.chat { margin-top: 0.75rem; }
.chat-box {
  --focus: var(--ink);
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}
.chat-messages { display: grid; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.chat-messages li { margin-right: 2rem; padding: 0.375rem 0.625rem; }
.chat-messages p { margin: 0; }
.chat-messages .chat-own { margin: 0 0 0 2rem; background: var(--green-pale); }
.chat-who { font-size: 0.9375rem; font-weight: 700; color: var(--ink-light); }
.chat-form { display: grid; justify-items: end; gap: 0.5rem; }
.chat-form textarea { min-height: 4rem; margin: 0; }
/* A chat nobody wrote in yet has no list: the form keeps the list's distance from the text above. */
.chat-intro + .chat-form { margin-top: 1rem; }
/* A pasted shop address or a long word is often wider than a phone screen: break it anywhere, like in the hints. */
.chat-messages li { overflow-wrap: anywhere; }
/* On the white note a normal secondary button, not the white outline of the red card (it would be invisible). */
.recipient .chat-box .btn-secondary { border-color: var(--green); background: var(--paper); color: var(--green); }
.recipient .chat-box .btn-secondary:hover { background: var(--green-pale); color: var(--green-dark); }
/* The list on a white note inside the red sheet, so it looks as on a white page: red diamonds, grey description,
   green links. On red the green of the links would be unreadable. */
.recipient .hints {
  --focus: var(--ink);
  margin-block: 1.25rem;
  padding: 1rem;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

/* ---------- 3. Choose list ---------- */

/* The choose list is names and "Choose" only, the button next to the name also on a phone.
   Hints show only on the dashboard, after the change window. */
/* "Prefer to leave it to chance?" and "Draw a name" above the list, on the page axis like the title. */
.draw-instead { text-align: center; }
.draw-instead .actions { justify-content: center; }

.candidates { margin: 2rem 0 0; padding: 0; list-style: none; }
.candidate {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding-block: 1rem;
  border-bottom: 2px solid var(--green-pale);
}
.candidate:first-child { border-top: 2px solid var(--green-pale); }
.candidate form { margin: 0; }
/* Flex, so the paragraph's line adds no space under the ribbon (inline-block). */
.candidate-who { display: flex; margin: 0; }

/* The name on a green ribbon with a swallowtail cut at the end. */
.ribbon {
  display: inline-block;
  margin: 0;
  padding: 0.375rem 2rem 0.375rem 0.875rem;
  background: var(--green);
  color: var(--paper);
  font-size: 1.25rem;           /* "Babcia Hela" fits next to "Choose" at 320 px */
  font-weight: 700;
  line-height: 1.2;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.875rem) 50%, 100% 100%, 0 100%);
}

.hints { margin: 0 0 1.25rem; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
.hints li { position: relative; padding-left: 1.5rem; }
.hints li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.5em;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--red);
  transform: rotate(45deg);
}
.hint-name { margin: 0; font-weight: 700; }
.hint-desc { margin: 0; color: var(--ink-light); }
/* A pasted shop address is often longer than a phone screen: break it anywhere. */
.hint-desc a { overflow-wrap: anywhere; }

/* A tick made of two border lines, so the state does not depend on colour alone.
   At the first line, not in the middle, because the state on the yellow sheet wraps on a narrow screen.
   On a person's card the tick sits differently, see .recipient .reminder-sent above. */
.reminder-sent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: var(--green);
  font-weight: 700;
}
.reminder-sent::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.95rem;
  margin: 0.3125rem 0.25rem 0 0.25rem;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* ---------- 4b and 2m. The result on the dashboard ---------- */

.drawn { margin-block: 1.5rem 2.5rem; text-align: center; }
.drawn .actions { justify-content: center; }
/* The sent state under a result sheet stays on the axis like the rest of it (on the red card see .recipient). */
.drawn .reminder-sent { justify-content: center; }
/* The hints under a result sheet are running text, left-aligned like the list on the card. */
.drawn .hints { margin-block: 1.25rem; text-align: left; }

/* The result: a red sheet with teeth at the top and bottom, a snowflake above the name. */
.reveal {
  position: relative;
  width: min(100%, 26rem);
  margin: 1.75rem auto 2.25rem;
  padding: 1.5rem 1.25rem 1.75rem;
  background: var(--red);
  color: var(--paper);
}
.reveal::before,
.reveal::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;                 /* one empty mask row lower, for the same reason as the header teeth */
  background: var(--red);
  -webkit-mask: var(--zigzag);
  mask: var(--zigzag);
}
.reveal::before { bottom: calc(100% - 1px); transform: scaleY(-1); }
.reveal::after { top: calc(100% - 1px); }
.reveal-name {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.reveal-name::before {
  content: "";
  display: block;
  width: 5rem;
  height: 5rem;
  margin: 0 auto 0.875rem;
  background: var(--paper);
  -webkit-mask: var(--snowflake-bold) center / contain no-repeat;
  mask: var(--snowflake-bold) center / contain no-repeat;
}

/* The only motion on the site: the sheet unfolds from the fold line, then the name appears.
   The end state is the default, so with prefers-reduced-motion everything is visible at once. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: unfold 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
  .reveal-name { animation: appear 0.5s ease-out 1s both; }
  .reveal-name::before { animation: turn 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
}
@keyframes unfold {
  from { clip-path: inset(-20px 50% -20px 50%); }
  to { clip-path: inset(-20px 0 -20px 0); }
}
@keyframes appear {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}
@keyframes turn {
  from { transform: rotate(-90deg) scale(0.6); }
  to { transform: none; }
}

/* ---------- 5. My hints ---------- */

.hint-list { margin: 2rem 0 0; padding: 0; list-style: none; }
.hint-item {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.125rem;
  border-bottom: 2px solid var(--green-pale);
}
.hint-item:first-child { border-top: 2px solid var(--green-pale); }
.hint-item .hint-name { font-size: 1.1875rem; }
.hint-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hint-actions form { margin: 0; }

/* ---------- 6 and 7. Admin panel ---------- */

.counter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}
.counter-text { font-size: 1.5rem; font-weight: 700; }
/* One diamond per taking part person, filled for a complete choice (11 and 6 on 6a). A Razor loop with class "on". */
.pearls { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-inline: 0.125rem; }
.pearls i {
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--green);
  transform: rotate(45deg);
}
.pearls i.on { background: var(--green); }

/* A warning: a yellow sheet instead of the green one. */
.alert { border-top-color: var(--ink); background: var(--yellow); }
.alert::before { background: var(--ink); }
/* On yellow the ink colour (9.2:1), because green has only 4.3:1 there. */
.alert .reminder-sent { color: var(--ink); }

/* Before the draw: the state and the "Draw names" button at the top of the panel, on the green sheet. */
.draw-state { font-size: 1.25rem; font-weight: 700; }
.draw-start .btn { font-size: 1.25rem; font-weight: 700; }

.admin > .notice { margin-bottom: 2rem; }
/* The change request counts (owner 2026-11-30): normal text in a quiet box, not a heading like the choice counter. */
.change-requests { margin: 0 0 1.5rem; padding: 0.75rem 1rem; border: 1px solid var(--green); font-size: 1rem; }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}
.admin-actions form { margin: 0; }

.section-title { font-size: 1.375rem; }

/* The people table. On phones and tablets every row is a block with a green bar on the left: name and e-mail at the
   top, short values in a row, actions at the bottom. The table header is hidden only visually, the ARIA roles in the
   HTML keep the table semantics in Safari despite the changed display. From 64rem a normal table (see below). */
.people { display: block; width: 100%; border-collapse: collapse; margin-bottom: 3rem; }
.people thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.people tbody { display: grid; gap: 1rem; }
.people tr {
  display: grid;
  /* Short values next to each other, as many as fit: the "Hints" caption needs about 5rem,
     so the narrowest phones get two columns instead of three. */
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem 0.75rem;
  padding: 1rem 1rem 1rem 1.125rem;
  border-left: 6px solid var(--green);
  background: var(--green-pale);
}
.people th, .people td { text-align: left; vertical-align: middle; }
.people tbody th { grid-column: 1 / -1; font-size: 1.25rem; line-height: 1.2; font-weight: 700; }
.people .email { grid-column: 1 / -1; margin-top: -0.375rem; overflow-wrap: anywhere; }
.people td:not(.email)[data-label]::before {
  content: attr(data-label);
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-light);
}
/* A person who does not take part: the row's text dimmed (6.1:1 on pale green), the yes/no colours stay.
   On a phone their empty choice cell disappears together with its caption. */
.people .person-out th,
.people .person-out td { color: var(--ink-light); }
.people td:empty { display: none; }
.people .row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.people .row-actions form { margin: 0; }
/* The last visit and the people excluded with this person: a whole line each with the caption in front,
   "Ostatnio: 26 listopada", "Wykluczenia: Tomek, Zosia". An empty exclusions cell disappears with the rule
   above. On a wide screen normal columns, the caption goes (content: none). */
.people :is(.last-seen, .exclusions) { grid-column: 1 / -1; }
.people td:is(.last-seen, .exclusions)[data-label]::before { display: inline; content: attr(data-label) ": "; }
/* The "admin" marker after the name: a small green frame like a label, in line with the name. The colour stays in the
   dimmed row of a person who does not take part (green on pale green 6.2:1). */
.people .role {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0 0.375rem;
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: 0.1em;
}

.yes, .no, .part { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.yes::before, .no::before, .part::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}
.yes { color: var(--green); }
.yes::before { background: currentColor; }
.no { color: var(--red); }
/* Part of a choice ("1/2" when the number of people to gift is above 1): a half-filled diamond.
   The diagonal before the 45° turn becomes a vertical line after it, so the left half is filled. */
.part { color: var(--green); }
.part::before { background: linear-gradient(to bottom left, transparent 50%, currentColor 50%); }

.settings { margin-top: 1rem; }
fieldset { margin: 0; padding: 0; border: 0; }
/* The person form's exclusions (owner 2026-11-30): a row per other person, one radio group across four columns.
   The name takes the rest of the width, each column a 40 px wide tap target, so the heading with its sign fits in
   one line at 320 px. At most 26rem wide, so on a wide screen the choices stay close to the names. Every other row
   lightly tinted (owner 2026-11-30), so a row is easy to follow from the name to its choice. */
.exclusion-grid { width: 100%; max-width: 26rem; margin-top: 0.5rem; border-collapse: collapse; }
.exclusion-grid th,
.exclusion-grid td { padding: 0; text-align: center; }
.exclusion-grid tbody th { width: 100%; padding: 0 0.5rem; text-align: left; font-weight: 700; overflow-wrap: anywhere; }
.exclusion-grid tbody tr:nth-child(odd) { background: rgb(23 102 63 / 0.08); }
/* a chosen exclusion in red, like the sign by the heading (owner 2026-11-30), "none" stays green. Locked, dimmed. */
.exclusion-grid input[type="radio"]:checked:not([value=""]) {
  border-color: var(--red);
  background: radial-gradient(circle, var(--red) 0 0.3rem, var(--paper) 0.35rem);
}
fieldset:disabled .exclusion-grid input[type="radio"]:checked:not([value=""]) { opacity: 0.6; }
.exclusion-grid .ex-heading { text-align: left; font-size: 1rem; font-weight: 700; white-space: nowrap; }
/* the prohibition sign before the heading, red like a sign */
.ex-no { display: inline-block; margin-right: 0.3125rem; color: var(--red); vertical-align: -0.2em; }
.ex-no svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.ex-cell { display: flex; align-items: center; justify-content: center; width: 2.5rem; min-height: 2.75rem; cursor: pointer; }
fieldset:disabled .ex-cell { cursor: not-allowed; }
/* The column heads: an icon (or "none") whose tooltip shows on hover and on a tap, which focuses it. The tooltip is
   a bar right under the header row across the whole table, so it never runs off a phone's edge. */
.exclusion-grid thead { position: relative; }
.ex-tip { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.75rem; color: var(--green); cursor: help; }
.ex-tip svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ex-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  display: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 400;
  text-align: left;
}
.ex-tip:is(:hover, :focus)::after { display: block; }
fieldset:disabled .ex-tip { color: var(--ink-light); }
/* without the browser's 2 px inline padding, so a legend lines up with the labels above and beside it */
legend { padding: 0; }
/* The mode options, and the same for checkboxes: the exclusions on the person form, the option in the settings. */
.mode-options,
.check-options { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 0.5rem; }
.mode-option,
.check-option {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-weight: 700;
}
/* A custom look, because Chrome's built-in disabled radio does not tell checked from empty. */
input[type="radio"] {
  appearance: none;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--paper);
}
input[type="radio"]:checked { background: radial-gradient(circle, var(--green) 0 0.3rem, var(--paper) 0.35rem); }
/* A locked switch stays readable: the controls are dimmed, but the checked one still shows. */
fieldset:disabled .mode-option,
.check-option:has(:disabled) { color: var(--ink-light); cursor: not-allowed; }
fieldset:disabled input[type="radio"] { border-color: var(--ink-light); }
fieldset:disabled input[type="radio"]:checked { background: radial-gradient(circle, var(--ink-light) 0 0.3rem, var(--paper) 0.35rem); }
.help--lock { font-size: 1rem; }
/* The browser's own checkbox in the radio's size and green. Disabled (a locked option, the configured admin's "Admin")
   Chrome greys it out, but unlike its radio a checked box still shows its tick. */
input[type="checkbox"] { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--green); }
.mode .btn { margin-top: 1rem; }

/* The mode, the number of people to gift and the change window (choose mode only) side by side,
   and below each other when they do not fit (phone). */
.settings-fields { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.number-field label { display: block; }
/* A field for a few digits. 44 px high like the mode options next to it, so the fields line up with the switch. */
.number-field input {
  width: 5.5rem;
  min-height: 2.75rem;
  margin: 0.5rem 0 0;
  padding-block: 0.25rem;
}

.new-edition { margin-top: 2rem; }
/* The game's name and the text for participants below the short settings, the width of the form column but no wider
   than a comfortable line. Each field has the layout of the hint form (5). */
.settings-text { display: grid; gap: 1rem; max-width: 36rem; margin-top: 1.5rem; }
.settings-text textarea { min-height: 14rem; }      /* a few short paragraphs without scrolling, also at 320 px */

/* ---------- 7b. Draw confirmation ---------- */

.draw { text-align: center; }
.draw p { margin-inline: auto; max-width: 30rem; }

/* The "Draw names" button is the centre of a big green snowflake: its arms reach out from under the red circle. */
.draw-form {
  position: relative;
  display: grid;
  place-items: center;
  width: 18rem;                 /* at 320 px max-width leaves 288 px, the same */
  max-width: 100%;
  aspect-ratio: 1;
  margin: 1.25rem auto 1rem;
}
.draw-form::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green);
  -webkit-mask: var(--snowflake-bold) center / contain no-repeat;
  mask: var(--snowflake-bold) center / contain no-repeat;
}
.btn-draw {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
  font-size: 1.75rem;
  font-weight: 700;
}
.btn-draw:hover { background: var(--red-dark); color: var(--paper); }
/* Focus on the green snowflake: a yellow ring with a dark outline, visible on each of the colours. */
.btn-draw:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 0;
  box-shadow: 0 0 0 9px var(--ink);
}

/* ---------- 10. Hint request confirmation, also the error pages ---------- */

/* Short pages on the symmetry axis, like the draw confirmation. */
.confirm { text-align: center; }
.confirm p { text-wrap: balance; }
.confirm form { margin-top: 1.5rem; }

/* ---------- Wider screens ---------- */

@media (min-width: 36rem) {
  .form .btn,
  .actions .btn,
  .recipient-hints > summary,
  .chat > summary,
  .admin-actions > *,
  .admin-actions .btn,
  .alert .btn,
  .mode .btn,
  .new-edition .btn,
  .draw .btn-secondary,
  .confirm .btn { width: auto; }
  .admin-actions form { max-width: 24rem; }
  .draw .btn-secondary { min-width: 11rem; }

  .brand { font-size: 1.125rem; gap: 0.625rem; }
  .brand::before, .brand::after { width: 1.375rem; height: 1.375rem; }
  .site-nav ul { gap: 0 1.5rem; }
  .site-nav a,
  .site-nav button { font-size: 1.0625rem; }

  .main { padding-top: 2rem; }
  .page-title { font-size: 2.5rem; }
  .page-title::before,
  .greeting::before { width: 2.25rem; height: 2.25rem; margin-bottom: 0.75rem; }
  .rename > summary { font-size: 2.5rem; }
  .rename > summary svg { width: 1.5rem; height: 1.5rem; }
  .rename-form input[type="text"] { font-size: 2.5rem; }
  h2 { font-size: 1.4375rem; }
  .recipient-name { font-size: 3.25rem; }
  .panel { padding: 2.25rem 2.25rem 2rem; }
  .recipient::before { --corner: 10rem; --corner-x: -3.5rem; --corner-y: -3.5rem; }
  .draw-form { width: 20rem; margin-top: 1.5rem; }
  .btn-draw { width: 9.5rem; height: 9.5rem; font-size: 1.875rem; }
}

/* The table layout's header cells and column widths. The block layout hides the header, so they only show in the
   table below. A fixed layout and widths in whole pixels (rem * 16): with the automatic layout the column borders fell
   on fractional pixels and Chrome drew light vertical lines on them. The e-mail column takes the rest. Widths by
   class, because draw mode has no "Choice" column and "Exclusions" is not always there. */
.people thead th {
  padding: 0.75rem 0.75rem 0.75rem 0;
  background: var(--green);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 700;
}
.people thead th:first-child { padding-left: 0.75rem; }
/* The short columns are only a few pixels wider than their bold captions, measured in Chromium with Fira Sans
   (Polish captions: Takes part 46 px, Hints 94 px, Invited 88 px, Chosen 47 px, plus the 12 px padding). A caption a pixel wider
   in another browser only narrows the gap to the next column. "Last seen" fits this year's longest day,
   30 October in Polish (120 px), on one line, an earlier year goes to a second line. The name column keeps "Admin" with
   its marker (139 px) on one line, the actions "Edit" and "Send link" (212 px). Longer names wrap, also in
   "Exclusions". The e-mail column then gets 160 px at 1024 px (choose mode without exclusions), enough for
   "ala@example.com" (142 px), and at 74rem 184 px with "Exclusions" and "Choice", 244 px in draw mode. A longer
   address wraps onto a second line. */
.people .col-name { width: 9rem; }
.people .col-num { width: 7rem; }
.people .col-part { width: 3.75rem; }
.people .col-invite { width: 6.5rem; }
.people .col-choice { width: 3.75rem; }
.people .col-last-seen { width: 8.5rem; }
.people .col-actions { width: 13.5rem; }
.people .col-exclusions { width: 8.5rem; }

/* A normal table from 64rem, as in the mockup. With the "Exclusions" column (.people--wide) only from 74rem, where
   the wide column has its full 72rem: at 64rem the e-mail would get about 100 px, in choose mode almost nothing.
   The two blocks hold the same rules, one per breakpoint (a media query cannot depend on a class), keep them equal. */
@media (min-width: 64rem) {
  .people:not(.people--wide) { display: table; table-layout: fixed; font-size: 1.0625rem; }
  .people:not(.people--wide) thead { position: static; display: table-header-group; width: auto; height: auto; overflow: visible; clip: auto; }
  .people:not(.people--wide) tbody { display: table-row-group; }
  .people:not(.people--wide) tr { display: table-row; padding: 0; border-left: 0; background: none; }
  .people:not(.people--wide) tbody tr { border-bottom: 2px solid var(--green-pale); }
  .people:not(.people--wide) tbody tr:nth-child(even) { background: var(--green-pale); }
  .people:not(.people--wide) :is(tbody th, td) { padding: 0.625rem 0.75rem 0.625rem 0; }
  .people:not(.people--wide) tbody th { padding-left: 0.75rem; font-size: inherit; line-height: inherit; }
  .people:not(.people--wide) .email { margin-top: 0; }
  .people:not(.people--wide) td:not(.email)[data-label]::before { content: none; }
  .people:not(.people--wide) td:empty { display: table-cell; }
  .people:not(.people--wide) .num { text-align: right; padding-right: 2rem; }
  .people:not(.people--wide) .row-actions { display: table-cell; margin-top: 0; text-align: right; white-space: nowrap; }
  .people:not(.people--wide) .row-actions form { display: inline-block; margin-left: 0.5rem; }
}

@media (min-width: 74rem) {
  .people--wide { display: table; table-layout: fixed; font-size: 1.0625rem; }
  .people--wide thead { position: static; display: table-header-group; width: auto; height: auto; overflow: visible; clip: auto; }
  .people--wide tbody { display: table-row-group; }
  .people--wide tr { display: table-row; padding: 0; border-left: 0; background: none; }
  .people--wide tbody tr { border-bottom: 2px solid var(--green-pale); }
  .people--wide tbody tr:nth-child(even) { background: var(--green-pale); }
  .people--wide :is(tbody th, td) { padding: 0.625rem 0.75rem 0.625rem 0; }
  .people--wide tbody th { padding-left: 0.75rem; font-size: inherit; line-height: inherit; }
  .people--wide .email { margin-top: 0; }
  .people--wide td:not(.email)[data-label]::before { content: none; }
  .people--wide td:empty { display: table-cell; }
  .people--wide .num { text-align: right; padding-right: 2rem; }
  .people--wide .row-actions { display: table-cell; margin-top: 0; text-align: right; white-space: nowrap; }
  .people--wide .row-actions form { display: inline-block; margin-left: 0.5rem; }
}
