/* ============================================
   ONLINE / CONSENT SHEETS
   Full-screen overlays that hold one centered card: the first-run consent
   screen, "looking for an opponent", the friend-room flow and messages.
   They sit outside the game column, so sizes are plain em/min() values that
   hold from a 320px phone to a desktop window.
   ============================================ */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 90; /* above the coin flip (80): consent and errors must never hide behind it */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: whitesmoke; /* opaque before .opt-bg's art has loaded */
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}

/* The online flow floats over a game or the home screen, so it dims what's under it. */
#online-overlay {
  background-color: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}

#online-overlay .opt-bg {
  display: none;
}

.sheet {
  position: relative;
  width: min(100%, 440px);
  max-height: 100%;
  overflow-y: auto;
  background: whitesmoke;
  /* The app's border: black at low opacity (as on the player boxes). Brown
     is the board's colour only. */
  border: .25em solid rgba(0, 0, 0, .35);
  border-radius: 1.2em;
  padding: 1.2em 1.2em 1.4em;
  text-align: center;
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  gap: .9em;
}

.sheet-title {
  font-family: "Changa One", sans-serif;
  font-size: 1.9em;
  line-height: 1.1;
}

.sheet-text {
  font-family: sans-serif;
  font-size: 1em;
  line-height: 1.45;
}

.sheet-text.error {
  color: #b3261e;
  min-height: 1.45em;
}

.sheet-list {
  margin: 0;
  padding-left: 1.2em;
  text-align: left;
  font-family: sans-serif;
  font-size: .95em;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: .5em;
}

/* The Pro sheet's first line: what the star looks like, on a gold wash. */
.sheet-list .pro-star {
  list-style: none;
  margin-left: -1.2em;
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .45em .6em;
  border-radius: .7em;
  background: rgba(232, 185, 35, .2);
  border: .1em solid rgba(232, 185, 35, .6);
}

.pro-sample {
  flex: none;
  font-size: .95em;
}

.sheet-check {
  display: flex;
  align-items: flex-start;
  gap: .7em;
  text-align: left;
  font-family: sans-serif;
  font-size: .95em;
  line-height: 1.4;
  cursor: pointer;
}

.sheet-check input {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  margin: .05em 0 0;
  accent-color: rgb(46, 160, 90);
}

.sheet-check a {
  color: rgb(31, 46, 124);
}

.sheet-view {
  display: none;
  flex-direction: column;
  gap: .9em;
}

#online-overlay[data-view="searching"] .sheet-view[data-view="searching"],
#online-overlay[data-view="friend"] .sheet-view[data-view="friend"],
#online-overlay[data-view="friends"] .sheet-view[data-view="friends"],
#online-overlay[data-view="friend-add"] .sheet-view[data-view="friend-add"],
#online-overlay[data-view="friend-confirm"] .sheet-view[data-view="friend-confirm"],
#online-overlay[data-view="friend-manage"] .sheet-view[data-view="friend-manage"],
#online-overlay[data-view="report"] .sheet-view[data-view="report"],
#online-overlay[data-view="feedback"] .sheet-view[data-view="feedback"],
#online-overlay[data-view="waiting"] .sheet-view[data-view="waiting"],
#online-overlay[data-view="joincode"] .sheet-view[data-view="joincode"],
#online-overlay[data-view="message"] .sheet-view[data-view="message"],
#online-overlay[data-view="bot"] .sheet-view[data-view="bot"],
#online-overlay[data-view="login"] .sheet-view[data-view="login"],
#online-overlay[data-view="login-email"] .sheet-view[data-view="login-email"],
#online-overlay[data-view="login-code"] .sheet-view[data-view="login-code"],
#online-overlay[data-view="account"] .sheet-view[data-view="account"],
#online-overlay[data-view="player"] .sheet-view[data-view="player"],
#online-overlay[data-view="level-help"] .sheet-view[data-view="level-help"],
#online-overlay[data-view="invite"] .sheet-view[data-view="invite"],
#online-overlay[data-view="invite-mode"] .sheet-view[data-view="invite-mode"],
#online-overlay[data-view="profile"] .sheet-view[data-view="profile"],
#online-overlay[data-view="account-signout"] .sheet-view[data-view="account-signout"],
#online-overlay[data-view="account-delete"] .sheet-view[data-view="account-delete"],
#online-overlay[data-view="pro"] .sheet-view[data-view="pro"],
#online-overlay[data-view="leave"] .sheet-view[data-view="leave"],
#online-overlay[data-view="endgame"] .sheet-view[data-view="endgame"],
#online-overlay[data-view="play-warning"] .sheet-view[data-view="play-warning"],
#online-overlay[data-view="rematch-offer"] .sheet-view[data-view="rematch-offer"],
#online-overlay[data-view="mode-offer"] .sheet-view[data-view="mode-offer"],
#online-overlay[data-view="ruthless-join"] .sheet-view[data-view="ruthless-join"],
#online-overlay[data-view="restart"] .sheet-view[data-view="restart"],
#online-overlay[data-view="giveup"] .sheet-view[data-view="giveup"] {
  display: flex;
}

.sheet .button {
  min-height: 2.8em;
  cursor: pointer;
}

.sheet .text-button {
  font-size: 1.35em;
}

.sheet-btn.go {
  background-color: rgb(46, 160, 90);
}

.sheet-btn.alt {
  background-color: rgb(70, 94, 228);
}

.sheet-btn.cancel {
  background-color: rgb(150, 130, 110);
}

.sheet-btn.danger {
  background-color: rgb(196, 74, 62);
}

.sheet-btn.bot {
  background-color: rgb(230, 140, 40);
}

.sheet-btn.apple {
  background-color: #111;
}

.sheet-btn.google {
  background-color: #fff;
}

.sheet-btn.google .text-button {
  color: #222;
}

/* Two buttons side by side (POINTS / SPEED, MONTHLY / FOR LIFE, LEAVE / STAY). */
.sheet-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9em;
}

.sheet-row .button {
  margin: 0;
}

/* Vs Bot: what tells the two modes apart, folded under the buttons. */
.bot-help summary {
  cursor: pointer;
  list-style: none;
  padding: .2em;
  font: .9em sans-serif;
  font-weight: 700;
  opacity: .8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.bot-help-body {
  margin-top: .6em;
  text-align: left;
  font-family: sans-serif;
  font-size: .85em;
  line-height: 1.45;
}

.bot-help-body p {
  margin: .5em 0;
}

.bot-help-body b::after {
  content: ":";
}

/* The first screen's language choice: six small chips above the text. */
.consent-langs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4em;
}

.consent-lang {
  padding: .35em .2em;
  border: .125em solid transparent;
  border-radius: .5625em;
  background: rgba(0, 0, 0, .07);
  color: inherit;
  font: .9em "Changa One", sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.consent-lang.is-on {
  border-color: rgba(0, 0, 0, .5);
  background: rgba(0, 0, 0, .16);
}

/* the consent button stays dead until the box is ticked (the inactive
   look is shared with ROLL/DONE, see .button.is-inactive in linotte.css) */

.pro-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: .3em;
  padding: .1em .45em;
  border-radius: .5em;
  background: rgb(232, 185, 35);
  color: rgb(95, 70, 4);
  font-size: .6em;
}

.room-code {
  font-family: "Changa One", sans-serif;
  font-size: 3.4em;
  letter-spacing: .18em;
  padding-left: .18em; /* balances the trailing letter-spacing so it looks centered */
  line-height: 1.1;
  background: rgba(0, 0, 0, .06);
  border-radius: .3em;
  user-select: all;
}

.code-input {
  font-family: "Changa One", sans-serif;
  font-size: 2.6em;
  letter-spacing: .25em;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  padding: .15em 0;
  border: .0722em solid rgba(0, 0, 0, .35); /* 3px at the phone's 41.6px */
  border-radius: .3em;
  background: #fff;
  color: var(--ink);
}

/* the email field on the sign-in sheet: same frame as the code boxes */
.text-input {
  font-family: sans-serif;
  font-size: 1.2em;
  text-align: center;
  width: 100%;
  padding: .55em .4em;
  border: .15625em solid rgba(0, 0, 0, .35); /* 3px at the phone's 19.2px, like .code-input */
  border-radius: .5em;
  background: #fff;
  color: var(--ink);
}

.sheet-btn[hidden] {
  display: none;
}

/* while the sign-in email only has a link (EMAIL_HAS_CODE false) */
.email-link-only #login-code-input,
.email-link-only #login-code-submit,
#login-error:empty,
#account-delete-error:empty {
  display: none;
}

.sheet-small {
  font-size: .85em;
  opacity: .8;
}

.sheet-text a {
  color: inherit;
}

/* a quiet text link under the buttons (Delete account) */
.sheet-link {
  align-self: center;
  font-family: sans-serif;
  font-size: .9em;
  color: #b3261e;
  background: none;
  border: none;
  padding: .3em .6em;
  text-decoration: underline;
  cursor: pointer;
}

/* A link that stays out of the way: grey, not red. */
.sheet-link.muted {
  color: inherit;
  opacity: .75;
  font-size: .8em;
}

#account-email {
  overflow-wrap: anywhere;
}

/* a sheet button waiting on the network (SEND CODE, SIGN IN) */
.sheet-btn.is-busy {
  opacity: .6;
  pointer-events: none;
}

.spinner {
  width: 3em;
  height: 3em;
  margin: .3em auto;
  border-radius: 50%;
  border: .3em solid rgba(0, 0, 0, .12);
  border-top-color: rgba(0, 0, 0, .5);
  animation: sheetSpin 0.9s linear infinite;
}

/* "Updating..." under the title of the friends sheet while the list is being asked again */
.fr-updating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-size: .85em;
  opacity: .7;
}

.spinner-sm {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: .18em solid rgba(0, 0, 0, .12);
  border-top-color: rgba(0, 0, 0, .5);
  animation: sheetSpin 0.9s linear infinite;
}

@keyframes sheetSpin {
  to { transform: rotate(360deg); }
}

/* short landscape phones: shrink the card so it still fits without scrolling */
@media (max-height: 460px) {
  .sheet {
    font-size: 13px;
    padding: .8em 1em 1em;
    gap: .6em;
  }

  .room-code {
    font-size: 2.4em;
  }
}

/* Small transient message ("Opponent disconnected"...). */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 7dvh + var(--ad-h, 0px));
  transform: translate(-50%, 20px);
  width: max-content; /* as wide as its text (left: 50% alone would squeeze it into half the screen), up to */
  max-width: min(86vw, 420px);
  padding: .7em 1.1em;
  border-radius: 1em;
  background: rgba(30, 20, 10, .9);
  color: #fff;
  font-family: sans-serif;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  white-space: pre-line; /* a line break in a message is kept */
  transition: opacity 150ms cubic-bezier(.25, 1, .5, 1), transform 150ms cubic-bezier(.25, 1, .5, 1), translate 200ms cubic-bezier(.25, 1, .5, 1);
  z-index: 95;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  /* Swiped away to the left, right or down (see showToast in linotte.js); the finger moves it, so no
     transition on `translate` while dragging (below). */
  pointer-events: auto;
  touch-action: none;
}

.toast.dragging {
  transition: opacity 150ms, transform 150ms;
}

/* Linotte Pro sheet (see the "Pro" section of linotte.js): the price line,
   a note that depends on where the player is (web / app, signed in or not),
   and the thank-you once they are Pro. */
.pro-price {
  font-weight: bold;
}

#pro-note:empty,
.sheet-view [hidden] {
  display: none !important;
}



/* Edit profile: name, a grid of pictures, country. */
.profile-label {
  font-family: sans-serif;
  font-weight: bold;
  font-size: .95em;
  text-align: left;
  margin-bottom: -.5em;
}

.profile-avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.6em, 1fr));
  gap: .45em;
  max-height: 9.5em;
  overflow-y: auto;
  padding: .3em;
  border: .15625em solid rgba(0, 0, 0, .35);
  border-radius: .5em;
  background: #fff;
}

.profile-avatar {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: .15em solid transparent;
  border-radius: 50%;
  background: rgb(228, 209, 187) center / cover no-repeat;
  cursor: pointer;
}

.profile-avatar[aria-checked="true"] {
  border-color: #3d240c;
  box-shadow: 0 0 0 .15em rgb(232, 185, 35);
}

.profile-country {
  font-size: 1em;
  text-align: left;
}

/* Stats: six numbers, a line per kind of game, the last games. */
.stats-body {
  display: flex;
  flex-direction: column;
  gap: .9em;
  font-family: sans-serif;
}

/* The account's level, and how far it is to the next one. */
.stats-level {
  display: flex;
  flex-direction: column;
  gap: .3em;
  padding: .55em .7em;
  border: .125em solid rgba(0, 0, 0, .2);
  border-radius: .6em;
  background: rgba(255, 255, 255, .7);
}

.stats-level[hidden] {
  display: none;
}

.stats-level-row {
  display: flex;
  align-items: center;
  gap: .4em;
}

.stats-level-row > span {
  margin-left: auto;
}

/* The (?) by the level: a thin, quiet outline that opens how levels work
   (its tap area is larger than the drawing). */
.help-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin: -.3em -.2em;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(61, 36, 12, .5);
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  cursor: pointer;
}

.help-dot svg {
  width: 1em;
  height: 1em;
}

/* The level rules: a long list, a little smaller than the Pro sheet's. */
.level-rules {
  font-size: .9em;
}

.stats-level-row b {
  font-family: "Changa One", sans-serif;
  font-size: 1.3em;
}

.stats-level-row span {
  font-size: .8em;
  opacity: .75;
  font-variant-numeric: tabular-nums;
}

.stats-level-bar {
  height: .55em;
  border-radius: .3em;
  background: rgba(0, 0, 0, .12);
  overflow: hidden;
}

.stats-level-bar > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgb(232, 185, 35);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5em;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .45em .2em;
  border: .125em solid rgba(0, 0, 0, .2);
  border-radius: .6em;
  background: rgba(255, 255, 255, .7);
}

.stat b {
  font-family: "Changa One", sans-serif;
  font-size: 1.5em;
  line-height: 1.1;
}

.stat span {
  font-size: .75em;
  opacity: .75;
}

.stats-modes {
  width: 100%;
  border-collapse: collapse;
  font-size: .9em;
}

.stats-modes th,
.stats-modes td {
  padding: .3em .2em;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.stats-modes th:first-child,
.stats-modes td:first-child {
  text-align: left;
}

.stats-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9em;
  text-align: left;
}

.stats-recent li {
  display: flex;
  gap: .5em;
  padding: .3em 0;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.stats-recent .res {
  flex: none;
  font-weight: bold;
  min-width: 2.6em; /* "Égalité", "Vitória" are longer */
}

.stats-recent .won { color: #2e7d32; }
.stats-recent .lost { color: #b3261e; }
.stats-recent .draw { color: rgba(61, 36, 12, .65); }

.stats-recent .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stats-recent .when {
  opacity: .6;
}

/* Sign in: no new password to create, said where it's seen first. */
.login-nopass {
  font-weight: bold;
}

.sheet-btn.pro {
  background-color: rgb(232, 185, 35);
}

.sheet-btn.pro .text-button {
  color: #5f4604;
}

.sheet-btn.pro[hidden] {
  display: none;
}

/* The level box: next reward, and a point for a whole ad. */
.stats-level-next {
  font-size: .78em;
  opacity: .8;
}

.stats-level-next:empty {
  display: none;
}

.level-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  margin-top: .25em;
  padding: .5em .8em;
  border: var(--btn-border);
  border-radius: .5625em;
  background: rgb(232, 185, 35);
  color: #5f4604;
  font: 1em "Changa One", sans-serif;
  cursor: pointer;
}

.level-ad:disabled {
  background: rgba(0, 0, 0, .08);
  color: rgba(61, 36, 12, .6);
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  cursor: default;
}

.level-ad:disabled .level-ad-play {
  display: none;
}

.level-ad-play {
  flex: none; /* a long text beside it wraps, the circle never squeezes */
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: #5f4604;
  color: rgb(232, 185, 35);
  font-size: .75em;
  padding-left: .1em;
}

/* The level in the stats: the pastille, a little bigger. */
#st-level {
  font-size: 1.05em;
}

/* The weekly ranking. */
.lb-list,
.lb-me {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lb-list {
  max-height: 45vh;
  overflow-y: auto;
}

.lb-list li,
.lb-me li {
  display: grid;
  /* the place, the flag (a column of its own, empty without a country, so the names line up), the name, the points */
  grid-template-columns: 1.6em 1.3em minmax(0, 1fr) auto;
  gap: .4em;
  align-items: center;
  padding: .35em .3em;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.lb-list li:nth-child(-n+3) .lb-rank {
  font-family: "Changa One", sans-serif;
  color: #b07b00;
}

.lb-rank {
  text-align: left;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.lb-flag {
  text-align: center;
}

.lb-name {
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lb-points {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* While the ranking loads: grey lines in the rows' places, with a light passing over them. */
.lb-skel .sk {
  display: block;
  height: .85em;
  border-radius: .45em;
  background: linear-gradient(100deg, rgba(0, 0, 0, .08) 30%, rgba(0, 0, 0, .16) 50%, rgba(0, 0, 0, .08) 70%) 0 0 / 250% 100%;
  animation: lbShimmer 1.3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .08s);
}

.lb-skel .sk-rank { width: 1.3em; justify-self: end; }
.lb-skel .sk-name { width: 62%; }
.lb-skel:nth-child(3n) .sk-name { width: 48%; }
.lb-skel:nth-child(3n + 1) .sk-name { width: 74%; }
.lb-skel .sk-pts { width: 3em; }

/* A player's card while it loads: the badge, the points and the record are grey placeholders with the same light. */
.pc-skeleton .pc-badge,
.pc-skeleton .pc-plan,
.pc-skeleton .stat b {
  color: transparent !important;
  border-color: transparent !important;
  text-shadow: none !important;
  border-radius: .5em;
  background: linear-gradient(100deg, rgba(0, 0, 0, .08) 30%, rgba(0, 0, 0, .16) 50%, rgba(0, 0, 0, .08) 70%) 0 0 / 250% 100% !important;
  animation: lbShimmer 1.3s ease-in-out infinite;
}

.pc-skeleton .pc-badge {
  border-radius: 999px;
}

.pc-skeleton .stat {
  pointer-events: none;
}

@keyframes lbShimmer {
  from { background-position: 100% 0; }
  to { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-skel .sk,
  .pc-skeleton .pc-badge,
  .pc-skeleton .pc-plan,
  .pc-skeleton .stat b { animation: none; }
}

.lb-list li.is-me,
.lb-me li {
  border-radius: .5em;
  background: rgba(232, 185, 35, .3);
}

.lb-me {
  text-align: center;
  font-size: .9em;
}

.lb-me[hidden],
#lb-empty[hidden] {
  display: none;
}

/* Ranking tabs: this week, all time, friends. */
.lb-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3em;
  width: 100%;
  padding: .25em;
  border-radius: .8em;
  background: rgba(0, 0, 0, .08);
  box-sizing: border-box;
}

.lb-tab {
  padding: .45em .2em;
  border: 0;
  border-radius: .6em;
  background: none;
  color: rgba(61, 36, 12, .7);
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  font: .9em "Changa One", sans-serif;
  cursor: pointer;
}

.lb-tab.is-on {
  background: white;
  color: var(--ink);
  box-shadow: 0 .1em .3em rgba(0, 0, 0, .15);
}

/* Friends: games together, an online dot (Pro and Pro), PLAY. */
.lb-list li.lb-friend {
  grid-template-columns: .8em minmax(0, 1fr) auto auto;
}

.lb-dot {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: rgba(0, 0, 0, .2);
}

.lb-dot.is-online {
  background: #2fbf4f;
  box-shadow: 0 0 0 .15em rgba(47, 191, 79, .25);
}

.lb-dot.is-none {
  visibility: hidden;
}

.lb-sub {
  display: block;
  font-size: .75em;
  opacity: .65;
  font-weight: normal;
}

.lb-play {
  padding: .3em .7em;
  border: var(--btn-border);
  border-radius: .5625em;
  background: rgb(46, 160, 90);
  color: white;
  font: .85em "Changa One", sans-serif;
  cursor: pointer;
}

.lb-play[hidden] {
  display: none;
}

/* Without Pro: what Pro adds to friends. */
.lb-pro {
  display: flex;
  align-items: center;
  gap: .6em;
  padding: .5em .7em;
  border-radius: .7em;
  background: rgba(232, 185, 35, .25);
  font-size: .85em;
  text-align: left;
}

.lb-pro[hidden] {
  display: none;
}

.lb-pro-btn {
  flex: none;
  padding: .35em .7em;
  border: var(--btn-border);
  border-radius: .5625em;
  background: rgb(232, 185, 35);
  color: #5f4604;
  font: .9em "Changa One", sans-serif;
  cursor: pointer;
}

/* The daily bonus, said where a game starts (ONLINE's and FRIEND's sheets)
   while it's still to win today: the same gift as the "+2" on ONLINE. */
.sheet-daily {
  display: none;
}

body.daily-open .sheet-daily {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .45em .8em .45em 2.3em;
  border-radius: .8em;
  background: rgba(232, 185, 35, .3) .7em 50% / 1.3em no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%235f4604'%3E%3Crect x='3' y='9' width='18' height='4.5' rx='1'/%3E%3Crect x='4.5' y='14.5' width='15' height='7' rx='1.2'/%3E%3C/g%3E%3Cpath d='M12 9v12.5' stroke='%23f2c84a' stroke-width='2.2'/%3E%3Cpath d='M12 8.6C10.6 5.4 7.4 4.6 6.6 6.3 5.8 8 9 8.8 12 8.6zM12 8.6c1.4-3.2 4.6-4 5.4-2.3.8 1.7-2.4 2.5-5.4 2.3z' fill='none' stroke='%235f4604' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: #5f4604;
  font-size: .9em;
  font-weight: bold;
  text-align: left;
}

/* "You don't lose any level points": reassurance, under the warning. */
.sheet-reassure {
  color: rgb(36, 128, 70);
  font-weight: bold;
}

/* Stat tiles explain themselves when touched. */
.stat[data-explain] {
  cursor: pointer;
}

/* "How levels work": the one-line summary hugs the title and is set apart from the rules below. */
.sheet-view[data-view="level-help"] .sheet-title {
  margin-bottom: -.4em;
}

.level-note {
  padding-bottom: .9em;
  margin-bottom: .5em;
  border-bottom: 1px solid rgba(0, 0, 0, .15);
}


/* ============================================
   FRIENDS (the "friends" sheet: see docs/FRIENDS.md)
   ============================================ */
.fr-block {
  display: flex;
  flex-direction: column;
  gap: .3em;
  text-align: left;
}

.fr-head {
  font: 1em "Changa One", sans-serif;
  text-align: center;
}

.fr-list {
  width: 100%;
  max-height: 42vh;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.fr-list li {
  display: grid;
  grid-template-columns: .8em minmax(0, 1fr) auto;
  gap: .5em;
  align-items: center;
  padding: .45em .3em;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.fr-list li:last-child {
  border-bottom: 0;
}

/* The name is a button: it opens what can be done with this friend. */
.fr-name {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 1.05em "Changa One", sans-serif;
  text-align: left;
  cursor: pointer;
}

.fr-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-name .fr-state {
  font: .75em sans-serif;
  opacity: .65;
}

/* online green, busy (a game against the bot) and in an online game, offline grey */
.fr-dot {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: rgba(0, 0, 0, .2);
}

.fr-dot.is-online {
  background: #2fbf4f;
  box-shadow: 0 0 0 .15em rgba(47, 191, 79, .25);
}

.fr-dot.is-busy {
  background: #e8a317;
  box-shadow: 0 0 0 .15em rgba(232, 163, 23, .25);
}

.fr-dot.is-playing {
  background: #e8a317;
}

.fr-actions {
  display: flex;
  gap: .4em;
}

.fr-btn {
  min-width: 2.3em;
  padding: .3em .7em;
  border: var(--btn-border);
  border-radius: .5625em;
  background: rgb(46, 160, 90);
  color: #fff;
  font: .9em "Changa One", sans-serif;
  cursor: pointer;
}

.fr-btn.is-no {
  background: rgb(150, 130, 110);
}

.fr-btn[hidden] {
  display: none;
}

/* A row of the ranking or the friends that opens that player's card. */
.lb-list li.lb-tap {
  cursor: pointer;
}

.lb-list li.lb-tap:active {
  background: rgba(0, 0, 0, .06);
}

/* The picture on a player's card: the gallery one, or the generic buddy; grey and shimmering while the card loads. */
.pc-avatar {
  align-self: center;
  width: 4.6em;
  aspect-ratio: 1;
  border: .15em solid rgba(0, 0, 0, .35);
  border-radius: 50%;
  background: rgb(228, 209, 187) url("resources/images/avatar-guest.svg") center / 100% no-repeat;
  background-origin: border-box;
}

.pc-avatar.has-picture {
  background-size: cover;
}

.pc-skeleton .pc-avatar {
  background: linear-gradient(100deg, rgba(0, 0, 0, .08) 30%, rgba(0, 0, 0, .16) 50%, rgba(0, 0, 0, .08) 70%) 0 0 / 250% 100%;
  animation: lbShimmer 1.3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pc-skeleton .pc-avatar { animation: none; }
}

/* A friend just made, until the list has been seen. */
/* the flag's slot: the same width with or without a flag, so the names start at the same place */
.fr-name span.fr-flag {
  display: inline-block;
  width: 1.7em;
  overflow: visible;
}

.fr-name span.fr-new {
  display: inline-block;
  overflow: visible;
  padding: .05em .45em;
  border-radius: 999px;
  background: #e0443a;
  color: #fff;
  font: .65em "Changa One", sans-serif;
  vertical-align: .15em;
}

.fr-my-code {
  font-size: 2.6em;
}

.fr-or {
  margin-top: .3em;
}

.fr-code-input {
  font-size: 2em;
  letter-spacing: .18em;
}

/* A friend's invitation while a game against the bot or at the same table is on: a quiet banner. */
.invite-banner {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: .6em;
  width: min(92vw, 420px);
  padding: .5em .6em .5em .9em;
  transform: translateX(-50%);
  border: .2em solid rgba(0, 0, 0, .35);
  border-radius: 1em;
  background: whitesmoke;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  font: 15px sans-serif;
  animation: invitePeek .35s cubic-bezier(.2, 1.2, .4, 1) both;
}

.invite-banner[hidden] {
  display: none;
}

.invite-banner-text {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.invite-banner-go,
.invite-banner-no {
  padding: .35em .8em;
  border: var(--btn-border);
  border-radius: .5625em;
  font: 1em "Changa One", sans-serif;
  color: #fff;
  cursor: pointer;
}

.invite-banner-go {
  background: rgb(46, 160, 90);
}

.invite-banner-no {
  background: rgb(150, 130, 110);
}

@keyframes invitePeek {
  from { opacity: 0; transform: translate(-50%, -140%); }
}

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


/* Report a problem */
.feedback-text {
  width: 100%;
  min-height: 7em;
  resize: vertical;
  font: 1em/1.4 sans-serif;
  text-align: left;
}

.feedback-shot {
  display: flex;
  align-items: center;
  gap: .8em;
  justify-content: center;
}

.feedback-shot[hidden] {
  display: none;
}

.feedback-shot img {
  max-width: 6em;
  max-height: 5em;
  border: 3px solid rgba(0, 0, 0, .35);
  border-radius: .5625em;
  object-fit: cover;
}

#feedback-email {
  font-size: 1em;
}

/* A name that can't be changed yet (once a day, see nameLockMs in linotte.js). */
.text-input:disabled {
  opacity: .55;
}

/* Normal or Ruthless (see "Normal and Ruthless" in linotte.js): two buttons side by side, the chosen one blue. */
.mode-choice {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Both as wide as each other, unless RUTHLESS needs more room in some language (IMPITOYABLE, IMPLACÁVEL...): then it
   takes what its word needs, with the devil, and NORMAL gives that much up. Never on two lines. */
.mode-choice .mode-btn {
  flex: 1 1 0;
  min-width: 0;
}

.mode-choice .mode-btn[data-mode="ruthless"] {
  min-width: max-content;
}

.mode-choice .mode-btn .text-button {
  white-space: nowrap;
}

/* The chosen one is the saturated blue with white letters; the other is pale, with blue letters (a dimmed button would
   look switched off). The devil has a thin white edge so that it shows on the blue one. */
.mode-btn:not(.is-selected) {
  background-color: #fff;
}

.mode-btn:not(.is-selected) .text-button {
  color: #3a4fcf;
}

.mode-btn .devil-icon {
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff);
}

/* "Once the game starts..." and, on a line of its own, what leaving costs. */
.mode-warn,
#invite-title {
  white-space: pre-line;
}

/* "{name} invites you to play" on one line, then the way to play on the next. */
#invite-title {
  font-size: 1.55em;
}

/* The devil of Ruthless (resources/images/devil-2.svg) inside a text or a button. */
.devil-icon {
  height: 1.15em;
  width: auto;
  vertical-align: -.2em;
}

/* In a Ruthless game the VS (the green chip) is replaced by one drawing, the devil over its own VS
   (resources/images/devil-vs-3.svg, 112 by 162): the cell's background is taken away (.vs.ruthless, see setGameMode in
   linotte.js) and the drawing is centered on the cell, 1.15 times as wide as it (so its own VS is as wide as the old one), and
   grows and shrinks with it. It sits above the players' boxes where it overlaps them. A Normal game keeps the old VS. */
.vs {
  position: relative;
  z-index: 2;
}

.vs.ruthless {
  background-image: none;
}

.mode-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 115%; /* the drawing's own VS is .865 of its width: .995 of the old VS's, as wide as it */
  max-width: none; /* the page's own img { max-width: 100% } would hold it to the cell */
  height: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
  pointer-events: none;
}
