.tcg-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--overlay, rgba(0, 0, 0, 0.65));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.tcg-auth-overlay[hidden] {
  display: none;
}

html.tcg-auth-open {
  overflow: hidden;
}

.tcg-auth-card {
  position: relative;
  width: min(26rem, 100%);
  background: var(--bg-elevated, #1a2332);
  color: var(--text, #e8edf4);
  border: 1px solid var(--border, #2f3f56);
  border-radius: 0;
  box-shadow: none;
  padding: 1.35rem 1.4rem 1.2rem;
}

.tcg-auth-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.tcg-auth-subtitle {
  margin: 0 0 1rem;
  color: var(--text-muted, #8b9cb3);
  font-size: 0.92rem;
  line-height: 1.4;
}

.tcg-auth-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted, #8b9cb3);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.tcg-auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0.65rem 0 0.25rem;
}

.tcg-auth-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #2f3f56);
  background: var(--bg, #0f1419);
  color: var(--text, #e8edf4);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.tcg-auth-submit {
  width: 100%;
  margin-top: 0.9rem;
}

.tcg-auth-error,
.tcg-auth-success {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}

.tcg-auth-error {
  color: var(--loss, #f07178);
}

.tcg-auth-success {
  color: var(--accent, #3dd68c);
}

.tcg-auth-toggle {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted, #8b9cb3);
}

.tcg-auth-toggle .back-link,
.player-link-slot .back-link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent, #3dd68c);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.tcg-account-popover {
  position: fixed;
  z-index: 70;
  width: min(24rem, calc(100vw - 1.5rem));
  background: var(--bg-elevated, #1a2332);
  color: var(--text, #e8edf4);
  border: 1px solid var(--border, #2f3f56);
  border-radius: 0;
  box-shadow: none;
  padding: 0.85rem 1rem 0.85rem;
}

.tcg-account-popover[hidden] {
  display: none;
}

.tcg-account-email {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted, #8b9cb3);
  word-break: break-all;
}

.tcg-account-section {
  margin: 0 0 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #2f3f56);
}

.tcg-account-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

.tcg-account-section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8b9cb3);
}

.tcg-account-label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted, #8b9cb3);
}

.tcg-account-select {
  width: 100%;
  border: 1px solid var(--border, #2f3f56);
  border-radius: 0;
  background: var(--bg, #0f1419);
  color: var(--text, #e8edf4);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
}

.tcg-account-active-row {
  margin: 0 0 0.35rem;
}

.tcg-account-hint,
.tcg-account-muted {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted, #8b9cb3);
  line-height: 1.35;
}

.tcg-account-legacy {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--text, #e8edf4);
}

.tcg-account-linked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
}

.tcg-account-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.45rem;
}

.tcg-account-search input {
  flex: 1 1 6rem;
  min-width: 0;
  border: 1px solid var(--border, #2f3f56);
  background: var(--bg, #0f1419);
  color: var(--text, #e8edf4);
  border-radius: 0;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.88rem;
}

.tcg-account-results {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  max-height: 18rem;
  overflow: auto;
  border-top: 1px solid var(--border, #2f3f56);
}

.tcg-account-results li.tcg-link-result {
  margin: 0;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border, #2f3f56);
}

.tcg-account-results button {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text, #e8edf4);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.1rem 0.15rem 0.15rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tcg-account-results button:hover,
.tcg-account-results button:focus-visible {
  color: var(--accent, #3dd68c);
}

.tcg-link-result-name {
  font-weight: 600;
}

.tcg-link-result-meta {
  font-size: 0.72rem;
  color: var(--text-muted, #8b9bb4);
  font-variant-numeric: tabular-nums;
}

.tcg-link-events {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0 0.15rem;
}

.tcg-link-events li {
  font-size: 0.72rem;
  color: var(--text-muted, #8b9bb4);
  line-height: 1.35;
  padding: 0.05rem 0;
  border: 0;
}

.tcg-link-events-meta,
.tcg-link-events-empty {
  opacity: 0.85;
}

.tcg-account-theme {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}

.tcg-theme-opt {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--text-muted, #8b9cb3);
  cursor: pointer;
}

.tcg-theme-opt.is-active {
  color: var(--text, #e8edf4);
  font-weight: 700;
}

.tcg-theme-opt:hover,
.tcg-theme-opt:focus-visible {
  color: var(--accent, #3dd68c);
}

.tcg-theme-sep {
  color: var(--text-muted, #8b9cb3);
  user-select: none;
}

.tcg-account-links {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}

.tcg-account-link {
  color: var(--text-muted, #8b9cb3);
  text-decoration: none;
}

.tcg-account-link:hover,
.tcg-account-link:focus-visible {
  color: var(--accent, #3dd68c);
}

.tcg-account-signin,
.tcg-account-signout {
  width: 100%;
}

.you-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0;
  border: 1px solid var(--border, #2f3f56);
  background: transparent;
  color: var(--text-muted, #8b9cb3);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.player-link-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.btn-link-me {
  font-size: 0.82rem;
  padding: 0.22rem 0.55rem;
}

tr.standing-row.is-you td:nth-child(2),
.pairing-player.is-you .pairing-name {
  font-weight: 650;
}

.account-nav-btn {
  max-width: 9rem;
}

.tcg-fav-prompt-card {
  width: min(28rem, 100%);
}

.tcg-link-me-card {
  width: min(28rem, 100%);
  border-radius: 0;
}

.tcg-link-me-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  max-height: 16rem;
  overflow: auto;
  border-top: 1px solid var(--border, #2f3f56);
}

.tcg-link-me-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border, #2f3f56);
}

.tcg-link-me-row:last-child {
  border-bottom: 0;
}

.tcg-link-me-name {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  font-size: 0.92rem;
}

.tcg-link-me-actions {
  flex-shrink: 0;
}

.tcg-link-me-actions .btn {
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
}

.tcg-fav-prompt-list {
  list-style: none;
  margin: 0 0 0.95rem;
  padding: 0;
  max-height: 16rem;
  overflow: auto;
}

.tcg-fav-prompt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border, #2f3f56);
}

.tcg-fav-prompt-row:last-child {
  border-bottom: 0;
}

.tcg-fav-prompt-name {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tcg-fav-prompt-row-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.tcg-fav-prompt-row-actions .btn {
  font-size: 0.82rem;
  padding: 0.22rem 0.6rem;
}

.tcg-fav-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
