@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=Playfair+Display:wght@600;700;800&family=Cormorant+Garamond:wght@600;700&family=Crimson+Text:wght@400;600&display=swap');

:root {
  --bg:         #efe9db;
  --surface:    #e5ddcc;
  --card:       #f7f3e9;
  --card-hover: #eee6d8;
  --border:     #c4b59d;
  --text:       #352f27;
  --muted:      #746c5e;
  --accent:     #5a4634;

  /* Nature-inspired rarity colors */
  --rare:       #7f9461;
  --epic:       #2f6f4f;
  --legendary:  #2e5f69;
  --mythic:     #8a6943;

  --gold:       #c9965a;
  --gummy:      #c7727d;
  --galaxy:     #5b4f71;
  --holofoil:   #678f8c;
  --cube:       #5c6173;
  --gem:        #4e8f6a;

  --paper-line:   rgba(92, 117, 159, 0.14);
  --paper-margin: rgba(179, 96, 86, 0.24);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] {
  display: none !important;
}

html {
  background-color: var(--bg) !important;
  background-image:
    linear-gradient(90deg,
      transparent 0,
      transparent 72px,
      var(--paper-margin) 72px,
      var(--paper-margin) 74px,
      transparent 74px),
    repeating-linear-gradient(180deg,
      transparent 0,
      transparent 35px,
      var(--paper-line) 35px,
      var(--paper-line) 36px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(98, 120, 84, 0.03) 2px, rgba(98, 120, 84, 0.03) 4px),
    url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' seed='7'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23efe9db' filter='url(%23noise)' opacity='0.065'/%3E%3C/svg%3E") !important;
  background-size: auto, auto, 180px 180px, 120px 120px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed;
}

body {
  background: transparent !important;
  color: var(--text);
  font-family: 'Merriweather', serif;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  padding-bottom: 60px;
  animation: paperDrift 42s linear infinite;
}

.app-frame {
  min-height: 100vh;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

body::before {
  content: '';
  position: fixed;
  inset: -20vh -20vw;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 22%, rgba(126, 153, 118, 0.14) 0%, transparent 70%),
    radial-gradient(42% 34% at 82% 72%, rgba(93, 117, 143, 0.12) 0%, transparent 72%),
    radial-gradient(38% 30% at 55% 45%, rgba(194, 150, 90, 0.08) 0%, transparent 72%);
  animation: ambientDrift 18s ease-in-out infinite alternate;
}

body > * {
  position: relative;
  z-index: 1;
}

@keyframes paperDrift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  50% { background-position: 0 0, 0 6px, 18px 14px, 8px 10px; }
  100% { background-position: 0 0, 0 0, 0 0, 0 0; }
}

@keyframes ambientDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 1.5%, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  body,
  body::before,
  .floating-leaf {
    animation: none !important;
  }
}

@media (max-width: 700px) {
  html {
    background-image:
      linear-gradient(90deg,
        transparent 0,
        transparent 34px,
        var(--paper-margin) 34px,
        var(--paper-margin) 36px,
        transparent 36px),
      repeating-linear-gradient(180deg,
        transparent 0,
        transparent 33px,
        var(--paper-line) 33px,
        var(--paper-line) 34px),
      repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(98, 120, 84, 0.03) 2px, rgba(98, 120, 84, 0.03) 4px),
      url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' seed='7'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23efe9db' filter='url(%23noise)' opacity='0.065'/%3E%3C/svg%3E") !important;
    background-attachment: scroll;
  }

  .floating-leaves {
    inset: 0 0 auto 0;
    height: 76px;
  }

  .floating-leaf {
    font-size: 1.9rem;
    opacity: 0.4;
  }

  .floating-leaf--1 { left: 4%; }
  .floating-leaf--2 { left: 20%; }
  .floating-leaf--3 { right: 18%; }
  .floating-leaf--4 { right: 4%; }
}

/* ── HEADER ─────────────────────────────── */
header {
  text-align: center;
  padding: 40px 16px 28px;
  position: relative;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, rgba(255,252,245,0.55) 0%, rgba(222,214,196,0.38) 100%);
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 0;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 30px;
  box-shadow: 0 18px 45px rgba(9, 14, 34, 0.28);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 12px;
  z-index: 50;
  transition: padding 0.28s ease, transform 0.28s ease, border-radius 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

body.is-scrolled header {
  padding: 16px 18px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 25, 57, 0.94) 0%, rgba(23, 31, 71, 0.88) 100%);
  box-shadow: 0 18px 40px rgba(5, 8, 19, 0.38);
}

body.is-scrolled .floating-leaves,
body.is-scrolled .header-glow,
body.is-scrolled .intro-text,
body.is-scrolled .byline,
body.is-scrolled .release-notes {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

body.is-scrolled .title-brand {
  margin-bottom: 4px;
}

body.is-scrolled .fortnite-logo {
  width: min(170px, 34vw);
}

body.is-scrolled header h1 {
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  margin-bottom: 3px;
}

body.is-scrolled .subtitle {
  font-size: 0.9rem;
  margin-top: 0;
}

body.is-scrolled .progress-wrap {
  margin-top: 12px;
  padding: 10px 14px;
}

.header-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(88, 126, 92, 0.13) 0%, transparent 70%);
  pointer-events: none;
}

.floating-leaves {
  position: absolute;
  inset: 10px 0 auto 0;
  height: 70px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-leaf {
  position: absolute;
  top: 0;
  display: block;
  font-size: 2.2rem;
  opacity: 0.52;
  filter: drop-shadow(0 1px 1px rgba(76, 99, 62, 0.15));
  animation: leafFloat 10s ease-in-out infinite;
  transform-origin: center;
}

.floating-leaf--1 {
  left: 8%;
  font-size: 2.35rem;
  animation-duration: 11s;
  animation-delay: -2s;
}

.floating-leaf--2 {
  left: 24%;
  font-size: 1.85rem;
  animation-duration: 13s;
  animation-delay: -6s;
}

.floating-leaf--3 {
  right: 22%;
  font-size: 2rem;
  animation-duration: 12s;
  animation-delay: -4s;
}

.floating-leaf--4 {
  right: 7%;
  font-size: 1.7rem;
  animation-duration: 14s;
  animation-delay: -8s;
}

@keyframes leafFloat {
  0% {
    transform: translate3d(0, -6px, 0) rotate(-10deg);
  }
  25% {
    transform: translate3d(10px, 4px, 0) rotate(8deg);
  }
  50% {
    transform: translate3d(-6px, 12px, 0) rotate(-4deg);
  }
  75% {
    transform: translate3d(8px, 4px, 0) rotate(10deg);
  }
  100% {
    transform: translate3d(0, -6px, 0) rotate(-10deg);
  }
}

.title-wrap {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.title-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.fortnite-logo {
  width: min(360px, 76vw);
  height: auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.14));
}

.header-sprite-mark {
  width: min(120px, 24vw);
  max-height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22)) !important;
}

header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: var(--accent);
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  line-height: 1.1;
  margin-bottom: 8px;
}

.subtitle {
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
  font-style: italic;
  letter-spacing: 1px;
  color: var(--rare);
  margin-top: 6px;
}

.intro-text {
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.9;
  margin-top: 10px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.byline {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  font-family: 'Merriweather', serif;
}

.version-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--muted);
  opacity: 0.75;
  margin-top: 4px;
  font-family: 'Merriweather', serif;
}

.release-notes-trigger {
  display: none;
  margin: 8px auto 0;
  min-height: 34px;
  padding: 7px 12px;
  border: 1.5px solid rgba(78, 86, 171, 0.45);
  border-radius: 999px;
  background: rgba(233, 236, 255, 0.1);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.release-notes {
  display: block;
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: var(--accent);
  opacity: 0.88;
  letter-spacing: 0.2px;
  line-height: 1.45;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.header-progress-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 641px) {
  header {
    position: relative;
    top: auto;
  }

  .header-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
  }

  .header-progress-grid .progress-wrap,
  .header-progress-grid .mastery-progress-wrap {
    width: 100%;
    max-width: none;
    margin: 20px 0 0;
  }

  .header-progress-grid .mastery-progress-wrap {
    margin-top: 20px;
  }
}

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 0;
  display: grid;
  gap: 18px;
}

.shell-panel {
  position: relative;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 27, 61, 0.92) 0%, rgba(15, 22, 50, 0.86) 100%);
  box-shadow: 0 18px 40px rgba(7, 10, 23, 0.24);
  backdrop-filter: blur(14px);
  overflow: clip;
}

.shell-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 28%, transparent 100%);
  pointer-events: none;
}

.shell-panel-toolbar {
  padding: 22px;
}

.shell-panel-content {
  padding: 20px 0 14px;
}

.shell-panel-data {
  padding: 22px;
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.panel-heading-inline {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 380px);
  align-items: end;
  gap: 16px;
}

.panel-eyebrow {
  font-family: 'Crimson Text', serif;
  font-size: 0.76rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--rare);
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: 0.5px;
  color: var(--text);
  line-height: 1.05;
}

.panel-copy {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(233, 236, 255, 0.78);
  max-width: 640px;
}

/* ── PROGRESS ─────────────────────────────── */
.progress-wrap {
  max-width: 540px;
  margin: 20px auto 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.progress-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  pointer-events: none;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label span:first-child {
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--accent);
}

.progress-count {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--legendary);
  letter-spacing: 1px;
}

.progress-track {
  height: 8px;
  background: #d9cfbc;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d6548 0%, #83965f 100%);
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(.4,0,.2,1);
}

.mastery-progress-wrap {
  margin-top: 14px;
}

.install-app-slot {
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto 0;
  display: flex;
  justify-content: center;
}

.btn.install-app-btn-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0;
}

@media (max-width: 900px) {
  .install-app-slot {
    width: min(100% - 16px, 100%);
    margin: 12px auto;
  }

  .install-app-slot + .app-shell {
    margin-top: 0;
  }
}

.install-app-btn-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  flex-shrink: 0;
}

.mastery-fill {
  background: linear-gradient(90deg, var(--gold) 0%, #7f9461 100%);
}

/* ── CONTROLS ─────────────────────────────── */
.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(200px, 280px) repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

.save-status {
  grid-column: 1 / -1;
  text-align: left;
  font-family: 'Merriweather', serif;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.2px;
  margin-top: 4px;
}

.install-tip {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: rgba(247, 243, 233, 0.08);
  color: var(--accent);
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  letter-spacing: 0.2px;
  line-height: 1.35;
  padding: 10px 12px;
  text-align: center;
}

.collector-name-field {
  flex: 0 0 clamp(210px, 24vw, 280px);
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  line-height: 1.2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.variant-filter-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 164px;
}

.variant-filter-label {
  font-family: 'Crimson Text', serif;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 6px;
}

.variant-filter-select {
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Merriweather', serif;
  font-size: 0.94rem;
  line-height: 1.2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  cursor: pointer;
}

.variant-filter-select:focus {
  outline: none;
  border-color: var(--rare);
  box-shadow: 0 0 0 3px rgba(139,157,109,0.12);
}

@media (max-width: 700px) {
  .app-frame {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  header,
  .app-shell {
    width: min(100% - 16px, 100%);
  }

  header {
    top: 8px;
    margin-top: 8px;
    border-radius: 24px;
    padding: 20px 12px 16px;
  }

  body.is-scrolled header {
    padding: 12px 10px 10px;
    transform: translateY(-2px);
  }

  .title-brand {
    margin-bottom: 6px;
  }

  .fortnite-logo {
    width: min(132px, 40vw);
  }

  header h1 {
    font-size: 1.72rem;
    margin-bottom: 4px;
  }

  .subtitle {
    font-size: 0.88rem;
    letter-spacing: 0.7px;
  }

  .intro-text {
    display: none;
  }

  .byline {
    display: none;
  }

  .version-label {
    font-size: 0.64rem;
    margin-top: 4px;
  }

  .release-notes-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 8px;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 0.82rem;
    letter-spacing: 0.65px;
  }

  .release-notes {
    display: none;
  }

  .header-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .progress-wrap,
  .mastery-progress-wrap {
    max-width: none;
    margin-top: 8px;
    padding: 8px 10px;
  }

  .mastery-progress-wrap {
    margin-top: 8px;
  }

  .progress-label {
    margin-bottom: 6px;
    align-items: flex-start;
    gap: 4px;
  }

  .progress-label span:first-child {
    font-size: 0.68rem;
    letter-spacing: 0.55px;
  }

  .progress-count {
    font-size: 0.92rem;
    letter-spacing: 0.25px;
  }

  .shell-panel-toolbar,
  .shell-panel-data {
    padding: 16px;
  }

  .shell-panel-content {
    padding-top: 12px;
  }

  .panel-heading-inline {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .collector-name-field,
  .btn {
    width: 100%;
    max-width: 100%;
  }

  .collector-name-field {
    flex-basis: auto;
    width: 100%;
    margin-inline: auto;
  }

  .controls .variant-filter-wrap {
    width: min(100%, 340px);
    margin-inline: auto;
  }

  .save-status,
  .install-tip {
    width: 100%;
    margin-inline: auto;
  }

  .install-tip {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 0.95rem;
  }
}

.collector-name-field:focus {
  outline: none;
  border-color: var(--rare);
  box-shadow: 0 0 0 3px rgba(139,157,109,0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--accent);
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 100%);
}

.btn:hover {
  border-color: var(--rare);
  color: var(--rare);
  background: #ece4d5;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn.danger {
  border-color: #a85447;
  color: #a85447;
}

.btn.danger:hover {
  border-color: #8b4439;
  color: #8b4439;
  background: #fae8e6;
}

.mobile-app-bar {
  display: none;
}

.mobile-more-sheet[hidden] {
  display: none;
}

.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  align-items: end;
}

.mobile-more-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 14, 28, 0.46);
  backdrop-filter: blur(3px);
}

.mobile-more-sheet__panel {
  position: relative;
  z-index: 1;
  border-radius: 18px 18px 0 0;
  border: 1.5px solid rgba(103, 154, 239, 0.52);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(16, 30, 66, 0.98) 0%, rgba(8, 18, 42, 0.98) 100%);
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 28px rgba(3, 6, 15, 0.45);
}

.mobile-more-sheet__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 10px;
}

.mobile-more-sheet__actions {
  display: grid;
  gap: 8px;
}

.mobile-more-sheet__btn {
  width: 100%;
  min-height: 46px;
}

body.mobile-more-open {
  overflow: hidden;
}

.back-to-top {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: rgba(247, 243, 233, 0.96);
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.24s ease, transform 0.24s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.back-to-top-sprite {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  filter: brightness(0) saturate(100%) opacity(0.86);
  transform: translateY(1px);
}

.back-to-top-arrow {
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  transform: translateY(-1px);
}

.back-to-top:hover {
  background: #ece4d5;
  color: var(--rare);
  border-color: var(--rare);
}

.back-to-top:focus-visible {
  outline: none;
  border-color: var(--rare);
  box-shadow: 0 0 0 3px rgba(139, 157, 109, 0.18), 0 10px 20px rgba(0, 0, 0, 0.16);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 700px) {
  .app-frame {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-app-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(105, 154, 238, 0.36);
    background: linear-gradient(180deg, rgba(11, 21, 53, 0.98) 0%, rgba(8, 15, 38, 0.99) 100%);
    backdrop-filter: blur(14px) saturate(1.05);
  }

  .mobile-app-bar__btn {
    -webkit-tap-highlight-color: transparent;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: rgba(218, 234, 255, 0.8);
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
    transition: color 0.18s ease, transform 0.16s ease;
  }

  .mobile-app-bar__btn::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    width: 34px;
    height: 26px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: rgba(109, 177, 255, 0.24);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
  }

  .mobile-app-bar__btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(166, 211, 255, 0.16);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
  }

  .mobile-app-bar__icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
    transition: transform 0.18s ease;
  }

  .mobile-app-bar__icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
  }

  .mobile-app-bar__label {
    font-size: 0.7rem;
    line-height: 1;
    opacity: 0.94;
    z-index: 1;
  }

  .mobile-app-bar__btn.is-active {
    color: #f3f9ff;
  }

  .mobile-app-bar__btn.is-active::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  .mobile-app-bar__btn.is-active .mobile-app-bar__icon {
    transform: translateY(-0.5px) scale(1.04);
  }

  .mobile-app-bar__btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(151, 203, 255, 0.62);
  }

  .mobile-app-bar__btn:active::after {
    opacity: 1;
    transform: scale(1);
  }

  .mobile-app-bar__btn:active {
    transform: translateY(1px);
  }

  .back-to-top {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    gap: 0;
  }

  .back-to-top-sprite {
    width: 18px;
    height: 18px;
  }

  .back-to-top-arrow {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

.sprite-jump-section {
  margin-bottom: 22px;
  padding: 20px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(28, 37, 80, 0.76) 0%, rgba(19, 27, 58, 0.74) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 30px rgba(6, 10, 22, 0.18);
}

.sprite-jump-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

.sprite-jump-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sprite-jump-filter-wrap {
  min-width: 220px;
  align-items: flex-end;
}

.sprite-jump-filter-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sprite-jump-filter-wrap .variant-filter-label {
  margin-left: 0;
}

.sprite-jump-filter-wrap .variant-filter-select {
  min-height: 38px;
  padding: 8px 12px;
}

.missing-only-toggle-row {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Merriweather', serif;
  font-size: 0.82rem;
  color: var(--accent);
  user-select: none;
}

.missing-only-toggle-input {
  width: 16px;
  height: 16px;
  accent-color: var(--rare);
  cursor: pointer;
}

.missing-only-toggle-text {
  line-height: 1.1;
}

.sprite-jump-clear-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.86rem;
  letter-spacing: 0.6px;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(229, 221, 204, 0.88);
}

.sprite-jump-clear-btn:disabled {
  opacity: 0.55;
  cursor: default;
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.sprite-jump-clear-btn:disabled:hover {
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.sprite-jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sprite-jump-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: rgba(247, 243, 233, 0.9);
  color: var(--accent);
  text-decoration: none;
  font-family: 'Crimson Text', serif;
  font-size: 0.92rem;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.sprite-jump-name {
  line-height: 1;
}

.sprite-jump-count {
  font-family: 'Merriweather', serif;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.1px;
  opacity: 0.86;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(88, 70, 52, 0.2);
}

.sprite-jump-link[data-collection="none"] {
  background: rgba(247, 243, 233, 0.95);
  border-color: var(--border);
  color: var(--accent);
}

.sprite-jump-link[data-collection="some"] {
  background: #f6ead8;
  border-color: #d5b78a;
  color: #6a5132;
}

.sprite-jump-link[data-collection="all"] {
  background: #dfeddc;
  border-color: #9db996;
  color: #325236;
}

.sprite-jump-link:hover {
  border-color: var(--rare);
  color: var(--rare);
  background: rgba(229, 221, 204, 0.85);
  transform: translateY(-1px);
}

.sprite-jump-link[data-collection="some"]:hover {
  border-color: #c79e67;
  color: #5b4327;
  background: #f1dfc4;
}

.sprite-jump-link[data-collection="all"]:hover {
  border-color: #86a880;
  color: #274a2d;
  background: #d3e5d0;
}

.sprite-card {
  scroll-margin-top: 16px;
}

.bottom-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding-top: 0;
  border-top: none;
}

.bottom-controls .btn {
  white-space: normal;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .sprite-jump-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sprite-jump-filter-wrap {
    min-width: 0;
    width: 100%;
    align-items: stretch;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.74) 0%, rgba(229, 221, 204, 0.5) 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }

  .missing-only-toggle-row {
    margin-top: 10px;
  }

  .sprite-jump-filter-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .sprite-jump-filter-wrap .variant-filter-select,
  .sprite-jump-clear-btn {
    width: 100%;
  }

  .sprite-jump-filter-wrap .variant-filter-select {
    min-height: 42px;
  }

  .sprite-jump-clear-btn {
    min-height: 42px;
    padding-inline: 14px;
  }

  .bottom-controls {
    grid-template-columns: 1fr;
    margin-inline: 0;
  }

  .bottom-controls .btn {
    width: 100%;
    max-width: 100%;
  }

  .sprite-jump-link {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .mobile-app-bar {
    gap: 4px;
    padding-inline: 8px;
  }

  .mobile-app-bar__btn {
    min-height: 52px;
  }

  .mobile-app-bar__icon,
  .mobile-app-bar__icon svg {
    width: 20px;
    height: 20px;
  }

  .mobile-app-bar__label {
    font-size: 0.64rem;
  }

  .header-progress-grid {
    grid-template-columns: 1fr;
  }

  .sprite-jump-filter-row {
    grid-template-columns: 1fr;
  }
}

/* ── RARITY SECTIONS ─────────────────────── */
.rarity-section {
  max-width: 1140px;
  margin: 0 auto 22px;
  padding: 20px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(23, 31, 71, 0.82) 0%, rgba(16, 23, 52, 0.82) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 34px rgba(4, 8, 22, 0.2);
}

.rarity-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: capitalize;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.rarity-title::after {
  content: '';
  flex: 1;
  height: 0;
}

.rarity-title.rare        { color: var(--rare); border-color: var(--rare); }
.rarity-title.epic        { color: var(--epic); border-color: var(--epic); }
.rarity-title.legendary   { color: var(--legendary); border-color: var(--legendary); }
.rarity-title.mythic      { color: var(--mythic); border-color: var(--mythic); }

/* ── CARDS ─────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.sprite-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0,0,0,0.16);
}

.sprite-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.3s;
}

.sprite-card.rare::before       { background: var(--rare); }
.sprite-card.epic::before       { background: var(--epic); }
.sprite-card.legendary::before  { background: var(--legendary); }
.sprite-card.mythic::before     { background: var(--mythic); }

.sprite-card:hover {
  background: var(--card-hover);
  box-shadow: 0 18px 32px rgba(0,0,0,0.2);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.sprite-card.fully-collected {
  border-color: var(--gem);
  background-color: #edf4ea;
  background-image: linear-gradient(135deg, rgba(78,143,106,0.16) 0%, rgba(78,143,106,0.09) 100%);
  box-shadow: 0 6px 12px rgba(95,165,128,0.15);
}

.sprite-card.fully-collected::before { opacity: 1; }

/* Icon */
.sprite-icon-wrap {
  width: 70px;
  height: 70px;
  border-radius: 2px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.sprite-icon-wrap.rare        { background: rgba(139,157,109,0.1); border-color: var(--rare); }
.sprite-icon-wrap.epic        { background: rgba(61,122,92,0.1); border-color: var(--epic); }
.sprite-icon-wrap.legendary   { background: rgba(30,90,107,0.1); border-color: var(--legendary); }
.sprite-icon-wrap.mythic      { background: rgba(139,111,71,0.1); border-color: var(--mythic); }

.icon-collected-badge {
  display: none;
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: var(--gem);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: white;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--card);
}

.sprite-card.fully-collected .icon-collected-badge { display: flex; }

/* Card header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sprite-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
}

.rarity-badge {
  font-family: 'Merriweather', serif;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1.5px solid;
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 600;
}

.rarity-badge.rare        { color: var(--rare); border-color: var(--rare); background: rgba(139,157,109,0.1); }
.rarity-badge.epic        { color: var(--epic); border-color: var(--epic); background: rgba(61,122,92,0.1); }
.rarity-badge.legendary   { color: var(--legendary); border-color: var(--legendary); background: rgba(30,90,107,0.1); }
.rarity-badge.mythic      { color: var(--mythic); border-color: var(--mythic); background: rgba(139,111,71,0.1); }

.effect-text {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.6;
  font-family: 'Merriweather', serif;
}

/* Divider */
.variants-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 10px;
  opacity: 0.5;
}

/* Variants */
.variants-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.variant-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  padding: 5px 6px;
  border-radius: 2px;
  transition: background 0.15s;
  flex-wrap: wrap;
}

.variant-row:hover { background: rgba(107,154,109,0.08); }

.variant-row[data-mastered="true"] {
  background: rgba(212,165,116,0.08);
}

.variant-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  position: relative;
}

.variant-row input[type="checkbox"]:checked { border-color: transparent; }

.variant-row input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.variant-row[data-variant="Base"]     input:checked { background: #9ba882; }
.variant-row[data-variant="Gold"]     input:checked { background: var(--gold); }
.variant-row[data-variant="Gummy"]    input:checked { background: var(--gummy); }
.variant-row[data-variant="Galaxy"]   input:checked { background: var(--galaxy); }
.variant-row[data-variant="Holofoil"] input:checked { background: var(--holofoil); }
.variant-row[data-variant="Cube"]     input:checked { background: var(--cube); }
.variant-row[data-variant="Gem"]      input:checked { background: var(--gem); }
.variant-row[data-variant="collected"] input:checked { background: #5fa580; }

.variant-mastered-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 10px;
  color: var(--gold);
}

.variant-mastered-control[hidden] {
  display: none;
}

.variant-mastered-control input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: transparent;
}

.variant-mastered-control input[type="checkbox"]:checked::after {
  content: '✓';
}

.variant-mastered-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.variant-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pip-base     { background: #9ba882; }
.pip-gold     { background: var(--gold); }
.pip-gummy    { background: var(--gummy); }
.pip-galaxy   { background: var(--galaxy); }
.pip-holofoil { background: var(--holofoil); }
.pip-cube     { background: var(--cube); }
.pip-gem      { background: var(--gem); }

.variant-label {
  font-size: 0.8rem;
  font-weight: 500;
  flex: 1;
  color: var(--text);
  font-family: 'Merriweather', serif;
}

.sprite-card.mastered {
  border-color: var(--gold);
  box-shadow: 0 6px 12px rgba(212,165,116,0.16);
}

.variant-effect {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: 'Merriweather', serif;
}

.variant-art-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.variant-art-tile {
  position: relative;
  background: rgba(255,255,255,0.55);
  border: 1.5px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 110px;
}

.variant-art-image,
.variant-art-pending {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.variant-art-image {
  object-fit: contain;
  padding: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(235,230,224,0.45) 100%);
}

.variant-art-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  font-style: italic;
  background: repeating-linear-gradient(135deg, rgba(212,200,186,0.45), rgba(212,200,186,0.45) 8px, rgba(255,255,255,0.4) 8px, rgba(255,255,255,0.4) 16px);
}

.variant-art-tile[data-state="locked"] .variant-art-image {
  filter: grayscale(1) brightness(0.75);
  opacity: 0.72;
}

.variant-art-tile[data-state="locked"]::after,
.variant-art-tile[data-state="pending"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(61, 58, 53, 0.22);
  pointer-events: none;
}

.variant-art-tile[data-state="unlocked"] {
  border-color: var(--rare);
  box-shadow: 0 6px 12px rgba(61,122,92,0.12);
  transform: translateY(-1px);
}

.variant-art-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(250,248,245,0.95);
  border-top: 1px solid rgba(212,200,186,0.75);
}

.variant-art-label {
  font-size: 0.68rem;
  letter-spacing: 0.4px;
}

.variant-art-label {
  color: var(--accent);
  font-weight: 600;
}

.collected-modal[hidden] {
  display: none;
}

.collected-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.collected-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 32, 26, 0.6);
  backdrop-filter: blur(3px);
}

.collected-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  background: var(--card);
  border: 2px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  padding: 26px;
  z-index: 1;
}

.collected-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.collected-modal__eyebrow {
  font-family: 'Crimson Text', serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--rare);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.collected-modal__title {
  font-family: 'Playfair Display', serif;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.collected-modal__text {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.collected-modal__art {
  background: rgba(255,255,255,0.52);
  border: 1.5px solid var(--border);
  padding: 14px;
  margin-bottom: 18px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collected-modal__art img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.collected-modal__placeholder {
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.collected-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.release-notes-modal[hidden] {
  display: none;
}

.release-notes-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.release-notes-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 32, 26, 0.62);
  backdrop-filter: blur(3px);
}

.release-notes-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  background: var(--card);
  border: 2px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  padding: 26px;
  z-index: 1;
}

.release-notes-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.release-notes-modal__eyebrow {
  font-family: 'Crimson Text', serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--rare);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.release-notes-modal__title {
  font-family: 'Playfair Display', serif;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.release-notes-modal__text {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.release-notes-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.modal-open {
  overflow: hidden;
}

/* Footer */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding-top: 16px;
  letter-spacing: 1px;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 18px;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-left: 10px;
}

.footer-links a,
.text-link {
  color: var(--rare);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.info-shell {
  width: min(980px, calc(100% - 24px));
  margin: 18px auto 40px;
  display: grid;
  gap: 18px;
}

.info-hero,
.info-panel {
  position: relative;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 27, 61, 0.92) 0%, rgba(15, 22, 50, 0.86) 100%);
  box-shadow: 0 18px 40px rgba(7, 10, 23, 0.24);
  backdrop-filter: blur(14px);
  overflow: clip;
}

.info-hero {
  padding: 24px;
}

.info-panel {
  padding: 22px;
}

.info-hero::before,
.info-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 28%, transparent 100%);
  pointer-events: none;
}

.info-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.info-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--text);
}

.info-copy,
.info-panel p,
.info-panel li {
  position: relative;
  z-index: 1;
  color: rgba(233, 236, 255, 0.88);
  line-height: 1.7;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.info-list {
  position: relative;
  z-index: 1;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.info-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.info-kicker {
  font-family: 'Crimson Text', serif;
  font-size: 0.78rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--rare);
}

@media (max-width: 700px) {
  .footer-links {
    display: flex;
    margin-top: 8px;
    margin-left: 0;
  }

  .info-shell {
    width: min(100% - 16px, 100%);
    margin-top: 12px;
  }

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

  .info-hero,
  .info-panel {
    border-radius: 24px;
    padding: 18px;
  }

  .info-title {
    font-size: 2rem;
  }
}

/* ── RESPONSIVE ────────────────────────── */
@media (max-width: 640px) {
  .fortnite-logo {
    width: min(170px, 56vw);
  }

  header h1 {
    font-size: 2rem;
    letter-spacing: 1px;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .rarity-title {
    font-size: 1.2rem;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

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

  .collected-modal__dialog {
    padding: 22px 18px;
  }

  .collected-modal__title {
    font-size: 1.55rem;
  }

  .release-notes-modal__dialog {
    padding: 22px 18px;
  }

  .release-notes-modal__title {
    font-size: 1.55rem;
  }
}

/* Cube Variant Theme Overrides */
:root {
  --bg:         #060a1f;
  --surface:    #13213f;
  --card:       #17284b;
  --card-hover: #1d3360;
  --border:     #4f79bf;
  --text:       #e8f2ff;
  --muted:      #9db4d3;
  --accent:     #b8dcff;

  --rare:       #7ecfff;
  --epic:       #5da8ff;
  --legendary:  #6f8fff;
  --mythic:     #79c6ff;

  --gold:       #f5c46f;
  --gummy:      #ff8fb0;
  --galaxy:     #719dff;
  --holofoil:   #8fdaf8;
  --cube:       #6db4ff;

  --paper-line:   rgba(120, 162, 230, 0.12);
  --paper-margin: rgba(98, 179, 255, 0.16);
}

html {
  background-color: var(--bg) !important;
  background-image:
    radial-gradient(44% 36% at 20% 18%, rgba(90, 161, 255, 0.25) 0%, transparent 70%),
    radial-gradient(48% 38% at 82% 72%, rgba(64, 127, 235, 0.24) 0%, transparent 72%),
    radial-gradient(34% 28% at 52% 40%, rgba(159, 222, 255, 0.14) 0%, transparent 74%),
    linear-gradient(180deg, #060a1f 0%, #0a0f29 42%, #0f1638 100%) !important;
  background-size: cover;
  background-attachment: fixed;
}

body {
  animation: none;
}

body::before {
  background:
    radial-gradient(45% 36% at 50% -8%, rgba(114, 188, 255, 0.3) 0%, transparent 70%),
    radial-gradient(36% 34% at 15% 78%, rgba(90, 145, 255, 0.2) 0%, transparent 75%),
    radial-gradient(40% 34% at 86% 25%, rgba(116, 169, 255, 0.2) 0%, transparent 74%);
  animation: ambientDrift 16s ease-in-out infinite alternate;
}

header {
  border-bottom: 2px solid rgba(105, 170, 255, 0.45);
  background:
    linear-gradient(140deg, rgba(17, 30, 67, 0.86) 0%, rgba(19, 43, 88, 0.76) 60%, rgba(38, 82, 148, 0.7) 100%),
    url("inspiration/peely-battle-bus.jpeg");
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 42px rgba(5, 7, 22, 0.44);
}

body.is-scrolled header {
  background: linear-gradient(180deg, rgba(15, 33, 74, 0.94) 0%, rgba(18, 46, 96, 0.88) 100%);
  box-shadow: 0 18px 40px rgba(5, 8, 19, 0.38);
}

.header-glow {
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(119, 200, 255, 0.26) 0%, transparent 72%);
}

.fortnite-logo {
  filter: drop-shadow(0 4px 18px rgba(123, 189, 255, 0.5));
}

header h1 {
  color: #e8f6ff;
  text-shadow: 0 0 12px rgba(110, 188, 255, 0.42);
}

.subtitle {
  color: #b7dcff;
}

.shell-panel {
  background: linear-gradient(180deg, rgba(20, 27, 61, 0.92) 0%, rgba(15, 22, 50, 0.86) 100%);
  box-shadow: 0 18px 40px rgba(7, 10, 23, 0.24);
}

.panel-copy {
  color: rgba(233, 236, 255, 0.78);
}

.release-notes-trigger {
  border-color: rgba(78, 86, 171, 0.45);
  background: rgba(233, 236, 255, 0.1);
  color: var(--text);
}

.progress-wrap,
.rarity-section,
.sprite-card,
.controls .btn,
.collector-name-field,
.bottom-controls .btn,
.collected-modal__dialog {
  background: rgba(18, 31, 68, 0.86);
  border-color: rgba(104, 154, 237, 0.62);
  box-shadow: 0 10px 26px rgba(5, 7, 20, 0.35);
}

.progress-wrap::before,
.rarity-section::before,
.sprite-card::before {
  background: linear-gradient(180deg, rgba(210, 238, 255, 0.16) 0%, transparent 100%);
}

.sprite-card:hover {
  background: rgba(22, 42, 92, 0.94);
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(9, 12, 34, 0.42);
}

.sprite-card.fully-collected {
  border-color: rgba(120, 191, 255, 0.9);
  background-color: rgba(32, 52, 106, 0.95);
  background-image: linear-gradient(135deg, rgba(99, 176, 255, 0.3) 0%, rgba(76, 134, 240, 0.22) 100%);
  box-shadow: 0 10px 24px rgba(20, 12, 48, 0.45);
}

.sprite-card.fully-collected .sprite-name,
.sprite-card.fully-collected .effect-text,
.sprite-card.fully-collected .variant-label,
.sprite-card.fully-collected .variant-effect {
  color: #f3efff;
}

.sprite-card.fully-collected .variant-effect {
  opacity: 0.88;
}

.sprite-card.fully-collected .icon-collected-badge {
  border-color: rgba(32, 24, 68, 0.95);
}

.sprite-jump-link,
.sprite-jump-link[data-collection="none"],
.sprite-jump-link[data-collection="some"],
.sprite-jump-link[data-collection="all"] {
  color: #f3edff;
  border-color: rgba(108, 152, 236, 0.85);
  background: rgba(26, 41, 92, 0.78);
}

.sprite-jump-count {
  color: #eef2ff;
  background: rgba(77, 129, 208, 0.48);
  border-color: rgba(165, 210, 255, 0.5);
}

.sprite-jump-link:hover,
.sprite-jump-link[data-collection="none"]:hover,
.sprite-jump-link[data-collection="some"]:hover,
.sprite-jump-link[data-collection="all"]:hover {
  color: #ffffff;
  border-color: rgba(165, 215, 255, 0.95);
  background: rgba(62, 109, 196, 0.88);
}

.variant-row:hover {
  background: rgba(111, 169, 255, 0.18);
}

.variant-row[data-mastered="true"] {
  background: rgba(245, 191, 101, 0.16);
}

.variant-art-meta,
.collected-modal__art {
  background: rgba(10, 19, 46, 0.74);
  border-color: rgba(106, 151, 224, 0.62);
}

.variant-art-tile[data-state="unlocked"] {
  border-color: rgba(120, 185, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(120, 185, 255, 0.4), 0 10px 18px rgba(13, 27, 64, 0.4);
}

.progress-track {
  background: rgba(10, 14, 37, 0.8);
  border-color: rgba(102, 142, 208, 0.66);
}

.progress-fill {
  background: linear-gradient(90deg, #4f8fff 0%, #79d1ff 100%);
}

.mastery-fill {
  background: linear-gradient(90deg, #f5bf65 0%, #68b9ff 100%);
}

.btn {
  background: linear-gradient(135deg, rgba(77, 127, 224, 0.9) 0%, rgba(79, 171, 255, 0.9) 100%);
  color: #f8f6ff;
  border-color: rgba(149, 193, 255, 0.54);
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

@media (max-width: 700px) {
  header {
    background-position: 54% center;
  }
}

@media (max-width: 640px) {
  header {
    width: calc(100% - 16px);
    margin-top: 8px;
    padding: 20px 12px 16px;
    will-change: transform, padding, border-radius;
  }

  body.is-scrolled header {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    width: 100vw;
    top: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 6px;
    border: 0;
    border-bottom: 1px solid rgba(108, 152, 236, 0.34);
    border-radius: 0;
    background: rgba(10, 22, 50, 0.96);
    box-shadow: none;
    backdrop-filter: blur(10px);
    transform: translateZ(0);
  }

  header h1,
  .subtitle,
  .version-label,
  .release-notes-trigger {
    transition: opacity 0.18s ease, transform 0.22s ease, max-height 0.22s ease, margin 0.22s ease;
    transform-origin: top center;
  }

  body.is-scrolled header h1,
  body.is-scrolled .subtitle,
  body.is-scrolled .version-label,
  body.is-scrolled .release-notes-trigger {
    opacity: 0;
    width: 0;
    min-width: 0;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    transform: translateY(-6px);
    pointer-events: none;
    overflow: hidden;
  }

  .fortnite-logo {
    width: min(132px, 40vw);
  }

  .title-wrap {
    display: block;
  }

  body.is-scrolled .title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 52px;
    min-width: 52px;
    grid-row: 1 / -1;
    align-self: center;
    height: 100%;
  }

  body.is-scrolled .fortnite-logo {
    width: 100%;
    max-width: 40px;
    height: auto;
    object-fit: contain;
  }

  header h1 {
    font-size: 1.72rem;
    margin-bottom: 4px;
    letter-spacing: 0.8px;
  }

  .subtitle {
    font-size: 0.88rem;
    letter-spacing: 0.7px;
  }

  body.is-scrolled header .title-brand {
    display: flex !important;
    margin: 0;
    justify-content: center;
    width: 100%;
    align-items: center;
    height: 100%;
  }

  .byline,
  .release-notes,
  .intro-text {
    display: none !important;
  }

  .version-label {
    font-size: 0.64rem;
    margin-top: 4px;
  }

  .release-notes-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 8px;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 0.82rem;
    letter-spacing: 0.65px;
  }

  .header-progress-grid .progress-wrap,
  .header-progress-grid .mastery-progress-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .header-progress-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.is-scrolled .header-progress-grid {
    grid-template-columns: 1fr;
    gap: 3px;
    align-self: stretch;
  }

  .progress-wrap,
  .mastery-progress-wrap {
    margin-top: 0;
    padding: 10px 12px;
  }

  body.is-scrolled .progress-wrap,
  body.is-scrolled .mastery-progress-wrap {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.is-scrolled .mastery-progress-wrap {
    margin-top: 0;
  }

  .progress-label {
    margin-bottom: 7px;
    gap: 4px;
  }

  body.is-scrolled .progress-label {
    margin-bottom: 3px;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
  }

  body.is-scrolled .progress-track {
    height: 4px;
    border-width: 1px;
  }

  .progress-label span:first-child {
    font-size: 0.72rem;
    letter-spacing: 0.55px;
  }

  body.is-scrolled .progress-label span:first-child {
    font-size: 0.58rem;
    letter-spacing: 0.18px;
    white-space: nowrap;
    opacity: 0.82;
  }

  .progress-count {
    font-size: 1rem;
    letter-spacing: 0.25px;
  }

  body.is-scrolled .progress-count {
    font-size: 0.72rem;
    letter-spacing: 0.1px;
    opacity: 0.96;
  }

  .install-app-slot {
    width: calc(100% - 16px);
    margin: 12px auto;
  }
}


