/* ==========================================================
   MY TOP - "stage" look (my-top.html only, loaded after
   style.css). A mid-tone blue-violet stage behind the whole page,
   glass cards with heart flags, big years and labelled status
   pills - lighter than the dark home-screen list it's based on.
   Everything is scoped to .mt-stage so no other page changes.
   ========================================================== */

/* ---------- Hero ---------- */

.mt-stage .mr-hero {
  max-width: none;
  margin: 0;
  padding: 34px 0 26px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mt-stage .mr-hero-floor {
  display: none;
}

.mt-stage .mr-hero-beam {
  /* the stage behind already has its own beams */
  display: none;
}

/* One width for every section, edge to edge of the page column */
.mt-stage .my-ranking-account,
.mt-stage #myRankingBody {
  max-width: none;
  padding-inline: 0;
}

.mt-stage .mr-hero {
  overflow: visible;
}

.mt-stage .mr-hero h1 {
  background: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 4px 24px rgba(40, 30, 130, .25);
}

.mt-stage .mr-hero-kicker {
  color: var(--mt-gold);
}

.mt-stage .mr-hero-sub {
  color: var(--mt-ink-soft);
}

.mt-stage .mr-hero-btn {
  border: 1px solid var(--mt-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: none;
}

.mt-stage .mr-hero-btn.primary {
  border-color: #fff;
  background: #fff;
  color: var(--mt-mid);
}

@media (hover: hover) {
  .mt-stage .mr-hero-btn.ghost:hover {
    background: rgba(255, 255, 255, .24);
  }
}

.mt-stage .mr-hero-btn:focus-visible {
  outline: 2px solid var(--mt-gold);
  outline-offset: 2px;
}

.mt-stage .mr-hero-stats,
.mt-stage .mr-hero-stats span {
  color: var(--mt-ink-dim);
}

.mt-stage .mr-hero-stats b {
  color: #fff;
}

/* Example of the finished share image (drawn by drawShareImage) */
.mt-stage .mr-hero-preview {
  display: grid;
  gap: 10px;
  width: min(100%, 380px);
  margin: 0;
  justify-items: center;
}

.mt-stage .mr-hero-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(40, 30, 120, .35);
  transform: rotate(2deg);
}

.mt-stage .mr-hero-preview figcaption {
  color: var(--mt-ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.mt-stage .mr-hero-side[hidden] {
  display: none;
}

/* While ranking: a slim banner */
.mt-stage .mr-hero.is-compact {
  padding-top: 18px;
  padding-bottom: 10px;
}


/* ---------- Account bar (account + contest / decade switches) ---------- */

.mt-stage .mr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 16px;
  padding: 12px 16px;
}

.mt-stage .mr-toolbar-who {
  display: grid;
  flex: 0 1 auto;
  gap: 2px;
  min-width: 0;
  text-align: start;
}

.mt-stage .mr-toolbar:not(.signed-in) .mr-toolbar-who {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.mt-stage .mr-toolbar:not(.signed-in) .my-ranking-account-note {
  flex: 1 1 200px;
}

.mt-stage .mr-toolbar-name {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mt-stage .mr-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--mt-ink-soft);
  font-family: Heebo, "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 12.5px;
}

.mt-stage .mr-toolbar-check {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #4aa3ff;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.mt-stage .mr-toolbar-signout {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.mt-stage .mr-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.mt-stage .mr-toolbar-controls[hidden] {
  display: none;
}

.mt-stage img.mr-avatar {
  object-fit: cover;
}

/* No numbered steps / second mode switch - the header buttons choose */
.mt-stage .mr-step-num,
.mt-stage .mr-switch-row {
  display: none;
}

.mt-stage .mr-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.mt-stage .mr-list-head .mr-step-head {
  margin: 0;
}

.mt-stage .mr-legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}


/* ---------- Account strip ---------- */

.mt-stage .my-ranking-account {
  margin-top: 6px;
}

.mt-stage .my-ranking-account-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border: 1px solid var(--mt-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
  color: #fff;
}

.mt-stage .my-ranking-account-note {
  flex: 1 1 220px;
  margin: 0;
  color: var(--mt-ink-soft);
}

.mt-stage .my-ranking-account-note strong {
  color: #fff;
}

.mt-stage .mr-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #ffe6f4);
  color: var(--mt-mid);
  font-size: 17px;
  font-weight: 900;
}

.mt-stage .my-ranking-account-error {
  color: #ffe0ea;
}

.mt-stage .my-ranking-invite-notice {
  border-color: var(--mt-gold);
  background: rgba(255, 216, 77, .2);
  color: #fff;
}


/* ---------- Pills (contest / decade / mode switches) ---------- */

.mt-stage .competition-switch {
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--mt-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  box-shadow: none;
}

.mt-stage .competition-switch-button {
  min-width: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--mt-ink-soft);
  font-weight: 800;
  box-shadow: none;
}

.mt-stage .competition-switch-button:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  box-shadow: none;
}

.mt-stage .competition-switch-button.active {
  background: #fff;
  background-image: none;
  color: var(--mt-mid);
  box-shadow: 0 4px 12px rgba(40, 30, 130, .2);
}

.mt-stage .competition-switch-button:focus-visible {
  outline: 2px solid var(--mt-gold);
}

.mt-stage .mr-decade-switch .competition-switch-button {
  padding: 7px 14px;
  font-size: 13px;
}


/* ---------- Filters ---------- */

.mt-stage .mr-filters {
  --mr-navy: #fff;
  --mr-muted: var(--mt-ink-soft);
  --mr-accent: var(--mt-gold);

  padding: 22px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.mt-stage .mr-step-head h2,
.mt-stage .mr-round-panel h3 {
  color: #fff;
}

.mt-stage .mr-step-num {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--mt-line);
}

.mt-stage .mr-legend,
.mt-stage .mr-legend > span:not(.mr-pill) {
  color: var(--mt-ink-soft);
}

.mt-stage .mr-link-back,
.mt-stage .my-ranking-back {
  color: var(--mt-ink-soft);
}

.mt-stage .mr-choice-list {
  gap: 10px;
}

/* The card */
.mt-stage .mr-choice {
  gap: 14px;
  min-height: 66px;
  padding: 11px 16px;
  border: 1px solid var(--mt-line);
  border-radius: 16px;
  background: linear-gradient(120deg, var(--mt-glass-a), var(--mt-glass-b));
  box-shadow: 0 6px 18px rgba(40, 30, 120, .16), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff;
}

.mt-stage .mr-choice:hover {
  filter: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .12));
  box-shadow: 0 10px 24px rgba(40, 30, 120, .22), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.mt-stage .mr-choice:focus-visible {
  outline: 2px solid var(--mt-gold);
}

.mt-stage .mr-choice.is-new {
  border-color: rgba(62, 224, 166, .85);
  box-shadow: 0 0 0 1px rgba(62, 224, 166, .4), 0 0 22px rgba(62, 224, 166, .35);
}

.mt-stage .mr-choice-heart {
  width: 46px;
}

.mt-stage .mr-choice-heart .my-ranking-heart-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 3px rgba(30, 20, 90, .35));
}

.mt-stage .mr-choice-year {
  background: rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 0 1px var(--mt-line);
}

.mt-stage .mr-choice-text strong {
  color: #fff;
}

.mt-stage .mr-choice-text strong.mr-choice-big {
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.mt-stage .mr-choice-text small {
  overflow: hidden;
  color: var(--mt-ink-soft);
  font-family: Heebo, "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-stage .mr-choice-cancelled {
  color: #ffd0dc;
}


/* ---------- Status pills ---------- */

.mr-pill-label {
  display: none;
}

.mt-stage .mr-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mt-stage .mr-pill .mr-pill-label {
  display: inline;
}

.mt-stage .mr-pill .mr-mark {
  display: none;
}

.mt-stage .mr-pill .mr-mark-count {
  display: none;
}

.mt-stage .mr-pill-done {
  background: var(--mt-gold);
  color: #3a2a00;
}

.mt-stage .mr-pill-done::before {
  content: "✓";
}

.mt-stage .mr-pill-partial {
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  letter-spacing: .02em;
}

.mt-stage .mr-pill-new {
  background: var(--mt-green);
  color: #0f5c43;
}

/* Guests: rounds / modes that need a Google account */
.mt-stage .mr-pill-lock {
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  letter-spacing: 0;
}

/* Special-ranking cards stack icon / text - the lock sits in the corner */
.mt-stage .mr-special {
  position: relative;
}

.mt-stage .mr-special .mr-pill-lock {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
}

.mt-stage .mr-guest-lock {
  margin: 0 0 12px;
  color: var(--mt-ink-soft);
  font-size: 13px;
  font-weight: 600;
}

/* The legend keeps its small dots */
.mt-stage .mr-legend .mr-mark-done {
  background: var(--mt-gold);
  color: #3a2a00;
}


/* ---------- Ranking (pick) screen ---------- */

.mt-stage .my-ranking-pick {
  padding-top: 18px;
}

.mt-stage .my-ranking-pick-header,
.mt-stage .my-ranking-pick-header h2 {
  color: #fff;
}

.mt-stage .my-ranking-pick-header p {
  color: var(--mt-ink-soft);
}

.mt-stage .mr-rank-count strong {
  color: var(--mt-gold);
}

.mt-stage .my-ranking-finish-hint {
  color: #fff;
}

.mr-progress {
  display: none;
}

.mt-stage .mr-progress {
  display: block;
  height: 8px;
  max-width: 420px;
  margin: 8px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
}

.mt-stage .mr-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mt-gold), var(--mt-pink));
  transition: width .25s ease;
}

.mt-stage .my-ranking-primary-button {
  border-radius: 999px;
  background: var(--mt-pink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(200, 40, 130, .3);
}

.mt-stage .my-ranking-primary-button:disabled {
  background: rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .8);
  box-shadow: none;
}

.mt-stage .my-ranking-search {
  border: 1px solid var(--mt-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #1f2547;
}

.mt-stage .my-ranking-reset {
  border-color: rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.mt-stage .mr-divider span {
  color: var(--mt-gold);
}

.mt-stage .mr-divider span::before,
.mt-stage .mr-divider span::after {
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .45);
}

.mt-stage .mr-divider small {
  color: var(--mt-ink-soft);
}

/* Ranked rows: light cards so the gold / silver / bronze tones read */
.mt-stage .my-ranking-pick .my-ranking-list-row:not(.is-pending) {
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(40, 30, 120, .14);
}

.mt-stage .my-ranking-pick .my-ranking-list-row.rank-blue {
  background: rgba(255, 255, 255, .94);
}

/* Not ranked yet: dashed glass cards */
.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending {
  border: 1px dashed rgba(255, 255, 255, .5);
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  box-shadow: none;
  color: #fff;
  opacity: 1;
}

.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending .my-ranking-list-text,
.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending .my-ranking-list-heart {
  opacity: 1;
}

.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending .my-ranking-list-text strong {
  color: #fff;
}

.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending .my-ranking-list-text small {
  color: var(--mt-ink-soft);
}

.mt-stage .my-ranking-pick .my-ranking-list-rank.mr-plus {
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--mt-mid);
  font-weight: 900;
}

.mt-stage .my-ranking-pick .my-ranking-list-row.is-pending .my-ranking-list-grip {
  color: var(--mt-ink-dim);
}

/* Saved / loaded notices under the header */
.mt-stage .my-ranking-saved-notice,
.mt-stage .my-ranking-saved-notice.muted,
.mt-stage .my-ranking-save-status {
  /* style.css sets these with !important */
  color: var(--mt-ink-soft) !important;
}

.mt-stage .my-ranking-save-status.error {
  color: #ffe0ea;
}


/* ---------- Result + My Group: white sheets on the stage ---------- */

.mt-stage .my-ranking-result {
  padding-top: 18px;
  color: #fff;
}

.mt-stage .my-ranking-result h2 {
  color: #fff;
}

.mt-stage .my-ranking-secondary-button {
  border-color: #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.mt-stage .mg .my-ranking-back {
  color: #3656b4;
}

.mt-stage .mg {
  margin-top: 18px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  color: #17213b;
  box-shadow: 0 12px 34px rgba(40, 30, 120, .2);
}


/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .mt-stage {
    padding: 0 14px 28px;
  }

  .mt-stage .mr-hero {
    padding: 24px 0 18px;
  }

  /* Header as in the phone sketch: title, line, four mode tiles */
  .mt-stage .mr-hero-side,
  .mt-stage .mr-hero-stats {
    display: none;
  }

  .mt-stage .mr-hero h1 {
    font-size: 44px;
  }

  .mt-stage .mr-hero-sub {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .mt-stage .mr-hero-cta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .mt-stage .mr-hero-btn {
    min-height: 88px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    min-width: 0;
    padding: 11px 4px;
    border-radius: 16px;
    font-size: 11.5px;
    line-height: 1.15;
    text-align: center;
  }

  .mt-stage .mr-hero-btn span {
    font-size: 20px;
  }

  .mt-stage .mr-toolbar {
    padding: 12px;
  }

  .mt-stage .mr-toolbar.signed-in .mr-toolbar-who {
    flex: 1;
  }

  .mt-stage .mr-filters {
    padding: 14px 0 0;
  }

  .mt-stage .mr-toolbar-controls {
    width: 100%;
    margin-inline-start: 0;
  }

  .mt-stage .mr-toolbar-controls .competition-switch {
    width: 100%;
  }

  .mt-stage .mr-contest-switch .competition-switch-button {
    flex: 1;
  }

  .mt-stage .mr-choice-list.two-columns.mr-year-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .mt-stage .mr-choice {
    min-height: 62px;
    padding: 10px 14px;
  }

  .mt-stage .mr-choice-text strong.mr-choice-big {
    font-size: 23px;
  }

  /* Two cards a row (countries, rounds): smaller heart, names wrap */
  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice {
    gap: 9px;
    padding: 9px 10px;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-heart {
    width: 32px;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-heart .my-ranking-heart-icon {
    width: 30px;
    height: 30px;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-text strong,
  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-text small {
    overflow-wrap: break-word;
    white-space: normal;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-text strong {
    font-size: 13.5px;
  }

  /* The status pill goes under the name instead of squeezing it */
  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 6px;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice-heart {
    grid-row: span 2;
  }

  .mt-stage .mr-choice-list.two-columns:not(.mr-year-list) .mr-choice > .mr-pill {
    grid-column: 2;
    justify-self: start;
  }

  /* Cards without a heart (rounds, special rankings): one column -
     name, song count, then the tag */
  .mt-stage .mr-choice-list.two-columns .mr-choice:not(:has(.mr-choice-heart, .mr-choice-year)) {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .mt-stage .mr-choice-list.two-columns .mr-choice:not(:has(.mr-choice-heart, .mr-choice-year)) > .mr-pill {
    grid-column: 1;
  }

  /* Smaller tags on phones */
  .mt-stage .mr-choice > .mr-pill {
    padding: 3px 8px;
    font-size: 9.5px;
  }

  .mt-stage .competition-switch-button {
    padding: 8px 13px;
    font-size: 13px;
  }

  .mt-stage .mr-decade-switch {
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }

  /* Finish button stays in reach at the bottom while ranking */
  .mt-stage .my-ranking-pick-header #myRankingFinish {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
  }

  .mt-stage .mg {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mt-stage .mr-progress i {
    transition: none;
  }
}


/* Jumps to a section (hero buttons, round picker) land below the
   fixed top bar */
body.mt-page #myRankingAccount,
body.mt-page #myRankingBody,
body.mt-page .mr-round-panel {
  scroll-margin-top: calc(var(--mt-bar-height) + 16px);
}


/* ==========================================================
   MY GROUP - a white sheet on the stage, so everything inside
   uses dark text: light cards, a light contest switch
   ========================================================== */

.mt-stage .mg {
  --mg-ink: #16235e;
  --mg-muted: #65708a;
  --mg-line: #e3e6f3;

  padding: 26px 28px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 22px 50px rgba(30, 20, 110, .22);
  color: var(--mg-ink);
}

.mt-stage .mg :is(h1, h2, h3, h4),
.mt-stage .mg .mr-step-head h2 {
  color: var(--mg-ink);
}

.mt-stage .mg :is(p, .muted, .mg-muted) {
  color: var(--mg-muted);
}

/* Inner cards: soft tinted panels */
.mt-stage .mg .mg-card {
  border: 1px solid var(--mg-line);
  border-radius: 20px;
  background: #fbfbff;
  box-shadow: none;
}

/* Contest switch: light track, violet active pill */
.mt-stage .mg .competition-switch {
  border: 0;
  background: #eef0fb;
}

.mt-stage .mg .competition-switch-button {
  color: #4a4f86;
}

.mt-stage .mg .competition-switch-button:hover {
  background: #fff;
  color: var(--mt-mid);
}

.mt-stage .mg .competition-switch-button.active {
  background: var(--mt-mid);
  color: #fff;
}

/* Year / country cards: white with a hairline, like a list on paper */
.mt-stage .mg .mr-choice {
  border: 1px solid var(--mg-line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 20, 110, .06);
  color: var(--mg-ink);
}

.mt-stage .mg .mr-choice:hover {
  border-color: #c9cdf0;
  background: #f6f5ff;
  box-shadow: 0 6px 16px rgba(30, 20, 110, .1);
}

.mt-stage .mg .mr-choice-text strong {
  color: var(--mg-ink);
}

.mt-stage .mg .mr-choice-text small {
  color: var(--mg-muted);
}

.mt-stage .mg .mr-choice-cancelled {
  color: #c2185b;
}

.mt-stage .mg .mr-choice-year {
  background: var(--mg-ink);
  box-shadow: none;
}

/* Buttons that were white-on-glass */
.mt-stage .mg :is(.my-ranking-secondary-button, .my-ranking-back) {
  border-color: #d5d8f0;
  background: #fff;
  color: var(--mt-mid);
}

.mt-stage .mg .my-ranking-secondary-button:hover {
  background: #f3f2ff;
}

@media (max-width: 760px) {
  .mt-stage .mg {
    padding: 18px 14px;
    border-radius: 22px;
  }
}

.mt-stage .mg :is(.mr-link-back, .my-ranking-back) {
  color: var(--mt-mid);
}


/* What is being ranked (All songs / Final / Semi Final...) beside the
   year on the ranking and image screens */
.mr-round-chip {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--mt-gold, #ffd84d);
  color: #3a2a00;
  font-size: .5em;
  font-weight: 800;
  letter-spacing: .04em;
  vertical-align: middle;
  white-space: nowrap;
}

/* Back buttons ("Change selection", "Back to editing"): a clear glass
   pill instead of a small text link */
.mt-stage :is(.my-ranking-pick, .my-ranking-result) .my-ranking-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 18px 10px 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease;
}

.mt-stage :is(.my-ranking-pick, .my-ranking-result) .my-ranking-back:hover {
  background: rgba(255, 255, 255, .32);
}

.mt-stage :is(.my-ranking-pick, .my-ranking-result) .my-ranking-back:focus-visible {
  outline: 2px solid var(--mt-gold);
  outline-offset: 2px;
}


/* ==========================================================
   EVERYONE'S AVERAGE (ranking screen)
   ========================================================== */

.mr-pick-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* A quiet link under "Finish & create image", not a second big button */
.mt-stage .mr-average-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: rgba(255, 255, 255, .82);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .4);
  text-underline-offset: 3px;
  cursor: pointer;
}

.mt-stage .mr-average-button:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.mt-stage .mr-average-button:focus-visible {
  outline: 2px solid var(--mt-gold);
  outline-offset: 2px;
}

.mr-average-overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(24, 18, 60, .55);
}

.mr-average-overlay[hidden] {
  display: none;
}

.mr-average-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(84vh, 760px);
  overflow-y: auto;
  padding: 24px 22px 20px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(20, 10, 70, .4);
  color: #16235e;
  font-family: Montserrat, Heebo, "Noto Sans Hebrew", Arial, sans-serif;
}

.mr-average-panel h3 {
  margin: 0 40px 4px 0;
  font-size: 22px;
  font-weight: 900;
}

html[dir="rtl"] .mr-average-panel h3 {
  margin: 0 0 4px 40px;
}

.mr-average-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef0fb;
  color: #4b45c4;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.mr-average-note {
  margin: 0 0 14px;
  color: #65708a;
  font-family: Heebo, "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.mr-average-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mr-average-row {
  display: grid;
  grid-template-columns: 30px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 8px;
  border: 1px solid #eceef8;
  border-radius: 14px;
  background: #fff;
}

.mr-average-row.g1 { background: linear-gradient(90deg, #fff1b8, #fffaf0); }
.mr-average-row.g2 { background: linear-gradient(90deg, #e3e7ef, #fbfcfe); }
.mr-average-row.g3 { background: linear-gradient(90deg, #f6dfcc, #fffaf6); }

.mr-average-place {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3b3f86;
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
}

.mr-average-row.g1 .mr-average-place { background: #b8860b; }
.mr-average-row.g2 .mr-average-place { background: #6b7280; }
.mr-average-row.g3 .mr-average-place { background: #a0623a; }

.mr-average-heart .my-ranking-heart-icon {
  width: 28px;
  height: 28px;
}

.mr-average-text {
  display: grid;
  min-width: 0;
}

.mr-average-text strong {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mr-average-text small {
  overflow: hidden;
  color: #65708a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mr-average-score {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef0fb;
  color: #4b45c4;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
