/* Approved cosmic reward track; ownership remains server-backed. */
body:has(#pass:not([hidden])) {
  background:
    linear-gradient(#100b27c9, #0d0b20ed),
    url(assets/portal-resolute-v1.webp) center/cover fixed;
}
#pass:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#pass > .catalog-head {
  padding: 8px 14px;
}
#pass .compact-progress {
  padding: 8px 14px;
  border: 1px solid #bd91e34a;
  border-radius: 12px;
  background: linear-gradient(100deg, #37204b, #16162e);
  font-size: 12px;
}
#pass .legend {
  display: none;
}
#pass #track.cosmic-track {
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px 32px;
  scroll-padding: 18px;
  height: auto;
  min-height: 0;
  flex: 1;
  scroll-snap-type: none;
  background: none;
}
.cosmic-track .track-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  min-height: min(650px, 70dvh);
  flex-shrink: 0;
  padding: 20px 8px;
  position: relative;
  isolation: isolate;
}
.track-intro:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse, #9166e455, transparent 65%);
}
.track-intro > img {
  height: clamp(170px, 33dvh, 360px);
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px #bc78f944);
}
#pass .track-intro h2 {
  font:
    700 clamp(24px, 6vw, 38px)/1.1 Georgia,
    serif;
  color: #ffe6be;
  max-width: 400px;
  margin: 12px auto;
}
.track-intro small {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #edc690;
}
.track-intro p {
  font-size: 14px;
  color: #d7c2e8;
}
#track-start,
#bonus-open {
  background: linear-gradient(#ffe6a4, #e0a04a);
  color: #38213b;
  border: 1px solid #f8dba2;
  border-radius: 12px;
  box-shadow: 0 4px #775032;
  min-height: 48px;
  font-weight: 800;
  padding: 10px 20px;
}
.landscape-hint {
  display: none;
}
#track.cosmic-track .cosmic-tier {
  display: block;
  position: relative;
  flex: none;
  min-width: 0;
  width: 100%;
  max-width: 760px;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 12px 12px 14px 54px;
  border: 1px solid #a27ccb85;
  border-radius: 18px;
  background: linear-gradient(130deg, #3b2755cc, #1c172fe8);
  box-shadow:
    inset 0 2px #f7dfff18,
    0 7px 20px #03020a44;
  overflow: visible;
}
#track.cosmic-track .cosmic-tier:before {
  content: "";
  position: absolute;
  left: 26px;
  top: -27px;
  width: 3px;
  height: calc(100% + 27px);
  background: #70528f;
  z-index: 0;
}
#track.cosmic-track .cosmic-tier.level-reached:before {
  background: #5fe2ed;
  box-shadow: 0 0 9px #5fe2ed66;
}
#track.cosmic-track .cosmic-tier:last-of-type {
  border-color: #e8c27c;
}
#track.cosmic-track .level-dot {
  position: absolute;
  top: 42%;
  left: 4px;
  transform: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 44px;
  height: auto;
  min-height: 44px;
  gap: 4px;
  background: linear-gradient(#513269, #251b40);
  border: 2px solid #dfbd81;
  border-radius: 12px;
  box-shadow: 0 0 12px #eab76333;
  color: white;
  padding: 4px;
}
#track.cosmic-track .level-dot b {
  font-size: 22px;
  line-height: 1.2;
}
#track.cosmic-track .level-dot small {
  font-size: 8px;
  line-height: 1.2;
  color: #e7cba2;
}
.cosmic-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  position: relative;
  z-index: 1;
}
.cosmic-lane {
  min-width: 0;
}
.cosmic-lane h3 {
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: 0.14em;
  color: #f0d8ff;
  font-size: 12px;
}
#track.cosmic-track .reward-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 172px;
  min-width: 0;
  padding: 12px 7px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #af86df99;
  border-radius: 14px;
  background: linear-gradient(140deg, #4c3567b3, #211d39);
  box-shadow: inset 0 2px #ead8ff19;
}
#track.cosmic-track .reward-item.premium {
  background: linear-gradient(140deg, #713c8580, #35204e);
  border-color: #bb77e1;
}
#track.cosmic-track .reward-art {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  height: 100px;
  min-height: 0;
  margin: 0;
  display: block;
}
#track.cosmic-track .reward-art img,
#track.cosmic-track .reward-art svg {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
#track.cosmic-track .reward-plaque {
  position: relative;
  inset: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#track.cosmic-track .reward-plaque strong {
  font-size: 13px;
  line-height: 1.3;
  white-space: normal;
  color: #fff1de;
  overflow-wrap: anywhere;
}
#track.cosmic-track .reward-type,
#track.cosmic-track .reward-plaque > small {
  display: none;
}
#track.cosmic-track .reward-status {
  display: block;
  position: static;
  margin: 3px 0 0;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.3;
  background: none;
  border: 0;
  white-space: normal;
  color: #e7d3fc;
}
#track.cosmic-track .reward-status-received {
  color: #9cf4bd;
}
#track.cosmic-track .plus-reward {
  position: relative;
  inset: auto;
  transform: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  height: auto;
  margin-top: 12px;
  padding: 8px 0 0;
  border-top: 1px solid #ae87d54a;
}
#track.cosmic-track .plus-reward > b {
  font-size: 10px;
  color: #e8c88a;
}
#track.cosmic-track .plus-reward button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  max-width: 100%;
  min-height: 44px;
  font-size: 12px;
  background: #282039;
  border: 1px solid #a486bd66;
  border-radius: 10px;
}
.cosmic-plus-art {
  display: block !important;
  flex: 0 0 44px;
  width: 44px !important;
  height: 54px !important;
  position: relative !important;
}
.cosmic-plus-art svg {
  width: 100%;
  height: 100%;
}
.bonus-chest {
  position: relative;
  display: grid;
  grid-template-columns: minmax(90px, 35%) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  flex: none;
  padding: 24px 16px;
  border: 2px solid #dfb879;
  border-radius: 22px;
  background: radial-gradient(ellipse at 20% 25%, #8455bb55, transparent 65%), #19142de8;
  box-shadow:
    inset 0 2px #fce6ff33,
    0 0 20px #a46cdb22;
}
.bonus-chest > img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 14px #a96cfa66);
}
#pass .bonus-chest h2 {
  font-size: 22px;
  margin: 0 25px 10px 0;
  line-height: 1.1;
}
.bonus-chest p {
  font-size: 13px;
  line-height: 1.4;
  color: #decaed;
}
.bonus-chest b {
  font-size: 13px;
  color: #92f5f2;
}
.bonus-chest progress {
  display: block;
  width: 100%;
  height: 17px;
  margin: 12px 0 8px;
  accent-color: #5deeea;
}
.bonus-chest #bonus-info {
  position: absolute;
  right: 5px;
  top: 5px;
  font-size: 23px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
}
#bonus-open {
  width: 100%;
  margin-top: 8px;
}
#bonus-open:disabled {
  background: linear-gradient(#69517c, #3e3153);
  border-color: #8d73ac;
  color: #cbb9dd;
  box-shadow: none;
  opacity: 0.8;
  cursor: default;
}
.bonus-won {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin: 10px auto;
}
.bonus-chest.is-opening > img {
  animation: chest-glow 1s ease-in-out infinite;
}
@keyframes chest-glow {
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 30px #79f5ff);
  }
}
@media (orientation: landscape) {
  #pass #track.cosmic-track {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 28px;
    padding: 20px 24px;
    scroll-snap-type: x proximity;
  }
  .cosmic-track .track-intro {
    flex: 0 0 min(80vw, 850px);
    min-height: 0;
    height: 100%;
    flex-direction: row;
    gap: 22px;
    text-align: left;
  }
  .track-intro > img {
    height: 100%;
    max-width: 45%;
  }
  .track-intro h2 {
    margin-left: 0 !important;
  }
  .portrait-hint {
    display: none;
  }
  .landscape-hint {
    display: inline;
  }
  #track.cosmic-track .cosmic-tier {
    flex: 0 0 360px;
    width: 360px;
    max-height: 100%;
    overflow-y: auto;
    scroll-snap-align: start;
  }
  #track.cosmic-track .cosmic-tier:before {
    left: -29px;
    top: 50%;
    height: 3px;
    width: 28px;
  }
  #track.cosmic-track .reward-art {
    height: 100px;
  }
  #track.cosmic-track .reward-item {
    min-height: 165px;
  }
  .bonus-chest {
    flex: 0 0 420px;
    width: 420px;
    max-height: 100%;
    overflow: auto;
    scroll-snap-align: start;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  #pass > .catalog-head {
    padding: 2px 10px;
  }
  #pass > .compact-progress {
    padding: 3px 10px;
  }
  #pass .catalog-head h2 {
    font-size: 14px;
  }
  #track.cosmic-track .cosmic-tier {
    padding: 8px 8px 8px 50px;
  }
  #track.cosmic-track .reward-art {
    height: 55px;
  }
  #track.cosmic-track .reward-item {
    min-height: 110px;
    padding: 6px;
  }
  #track.cosmic-track .reward-plaque strong {
    font-size: 11px;
  }
  #track.cosmic-track .reward-status {
    font-size: 10px;
  }
  #track.cosmic-track .plus-reward {
    margin-top: 5px;
    padding-top: 5px;
  }
  #track.cosmic-track .plus-reward button {
    font-size: 10px;
  }
  #track.cosmic-track .cosmic-plus-art {
    height: 32px !important;
  }
  #pass .bonus-chest h2 {
    font-size: 18px;
  }
  .bonus-chest {
    padding: 14px 12px;
    gap: 10px;
  }
  .bonus-chest p {
    font-size: 11px;
    margin: 6px 0;
  }
}
@media (max-width: 360px) and (orientation: portrait) {
  #track.cosmic-track .cosmic-tier {
    padding-left: 45px;
    padding-right: 8px;
  }
  .cosmic-lanes {
    gap: 6px;
  }
  #track.cosmic-track .reward-plaque strong {
    font-size: 11px;
  }
  #track.cosmic-track .reward-status {
    font-size: 10px;
  }
  .bonus-chest {
    grid-template-columns: 90px 1fr;
    padding: 20px 10px;
    gap: 10px;
  }
  #pass .bonus-chest h2 {
    font-size: 18px;
  }
  #bonus-open {
    font-size: 12px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bonus-chest.is-opening > img {
    animation: none;
  }
}
#track.cosmic-track #pass-level-50 {
  border: 2px solid #e7bf78;
  box-shadow:
    inset 0 2px #ffe4a633,
    0 0 18px #edb85e22;
}
#track.cosmic-track .plus-reward button>span{color:#f2e4ff;}
