:root {
  color-scheme: dark;
  --app-bg: #171a1e;
  --surface: #21262b;
  --surface-raised: #282e34;
  --surface-soft: #1d2227;
  --surface-hover: #303840;
  --line: rgba(203, 222, 238, 0.12);
  --line-strong: rgba(203, 222, 238, 0.24);
  --text: #f2f6f9;
  --muted: #aebdca;
  --accent: #69bdf5;
  --accent-strong: #1874ad;
  --accent-soft: rgba(105, 189, 245, 0.13);
  --gold: #d8bd78;
  --success: #5ee39a;
  --warning: #f5c86b;
  --danger: #ff929b;
  --shadow-sm: 0 5px 14px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(105, 189, 245, 0.14), transparent 34rem),
    linear-gradient(180deg, #171a1e, #121519 42rem);
  color: var(--text);
  font: 14px/1.45 "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  scrollbar-color: #4b5964 #171a1e;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 42, 63, 0.94);
  border-bottom: 1px solid rgba(105, 189, 245, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.connection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem clamp(1rem, 2.5vw, 1.5rem);
}

.demo-copy {
  min-width: 0;
}

.demo-copy strong,
.demo-copy span {
  display: block;
}

.demo-copy strong {
  color: #fff;
  font-size: 1.05rem;
}

.demo-copy span {
  color: #c7dced;
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-link,
.secondary-button,
.tab,
.filter-button,
.asset-button,
.friend-card button {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.primary-link {
  flex: 0 0 auto;
  min-height: 2.55rem;
  padding: 0.62rem 1rem;
  background: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}

.primary-link:hover,
.secondary-button:hover,
.asset-button:hover,
.friend-card button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(6, 64, 100, 0.24);
}

.primary-link:hover {
  background: #2085c3;
}

.tabs {
  display: flex;
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
  padding: 0 1rem;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 3rem;
  padding: 0 1rem;
  background: transparent;
  color: #f4f8ff;
  border-radius: 0;
}

.tab::after {
  position: absolute;
  right: 0.55rem;
  bottom: 0;
  left: 0.55rem;
  height: 3px;
  background: transparent;
  content: "";
}

.tab.active::after {
  background: var(--accent);
}

.tab:hover {
  background: rgba(105, 189, 245, 0.08);
}

main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 2.4vw, 1.5rem) 3rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.preview-card,
.tool-panel,
.toolbar,
.friend-card,
.section-card,
.table-wrap {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.preview-card {
  position: relative;
  overflow: hidden;
  width: min(58rem, 100%);
  margin: 0 auto;
}

.preview-art,
.preview-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preview-art {
  background-position: center 18%;
  background-size: cover;
  opacity: 0.48;
}

.preview-shade {
  background: linear-gradient(90deg, rgba(20, 22, 25, 0.97), rgba(20, 22, 25, 0.7) 50%, rgba(20, 22, 25, 0.94));
}

.preview-content {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2.8vw, 1.5rem);
}

.preview-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}

.profile-icon {
  display: grid;
  place-items: center;
  width: 5.4rem;
  height: 5.4rem;
  overflow: hidden;
  border: 2px solid #c2a05a;
  border-radius: 50%;
  background: #111820;
}

.profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-copy {
  min-width: 0;
}

.eyebrow,
.preview-grid span,
.friend-group span,
.field span,
.search-field span,
th {
  display: block;
  color: #9fd3ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  color: #f6eedc;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1.1;
}

h1 small {
  color: #d7dce3;
  font-size: 0.72em;
}

h2 {
  margin-bottom: 0.15rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

#statusLine {
  margin: 0.4rem 0 0;
  color: #c7dced;
  font-size: 1rem;
  font-weight: 800;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.preview-grid div {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  background: rgba(13, 20, 26, 0.6);
  border: 1px solid rgba(203, 222, 238, 0.13);
  border-radius: 7px;
}

.preview-grid strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head.compact {
  margin-bottom: 1rem;
}

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

.muted {
  color: var(--muted);
  font-weight: 700;
}

.secondary-button {
  min-height: 2.5rem;
  padding: 0.52rem 0.9rem;
  background: rgba(13, 34, 52, 0.72);
  border-color: rgba(105, 189, 245, 0.28);
}

.secondary-button:hover {
  background: rgba(20, 57, 85, 0.86);
  border-color: rgba(105, 189, 245, 0.58);
}

.tool-panel {
  padding: 1.25rem;
}

.toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.search-field,
.field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.search-field {
  flex: 1 1 auto;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(203, 222, 238, 0.16);
  border-radius: 7px;
  outline: none;
}

textarea {
  min-height: 12rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(105, 189, 245, 0.7);
  outline-offset: 2px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.filter-button {
  min-height: 2.45rem;
  padding: 0.45rem 0.85rem;
  background: rgba(13, 19, 24, 0.32);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-button.active {
  border-color: rgba(94, 197, 255, 0.9);
  background: rgba(26, 68, 96, 0.7);
}

.filter-button span {
  display: inline-flex;
  min-width: 1.5rem;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.friend-card {
  padding: 0.9rem;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.friend-card:hover {
  border-color: rgba(142, 202, 255, 0.62);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.friend-card.offline {
  opacity: 0.72;
}

.friend-card.removing {
  pointer-events: none;
  border-color: rgba(105, 189, 245, 0.42);
  opacity: 0.68;
  transform: scale(0.985);
}

.friend-card.removed {
  pointer-events: none;
  animation: friend-card-remove 260ms ease forwards;
}

.friend-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.avatar-wrap {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  object-fit: cover;
}

.presence-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--surface-raised);
  border-radius: 50%;
  background: #777;
}

.presence-dot.online {
  background: #2fd57a;
}

.presence-dot.offline {
  background: #73777d;
}

.presence-dot.busy {
  background: #d84d4d;
}

.presence-dot.mobile {
  background: #4aa3ff;
}

.friend-title {
  min-width: 0;
}

.friend-title h3,
.friend-title p {
  overflow-wrap: anywhere;
}

.friend-title h3 {
  margin: 0;
  color: #f2fbff;
  font-size: 1rem;
}

.friend-title p {
  margin: 0.25rem 0 0;
  color: #a9bdca;
}

.badge-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.badge.league {
  background: rgba(134, 201, 255, 0.16);
  color: #9dd7ff;
}

.badge.discord {
  background: rgba(88, 101, 242, 0.2);
  color: #c8cdff;
}

.badge.mobile {
  background: rgba(74, 163, 255, 0.18);
  color: #b7dcff;
}

.badge.muted {
  background: rgba(255, 255, 255, 0.09);
  color: #c7dced;
}

.friend-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.8rem 0;
  padding: 0.65rem;
  background: rgba(13, 19, 24, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
}

.friend-group strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.friend-card button {
  min-height: 2.3rem;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border-color: rgba(142, 202, 255, 0.45);
}

.friend-card button:disabled {
  color: #8998a5;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.12);
}

.action-hint {
  margin: 0.55rem 0 0;
  color: #8fa5b4;
  font-size: 0.78rem;
}

@keyframes friend-card-remove {
  from {
    max-height: 22rem;
    opacity: 0.68;
    transform: scale(0.985);
  }

  to {
    max-height: 0;
    margin-top: -1rem;
    margin-bottom: -1rem;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: scale(0.94);
  }
}

.asset-grid {
  display: grid;
  gap: 1rem;
}

.icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
}

.background-grid {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.asset-button {
  position: relative;
  display: grid;
  gap: 0.5rem;
  width: 100%;
  overflow: hidden;
  padding: 0.65rem;
  background: var(--surface-raised);
  border-color: var(--line);
  text-align: left;
}

.asset-button.active {
  border-color: rgba(94, 197, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(94, 197, 255, 0.2), var(--shadow-sm);
}

.asset-button img {
  width: 100%;
  object-fit: cover;
}

.icon-grid .asset-button img {
  aspect-ratio: 1;
  border-radius: 8px;
}

.background-grid .asset-button img {
  aspect-ratio: 16 / 9;
  border-radius: 7px;
}

.asset-button span {
  color: #e8f4ff;
  font-size: 0.88rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(134, 201, 255, 0.16);
  color: #9dd7ff;
  font-weight: 900;
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

td {
  color: #dcebf5;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(105, 189, 245, 0.055);
}

@media (max-width: 860px) {
  .connection-row,
  .preview-header,
  .section-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-row,
  .section-head {
    display: flex;
  }

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

  .preview-header .secondary-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .connection-row {
    padding: 0.8rem 1rem;
  }

  main {
    padding: 1rem 0.75rem 2rem;
  }

  .preview-header,
  .preview-grid,
  .form-grid,
  .friend-grid,
  .background-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    padding: 0 0.35rem;
  }

  .tab {
    min-height: 2.65rem;
    padding: 0 0.7rem;
    font-size: 0.86rem;
  }

  .profile-icon {
    width: 4.5rem;
    height: 4.5rem;
  }
}

/* V3.4.1 app parity overrides for the static sandbox */
body {
  background: var(--app-bg);
}

.app-shell {
  background: #102a3f;
  border-bottom: 1px solid rgba(105, 189, 245, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.17);
  backdrop-filter: none;
}

.connection-row,
.tabs,
main {
  max-width: 82rem;
}

.connection-row {
  min-height: 4.1rem;
  padding: 0.65rem clamp(1rem, 2.4vw, 2rem);
}

.tabs {
  padding: 0 clamp(1rem, 2.4vw, 2rem);
}

.tab {
  min-height: 50px;
  padding: 0 18px;
  font-weight: 600;
}

main {
  padding: 1.75rem clamp(1rem, 2.4vw, 2rem) 3rem;
}

.primary-link,
.primary-action,
.secondary-button,
.owned-filter,
.friend-card button {
  min-height: 40px;
  border-radius: 7px;
  font-weight: 600;
  letter-spacing: 0;
}

.primary-action {
  min-width: 6rem;
  padding: 0.55rem 1rem;
  color: #fff;
  cursor: pointer;
  background: var(--accent-strong);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.primary-action:hover {
  background: #2085c3;
  box-shadow: 0 7px 18px rgba(11, 94, 148, 0.26);
  transform: translateY(-1px);
}

.tool-panel,
.toolbar,
.friend-card,
.section-card,
.table-wrap,
.note-card,
.rank-panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.preview-card {
  width: min(58rem, calc(100vw - 2rem));
  margin: 1.5rem auto 0;
  text-align: left;
  background: #1d2227;
  border-color: rgba(105, 189, 245, 0.22);
  box-shadow: var(--shadow-md);
}

.preview-content {
  gap: 0.95rem;
  padding: 1.25rem;
}

.profile-icon {
  width: 5rem;
  height: 5rem;
}

.preview-grid {
  gap: 0.75rem;
}

.preview-grid div {
  padding: 0.75rem 0.85rem;
  background: rgba(13, 20, 26, 0.56);
  border-color: rgba(203, 222, 238, 0.13);
}

.app-field,
.search-field {
  display: block;
  min-width: 0;
}

.app-field span,
.search-field span,
.friend-group span,
.preview-grid span,
.eyebrow,
th {
  display: block;
  color: #9fd3ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-field input,
.app-field select,
.app-field textarea,
.search-field input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 0;
  border-bottom: 1px solid rgba(203, 222, 238, 0.42);
  border-radius: 7px 7px 0 0;
  outline: none;
  transition: background 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.app-field input:focus,
.app-field select:focus,
.app-field textarea:focus,
.search-field input:focus {
  background: rgba(105, 189, 245, 0.09);
  border-bottom-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(105, 189, 245, 0.12);
}

.status-page {
  max-width: 64rem;
}

.status-card {
  max-width: 58rem;
  margin: 0 auto;
  padding: 1.65rem;
}

.status-card .panel-header {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.status-card .panel-header h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
}

.status-card .panel-header p {
  margin: 0;
  color: var(--muted);
}

.status-select {
  margin-bottom: 0.45rem;
}

.message-container {
  position: relative;
  margin-top: 1.25rem;
  margin-bottom: 0.55rem;
}

.message-field {
  margin-bottom: 0;
}

.message-field textarea {
  min-height: 12rem;
  height: 32vh;
  max-height: 22rem;
  padding-bottom: 3.25rem;
  resize: vertical;
}

.message-field small {
  display: block;
  margin: 0.4rem 0 0;
  color: #c7dced;
  font-size: 0.88rem;
}

.set-message-button {
  position: absolute;
  right: 1rem;
  bottom: 2.15rem;
  z-index: 2;
  min-width: 8.25rem;
}

.persistent-panel {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(13, 30, 42, 0.38);
  border: 1px solid rgba(105, 189, 245, 0.16);
  border-radius: 8px;
}

.persistent-toggle,
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  margin: 0;
  color: #f2f7fb;
  font-weight: 700;
}

.persistent-toggle input,
.toggle-row input {
  width: 1rem;
  height: 1rem;
  min-height: 0;
}

.persistent-note,
.automation-note {
  margin: 0.25rem 0 0;
  color: #c7dced;
  font-size: 0.88rem;
}

.app-field span,
.search-field span {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow,
.preview-grid span,
.friend-group span {
  color: #9fd3ff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

th {
  color: #e8f4ff;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
}

.custom-icons-page {
  max-width: 82rem;
  text-align: center;
}

.background-page {
  max-width: 88rem;
  text-align: center;
}

.note-card {
  max-width: 50rem;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  text-align: left;
}

.note-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.note-card p {
  margin: 0;
}

.search-panel {
  max-width: 72rem;
  margin: 1rem auto;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-panel .app-field {
  flex: 1 1 auto;
  width: 100%;
  text-align: center;
}

.search-panel input,
.search-champion input {
  text-align: center;
}

.owned-filter {
  min-width: 8.5rem;
  height: 2.75rem;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  background: rgba(13, 19, 24, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.owned-filter.active {
  color: #dff6ff;
  background: rgba(26, 68, 96, 0.7);
  border-color: rgba(94, 197, 255, 0.9);
}

.selection-note {
  max-width: 34rem;
  margin: 0.5rem auto 1rem;
  padding: 0.7rem 0.9rem;
  color: #c7dced;
  background: rgba(18, 38, 52, 0.72);
  border: 1px solid rgba(94, 197, 255, 0.24);
  border-radius: 6px;
}

.icon-grid,
.asset-grid,
.champion-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-right: auto;
  margin-left: auto;
}

.icon-grid {
  max-width: 76rem;
  margin-bottom: 1rem;
}

.load-more-button {
  display: block;
  margin: 0.35rem auto 0;
}

.icon-grid .empty-state {
  flex-basis: min(100%, 34rem);
}

.search-champion {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 7rem;
  margin: 0 auto 1rem;
  padding: 1.25rem 1.5rem;
}

.search-champion.browsing-skins {
  justify-content: center;
}

.search-champion .app-field {
  width: min(100%, 48rem);
  text-align: center;
}

.background-back-button {
  margin: 0 auto;
}

.icon-button,
.image-button,
.champion-button {
  position: relative;
  display: block;
  width: 104px !important;
  height: 104px !important;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  cursor: pointer;
  background: #18232b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.icon-button:hover,
.image-button:hover,
.champion-button:hover {
  border-color: rgba(142, 202, 255, 0.85);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.icon-button.owned-icon,
.image-button.active,
.champion-button.active {
  border-color: rgba(94, 197, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(94, 197, 255, 0.2);
}

.icon-button.selected-icon {
  border-color: rgba(94, 227, 154, 0.95);
  box-shadow: 0 0 0 2px rgba(94, 227, 154, 0.32), 0 0 18px rgba(94, 227, 154, 0.18);
}

.icon-button img,
.image-button img,
.champion-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.skin-button {
  width: 191px !important;
  height: 352px !important;
}

.skin-button img {
  object-fit: cover;
  object-position: center top;
}

.owned-badge {
  position: absolute;
  right: 0.25rem;
  bottom: 0.25rem;
  z-index: 1;
  padding: 0.15rem 0.35rem;
  color: #aee7ff;
  pointer-events: none;
  background: rgba(10, 46, 70, 0.92);
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.chat-rank-page {
  max-width: 58rem;
  margin: 0 auto;
}

.tab-panel.chat-rank-page.active {
  display: grid;
  gap: 1rem;
}

.rank-panel {
  width: 100%;
  padding: 1.25rem;
  text-align: left;
}

.rank-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.rank-source {
  margin: -0.35rem 0 0.75rem;
  color: #c7dced;
  font-size: 0.85rem;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.challenge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.1rem;
}

.automation-panel {
  background: var(--surface);
}

.automation-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.event-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  color: #c7dced;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  font-size: 0.85rem;
}

.event-status .connected {
  color: #c7dced;
}

.reapply-toggle {
  align-items: flex-start;
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
}

.table-wrap {
  max-width: 52rem;
  margin: 1rem auto 0;
  overflow-x: auto;
}

table {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  font-size: 1rem;
}

td {
  word-break: break-word;
}

@media (max-width: 720px) {
  .search-panel,
  .automation-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .rank-grid,
  .challenge-grid {
    grid-template-columns: 1fr;
  }

  .set-message-button {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
  }

  .message-field textarea {
    padding-bottom: 0.8rem;
  }
}

.demo-select {
  position: relative;
}

.demo-select-trigger {
  position: relative;
  display: block;
  width: 100%;
  min-height: 4rem;
  padding: 1.45rem 2.7rem 0.7rem 0.95rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 0;
  border-bottom: 1px solid rgba(203, 222, 238, 0.42);
  border-radius: 7px 7px 0 0;
  transition: background 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.demo-select-trigger::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0;
  height: 0;
  border-right: 0.38rem solid transparent;
  border-left: 0.38rem solid transparent;
  border-top: 0.42rem solid #d8e5ef;
  content: "";
  transform: translateY(-35%);
}

.demo-select.open .demo-select-trigger {
  background: rgba(105, 189, 245, 0.09);
  border-bottom-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(105, 189, 245, 0.12);
}

.demo-select.open .demo-select-trigger::after {
  border-top: 0;
  border-bottom: 0.42rem solid #d8e5ef;
}

.demo-select-trigger strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-select-panel {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  z-index: 40;
  display: none;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.25rem;
  background: #3f403f;
  border: 1px solid rgba(142, 202, 255, 0.28);
  border-radius: 0 0 7px 7px;
  box-shadow: var(--shadow-md);
}

.demo-select.open .demo-select-panel {
  display: block;
}

.demo-select-panel button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 2.7rem 0.7rem 0.8rem;
  color: #f2f6f9;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
}

.demo-select-panel button:hover {
  background: rgba(142, 202, 255, 0.12);
}

.demo-select-panel button.selected {
  background: rgba(105, 189, 245, 0.18);
}

.demo-select-panel button.selected::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0.7rem;
  height: 1.1rem;
  border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  content: "";
  transform: translateY(-65%) rotate(45deg);
}

.locked-message {
  pointer-events: none;
  user-select: none;
  caret-color: transparent;
}

.locked-message::selection {
  color: inherit;
  background: transparent;
}

.demo-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.45);
  animation: demo-backdrop-in 180ms ease-out both;
}

.demo-dialog-backdrop[hidden] {
  display: none;
}

.demo-dialog {
  width: min(32rem, calc(100vw - 3rem));
  padding: 1.65rem;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(24, 116, 173, 0.22), rgba(40, 46, 52, 0.96)),
    var(--surface-raised);
  border: 1px solid rgba(105, 189, 245, 0.42);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(8, 45, 72, 0.62);
  transform-origin: 50% 42%;
  animation: demo-dialog-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.demo-dialog-backdrop.closing {
  pointer-events: none;
  animation: demo-backdrop-out 170ms ease-in both;
}

.demo-dialog-backdrop.closing .demo-dialog {
  animation: demo-dialog-out 170ms cubic-bezier(0.4, 0, 1, 1) both;
}

.demo-dialog h2 {
  margin: 0;
  color: #e5f6ff;
  font-size: 1.6rem;
  line-height: 1.25;
}

.demo-dialog p {
  margin: 1rem 0 0;
  color: #d2e8f8;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.demo-dialog-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.35rem;
}

.demo-dialog-actions .primary-action {
  min-width: 6.4rem;
}

@keyframes demo-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes demo-backdrop-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes demo-dialog-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
    filter: blur(4px);
  }

  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.006);
    filter: blur(0);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes demo-dialog-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(10px) scale(0.975);
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-dialog-backdrop,
  .demo-dialog,
  .demo-dialog-backdrop.closing,
  .demo-dialog-backdrop.closing .demo-dialog {
    animation-duration: 1ms;
  }
}

/* Final polish pass */
.section-head,
.toolbar,
.filter-row,
.friend-grid,
.note-card,
.search-panel,
.search-champion,
.selection-note,
.load-more-row,
.icon-grid,
.champion-grid {
  animation: section-soft-in 180ms ease-out both;
}

.load-more-button {
  margin: 1.1rem auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  box-shadow: 0 10px 24px rgba(24, 116, 173, 0.22);
}

.custom-icons-page .load-more-button[hidden] {
  display: none !important;
}


.icon-button.selected-icon {
  border-color: rgba(94, 227, 154, 0.95) !important;
  box-shadow: 0 0 0 2px rgba(94, 227, 154, 0.32), 0 0 18px rgba(94, 227, 154, 0.18) !important;
}

.image-button.active,
.champion-button.active {
  border-color: rgba(94, 227, 154, 0.95) !important;
  box-shadow: 0 0 0 2px rgba(94, 227, 154, 0.22), 0 0 18px rgba(94, 227, 154, 0.14) !important;
}

.skin-button {
  background: #0e1419;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.skin-button img {
  object-fit: cover;
  object-position: center center;
  transition: transform 180ms ease, filter 180ms ease;
}

.skin-button:hover img {
  transform: scale(1.025);
  filter: saturate(1.05) brightness(1.04);
}

.skin-button .skin-name {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 1.2rem 0.55rem 0.5rem;
  color: #f4fbff;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(4, 10, 14, 0.88));
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 150ms ease, transform 150ms ease;
}

.skin-button:hover .skin-name,
.skin-button:focus-visible .skin-name,
.skin-button.active .skin-name {
  opacity: 1;
  transform: translateY(0);
}

.search-champion.browsing-skins {
  min-height: 5.3rem;
  padding: 1rem;
}

.background-page .selection-note[hidden] {
  display: none !important;
}

.empty-state {
  width: min(100%, 34rem);
  margin: 1rem auto;
  padding: 1rem 1.2rem;
  color: #c7dced;
  background: rgba(18, 38, 52, 0.72);
  border: 1px solid rgba(94, 197, 255, 0.18);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

.demo-dialog {
  border-color: rgba(94, 227, 154, 0.34);
}


.friend-card button[data-friend-action="invite"]:disabled {
  opacity: 0.62;
}

@keyframes section-soft-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-head,
  .toolbar,
  .filter-row,
  .friend-grid,
  .note-card,
  .search-panel,
  .search-champion,
  .selection-note,
  .load-more-row,
  .icon-grid,
  .champion-grid {
    animation-duration: 1ms;
  }

  .skin-button img,
  .skin-button .skin-name {
    transition-duration: 1ms;
  }
}

/* Final polish: app-style request dialog and clearer artwork */
.demo-dialog-backdrop {
  background: rgba(0, 0, 0, 0.24) !important;
}

.demo-dialog {
  width: min(44rem, calc(100vw - 3rem)) !important;
  padding: 2.1rem 2.25rem !important;
  color: var(--text) !important;
  background: #282e34 !important;
  border: 1px solid rgba(203, 222, 238, 0.16) !important;
  border-radius: 8px !important;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.46) !important;
}

.demo-dialog h2 {
  color: #f2f6f9 !important;
  font-size: 1.45rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.demo-dialog p {
  margin-top: 1.25rem !important;
  color: #f2f6f9 !important;
  font-size: 1.16rem !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

.demo-dialog-actions {
  margin-top: 2rem !important;
}

.demo-dialog-actions .primary-action {
  min-width: 8.2rem !important;
  min-height: 3rem !important;
}

.preview-art {
  opacity: 0.72 !important;
  filter: saturate(1.08) brightness(1.08) !important;
}

.preview-shade {
  background: linear-gradient(90deg, rgba(12, 16, 20, 0.9), rgba(12, 16, 20, 0.44) 52%, rgba(12, 16, 20, 0.76)) !important;
}

.skin-button img {
  filter: saturate(1.07) brightness(1.08) !important;
}

.skin-button:hover img {
  filter: saturate(1.12) brightness(1.12) !important;
}

/* Final background card crop: use centered splash art, not loading-screen side crops */
.skin-button img {
  object-fit: cover !important;
  object-position: center center !important;
}

.skin-button {
  background: #0d1217 !important;
}
