/* ==================================================
   MODALS: 22-PHOTO ARCHIVE, 3D CARD STUDIO, CHRONICLE & LIGHTBOX
   ================================================== */
.drawer-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(16, 10, 6, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s 0.45s;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s;
}

.drawer-box {
  width: min(1200px, 100%);
  height: min(87vh, 860px);
  margin: auto;
  background: rgba(24, 18, 14, 0.92);
  border: 1px solid rgba(245, 196, 81, 0.32);
  border-radius: 28px;
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}

.drawer-overlay.is-open .drawer-box {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Questrial", sans-serif;
  font-size: 21px;
  color: var(--white);
}

.drawer-title span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(232, 116, 42, 0.25);
  border: 1px solid var(--orange);
  color: var(--gold-bright);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-family: "Questrial", sans-serif;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-tab:hover,
.filter-tab.is-active {
  background: var(--orange);
  border-color: var(--gold);
  color: var(--white);
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.drawer-close:hover {
  background: var(--orange);
  transform: rotate(90deg);
}

/* 1. 22-PHOTO ROYAL ARCHIVE GRID */
.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 220px;
  align-content: start;
  gap: 18px;
}

.gallery-grid::-webkit-scrollbar,
.studio-body::-webkit-scrollbar,
.dossier-body::-webkit-scrollbar {
  width: 6px;
}

.gallery-grid::-webkit-scrollbar-thumb,
.studio-body::-webkit-scrollbar-thumb,
.dossier-body::-webkit-scrollbar-thumb {
  background: rgba(245, 196, 81, 0.35);
  border-radius: 999px;
}

.g-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #120d0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.g-card.is-wide {
  grid-column: span 2;
}

.g-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 32px rgba(232, 116, 42, 0.28);
}

.g-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(.2,.8,.2,1);
}

.g-card:hover img {
  transform: scale(1.06);
}

.g-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(16,10,6,0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.g-card:hover .g-card__overlay {
  opacity: 1;
}

.g-card__title {
  font-family: "Questrial", sans-serif;
  font-size: 14px;
  color: var(--white);
  margin-bottom: 6px;
}

.g-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.g-card__btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(26, 20, 16, 0.78);
  color: var(--gold-bright);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.g-card__btn:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--white);
}

/* 2. INTERACTIVE 3D CARD STUDIO & HD PNG EXPORTER */
.studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: start;
}

.studio-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(245, 196, 81, 0.22);
  border-radius: 22px;
  padding: 18px;
}

.studio-canvas {
  width: 100%;
  max-width: 290px;
  aspect-ratio: 1024 / 1420;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(245, 196, 81, 0.45);
  display: block;
}

.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-field label {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.studio-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 12px;
}

.studio-input {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-family: "Urbanist", sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s ease;
}

.studio-input:focus {
  border-color: var(--gold);
}

.foil-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.foil-chip {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-family: "Questrial", sans-serif;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.foil-chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.foil-chip.is-active,
.foil-chip:hover {
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.18);
}

.studio-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.studio-photo-pick {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: #140e0a;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.studio-photo-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.studio-photo-pick.is-active {
  border-color: var(--gold);
  transform: scale(1.05);
}

.studio-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.studio-cta {
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--orange);
  color: var(--white);
  font-family: "Questrial", sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.studio-cta:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
}

.studio-cta--secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

/* 3. CHRONICLE & ARSENAL DOSSIER */
.dossier-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 28px;
  align-items: start;
}

.dossier-portrait {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(245, 196, 81, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  aspect-ratio: 3 / 4.4;
}

.dossier-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dossier-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dossier-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.stat-box strong {
  font-family: "Questrial", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--white);
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.arsenal-card {
  padding: 15px 17px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 196, 81, 0.18);
}

.arsenal-card h4 {
  font-family: "Questrial", sans-serif;
  font-size: 14px;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.arsenal-card p {
  font-size: 12.5px;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.8);
}

.voice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-card {
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(232, 116, 42, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.22);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.voice-card:hover {
  background: rgba(232, 116, 42, 0.22);
  transform: translateX(4px);
}

.voice-card h4 {
  font-family: "Questrial", sans-serif;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 4px;
}

.voice-card p {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

/* 4. FULLSCREEN LIGHTBOX */
.lightbox {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(10, 6, 4, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s 0.35s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 76vh;
  border-radius: 18px;
  border: 1px solid rgba(245, 196, 81, 0.45);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

.lightbox__bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 5. 5-STAR GOLDEN METEOR WISH SUMMON OVERLAY */
.wish-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: #070510;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wish-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s;
}

.wish-meteor-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.wish-result {
  position: relative;
  z-index: 2;
  width: min(1100px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transform: scale(0.88) translateY(20px);
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.65s cubic-bezier(.2,.8,.2,1);
}

.wish-result.is-revealed {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.wish-single {
  display: flex;
  align-items: center;
  gap: 32px;
  background: rgba(24, 18, 14, 0.85);
  border: 1px solid rgba(247, 198, 84, 0.55);
  border-radius: 28px;
  padding: 26px 32px;
  box-shadow: 0 0 80px rgba(245, 196, 81, 0.35), 0 28px 80px rgba(0, 0, 0, 0.8);
  max-width: 780px;
}

.wish-single__art {
  width: 240px;
  aspect-ratio: 3 / 4.2;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 32px rgba(245, 196, 81, 0.45);
  flex-shrink: 0;
}

.wish-single__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wish-single__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wish-single__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.2);
  border: 1px solid var(--gold);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.wish-single__stars {
  font-size: 26px;
  letter-spacing: 0.18em;
  color: #ffd859;
  text-shadow: 0 0 18px rgba(255, 216, 89, 0.85);
}

.wish-single__title {
  font-family: "Questrial", sans-serif;
  font-size: 32px;
  color: var(--white);
}

.wish-single__quote {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.wish-multi-grid {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  width: 100%;
  max-height: 68vh;
  overflow-y: auto;
  padding: 10px;
}

.wish-multi-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4.2;
  border: 1.5px solid var(--gold);
  background: #140f0c;
  box-shadow: 0 0 24px rgba(245, 196, 81, 0.32);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wish-multi-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 0 36px rgba(245, 196, 81, 0.75);
}

.wish-multi-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wish-multi-card__stars {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 12px;
  color: #ffd859;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.wish-multi-card__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(12, 8, 4, 0.92));
  font-family: "Questrial", sans-serif;
  font-size: 12.5px;
  color: var(--white);
  text-align: center;
}

.wish-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 960px) {
  .studio-body,
  .dossier-body {
    grid-template-columns: 1fr;
  }
  .studio-row {
    grid-template-columns: 1fr;
  }
  .g-card.is-wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .drawer-overlay {
    padding: 10px;
  }
  .drawer-box {
    height: 92dvh;
    border-radius: 20px;
  }
  .drawer-head {
    padding: 14px 16px;
    gap: 10px;
  }
  .drawer-title {
    font-size: 17px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .gallery-grid {
    padding: 14px;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 165px;
    gap: 10px;
  }
  .g-card__overlay {
    opacity: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(12,8,4,0.88) 100%);
    padding: 10px;
  }
  .g-card__title {
    font-size: 12px;
  }
  .g-card__btn {
    padding: 3px 8px;
    font-size: 10px;
  }
  .studio-body,
  .dossier-body {
    padding: 14px;
    gap: 18px;
  }
  .studio-canvas {
    max-width: 210px;
  }
  .dossier-portrait {
    max-width: 220px;
    margin: 0 auto;
  }
  .wish-single {
    flex-direction: column;
    text-align: center;
    padding: 18px;
    gap: 16px;
  }
  .wish-single__art {
    width: 175px;
  }
  .wish-single__meta {
    align-items: center;
  }
  .wish-single__title {
    font-size: 22px;
  }
  .wish-multi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 58dvh;
  }
}
