.topbar { gap: 28px; padding-top: 22px; padding-bottom: 22px; }
.topbar .brand { flex-shrink: 0; }
.topbar nav { flex-shrink: 0; gap: 18px; }
.player-bar { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.player-record-actions { display: flex; gap: 5px; align-items: center; }
.player-bar button { min-height: 44px; border-radius: 12px; font-size: 12px; }
.header-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 11px; color: var(--muted); white-space: nowrap; }
.header-action:hover { background: var(--soft); color: var(--ink); }
.header-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#account-open { display: flex; align-items: center; gap: 10px; padding: 5px 11px 5px 5px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); min-width: 0; }
#account-open:hover { border-color: var(--muted); background: var(--soft); }
.player-avatar { display: grid; place-items: center; position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
#player-avatar-fallback { font-size: 13px; font-weight: 800; }
.player-presence { position: absolute; right: -1px; bottom: 0; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); }
.player-profile-copy { display: grid; gap: 2px; min-width: 0; }
#player-name { color: var(--ink); font-size: 11px; font-weight: 700; max-width: 128px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#account-label { color: var(--muted); font-size: 10px; }
.profile-chevron { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.5; flex-shrink: 0; }
@media (max-width: 960px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding-top: 16px; padding-bottom: 12px; }
  .topbar .brand { grid-column: 1; grid-row: 1; min-width: 0; }
  .topbar nav { grid-column: 1; grid-row: 2; gap: 16px; }
  .player-bar { display: contents; }
  .player-record-actions { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  #account-open { grid-column: 2; grid-row: 1; justify-self: end; }
  .header-action { width: 44px; padding: 10px; border: 1px solid var(--line); background: var(--surface); }
  .header-action span { display: none; }
}
@media (max-width: 480px) {
  .topbar .brand { gap: 8px; }
  .topbar .brand-icon { width: 34px; height: 34px; font-size: 29px; border-radius: 10px; }
  .topbar .brand strong { font-size: 17px; letter-spacing: .3px; }
  .topbar .brand strong span { font-size: 6px; letter-spacing: 1px; }
  #account-open { gap: 7px; padding: 4px 9px 4px 4px; }
  .player-avatar { width: 34px; height: 34px; }
  #player-name, .profile-chevron { display: none; }
  #account-label { font-size: 11px; color: var(--ink); font-weight: 700; white-space: nowrap; }
}
.record-status {
  font-size: 10px;
  margin: 0 0 12px;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}
#player-dialog {
  position: fixed;
  width: min(850px, calc(100% - 32px));
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  padding: 30px;
  box-shadow: 0 24px 100px #0004;
}
#player-dialog::backdrop {
  background: #11182799;
  backdrop-filter: blur(5px);
}
#player-dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 26px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
#player-dialog-close:hover {
  background: var(--soft);
}
#player-dialog-title {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 7px 35px 16px 0;
}
.player-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 700;
}
.provider-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 25px 0;
}
.provider-list a,
.provider-list button {
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
  font-size: 13px;
}
.provider-list .provider-google {
  background: #fff;
  color: #1f1f1f;
  border-color: #747775;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding-left: 12px;
  padding-right: 12px;
}
.provider-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.provider-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}
.provider-list small {
  display: block;
  font-size: 10px;
  margin-top: 7px;
  color: var(--muted);
}
.provider-list .provider-google small {
  color: #5f6368;
}
.account-connections {
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.account-connections h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.account-provider-list {
  margin: 16px 0 0;
}
.account-provider {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.provider-status {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.provider-status strong,
.provider-status span {
  display: block;
}
.provider-status strong {
  color: var(--ink);
  font-size: 12px;
}
.account-provider > a,
.account-provider > button {
  display: block;
  margin-top: auto;
}
.player-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.player-form label {
  font-size: 12px;
  display: grid;
  gap: 8px;
  flex: 1;
}
.player-form input,
.record-filters select {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  min-width: 0;
  max-width: 100%;
}
.player-form button,
.record-pager button,
.record-retry,
#player-signout {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 12px;
}
.player-notice {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.record-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 20px 0;
}
.record-filters label {
  font-size: 11px;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.record-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
  padding: 15px;
  background: var(--soft);
  border-radius: 12px;
  margin: 15px 0;
}
.record-summary b {
  color: var(--ink);
}
.record-scroll {
  overflow-x: auto;
}
.record-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.record-table th {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  font-size: 10px;
  white-space: nowrap;
}
.record-table td,
.record-table th {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.record-table td:first-child,
.record-table th:first-child {
  padding-left: 0;
}
.record-table small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}
.record-detail {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
}
.record-empty {
  text-align: center;
  padding: 38px 12px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}
.record-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 11px;
}
.rank-medal {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft);
  font-weight: 700;
}
.record-table tr:first-child .rank-medal {
  background: var(--accent);
  color: var(--on-accent);
}
@media (max-width: 760px) {
  #player-dialog {
    padding: 20px;
  }
  .provider-list {
    grid-template-columns: 1fr;
  }
  .provider-list a,
  .provider-list button {
    padding: 13px;
  }
  .record-filters label {
    flex: 1;
  }
  .record-table {
    min-width: 500px;
  }
}
