:root {
  color-scheme: dark;
  --bg: #080a12;
  --bg-2: #101527;
  --panel: rgba(18, 22, 37, 0.84);
  --panel-solid: #121625;
  --panel-2: #171d31;
  --text: #f6f8ff;
  --muted: #a8b0ca;
  --faint: #68708c;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #72f3ff;
  --accent-2: #a875ff;
  --gold: #ffd166;
  --good: #65f0a3;
  --bad: #ff6b8a;
  --warn: #ffca66;
  --radius-lg: 26px;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(114, 243, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 85% 8%, rgba(168, 117, 255, 0.22), transparent 28rem),
    linear-gradient(135deg, #080a12 0%, #101425 52%, #090b15 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid rgba(114, 243, 255, 0.55);
  outline-offset: 2px;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: end;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(24, 30, 52, 0.9), rgba(11, 13, 25, 0.78));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -160px auto;
  width: 360px;
  height: 360px;
  background: conic-gradient(from 60deg, var(--accent), var(--accent-2), var(--gold), var(--accent));
  filter: blur(52px);
  opacity: 0.2;
  border-radius: 50%;
}

.hero-copy,
.hero-card {
  position: relative;
  z-index: 1;
}

.tracker-archive-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.archive-link-secondary {
  color: var(--accent-soft);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(38px, 7vw, 82px);
  line-height: 0.88;
  margin: 0;
  letter-spacing: -0.07em;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(16px, 2.6vw, 20px);
  margin: 18px 0 0;
}

.hero-card,
.control-panel,
.tabs,
.section-head,
.sprite-card,
.friend-block,
.summary-card,
.table-wrap,
.empty-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.18);
}

.hero-card {
  padding: 20px;
  border-radius: 22px;
}

.hero-card-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.hero-card strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.hero-card span {
  display: block;
}

.hero-card #activeUserProgress {
  color: var(--good);
  margin-top: 8px;
  font-weight: 700;
}

.save-status {
  min-height: 1.3em;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.save-status:empty {
  display: none;
}

.save-status[data-state="saving"] {
  color: var(--accent);
}

.save-status[data-state="saved"] {
  color: var(--good);
}

.save-status[data-state="error"] {
  color: var(--bad);
}

.save-status[data-state="warning"] {
  color: var(--warn);
}

.last-changed-status {
  min-height: 1.3em;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
}

.last-changed-status:empty {
  display: none;
}

.control-panel {
  margin-top: 16px;
  border-radius: 22px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.field-row,
.profile-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-row label {
  color: var(--muted);
  font-weight: 700;
  min-width: 64px;
}

select,
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

select option {
  color: #111;
}

input::placeholder {
  color: rgba(168, 176, 202, 0.7);
}

input:focus,
select:focus {
  border-color: rgba(114, 243, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(114, 243, 255, 0.12);
}

.profile-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.dialog-new-user input,
.profile-dialog-card input {
  width: 100%;
  max-width: 100%;
}

.profile-actions button,
.dialog-actions button,
.tab {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  color: #061018;
  background: linear-gradient(135deg, var(--accent), #8af7c9);
  font-weight: 900;
  padding: 0 18px;
}

.hint,
.field-error {
  width: 100%;
  margin: 0;
  font-size: 13px;
}

.hint {
  color: var(--muted);
}

.control-panel > .hint {
  grid-column: 1 / -1;
}

.field-error {
  color: var(--bad);
  min-height: 1.25em;
}

.field-error:empty {
  display: none;
}

.profile-dialog {
  width: min(92vw, 440px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.profile-dialog[open] {
  display: block;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.profile-dialog::backdrop {
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(8px);
}

.profile-dialog-card {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.field-stack {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.dialog-copy {
  margin: 0;
  color: var(--muted);
}

.dialog-new-user {
  display: grid;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-button {
  color: #fff !important;
  background: rgba(255, 107, 138, 0.88) !important;
}

.danger-button:hover {
  background: rgba(255, 107, 138, 1) !important;
}

.ghost-button {
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid var(--line) !important;
}

.profile-dialog-delete {
  color: #fff !important;
  background: rgba(255, 107, 138, 0.8) !important;
  margin-right: auto;
}

.profile-dialog-delete:hover {
  background: rgba(255, 107, 138, 1) !important;
}

.tabs {
  position: sticky;
  top: 8px;
  z-index: 5;
  margin: 16px 0;
  border-radius: 22px;
  padding: 8px;
  display: flex;
  gap: 8px;
}

.tab {
  flex: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.tab.active {
  color: #061018;
  background: linear-gradient(135deg, var(--accent), #8af7c9);
}

.tab:not(.active):hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.section-head {
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.04em;
}

.section-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search {
  min-width: min(260px, 100%);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pill-toggle {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  white-space: nowrap;
}

.pill-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.empty-state {
  margin-bottom: 16px;
}

.collection-progress {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(114, 243, 255, 0.08);
  border: 1px solid rgba(114, 243, 255, 0.25);
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.tracker-progress-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.progress-stat {
  padding: 14px 16px;
  border: 1px solid rgba(114, 243, 255, 0.25);
  border-radius: 16px;
  background: rgba(114, 243, 255, 0.08);
}

.progress-stat > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.progress-stat > strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.progress-stat--mastery {
  border-color: rgba(255, 209, 102, 0.38);
  background: rgba(255, 209, 102, 0.09);
}

.progress-stat--mastery .progress-bar span {
  background: linear-gradient(90deg, #ffb938, var(--gold));
}

.compare-filter {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(13, 17, 29, 0.86);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.18);
}

.compare-filter-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.compare-filter-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.compare-filter-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.compare-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-filter-actions button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 800;
}

.compare-user-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.compare-user-pill {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.compare-user-pill:hover {
  border-color: rgba(114, 243, 255, 0.28);
  background: rgba(114, 243, 255, 0.08);
}

.compare-user-pill:has(.compare-user-checkbox:checked) {
  border-color: rgba(114, 243, 255, 0.42);
  background: rgba(114, 243, 255, 0.14);
}

.compare-user-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
}

.compare-filter-empty {
  margin: 0;
  color: var(--muted);
}

.empty-card {
  border-radius: var(--radius);
  padding: 22px;
}

.empty-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.empty-card p {
  margin: 0;
  color: var(--muted);
}

.sprite-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sprite-card {
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
}

.skeleton-card {
  min-height: 220px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent),
    var(--panel);
  background-size: 220px 100%, auto;
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  from { background-position: -220px 0, 0 0; }
  to { background-position: calc(100% + 220px) 0, 0 0; }
}

.sprite-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 14px;
}

.family-title {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.family-progress {
  color: var(--good);
  font-weight: 850;
  font-size: 13px;
  padding: 5px 9px;
  background: rgba(101, 240, 163, 0.12);
  border-radius: 999px;
}

.family-progress.is-incomplete {
  color: var(--accent);
  background: rgba(114, 243, 255, 0.12);
}

.sprite-option {
  display: grid;
  grid-template-columns: 42px 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.045);
  transition: 0.15s ease;
}

.sprite-option:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 243, 255, 0.45);
}

.sprite-option--mastered {
  border-color: rgba(255, 209, 102, 0.72);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.13), rgba(255, 255, 255, 0.045));
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.12);
}

.sprite-option input {
  width: 28px;
  height: 28px;
  accent-color: var(--accent);
  justify-self: center;
}

.sprite-option--unreleased {
  opacity: 0.58;
  border-style: dashed;
}

.sprite-option--unreleased:hover {
  transform: none;
  border-color: var(--line);
}

.sprite-option--unreleased input {
  cursor: not-allowed;
}

.sprite-option--missing {
  opacity: 0.6;
}

.collection-cell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.sprite-collection-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.045);
  transition: 0.15s ease;
}

.sprite-collection-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 243, 255, 0.45);
}

.sprite-collection-cell--missing {
  opacity: 0.92;
  border: 1px dashed rgba(255, 178, 56, 0.85);
  background: rgba(255, 178, 56, 0.08);
  box-shadow: 0 0 10px rgba(255, 178, 56, 0.22);
}

.sprite-collection-cell--missing:hover {
  border-color: rgba(255, 178, 56, 1);
}

.sprite-collection-cell--mastered {
  border-color: rgba(255, 209, 102, 0.72);
  background: rgba(255, 209, 102, 0.1);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.16);
}

.sprite-collection-cell--unreleased {
  opacity: 0.58;
  border-style: dashed;
}

.collection-release-badge,
.table-sprite-unreleased {
  color: #ffb238;
  font-size: 0.72rem;
  font-weight: 800;
}

.collection-release-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(18, 15, 9, 0.84);
  transform: translateX(-50%);
}

.collection-mastery-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  color: var(--gold);
  font-size: 0.85rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.sprite-collection-cell--missing::after {
  content: "🔒";
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.7rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.sprite-collection-cell .sprite-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.sprite-image--missing {
  filter: grayscale(100%) brightness(0.85);
}

.sprite-art-pending { display:inline-flex;align-items:center;justify-content:center;padding:4px;color:var(--muted);font-size:10px;line-height:1.2;text-align:center;background:var(--panel-2);border:1px dashed var(--line);border-radius:8px; }
.sprite-image {
  display: block;
  object-fit: contain;
  flex: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 4px;
}

.sprite-image--option {
  width: 48px;
  height: 48px;
}

.sprite-image--collection {
  width: 40px;
  height: 40px;
}

.sprite-image--compact {
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 10px;
}

.sprite-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sprite-identity > div,
.sprite-identity > span {
  min-width: 0;
}

.sprite-option-content {
  min-width: 0;
}

.sprite-option-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.mastery-button {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 209, 102, 0.52);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.08);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mastery-button:hover,
.mastery-button.is-mastered {
  color: #171007;
  background: linear-gradient(135deg, #ffb938, var(--gold));
  border-color: var(--gold);
}

.mastery-button.is-mastered:hover {
  filter: brightness(1.08);
}

.sprite-name {
  display: block;
  font-weight: 850;
}

.family-description {
  max-width: 70ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.sprite-description {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.sprite-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.badge {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.07);
}

.badge.starter {
  color: var(--gold);
}

.badge.unreleased {
  color: #ffb238;
  background: rgba(255, 178, 56, 0.14);
}

.summon-cost {
  color: var(--gold);
  font-weight: 850;
}

.rarity-Mythic {
  color: #ffadf6;
}

.rarity-Legendary {
  color: #ffd166;
}

.rarity-Epic {
  color: #b794ff;
}

.rarity-Rare {
  color: #72f3ff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  border-radius: var(--radius);
  padding: 16px;
}

.summary-card strong {
  display: block;
  font-size: 22px;
}

.summary-card span {
  color: var(--muted);
}

.progress-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--good));
}

.friends-card-list {
  display: grid;
  gap: 14px;
}

.friend-block {
  border-radius: var(--radius);
  padding: 16px;
}

.friend-block h3 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.friend-sprite-row {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.friend-sprite-row:last-child {
  padding-bottom: 0;
}

.friend-sprite-name {
  font-weight: 850;
}

.friend-sprite-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.have-list,
.missing-list {
  color: var(--muted);
  font-size: 14px;
}

.have-list strong {
  color: var(--good);
}

.missing-list strong {
  color: var(--bad);
}

.name-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.table-wrap {
  border-radius: var(--radius);
  overflow: auto;
  max-height: 72vh;
  max-width: 100%;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-gutter: stable both-edges;
}

.table-scroll-hint {
  display: none;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  min-width: 850px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151a2d;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: #121625;
  min-width: 245px;
}

th:first-child {
  z-index: 3;
  background: #151a2d;
}

tr.family-break td {
  border-top: 2px solid rgba(114, 243, 255, 0.22);
}

.table-sprite-cell {
  white-space: normal;
}

.sprite-identity--table {
  white-space: normal;
}

.check {
  color: var(--good);
  font-size: 20px;
  font-weight: 900;
}

.mastery-check {
  color: var(--gold);
  font-size: 21px;
  font-weight: 900;
  filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.3));
}

.cross {
  color: var(--faint);
  font-size: 18px;
}

.table-sprite-name {
  display: block;
  font-weight: 850;
  color: var(--text);
}

.table-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: #061018;
  background: linear-gradient(135deg, var(--accent), var(--good));
  font-weight: 900;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  transition: 0.2s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 24px;
  }

  .hero-card {
    width: 100%;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .compare-filter-head {
    display: grid;
  }

  .compare-filter-actions {
    width: 100%;
  }

  .compare-filter-actions button {
    flex: 1 1 0;
  }

  .filters {
    justify-content: stretch;
  }

  .search {
    width: 100%;
  }

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

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

  .friend-sprite-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 9px;
  }

  .hero {
    min-height: auto;
    border-radius: 20px;
    padding: 20px;
  }

  .control-panel {
    padding: 10px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .profile-actions button {
    min-height: 42px;
    padding: 0 14px;
  }

  .dialog-new-user input,
  .profile-dialog-card input {
    min-height: 42px;
  }

  .tabs {
    top: 4px;
    overflow-x: auto;
    padding: 6px;
  }

  .tab {
    flex: 0 0 auto;
    padding: 0 14px;
  }

  .sprite-grid,
  .summary-grid,
  .tracker-progress-summary {
    grid-template-columns: 1fr;
  }

  .section-head {
    padding: 16px;
  }

  .compare-filter {
    padding: 12px;
    border-radius: 18px;
  }

  .compare-user-list {
    grid-template-columns: 1fr;
  }

  .compare-user-pill {
    min-height: 42px;
  }

  .table-wrap {
    max-height: 65vh;
    border-radius: 16px;
  }

  table {
    min-width: max-content;
  }

  th,
  td {
    padding: 10px 12px;
  }

  th:first-child,
  td:first-child {
    min-width: 190px;
    max-width: 220px;
  }

  .table-scroll-hint {
    display: block;
  }

  .sprite-option {
    grid-template-columns: 38px 38px minmax(0, 1fr);
    gap: 8px;
  }

  .sprite-option-actions {
    grid-column: 2 / -1;
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    width: 100%;
  }

  .sprite-image--option {
    width: 38px;
    height: 38px;
  }

  .sprite-image--compact {
    width: 30px;
    height: 30px;
  }

  h1 {
    letter-spacing: -0.06em;
  }
}

@media (max-width: 420px) {
  th:first-child,
  td:first-child {
    min-width: 170px;
    max-width: 190px;
  }

  th:first-child {
    z-index: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
