@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Cormorant+Garamond:ital,wght@0,500;1,500&display=swap');

:root{
  --teal-hi:#1c6a6c;
  --teal:#0f3d3e;
  --teal-lo:#082627;
  --gold:#d4af37;
  --gold-bright:#f3dd93;
  --gold-dim:#8a6f2b;
  --ink:#2c2115;
  --parchment:#f4e8cc;

  /* Gallery sizing. Overridden by html[data-view="small"]. */
  --card-w:220px;
  --card-h:323px;
  --card-gap:28px;
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  height:100%;
  font-family:'Cormorant Garamond', serif;
}

/* Keep the scrollbar gutter reserved so locking scroll for a modal doesn't
   shift the whole gallery sideways. */
html{
  scrollbar-gutter:stable;
}

body{ 
  margin:0;
  min-height:100vh;
  
  display:grid;
  grid-template-columns: repeat(auto-fit, var(--card-w));
  grid-auto-rows: max-content;
  justify-content: center;
  gap:var(--card-gap);

  padding:120px 20px 60px;

  overflow-y:auto;
  overflow-x:hidden;
  isolation:isolate;

  background: linear-gradient(135deg, rgb(25, 148, 87), rgb(28, 176, 159), rgb(15, 49, 104));
    background-attachment: fixed;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image:url('img/elements.png');
  background-repeat:no-repeat;
  background-position:center;
  background-size:min(60vw, 620px);
  opacity:0.18;
  mix-blend-mode:soft-light;
  pointer-events:none;
  z-index:-1;
}

@keyframes drift-bg{
  0%{ background-position: 0 0, 0 0, 0% 50%; }
  50%{ background-position: 0 0, 0 0, 100% 50%; }
  100%{ background-position: 0 0, 0 0, 0% 50%; }
}

body::-webkit-scrollbar{  
  width:8px; 
} 
 
body::-webkit-scrollbar-track{ 
  background:rgba(255,255,255,0.05); 
} 
 
body::-webkit-scrollbar-thumb{ 
  background:linear-gradient(180deg, var(--gold-dim), var(--gold)); 
  border-radius:10px; 
} 
 
body{ 
  scrollbar-width:thin; 
  scrollbar-color: var(--gold-dim) rgba(255,255,255,0.05); 
}


header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  padding:16px 28px;
  display:flex;
  align-items:center;
  z-index:10;
  background:linear-gradient(180deg, rgba(6,15,20,0.85) 0%, rgba(6,15,20,0) 100%);
  pointer-events:none;
}

header img{
  height:44px;
  width:auto;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.5));
}

.search-bar{
  position:fixed;
  margin:10px;
  top:22px;
  right:32px;
  z-index:11;
  width:auto;
  height:auto;
  display:flex;
  align-items:center;
  gap:8px;
 
  padding:8px 16px;
  border-radius:999px;
  background:linear-gradient(160deg, #163f40, #082627);
  border:1px solid rgba(212,175,55,0.5);
  box-shadow:0 8px 18px rgba(0,0,0,0.4);
  overflow:visible;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
 
.search-bar:focus-within{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(212,175,55,0.18), 0 8px 18px rgba(0,0,0,0.4);
}
 
.search-bar input{
  background:transparent;
  border:none;
  outline:none;
  width:180px;
  font-family:'Cormorant Garamond', serif;
  font-weight: bold;
  font-size:1rem;
  color:var(--gold-bright);
}
 
.search-bar input::placeholder{
  color:rgba(243,221,147,0.55);
}
 
.search-bar button{
  display:flex;
  align-items:center;
  justify-content:center;
  background:none;
  border:none;
  padding:0;
  color:var(--gold-bright);
  cursor:pointer;
  opacity:0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
 
.search-bar button:hover{
  opacity:1;
  transform:scale(1.10);
}

@media (max-width: 480px){
  .search-bar{
    top:14px;
    right:12px;
    padding:6px 12px;
    gap:6px;
  }
  .search-bar input{
    width:110px;
    font-size:0.85rem;
  }
  .search-bar button svg{
    width:15px;
    height:15px;
  }
}

.new-char {
  background:linear-gradient(135deg, #1be8d7, #0e7d7d);
  font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-weight: bold;
  color: #ff004c;
  border: 1px solid #a9e7ff;
  border-radius: 12px;
  padding: 2px;
  padding-left: 20px;
  padding-right: 20px;
  text-shadow: none;
}

.upcoming-char {
  background:linear-gradient(135deg, #1b74e8, #0e357d);
  font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-weight: bold;
  color: #ed87a5;
  border: 1px solid #a9e7ff;
  border-radius: 12px;
  padding: 2px;
  padding-left: 20px;
  padding-right: 20px;
  text-shadow: none;
}

.new-name{
  color: #3fffb5;
}


.character-card{ 
  position:relative; 
  width:var(--card-w);
  height:var(--card-h);
  display:flex;
  flex-direction:column;

  border-radius:10px; 
  overflow:hidden; 
  background:linear-gradient(160deg, #163f40 0%, #0a2a2b 100%); 

  box-shadow: 
    inset 0 0 0 1px rgba(212,175,55,0.35), 
    0 12px 30px rgba(0,0,0,0.5); 

  transition:transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease; 
}

.card-media{
  position:relative;
  display:block;
  flex:1;
  min-height:0;
  overflow:hidden;
}

.character-card.search-hidden{
  display:none;
}
 
.character-card.search-entering{
  opacity:0;
  transform:translateY(26px);
}


.character-card:hover{
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px var(--gold),
    0 0 26px rgba(255, 255, 255, 0.968),
    0 18px 40px rgba(0,0,0,0.6);
  z-index:2;
}

.Pyro-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #ff4500,
    0 0 26px rgba(255, 69, 0, 0.5),
    0 18px 40px rgba(139, 0, 0, 0.6);
  z-index: 2;
}

.Hydro-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #1e90ff,
    0 0 26px rgba(30, 144, 255, 0.5),
    0 18px 40px rgba(0, 0, 139, 0.6);
  z-index: 2;
}

.Geo-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #ffd700,
    0 0 26px rgba(255, 215, 0, 0.5),
    0 18px 40px rgba(184, 134, 11, 0.6);
  z-index: 2;
}

.Dendro-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #7fff00,
    0 0 26px rgba(127, 255, 0, 0.5),
    0 18px 40px rgba(34, 139, 34, 0.6);
  z-index: 2;
}

.Electro-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #ba55d3,
    0 0 26px rgba(186, 85, 211, 0.5),
    0 18px 40px rgba(75, 0, 130, 0.6);
  z-index: 2;
}

.Anemo-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #00ffcc,
    0 0 26px rgba(0, 255, 204, 0.5),
    0 18px 40px rgba(0, 139, 139, 0.6);
  z-index: 2;
}

.Cryo-Archon:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #b0e0e6,
    0 0 26px rgba(176, 224, 230, 0.5),
    0 18px 40px rgba(70, 130, 180, 0.6);
  z-index: 2;
}

.Lunar-God:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px #bebef9,
    0 0 26px #b330f4,
    0 18px 40px #83199b;
  z-index: 2;
}

.card-image{
  width:100%;
  height:100%;

  object-fit: cover;
  object-position: center top; 
  display:block;
  filter:saturate(1.05) contrast(1.02);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.character-card:hover .card-image{
  transform:scale(1.08);
}

.card-name{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  margin:0;
  padding:22px 10px 12px;
  text-align:center;

  font-family:'Cinzel', serif;
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:0.03em;
  color:var(--gold-bright);
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);

  background:linear-gradient(180deg, rgba(6,15,20,0) 0%, rgba(6,15,20,0.85) 60%, rgba(6,15,20,0.92) 100%);
  z-index:1;
}



.Pyro-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #ff4500bf 60%, #8b0000e6 100%);
}

.Hydro-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #0073ffbf 60%, #02008be6 100%);
}

.Geo-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #ff9900bf 60%, #8b6600e6 100%);
}

.Dendro-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #00ff37bf 60%, #158b00e6 100%);
}

.Electro-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #9d00ffbf 60%, #53008be6 100%);
}

.Anemo-Archon:hover .card-name{
  background: linear-gradient(180deg, #060f1400 0%, #00ffd0bf 60%, #008b66e6 100%);
}

.Cryo-Archon:hover .card-name {
  background: linear-gradient(180deg, #060f1400 0%, #4682b4d9 60%, #1e3c64f2 100%);
}

.Lunar-God:hover .card-name{
 background: linear-gradient(180deg, rgba(6,15,20,0) 0%, rgba(45, 25, 75, 0.85) 60%, rgba(20, 10, 40, 0.95) 100%);
}

/* ---------- Small icon view ---------- */

html[data-view="small"]{
  --card-w:108px;
  --card-gap:16px;
}

html[data-view="small"] .character-card{
  height:auto;
  border-radius:14px;
  background:linear-gradient(160deg, #abfbff 0%, #0d4961 70%);
}

html[data-view="small"] .card-media{
  flex:none;
  width:100%;
  /* Explicit height: aspect-ratio alone collapses inside the auto-height
     flex card, because the grid row is sized before the ratio resolves. */
  height:var(--card-w);
  aspect-ratio:1;
  border-radius:14px;
}

html[data-view="small"] .card-image{
  object-position:center 15%;
  filter:none;
}

/* No icon file yet: zoom the poster onto the head instead of showing a
   full-body thumbnail. Replaced automatically once the -icon.png exists. */
html[data-view="small"] .character-card.no-icon .card-image{
  transform:scale(1.9);
  transform-origin:50% 22%;
}

html[data-view="small"] .card-name,
html[data-view="small"] .character-card:hover .card-name{
  position:static;
  padding:7px 2px 0;
  min-height:calc(2.3em + 7px);
  font-size:0.72rem;
  line-height:1.15;
  letter-spacing:0.01em;
  background:none;
  text-shadow:0 1px 4px rgba(0,0,0,0.85);
}

html[data-view="small"] .new-char,
html[data-view="small"] .upcoming-char,
html[data-view="small"] .card-name br{
  display:none;
}

/* ---------- Element filter (hamburger) ---------- */

header{
  gap:14px;
}

.filter-toggle{
  position:relative;
  pointer-events:auto;
  display:inline-flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  width:44px;
  height:44px;
  padding:0 11px;
  border-radius:12px;
  border:1px solid rgba(212,175,55,0.5);
  background:linear-gradient(160deg, #163f40, #082627);
  box-shadow:0 8px 18px rgba(0,0,0,0.4);
  cursor:pointer;
  transition:border-color 0.3s ease, box-shadow 0.3s ease;
}

.filter-toggle span{
  display:block;
  width:100%;
  height:2px;
  border-radius:2px;
  background:var(--gold-bright);
  transition:transform 0.3s ease, opacity 0.25s ease;
}

.filter-toggle span:nth-child(2){
  width:70%;
}

.filter-toggle:hover{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(212,175,55,0.16), 0 8px 18px rgba(0,0,0,0.4);
}

.filter-toggle[aria-expanded="true"] span:nth-child(1){
  transform:translateY(7px) rotate(45deg);
}

.filter-toggle[aria-expanded="true"] span:nth-child(2){
  opacity:0;
}

.filter-toggle[aria-expanded="true"] span:nth-child(3){
  transform:translateY(-7px) rotate(-45deg);
}

.filter-toggle.has-active::after{
  content:"";
  position:absolute;
  top:6px;
  right:6px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--gold-bright);
  box-shadow:0 0 8px var(--gold);
}

/* ---------- View toggle (large / small icons) ---------- */



/* ---------- Small icon view overlay styling ---------- */

html[data-view="small"] .character-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

html[data-view="small"] .card-media {
  display: block;
  width: 100%;
  height: var(--card-w);
}

/* Position name box over the bottom of the image */
html[data-view="small"] .card-name {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 16px 4px 6px;
  min-height: 0;
  font-size: 0.72rem;
  font-weight: bold;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold-bright);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  z-index: 2;
  border-top: none;
}

/* Element-colored gradient overlays (fading from transparent to deep element color) */
html[data-view="small"] .character-card[data-element="anemo"] .card-name {
  background: linear-gradient(180deg, rgba(46, 210, 180, 0) 0%, rgba(34, 209, 160, 0.45) 50%, rgba(21, 176, 163, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="cryo"] .card-name {
  background: linear-gradient(180deg, rgba(140, 225, 250, 0) 0%, rgba(113, 211, 244, 0.45) 50%, rgba(12, 184, 184, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="dendro"] .card-name {
  background: linear-gradient(180deg, rgba(150, 235, 70, 0) 0%, rgba(57, 232, 84, 0.45) 50%, rgba(47, 167, 7, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="electro"] .card-name {
  background: linear-gradient(180deg, rgba(185, 115, 245, 0) 0%, rgba(124, 54, 194, 0.45) 50%, rgba(74, 8, 150, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="geo"] .card-name {
  background: linear-gradient(180deg, rgba(235, 185, 54, 0) 0%, rgba(170, 125, 28, 0.45) 50%, rgba(102, 77, 7, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="hydro"] .card-name {
  background: linear-gradient(180deg, rgba(65, 180, 245, 0) 0%, rgba(18, 77, 160, 0.45) 50%, rgba(15, 49, 104, 0.75) 100%);
}

html[data-view="small"] .character-card[data-element="pyro"] .card-name {
  background: linear-gradient(180deg, rgba(245, 115, 60, 0) 0%, rgba(194, 54, 94, 0.45) 50%, rgba(139, 10, 42, 0.75) 100%);
}

.view-toggle{
  position:fixed;
  top:76px;
  left:28px;
  z-index:11;
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  padding:0;
  border-radius:12px;
  border:1px solid rgba(212,175,55,0.5);
  background:linear-gradient(160deg, #163f40, #082627);
  box-shadow:0 8px 18px rgba(0,0,0,0.4);
  color:var(--gold-bright);
  cursor:pointer;
  transition:border-color 0.3s ease, box-shadow 0.3s ease;
}

.view-toggle:hover{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(212,175,55,0.16), 0 8px 18px rgba(0,0,0,0.4);
}

.view-toggle:focus-visible{
  outline:2px solid var(--gold-bright);
  outline-offset:3px;
}

.view-toggle svg{
  width:18px;
  height:18px;
  display:block;
}

.view-toggle .icon-small{
  display:none;
}

html[data-view="small"] .view-toggle .icon-large{
  display:none;
}

html[data-view="small"] .view-toggle .icon-small{
  display:block;
}

.filter-menu{
  position:fixed;
  top:124px;
  left:28px;
  z-index:12;
  width:250px;
  max-height:calc(100vh - 148px);
  overflow-y:auto;
  display:none;
  flex-direction:column;
  gap:6px;
  padding:14px;
  border:1px solid rgba(212,175,55,0.5);
  border-radius:16px;
  background:linear-gradient(160deg, rgba(22,63,64,0.98), rgba(8,38,39,0.98));
  box-shadow:0 18px 40px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(243,221,147,0.06);
  backdrop-filter:blur(6px);
  pointer-events:auto;
}

.filter-menu.open{
  display:flex;
  animation:filter-menu-in 0.22s ease;
}

@keyframes filter-menu-in{
  from{ opacity:0; transform:translateY(-8px) scale(0.98); }
  to{ opacity:1; transform:none; }
}

.filter-menu-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
  padding:0 4px 8px;
  border-bottom:1px solid rgba(212,175,55,0.22);
}

.filter-menu-title{
  margin:0;
  font-family:'Cinzel', serif;
  font-size:0.72rem;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:rgba(243,221,147,0.72);
}

.filter-reset{
  border:none;
  background:none;
  padding:2px 4px;
  border-radius:6px;
  font-family:'Cormorant Garamond', serif;
  font-size:0.85rem;
  font-weight:bold;
  color:var(--gold);
  cursor:pointer;
  transition:color 0.2s ease;
}

.filter-reset:hover{
  color:var(--gold-bright);
  text-decoration:underline;
}

.filter-reset:disabled{
  opacity:0.35;
  cursor:default;
  text-decoration:none;
}

.filter-option{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--parchment);
  font-family:'Cinzel', serif;
  font-size:0.92rem;
  letter-spacing:0.04em;
  text-align:left;
  cursor:pointer;
  transition:background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-option:hover{
  background:rgba(243,221,147,0.08);
  border-color:rgba(212,175,55,0.35);
  transform:translateX(2px);
}

.filter-option[aria-pressed="true"]{
  background:rgba(212,175,55,0.14);
  border-color:var(--gold);
  color:var(--gold-bright);
}

.filter-icon{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:50%;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.28);
  box-shadow:inset 0 0 10px rgba(0,0,0,0.35);
}

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

.filter-icon[data-element="anemo"]{
  background:radial-gradient(circle at 30% 30%, #c3fff0, #2ec4a8);
}

.filter-icon[data-element="cryo"]{
  background:radial-gradient(circle at 30% 30%, #ebfbff, #7fd4f0);
}

.filter-icon[data-element="dendro"]{
  background:radial-gradient(circle at 30% 30%, #e6ffb0, #86b52c);
}

.filter-icon[data-element="electro"]{
  background:radial-gradient(circle at 30% 30%, #eed4ff, #9b5fd6);
}

.filter-icon[data-element="geo"]{
  background:radial-gradient(circle at 30% 30%, #fff0c2, #d7a52c);
}

.filter-icon[data-element="hydro"]{
  background:radial-gradient(circle at 30% 30%, #d6f4ff, #2f9fe0);
}

.filter-icon[data-element="pyro"]{
  background:radial-gradient(circle at 30% 30%, #ffd9c2, #e5602b);
}

.filter-label{
  line-height:1.1;
}

@media (max-width: 480px){
  header{
    padding:10px 12px;
    gap:8px;
  }

  header img{
    height:32px;
  }

  :root{
    --card-w:calc(50vw - 27px);
    --card-gap:14px;
  }

  body{
    padding:108px 20px 48px;
  }

  .card-name{
    font-size:0.85rem;
    padding:16px 6px 8px;
  }

  .filter-toggle{
    width:40px;
    height:40px;
    padding:0 10px;
  }

  .view-toggle{
    top:60px;
    left:12px;
  }

  .filter-menu{
    top:108px;
    left:12px;
    right:12px;
    width:auto;
    max-height:calc(100vh - 126px);
  }

  html[data-view="small"]{
    --card-w:72px;
    --card-gap:10px;
  }

  html[data-view="small"] .card-name{
    font-size:0.6rem;
    padding:5px 1px 0;
  }
}