.atlas-book-view {
  gap: 6px;
}

.atlas-sets {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 2px 8px;
}

.atlas-set {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atlas-set[hidden] {
  display: none;
}

.atlas-set-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.atlas-set-name {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 var(--gold-deep)) drop-shadow(0 2px 1px rgba(0, 0, 0, 0.7));
}

.atlas-set-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 18px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 3px #000, 0 0 0 1px var(--gold-deep);
}

.atlas-set-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #8dff8a, #2fbf3a 55%, #1a8a28);
  transition: width 400ms ease-out;
}

.atlas-set-count {
  position: relative;
  color: #fff;
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #000, 0 0 3px #000;
}

.atlas-set.complete .atlas-set-fill {
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-dark));
}

.atlas-set .atlas-grid {
  row-gap: 18px;
  padding-top: 8px;
}

.atlas-slot-stars {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 1;
  transform: translate(-50%, -55%);
  color: var(--gold);
  font-family: var(--display);
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-shadow: 0 0 5px rgba(255, 211, 77, 0.8), 0 1px 0 var(--gold-deep), 0 2px 2px #000;
}

.atlas-slot.missing .atlas-slot-stars {
  color: var(--gold-dark);
  text-shadow: 0 1px 0 #000;
}

#atlas-sheet .atlas-card-stars {
  display: none;
}

#atlas-sheet .atlas-card-count {
  left: 0.35em;
  right: auto;
}

.atlas-slot-new {
  position: absolute;
  top: 10px;
  right: -2px;
  z-index: 1;
  display: none;
  padding: 2px 5px 0;
  border-radius: 4px;
  background: var(--gold-bevel);
  border: 1px solid var(--gold-deep);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  color: var(--gold-deep);
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.atlas-slot.fresh .atlas-slot-new {
  display: block;
}

.atlas-set-prize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

.atlas-set-prize .atlas-coin {
  width: 34px;
  height: 34px;
}

.atlas-set-prize .atlas-claim-reward {
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 var(--gold-deep), 0 2px 2px #000;
}

.atlas-strip-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}

.atlas-back {
  flex: none;
  min-width: 56px;
  min-height: 44px;
  padding: 0 6px;
  background: none;
  border: 0;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #000;
}

.atlas-strip {
  flex: 1 1 auto;
  display: flex;
  justify-content: space-around;
  min-width: 0;
}

.atlas-chip {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.atlas-chip .atlas-medal-ring {
  width: 44px;
  height: 44px;
  border-width: 2px;
  opacity: 0.7;
}

.atlas-chip.current .atlas-medal-ring {
  opacity: 1;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 0 12px rgba(255, 211, 77, 0.8);
}

.atlas-chip .atlas-medal-new {
  top: -6px;
  right: -8px;
}

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

.atlas-slot {
  position: relative;
  display: block;
}

.atlas-slot.got-now .atlas-card {
  animation: atlas-got 650ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

.atlas-card {
  --frame: var(--gold-dark);
  --glow: rgba(255, 211, 77, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 1.1em 0.3em 0.35em;
  overflow: hidden;
  border-radius: 0.6em;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 75% 18%, #fff, transparent),
    radial-gradient(1px 1px at 60% 62%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(80% 55% at 50% 42%, rgba(239, 52, 201, 0.35), transparent 70%),
    linear-gradient(180deg, #3b1466, #160733);
  border: 2px solid var(--frame);
  box-shadow: 0 0 0 1px var(--gold-deep), inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px var(--glow);
  font-size: 13px;
}

.atlas-card.r2 { --frame: var(--gold); --glow: rgba(59, 139, 255, 0.55); }
.atlas-card.r3 { --frame: var(--gold-light); --glow: rgba(255, 79, 216, 0.7); }
.atlas-card.r4 {
  --frame: #fff6c8;
  --glow: rgba(255, 211, 77, 0.9);
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 75% 18%, #fff, transparent),
    radial-gradient(80% 55% at 50% 42%, rgba(255, 211, 77, 0.45), transparent 70%),
    conic-gradient(from 200deg at 50% 45%, #4a1580, #7a1f8c, #2a1a7a, #4a1580);
}

.atlas-card.r2,
.atlas-card.r3,
.atlas-card.r4 {
  border-width: 3px;
}

.atlas-card.r4:not(.missing) {
  animation: atlas-legend 2.4s ease-in-out infinite;
}

.atlas-card-art {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.atlas-card-img {
  display: block;
  width: 86%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.atlas-card-stars {
  position: absolute;
  top: 0.2em;
  left: 0.4em;
  color: var(--gold);
  font-size: 0.75em;
  letter-spacing: -0.08em;
  text-shadow: 0 0 4px rgba(255, 211, 77, 0.8), 0 1px 1px #000;
}

.atlas-card-count {
  position: absolute;
  top: 0.1em;
  right: 0.35em;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.85em;
  text-shadow: 0 1px 2px #000;
}

.atlas-card-name {
  flex: none;
  max-width: 100%;
  color: var(--text);
  font-family: var(--display);
  font-size: max(11px, 0.78em);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 #000;
}

.atlas-card-unknown {
  display: none;
}

.atlas-card.missing {
  --frame: #4a2d6e;
  --glow: transparent;
  background: linear-gradient(180deg, #1d0b38, #0b0418);
  border-width: 2px;
  box-shadow: 0 0 0 1px #1a0a2c, inset 0 0 12px rgba(0, 0, 0, 0.8);
}

.atlas-card.missing .atlas-card-art {
  filter: brightness(0);
  opacity: 0.55;
}

.atlas-card.missing .atlas-card-name,
.atlas-card.missing .atlas-card-stars {
  opacity: 0.45;
}

.atlas-card.missing .atlas-card-unknown {
  position: absolute;
  inset: 0 0 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 2.4em;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 0 6px rgba(255, 79, 216, 0.6));
}

#atlas-sheet .atlas-card {
  box-shadow: 0 0 0 1px var(--gold-deep), inset 0 0 0 2px rgba(0, 0, 0, 0.35);
  animation: none;
}

#atlas-sheet .atlas-slot.got-now .atlas-card {
  animation: atlas-got 650ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

#atlas-sheet .atlas-card-name {
  font-size: 12px;
}

#atlas-sheet .atlas-card-stars {
  font-family: var(--display);
  font-size: 11px;
  text-shadow: 0 1px 0 #000;
}

#atlas-sheet .atlas-card-unknown {
  filter: drop-shadow(0 1px 0 var(--gold-deep));
}


@media (prefers-reduced-motion: reduce) {
  #atlas-sheet .atlas-slot.got-now .atlas-card {
    animation: none;
  }
}

.atlas-workshop { flex: none; }
.atlas-guide {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.atlas-trade-title, .atlas-planet-name {
  font-family: var(--display);
  color: var(--text);
  text-shadow: 0 1px 0 #000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.atlas-trade-title { margin-top: 16px; font-size: 1rem; }
.atlas-trades { display: grid; grid-template-columns: repeat(4, minmax(0, 0.9fr)) repeat(2, minmax(0, 1.2fr)); gap: 7px; padding: 8px 0; }
.atlas-planet-offer { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.atlas-planet-offer .pearl { width: 40px; height: 40px; }
.atlas-planet-name { font-size: 0.7rem; letter-spacing: 0.025em; }
.atlas-action, .atlas-trade {
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 0 var(--gold-deep);
  color: var(--text);
  background: linear-gradient(var(--violet), var(--navy-deep));
  font-family: var(--display);
  text-shadow: 0 1px 0 #000;
  letter-spacing: 0.04em;
  min-height: 44px;
}
.atlas-action { display: block; width: 100%; margin: 8px auto; max-width: 240px; }
.atlas-action[hidden] { display: none; }
.atlas-trade {
  width: 100%;
  padding: 2px 4px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.atlas-trade:disabled { opacity: 0.45; }

.atlas-trade:active {
  transform: translateY(2px);
}

.atlas-button {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  margin-bottom: 10px;
  padding: 4px 14px 4px 16px;
  border-bottom: 1px solid var(--hairline);
}

.atlas-button:active {
  transform: translateY(2px);
}

.atlas-button-icon,
.voyage-button-icon {
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: 4px;
}

.voyage-button .atlas-button-state {
  color: var(--starlight);
}

.atlas-button-name {
  position: relative;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}

.atlas-button-state {
  margin-left: auto;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}

.atlas-button.ready .atlas-button-name::before {
  content: "!";
  position: absolute;
  top: calc(50% - 21px);
  left: -27px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ruby);
  border: 2px solid var(--gold-deep);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0;
  line-height: 18px;
  text-align: center;
  text-shadow: none;
}

