/* Load magical fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=MedievalSharp&display=swap');

/* Base styles */
body {
  font-family: 'Cinzel', serif;
  background: #f8f8f8;
  color: #333;
  margin: 0;
  padding: 0;
  text-align: center;
}

header, footer {
  font-family: 'MedievalSharp', cursive;
  font-size: 1.2rem;
  padding: 1rem;
  background: #e0f7ff;
  border-bottom: 2px solid #cce;
}

.grotto-banner span {
  display: block;
  font-size: 1.4rem;
  margin: 0.5rem 0;
}

.intro-text {
  font-size: 1rem;
  margin: 1rem auto;
  max-width: 600px;
  line-height: 1.6;
}

.countdown-container {
  margin: 1rem auto;
  font-size: 1.2rem;
}

.grotto-links {
  margin: 1rem auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.grotto-links button {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: linear-gradient(#fafafa, #e6e6e6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.grotto-links button:hover {
  background: #dfefff;
  border-color: #7fbfff;
  box-shadow: 0 0 10px rgba(80,150,255,0.6);
  transform: translateY(-2px);
}

/* Merch grid */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center; /* ✅ keeps single filtered item centered */
}

/* Relic card */
.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #fffdf7;
  border: 3px solid #e8dcc2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: opacity 0.4s ease, transform 0.3s ease;
  max-width: 280px; /* ✅ prevents giant tees when only 1 result */
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Frost overlay */
.image-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/images/ice.png");
  background-size: cover;
  opacity: 0.15;
  pointer-events: none;
  z-index: 2;
}

/* Sparkle shimmer */
.image-container:hover::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  animation: sparkle 1.2s ease-out forwards;
  pointer-events: none;
}

@keyframes sparkle {
  from { opacity: 0.8; transform: scale(0.6); }
  to { opacity: 0; transform: scale(1.4); }
}

/* Overlay text/button */
.overlay-text {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  font-family: 'MedievalSharp', cursive;
  font-size: 1rem;
  color: #fff;
  background: rgba(0,0,0,0.4);
  padding: 0.5rem;
  z-index: 3;
}

.overlay-button {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  background: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  z-index: 3;
}

/* Filter bar default: ghosted */
#filters .filter-bar button {
  opacity: 0.2;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin: 0.3rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f0f0f0;
}

/* Clear button slightly more visible */
#filters .filter-bar .filter-clear {
  opacity: 0.5;
  pointer-events: auto;
}

/* Rune Reveal mode: activate filters */
.rune-reveal #filters .filter-bar button {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  filter: drop-shadow(0 0 6px #9cf);
}

/* Rune button styling */
.rune-button {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  padding: 8px 14px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: linear-gradient(#fafafa, #e6e6e6);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.rune-button:hover {
  background: #dfefff;
  border-color: #7fbfff;
  box-shadow: 0 0 10px rgba(80,150,255,0.6);
  transform: translateY(-2px);
}

/* ✅ Active filter button (new) */
#filters .filter-bar button.active {
  background: #dfefff;
  border-color: #7fbfff;
  color: #003366;
  opacity: 1 !important;
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px #9cf);
}

.intro-text-wrapper {
  position: relative;
  display: inline-block;
}

.intro-text-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/images/ring.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.15;
  z-index: -1;
  animation: spin 20s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
