/* Lustball Manager — Mini App styles.
   In the game it is always summer. There are two palettes, a day one and an evening one, and five
   skies over the club that follow the player's own clock: public/theme.js writes `data-theme` and
   `data-sky` on <html> before the first paint.
   Four colours carry meaning everywhere: coral is the next step, sea green is form and play,
   pink is chemistry and anything that needs attention, gold is coins and everything paid for with Stars. */

:root {
  --radius: 16px;

  /* Day: warm paper under a summer sun. Also what a browser without scripts gets. */
  color-scheme: light;
  --bg: #fff6ea;
  --text: #2d2142;
  --hint: #8c7b93;
  --card: #fffdf8;
  --button: #f2664a;
  --button-text: #2d2142;
  --pitch: #1e9e8f;
  --heat: #e8457a;
  --gold: #f5a623;
  --on-gold: #3a2500;
  --on-heat: #3b0a20;
  --brand-sub: #b3264f;
  /* The board under the logo on the page outside Telegram: the logo's letters are dark in both palettes. */
  --sign: #fffaf3;
  --avatar-text: #ffffff;
  --card-shadow: 0 1px 0 rgb(45 33 66 / 6%), 0 12px 24px -18px rgb(242 102 74 / 55%);
  --line: color-mix(in srgb, var(--text) 9%, transparent);
  /* A photo on the whole screen is dark in both palettes, as in a messenger. */
  --viewer-bg: rgb(16 12 26 / 92%);
  --viewer-button: rgb(255 255 255 / 16%);
  --viewer-text: #ffffff;

  /* The sky at the golden hour: the sun on its way down to the sea. */
  --sky-top: #ffbf86;
  --sky-mid: #ffa79b;
  --sky-low: #ffd7ad;
  --orb: #fff3bf;
  /* The middle of the sun or the moon; only the moon's differs (night). */
  --orb-core: var(--orb);
  --orb-halo: rgb(255 243 191 / 50%);
  --orb-x: 51%;
  --orb-y: 64%;
  --sea: #1e9e8f;
  --sea-line: #63c9bb;
  --sky-extra: linear-gradient(transparent, transparent);
}

/* Evening: the same club after sunset. */
:root[data-theme="dusk"] {
  color-scheme: dark;
  --bg: #1f1830;
  --text: #fbeedd;
  --hint: #b3a2bf;
  --card: #2b2242;
  --button: #ff7f5e;
  --button-text: #2a1020;
  --pitch: #3cc2b0;
  --heat: #ff6f9c;
  --gold: #ffc45c;
  --brand-sub: #ffb3c7;
  --sign: #fff3e2;
  --avatar-text: #2a1020;
  --card-shadow: none;
  --viewer-bg: rgb(10 7 18 / 94%);
  --viewer-button: rgb(255 255 255 / 16%);
  --viewer-text: #ffffff;
}

/* Sunrise: the sun is half out of the sea, the sky still pale. */
:root[data-sky="morning"] {
  --sky-top: #a9d9ec;
  --sky-mid: #ffd9c9;
  --sky-low: #fff1dc;
  --orb: #fff8d9;
  --orb-halo: rgb(255 248 217 / 60%);
  --orb-y: calc(100% - 13px);
  --sea: #2aa7a0;
  --sea-line: #86d6cb;
}

/* Midday: a high sun in a clear sky. */
:root[data-sky="noon"] {
  --sky-top: #63bdf0;
  --sky-mid: #a3dcf7;
  --sky-low: #f3f6e4;
  --orb: #fffbe6;
  --orb-halo: rgb(255 251 230 / 55%);
  --orb-y: 50%;
  --sea: #1792a6;
  --sea-line: #6fd0de;
}

/* Just after sunset: the last of the sun on the water. */
:root[data-sky="dusk"] {
  --sky-top: #2a2145;
  --sky-mid: #5b2e63;
  --sky-low: #d7646c;
  --orb: #ffd28a;
  --orb-halo: rgb(255 190 120 / 40%);
  --orb-y: calc(100% - 13px);
  --sea: #14575a;
  --sea-line: #2f8f88;
  /* The first small stars high up, where the sky is already dark (the owner's request, 30.11.2026). */
  --sky-extra:
    radial-gradient(circle at 9% 16%, rgb(255 246 230 / 90%) 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 31% 7%, rgb(255 246 230 / 75%) 0 0.8px, transparent 1.5px),
    radial-gradient(circle at 47% 13%, rgb(255 246 230 / 60%) 0 0.7px, transparent 1.4px);
}

/* Night: the moon with a yellow middle and stars with yellow middles (the owner's request, 30.11.2026). */
:root[data-sky="night"] {
  --sky-top: #141a3a;
  --sky-mid: #232a5c;
  --sky-low: #3b2f6b;
  --orb: #fdf6e3;
  --orb-core: #ffd45e;
  --orb-halo: rgb(253 246 227 / 20%);
  --orb-y: 52%;
  --sea: #0f3a4a;
  --sea-line: #1f6677;
  --sky-extra:
    radial-gradient(circle at 52% 22%, #ffdf70 0 0.9px, rgb(255 250 235 / 80%) 1.5px, transparent 2.6px),
    radial-gradient(circle at 70% 31%, #ffdf70 0 0.8px, rgb(255 250 235 / 75%) 1.3px, transparent 2.3px),
    radial-gradient(circle at 93% 68%, #ffdf70 0 0.9px, rgb(255 250 235 / 80%) 1.5px, transparent 2.6px),
    radial-gradient(circle at 64% 55%, #ffdf70 0 0.7px, rgb(255 250 235 / 60%) 1.2px, transparent 2.1px),
    radial-gradient(circle at 97% 22%, #ffdf70 0 0.7px, rgb(255 250 235 / 60%) 1.2px, transparent 2.1px),
    radial-gradient(circle at 12% 10%, #ffdf70 0 0.9px, rgb(255 250 235 / 80%) 1.5px, transparent 2.6px),
    radial-gradient(circle at 36% 6%, #ffdf70 0 0.7px, rgb(255 250 235 / 60%) 1.2px, transparent 2.1px),
    radial-gradient(circle at 22% 74%, #ffdf70 0 0.8px, rgb(255 250 235 / 70%) 1.3px, transparent 2.3px),
    radial-gradient(circle at 84% 80%, #ffdf70 0 0.7px, rgb(255 250 235 / 60%) 1.2px, transparent 2.1px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}

/* Room for the tab bar. */
body.has-tabs .app {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.status {
  color: var(--hint);
  text-align: center;
  margin: 2rem 0;
}

/* Read by screen readers, not shown. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Wordmark: tight, heavy, slightly italic — a matchday programme masthead. */
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-transform: uppercase;
  font-style: italic;
  line-height: 1;
}

.wordmark-main {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.wordmark-sub {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--brand-sub);
}

/* In the header the two words stand one over the other and leave the sky to the sun. */
.wordmark.stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.wordmark.stack .wordmark-main {
  font-size: 1.55rem;
}

.wordmark.stack .wordmark-sub {
  font-size: 0.6rem;
  letter-spacing: 0.32em;
}

/* The sky over the club, drawn flat like a painted background: the sea, a sun or a moon, the sky.
   One line: the masthead, the coins and the look, with the sun or the moon between them. */
.top {
  margin: -20px -16px 14px;
  padding: 14px 16px 26px;
  border-radius: 0 0 26px 26px;
  background:
    linear-gradient(to top, var(--sea) 0 10px, var(--sea-line) 10px 13px, transparent 13px),
    var(--sky-extra),
    radial-gradient(
      circle at var(--orb-x) var(--orb-y),
      var(--orb-core) 0,
      var(--orb) 15px,
      var(--orb-halo) 16px 27px,
      transparent 28px
    ),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-low) 100%);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top .pill {
  align-items: center;
  padding: 8px 13px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  font-size: 0.98rem;
  color: var(--text);
}

/* Auto, day or evening: one tap moves to the next. */
.theme-switch {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--text);
  cursor: pointer;
}

.theme-switch .icon svg {
  width: 22px;
  height: 22px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  font-size: 0.82rem;
  color: var(--hint);
}

.pill strong {
  font-size: 1.05rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Section titles speak in the masthead's voice: heavy and leaning forward. */
h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.01em;
}

h2:not(:first-of-type) {
  margin-top: 26px;
}

/* A title with the section's own number on the right: the team's power, the scout's reports. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.section-head ~ .section-head {
  margin-top: 22px;
}

.section-head h2 {
  margin: 0;
}

.section-stat {
  margin: 0;
  font-size: 0.82rem;
  color: var(--hint);
  white-space: nowrap;
}

.section-stat strong {
  margin-left: 6px;
  font-size: 1.05rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lede {
  margin: -6px 0 14px;
  color: var(--hint);
  font-size: 0.95rem;
}

/* Coins: a gold coin and a number, the same in every language. */
.price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.coin {
  flex: none;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe7a3, var(--gold) 58%, #b47a12);
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 18%);
}

/* Cards. */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-title {
  min-width: 0;
}

.card-title h3 {
  margin: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.meta {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--hint);
}

.meta.hint {
  margin-top: 10px;
}

.meta.hint a {
  color: inherit;
}

/* The portrait tile; until a picture exists it carries initials. Players wear their shirt number. */
.avatar {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--avatar-text);
  background: linear-gradient(135deg, var(--gold), var(--heat));
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.kit {
  position: absolute;
  right: -7px;
  bottom: -7px;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid var(--card);
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.74rem;
  font-weight: 900;
  font-style: italic;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The first page of the club.
   The cover: one big picture of whoever needs the manager now, with her line and one button.
   Over a picture everything keeps the picture's own light, whatever the palette. */
.cover {
  position: relative;
  height: 200px;
  margin: 0 0 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold), var(--heat));
  box-shadow: var(--card-shadow);
}

.cover-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.cover-open:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: -3px;
}

/* The cover is wider than a picture: it keeps the upper part, where the faces are. */
.cover-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
}

/* Naomi leans down to the camera: her face is lower in the frame, and her line must not cover it. */
.cover-open img[src$="/naomi-1.webp"] {
  object-position: 50% 62%;
}

.cover-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 64%;
  pointer-events: none;
  background: linear-gradient(to top, rgb(33 22 48 / 90%) 0%, rgb(33 22 48 / 66%) 40%, rgb(33 22 48 / 0%) 100%);
}

.cover-flag {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgb(33 22 48 / 68%);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
}

/* Pink is for what needs attention: here, a message he has not read. */
.cover-flag.new::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--heat);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 85%);
}

.cover-body {
  position: absolute;
  left: 16px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: #ffffff;
  pointer-events: none;
}

.cover-text {
  flex: 1;
  min-width: 0;
}

.cover-name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
}

.cover-line {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.3;
  color: rgb(255 255 255 / 94%);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cover-button {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: #fffdf8;
  color: #2d2142;
  font: inherit;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
}

.cover-button:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 3px;
}

.cover-button .chat-news {
  top: -11px;
  right: -4px;
}

.cover-button .news-count,
.cover-button .news-reaction {
  min-width: 24px;
  height: 24px;
  border-color: transparent;
  font-size: 0.8rem;
}

/* Today: the three steps of a day at the club. Coral marks the next one. */
.card.today {
  padding: 4px 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 7px 0;
}

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

.step-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.step.done .step-mark {
  background: var(--pitch);
  color: var(--card);
}

.step-mark .icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

.step-text {
  flex: 1;
  min-width: 0;
}

.step-text b {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.step-hint {
  display: block;
  margin-top: 1px;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--hint);
}

.step-hint .price {
  color: var(--text);
}

.step .button {
  flex: none;
  min-height: 40px;
  margin: 0;
  padding: 9px 16px;
  font-size: 0.9rem;
}

.step .stat strong {
  font-size: 1.35rem;
}

.step .stat span {
  font-size: 0.68rem;
}

.card.today + .notice {
  margin: 0 0 12px;
}

/* The squad and the staff as lists: a face, a name, form and chemistry, and the way into her chat.
   The row itself opens her profile. */
.card.list {
  padding: 2px 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 0 12px 0 14px;
}

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

.row.hurt {
  box-shadow: inset 3px 0 0 var(--heat);
}

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.row-main:focus-visible,
.chat-round:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 2px;
}

.row .avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 0.9rem;
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.row-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--hint);
}

.row-stats b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-stats .busy {
  color: var(--heat);
  font-weight: 700;
}

.row-duty {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Form and the scout's progress in one thin line. */
.mini {
  flex: 1;
  max-width: 96px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.mini i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pitch);
}

.mini.scout i {
  background: var(--gold);
}

/* The level of chemistry: a heart and a number. */
.bond {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  color: var(--heat);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bond .icon svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* The way into her chat. Coral when something new waits there. */
.chat-round {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 26%, transparent);
  cursor: pointer;
}

.chat-round .icon svg {
  width: 21px;
  height: 21px;
}

.chat-round.has-news {
  background: var(--button);
  color: var(--button-text);
  box-shadow: none;
}

.chat-round:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-round .chat-news {
  top: -7px;
  right: -7px;
  gap: 2px;
}

.chat-round .news-count,
.chat-round .news-reaction {
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  font-size: 0.74rem;
}

/* A place the scout is still filling. */
.row.wanted .avatar {
  filter: grayscale(1);
  opacity: 0.7;
}

.row.wanted .row-name {
  color: var(--hint);
}

.row-go {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--hint);
}

.row-go .icon svg {
  width: 20px;
  height: 20px;
}

/* The character's pictures across the top of her profile, and of her card on the scout's screen;
   the small tile gives way to them.
   With more than one picture they lie in a strip that scrolls sideways under the finger,
   one picture at a time; a tap turns to the next. */
.art {
  position: relative;
  display: block;
  width: calc(100% + 32px);
  margin: -16px -16px 14px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.art-strip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.art-strip::-webkit-scrollbar {
  display: none;
}

.art-strip:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: -3px;
}

.art-strip img {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.art .kit {
  right: 12px;
  bottom: 12px;
  pointer-events: none;
}

.art-dots {
  position: absolute;
  pointer-events: none;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}

.art-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(255 255 255 / 50%);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 18%);
}

.art-dots .on {
  background: #ffffff;
}

.art + .card-head .avatar {
  display: none;
}

.card.locked .art img {
  filter: grayscale(1);
  opacity: 0.8;
}

/* The heart over the pictures on the player's own cards: his reaction to the picture on screen.
   Over a photo it keeps the photo's own light, as the dots do. */
.art-react-wrap {
  position: absolute;
  left: 12px;
  bottom: 10px;
}

.art-react {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 34%);
  color: #ffffff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.art-react .icon svg {
  width: 21px;
  height: 21px;
}

.art-react.set {
  background: rgb(255 255 255 / 86%);
}

.art-react-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

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

/* Her profile: what used to be her card in the club, on a page of its own.
   The pictures run from edge to edge, under the sky's own rounded corners. */
.profile-art {
  position: relative;
  margin: -20px -16px 16px;
}

.profile-art .art {
  width: 100%;
  margin: 0;
  border-radius: 0 0 26px 26px;
}

.profile-art .back {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  padding: 0 2px 4px 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 34%);
  color: #ffffff;
}

/* Without pictures the back button stands on the page itself. */
.profile-art.plain {
  margin: 0 0 8px;
}

.profile-art.plain .back {
  position: static;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.profile.has-art .card-head .avatar {
  display: none;
}

.profile .card-title h3 {
  font-size: 1.35rem;
  font-weight: 800;
}

.profile .bio {
  margin: 12px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  font-size: 0.75rem;
  font-weight: 700;
}

.tag.star,
.tag.legend {
  background: var(--gold);
  color: var(--on-gold);
}

.tag.hurt {
  background: var(--heat);
  color: var(--on-heat);
}

/* The number that decides matches. */
.stat {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.stat strong {
  font-size: 1.6rem;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 0.72rem;
  color: var(--hint);
}

.bio {
  margin: 14px 0;
  font-size: 0.95rem;
}

.bio.first {
  margin-top: 0;
}

/* Not signed yet: an empty place in the album. */
.card.locked {
  background: transparent;
  border: 1.5px dashed color-mix(in srgb, var(--text) 28%, transparent);
  box-shadow: none;
}

.card.locked .avatar {
  filter: grayscale(1);
  opacity: 0.75;
}

.card.locked .kit {
  border-color: var(--bg);
}

.meter + .meter {
  margin-top: 10px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--hint);
  margin-bottom: 4px;
}

.meter-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
}

.meter-fill.form {
  background: var(--pitch);
}

.meter-fill.chem {
  background: var(--heat);
}

.meter-fill.scout {
  background: var(--gold);
}

/* A line about what somebody is doing right now: the doctor, the coach, the scout. */
.duty {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  font-size: 0.9rem;
}

.duty.owner {
  margin: 0 0 12px;
  box-shadow: inset 3px 0 0 var(--gold);
}

.note {
  margin: 18px 4px 0;
  font-size: 0.85rem;
  color: var(--hint);
}

.allowance {
  margin: 14px 4px 0;
  font-size: 0.85rem;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}

.notice {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border-left: 3px solid var(--heat);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  font-size: 0.9rem;
}

.notice.good {
  border-left-color: var(--pitch);
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 6px;
}

.notice .button.wide {
  margin-top: 10px;
}

.top + .notice {
  margin: 0 0 18px;
}

/* Buttons. Coral plays the game, the outline is a quieter action, gold spends Stars. */
.button {
  align-self: flex-start;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
}

.button:focus-visible,
.item:focus-visible,
.tab:focus-visible,
.theme-switch:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 3px;
}

button.button {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.wide {
  align-self: stretch;
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
}

.button.wide + .button.wide {
  margin-top: 8px;
}

/* The button into her chat shows what is new there, as a chat list does: her unseen reaction and the count
   of messages he has not read sit on its corner, like the badge of an app. */
.chat-button {
  position: relative;
}

.chat-news {
  position: absolute;
  top: -10px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.news-count,
.news-reaction {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 2px solid var(--card);
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1;
}

.news-count {
  background: var(--heat);
  color: var(--on-heat);
  font-weight: 800;
}

.news-reaction {
  background: var(--card);
  box-shadow: 0 1px 4px rgb(0 0 0 / 18%);
  font-size: 0.95rem;
}

.chat-preview {
  margin: 14px 0 -4px;
  overflow: hidden;
  font-size: 0.9rem;
  color: var(--hint);
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.chat-preview b {
  color: var(--text);
  font-weight: 700;
}

/* She is writing her thanks for a gift: the line above her chat button shows her typing, as a chat list does. */
.chat-preview.writing {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: default;
}

.chat-preview.writing b {
  font-weight: 600;
}

.writing-dots {
  display: inline-flex;
  gap: 3px;
}

.writing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--heat);
  animation: typing 1.2s infinite ease-in-out;
}

.writing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.writing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .writing-dots span {
    animation: none;
  }
}

.button.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 30%, transparent);
}

.button.star {
  background: var(--gold);
  color: var(--on-gold);
}

.button.quiet {
  background: transparent;
  color: var(--hint);
  margin-top: 0;
}

.button .price {
  vertical-align: bottom;
}

.button:disabled,
.item:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Boosts and gifts on a card: what it is, what it gives, what it costs. */
.items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.item b {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.item span {
  color: var(--hint);
}

.item .item-price,
.item .item-price span {
  margin-top: 4px;
  color: var(--text);
  font-weight: 700;
}

.item .price span {
  margin-top: 0;
}

.item.star {
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

/* Next to a boost and a gift, the premium gift takes a row of its own. */
.items .item.star:nth-child(3) {
  grid-column: 1 / -1;
  flex-flow: row wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.items .item.star:nth-child(3) .item-price {
  margin: 0 0 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Outside Telegram and the age gate. */
.landing {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.landing .wordmark-main {
  font-size: 2.8rem;
}

.tagline {
  margin: 0;
  font-size: 1.15rem;
  max-width: 24rem;
}

.landing .status {
  margin: 0;
  text-align: left;
}

/* The page outside Telegram (A35): the logo on a board over the sea, what the game is, the way into the bot,
   the players, how it plays. Its sky follows the visitor's clock, as the club's does in the game; the sun sits
   between the board and the sea. */
.site-top {
  --orb-r: 15px;
  --halo-r: 27px;
  --sea-h: 10px;
  --line-h: 3px;
  --orb-y: calc(100% - 38px);
  margin: -20px -16px 18px;
  padding: 12px 16px 74px;
  border-radius: 0 0 26px 26px;
  background:
    linear-gradient(
      to top,
      var(--sea) 0 var(--sea-h),
      var(--sea-line) var(--sea-h) calc(var(--sea-h) + var(--line-h)),
      transparent calc(var(--sea-h) + var(--line-h))
    ),
    var(--sky-extra),
    radial-gradient(
      circle at var(--orb-x) var(--orb-y),
      var(--orb-core) 0,
      var(--orb) var(--orb-r),
      var(--orb-halo) calc(var(--orb-r) + 1px) var(--halo-r),
      transparent calc(var(--halo-r) + 1px)
    ),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-low) 100%);
}

/* At sunrise and just after sunset the sun stays half in the sea, as over the club. */
:root[data-sky="morning"] .site-top,
:root[data-sky="dusk"] .site-top {
  --orb-y: calc(100% - var(--sea-h) - var(--line-h));
}

.site-langs {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.site-langs button {
  min-width: 40px;
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.site-langs button.on {
  background: var(--text);
  color: var(--bg);
}

.site-langs button:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 2px;
}

.site-logo {
  margin: 18px 0 0;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: var(--sign);
  box-shadow: 0 16px 30px -18px rgb(45 33 66 / 60%);
  line-height: 0;
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-lead {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.4;
}

.site-note {
  margin: 10px 0 0;
  color: var(--hint);
  font-size: 0.88rem;
  text-align: center;
}

.site h2 {
  margin: 32px 0 6px;
}

.site-sub {
  margin: 0 0 12px;
  color: var(--hint);
  font-size: 0.95rem;
}

/* The players side by side, a swipe apart, like the pictures in a profile. */
.site-squad {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 2px 16px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.site-squad::-webkit-scrollbar {
  display: none;
}

.site-squad:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: -3px;
}

/* A mouse cannot swipe: a thin scrollbar shows that the row goes on. */
@media (pointer: fine) {
  .site-squad {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent;
  }

  .site-squad::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .site-squad::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: color-mix(in srgb, var(--text) 28%, transparent);
  }
}

.site-player {
  flex: 0 0 78%;
  max-width: 19rem;
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.site-player img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.site-player-text {
  padding: 12px 14px 14px;
}

.site-player h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
}

.site-player p {
  margin: 0;
  font-size: 0.93rem;
}

.site-player .site-player-role {
  margin: 2px 0 6px;
  color: var(--pitch);
  font-size: 0.85rem;
  font-weight: 700;
}

.site-how {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.site-how li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.site-how .icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--button) 16%, transparent);
  color: var(--button);
}

.site-how .icon svg {
  width: 22px;
  height: 22px;
}

.site-frame {
  margin: 22px 0 0;
  color: var(--hint);
  font-size: 0.92rem;
}

.site-foot {
  margin: 26px 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.site-foot a {
  color: var(--hint);
}

/* Tablet and computer (A35, the owner's request): the page leaves the game's phone column. The sky runs across
   the whole window with a bigger sun, the text keeps a readable width and stands in the middle. From 1100 px
   all five players stand in one row and «How it plays» in four columns. */
@media (min-width: 720px) {
  body.site-page .app {
    max-width: none;
    padding: 0 0 calc(44px + env(safe-area-inset-bottom));
  }

  .site-top {
    --orb-r: 22px;
    --halo-r: 38px;
    --sea-h: 14px;
    --line-h: 4px;
    --orb-y: calc(100% - 58px);
    margin: 0 0 32px;
    padding: 18px max(24px, calc((100% - 46rem) / 2 + 24px)) 110px;
    border-radius: 0 0 40px 40px;
  }

  .site-logo {
    max-width: 38rem;
    margin: 28px auto 0;
    padding: 24px 28px 20px;
    border-radius: 28px;
  }

  .site-body {
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 24px;
  }

  .site-lead {
    max-width: 38rem;
    margin: 0 auto;
    font-size: 1.4rem;
    text-align: center;
  }

  .site .button.wide {
    width: fit-content;
    min-width: 20rem;
    margin: 22px auto 0;
    padding-inline: 44px;
  }

  .site h2,
  .site-sub,
  .site-frame {
    text-align: center;
  }

  .site h2 {
    margin-top: 48px;
    font-size: 1.5rem;
  }

  body.site-page {
    overflow-x: clip;
  }

  /* The row runs to the edges of the window; the first card stands on the edge of the text. */
  .site-squad {
    --edge: max(24px, calc((100vw - 46rem) / 2 + 24px));
    margin: 0 calc(-1 * var(--edge));
    padding: 2px var(--edge) 14px;
    scroll-padding: 0 var(--edge);
  }

  .site-player {
    flex-basis: 18rem;
    max-width: none;
  }

  /* The staff are fewer than the players: their row fits the screen and stands in the middle. */
  .site-staff {
    justify-content: center;
    justify-content: safe center;
  }

  .site-how {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .site-how li {
    align-items: flex-start;
  }

  .site-frame {
    max-width: 36rem;
    margin: 32px auto 0;
  }
}

@media (min-width: 1100px) {
  .site-top {
    --orb-r: 26px;
    --halo-r: 46px;
    --orb-y: calc(100% - 66px);
    padding: 22px max(32px, calc((100% - 72rem) / 2 + 32px)) 128px;
  }

  .site-logo {
    max-width: 46rem;
    margin-top: 34px;
  }

  .site-body {
    max-width: 72rem;
    padding: 0 32px;
  }

  .site-lead {
    max-width: 46rem;
    font-size: 1.55rem;
  }

  .site-squad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  /* A staff card is as wide as a player's card in the row of five above it. */
  .site-staff {
    display: flex;
  }

  .site-staff .site-player {
    flex: 0 0 calc((100% - 4 * 16px) / 5);
  }

  .site-how {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .site-how li {
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }
}

.gate-title {
  margin: 0;
  font-size: 1.4rem;
}

/* Naming the club (G38): one field with a ready name, the dice for another, the save button. */
.name-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.club-name-input {
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border: 1.5px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
}

.club-name-input::placeholder {
  color: var(--hint);
  font-weight: 400;
}

.club-name-input:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 2px;
}

.name-dice {
  padding: 8px 4px;
}

.name-problem {
  margin: 0 4px;
  color: var(--heat);
  font-size: 0.9rem;
}

.name-form .button.wide {
  margin-top: 6px;
}

.name-form .button.wide + .button.wide {
  margin-top: 0;
}

/* The club's name at the top of its page; the name and the pencil both rename the club. */
.club-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.club-title h2 {
  margin: 0;
  min-width: 0;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.name-edit {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--hint);
  cursor: pointer;
}

.name-edit .icon svg {
  width: 17px;
  height: 17px;
}

.name-edit:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 3px;
}

/* The match itself. */
.score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.side.away {
  text-align: right;
}

.score strong {
  font-size: 1.7rem;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score.big {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
}

.score.big strong {
  font-size: 2.3rem;
}

.result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 10px 0 4px;
  font-weight: 700;
}

.result.win {
  color: var(--pitch);
}

.result.loss {
  color: var(--heat);
}

.result .price {
  color: var(--text);
}

.timeline {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.episode {
  display: flex;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--card);
  color: var(--hint);
  font-size: 0.95rem;
}

.episode .minute {
  flex: none;
  width: 2.2rem;
  font-variant-numeric: tabular-nums;
}

.episode.goal_for {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--pitch);
}

.episode.goal_against {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--heat);
}

.match-screen .meta {
  margin: 0 0 4px;
}

/* Opening a scout report (owner's decision, 27.11.2026): whom it is for, a moment on the road, then the find.
   The find lands with a pop, the scout's bar grows after it, and a signing gets her big picture. */
.report {
  display: flex;
  flex-direction: column;
}

.report .card.list {
  margin-bottom: 4px;
}

/* Her bar keeps a readable length next to a long position; the position gives way. */
.row.pick .mini {
  flex: 1 0 44px;
}

/* A small mark next to her name in the list: the last choice, or that the next report signs her. */
.row-tag {
  padding: 1px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--hint);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.row-tag.gold {
  background: var(--gold);
  color: var(--on-gold);
}

/* The scout on the road: her face, and a short wait. */
.road {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: var(--hint);
  font-weight: 700;
}

.road p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.road .avatar,
.road-mark {
  width: 112px;
  height: 112px;
  border-radius: 30px;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--gold);
}

.road .avatar {
  font-size: 1.6rem;
}

.road-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--heat));
  color: #ffffff;
}

.road-mark .icon svg {
  width: 52px;
  height: 52px;
}

@media (prefers-reduced-motion: no-preference) {
  .road .avatar,
  .road-mark {
    animation: road 0.9s ease-in-out infinite alternate;
  }
}

@keyframes road {
  from {
    transform: translateY(0) rotate(-3deg);
  }
  to {
    transform: translateY(-8px) rotate(3deg);
  }
}

/* The find: large and rimmed in gold, the "bam" of the report. */
.find-card {
  margin: 4px 0 12px;
  padding: 22px 18px 20px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.find-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hint);
}

.find-what {
  margin: 8px 0 0;
  font-size: 1.7rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1.2;
}

/* What it gives, in the colour of what it is for: form is sea green, chemistry and a contract are pink. */
.find-what b {
  font-weight: inherit;
  color: var(--pitch);
}

.find-card.gift .find-what b,
.find-card.contract .find-what {
  color: var(--heat);
}

.find-use {
  margin: 8px auto 0;
  max-width: 20rem;
  font-size: 0.9rem;
  color: var(--hint);
}

.find-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 1.15rem;
  font-weight: 800;
}

/* The step toward her contract: her face and the scout's bar, which grows from where it was. */
.step-who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-who .meter {
  flex: 1;
  min-width: 0;
}

.step-who .meter-head {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .step-card .meter-fill {
    transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

.step-card .duty {
  margin-top: 12px;
}

/* A signing: her portrait, large, with the news over it. Over a picture everything keeps the picture's own light. */
.signed-card {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0 0 12px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold), var(--heat));
  box-shadow: var(--card-shadow);
}

.signed-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signed-body {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #ffffff;
}

.signed-card .cover-name {
  font-size: 1.25rem;
}

.signed-card .cover-line {
  -webkit-line-clamp: 3;
}

.report .reports-left {
  margin: 2px 0 0;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .find-card {
    animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  }

  .step-card {
    animation: rise 0.4s ease-out 0.15s both;
  }

  .signed-card {
    animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.25s both;
  }
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

/* League table. The stripe at the rank marks the places that go up or down. */
.table-card {
  padding: 4px 0;
}

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

.table th,
.table td {
  padding: 10px 8px;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}

.table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--hint);
}

.table th[scope="row"],
.table thead th:nth-child(2) {
  width: 100%;
  text-align: left;
  white-space: normal;
}

.table .rank {
  width: 2.6rem;
  padding-left: 16px;
  text-align: left;
  color: var(--hint);
}

.table .points {
  padding-right: 16px;
  font-weight: 800;
}

.table tbody tr {
  border-top: 1px solid var(--line);
}

.table tr.up .rank {
  box-shadow: inset 4px 0 0 var(--pitch);
}

.table tr.down .rank {
  box-shadow: inset 4px 0 0 var(--heat);
}

.table tr.mine {
  background: color-mix(in srgb, var(--pitch) 16%, transparent);
}

.table tr.mine th,
.table tr.mine td {
  font-weight: 800;
  color: var(--text);
}

/* A short list of names and amounts. */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  font-size: 0.95rem;
}

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

.rows li:first-child {
  padding-top: 0;
}

/* Tab bar. */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--hint);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.on {
  color: var(--text);
}

.tab.on .icon {
  color: var(--button);
}

.icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.badge {
  position: absolute;
  top: 1px;
  left: calc(50% + 5px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--heat);
  color: var(--on-heat);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* No number, just "something is waiting here": today's match has not been played. */
.badge.pip {
  top: 5px;
  left: calc(50% + 9px);
  min-width: 0;
  width: 9px;
  height: 9px;
  padding: 0;
}

/* Chat: the screen is a column that fills the visible Telegram viewport, so the composer
   stays above the keyboard and only the message list scrolls. */
body.chat-open .app {
  padding: 0;
}

.chat {
  display: flex;
  flex-direction: column;
  height: var(--tg-viewport-height, 100dvh);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-mid));
}

.chat-head .meta {
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

/* Her face and name at the top of the chat: a tap opens her profile, as in a messenger. */
.chat-who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-who-text {
  min-width: 0;
}

.chat-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chat-who .meta {
  display: block;
}

.chat-who:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 4px;
  border-radius: 12px;
}

.back {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.chat-status {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 3px solid var(--pitch);
}

.chat-status.staff {
  grid-template-columns: 1fr auto;
}

.chat-status .meter + .meter {
  margin-top: 0;
}

.training {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--hint);
}

.dots {
  display: flex;
  gap: 5px;
  height: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 16%, transparent);
}

.dot.on {
  background: var(--heat);
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  overscroll-behavior: contain;
}

.bubble {
  max-width: 84%;
  padding: 9px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.mine {
  align-self: flex-end;
  background: var(--button);
  color: var(--button-text);
  border-bottom-right-radius: 6px;
}

.bubble.theirs {
  align-self: flex-start;
  background: var(--card);
  border-bottom-left-radius: 6px;
}

/* A photo she sent (src/photos.ts): the picture fills the bubble; a tap opens it on the whole screen. */
.bubble.photo {
  display: block;
  width: min(68vw, 260px);
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--card);
  color: var(--hint);
  font: inherit;
  cursor: zoom-in;
}

.bubble.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble.photo.broken {
  display: grid;
  place-items: center;
  padding: 14px;
  font-size: 0.85rem;
  cursor: default;
}

.bubble.photo:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 2px;
}

/* She is picking the photo he asked for: a line in her bubble with the dots of a messenger. */
.bubble.picking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hint);
  font-size: 0.9rem;
}

/* Her photo on the whole screen. */
.photo-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--viewer-bg);
  cursor: zoom-out;
}

.photo-view img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.photo-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--viewer-button);
  color: var(--viewer-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.photo-close:focus-visible {
  outline: 2px solid var(--viewer-text);
  outline-offset: 2px;
}

/* The game speaking in its own voice, outside the character. */
.bubble.care {
  align-self: stretch;
  max-width: none;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  font-size: 0.95rem;
}

/* Her message with the player's reaction under it. A tap on the message opens the reactions. */
.said {
  align-self: flex-start;
  max-width: 84%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.said .bubble {
  max-width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The reaction sits on the lower edge of the bubble; without one, only her latest message shows the hint. */
.react-chip {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  margin: -10px 0 0 12px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--hint);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.react-chip .icon svg {
  width: 15px;
  height: 15px;
}

.react-chip.set {
  color: var(--text);
}

.react-chip.set,
.said.latest .react-chip,
.said.picking .react-chip {
  display: inline-flex;
}

.react-chip:focus-visible,
.react-picker button:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 1px;
}

.react-picker {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 20px -10px rgb(0 0 0 / 35%);
}

.react-picker button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.react-picker button.on {
  background: color-mix(in srgb, var(--heat) 24%, transparent);
}

/* His own message, with her reaction on its edge. */
.said.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.said.mine .bubble {
  cursor: default;
}

.her-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  margin: -10px 12px 0 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.95rem;
  line-height: 1;
}

.her-chip[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .her-chip.fresh {
    animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  }
}

@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

/* Where her messages that came while he was away begin. */
.chat-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--heat);
}

.chat-divider::before,
.chat-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--heat) 45%, transparent);
}

/* Over a picture the row opens above the heart. */
.react-picker.on-art {
  position: absolute;
  left: 0;
  bottom: 48px;
  margin: 0;
  border-color: transparent;
  box-shadow: 0 8px 22px rgb(0 0 0 / 30%);
}

.typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hint);
  animation: typing 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
  }
}

.chat-intro,
.chat-event {
  margin: 6px auto;
  max-width: 22rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--hint);
}

.chat-event {
  color: var(--heat);
  font-weight: 700;
}

.chat .notice {
  margin: 0 16px 8px;
  background: var(--card);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 16px 0;
}

.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  resize: none;
}

.chat-input::placeholder {
  color: var(--hint);
}

.chat-input:focus-visible,
.send:focus-visible,
.back:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 2px;
}

.send {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  font-size: 1.1rem;
  cursor: pointer;
}

.send:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat .allowance {
  margin: 6px 16px calc(10px + env(safe-area-inset-bottom));
  font-size: 0.75rem;
  text-align: center;
}

/* Her deal of a bold photo (src/deals.ts): what it waits for, just above the allowance. */
.chat .deal-line {
  margin: 6px 16px 0;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text);
}
