@font-face {
  font-family: 'Hakgyoansim Byeolbichhaneul';
  src: url('./fonts/Hakgyoansim Byeolbichhaneul OTF L.otf') format('opentype');
}

:root {
  color-scheme: light only;
}

html,
body {
  background-color: #0e0b36;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: auto;
  font-family: 'Hakgyoansim Byeolbichhaneul', Arial, sans-serif;
  background: url('./UI_png/배경/배경_글리터+별+그라데이션.png') repeat center
    center fixed;
  background-size: cover;
  color: white;
  opacity: 1;
  transition: opacity 0.5s ease;
}

body {
  display: flex;
  flex-direction: column;
  width: 100vw;
}

body.fade-out {
  opacity: 0;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4;
  width: 100%;
}
header img {
  width: auto;
  height: 120px;
}

/* Ornaments */
.ornament-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 100%;
  pointer-events: none;
}
.ornament-bottom {
  /* position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  width: 100%;
  pointer-events: none; */
  margin-top: 20px;
  width: 100%;
}

.body-container {
  flex: 1 1 0%;
  margin-top: 140px; /* offset for fixed header */
  justify-items: center;
}

/* ======================= */
/* HOMEPAGE (index.html)   */
/* ======================= */
.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 85px;
  justify-items: center;
  /* padding: 50px 300px; */
  width: auto;
  position: relative;
  z-index: 1;
}

.character-card {
  position: relative;
  width: 200px;
  height: 300px;
  background-size: cover;
  border-radius: 10%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-image: url('./ui 에셋/캐릭배경.png'),
    url('./ui 에셋/컬러포인트+컬러 그라데이션.png');
}

.character-card:hover {
  transform: scale(1.05);
  /* box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); */
}

.character-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transform: scale(1);
  position: absolute;
  top: -2%;
  left: 0;
  z-index: -1;
}

.info-text {
  margin-top: 50px;
  font-size: 20px;
  text-align: center;
}

/* Responsive homepage grid */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 0;
  }
  .character-card {
    width: 140px;
    height: 210px;
  }
  header img {
    height: 60px;
  }
}

/* ==========================
   DESCRIPTION PAGE LAYOUT
   (Horizontal: bigger char on left,
    two boxes stacked on right)
   ========================== */
.desc-page-legacy {
  /* Large top margin so the character never overlaps the ornament */
  margin-top: 200px;
  /* Center everything horizontally within the page */
  width: 1200px; /* or any max container width you prefer */
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
  /* Provide vertical spacing below header */

  display: flex;
  flex-direction: row;
  align-items: flex-start; /* top-align the character and boxes */
  justify-content: center; /* center them horizontally in the container */
  gap: 60px; /* space between left & right columns */

  min-height: calc(100vh - 200px);
  position: relative;
  box-sizing: border-box;

  z-index: 1;
}

.desc-page {
  width: 100vw;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 80%;
}

/* Left column: the character */
.desc-left {
  /* We only have the image, so no special flex needed here */
  grid-row: 1 / span 2;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  width: 100%;
}

.desc-left__container {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 500px;
}

.audio-container {
  display: flex;
  margin-top: 25px;
}

.audio-container__player {
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.audio-container__player:nth-child(1) {
  margin-right: 25px;
}

.audio-container__player > button {
  background: transparent;
  border: none;
  width: 100px;
}

.audio-container__player__icon {
  width: 100%;
  height: 100%;
}

/* Make the character image bigger but not so large it hits the ornament */
.desc-character-image {
  width: 500px; /* increase for bigger character */
  max-width: 100%; /* don’t overflow the container */
  height: auto;
  object-fit: contain;
  display: block;
}

/* Right column: stack the two boxes, top-aligned */
.desc-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start; /* top-left alignment for both boxes */
}

/* Info Box using 인포 박스.png */
.info-box-static {
  width: 100%;
  background: url('./ui 에셋/인포 박스2.png') no-repeat center center;
  background-size: contain;
  background-position: left;
  text-align: left;
  padding: 48px;
  box-sizing: border-box;
  border-radius: 10px;
}

/* Description Box using 설명 박스.png */
.description-box-static {
  width: 100%;
  background: url('./ui 에셋/설명 박스2.png') no-repeat center center;
  background-size: contain;
  background-position: left;
  text-align: left;
  padding: 48px;
  box-sizing: border-box;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.description-box-static > p {
  word-break: keep-all;
}

/* Back button style */
.close-btn {
  margin-top: 25px;
  padding: 10px 20px;
  background: transparent;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 20px;
  font-family: 'Hakgyoansim Byeolbichhaneul', Arial, sans-serif;
  pointer-events: auto;
  z-index: 9999;
}

.close-btn > img {
  width: 50px;
  margin-right: 10px;
  pointer-events: none;
}

.close-btn:hover {
  /* TODO */
}

.flex-col-center-container {
}

/* ==========================
     RESPONSIVE (Portrait/Mobile)
     ========================== */
@media (max-width: 768px) {
  .flex-col-center-container {
    display: flex;
    align-items: center;
    flex-direction: column;
  }

  .desc-page-legacy {
    margin-top: 140px;
    flex-direction: column;
    align-items: center; /* center both columns in mobile view */
    gap: 30px;
    min-height: auto;
    z-index: 1;
  }

  .desc-page {
    grid-template-columns: repeat(1, 1fr);
    width: 100%;
  }

  .desc-character-image {
    width: 300px;
  }

  .desc-left {
    align-items: center;
    margin-bottom: 25px;
    width: 100vw;
  }

  .desc-left__container {
    width: auto;
  }

  /* Info Box using 인포 박스.png */
  .info-box-static-legacy {
    width: 500px;
    background: url('./ui 에셋/인포 박스2.png') no-repeat center center;
    background-size: contain;
    text-align: left;
    padding: 8vh 170px; /* enough space to display the shape */
    box-sizing: border-box;
    border-radius: 10px;
  }

  /* .info-box-static, .description-box-static {
    margin-left: 10px;
  } */

  .close-btn > img {
    margin-right: 0;
  }

  .close-btn {
    padding-left: 0;
  }

  /* Description Box using 설명 박스.png */
  .description-box-static-legacy {
    width: 500px;
    background: url('./ui 에셋/설명 박스2.png') no-repeat center center;
    background-size: contain;
    text-align: center;
    padding: 8vh 150px;
    box-sizing: border-box;
    border-radius: 10px;
    margin-bottom: 20px;
  }
}
