@font-face {
  font-family: 'Underwood1913';
  src: url('https://harrowick.neocities.org/Lore/Candles/Underwood1913.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background: url("https://harrowick.neocities.org/Lore/Items/itempagebackground.gif") no-repeat center center fixed;
  background-size: cover;
  font-family: 'Underwood1913', monospace;
  color: rgb(221, 206, 191);
  overflow: hidden;
}


.home-btn {
  position: fixed;
  top: 0;
  left: 0;
  cursor: pointer;
  z-index: 5;
  filter: brightness(0.8) contrast(0.9);
  transition: filter 0.3s ease;
}
.home-btn:hover {
  filter: brightness(1) contrast(1);
}


.page-title {
  position: absolute;
  top: 0px;
  left: 58%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 800px;
  height: auto;
  pointer-events: none;
}


#itemPanel {
  position: fixed;
  top: 20px;
  left: -15px;
  width: 28%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
}





/*the panel on the left!!  */

#itemPanelBox {
  width: 100%;
  height: 79vh;
  background-image: url('https://harrowick.neocities.org/Lore/Candles/LoreContainerAnim.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  padding: 110px 30px 40px 30px;
  margin-left: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0.8;
}

#itemImageWrapper {
  position: relative;
  width: 280px;
  height: 280px;
  background-image: none; 
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#itemImageWrapper::before {
  content: '';
  position: absolute;
  width: 110%; 
  height: 110%;
  background-image: url('https://harrowick.neocities.org/Lore/Items/itemborder.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 2;
}

#itemImage {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: none;
  filter: drop-shadow(0 0 3px rgba(221,206,191,0.8));
}

#itemImagePlaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#itemImagePlaceholder img {
  width: 60%;
  height: auto;
  opacity: 0.45;
}


#itemNameRow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#itemName {
  font-family: 'Underwood1913', monospace;
  font-size: 22px;
  color: rgb(221, 206, 191);
  text-decoration: underline;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 1px;
  min-height: 26px;
}



#itemSubtitle {
  font-family: 'Underwood1913', monospace;
  font-size: 18px;
  color: rgba(221, 206, 191, 0.5);
  font-style: italic;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 1px;
}




#itemLore {
  font-family: 'Underwood1913', monospace;
  font-size: 17px;
  color: rgba(221, 206, 191, 0.8);
  font-style: italic;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  min-height: 36px;
  line-height: 1.5;
}




#itemDesc {
  font-family: 'Underwood1913', monospace;
  font-size: 17px;
  color: rgb(221, 206, 191);
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  line-height: 1.4;
}











#lockIndicator {
  display: none;
  width: 24px;
  flex-shrink: 0;
  position: relative;
}

#lockBase {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.3;
}

#lockDrain {
  width: 100%;
  height: auto;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
}

#lockIndicator.draining #lockDrain {
  animation: drain 3s linear forwards;
}

@keyframes drain {
  from { opacity: 1; }
  to   { opacity: 0; }
}





#mainContent {
  position: fixed;
  top: 0;
  left: 440px;
  right: 0;
  bottom: -20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 30px 30px 20px;
  gap: 10px;
}

#pageSubtitle {
  font-family: 'Underwood1913', monospace;
  font-size: 19px;
  color: rgba(221, 206, 191, 0.75);
  text-align: center;
  line-height: 1.7;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  position: absolute;
  top: 80px;
  left: 48%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}


.content-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}



/*item grid.  */
.content-box {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: 980px;
  background-image: url('https://harrowick.neocities.org/Lore/Candles/LoreContainerAnim.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  padding: 70px;
  box-sizing: border-box;
  opacity: 0.8;
}

.content-header {
  text-align: center;
  font-family: 'Underwood1913', monospace;
  font-size: 25px;
  font-weight: normal;
  color: rgb(221, 206, 191);
  text-decoration: underline 0.02em;
  margin-bottom: 20px;
  letter-spacing: 2px;
  padding-top: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}


.scroll-gradient {
  height: 740px;
  overflow-y: scroll;
  padding-right: 160px;
  padding-left: 160px;
  padding-top: 30px;
  font-family: 'Underwood1913', monospace;
  font-size: 20px;
  line-height: 1.3;
  color: rgb(221, 206, 191);
  position: relative;
  text-shadow: 1px 1px 2px rgba(0,0,0,5);
}

.scroll-gradient::after {
  content: '';
  display: block;
  height: 60px;
}

.scroll-gradient::-webkit-scrollbar {
  width: 15px;
}
.scroll-gradient::-webkit-scrollbar-track {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbartrack.png');
  background-size: contain;
  background-repeat: repeat-y;
  background-position: center;
}
.scroll-gradient::-webkit-scrollbar-thumb {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbarthumb.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
}

.scroll-gradient.scrolled-top {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}
.scroll-gradient.scrolled-middle {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}
.scroll-gradient.scrolled-bottom {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
}


#itemGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 65px 12px;
  padding: 10px 0 40px 0;
}

.item-grid-header {
  grid-column: 1 / -1; 
  font-family: 'Underwood1913', monospace;
  font-size: 20px;
  color: rgba(221, 206, 191, 0.8);
  text-align: center;
  letter-spacing: 3px;
  padding: 10px 0 5px 0;
  border-bottom: 1px solid rgba(221, 206, 191, 0.3);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.item-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Underwood1913', monospace;
  font-size: 18px;
  color: rgba(221, 206, 191, 0.7);
  text-align: center;
  cursor: pointer;
  padding: 8px 4px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

.item-entry img {
  width: 90%;
  height: 150px;
  object-fit: contain;
  display: block;
  transition: filter 0.3s ease, transform 0.3s ease;
  filter: brightness(0.85) contrast(0.9) drop-shadow(0 0 2px rgba(221,206,191,0.4));
}

.item-entry:hover img,
.item-entry.active img {
  filter: brightness(1) contrast(1) drop-shadow(0 0 2px rgba(221,206,191,0.8));
  transform: scale(1.15);
}

.item-entry.locked-active img {
  filter: brightness(1.1) contrast(1) drop-shadow(0 0 2px rgba(221,206,191,0.8));
  transform: scale(1.05);
}

.item-entry:hover,
.item-entry.active {
  color: rgb(221, 206, 191);
  border-bottom-color: rgba(221, 206, 191, 0.4);
  text-shadow: 0 0 8px rgba(221, 206, 191, 0.3), 1px 1px 2px rgba(0,0,0,0.9);
}

.item-entry.locked-active {
  color: rgb(255, 240, 210);
  border-bottom-color: rgba(255, 240, 210, 0.6);
  text-shadow: 0 0 12px rgba(255, 230, 180, 0.5), 1px 1px 2px rgba(0,0,0,0.9);
}




#engraved-coal{
  max-width: 250px;
}





/* ─── Mobile panel (hidden by default, opened via JS) ─── */

#mobilePanel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

#mobilePanel.open {
  display: flex;
}

#mobilePanelInner {
  position: relative;
  width: 85vw;
  max-width: 500px;
  background-image: url('https://harrowick.neocities.org/Lore/Candles/LoreContainerAnim.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 60px 40px 50px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#mobilePanelImage {
  width: 280px;
  height: 280px;
  object-fit: contain;
  display: none;
  filter: drop-shadow(0 0 3px rgba(221,206,191,0.8));
}

#mobilePanelImagePlaceholder {
  width: 160px;
  height: 160px;
  background-image: url('https://harrowick.neocities.org/Lore/Items/itemborder.png');
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobilePanelImagePlaceholder img {
  width: 50%;
  height: auto;
  opacity: 0.45;
}

#mobilePanelName {
  font-family: 'Underwood1913', monospace;
  font-size: 22px;
  color: rgb(221, 206, 191);
  text-decoration: underline;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 1px;
}

#mobilePanelLore {
  font-family: 'Underwood1913', monospace;
  font-size: 16px;
  color: rgba(221, 206, 191, 0.8);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

#mobilePanelDesc {
  font-family: 'Underwood1913', monospace;
  font-size: 15px;
  color: rgb(221, 206, 191);
  text-align: center;
  line-height: 1.6;
}

#closeMobilePanelBtn {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 50px;
  height: auto;
  cursor: pointer;
  filter: brightness(0.8) contrast(0.9);
  transition: filter 0.3s ease;
}
#closeMobilePanelBtn:hover {
  filter: brightness(1) contrast(1);
}




@media (max-width: 1440px) {
  #itemPanel {
    width: 440px;
    left: -2%;
    top: 30px;
  }

  #itemPanelBox {
    height: 79vh;
    padding: 95px 25px 35px 25px;
  }

  #itemImageWrapper {
    width: 250px;
    height: 250px;
  }

  #mainContent {
    left: 25%;
    width: 80%;
  }

  .content-box {
    height: 900px;
  }

  .scroll-gradient {
    height: 680px;
    padding-left: 80px;
    padding-right: 80px;
    padding-top: 25px;
  }

  #itemGrid {
    gap: 60px 10px;
  }

  .item-entry img {
    height: 130px;
  }
}


/* ─── 1024px: small desktop / large tablet ─── */
@media (max-width: 1024px) {
  #itemPanel {
    width: 36%;
    left: -5%;
    top: 50px;
    background: none;
  }

  #itemPanelBox {
    width: 93%;
    height: 67%;
    padding: 95px 25px 35px 25px;
  }

  #itemImageWrapper {
    width: 180px;
    height: 180px;
  }

  #itemName {
    font-size: 18px;
  }

  #itemLore,
  #itemDesc {
    font-size: 15px;
  }

  #mainContent {
    left: 26%;
    width: 80vw;

  }

  #pageSubtitle {
    font-size: 15px;
    top: 60px;
  }

  .content-box {
    height: 820px;
    padding: 50px;
  }

  .scroll-gradient {
    height: 620px;
    padding-left: 40px;
    padding-right: 40px;
    padding-top: 25px;
  }

  #itemGrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 50px 10px;
  }

  .item-entry img {
    height: 105px;
  }

  .item-entry {
    font-size: 14px;
  }
}


@media (max-width: 768px) {
  body {
    overflow: hidden;
    height: auto;
    min-height: 100vh;
  }

  #itemPanel {
    display: none;
  }

  .page-title {
    left: 50%;
    max-width: 90vw;
  }

  .home-btn {
    width: 200px;
  }

  #mainContent {
    position: relative;
    left: 0;
    top: 0;
    bottom: auto;
    right: auto;
    width: 100%;
    padding: 10px 10px 20px 10px;
    justify-content: flex-start;
    margin-top: 120px;
  }

  #pageSubtitle {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    font-size: 14px;
    white-space: normal;
    margin-bottom: 10px;
  }

  .content-container {
    max-width: 100%;
  }

  .content-box {
    height: auto;
    min-height: 500px;
    padding: 5px 20px;
    margin-top: -60px;
  }

  .scroll-gradient {
    height: 75vh;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 20px;
  }

  #itemGrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 10px;
  }

  .item-entry img {
    height: 100px;
  }

  .item-entry {
    font-size: 13px;
  }
}


/* ─── 480px: small mobile ─── */
@media (max-width: 480px) {
  
  body{
    overflow: hidden;
    height: 100vh;
  }
  
  .home-btn {
    width: 160px;
  }

  #mainContent {
    margin-top: 100px;
    padding: 8px;
  }

  #pageSubtitle {
    font-size: 12px;
  }

  .content-box {
    padding: 30px 10px;
    margin-top: -80px;
  }

  .scroll-gradient {
    height: 77vh;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 15px;
  }

  #itemGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 10px;
    
  }

  .item-entry img {
    height: 90px;
  }

  .item-entry {
    font-size: 12px;
  }

  #mobilePanelInner {
    padding: 50px 15px 40px 15px;
  }

  #mobilePanelImage,
  #mobilePanelImagePlaceholder {
    width: 200px;
    height: 200px;
  }

  #mobilePanelName {
    font-size: 18px;
  }

  #mobilePanelLore,
  #mobilePanelDesc {
    font-size: 15px;
  }
}