.pack-history {
  max-width: 1300px;
}

/* ---- History entries ---- */
.history-entry {
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 10px;
  overflow: hidden;
}

.history-entry-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  background: rgba(128, 128, 128, 0.06);
}

.history-set {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.history-time {
  font-size: 0.85rem;
  opacity: 0.8;
}

.history-count {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.7;
}

.history-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
}

.history-card {
  position: relative;
  width: 150px;
  border-radius: 9px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.history-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.history-card .card-img {
  width: 100%;
  display: block;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.empty-wrapper i {
  opacity: 0.4;
}

/* ---- Card highlight overlay ---- */
.card-highlight {
  display: none;
  z-index: 100;
  width: 100%;
  height: 100%;
  padding: 0;
  position: fixed;
  max-width: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.card-highlight > img {
  width: 480px;
  border-radius: 26px;
  border: 1px solid black;
  max-width: 90vw;
}

.view-in-another-tab {
  border: 1px solid #dc0800;
  top: calc(50% + 345px);
  height: 24px;
  line-height: 24px;
  width: 100px;
  left: calc(50% - 50px);
  position: absolute;
  background-color: white;
  border-radius: 20px;
  text-align: center;
}

.view-in-another-tab a {
  color: #dc0800;
}

/* ---- Foil overlay (animated) ---- */
.foil {
  opacity: 1;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 10;
  border: 1px solid black;
  border-radius: 9px;
  background: linear-gradient(48deg,
      rgba(227, 193, 244, 0.35),
      rgba(217, 215, 237, 0.35),
      rgba(223, 247, 241, 0.35),
      rgba(172, 240, 255, 0.35),
      rgba(227, 193, 244, 0.35),
      rgba(217, 215, 237, 0.35),
      rgba(223, 247, 241, 0.35),
      rgba(172, 240, 255, 0.35),
      rgba(227, 193, 244, 0.35));
  animation: foil 8s ease infinite;
  background-size: 200% 200%;
  pointer-events: none;
}

@keyframes foil {
  0% { background-position: 84% 0; }
  50% { background-position: 17% 100%; }
  100% { background-position: 84% 0; }
}

/* ---- Modal (shared look with the pack opener) ---- */
.pack-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 16px 16px;
}

.pack-modal-dialog {
  background: var(--white, #fff);
  color: inherit;
  width: 100%;
  max-width: 460px;
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.pack-modal-header,
.pack-modal-footer {
  display: flex;
  align-items: center;
  padding: 14px 18px;
}

.pack-modal-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.pack-modal-footer {
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.pack-modal-body {
  padding: 18px;
}

.pack-modal-body textarea {
  width: 100%;
}

.pack-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
}

.pack-modal-close:hover {
  opacity: 1;
}
