/* v30.1.54: Growth History remains unchanged while Profile/Song score presentation alignment is audited. */

body #player-detail-view .profile-stats-v182.profile-metrics-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 66px !important;
  gap: 1px !important;
  margin-top: 12px !important;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 {
  min-width: 0 !important;
  min-height: 66px !important;
  height: 66px !important;
  padding: 11px 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(12, 18, 31, 0.76) !important;
  box-shadow: none !important;
}

body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 + .profile-stat-v182 {
  border-left: 1px solid rgba(255, 255, 255, 0.075) !important;
}

body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 > span {
  font-size: 11px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.065em !important;
  text-transform: uppercase;
  color: rgba(218, 226, 242, 0.64) !important;
}

body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 strong,
body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-accuracy-stat strong {
  margin-top: 3px !important;
  font-size: clamp(20px, 2.1vw, 28px) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
}

.growth-history-host {
  margin-top: 10px;
}

.growth-history-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  padding: 10px;
  color: #edf3ff;
  background: rgba(8, 13, 24, 0.84);
}

.growth-history-periods {
  display: inline-flex;
  width: max-content;
  margin: 0 0 7px auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(3, 7, 14, 0.58);
}

.growth-history-periods button {
  min-height: 27px;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  color: rgba(225, 233, 248, 0.65);
  background: transparent;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.growth-history-periods button:hover,
.growth-history-periods button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.growth-history-periods button.active {
  color: #fff;
  background: rgba(75, 122, 225, 0.82);
}

.growth-history-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  min-height: 18px;
  margin: 7px 4px 0;
}

.growth-history-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(224, 232, 247, 0.68);
  font-size: 10.5px;
  white-space: nowrap;
}

.growth-history-legend-swatch {
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: #6f9cff;
}

.growth-history-legend-averageAccuracy .growth-history-legend-swatch {
  background: repeating-linear-gradient(90deg, #ffb55e 0 5px, transparent 5px 8px);
}

.growth-history-legend-totalScore .growth-history-legend-swatch {
  background: #3bd99a;
}

.growth-history-legend-chartsPlayed .growth-history-legend-swatch {
  width: 9px;
  height: 8px;
  border-radius: 2px;
  background: rgba(167, 120, 255, 0.72);
}

.growth-history-chart-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  background: rgba(2, 7, 16, 0.34);
}

.growth-history-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  touch-action: pan-y;
}

.growth-history-gridline {
  stroke: rgba(199, 214, 239, 0.09);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.growth-history-x-label {
  fill: rgba(212, 222, 240, 0.48);
  font-size: 10px;
}

.growth-history-series {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.growth-history-line-pp {
  stroke: #6d9cff;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 5px rgba(77, 132, 255, 0.42));
}

.growth-history-line-accuracy {
  stroke: #ffb45c;
  stroke-width: 2.25;
  stroke-dasharray: 7 6;
}

.growth-history-line-score {
  stroke: #36d49a;
  stroke-width: 2.35;
}

.growth-history-score-area {
  fill: rgba(54, 212, 154, 0.09);
  stroke: none;
}

.growth-history-accuracy-point {
  fill: #0e1727;
  stroke: #ffc06f;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.growth-history-endpoint {
  fill: #0e1727;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.growth-history-endpoint-totalPp { stroke: #7aa6ff; }
.growth-history-endpoint-totalScore { stroke: #43dca5; }

.growth-history-chart-bar {
  fill: rgba(158, 108, 255, 0.55);
  stroke: rgba(197, 166, 255, 0.45);
  stroke-width: 0.6;
}

.growth-history-recording-marker {
  stroke: rgba(228, 235, 249, 0.32);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.growth-history-hit {
  fill: transparent;
  pointer-events: all;
}

.growth-history-tooltip {
  position: absolute;
  z-index: 3;
  top: 12px;
  min-width: 190px;
  max-width: min(250px, calc(100% - 20px));
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  transform: translateX(-18%);
  color: #f4f7ff;
  background: rgba(5, 10, 19, 0.94);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.growth-history-tooltip-right { transform: translateX(-88%); }

.growth-history-tooltip time {
  display: block;
  margin-bottom: 7px;
  color: rgba(226, 234, 248, 0.66);
  font-size: 10px;
}

.growth-history-tooltip > div {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 7px;
  margin-top: 4px;
  font-size: 11px;
}

.growth-history-tooltip strong { font-variant-numeric: tabular-nums; }
.growth-history-tooltip small { grid-column: 2 / -1; color: rgba(218, 227, 244, 0.52); }
.growth-history-tooltip-dot { width: 6px; height: 6px; border-radius: 50%; background: #6d9cff; }
.growth-history-tooltip-averageAccuracy { background: #ffb45c; }
.growth-history-tooltip-totalScore { background: #36d49a; }
.growth-history-tooltip-chartsPlayed { background: #a778ff; }

.growth-history-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 24px;
  color: rgba(220, 229, 244, 0.58);
  text-align: center;
}

.growth-history-empty[hidden],
.growth-history-svg[hidden],
.growth-history-tooltip[hidden] { display: none !important; }

@media (max-width: 560px) {
  body #player-detail-view .profile-stats-v182.profile-metrics-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 62px !important;
  }

  body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 {
    min-height: 62px !important;
    height: 62px !important;
    padding: 9px 8px !important;
  }

  body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 > span {
    font-size: 9px !important;
    letter-spacing: 0.025em !important;
  }

  body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-stat-v182 strong,
  body #player-detail-view .profile-stats-v182.profile-metrics-compact .profile-accuracy-stat strong {
    font-size: clamp(16px, 5vw, 21px) !important;
  }

  .growth-history-host { margin-top: 8px; }
  .growth-history-panel { padding: 8px; border-radius: 12px; }
  .growth-history-periods { width: 100%; margin-bottom: 6px; }
  .growth-history-periods button { flex: 1 1 0; padding-inline: 3px; font-size: 9.5px; }
  .growth-history-legend { gap: 4px 11px; margin-top: 5px; }
  .growth-history-legend-item { gap: 4px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .growth-history-periods button { transition: none; }
}

/* v30.1.50: public, chart-scoped player score history. */
.player-score-history-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.player-score-history-title-line > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-detail-view .top-play-song-main.top-play-song-main-with-history {
  /* Keep Top Plays rank/difficulty in deterministic slots when adding history.
     Auto-sized tracks made the song-title x-position vary by difficulty/rank label width. */
  grid-template-columns: 42px 74px minmax(0, 1fr) auto !important;
}

.score-history-open {
  display: inline-grid;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(127, 174, 255, 0.18);
  border-radius: 7px;
  color: rgba(173, 205, 255, 0.78);
  background: rgba(48, 82, 139, 0.18);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

/* v30.1.50-r3: keep the history affordance inside the reviewed profile row height. */
#player-detail-view .profile-table-scroll .all-plays-table .player-score-history-title-line {
  position: relative;
  box-sizing: border-box;
  padding-right: 29px;
  overflow: visible;
}

#player-detail-view .profile-table-scroll .all-plays-table .title-cell .meta {
  box-sizing: border-box;
  padding-right: 29px;
}

#player-detail-view .profile-table-scroll .all-plays-table .player-score-history-title-line > .score-history-open {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.score-history-open:hover,
.score-history-open:focus-visible {
  border-color: rgba(129, 183, 255, 0.5);
  color: #fff;
  background: rgba(65, 112, 190, 0.34);
}

.song-score-history-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.song-score-history-name-line > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#song-detail-view .song-ranking-score,
#song-detail-view .activity-values {
  position: relative;
}

#song-detail-view .song-ranking-score .score-history-open,
#song-detail-view .activity-values .score-history-open {
  position: absolute;
  top: 50%;
  right: -2px;
  transform: translateY(-50%);
}

#song-detail-view .song-ranking-score,
#song-detail-view .activity-values {
  padding-right: 28px;
}

#player-score-history-view .song-hero {
  margin-bottom: 12px;
}

.player-score-history-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(8, 13, 24, 0.84);
}

.player-score-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.player-score-history-head h3,
.player-score-history-head p { margin: 0; }
.player-score-history-head h3 { font-size: 14px; }
.player-score-history-head p {
  margin-top: 3px;
  color: rgba(216, 225, 242, 0.55);
  font-size: 10.5px;
}

.player-score-history-current {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(35, 69, 126, 0.13);
}

.player-score-history-current > div {
  min-width: 0;
  padding: 10px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.player-score-history-current > div:last-child { border-right: 0; }
.player-score-history-current span,
.player-score-history-current strong { display: block; }
.player-score-history-current span {
  color: rgba(216, 225, 242, 0.55);
  font-size: 9.5px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.player-score-history-current strong {
  margin-top: 3px;
  overflow: hidden;
  color: #f0f5ff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-score-history-list {
  position: relative;
  padding: 5px 14px 5px 30px;
}

.player-score-history-list::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  width: 1px;
  content: '';
  background: rgba(112, 159, 241, 0.23);
}

.player-score-history-entry {
  position: relative;
  display: grid;
  grid-template-columns: 1px minmax(0, 1fr);
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.player-score-history-entry:last-child { border-bottom: 0; }
.player-score-history-marker {
  position: absolute;
  top: 20px;
  left: -15px;
  width: 8px;
  height: 8px;
  border: 2px solid #89b5ff;
  border-radius: 50%;
  background: #0b1424;
}
.player-score-history-entry-main { min-width: 0; }
.player-score-history-entry-head,
.player-score-history-entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.player-score-history-entry-head strong,
.player-score-history-entry-head time { display: block; }
.player-score-history-entry-head strong { font-size: 12px; }
.player-score-history-entry-head time {
  margin-top: 2px;
  color: rgba(216, 225, 242, 0.5);
  font-size: 9.5px;
}
.player-score-history-badges { display: flex; gap: 5px; }
.player-score-history-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.player-score-history-values > div {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}
.player-score-history-values span,
.player-score-history-values strong { display: block; }
.player-score-history-values span {
  color: rgba(216, 225, 242, 0.5);
  font-size: 9px;
}
.player-score-history-values strong {
  margin-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.score-history-delta {
  margin-top: 2px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.score-history-delta.positive { color: #66dba3; }
.score-history-delta.negative { color: #ff9fba; }
.player-score-history-entry-foot {
  min-height: 20px;
  margin-top: 5px;
  color: rgba(216, 225, 242, 0.45);
  font-size: 9.5px;
}
.player-score-history-entry-foot a {
  color: #8db4ff;
  font-weight: 700;
  text-decoration: none;
}
.player-score-history-entry-foot a:hover { text-decoration: underline; }
.player-score-history-more {
  display: block;
  min-width: 130px;
  margin: 5px auto 14px;
}

@media (max-width: 620px) {
  .player-score-history-current { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-score-history-current > div:nth-child(2) { border-right: 0; }
  .player-score-history-current > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .player-score-history-head { padding-inline: 11px; }
  .player-score-history-head p { max-width: 31em; }
  .player-score-history-list { padding-right: 9px; padding-left: 26px; }
  .player-score-history-list::before { left: 17px; }
  .player-score-history-marker { left: -13px; }
  .player-score-history-values { gap: 4px; }
  .player-score-history-values > div { padding: 6px; }
  .player-score-history-values strong { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .score-history-open { transition: none; }
}

/* v30.1.52 Phase 37.3: Player Score History UI rebuild.
   The history route reuses songHeroMarkup(), but the reviewed Song Detail geometry is ID-scoped
   to #song-detail-view. Keep this route independently bounded so the shared markup cannot fall
   back to un-sized images or legacy generic hero rules. */
#player-score-history-view {
  --score-history-line: rgba(111, 137, 183, 0.14);
  --score-history-line-strong: rgba(119, 169, 255, 0.28);
  --score-history-panel: rgba(8, 13, 24, 0.90);
  --score-history-panel-soft: rgba(12, 19, 33, 0.72);
  --score-history-muted: rgba(216, 225, 242, 0.62);
  --score-history-text: #eef4ff;
}

#player-score-history-view #player-score-history-content {
  min-width: 0;
}

#player-score-history-view .song-hero {
  min-height: 0;
  margin: 0 0 16px !important;
  padding: 20px 20px 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--score-history-line) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.92), rgba(6, 11, 20, 0.90)) !important;
  box-shadow: none !important;
  isolation: isolate;
}

#player-score-history-view .song-hero::before,
#player-score-history-view .song-hero::after {
  opacity: 0.025 !important;
}

#player-score-history-view .song-hero-top.song-hero-top-expanded {
  display: grid !important;
  grid-template-columns: 188px minmax(0, 1fr) minmax(206px, 236px) !important;
  grid-template-areas: "cover info balance" !important;
  align-items: center !important;
  gap: 18px 22px !important;
  min-width: 0 !important;
  padding: 0 4px 20px !important;
}

#player-score-history-view .song-hero-cover {
  grid-area: cover;
  display: grid;
  place-items: center;
  width: 188px !important;
  height: 188px !important;
  min-width: 188px !important;
  max-width: 188px !important;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(137, 171, 255, 0.18);
  border-radius: 22px !important;
  background:
    linear-gradient(135deg, rgba(80, 105, 255, 0.18), rgba(30, 206, 255, 0.08)),
    rgba(7, 12, 26, 0.92);
  color: rgba(216, 232, 255, 0.74);
  font-size: 42px;
  font-weight: 900;
  box-sizing: border-box;
}

#player-score-history-view .song-hero-cover img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: cover;
}

#player-score-history-view .song-hero-title-block {
  grid-area: info;
  min-width: 0;
  width: 100%;
}

#player-score-history-view .song-hero-title {
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  color: var(--score-history-text) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  font-size: clamp(28px, 3.4vw, 46px) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-shadow: none !important;
}

#player-score-history-view .song-hero-meta {
  margin: 9px 0 0 !important;
  padding: 0 !important;
  color: #98a7bd !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

#player-score-history-view .song-hero-info-row.song-hero-inline-info {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px 14px !important;
  width: 100%;
  min-width: 0;
  margin-top: 16px !important;
  padding: 0 !important;
}

#player-score-history-view .song-hero-info-row .song-badges {
  min-width: 0;
  margin: 0 !important;
}

#player-score-history-view .song-difficulty-switcher {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0;
  max-width: 100%;
}

#player-score-history-view .song-difficulty-label {
  flex: 0 0 100%;
  margin: 0 0 2px;
  color: #8f9db4;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

#player-score-history-view .song-diff-chip {
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 78px !important;
  min-height: 36px !important;
  max-width: 100%;
  padding: 8px 11px !important;
  border: 1px solid rgba(104, 128, 171, 0.22) !important;
  border-left: 2px solid rgba(91, 179, 255, 0.48) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, rgba(13, 20, 34, 0.76), rgba(6, 10, 18, 0.58)) !important;
  color: #e5edf8 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap;
  box-sizing: border-box;
}

#player-score-history-view .song-diff-chip small {
  display: inline-block;
  font-size: 14px !important;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#player-score-history-view .song-diff-chip.active {
  min-width: 90px !important;
  min-height: 40px !important;
  border-left-color: rgba(255, 211, 105, 0.72) !important;
  color: #ffe08a !important;
  background: linear-gradient(180deg, rgba(31, 29, 22, 0.80), rgba(12, 14, 20, 0.64)) !important;
}

#player-score-history-view .song-hero-actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

#player-score-history-view .song-hero-balance {
  grid-area: balance;
  width: 100% !important;
  max-width: 236px !important;
  justify-self: end;
  align-self: center;
}

#player-score-history-view .song-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin: 0 -20px !important;
  border-top: 1px solid var(--score-history-line);
}

#player-score-history-view .song-stat {
  min-width: 0;
  padding: 11px 14px !important;
  border: 0 !important;
  border-right: 1px solid var(--score-history-line) !important;
  border-radius: 0 !important;
  background: rgba(7, 12, 22, 0.58) !important;
  backdrop-filter: none !important;
}

#player-score-history-view .song-stat:last-child {
  border-right: 0 !important;
}

#player-score-history-view .song-stat span {
  color: var(--score-history-muted) !important;
  font-size: 10px !important;
  line-height: 1.2;
}

#player-score-history-view .song-stat strong {
  margin-top: 4px !important;
  overflow: hidden;
  color: var(--score-history-text) !important;
  font-size: 15px !important;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-score-history-view .player-score-history-panel {
  overflow: hidden;
  border: 1px solid var(--score-history-line) !important;
  border-radius: 16px !important;
  background: var(--score-history-panel) !important;
}

#player-score-history-view .player-score-history-head {
  min-height: 0;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--score-history-line) !important;
}

#player-score-history-view .player-score-history-head h3 {
  color: var(--score-history-text);
  font-size: 15px !important;
  line-height: 1.25;
}

#player-score-history-view .player-score-history-head p {
  max-width: 66em;
  margin-top: 5px !important;
  color: var(--score-history-muted) !important;
  font-size: 11.5px !important;
  line-height: 1.55;
}

#player-score-history-view .player-score-history-current {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  border-bottom: 1px solid var(--score-history-line) !important;
  background: rgba(37, 72, 128, 0.12) !important;
}

#player-score-history-view .player-score-history-current > div {
  min-width: 0;
  padding: 12px 16px !important;
  border-right: 1px solid var(--score-history-line) !important;
}

#player-score-history-view .player-score-history-current > div:last-child {
  border-right: 0 !important;
}

#player-score-history-view .player-score-history-current span {
  color: var(--score-history-muted) !important;
  font-size: 10px !important;
  line-height: 1.25;
  letter-spacing: 0.05em;
}

#player-score-history-view .player-score-history-current strong {
  margin-top: 5px !important;
  overflow: hidden;
  color: var(--score-history-text) !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-score-history-view .player-score-history-list {
  position: static !important;
  padding: 0 !important;
}

#player-score-history-view .player-score-history-list::before,
#player-score-history-view .player-score-history-marker {
  display: none !important;
}

#player-score-history-view .player-score-history-entry {
  display: block !important;
  min-width: 0;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--score-history-line) !important;
}

#player-score-history-view .player-score-history-entry:last-child {
  border-bottom: 0 !important;
}

#player-score-history-view .player-score-history-entry-main {
  min-width: 0;
}

#player-score-history-view .player-score-history-entry-head {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start !important;
  justify-content: space-between;
  gap: 8px 16px !important;
  min-width: 0;
}

#player-score-history-view .player-score-history-entry-head > div:first-child {
  min-width: 0;
  flex: 1 1 240px;
}

#player-score-history-view .player-score-history-entry-head strong {
  color: var(--score-history-text);
  font-size: 13px !important;
  line-height: 1.3;
}

#player-score-history-view .player-score-history-entry-head time {
  margin-top: 3px !important;
  color: var(--score-history-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.35;
}

#player-score-history-view .player-score-history-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

#player-score-history-view .player-score-history-values {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1px !important;
  margin-top: 11px !important;
  overflow: hidden;
  border: 1px solid var(--score-history-line);
  border-radius: 10px;
  background: var(--score-history-line);
}

#player-score-history-view .player-score-history-values > div {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 70px;
  padding: 9px 11px !important;
  border-radius: 0 !important;
  background: var(--score-history-panel-soft) !important;
  box-sizing: border-box;
}

#player-score-history-view .player-score-history-values span {
  color: var(--score-history-muted) !important;
  font-size: 10px !important;
  line-height: 1.25;
}

#player-score-history-view .player-score-history-values strong {
  display: block;
  min-width: 0;
  margin-top: 4px !important;
  overflow: hidden;
  color: var(--score-history-text);
  font-size: clamp(15px, 1.8vw, 19px) !important;
  line-height: 1.18 !important;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-score-history-view .score-history-delta {
  display: block !important;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px !important;
  font-size: 10.5px !important;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#player-score-history-view .player-score-history-entry-foot {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px !important;
  min-height: 0 !important;
  margin-top: 9px !important;
  color: rgba(216, 225, 242, 0.52) !important;
  font-size: 10.5px !important;
  line-height: 1.4;
}

#player-score-history-view .player-score-history-entry-foot > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#player-score-history-view .player-score-history-entry-foot a {
  flex: 0 0 auto;
}

#player-score-history-view .player-score-history-more {
  margin: 14px auto 16px !important;
}

@media (max-width: 1010px) {
  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 168px minmax(0, 1fr) !important;
    grid-template-areas:
      "cover info"
      "balance balance" !important;
  }

  #player-score-history-view .song-hero-cover {
    width: 168px !important;
    height: 168px !important;
    min-width: 168px !important;
    max-width: 168px !important;
    border-radius: 20px !important;
  }

  #player-score-history-view .song-hero-balance {
    width: min(236px, 100%) !important;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  #player-score-history-view .song-hero {
    padding: 14px 14px 0 !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    grid-template-areas:
      "cover info"
      "balance balance" !important;
    gap: 12px 14px !important;
    padding: 0 0 14px !important;
  }

  #player-score-history-view .song-hero-cover {
    width: 112px !important;
    height: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
    border-radius: 15px !important;
    font-size: 28px;
  }

  #player-score-history-view .song-hero-title {
    font-size: clamp(22px, 6vw, 32px) !important;
  }

  #player-score-history-view .song-hero-meta {
    font-size: 11.5px !important;
  }

  #player-score-history-view .song-hero-info-row.song-hero-inline-info {
    display: block !important;
    margin-top: 11px !important;
  }

  #player-score-history-view .song-diff-chip {
    min-width: 70px !important;
    min-height: 34px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }

  #player-score-history-view .song-diff-chip small {
    font-size: 13px !important;
  }

  #player-score-history-view .song-hero-balance {
    justify-self: center;
  }

  #player-score-history-view .song-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    margin: 0 -14px !important;
  }

  #player-score-history-view .song-stat:nth-child(3n) {
    border-right: 0 !important;
  }

  #player-score-history-view .song-stat:nth-child(-n + 3) {
    border-bottom: 1px solid var(--score-history-line) !important;
  }

  #player-score-history-view .player-score-history-current {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #player-score-history-view .player-score-history-current > div:nth-child(2n) {
    border-right: 0 !important;
  }

  #player-score-history-view .player-score-history-current > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--score-history-line) !important;
  }

  #player-score-history-view .player-score-history-values {
    grid-template-columns: 1fr !important;
  }

  #player-score-history-view .player-score-history-values > div {
    display: grid !important;
    grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    min-height: 50px;
    padding: 8px 10px !important;
  }

  #player-score-history-view .player-score-history-values strong,
  #player-score-history-view .score-history-delta {
    margin-top: 0 !important;
  }

  #player-score-history-view .player-score-history-values strong {
    text-align: right;
  }

  #player-score-history-view .score-history-delta {
    justify-self: end;
  }
}

@media (max-width: 520px) {
  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 10px 12px !important;
  }

  #player-score-history-view .song-hero-cover {
    width: 86px !important;
    height: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    border-radius: 13px !important;
    font-size: 23px;
  }

  #player-score-history-view .song-hero-title {
    font-size: clamp(20px, 6.4vw, 27px) !important;
  }

  #player-score-history-view .song-difficulty-switcher {
    gap: 5px !important;
  }

  #player-score-history-view .song-diff-chip {
    min-width: 62px !important;
    min-height: 31px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  #player-score-history-view .song-diff-chip small {
    font-size: 12px !important;
  }

  #player-score-history-view .song-stat {
    padding: 9px 10px !important;
  }

  #player-score-history-view .player-score-history-head,
  #player-score-history-view .player-score-history-entry {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  #player-score-history-view .player-score-history-current > div {
    padding: 10px 12px !important;
  }

  #player-score-history-view .player-score-history-values > div {
    grid-template-columns: minmax(68px, 0.65fr) minmax(0, 1fr);
    gap: 4px 10px;
  }

  #player-score-history-view .score-history-delta {
    grid-column: 2;
    justify-self: end;
  }

  #player-score-history-view .player-score-history-entry-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v30.1.53 Phase 37.4: Score History detail/evidence UX and mobile Song Detail parity. */
#player-score-history-view .player-score-history-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

#player-score-history-view .player-score-history-evidence {
  min-height: 32px !important;
  padding: 6px 10px !important;
  border-color: rgba(91, 179, 255, 0.28) !important;
  background: rgba(8, 18, 33, 0.78) !important;
  color: #bcd8ff !important;
  font-size: 10.5px !important;
  font-weight: 800;
  line-height: 1.2;
}

#player-score-history-view .player-score-history-evidence:hover,
#player-score-history-view .player-score-history-evidence:focus-visible {
  border-color: rgba(91, 179, 255, 0.52) !important;
  color: #eef6ff !important;
}

#player-score-history-view .player-score-history-details {
  margin-top: 10px;
  border-top: 1px solid var(--score-history-line);
}

#player-score-history-view .player-score-history-details > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 0 0;
  color: #a9bddb;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  list-style: none;
  user-select: none;
}

#player-score-history-view .player-score-history-details > summary::-webkit-details-marker {
  display: none;
}

#player-score-history-view .player-score-history-details > summary::before {
  content: '›';
  display: inline-block;
  color: #74aaff;
  font-size: 16px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.14s ease;
}

#player-score-history-view .player-score-history-details[open] > summary::before {
  transform: rotate(90deg);
}

#player-score-history-view .player-score-history-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--score-history-line);
  border-radius: 9px;
  background: var(--score-history-line);
}

#player-score-history-view .player-score-history-detail-grid > div {
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;
  background: rgba(8, 14, 25, 0.82);
}

#player-score-history-view .player-score-history-detail-grid span {
  display: block;
  color: var(--score-history-muted);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

#player-score-history-view .player-score-history-detail-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--score-history-text);
  font-size: 14px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-score-history-view .player-score-history-detail-empty {
  margin: 8px 0 0;
  padding: 10px 11px;
  border: 1px solid var(--score-history-line);
  border-radius: 8px;
  background: rgba(8, 14, 25, 0.58);
  color: var(--score-history-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  /* Match the reviewed Song Detail mobile surface rather than maintaining a second design. */
  #player-score-history-view > .route-header {
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 12px !important;
    padding: 2px 0 10px !important;
    overflow: visible !important;
    border-bottom: 1px solid rgba(92, 122, 174, 0.13) !important;
    background: transparent !important;
  }

  #player-score-history-view .route-header-left {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #player-score-history-view .route-header .route-breadcrumb {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #7f8ba0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #player-score-history-view .route-header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #player-score-history-view .route-header-actions .share-actions {
    display: contents !important;
  }

  #player-score-history-view .route-header-actions > button,
  #player-score-history-view .route-header-actions .share-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 8px 9px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    line-height: 1.22 !important;
    white-space: normal !important;
  }

  #player-score-history-view .song-hero {
    margin: 0 !important;
    padding: 0 0 14px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 132px minmax(0, 1fr) !important;
    grid-template-areas:
      "cover info"
      "balance balance" !important;
    gap: 18px !important;
    align-items: center !important;
    padding: 0 22px 16px !important;
  }

  #player-score-history-view .song-hero-cover {
    width: 132px !important;
    height: 132px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    border-radius: 18px !important;
    font-size: 34px;
  }

  #player-score-history-view .song-hero-title {
    font-size: clamp(25px, 8vw, 34px) !important;
    line-height: 1.08 !important;
  }

  #player-score-history-view .song-hero-info-row.song-hero-inline-info {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    align-items: start !important;
    margin-top: 15px !important;
    padding: 0 !important;
  }

  #player-score-history-view .song-hero-info-row .song-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    width: 100% !important;
  }

  #player-score-history-view .song-diff-chip {
    min-width: 0 !important;
    min-height: 27px !important;
    padding: 5px 9px !important;
    font-size: 10.5px !important;
    opacity: 0.58;
    filter: saturate(0.56) brightness(0.76);
    transform: scale(0.96);
  }

  #player-score-history-view .song-diff-chip.active {
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 7px 12px !important;
    font-size: 11.5px !important;
    opacity: 1;
    filter: saturate(1.18) brightness(1.08);
    transform: scale(1.04);
  }

  #player-score-history-view .song-diff-chip small {
    font-size: 10px !important;
  }

  #player-score-history-view .song-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 22px !important;
    border-top: 1px solid rgba(104, 128, 171, 0.12) !important;
    border-bottom: 1px solid rgba(104, 128, 171, 0.105) !important;
    border-left: 1px solid rgba(104, 128, 171, 0.10) !important;
    background: rgba(3, 6, 12, 0.24) !important;
  }

  #player-score-history-view .song-stat,
  #player-score-history-view .song-stat:nth-child(3n),
  #player-score-history-view .song-stat:nth-child(-n + 3) {
    min-height: 70px !important;
    padding: 12px 10px !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 1px solid rgba(104, 128, 171, 0.10) !important;
    border-bottom: 1px solid rgba(104, 128, 171, 0.10) !important;
    background: transparent !important;
  }

  #player-score-history-view .song-stat:nth-child(2n) {
    border-right: 0 !important;
  }

  #player-score-history-view .song-stat span {
    font-size: 9.5px !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
  }

  #player-score-history-view .song-stat strong {
    margin-top: 7px !important;
    font-size: 18px !important;
  }

  #player-score-history-view .player-score-history-detail-grid {
    grid-template-columns: 1fr !important;
  }

  #player-score-history-view .player-score-history-detail-grid > div {
    min-height: 48px;
  }
}

@media (max-width: 720px) {
  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  #player-score-history-view .song-hero-cover {
    width: 86px !important;
    height: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    border-radius: 14px !important;
    font-size: 24px;
  }

  #player-score-history-view .player-score-history-entry-foot {
    align-items: stretch !important;
  }

  #player-score-history-view .player-score-history-entry-actions,
  #player-score-history-view .player-score-history-evidence {
    width: 100%;
  }

  #player-score-history-view .player-score-history-evidence {
    min-height: 38px !important;
  }
}

@media (max-width: 430px) {
  #player-score-history-view .route-header-actions {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #player-score-history-view .player-score-history-details > summary::before {
    transition: none;
  }
}

/* v30.1.53 Phase 37.4 final mobile parity contract.
   The history route renders the exact same songHeroMarkup() as Song Detail. These rules mirror
   the reviewed v30.0.194/v30.0.201/v30.0.202 Song Detail breakpoints so phones do not receive a
   second, visually divergent hero implementation. */
@media (max-width: 820px) {
  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    grid-template-columns: 144px minmax(0, 1fr) !important;
    grid-template-areas:
      "cover info"
      "balance balance" !important;
    column-gap: 16px !important;
    row-gap: 18px !important;
    padding: 0 24px 20px !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-cover {
    width: 144px !important;
    height: 144px !important;
    min-width: 144px !important;
    max-width: 144px !important;
    border-radius: 18px !important;
    font-size: 34px !important;
  }

  #player-score-history-view .song-hero-balance {
    justify-self: end !important;
    width: min(236px, 100%) !important;
  }
}

@media (max-width: 760px) {
  #player-score-history-view .song-hero {
    margin: 0 !important;
    padding: 22px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    --song201-cover: clamp(118px, 34vw, 152px);
    --song201-radar: clamp(160px, 46vw, 202px);
    --song201-gap: clamp(8px, 3.1vw, 14px);
    --song201-top-width: min(100%, calc(var(--song201-cover) + var(--song201-gap) + var(--song201-radar)));
    grid-template-columns: var(--song201-cover) var(--song201-radar) !important;
    grid-template-areas:
      "cover balance"
      "info info" !important;
    justify-content: center !important;
    align-items: center !important;
    justify-items: stretch !important;
    column-gap: var(--song201-gap) !important;
    row-gap: 13px !important;
    padding: 0 14px 16px !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-cover {
    width: var(--song201-cover) !important;
    height: var(--song201-cover) !important;
    min-width: var(--song201-cover) !important;
    max-width: var(--song201-cover) !important;
    border-radius: 16px !important;
    justify-self: start !important;
    align-self: center !important;
    font-size: clamp(27px, 7vw, 36px) !important;
  }

  #player-score-history-view .song-hero-balance {
    width: var(--song201-radar) !important;
    min-width: var(--song201-radar) !important;
    max-width: var(--song201-radar) !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-hero-balance .balance-radar-stage {
    width: var(--song201-radar) !important;
    height: clamp(142px, 38vw, 176px) !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-hero-balance .balance-triangle-wrap {
    inset: 19px 12px 22px !important;
  }

  #player-score-history-view .song-hero-balance .balance-corner {
    font-size: clamp(.60rem, 2.25vw, .70rem) !important;
    letter-spacing: -.02em !important;
  }

  #player-score-history-view .song-hero-balance .balance-corner-tech {
    left: 4px !important;
    top: 4px !important;
  }

  #player-score-history-view .song-hero-balance .balance-corner-acc {
    right: 4px !important;
    top: 4px !important;
  }

  #player-score-history-view .song-hero-balance .balance-corner-pass {
    bottom: 1px !important;
  }

  #player-score-history-view .song-hero-balance .balance-center-label {
    font-size: clamp(.72rem, 2.5vw, .82rem) !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-title-block {
    width: var(--song201-top-width) !important;
    max-width: 100% !important;
    justify-self: center !important;
    align-self: start !important;
    justify-content: flex-start !important;
    text-align: left !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    max-height: 2.18em !important;
    overflow: hidden !important;
    font-size: clamp(23px, 7.1vw, 32px) !important;
    line-height: 1.09 !important;
    letter-spacing: -.035em !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-meta {
    margin-top: 7px !important;
    font-size: 12.2px !important;
    line-height: 1.42 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    max-height: 2.84em !important;
    overflow: hidden !important;
  }

  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-hero-inline-info {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 12px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-difficulty-switcher {
    gap: 7px !important;
  }

  #player-score-history-view .song-diff-chip,
  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-diff-chip {
    min-width: 74px !important;
    min-height: 36px !important;
    padding: 7px 9px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    gap: 5px !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  #player-score-history-view .song-diff-chip small,
  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-diff-chip small {
    font-size: 13.5px !important;
  }

  #player-score-history-view .song-diff-chip.active,
  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-diff-chip.active {
    min-height: 40px !important;
    min-width: 84px !important;
    padding: 8px 10px !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  #player-score-history-view .song-diff-chip.active small,
  #player-score-history-view .song-hero-top.song-hero-top-expanded .song-diff-chip.active small {
    font-size: 15.5px !important;
  }

  #player-score-history-view .song-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  #player-score-history-view .song-stat,
  #player-score-history-view .song-stat:first-child,
  #player-score-history-view .song-stat:nth-child(odd),
  #player-score-history-view .song-stat:nth-child(3n + 1),
  #player-score-history-view .song-stat:nth-child(3n + 1):not(:nth-child(odd)) {
    min-height: 82px !important;
    height: 82px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 11px 9px !important;
    border: 1px solid rgba(118,154,216,.18) !important;
    border-radius: 12px !important;
    background:
      radial-gradient(circle at 84% 18%, rgba(91,179,255,.055), transparent 40%),
      linear-gradient(180deg, rgba(7,12,24,.78), rgba(4,7,14,.92)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #player-score-history-view .song-stat span {
    min-width: 0 !important;
    color: rgba(194,205,225,.78) !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: .06em !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #player-score-history-view .song-stat strong {
    min-width: 0 !important;
    margin-top: 7px !important;
    color: #f4f8ff !important;
    font-size: clamp(18px, 5.2vw, 24px) !important;
    line-height: 1.04 !important;
    font-weight: 900 !important;
    letter-spacing: -.035em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-variant-numeric: tabular-nums !important;
  }
}

@media (max-width: 720px) {
  #player-score-history-view > .route-header {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  #player-score-history-view .route-header-left {
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  #player-score-history-view .route-header .route-breadcrumb {
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  #player-score-history-view .route-header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  #player-score-history-view .route-header-actions .share-actions {
    display: contents !important;
  }

  #player-score-history-view .route-header-actions > button,
  #player-score-history-view .route-header-actions .share-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 36px !important;
    height: auto !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    padding: 8px 9px !important;
    white-space: normal !important;
    line-height: 1.22 !important;
    overflow: visible !important;
  }
}

@media (max-width: 430px) {
  #player-score-history-view .route-header-actions {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  #player-score-history-view .route-header-actions > button,
  #player-score-history-view .route-header-actions .share-button {
    min-height: 38px !important;
    padding: 9px 10px !important;
  }
}

@media (max-width: 360px) {
  #player-score-history-view .song-hero-top.song-hero-top-expanded {
    --song201-cover: 112px;
    --song201-radar: 154px;
    --song201-gap: 8px;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #player-score-history-view .song-hero-balance .balance-corner {
    font-size: .59rem !important;
  }

  #player-score-history-view .song-stat-grid {
    gap: 6px !important;
  }

  #player-score-history-view .song-stat,
  #player-score-history-view .song-stat:first-child,
  #player-score-history-view .song-stat:nth-child(odd),
  #player-score-history-view .song-stat:nth-child(3n + 1),
  #player-score-history-view .song-stat:nth-child(3n + 1):not(:nth-child(odd)) {
    min-height: 76px !important;
    height: 76px !important;
    padding: 9px 7px !important;
    border-radius: 10px !important;
  }

  #player-score-history-view .song-stat span {
    font-size: 9px !important;
    letter-spacing: .035em !important;
  }

  #player-score-history-view .song-stat strong {
    font-size: clamp(16px, 5vw, 20px) !important;
    letter-spacing: -.04em !important;
  }
}

/* v30.1.54 Phase 37.5: history affordance placement cleanup.
   Player rows keep their bounded in-title action; Song Detail ranking/recent rows now own a
   dedicated action slot so buttons never drift with nickname or score length. */
#song-detail-view .song-ranking-score,
#song-detail-view .activity-values {
  padding-right: 0 !important;
}

#song-detail-view .song-ranking-history-cell .score-history-open,
#song-detail-view .song-ranking-history-action,
#song-detail-view .song-recent-history-action {
  position: static !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  margin: 0 !important;
}

#song-detail-view .song-ranking-history-cell .score-history-open {
  display: inline-grid !important;
  place-items: center !important;
}

@media (max-width: 700px) {
  #song-detail-view .song-ranking-history-cell .score-history-open,
  #song-detail-view .song-ranking-history-action,
  #song-detail-view .song-recent-history-action {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
  }
}
