/* Update detail page styles are isolated from the shared application shell. */

.update-page-shell {
  display: grid;
  gap: 16px;
}

.update-loading {
  padding: 36px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.update-loading p,
.update-heading h1,
.update-heading p,
.update-player-copy h2 {
  margin: 0;
}

.update-page {
  display: grid;
  gap: 16px;
}

.update-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 2px 0;
}

.update-heading h1 {
  margin-top: 3px;
  font-size: 48px;
  line-height: 1.1;
}

.update-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.update-summary-panel {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(430px, 1.35fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
}

.update-player-copy {
  min-width: 0;
}

.update-player-copy h2 {
  overflow: hidden;
  margin-top: 3px;
  font-size: 30px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-rating-flow {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.update-rating-flow > div {
  display: grid;
  gap: 2px;
}

.update-rating-flow span,
.update-summary-metrics span,
.update-record-rating > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.update-rating-flow strong {
  font-size: 38px;
  line-height: 1;
}

.update-rating-arrow {
  color: var(--muted);
  font-size: 24px;
}

.update-rating-flow em {
  color: var(--teal);
  font-size: 24px;
  font-style: normal;
  font-weight: 900;
}

.update-rating-flow em.negative {
  color: #c94a3b;
}

.update-summary-metrics {
  display: grid;
  min-width: 180px;
  gap: 8px;
}

.update-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.update-share-status {
  margin: 0 20px 12px;
}

.update-record-list {
  border-top: 1px solid var(--border);
}

.update-list-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--border);
}

.update-list-actions .secondary-button {
  min-width: 180px;
}

.update-record {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(150px, auto) 42px;
  min-height: 112px;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.update-record:last-child {
  border-bottom: 0;
}

.update-record-jacket {
  position: relative;
  display: block;
  width: 112px;
  min-height: 112px;
  overflow: hidden;
  border-left: 6px solid var(--muted);
  background: var(--surface-strong);
}

.update-record-jacket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.update-record.difficulty-basic .update-record-jacket {
  border-left-color: #40a85a;
}

.update-record.difficulty-advanced .update-record-jacket {
  border-left-color: #c7a51e;
}

.update-record.difficulty-expert .update-record-jacket {
  border-left-color: #e3535b;
}

.update-record.difficulty-master .update-record-jacket {
  border-left-color: #8648c7;
}

.update-record.difficulty-re-master .update-record-jacket {
  border-left-color: #efafd0;
}

.update-record-main {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 8px;
  padding: 12px 16px;
}

.update-record-title-row,
.update-record-chart,
.update-record-values,
.update-record-rating > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.update-record-title-row,
.update-record-chart,
.update-record-values {
  min-width: 0;
  max-width: 100%;
}

.update-record-title-row > a {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-kind {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.update-record-chart {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.update-record-chart strong {
  color: var(--text);
}

.update-record-values {
  flex-wrap: wrap;
  font-size: 17px;
  font-weight: 800;
}

.update-record-values em,
.update-record-rating em {
  color: var(--teal);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.update-record-rating {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 3px;
  padding: 12px 8px;
  text-align: right;
}

.update-record-rating small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.update-record-rating strong {
  color: var(--teal);
  font-size: 28px;
  line-height: 1;
}

.update-remove-button {
  align-self: center;
  justify-self: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
}

.update-remove-button:hover {
  color: #c94a3b;
}

@media (max-width: 980px) {
  .update-summary-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .update-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .update-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .update-heading .secondary-button {
    align-self: start;
  }

  .update-summary-panel {
    padding: 20px;
  }

  .update-rating-flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .update-rating-flow em {
    grid-column: 1 / -1;
  }

  .update-rating-flow strong {
    font-size: 32px;
  }

  .update-actions {
    width: 100%;
    justify-content: stretch;
  }

  .update-actions .secondary-button,
  .update-actions .primary-button {
    flex: 1 1 140px;
  }

  .update-record {
    grid-template-columns: 88px minmax(0, 1fr) 36px;
    min-height: 116px;
  }

  .update-list-actions {
    gap: 6px;
    padding: 14px 12px 16px;
  }

  .update-list-actions .secondary-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .update-record-jacket {
    width: 88px;
    min-height: 116px;
  }

  .update-record-main {
    gap: 5px;
    padding: 10px;
  }

  .update-record-title-row > a {
    font-size: 16px;
  }

  .update-record-chart {
    flex-wrap: wrap;
    gap: 3px 6px;
    font-size: 11px;
  }

  .update-record-values {
    flex-wrap: wrap;
    gap: 3px 6px;
    font-size: 14px;
  }

  .update-record-rating {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    padding: 0 10px 8px;
  }

  .update-record-rating > span,
  .update-record-rating small,
  .update-record-rating em {
    display: none;
  }

  .update-record-rating strong {
    font-size: 22px;
  }

  .update-remove-button {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .update-page-shell,
  .update-page {
    gap: 12px;
  }

  .update-heading {
    gap: 12px;
    margin: 14px 2px 2px;
  }

  .update-heading h1 {
    font-size: 32px;
  }

  .update-heading p {
    margin-top: 6px;
    font-size: 12px;
  }

  .update-heading .secondary-button {
    width: 100%;
  }

  .update-summary-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px 16px;
  }

  .update-player-copy h2 {
    font-size: 24px;
  }

  .update-rating-flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .update-rating-flow strong {
    font-size: 30px;
  }

  .update-rating-flow em {
    grid-column: auto;
    align-self: end;
    padding-bottom: 1px;
    font-size: 19px;
  }

  .update-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .update-summary-metrics span {
    padding: 9px 10px;
    border-radius: 6px;
    background: var(--surface-strong);
    line-height: 1.35;
  }

  .update-records-panel .panel-toolbar {
    gap: 14px;
    padding: 16px;
  }

  .update-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .update-actions .secondary-button,
  .update-actions .primary-button {
    min-height: 44px;
  }

  .update-actions #updateRestoreButton:not(.is-hidden) {
    grid-column: 1 / -1;
  }

  .update-record {
    grid-template-columns: 94px minmax(0, 1fr) 36px;
    grid-template-rows: minmax(88px, auto) 38px;
    min-height: 126px;
  }

  .update-record-jacket {
    width: 94px;
    min-height: 126px;
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .update-record-main {
    grid-column: 2;
    grid-row: 1;
    align-content: start;
    gap: 5px;
    padding: 10px 8px 7px;
  }

  .update-record-title-row > a {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: initial;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .update-record-chart {
    gap: 2px 6px;
    font-size: 10px;
  }

  .update-record-values {
    gap: 2px 5px;
    font-size: 12px;
  }

  .update-record-rating {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    align-self: stretch;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    text-align: left;
  }

  .update-record-rating > span,
  .update-record-rating em {
    display: block;
  }

  .update-record-rating > div {
    margin-left: auto;
  }

  .update-record-rating small {
    display: none;
  }

  .update-record-rating strong {
    font-size: 21px;
  }

  .update-record-rating em {
    font-size: 10px;
  }

  .update-remove-button {
    grid-column: 3;
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
  }
}
