/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --page-bg: #10161d;
  --page-bg-accent: #1b2b3b;
  --chrome: #171d25;
  --chrome-border: rgba(255, 255, 255, 0.08);
  --panel: rgba(24, 34, 46, 0.92);
  --panel-strong: rgba(15, 23, 32, 0.96);
  --text: #e6edf5;
  --text-muted: #97a8bc;
  --accent: #66c0f4;
  --accent-soft: rgba(102, 192, 244, 0.18);
  --success: #7ed957;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  --steam-strip: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top, rgba(82, 142, 196, 0.2), transparent 30%),
    linear-gradient(180deg, var(--page-bg-accent), var(--page-bg));
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.steam-shell {
  padding-bottom: 4rem;
}

.pull-refresh-indicator {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 50%;
  z-index: 100;
  width: 2.1rem;
  height: 2.1rem;
  opacity: 0;
  transform: translateX(-50%) translateY(-40px);
  pointer-events: none;
}

.pull-refresh-spinner {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(102, 192, 244, 0.25);
  border-top-color: var(--accent);
  border-radius: 999px;
}

.pull-refresh-indicator--spinning .pull-refresh-spinner {
  animation: pull-refresh-spin 0.7s linear infinite;
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 800px) {
  .pull-refresh-indicator {
    display: block;
  }
}

.topbar {
  background: linear-gradient(180deg, rgba(27, 40, 56, 0.96), rgba(23, 29, 37, 0.98));
  border-bottom: 1px solid var(--chrome-border);
}

.topbar__inner,
.profile-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.topbar__brand,
.brand-lockup {
  display: flex;
  align-items: center;
}

.topbar__brand {
  gap: 0.85rem;
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__menu-toggle {
  display: none;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.topbar__menu-toggle-bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.topbar__avatar-link {
  display: block;
  line-height: 0;
}

.topbar__avatar-link:focus-visible {
  outline: 2px solid rgba(126, 217, 87, 0.95);
  outline-offset: 3px;
}

.brand-lockup h1,
.content-panel h1 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar__avatar-slot {
  position: relative;
  width: 2.7rem;
  height: 2.7rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 2px solid rgba(93, 112, 129, 0.95);
  background: linear-gradient(180deg, #6a747d, #4b545c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.topbar__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar__avatar-initial {
  color: #eef5fb;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.avatar-status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid #171d25;
  background: #5b6672;
}

.avatar-status-dot--online {
  background: #7ed957;
  box-shadow: 0 0 10px rgba(126, 217, 87, 0.55);
}

.avatar-status-dot--lg {
  right: 0;
  bottom: 0;
  width: 1rem;
  height: 1rem;
  border-width: 3px;
}

.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.topbar__build-link {
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(102, 192, 244, 0.18);
  background: rgba(6, 11, 17, 0.32);
  color: #b7c7d6;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.build-popup-wrapper {
  position: relative;
  display: inline-flex;
}

.build-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  /* padding-top (not margin) keeps this invisible strip part of the
     hoverable box, so the mouse doesn't cross a dead zone on its way
     down from the build link into the popup below. */
  padding-top: 0.4rem;
  pointer-events: none;
}

.build-popup--visible {
  pointer-events: auto;
}

.build-popup__inner {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(102, 192, 244, 0.24);
  border-radius: 8px;
  background: #0b1520;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.build-popup--visible .build-popup__inner {
  opacity: 1;
  transform: translateY(0);
}

.build-popup__link {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.topbar__nav-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.topbar__nav a:hover,
.topbar__nav a:focus-visible,
.topbar__nav-button:hover,
.topbar__nav-button:focus-visible {
  color: var(--text);
}

.profile-shell {
  padding-top: 1rem;
}

.flash-stack {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  display: grid;
  gap: 0.5rem;
}

.flash-banner {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 32, 0.96);
}

.flash-banner--notice {
  border-color: rgba(126, 217, 87, 0.24);
  color: #dff8d3;
}

.flash-banner--alert {
  border-color: rgba(255, 116, 116, 0.28);
  color: #ffd7d7;
}

.profile-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.panel {
  border: 1px solid var(--chrome-border);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(24, 34, 46, 0.98), rgba(15, 23, 32, 0.98));
  box-shadow: var(--shadow);
}

.summary-panel,
.content-panel {
  padding: 1rem;
}

.summary-panel h3 {
  margin-top: 0;
}

.summary-list {
  margin: 0;
}

.summary-list div + div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-list dt {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-list dd {
  margin: 0;
}

.content-panel {
  min-height: 18rem;
}

.content-panel h1 {
  font-size: clamp(1.75rem, 2vw, 2.4rem);
}

.chain-show {
  display: grid;
  gap: 1.5rem;
}

.chain-builder-page {
  display: grid;
  gap: 1.25rem;
}

.chain-builder__layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
  gap: 1rem;
}

.chain-builder-panel,
.chain-builder-preview {
  padding: 1rem;
}

.chain-builder-panel__section + .chain-builder-panel__section {
  margin-top: 1rem;
}

.chain-builder__label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chain-builder__input,
.chain-builder__select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 11, 17, 0.65);
  color: var(--text);
}

.chain-builder__textarea {
  min-height: 7.5rem;
  resize: vertical;
}

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

.chain-builder__add-button,
.chain-builder__submit {
  min-height: 2.75rem;
}

.chain-builder__hint {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.chain-builder-preview__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.chain-builder-preview__header h2 {
  margin: 0;
}

.chain-builder-preview__count {
  margin: 0;
  color: var(--text-muted);
}

.chain-builder-preview__empty {
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.chain-builder-preview__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chain-builder-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.24);
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.chain-builder-item__media {
  width: 64px;
  height: 64px;
}

.chain-builder-item__icon {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #0f1721;
}

.chain-builder-item__icon--placeholder {
  display: grid;
  place-items: center;
  color: #d8efff;
  font-weight: 700;
  background: rgba(102, 192, 244, 0.14);
}

.chain-builder-item__body h3 {
  margin: 0;
  font-size: 1rem;
}

.chain-builder-item__body p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.chain-builder-item__note-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  color: #d5dee8;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chain-builder-item__note {
  width: 100%;
  min-height: 4.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 16, 0.72);
  color: var(--text);
  resize: vertical;
}

.chain-builder-item__remove {
  min-height: 2rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.form-errors {
  padding: 1rem;
  border: 1px solid rgba(255, 116, 116, 0.28);
  background: rgba(60, 10, 10, 0.3);
}

.form-errors h3 {
  margin: 0 0 0.6rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.login-card {
  gap: 1rem;
}

.login-card p {
  margin: 0;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 0.2rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.chain-index {
  display: grid;
  gap: 1.25rem;
}

.chain-index__header h1 {
  margin: 0;
}

.profile-header__presence {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.chain-index__description {
  max-width: 52rem;
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.help-page .chain-card {
  gap: 0.45rem;
}

.help-page h2 {
  margin: 0.95rem 0 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
}

.help-page h2:first-child {
  margin-top: 0;
}

.help-page p {
  margin: 0;
}

.help-page p + p {
  margin-top: 0.25em;
}

.help-page a {
  color: var(--accent);
  font-weight: 600;
}

.help-page a:hover,
.help-page a:focus-visible {
  text-decoration: underline;
}

.chain-show__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}

.chain-show__game {
  margin: 0.35rem 0 0;
  color: var(--accent);
  font-size: 1rem;
}

.chain-show__game-link:hover,
.chain-show__game-link:focus-visible {
  color: #9ad9ff;
}

.chain-show__steam-link {
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.chain-show__steam-link:hover,
.chain-show__steam-link:focus-visible {
  color: var(--accent);
}

.chain-show__byline,
.chain-card__byline {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.chain-show__description {
  max-width: 54rem;
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.chain-show__description p {
  margin: 0;
}

.chain-show__description p + p {
  margin-top: 0.9rem;
}

.achievement-detail {
  display: grid;
  gap: 1.25rem;
}

.achievement-detail__header {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.achievement-detail__icon-wrap {
  width: 96px;
  height: 96px;
}

.achievement-detail__icon {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: #0f1721;
}

.achievement-detail__icon--placeholder {
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.2), rgba(7, 12, 18, 0.9));
}

.achievement-detail__copy h1 {
  margin: 0;
}

.achievement-detail__game,
.achievement-link-card__game {
  margin: 0.3rem 0 0;
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.achievement-detail__description {
  margin-top: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.achievement-detail__description p {
  margin: 0;
}

.achievement-detail__description p + p {
  margin-top: 0.9rem;
}

.achievement-detail__chains {
  display: grid;
  gap: 0.8rem;
}

.achievement-link-card {
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.achievement-link-card__body h3 {
  margin: 0;
  font-size: 1rem;
}

.achievement-link-card__body h3 a:hover,
.achievement-link-card__body h3 a:focus-visible,
.achievement-row__title-link:hover,
.achievement-row__title-link:focus-visible {
  color: var(--accent);
}

.achievement-link-card__note {
  margin-top: 0.55rem;
  color: #c5d2df;
  line-height: 1.45;
  font-size: 0.84rem;
}

.achievement-link-card__note p {
  margin: 0;
}

.achievement-link-card__note p + p {
  margin-top: 0.75rem;
}

.chain-show__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-self: start;
}

.sidebar-stack {
  display: grid;
  gap: 1rem;
}

.sidebar-section h3 {
  margin: 0 0 0.9rem;
}

.sidebar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(102, 192, 244, 0.18);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(57, 107, 136, 0.9), rgba(31, 66, 91, 0.95));
  color: #e8f6ff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.sidebar-actions {
  display: flex;
  gap: 0.6rem;
}

.sidebar-icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.7rem;
  min-width: 2.7rem;
  min-height: 2.7rem;
  padding: 0;
  border: 1px solid rgba(255, 116, 116, 0.28);
  background: linear-gradient(180deg, rgba(88, 36, 36, 0.94), rgba(54, 20, 20, 0.98));
  color: #ffd7d7;
  cursor: pointer;
}

.sidebar-icon-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.sidebar-icon-button--nav {
  border-color: rgba(102, 192, 244, 0.18);
  background: linear-gradient(180deg, rgba(57, 107, 136, 0.9), rgba(31, 66, 91, 0.95));
  color: #e8f6ff;
}

.sidebar-icon-button--edit {
  border-color: rgba(210, 216, 227, 0.2);
  background: linear-gradient(180deg, rgba(62, 72, 83, 0.94), rgba(35, 42, 50, 0.98));
  color: #e3eaf2;
}

.sidebar-icon-button--star {
  border-color: rgba(255, 210, 110, 0.26);
  background: linear-gradient(180deg, rgba(76, 63, 25, 0.94), rgba(49, 39, 12, 0.98));
  color: #ffe6a6;
}

.sidebar-icon-button--star-active {
  color: #ffc84d;
}

.sidebar-icon-button--pin {
  border-color: rgba(232, 185, 63, 0.26);
  background: linear-gradient(180deg, rgba(76, 63, 25, 0.94), rgba(49, 39, 12, 0.98));
  color: #e8b93f;
}

.sidebar-icon-button--pin-active {
  color: #ffd35c;
}

.sidebar-icon-button--pin:hover,
.sidebar-icon-button--pin:focus-visible {
  background: linear-gradient(180deg, rgba(98, 82, 33, 0.96), rgba(61, 49, 16, 0.99));
}

.sidebar-icon-button--muted {
  opacity: 0.55;
}

.sidebar-icon-button--muted:hover,
.sidebar-icon-button--muted:focus-visible {
  opacity: 0.85;
}

.sidebar-button:hover,
.sidebar-button:focus-visible,
.sidebar-icon-button--nav:hover,
.sidebar-icon-button--nav:focus-visible {
  background: linear-gradient(180deg, rgba(69, 123, 154, 0.94), rgba(36, 77, 105, 0.98));
}

.sidebar-icon-button--edit:hover,
.sidebar-icon-button--edit:focus-visible {
  background: linear-gradient(180deg, rgba(76, 88, 101, 0.96), rgba(44, 52, 60, 0.99));
}

.sidebar-icon-button--danger:hover,
.sidebar-icon-button--danger:focus-visible {
  background: linear-gradient(180deg, rgba(112, 45, 45, 0.96), rgba(70, 25, 25, 0.99));
}

.sidebar-icon-button--star:hover,
.sidebar-icon-button--star:focus-visible {
  background: linear-gradient(180deg, rgba(98, 82, 33, 0.96), rgba(61, 49, 16, 0.99));
}

.game-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.game-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(102, 192, 244, 0.14);
  border-radius: 999px;
  background: rgba(102, 192, 244, 0.08);
  color: #d9e7f4;
  font-size: 0.78rem;
  line-height: 1.2;
}

.game-filter-chip:hover,
.game-filter-chip:focus-visible {
  background: rgba(102, 192, 244, 0.16);
  color: var(--text);
}

.game-filter-chip--active {
  background: linear-gradient(180deg, rgba(57, 107, 136, 0.9), rgba(31, 66, 91, 0.95));
  color: #eef8ff;
  border-color: rgba(102, 192, 244, 0.26);
}

.sidebar-stat-grid {
  display: grid;
  gap: 0.8rem;
}

.achievement-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(102, 192, 244, 0.12);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(25, 40, 55, 0.96), rgba(11, 18, 26, 0.98));
}

.achievement-stat-card--sidebar {
  padding: 0.85rem 0.9rem;
}

.chain-card-list {
  display: grid;
  gap: 0.95rem;
}

.chain-card {
  display: grid;
  gap: 0.95rem;
  position: relative;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(15, 23, 32, 0.98), rgba(9, 14, 20, 0.99));
}

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

.chain-card__lead {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.chain-card__icon-stack {
  position: relative;
  flex: 0 0 auto;
}

.chain-card__icon-link {
  display: block;
  flex: 0 0 auto;
  border-radius: 2px;
}

.chain-card__icon-link:focus-visible {
  outline: 2px solid rgba(255, 206, 97, 0.95);
  outline-offset: 3px;
}

.chain-card__icon-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
}

.chain-card__icon-wrap--glow::before,
.chain-card__icon-wrap--glow::after {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
}

.chain-card__icon-wrap--glow::before {
  background:
    radial-gradient(circle, rgba(255, 246, 186, 0.98) 0 18%, rgba(255, 212, 92, 0.94) 28%, rgba(255, 173, 46, 0.82) 48%, rgba(157, 88, 13, 0.34) 66%, transparent 78%);
  opacity: 0.98;
  filter: blur(5px) saturate(1.2);
  transform-origin: center;
  animation: crown-icon-spin 10s linear infinite;
  -webkit-mask-image: url("https://cdn.fastly.steamstatic.com/steamcommunity/public/ssr/star_mask-IH5JP5JD.png");
  -webkit-mask-size: cover;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("https://cdn.fastly.steamstatic.com/steamcommunity/public/ssr/star_mask-IH5JP5JD.png");
  mask-size: cover;
  mask-position: center;
  mask-repeat: no-repeat;
}

.chain-card__icon-wrap--glow::after {
  inset: -3px;
  border-radius: 0.6rem;
  background: radial-gradient(circle, rgba(255, 206, 97, 0.28), rgba(255, 163, 43, 0.12) 45%, transparent 72%);
  filter: blur(3px);
}

.chain-card__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #0f1721;
}

.chain-card__icon--placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.2), rgba(7, 12, 18, 0.9));
}

@keyframes crown-icon-spin {
  from {
    transform: rotate(0deg) scale(1.02);
  }

  to {
    transform: rotate(360deg) scale(1.02);
  }
}

.chain-card__heading h2 {
  margin: 0.15rem 0 0;
  font-size: 1.32rem;
}

.chain-card__heading h2 a:hover,
.chain-card__heading h2 a:focus-visible {
  color: var(--accent);
}

.chain-card__game {
  margin: 0.18rem 0 0;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chain-favorite-button {
  display: grid;
  place-items: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 210, 110, 0.2);
  background: rgba(255, 206, 97, 0.05);
  color: #cfd8e2;
  cursor: pointer;
}

.chain-favorite-button svg {
  width: 0.9rem;
  height: 0.9rem;
}

.chain-favorite-button--active {
  color: #ffc84d;
  background: rgba(255, 206, 97, 0.12);
}

.chain-card__meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chain-card__description {
  margin: 0;
  color: #c5d2df;
  line-height: 1.55;
}

.chain-card__description p {
  margin: 0;
}

.chain-card__description p + p {
  margin-top: 0.8rem;
}

.chain-card__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.chain-card__detail {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 0.9rem;
  background: rgba(0, 0, 0, 0.26);
  border-radius: 2px;
}

.chain-card__detail-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chain-card__detail-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}

.chain-card__detail-value--linked:hover,
.chain-card__detail-value--linked:focus-visible {
  color: var(--accent);
}

.chain-card__detail-icon {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  object-fit: cover;
}

.chain-card__detail-icon--placeholder {
  background: var(--accent-soft);
}

.chain-card__detail-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-card__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chain-card__pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  background: rgba(102, 192, 244, 0.1);
  color: #d6e8f6;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.achievement-stat-card__value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1;
}

.achievement-stat-card__label {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.achievements-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.achievements-section__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.achievements-section__header h2 {
  margin: 0;
}

.achievements-section__meta {
  margin: 0;
  color: var(--text-muted);
}

.achievement-wall__show-all {
  margin-left: 0.4rem;
  color: var(--accent);
}

.achievement-list {
  display: grid;
  gap: 0.6rem;
}

.achievement-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.achievement-row__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
}

.achievement-row__link {
  display: block;
  line-height: 0;
}

.achievement-row__link:focus-visible {
  outline: 2px solid rgba(102, 192, 244, 0.95);
  outline-offset: 2px;
}

.achievement-row__icon {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 0;
  background: #0f1721;
  object-fit: cover;
}

.achievement-row__icon--placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
  background:
    linear-gradient(135deg, rgba(102, 192, 244, 0.2), rgba(7, 12, 18, 0.9));
}

.achievement-step {
  display: grid;
  gap: 0.6rem;
}

.achievement-note {
  padding: 0.55rem 0.7rem;
  background: var(--steam-strip);
}

.achievement-note__body {
  color: #c5d2df;
  line-height: 1.35;
  font-size: 0.79rem;
}

.achievement-note__body p {
  margin: 0;
}

.achievement-note__body p + p {
  margin-top: 0.75rem;
}

.achievement-row__body {
  position: relative;
  min-height: 64px;
  padding: 0.38rem 11.5rem 0.42rem 0.45rem;
  background: var(--steam-strip);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.achievement-row__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.achievement-row__title-line h3 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.2;
}

.achievement-row__title-link {
  color: inherit;
}

.achievement-row__type {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  background: rgba(102, 192, 244, 0.12);
  color: #bfe8ff;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.achievement-row__unlock-time {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  color: #8fa0b0;
  font-size: 0.72rem;
  white-space: nowrap;
  text-align: right;
}

.achievement-row__description {
  margin: 0.16rem 0 0;
  color: #c5d2df;
  line-height: 1.3;
  font-size: 0.79rem;
}

.achievement-row__description p {
  margin: 0;
}

.achievement-row__description p + p {
  margin-top: 0.7rem;
}

.achievement-row__description--secondary {
  color: #8fa0b0;
  font-size: 0.72rem;
}

.achievement-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.3rem;
  color: #8fa0b0;
  font-size: 0.72rem;
}

.achievement-empty-state {
  padding: 1.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  color: var(--text-muted);
  text-align: center;
}

/*
 * Achievement Wall: a dense grid of every achievement a player has
 * unlocked, most recent first -- meant to read like a medal case, not a
 * list. Pinned tiles get a star badge and a brighter border.
 */
.achievement-wall {
  margin-bottom: 1.5rem;
}

.achievement-wall__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.5rem;
}

.achievement-wall__tile-wrap {
  position: relative;
}

.achievement-wall__tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  overflow: visible;
}

.achievement-wall__tile:hover,
.achievement-wall__tile:focus-visible {
  border-color: var(--accent);
}

.achievement-wall__tile--pinned {
  border-color: #e8b93f;
  box-shadow: 0 0 10px rgba(232, 185, 63, 0.35);
}

/*
 * Same Steam-CDN star-mask glow as .chain-card__icon-wrap--glow. First pass
 * scaled the insets/blur down and dropped the spin, on the theory that a
 * dense grid of small tiles needed something more restrained -- but at real
 * wall-tile size (packs down near 64px) that read as barely-there rather
 * than subtle. A crisp border makes it legible even at a glance/thumbnail;
 * the animated halo (same size/speed as the chain-card version) is what
 * actually catches the eye on a tile this small.
 */
.achievement-wall__tile--rare {
  border-color: #ffb545;
}

.achievement-wall__tile--rare::before,
.achievement-wall__tile--rare::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.achievement-wall__tile--rare::before {
  inset: -7px;
  background:
    radial-gradient(circle, rgba(255, 246, 186, 0.98) 0 18%, rgba(255, 212, 92, 0.94) 28%, rgba(255, 173, 46, 0.82) 48%, rgba(157, 88, 13, 0.34) 66%, transparent 78%);
  opacity: 0.98;
  filter: blur(5px) saturate(1.2);
  animation: crown-icon-spin 10s linear infinite;
  -webkit-mask-image: url("https://cdn.fastly.steamstatic.com/steamcommunity/public/ssr/star_mask-IH5JP5JD.png");
  -webkit-mask-size: cover;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("https://cdn.fastly.steamstatic.com/steamcommunity/public/ssr/star_mask-IH5JP5JD.png");
  mask-size: cover;
  mask-position: center;
  mask-repeat: no-repeat;
}

.achievement-wall__tile--rare::after {
  inset: -3px;
  border-radius: 4px;
  background: radial-gradient(circle, rgba(255, 206, 97, 0.32), rgba(255, 163, 43, 0.14) 45%, transparent 72%);
  filter: blur(3px);
}

.achievement-wall__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
}

.achievement-wall__icon--placeholder {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-soft);
}

.achievement-wall__pin-badge {
  position: absolute;
  z-index: 2;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #e8b93f;
  color: #171d25;
  font-size: 0.65rem;
  line-height: 1;
}

.wall-popup {
  --wall-popup-shift: 0px;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(calc(-50% + var(--wall-popup-shift)));
  z-index: 30;
  width: 220px;
  padding-bottom: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.wall-popup--visible {
  opacity: 1;
  pointer-events: auto;
}

.wall-popup__inner {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(102, 192, 244, 0.24);
  border-radius: 8px;
  background: #0b1520;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.wall-popup__inner h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.wall-popup__inner p {
  margin: 0.2rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.wall-popup__inner a {
  color: var(--accent);
}

.wall-popup__pin-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}

.wall-popup__pin-button:hover {
  border-color: var(--accent);
}

/*
 * Wizard: a deliberately bare, single-focus flow (own layout, no topbar/sidebar).
 * One question per screen, generous whitespace, one primary action.
 */
.wizard-shell {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
}

.wizard-shell__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.wizard-shell__close:hover,
.wizard-shell__close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.wizard-stage {
  width: 100%;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  text-align: center;
}

.wizard-flash-stack {
  width: 100%;
}

.wizard-progress {
  display: flex;
  gap: 0.35rem;
}

.wizard-progress__dot {
  width: 1.6rem;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.wizard-progress__dot--active {
  background: var(--accent);
}

.wizard-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wizard-title {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.wizard-title__aside {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
}

.wizard-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.wizard-input,
.wizard-textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(10, 16, 24, 0.7);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
}

.wizard-textarea {
  min-height: 5rem;
  text-align: left;
  resize: none;
}

.wizard-input:focus,
.wizard-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.wizard-hint {
  margin: 0;
  max-width: 24rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.wizard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1520;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.wizard-button:hover,
.wizard-button:focus-visible {
  background: #7ecbf6;
}

.wizard-button:active {
  transform: scale(0.98);
}

.wizard-button:disabled,
.wizard-button--disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: not-allowed;
}

.wizard-button--disabled {
  pointer-events: none;
}

.wizard-button--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.wizard-button--secondary:hover,
.wizard-button--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.wizard-button-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.wizard-game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  width: 100%;
}

.wizard-game-grid form.button_to {
  display: contents;
}

.wizard-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(15, 23, 32, 0.7);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.wizard-game-card:hover,
.wizard-game-card:focus-visible {
  border-color: rgba(102, 192, 244, 0.4);
  background: rgba(25, 40, 55, 0.85);
}

.wizard-game-card__icon {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
}

.wizard-game-card__icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 600;
}

.wizard-game-card__body h3 {
  margin: 0;
  max-width: 10rem;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-game-card__meta {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.wizard-achievement-picker,
.wizard-syncing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.wizard-achievement-picker__description {
  margin: 0;
  min-height: 1.4em;
  max-width: 24rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.wizard-achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.wizard-achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(15, 23, 32, 0.7);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wizard-achievement-card:hover,
.wizard-achievement-card:focus-visible {
  border-color: rgba(102, 192, 244, 0.3);
}

.wizard-achievement-card__icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
}

.wizard-achievement-card__icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  opacity: 0.45;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.wizard-achievement-card__icon--placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.wizard-achievement-card__title {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.wizard-achievement-card--selected {
  border-color: var(--accent);
  background: rgba(25, 40, 55, 0.9);
}

.wizard-achievement-card--selected .wizard-achievement-card__icon {
  filter: grayscale(0);
  opacity: 1;
}

.wizard-achievement-card--selected .wizard-achievement-card__title {
  color: var(--text);
}

.wizard-empty {
  color: var(--text-muted);
  line-height: 1.6;
}

.wizard-xp-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.wizard-xp-summary__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-xp-summary__row {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(15, 23, 32, 0.7);
  color: var(--text-muted);
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wizard-xp-summary__row--visible {
  opacity: 1;
  transform: translateY(0);
  color: var(--text);
}

.wizard-xp-summary__total {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wizard-xp-summary__total--visible {
  opacity: 1;
  transform: translateY(0);
  animation: wizard-xp-sparkle 1.1s ease-out;
}

@keyframes wizard-xp-sparkle {
  0% {
    text-shadow: 0 0 0 rgba(102, 192, 244, 0);
    transform: scale(1) translateY(0);
  }

  45% {
    text-shadow: 0 0 20px rgba(102, 192, 244, 0.9);
    transform: scale(1.08) translateY(0);
  }

  100% {
    text-shadow: 0 0 0 rgba(102, 192, 244, 0);
    transform: scale(1) translateY(0);
  }
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(15, 23, 32, 0.98), rgba(9, 14, 20, 0.99));
}

.leaderboard-row--me {
  border-color: rgba(102, 192, 244, 0.4);
  background: linear-gradient(180deg, rgba(25, 40, 55, 0.96), rgba(11, 18, 26, 0.98));
}

.leaderboard-row__rank {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.leaderboard-row__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.leaderboard-row__avatar-wrap {
  position: relative;
  flex: none;
}

.leaderboard-row__avatar {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  object-fit: cover;
}

.leaderboard-row__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.leaderboard-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.leaderboard-row__xp {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.leaderboard-row__stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.leaderboard-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.leaderboard-stat__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.9rem;
  line-height: 1;
}

.leaderboard-stat__value {
  min-width: 1ch;
}

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

.profile-header__avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.profile-header__avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 2px;
  object-fit: cover;
}

.profile-header__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 600;
}

.profile-header__copy h1 {
  margin: 0;
}

.xp-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.xp-feed__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: rgba(15, 23, 32, 0.7);
}

.xp-feed__description {
  flex: 1;
  min-width: 0;
  color: var(--text);
  line-height: 1.5;
}

.xp-feed__time {
  flex: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.xp-feed__entity-link {
  color: var(--accent);
  font-weight: 600;
}

.xp-feed__entity-link:hover,
.xp-feed__entity-link:focus-visible {
  text-decoration: underline;
}

.xp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(126, 217, 87, 0.16);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-feed__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: rgba(15, 23, 32, 0.7);
}

.news-feed__description {
  flex: 1;
  min-width: 0;
  color: var(--text);
  line-height: 1.5;
}

.news-feed__actor-name {
  color: var(--accent);
  font-weight: 600;
}

.news-feed__pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.news-feed__pagination-link {
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
}

.news-feed__pagination-link:hover {
  border-color: var(--accent);
}

.news-feed__pagination-link--disabled {
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

.xp-feed__icon {
  position: relative;
  flex: none;
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 4px;
  object-fit: cover;
}

.xp-feed__icon--placeholder {
  background: rgba(255, 255, 255, 0.06);
}

.xp-feed__icon-link {
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.xp-feed__icon-link:hover,
.xp-feed__icon-link:focus-visible {
  opacity: 0.82;
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.4);
}

.xp-feed__icon-link img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.xp-feed__icon--chain {
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-feed__icon-cover {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.xp-feed__icon-glyph {
  position: absolute;
  right: -0.3rem;
  bottom: -0.3rem;
  font-size: 0.75rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.xp-feed__icon-status-glyph {
  position: absolute;
  right: -0.3rem;
  top: -0.3rem;
  font-size: 0.7rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.xp-feed__icon--chain:not(:has(.xp-feed__icon-cover)) {
  gap: 0.15rem;
}

.xp-feed__icon--chain:not(:has(.xp-feed__icon-cover)) .xp-feed__icon-glyph,
.xp-feed__icon--chain:not(:has(.xp-feed__icon-cover)) .xp-feed__icon-status-glyph {
  position: static;
  font-size: 0.9rem;
  filter: none;
}

.comments-section {
  margin-top: 0.5rem;
}

.comment-form {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.comment-form__textarea {
  resize: none;
}

.comment-form__submit {
  justify-self: start;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: rgba(15, 23, 32, 0.7);
}

.comment-row__avatar-wrap {
  flex: none;
}

.comment-row__avatar {
  display: block;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 4px;
  object-fit: cover;
}

.comment-row__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.comment-row__body {
  flex: 1;
  min-width: 0;
}

.comment-row__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.comment-row__time {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.comment-row__text {
  color: var(--text);
  line-height: 1.5;
}

.comment-row__text p {
  margin: 0;
}

.comment-row__text p + p {
  margin-top: 0.4em;
}

.comment-row__delete {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid rgba(255, 116, 116, 0.28);
  border-radius: 4px;
  background: transparent;
  color: #ffaaaa;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.comment-row__delete:hover,
.comment-row__delete:focus-visible {
  background: rgba(255, 116, 116, 0.12);
}

@media (max-width: 900px) {
  .chain-builder__layout {
    grid-template-columns: 1fr;
  }

  .chain-show__header {
    grid-template-columns: 1fr;
  }

  .chain-card__top {
    display: block;
  }

  .chain-card__lead {
    width: 100%;
  }

  .chain-card__details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .topbar__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar__row {
    width: 100%;
  }

  .brand-lockup h1 {
    font-size: 1.3rem;
    white-space: nowrap;
  }

  .topbar__menu-toggle {
    display: flex;
  }

  .build-popup-wrapper {
    display: none;
  }

  .topbar__nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .topbar__nav--open {
    display: flex;
  }

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

  .steam-shell--dashboard .summary-panel {
    display: none;
  }

  .achievement-row__body {
    padding-right: 0.45rem;
    min-height: 0;
  }

  .achievement-row__unlock-time {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 0.35rem;
    text-align: left;
  }

  .chain-builder__picker,
  .chain-builder-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .achievement-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.4rem;
  }

  .achievement-row__icon {
    width: 56px;
    height: 56px;
  }

  .achievement-row__body {
    min-height: 56px;
  }

  .chain-show__summary {
    grid-template-columns: 1fr;
  }

  .achievements-section__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-row {
    grid-template-columns: 1.75rem 1fr auto;
    grid-template-areas:
      "rank identity xp"
      "rank stats stats";
    row-gap: 0.5rem;
    padding: 0.65rem 0.8rem;
  }

  .leaderboard-row__rank {
    grid-area: rank;
  }

  .leaderboard-row__identity {
    grid-area: identity;
    min-width: 0;
  }

  .leaderboard-row__xp {
    grid-area: xp;
  }

  .leaderboard-row__stats {
    grid-area: stats;
    justify-self: start;
  }

  .wizard-achievement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/*
 * Battle: PvE card battle board. Two rows (opponent / you), 3 slots each,
 * a hand tray, and a move log. See app/javascript/controllers/battle_controller.js.
 */
.battle-board {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  background: var(--panel);
}

/*
 * A grid rather than stacked flex rows so the opponent/player avatar
 * cards can span exactly the combined width of the 3 slot columns below
 * them (grid-column: 1 / -1), guaranteeing pixel-perfect alignment
 * without hardcoding a width. .battle-slots uses display:contents so its
 * 3 child slots become direct items of *this* grid instead of nesting
 * their own row -- that's what makes slot 1/2/3 line up vertically
 * between the opponent and player rows.
 */
.battle-board__main {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 0.6rem;
  justify-content: center;
  flex: 1 1 auto;
}

.battle-board__decks {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.battle-info-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-avatar-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  background: var(--panel-strong);
  text-align: left;
  cursor: default;
}

.battle-avatar-card--targetable {
  cursor: pointer;
}

.battle-avatar-card--targetable:hover {
  border-color: #e05252;
}

.battle-avatar-card--attacking {
  animation: battle-card-pulse 0.4s ease-out;
}

.battle-avatar-card__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.battle-avatar-card__icon--mirrored {
  transform: scaleX(-1);
}

.battle-avatar-card__icon--placeholder {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--accent-soft);
}

.battle-avatar-card__title {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.battle-hp {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.battle-hp__bar {
  width: 100%;
  height: 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.battle-hp__fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease;
}

.battle-hp__value {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.battle-slots {
  display: contents;
}

.battle-slot {
  width: 84px;
  height: 108px;
  border: 1px dashed var(--chrome-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-slot--placeable {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  cursor: pointer;
}

.battle-card {
  position: relative;
  width: 80px;
  padding: 0.35rem;
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  background: var(--panel-strong);
  cursor: pointer;
  text-align: center;
}

.battle-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.battle-card--attacking {
  animation: battle-card-pulse 0.4s ease-out;
}

.battle-card--log-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.battle-card--log-highlight-target {
  outline: 2px solid #e05252;
  outline-offset: 2px;
}

.battle-card--dead {
  opacity: 0.4;
  cursor: default;
}

.battle-card--acted {
  opacity: 0.55;
  cursor: default;
}

.battle-card__icon {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
}

.battle-card__icon--placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--accent-soft);
}

.battle-card__title {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card__stats {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.battle-card__skull {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.battle-deck-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.battle-card-back {
  display: block;
  width: 56px;
  height: 76px;
  border-radius: 6px;
  border: 1px solid var(--chrome-border);
  background: repeating-linear-gradient(135deg, var(--panel-strong), var(--panel-strong) 6px, var(--page-bg-accent) 6px, var(--page-bg-accent) 12px);
}

.battle-deck-pile__count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.battle-hand {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--chrome-border);
}

.battle-hand--opponent {
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0.5rem;
  border-top: none;
  border-bottom: 1px solid var(--chrome-border);
}

.battle-card--facedown {
  width: 80px;
  height: 108px;
  border-radius: 6px;
  border: 1px solid var(--chrome-border);
  background: repeating-linear-gradient(135deg, var(--panel-strong), var(--panel-strong) 6px, var(--page-bg-accent) 6px, var(--page-bg-accent) 12px);
  cursor: default;
}

.battle-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  background: var(--panel);
}

.battle-controls__ready--glow:not(:disabled) {
  box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.35), 0 0 16px 4px rgba(126, 217, 87, 0.55);
  animation: battle-ready-glow-pulse 1.6s ease-in-out infinite;
}

@keyframes battle-ready-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.35), 0 0 16px 4px rgba(126, 217, 87, 0.55);
  }

  50% {
    box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.55), 0 0 22px 8px rgba(126, 217, 87, 0.8);
  }
}

.battle-controls__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.battle-controls__timer {
  min-width: 2.6em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.battle-controls__timer:not(:empty)::before {
  content: "⏱ ";
}

.battle-log-section {
  margin-top: 1.5rem;
}

.battle-log {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
}

.battle-log__entry {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  background: var(--panel-strong);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.battle-log__side {
  font-weight: 700;
  margin-right: 0.25rem;
}

.battle-log__side--player {
  color: var(--accent);
}

.battle-log__side--opponent {
  color: #e05252;
}

.battle-log__player-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.battle-log__player-link:hover,
.battle-log__player-link:focus-visible {
  text-decoration: underline;
}

.battle-log__actor,
.battle-log__target {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.battle-log__icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: -3px;
  margin-right: 0.2rem;
}

.battle-log__damage {
  color: #e05252;
}

.battle-log__damage--heal {
  color: var(--success);
}

.battle-log__death {
  color: #e05252;
  font-weight: 700;
}

.battle-log__time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

@keyframes battle-card-pulse {
  0% {
    box-shadow: 0 0 0 2px rgba(224, 82, 82, 0.6);
  }

  100% {
    box-shadow: 0 0 0 2px rgba(224, 82, 82, 0);
  }
}

@keyframes battle-hp-flash {
  0% {
    color: #e05252;
  }

  100% {
    color: inherit;
  }
}

.battle-hp-flash {
  animation: battle-hp-flash 1.4s ease-out;
}

@keyframes battle-hp-bar-flash {
  0% {
    filter: brightness(1.8) saturate(2);
  }

  100% {
    filter: none;
  }
}

.battle-hp-bar-flash {
  animation: battle-hp-bar-flash 1.4s ease-out;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.cookie-banner__text {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.cookie-banner__text a {
  color: var(--accent);
}

.cookie-banner__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.6rem;
}

.cookie-banner__button {
  padding: 0.5rem 0.9rem;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.cookie-banner__button--decline {
  border: 1px solid var(--chrome-border);
  background: transparent;
  color: var(--text-muted);
}

.cookie-banner__button--decline:hover,
.cookie-banner__button--decline:focus-visible {
  color: var(--text);
  border-color: var(--text-muted);
}

.cookie-banner__button--accept {
  border: 1px solid rgba(102, 192, 244, 0.18);
  background: linear-gradient(180deg, rgba(57, 107, 136, 0.9), rgba(31, 66, 91, 0.95));
  color: #e8f6ff;
}

.cookie-banner__button--accept:hover,
.cookie-banner__button--accept:focus-visible {
  background: linear-gradient(180deg, rgba(69, 123, 154, 0.94), rgba(36, 77, 105, 0.98));
}
