/* Rider identity UI owns labels/crowns; transport runtimes own character artwork.
   Loaded after styles.css to avoid transport and seasonal visual overrides. */
.rider .name-chip {
  position: absolute;
  z-index: 20;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 1px;
  width: max-content;
  min-width: 66px;
  max-width: 188px !important;
  padding: 6px 9px 6px 7px;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 12px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 2px 6px rgba(39, 49, 60, .08);
}
.rider .name-chip::before {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
.rider .name-chip > .rider-name {
  grid-column: 2;
  grid-row: 1;
  max-width: 164px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rider .rider-meta {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.rider .rider-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #5d6470;
  font-size: 9px;
  line-height: 1.25;
  font-weight: 850;
}
.rider .rider-title[hidden],
.rider .rider-title-tooltip[hidden],
.rider .rider-meta .tokens[hidden] { display: none !important; }
.rider .rider-title-emoji { flex: 0 0 auto; font-size: 11px; line-height: 1; }
.rider .rider-title-name {
  min-width: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rider .rider-meta .tokens {
  min-width: 0;
  flex: 0 0 auto;
  font-size: 8px;
  color: #9d948d;
}
.rider.identity-tight .rider-meta .tokens { display: none !important; }
.rider.identity-icon-only .rider-title-name { display: none; }
.rider:not(.is-near-right) .name-chip { left: 116px; right: auto; }
.rider.is-near-right .name-chip,
.rider.identity-flipped .name-chip { left: auto; right: 109px; }
.rider.identity-flipped:not(.is-near-right) .name-chip { left: auto; right: 109px; }

.rider .rider-title-tooltip {
  display: none;
  position: absolute;
  z-index: 30;
  top: -4px;
  bottom: auto;
  left: calc(100% + 7px);
  right: auto;
  width: max-content;
  min-width: 86px;
  max-width: 190px;
  padding: 8px 11px;
  border: 1px solid rgba(39, 49, 60, .15);
  border-radius: 11px;
  background: #fffdf8;
  box-shadow: 0 5px 18px rgba(39, 49, 60, .14);
  color: #343b45;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  white-space: normal;
  pointer-events: none;
}
.rider .rider-title-tooltip small {
  display: block;
  margin-top: 3px;
  color: #7d766f;
  font-size: 10px;
  font-weight: 550;
}
.rider.is-near-right .rider-title-tooltip,
.rider.identity-flipped .rider-title-tooltip {
  left: auto;
  right: calc(100% + 7px);
}
@media (hover: none) {
  .rider .name-chip:hover .rider-title-tooltip:not([hidden]) { display: none; }
}
.rider .name-chip:hover .rider-title-tooltip:not([hidden]),
.rider .name-chip:focus-within .rider-title-tooltip:not([hidden]) { display: block; }
.rider.is-clickable:focus-visible { outline: 2px solid #7c9bdd; outline-offset: 2px; }

/* Crown stays inside rider-motion (the shared transport animation anchor),
   rather than floating independently in the lane's coordinate system. */
.rider .rider-motion > .leader-crown,
.rider.is-near-right .rider-motion > .leader-crown {
  position: absolute;
  z-index: 19;
  display: block;
  left: 50%;
  right: auto;
  top: -16px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%) rotate(-9deg);
  filter: drop-shadow(0 2px 1px rgba(39, 49, 60, .18));
  pointer-events: none;
}
.rider.has-pixel-rider .rider-motion > .leader-crown { left: 50%; top: -12px; }
/* PNG runtime owns the crown's position, using the same head_offset as its helmet.
   It must not sit at the center/top of the lane or respond to label flipping. */
.rider.has-frame-rider .frame-rider-art > .leader-crown {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 8;
  left: 58%;
  right: auto;
  top: 15%;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 2px 0 rgba(43, 25, 75, .3));
  pointer-events: none;
}

/* Do not let the historical '戴过皇冠' achievement render another crown. */
.rider .rider-title-emoji { filter: none; }

/* Transient award sticker, not another permanent rider ornament. */
.rider .rider-unlock-pop {
  position: absolute;
  z-index: 31;
  top: -48px;
  left: 50%;
  width: max-content;
  max-width: 195px;
  padding: 7px 11px;
  border: 2px solid #dfae53;
  border-radius: 13px;
  background: #fff5ce;
  color: #735323;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 3px 0 rgba(112, 78, 32, .13);
  transform: translateX(-50%);
  animation: riderAwardPop 3.8s both;
  pointer-events: none;
}
@keyframes riderAwardPop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.82); }
  11%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -9px) scale(.94); }
}

.profile-achievement-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.profile-achievement-card {
  grid-template-columns: 46px minmax(0, 1fr);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.profile-achievement-card.is-unlocked {
  background: #fff9e7;
  border-color: rgba(181, 138, 68, .25);
}
.profile-achievement-card.is-equipped {
  background: #f3f6ff;
  border-color: #8fa9de;
  box-shadow: inset 0 0 0 1px rgba(116, 148, 207, .16);
}
.profile-achievement-card:focus-visible { outline: 2px solid #779de3; outline-offset: 2px; }
.profile-achievement-card:hover { transform: translateY(-1px); }
.profile-achievement-card .profile-achievement-emoji {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(133, 105, 58, .1);
  border-radius: 13px;
  background: rgba(255, 255, 255, .65);
  font-size: 26px;
}
.profile-achievement-card .profile-achievement-copy .achievement-category {
  font-size: 9px;
  color: #998b7c;
  letter-spacing: .02em;
}
.profile-achievement-card .profile-achievement-copy .achievement-date {
  font-size: 9px;
  color: #9b8b70;
}

@media (max-width: 760px) {
  .rider .name-chip { max-width: 150px !important; padding: 5px 7px; }
  .rider .rider-title-name { max-width: 76px; }
  .rider .rider-meta .tokens { font-size: 7.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .rider .rider-unlock-pop { animation: none; }
  .profile-achievement-card { transition: none; }
  .profile-achievement-card:hover { transform: none; }
}


/* Lightweight, one-tap appearance choices; the social avatar is edited once, in the profile hero. */
.rider-appearance-settings { width:100%; min-width:0; display:grid; gap:12px; }
.rider-head-choices {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;width:100%;max-width:660px;
}
.rider-head-choice {
  font:inherit;text-align:left;min-width:0;width:100%;
  display:flex;align-items:center;gap:12px;position:relative;
  padding:13px 14px;border:1.5px solid #e2dcd4;border-radius:17px;
  background:rgba(255,253,248,.84);color:#333c48;
  box-shadow:0 2px 5px rgba(40,39,60,.025);cursor:pointer;
  transition:border-color .15s,background .15s,box-shadow .15s;
}
.rider-head-choice:hover { border-color:#a1a9bc; }
.rider-head-choice.is-selected {
  border-color:#7f98da;background:#f3f6ff;
  box-shadow:inset 0 0 0 1px rgba(91,129,218,.15);
}
.rider-head-choice:focus-visible { outline:2px solid #779de3;outline-offset:3px; }
.rider-head-choice:disabled { opacity:.65;cursor:wait; }
.rider-head-choice-visual {
  flex:0 0 52px;width:52px;height:52px;display:grid;place-items:center;
  overflow:hidden;border-radius:16px;background:#fff1d8;
  border:1px solid rgba(75,64,61,.09);font-size:29px;line-height:1;
}
.rider-head-choice-visual img { width:100%;height:100%;object-fit:cover; }
.rider-head-choice-copy { min-width:0;display:grid;gap:5px;line-height:1.3; }
.rider-head-choice-copy strong { font-size:13px;font-weight:850; }
.rider-head-choice-copy small { font-size:10px;line-height:1.5;color:#827b78;font-weight:500; }
.rider-head-choice-check {
  margin-left:auto;align-self:flex-start;flex:0 0 19px;
  width:19px;height:19px;border-radius:50%;display:grid;place-items:center;
  color:white;background:#748ecf;font-size:12px;font-weight:800;
  opacity:0;transform:scale(.8);
}
.rider-head-choice.is-selected .rider-head-choice-check { opacity:1;transform:scale(1); }
.rider-appearance-extras { display:flex;align-items:center;flex-wrap:wrap;gap:12px;color:#726d72; }
.rider-backpack-option { display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:650;cursor:pointer; }
.rider-backpack-option input { accent-color:#7c91c7; }
.rider-appearance-extras small { font-size:10px;color:#98919a; }
.rider-appearance-preset { display:flex;align-items:center;gap:9px;font-size:12px; }
.rider-appearance-preset[hidden] { display:none!important; }
.rider-appearance-preset select {
  padding:6px 9px;border:1px solid #dfd7cd;border-radius:8px;
  background:#fffdf7;color:#44404b;font-size:12px;
}
@media(max-width:640px) {
  .rider-head-choices { grid-template-columns:1fr;gap:9px; }
  .rider-head-choice { padding:11px 12px; }
  .rider-head-choice-visual { flex-basis:46px;width:46px;height:46px;font-size:26px; }
}
@media(prefers-reduced-motion:reduce) {
  .rider-head-choice { transition:none; }
}
