body[data-view='my-decks'] :is(#home, #archive-status) { display: none; }
#account-decks-link { margin-top: 12px; }
#my-decks { --profile-deck-radius: var(--deck-radius, 8px); --profile-deck-accent: var(--deck-accent, var(--cyan)); }
body[data-game='cyberpunk'] #my-decks { --profile-deck-radius: 0; }

.profile-deck-account, .builder-heading-info { display: grid; justify-items: end; gap: 8px; text-align: right; }
.profile-deck-identity { display: flex; align-items: center; gap: 9px; }
.profile-deck-identity img { width: 38px; height: 38px; flex: none; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; }
.profile-deck-account p, .builder-heading-info p {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.profile-decks-empty { margin-bottom: 18px; }
.profile-decks-empty p { margin-bottom: 0; }
.profile-decks-empty .action { margin-top: 10px; }
.profile-deck-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; }
.profile-deck-tools .searchbox { flex: 1 1 230px; max-width: 460px; min-width: 0; }
.profile-deck-filter { min-height: 42px; }
.profile-deck-filter[aria-pressed='true'] { border-color: var(--profile-deck-accent); background: var(--raised); color: var(--profile-deck-accent); }
.profile-deck-status { margin: 0; color: var(--muted); font: 650 .78rem/1.3 var(--body); }
.profile-deck-feedback { margin: 0 0 .7rem; color: var(--profile-deck-accent); font-size: .88rem; }
.profile-deck-feedback:empty, .profile-deck-delete-error:empty { margin: 0; }
.profile-decks-library { display: grid; gap: 18px; }
.profile-deck-game {
  min-width: 0;
  padding: clamp(12px, 2.5vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--profile-deck-radius);
  background: var(--sheet);
}
.profile-deck-game-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}
.profile-deck-game-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-deck-game-actions .action { min-height: 37px; gap: 5px; padding-inline: 9px; white-space: nowrap; }
.profile-deck-game-actions .icon { width: 14px; height: 14px; }
.profile-deck-game-header h3 {
  margin: 0;
  color: var(--text);
  font: 780 clamp(1.12rem, 2.6vw, 1.55rem)/1.2 var(--display);
}
.profile-deck-game-header p, .profile-deck-card small {
  margin: 4px 0 0;
  color: var(--muted);
  font: 650 .77rem/1.4 var(--body);
}
.profile-decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(9px, 1.3vw, 16px);
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.profile-deck-item {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--profile-deck-radius);
  background: var(--paper);
}
.profile-deck-item:is(:hover, :focus-within) { border-color: var(--profile-deck-accent); }
.profile-deck-card {
  display: grid;
  grid-template-columns: clamp(78px, 8vw, 108px) minmax(0, 1fr);
  align-items: stretch;
  height: 100%;
  border-radius: inherit;
  color: var(--text);
  text-decoration: none;
}
.profile-deck-card:hover, .profile-deck-card:focus-visible { background: var(--raised); }
.profile-deck-card:focus-visible { outline-offset: 3px; }
.profile-deck-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 63 / 88;
  inline-size: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--profile-deck-radius) 0 0 var(--profile-deck-radius);
  background: radial-gradient(ellipse at 18% 0%, var(--profile-deck-cover-tint, #25475d), #0b121c 85%);
}
[data-profile-game='magic'] .profile-deck-cover { --profile-deck-cover-tint: #4b3861; }
[data-profile-game='riftbound'] .profile-deck-cover { --profile-deck-cover-tint: #1a4b71; }
[data-profile-game='cyberpunk'] .profile-deck-cover { --profile-deck-cover-tint: #475532; }
.profile-deck-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.profile-deck-art-fallback .icon { width: 38px; height: 38px; color: #e3f3ff85; }
.profile-deck-card-info { display: grid; align-content: start; min-width: 0; padding: .65rem .75rem .75rem; overflow-wrap: anywhere; }
.profile-deck-card-info strong { padding-inline-end: 2.25rem; font: 760 1rem/1.25 var(--body); }
.profile-deck-meta { display: grid; gap: .3rem; }
.profile-deck-labels { display: flex; flex-wrap: wrap; gap: .26rem; }
.profile-deck-labels > span, .profile-deck-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: .13rem .35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: 650 .67rem/1.25 var(--body);
}
.profile-deck-labels .profile-deck-pinned, .profile-deck-value { background: var(--raised); color: var(--text); }
.profile-deck-pinned .icon { width: 12px; height: 12px; }
.profile-deck-symbols { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: .48rem; }
.profile-deck-symbol { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--profile-deck-swatch, var(--raised)); }
.profile-deck-symbol img { width: 100%; height: 100%; object-fit: contain; }
.profile-deck-actions-trigger {
  position: absolute;
  z-index: 2;
  inset: .38rem .38rem auto auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #e3f3ff54;
  border-radius: 50%;
  background: #0a121de8;
  color: #f1f8ff;
  font: 800 1.33rem/1 var(--body);
}
.profile-deck-actions-trigger:is(:hover, [aria-expanded='true']) { background: #edf7ff; color: #111a27; }
.profile-deck-menu {
  position: fixed;
  inset: auto;
  display: none;
  width: min(11.5rem, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--profile-deck-radius);
  background: var(--sheet);
  color: var(--text);
  box-shadow: 0 12px 34px #0009;
}
.profile-deck-menu:popover-open { display: grid; }
.profile-deck-menu :is(a, button) {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem .6rem;
  border: 0;
  border-radius: var(--profile-deck-radius);
  background: transparent;
  text-align: start;
  text-decoration: none;
  font: 650 .86rem/1.3 var(--body);
}
.profile-deck-menu :is(a, button):is(:hover, :focus-visible) { background: var(--raised); }
.profile-deck-menu .profile-deck-destructive { color: var(--alert); }
.profile-deck-delete {
  width: min(26rem, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--profile-deck-radius);
  background: var(--sheet);
  color: var(--text);
  box-shadow: 0 16px 55px #0009;
}
.profile-deck-delete::backdrop { background: #000b; }
.profile-deck-delete form { display: grid; gap: .8rem; padding: clamp(.8rem, 4vw, 1.25rem); overflow-wrap: anywhere; }
.profile-deck-delete h3, .profile-deck-delete p { margin: 0; }
.profile-deck-delete h3 { font: 760 1.22rem/1.2 var(--display); }
.profile-deck-delete p { color: var(--muted); font-size: .88rem; }
.profile-deck-delete .profile-deck-delete-error { color: var(--text); }
.profile-deck-delete-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.profile-deck-delete-actions .action { min-height: 40px; }
.profile-deck-delete-actions .profile-deck-destructive { border-color: var(--alert); background: var(--alert); color: #100b11; }

@media (max-width: 690px) {
  .profile-deck-account, .builder-heading-info { justify-items: start; text-align: left; }
  .profile-deck-actions-trigger { width: 44px; height: 44px; }
}
