.mode-utility-row {
  grid-template-columns: repeat(3, 1fr) minmax(220px, .9fr);
  width: min(1120px, 100%);
}

.setup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(1080px, 100%);
}

.ready-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trophy-cabinet-dialog {
  width: min(1060px, calc(100vw - 28px));
  max-height: min(88vh, 840px);
}

.trophy-progress-shell {
  display: grid;
  gap: 8px;
  margin: 4px 0 18px;
}

.trophy-progress-shell > strong {
  color: #ffd43b;
  letter-spacing: .12em;
}

.trophy-progress-shell > div {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: #070b13;
}

.trophy-progress-shell span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ffd43b, #fff2a8);
  box-shadow: 0 0 18px rgba(255,212,59,.55);
  transition: width .35s ease;
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  overflow: auto;
  max-height: min(64vh, 570px);
  padding: 2px 4px 8px 2px;
}

.trophy-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 96px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30,41,59,.92), rgba(8,13,23,.98));
}

.trophy-card .trophy-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 62px;
  clip-path: polygon(20% 0,80% 0,100% 25%,88% 75%,50% 100%,12% 75%,0 25%);
  background: #263244;
  color: #6d7b8f;
  font-size: 1.25rem;
  font-weight: 1000;
  text-shadow: 0 2px #08101b;
}

.trophy-card strong { display: block; color: #a6b3c5; }
.trophy-card small { color: #728096; line-height: 1.35; }

.trophy-card.unlocked {
  border-color: rgba(255,212,59,.5);
  box-shadow: inset 0 0 22px rgba(255,212,59,.05), 0 8px 22px rgba(0,0,0,.25);
}

.trophy-card.unlocked .trophy-icon {
  background: linear-gradient(145deg, #fff0a0, #f5a623 58%, #9b4d09);
  color: #241502;
  box-shadow: 0 0 20px rgba(255,212,59,.34);
}

.trophy-card.unlocked strong { color: #fff; }
.trophy-card.unlocked small { color: #c7d4e5; }

.weather-rain .race-banner { border-color: rgba(159,214,255,.65); }
.weather-sunset .race-banner { border-color: rgba(255,173,87,.75); }

.home-completion {
  position: absolute;
  top: 22px;
  right: clamp(18px, 3vw, 42px);
  width: clamp(150px, 15vw, 210px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(155, 232, 255, .32);
  border-radius: 8px;
  background: rgba(3, 8, 18, .78);
  box-shadow: 0 0 22px rgba(56, 189, 248, .12);
}

.home-completion span { color: #9be8ff; font-size: .58rem; font-weight: 1000; letter-spacing: .13em; }
.home-completion strong { color: #fff; font-size: .92rem; font-variant-numeric: tabular-nums; }
.home-completion i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.11); }
.home-completion b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #ffd43b); transition: width .35s ease; }

.livery-select small { color: #9be8ff; font-size: .58rem; letter-spacing: .1em; }
.filter-row:has(#leaderboardKind) { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.livery-cabinet { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.livery-cabinet-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.livery-cabinet-heading .eyebrow { margin: 0 0 4px; }
.livery-cabinet-heading h3 { margin: 0; font-size: 1.4rem; }
.livery-cabinet-heading > strong { color: var(--yellow); font-variant-numeric: tabular-nums; }
.livery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.livery-card { min-height: 82px; display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.035); opacity: .62; }
.livery-card.unlocked { opacity: 1; border-color: var(--livery-colour); background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035)); }
.livery-swatch { width: 52px; height: 34px; border: 2px solid rgba(255,255,255,.35); border-radius: 8px 14px 8px 14px; background: linear-gradient(135deg, var(--livery-light) 0 24%, var(--livery-colour) 25% 72%, var(--livery-dark) 73%); box-shadow: inset 0 -5px rgba(0,0,0,.22); }
.livery-card strong,.livery-card small { display: block; }
.livery-card strong { color: #fff; font-size: .82rem; letter-spacing: .05em; }
.livery-card small { margin-top: 4px; color: #aebed1; line-height: 1.25; }
.livery-card .livery-state { margin-top: 5px; color: var(--livery-colour); font-size: .62rem; font-weight: 1000; letter-spacing: .1em; }

@media (max-width: 760px) {
  .home-completion { position: static; width: min(240px, 100%); margin: 14px auto 0; }
  .filter-row:has(#leaderboardKind) { grid-template-columns: 1fr 1fr; }
  .mode-utility-row { grid-template-columns: 1fr 1fr; }
  .compact-audio-setting { grid-column: 1 / -1; }
  .setup-grid { grid-template-columns: 1fr; }
  .ready-grid { grid-template-columns: 1fr 1fr; }
  .trophy-grid { grid-template-columns: 1fr; max-height: 62vh; }
  .trophy-card { min-height: 82px; }
  .livery-grid { grid-template-columns: 1fr; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .mode-utility-row { grid-template-columns: 1fr 1fr; }
  .compact-audio-setting { grid-column: 2; }
  .setup-grid { grid-template-columns: 1fr 1fr; }
  .ready-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-height: 650px) and (min-width: 760px) {
  .trophy-cabinet-dialog { max-height: 94vh; }
  .trophy-grid { max-height: 58vh; }
}
