/* Shared account pieces: avatar bubbles, the account sheet, the header chip, and the family
   leaderboard sheet (leaderboard.js). Pages can tune --acct-accent and --acct-ink. */

.avatar {
  --size: 48px;
  --tint: #ffc93c;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--tint);
  color: #241036;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  font-weight: 800;
  font-size: calc(var(--size) * 0.5);
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 -3px 0 rgba(36, 16, 54, 0.18);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* Level borders (shared/rings.js): the ring covers the picture's outer edge, so the bubble keeps its
   size; its trim, laurels and crown reach a little past it; the level number sits on the bottom. */
.avatar .lv-ring { position: absolute; inset: -20%; pointer-events: none; }
.avatar .lv-ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.avatar .lv-pill {
  position: absolute; left: 50%; bottom: calc(var(--size) * -0.09); transform: translateX(-50%);
  min-width: 1.6em; padding: 0.2em 0.42em 0.08em; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lv-pill) 80%, #fff), var(--lv-pill));
  background-color: var(--lv-pill);
  color: #fff; text-align: center; white-space: nowrap; pointer-events: none;
  font: 800 clamp(10px, calc(var(--size) * 0.21), 19px)/1 "Baloo 2", ui-rounded, system-ui, sans-serif;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1.5px var(--lv-pill-edge), 0 2px 4px rgba(20, 6, 34, 0.35);
}
.lv-shine { transform-box: fill-box; transform-origin: center; animation: lv-shine 6s linear infinite; }
@keyframes lv-shine { to { transform: rotate(360deg); } }
.lv-aurora { animation: lv-aurora 9s linear infinite; }
@keyframes lv-aurora { to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lv-shine, .lv-aurora { animation: none; } }

.acct-sheet {
  --acct-ink: #241036;
  --acct-accent: #5a2d8c;
  width: min(440px, 100vw);
  max-width: 100vw;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 28px 28px 0 0;
  background: #fffaf2;
  color: var(--acct-ink);
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  box-shadow: 0 -20px 50px rgba(20, 6, 34, 0.35);
  overflow: auto;
  /* Scrolls itself and never hands a drag to the page behind (lockPage in account.js does the
     rest, for iPhones). Games set touch-action: none on some surfaces; a sheet always pans. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}
@media (min-width: 600px) { .acct-sheet { margin: auto; border-radius: 28px; } }
.acct-sheet::backdrop { background: rgba(26, 10, 44, 0.55); }
.acct-sheet[open] { animation: acct-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes acct-up { from { transform: translateY(40px); opacity: 0; } }

.acct-body { padding: 26px 22px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.acct-sheet h2 { margin: 0 44px 4px 0; font-size: 28px; font-weight: 800; line-height: 1.1; }
.acct-lede { margin: 0 0 16px; font-size: 16px; line-height: 1.35; color: #5d4b6e; }
.acct-close {
  position: sticky; float: right; top: 10px; margin: 10px 10px 0 0; z-index: 1;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #f1e6f7; color: var(--acct-ink); font: 800 26px/1 "Baloo 2", system-ui, sans-serif; cursor: pointer;
}

.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 14px; border-radius: 16px; background: #f1e6f7; }
.acct-tabs button {
  min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: #5d4b6e;
  font: 700 17px/1 "Baloo 2", system-ui, sans-serif; cursor: pointer;
}
.acct-tabs button[aria-selected="true"] { background: #fff; color: var(--acct-ink); box-shadow: 0 2px 6px rgba(36, 16, 54, 0.12); }

.acct-form { display: grid; gap: 12px; }
.acct-field { display: grid; gap: 4px; font-size: 15px; font-weight: 700; color: #5d4b6e; }
.acct-field input {
  min-height: 50px; padding: 8px 14px; border: 2px solid #e2d3ec; border-radius: 14px; background: #fff;
  color: var(--acct-ink); font: 600 18px/1.2 "Baloo 2", system-ui, sans-serif;
}
.acct-field input:focus { outline: none; border-color: var(--acct-accent); }
.acct-field-wrap { display: grid; gap: 4px; }
.acct-note { margin: 0; color: #7a6a88; font-size: 13px; font-weight: 600; line-height: 1.35; }
.acct-note:empty { display: none; }
.acct-note.bad { color: #c2185b; font-size: 14px; font-weight: 700; }
.acct-field input[aria-invalid] { border-color: #c2185b; }
.acct-fix { margin-left: 2px; min-height: 44px; padding: 4px 12px; border: 2px solid #c2185b; border-radius: 999px; background: #fff; color: #c2185b; font: inherit; font-weight: 800; cursor: pointer; }
.acct-error { margin: 0; min-height: 1.2em; color: #c2185b; font-size: 15px; font-weight: 700; }
.acct-error:empty { min-height: 0; }

.acct-primary, .acct-secondary {
  min-height: 52px; padding: 10px 18px; border: 0; border-radius: 16px; cursor: pointer;
  font: 800 19px/1 "Baloo 2", system-ui, sans-serif;
}
.acct-primary { background: var(--acct-accent); color: #fff; box-shadow: 0 4px 0 #3a1760; }
.acct-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #3a1760; }
.acct-primary:disabled { opacity: 0.6; }
.acct-secondary { background: #f1e6f7; color: var(--acct-ink); }
.acct-link {
  min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--acct-accent);
  font: 700 16px/1 "Baloo 2", system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.acct-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 6px; }
.acct-foot { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.acct-foot a.acct-link { display: inline-flex; align-items: center; }

.acct-picture-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.acct-picture .avatar { box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(36, 16, 54, 0.25); }
.acct-picture-actions { display: grid; gap: 4px; justify-items: start; }
.acct-file { display: none; }

.acct-crop-wrap { display: grid; place-items: center; margin: 4px 0 12px; }
.acct-crop {
  width: 260px; height: 260px; border-radius: 50%; touch-action: none; cursor: grab;
  background: #eee; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--acct-accent);
}
.acct-zoom { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; font-weight: 700; margin-bottom: 6px; }
.acct-zoom input { width: 100%; min-height: 44px; accent-color: var(--acct-accent); }

.acct-stats { margin-top: 20px; display: grid; gap: 12px; }
.acct-stats h3 { margin: 0; font-size: 22px; font-weight: 800; }
.acct-stats .acct-lede { margin: 0; }
.acct-stat-game { padding: 12px 14px 14px; border-radius: 18px; background: #f1e6f7; }
.acct-stat-game h4 { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.acct-stat-game dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.acct-stat-game dl > div { padding: 8px 10px; border-radius: 12px; background: #fff; }
.acct-stat-game dt { font-size: 14px; font-weight: 700; color: #5d4b6e; line-height: 1.2; }
.acct-stat-game dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }

.acct-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 60vw; padding: 6px 14px 6px 6px;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: #241036; cursor: pointer;
  font: 700 16px/1 "Baloo 2", system-ui, sans-serif; box-shadow: 0 6px 14px -8px rgba(31, 42, 68, 0.6);
}
.acct-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip:only-child, .acct-chip > span:only-child { padding-left: 8px; }
.acct-chip:focus-visible { outline: 3px solid #241036; outline-offset: 2px; }

/* A game menu's account line (saveLine in account-ui.js). */
.acct-saveline {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px 8px 8px;
  border: 0; border-radius: 18px; background: #f3eefa; color: #241036; text-align: left; cursor: pointer;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
}
.acct-saveline:active { transform: scale(0.98); }
.acct-saveline:focus-visible { outline: 3px solid #5a2d8c; outline-offset: 2px; }
.acct-saveline .avatar { box-shadow: 0 0 0 2px #fff; }
.acct-saveline-icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: #5a2d8c center / 24px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8.5' r='3.6'/%3E%3Cpath d='M5 20c.8-3.7 3.6-5.6 7-5.6s6.2 1.9 7 5.6'/%3E%3C/svg%3E");
}
.acct-saveline-words { display: flex; flex-direction: column; min-width: 0; }
.acct-saveline-words b, .acct-saveline-words small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-saveline-words b { font-size: 17px; font-weight: 800; line-height: 1.2; }
.acct-saveline-words small { font-size: 14px; font-weight: 600; line-height: 1.2; color: #1d8a52; }
.acct-saveline.out .acct-saveline-words b { color: #5a2d8c; }
.acct-saveline.out .acct-saveline-words small { color: #5d4b6e; }
.acct-saveline.warn .acct-saveline-words small { color: #a8560c; }

/* ---------- The family leaderboard sheet (leaderboard.js) ---------- */
/* Tall enough that switching boards doesn't make it jump. The title stays at the top and
   everything under it (games, tabs, the list) scrolls inside the sheet as one area (.lb-scroll). */
.lb-sheet { min-height: min(520px, 76vh); max-height: min(700px, 90vh); overflow: hidden; }
@supports (height: 1dvh) { .lb-sheet { min-height: min(520px, 76dvh); max-height: min(700px, 90dvh); } }
.lb-sheet.is-out { min-height: 0; } /* just the sign-in prompt */
.lb-sheet[open] { display: flex; flex-direction: column; }
.lb-head { position: relative; flex: none; padding: 22px 16px 10px; box-shadow: 0 1px 0 #efe3f5; }
.lb-head .acct-close { position: absolute; top: 12px; right: 12px; margin: 0; float: none; }
.lb-head h2 { margin: 0 52px 0 4px; }
.lb-scroll {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: manipulation;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
}

.lb-games {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 10px; padding: 0 40px 0 10px;
  border-radius: 16px; background: var(--acct-accent); color: #fff; box-shadow: 0 3px 0 #3a1760; cursor: pointer;
}
.lb-games::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); pointer-events: none;
}
.lb-pick-icon { flex: none; width: 32px; height: 32px; border-radius: 9px; }
.lb-pick {
  flex: 1 1 auto; min-width: 0; min-height: 52px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit;
  font: 800 18px/1.1 "Baloo 2", system-ui, sans-serif; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.lb-pick option { color: #2b1d38; background: #fff; }
.lb-games:focus-within { outline: 3px solid var(--acct-ink); outline-offset: 2px; }

.lb-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 2px solid #e6d8ef; border-radius: 999px; background: #fff; color: #5d4b6e; cursor: pointer;
  font: 700 16px/1 "Baloo 2", system-ui, sans-serif; white-space: nowrap;
}
.lb-tab[aria-selected="true"] { background: var(--acct-accent); border-color: var(--acct-accent); color: #fff; }
.lb-tab.weekly { border-color: #bfe3cc; }
.lb-tab.weekly::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-left: -4px; background: currentColor;
  -webkit-mask: var(--lb-calendar) center / contain no-repeat; mask: var(--lb-calendar) center / contain no-repeat;
}
.lb-tab.weekly[aria-selected="true"] { background: #1d7a4a; border-color: #1d7a4a; }
.lb-sheet {
  --lb-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='3'/%3E%3Cpath d='M4 10h16M9 3v4M15 3v4'/%3E%3C/svg%3E");
}
.lb-tab:focus-visible, .lb-open:focus-visible { outline: 3px solid var(--acct-ink); outline-offset: 2px; }

.lb-panel { padding-top: 2px; }
.lb-caption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px;
  margin: 10px 4px 8px; font-size: 16px; font-weight: 700; line-height: 1.2; color: #5d4b6e;
}
.lb-reset { padding: 3px 10px; border-radius: 999px; background: #e1f4e8; color: #1d6b45; font-size: 14px; font-weight: 800; max-width: 100%; border-radius: 14px; }
.lb-note { margin: 24px 8px 16px; font-size: 18px; font-weight: 700; line-height: 1.3; text-align: center; color: #5d4b6e; }
.lb-action { display: block; min-width: 180px; margin: 0 auto 10px; }

.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lb-list li { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px 6px 8px; border-radius: 16px; background: #f6f0fa; }
.lb-list li.me { background: #fff1d6; box-shadow: inset 0 0 0 3px #f2b84b; }
.lb-list li.lb-gap { min-height: 0; padding: 0; background: none; justify-content: center; color: #9a8aa8; font-weight: 800; line-height: 1; }
.lb-list .avatar { box-shadow: 0 0 0 2px #fff; }
.lb-rank {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 17px; font-weight: 800; color: #5d4b6e; font-variant-numeric: tabular-nums;
}
.lb-rank.top1 { background: #ffd34d; color: #6b4a00; }
.lb-rank.top2 { background: #dfe4ec; color: #3f4a5c; }
.lb-rank.top3 { background: #f4c7a1; color: #6b3a14; }
.lb-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-value { flex: none; max-width: 50%; font-size: 16px; font-weight: 800; line-height: 1.15; text-align: right; font-variant-numeric: tabular-nums; }
/* The admins' playtime boards: who sees them, and the past 24 hours and 3 days under each total. */
.lb-admin-note { margin: -2px 4px 10px; font-size: 14px; font-weight: 700; line-height: 1.3; color: #7a6a88; }
.lb-recent { display: flex; flex-direction: column; align-items: flex-end; margin-top: 3px; font-size: 13px; font-weight: 800; line-height: 1.2; color: #1d6b45; }
.lb-recent span { white-space: nowrap; }
.lb-recent i { font-style: normal; font-weight: 700; color: #8a7a98; }
.lb-recent .none { color: #9a8aa8; }

/* A game menu's leaderboard row (leaderboardButton in leaderboard.js). */
.lb-open {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px 8px 8px;
  border: 0; border-radius: 18px; background: #fff3d9; color: #241036; text-align: left; cursor: pointer;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
}
.lb-open:active { transform: scale(0.98); }
.lb-open-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e9a325; color: #fff; }
.lb-open-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lb-open-words { display: flex; flex-direction: column; min-width: 0; }
.lb-open-words b { font-size: 17px; font-weight: 800; line-height: 1.2; }
.lb-open-words small { font-size: 14px; font-weight: 600; line-height: 1.2; color: #8a5a12; }

/* ---------- Levels, badges and playtime in the account sheet (account-ui.js) ---------- */
.lv-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 22px; margin: 6px 0 14px; padding: 18px 16px 16px 22px; border-radius: 22px; background: linear-gradient(160deg, #2f1652, #5a2d8c 70%, #7a3fae); color: #fff; }
.lv-card .avatar { box-shadow: 0 6px 16px rgba(10, 2, 20, 0.45); }
.lv-card-words { min-width: 0; }
.lv-card-name { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-card-level { margin: 2px 0 8px; font-size: 17px; font-weight: 700; line-height: 1.2; color: #f1e3ff; }
.lv-featured { display: flex; gap: 6px; }
.lv-featured .lv-slot {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px dashed rgba(255, 255, 255, 0.45); border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.7); font: 800 20px/1 "Baloo 2", system-ui, sans-serif; cursor: pointer;
}
.lv-featured .lv-slot.filled { border: 0; background: none; }
.lv-featured .lv-slot svg { width: 44px; height: 44px; display: block; }
.lv-xp { margin: 0 0 14px; }
.lv-xp-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 700; color: #5d4b6e; }
.lv-xp-head b { color: var(--acct-ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.lv-bar { position: relative; height: 16px; border-radius: 999px; background: #eadff2; overflow: hidden; box-shadow: inset 0 2px 3px rgba(36, 16, 54, 0.15); }
.lv-bar i { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); border-radius: inherit; background: linear-gradient(90deg, #ffb347, #ffd75e); box-shadow: inset 0 -3px 0 rgba(160, 90, 0, 0.25); transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1); }
.lv-next { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 12px 14px 12px 18px; border-radius: 18px; background: #f6f0fa; }
.lv-next p { margin: 0; font-size: 16px; line-height: 1.3; color: #5d4b6e; }
.lv-next b { color: var(--acct-ink); }
.lv-levelup { margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; background: #fff1d6; box-shadow: inset 0 0 0 2px #f2b84b; font-size: 17px; font-weight: 800; color: #6b4a00; }
.lv-note { margin: 4px 0 0; font-size: 15px; line-height: 1.35; color: #5d4b6e; }

.lv-section { margin-top: 22px; }
.lv-section h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 52px 8px 0; font-size: 22px; font-weight: 800; }
.lv-section h3 small { font-size: 15px; font-weight: 700; color: #5d4b6e; }
.lv-group { margin: 0 0 10px; padding: 10px 10px 8px; border-radius: 18px; background: #f6f0fa; }
.lv-group h4 { display: flex; justify-content: space-between; gap: 8px; margin: 0 4px 6px; font-size: 16px; font-weight: 800; }
.lv-group h4 small { font-size: 14px; font-weight: 700; color: #7a6a88; }
.lv-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; }
.lv-badge {
  position: relative; display: grid; place-items: center; min-height: 58px; padding: 2px; border: 0; border-radius: 14px;
  background: none; cursor: pointer;
}
.lv-badge svg { width: 52px; height: 52px; display: block; }
.lv-badge svg.locked { filter: grayscale(1) opacity(0.38); }
.lv-badge.new::after { content: "New"; position: absolute; top: 0; right: 0; padding: 2px 5px 0; border-radius: 999px; background: #e5484d; color: #fff; font: 800 11px/1.2 "Baloo 2", system-ui, sans-serif; }
.lv-badge:focus-visible, .lv-slot:focus-visible { outline: 3px solid var(--acct-ink); outline-offset: 1px; }
.lv-badge:active { transform: scale(0.94); }

.lv-badge-sheet .acct-body { text-align: center; }
.lv-badge-big svg { width: 132px; height: 132px; }
.lv-badge-sheet h2 { margin: 6px 0 2px; }
.lv-badge-meta { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #7a6a88; }
.lv-badge-desc { margin: 0 0 16px; font-size: 18px; line-height: 1.35; }
.lv-badge-sheet .acct-primary, .lv-badge-sheet .acct-secondary { width: 100%; }

.lv-play { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lv-play li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #f6f0fa; }
.lv-play li span { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-play li b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-play li i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: #eadff2; overflow: hidden; }
.lv-play li i::before { content: ""; display: block; width: var(--pct, 0%); height: 100%; border-radius: inherit; background: #8a5bd0; }
.lv-play-total { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; font-size: 16px; color: #5d4b6e; }
.lv-play-total b { color: var(--acct-ink); }

.lv-tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 6px 0 16px; padding: 16px 4px 10px; border-radius: 18px; background: #f6f0fa; }
.lv-tiers figure { display: grid; justify-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; color: #5d4b6e; white-space: nowrap; }
.lv-nudge { margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: #fff1d6; font-size: 16px; line-height: 1.35; color: #6b4a00; }

/* A player's card, from a leaderboard row (leaderboard.js). */
.lb-list li.lb-tappable { cursor: pointer; }
.lb-list li.lb-tappable:active { transform: scale(0.98); }
.lb-card { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; background: #fffaf2; text-align: center; }
.lb-card .avatar { margin-bottom: 18px; }
.lb-card h3 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-card p { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: #5d4b6e; }
.lb-card-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 18px; }
.lb-card-badges figure { display: grid; justify-items: center; gap: 2px; width: 96px; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.15; color: #5d4b6e; }
.lb-card-badges svg { width: 64px; height: 64px; }
.lb-card .acct-secondary { min-width: 160px; }

@media (prefers-reduced-motion: reduce) {
  .acct-sheet[open] { animation: none; } .lb-open:active { transform: none; }
  .lv-bar i { transition: none; } .lv-badge:active, .lb-list li.lb-tappable:active { transform: none; }
}

/* The sign-in gate (account-ui.js requireAccount): a full-screen card over any page until someone is signed in. */
.acct-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background: var(--acct-gate-bg, #1d1330);
  color: var(--acct-gate-ink, #fff7e6);
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  overflow-y: auto;
}
.acct-gate.checking { background: var(--acct-gate-bg, #1d1330); }
.acct-gate-card {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  justify-items: stretch;
  text-align: center;
}
.acct-gate-paw { justify-self: center; width: 64px; height: 64px; color: #ffc93c; }
.acct-gate-paw svg { width: 100%; height: 100%; fill: currentColor; }
.acct-gate h1 { margin: 0; font-size: 2rem; line-height: 1.1; }
.acct-gate p { margin: 0 0 8px; font-size: 1.05rem; opacity: 0.85; }
.acct-gate .acct-gate-note { color: #ffd37a; opacity: 1; }
.acct-gate button { min-height: 48px; font-size: 1.1rem; }
.acct-gate .acct-primary { background: #ffc93c; color: #241036; box-shadow: 0 4px 0 #a87a00; }
.acct-gate .acct-primary:active { box-shadow: 0 2px 0 #a87a00; }
.acct-gate .acct-secondary { background: #f1e6f7; color: #241036; }

/* Requests and comments (shared/feedback.js): the sheet, your notes under it, and the one-time card. */
.fb-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-kind {
  min-height: 48px; padding: 6px 10px; border: 2px solid #e2d3ec; border-radius: 14px; background: #fff; cursor: pointer;
  color: #5d4b6e; font: 700 16px/1.15 "Baloo 2", system-ui, sans-serif;
}
.fb-kind[aria-checked="true"] { border-color: var(--acct-accent); background: #f1e6f7; color: var(--acct-ink); }
.fb-kind:focus-visible, .fb-text:focus-visible, .fb-game:focus-visible { outline: 3px solid var(--acct-accent); outline-offset: 2px; }
.fb-game-row[hidden] { display: none; }
.fb-game, .fb-text {
  width: 100%; box-sizing: border-box; border: 2px solid #e2d3ec; border-radius: 14px; background: #fff; color: var(--acct-ink);
  font: 600 17px/1.35 "Baloo 2", system-ui, sans-serif;
}
.fb-game { min-height: 48px; padding: 6px 12px; }
.fb-text { min-height: 130px; padding: 10px 14px; resize: vertical; -webkit-user-select: text; user-select: text; }
.fb-text:focus { outline: none; border-color: var(--acct-accent); }
.fb-thanks { display: grid; gap: 6px; text-align: center; }
.fb-thanks-big { margin: 6px 0 0; font-size: 26px; font-weight: 800; color: var(--acct-accent); }
.fb-mine-title { margin: 22px 0 8px; font-size: 19px; font-weight: 800; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-item { padding: 10px 14px; border-radius: 16px; background: #f1e6f7; }
.fb-item-top { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #5d4b6e; }
.fb-item-kind { flex: 1; min-width: 0; }
.fb-status { padding: 1px 10px; border-radius: 999px; background: #fff; font-size: 13px; }
.fb-status.s-planned { background: #fff2c2; color: #6b4a00; }
.fb-status.s-done { background: #d8f2dc; color: #1d5a2a; }
.fb-item-text { margin: 4px 0 0; font-size: 16px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-reply { margin: 6px 0 0; padding: 6px 10px; border-radius: 12px; background: #fff; font-size: 15px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-when { display: block; margin-top: 4px; font-size: 13px; color: #7a6a88; }
.fb-intro-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 6px 0 10px; border-radius: 50%; background: #f1e6f7; color: var(--acct-accent); }
.fb-intro-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fb-intro-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 8px; }
