/* The Career page (js/ui/career.js): the header card, Stats and Badges, the badge shields, the results'
   New badges box, badge toasts and the lobby profile card's way in. Class prefix: cr- (rs-badge for the
   results box). Built on the tokens in base.css and the panel pieces in menus.css. */

/* ---------------------------------------------------------------- shields */

.cr-shield {
  --face: #e6edf7;
  --rim: #ffffff;
  --dark: rgba(18, 32, 58, 0.07);
  --ico: var(--g, var(--blue));
  position: relative;
  display: inline-block;
  flex: none;
  width: 64px;
  height: 72px;
}
.cr-sh, .cr-sh-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.cr-sh-edge { fill: var(--ink); }
.cr-sh-rim { fill: var(--rim); }
.cr-sh-face { fill: var(--face); }
.cr-sh-dark { fill: var(--dark); }
.cr-sh-shine { fill: #fff; opacity: 0.32; }
.cr-sh-ico {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 46%;
  height: 46%;
  color: var(--ico);
  transform: translate(-50%, -50%);
}
.cr-sh-ico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cr-shield.t0 .cr-sh-ico { opacity: 0.7; }
.cr-shield.t1 { --face: #d9874a; --rim: #f7c99f; --dark: rgba(96, 40, 0, 0.2); --ico: #fff; }
.cr-shield.t2 { --face: #aebbcd; --rim: #ffffff; --dark: rgba(30, 50, 84, 0.18); --ico: #fff; }
.cr-shield.t3 { --face: #ffbf1f; --rim: #fff3ad; --dark: rgba(150, 80, 0, 0.2); --ico: #fff; }
.cr-shield:not(.t0) .cr-sh-ico { filter: drop-shadow(0 2px 0 rgba(18, 32, 58, 0.55)); }
/* Gold glows a little (a soft halo behind, no filter over the face). */
.cr-shield.t3::before {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 210, 63, 0.55), transparent);
}
.cr-shield.t3 .cr-sh { z-index: 1; }
.cr-shield.t3 .cr-sh-ico { z-index: 2; }
/* A little four-point sparkle on gold, top right. */
.cr-shield.t3::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -4%;
  right: -6%;
  width: 34%;
  height: 34%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 0c1 6.5 5.5 11 12 12-6.5 1-11 5.5-12 12-1-6.5-5.5-11-12-12C6.5 11 11 6.5 12 0z' fill='%23ffffff' stroke='%2312203a' stroke-width='1.6' stroke-linejoin='round'/></svg>") center / contain no-repeat;
}
.cr-mini.t3::after { width: 40%; height: 40%; }
@media (prefers-reduced-motion: no-preference) {
  .cr-shield.t3::after { animation: cr-twinkle 2.6s ease-in-out infinite; }
}
@keyframes cr-twinkle { 0%, 100% { transform: scale(0.55) rotate(0); opacity: 0.6; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
.cr-mini { width: 34px; height: 38px; }
.cr-mini .cr-sh-ico { width: 50%; height: 50%; }
.cr-mini:not(.t0) .cr-sh-ico { filter: drop-shadow(0 1px 0 rgba(18, 32, 58, 0.55)); }

/* ---------------------------------------------------------------- panel */

.cr .pnl-body { padding-top: 14px; }
.cr .pnl-icon { color: var(--yellow-dark); }

/* The header card: you, your rank, your favourite weapon and your best badges. */
.cr-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
  align-items: center;
  gap: 10px 18px;
  padding: 14px 18px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% -30%, rgba(255, 210, 63, 0.35), transparent 45%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 16px, transparent 16px 32px),
    linear-gradient(160deg, #3a6fe0 0%, #2a3f9e 55%, #33287a 100%);
  color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12), 0 5px 0 #1e2a6b;
}
.cr-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--yellow), var(--orange));
  font-family: var(--display);
  font-size: 38px;
  text-shadow: var(--outline);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16), 0 0 0 3px var(--ink), 0 5px 0 3px var(--ink);
}
.cr-who { display: grid; gap: 6px; min-width: 0; flex: 1; }
.cr-name { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-family: var(--display); font-size: 30px; line-height: 1.05; text-shadow: var(--outline); }
.cr-name > span:first-child { overflow: hidden; padding: 2px 3px 6px; margin: -2px -3px -6px; text-overflow: ellipsis; white-space: nowrap; }
.cr-name .owner-badge { text-shadow: 0 0 2px #fff, 0 0 3px #fff; }
.cr-lv { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 8px; }
.cr-lv-chip { padding: 2px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 13px; font-weight: 900; text-transform: uppercase; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); white-space: nowrap; }
.cr-lv .pbar { height: 11px; background: rgba(255, 255, 255, 0.22); box-shadow: none; }
.cr-lv-xp { font-size: 12px; font-weight: 900; color: #dbe6ff; white-space: nowrap; }
.cr-rank, .cr-fav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cr-rank .rk-lg { width: 54px; height: 60px; }
.cr-rank .rk-lg .rk-tier { font-size: 22px; }
.cr-cell { display: grid; min-width: 0; line-height: 1.15; }
.cr-cap { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #b9cbff; }
.cr-cell b { overflow: hidden; font-family: var(--display); font-size: 21px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.cr-cell small { overflow: hidden; font-size: 12.5px; font-weight: 800; color: #dbe6ff; text-overflow: ellipsis; white-space: nowrap; }
.cr-fav-art {
  display: grid;
  place-items: center;
  width: 78px;
  height: 52px;
  flex: none;
  padding: 5px 7px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 -3px 0 #dbe3ef, 0 3px 0 rgba(0, 0, 0, 0.25);
}
.cr-fav-art.is-none { color: #b9c6d9; font-size: 28px; }
.cr-show { display: grid; justify-items: center; gap: 4px; padding: 8px 10px 6px; border-radius: 16px; background: rgba(8, 16, 48, 0.28); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08); }
.cr-show-row { display: flex; gap: 4px; }
.cr-show .cr-mini { width: 42px; height: 47px; }
.cr-show-empty { width: 42px; height: 47px; border-radius: 12px 12px 22px 22px; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14); }
.cr-show small { font-size: 12px; font-weight: 900; color: #dbe6ff; white-space: nowrap; }

/* The tabs stay at the top while the page scrolls under them. */
.cr-tabs { position: sticky; top: -14px; z-index: 4; margin: 6px calc(-1 * var(--pad)) 8px; padding: 10px var(--pad) 0; background: var(--paper-2); }
.cr-tabs .m-tabs { padding-bottom: 8px; }
.cr-content { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- stats */

.cr-big { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cr-big-tile {
  --c: var(--blue);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "ico num" "ico lbl";
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #e1e8f2, 0 5px 0 #d3dceb;
}
.cr-big-tile > .m-ico {
  grid-area: ico;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 15px;
  background: var(--c);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}
.cr-big-tile b { grid-area: num; overflow: hidden; font-family: var(--display); font-size: 32px; font-weight: 400; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.cr-big-tile span:last-child { grid-area: lbl; font-size: 12px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

.cr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cr-modes-box { grid-column: 1 / -1; }
.cr-box .sec-h { margin-bottom: 10px; }
.cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cr-stat { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 9px 10px 10px; border-radius: 14px; background: var(--paper-2); box-shadow: inset 0 0 0 2px #e6edf7; }
.cr-stat-l { font-size: 10.5px; font-weight: 900; letter-spacing: 0.05em; line-height: 1.2; text-transform: uppercase; color: var(--muted); }
.cr-stat-v { overflow: hidden; font-family: var(--display); font-size: 25px; font-weight: 400; line-height: 1.05; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.cr-stat small { font-size: 11px; font-weight: 800; color: var(--muted); }

.cr-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.cr-mode { display: grid; grid-template-columns: 42px minmax(0, 1fr) 64px 64px; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 15px; background: var(--paper-2); box-shadow: inset 0 0 0 2px #e6edf7; }
.cr-mode-ico { display: grid; place-items: center; width: 42px; height: 42px; padding: 9px; border-radius: 13px; background: var(--c); color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.cr-mode-ico .m-ico { width: 100%; height: 100%; }
.cr-mode-name { display: grid; min-width: 0; line-height: 1.2; }
.cr-mode-name b { overflow: hidden; font-size: 15.5px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.cr-mode-name small { overflow: hidden; font-size: 12px; font-weight: 800; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.cr-mode-n { display: grid; justify-items: center; line-height: 1.05; }
.cr-mode-n b { font-family: var(--display); font-size: 22px; font-weight: 400; }
.cr-mode-n small { font-size: 10px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

.cr-weapons { display: grid; gap: 8px; }
.cr-weapon { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 14px; background: var(--paper-2); box-shadow: inset 0 0 0 2px #e6edf7; }
.cr-weapon.is-top { background: #fff4e3; box-shadow: inset 0 0 0 2px #ffd29a; }
.cr-weapon-art { display: grid; place-items: center; height: 40px; padding: 3px 6px; border-radius: 11px; background: #fff; box-shadow: inset 0 0 0 2px #e1e8f2; }
.cr-weapon-main { display: grid; gap: 5px; min-width: 0; }
.cr-weapon-name { overflow: hidden; font-size: 14.5px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.cr-weapon .pbar { height: 9px; }
.cr-weapon-n { font-family: var(--display); font-size: 22px; font-weight: 400; }
.cr-empty { margin: 4px 0; color: var(--muted); font-size: 14px; font-weight: 800; }

/* ---------------------------------------------------------------- badges */

.cr-sum {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #e1e8f2, 0 5px 0 #d3dceb;
}
.cr-sum.is-ready { background: linear-gradient(120deg, #fff8d6, #fff 60%); box-shadow: inset 0 0 0 3px var(--yellow), 0 5px 0 var(--yellow-dark); }
.cr-sum-main { display: grid; gap: 6px; flex: 1; min-width: 0; }
.cr-sum-t { margin: 0; font-size: 17px; font-weight: 900; }
.cr-sum-t b { font-family: var(--display); font-size: 30px; font-weight: 400; }
.cr-sum-main .pbar { height: 12px; }
.cr-sum-main small { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.cr-sum-claim { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.cr-sum-claim .cr-pay { font-size: 16px; }
.cr-sum-none { margin: 0; color: var(--muted); font-size: 14px; font-weight: 900; white-space: nowrap; }

.cr-groups { flex-wrap: wrap; }
.cr-groups .m-seg-btn { flex: 1 1 auto; }
.cr-group + .cr-group { margin-top: 8px; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }

.cr-badge {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px 12px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #e1e8f2, 0 4px 0 #d3dceb;
}
.cr-badge.t3 { background: linear-gradient(150deg, #fff8dc 0%, #fff 55%); box-shadow: inset 0 0 0 2px #ffe08a, 0 4px 0 #f1cf63; }
.cr-badge.is-ready { background: linear-gradient(150deg, #e3fbe9 0%, #fff 60%); box-shadow: inset 0 0 0 3px var(--green), 0 4px 0 var(--green-dark); }
.cr-badge-main { display: grid; gap: 5px; min-width: 0; }
.cr-badge-top { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 2px; }
.cr-badge-name { overflow: hidden; margin: 0; font-family: var(--display); font-size: 20px; font-weight: 400; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.cr-tier { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.cr-tier.t1 { background: #f9e1cc; color: #8a4a12; }
.cr-tier.t2 { background: #e3e9f1; color: #45536b; }
.cr-tier.t3 { background: #fff0b3; color: #8a6400; }
.cr-badge-text { margin: 0; font-size: 13.5px; font-weight: 800; line-height: 1.3; color: var(--ink-2); }
.cr-badge-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cr-badge-prog .pbar { height: 10px; }
.cr-count { font-size: 12px; font-weight: 900; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-badge-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 2px; }
.cr-steps { display: flex; gap: 4px; }
.cr-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px 2px 4px; border-radius: 999px; background: #eef2f8; color: #8d9ab0; font-size: 11px; font-weight: 900; white-space: nowrap; }
.cr-step .m-ico { width: 14px; height: 14px; color: #c3cdda; }
.cr-step.is-on.t1 { background: #f9e1cc; color: #8a4a12; }
.cr-step.is-on.t1 .m-ico { color: #cd7f32; }
.cr-step.is-on.t2 { background: #e3e9f1; color: #45536b; }
.cr-step.is-on.t2 .m-ico { color: #8f9db2; }
.cr-step.is-on.t3 { background: #fff0b3; color: #8a6400; }
.cr-step.is-on.t3 .m-ico { color: #f2b200; }
.cr-badge-pay .btn-sm { margin-left: auto; min-height: 32px; padding: 4px 12px; }
@media (pointer: coarse) { .cr-badge-pay .btn-sm { min-height: 44px; } }
/* What Claim gives (or the next step pays), on a line of its own under the stars. */
.cr-badge-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 6px; border-top: 2px dashed #e6edf7; }
.cr-pay-cap { font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cr-badge-pay:not(.is-ready) .cr-pay { opacity: 0.8; }
.cr-badge-pay.is-ready { border-top-color: #c3f0d2; }
.cr-badge-pay.is-ready .cr-pay-cap { color: var(--green-dark); }

/* What a step pays: key and coin chips, and a tag for boxes, cases and charms. */
.cr-pay { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.cr-pay.is-small { gap: 2px 8px; font-size: 12px; }
.cr-pay.is-small .cur > i { width: 16px; height: 16px; }
.cr-pay-extra { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 5px; border-radius: 999px; background: #f1e8ff; color: var(--purple-dark); font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.cr-pay-extra .m-ico { width: 13px; height: 13px; }

/* A step waiting to be claimed bounces its shield (only while the panel is open). */
@media (prefers-reduced-motion: no-preference) {
  .cr-badge.is-ready .cr-badge-art { animation: cr-hop 1.6s ease-in-out infinite; }
  .cr-badge.is-ready .btn { animation: cr-glow 1.6s ease-in-out infinite; }
}
@keyframes cr-hop { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(-5px) rotate(-3deg); } 80% { transform: translateY(0) rotate(0); } 88% { transform: translateY(-2px); } }
@keyframes cr-glow { 0%, 100% { filter: none; } 50% { filter: brightness(1.12); } }

/* ---------------------------------------------------------------- results and toasts */

.rs-badges .rs-h .m-ico { color: var(--yellow-dark); }
.rs-badge-list { display: grid; gap: 8px; }
.rs-badge { display: flex; align-items: center; gap: 10px; animation: m-slide 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.rs-badge:nth-child(2) { animation-delay: 0.12s; }
.rs-badge:nth-child(3) { animation-delay: 0.24s; }
.rs-badge:nth-child(n + 4) { animation-delay: 0.36s; }
.rs-badge > span:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.rs-badge b { font-size: 15.5px; font-weight: 900; }
.rs-badge-text { flex-basis: 100%; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.rs-badge-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.rs-badge-foot .rs-hint { margin: 0; }

.tst-badge { padding-left: 8px; }
.tst-badge .cr-toast-shield { width: 34px; height: 38px; }
.tst-badge .tst-text { display: grid; gap: 1px; }
.tst-badge .tst-text small { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }

/* ---------------------------------------------------------------- the lobby's profile card */

.lh-player.cr-card { position: relative; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; }
/* Only a nudge: the card's own look (menus.css) stays as it is. */
.lh-player.cr-card:active { transform: translateY(2px); }
@media (hover: hover) { .lh-player.cr-card:hover { transform: translateY(-2px); } .lh-player.cr-card:hover:active { transform: translateY(2px); } }
.lh-player.cr-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.cr-kbd { position: absolute; bottom: -9px; right: 10px; min-width: 18px; padding: 0 4px; font-size: 10.5px; line-height: 16px; box-shadow: 0 0 0 2px var(--ink); }
#lobby-hud.is-touch .cr-kbd { display: none; }

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 1100px) {
  .cr-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .cr-id { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cr-modes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .cr-big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cr-cols { grid-template-columns: minmax(0, 1fr); }
  .cr-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
  .cr-sum { flex-wrap: wrap; }
  .cr-sum-claim { flex: 1 1 100%; justify-content: space-between; }
}
/* Phones held upright: a compact header, two columns of numbers, one column of badges. */
@media (max-width: 560px) {
  .cr .pnl-body { --pad: 12px; }
  .cr-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10px; padding: 12px; border-radius: 18px; }
  .cr-id { grid-column: 1 / -1; }
  .cr-avatar { width: 52px; height: 52px; font-size: 30px; border-radius: 16px; }
  .cr-name { font-size: 25px; }
  .cr-rank, .cr-fav { gap: 7px; }
  .cr-show { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; }
  .cr-show .cr-mini, .cr-show-empty { width: 34px; height: 38px; }
  .cr-rank .rk-lg { width: 40px; height: 45px; }
  .cr-rank .rk-lg .rk-tier { font-size: 17px; }
  .cr-fav-art { width: 52px; height: 38px; padding: 4px 5px; border-radius: 11px; }
  .cr-cap { font-size: 10px; }
  .cr-cell b { font-size: 17px; }
  .cr-cell small { font-size: 11.5px; }
  .cr-stat { padding: 8px 9px; }
  .cr-stat-v { font-size: 22px; }
  .cr-big-tile { column-gap: 10px; padding: 10px; }
  .cr-big-tile > .m-ico { width: 40px; height: 40px; padding: 8px; border-radius: 12px; }
  .cr-big-tile b { font-size: 26px; }
  .cr-big-tile span:last-child { font-size: 10.5px; }
  .cr-box { padding: 12px; }
  .cr-mode { grid-template-columns: 38px minmax(0, 1fr) 50px 50px; gap: 8px; }
  .cr-mode-ico { width: 38px; height: 38px; padding: 8px; }
  .cr-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cr-badge { grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px 12px 10px 10px; }
  .cr-badge-art { width: 54px; height: 61px; }
  .cr-badge-name { font-size: 18px; }
  .cr-sum { gap: 10px; padding: 12px; }
  .cr-sum-t b { font-size: 26px; }
  .cr-groups .m-seg-btn { flex: 1 1 28%; min-height: 36px; padding: 4px 6px; font-size: 12px; }
}
/* Phones on their side: the header is one short row so the page shows below it. */
@media (max-height: 520px) and (min-width: 561px) {
  .cr-hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; padding: 8px 12px; gap: 8px 12px; }
  .cr-id { grid-column: auto; }
  .cr-avatar { width: 44px; height: 44px; font-size: 26px; border-radius: 14px; }
  .cr-name { font-size: 21px; }
  .cr-lv-xp { display: none; }
  .cr-rank .rk-lg { width: 40px; height: 44px; }
  .cr-rank .rk-lg .rk-tier { font-size: 17px; }
  .cr-fav-art { width: 54px; height: 38px; }
  .cr-cell b { font-size: 16px; }
  .cr-cell small { font-size: 11px; }
  .cr-show { padding: 5px 8px 4px; }
  .cr-show .cr-mini, .cr-show-empty { width: 30px; height: 34px; }
  .cr-big-tile { padding: 8px 10px; }
  .cr-big-tile b { font-size: 24px; }
  .cr-big-tile > .m-ico { width: 38px; height: 38px; padding: 8px; }
}
