/* ###################### 로고 및 메뉴 ###################### */

body {
  background-color: aliceblue;
}

.all {
  background-color: rgb(3, 21, 65);
}

.mouse-memoirs-regular {
  font-family: 'Mouse Memoirs', sans-serif;
  font-weight: 400;
  font-style: normal;
}

#logo {
  display: flex;
  margin-left: 50px;
}

.special-gothic-condensed-one-regular {
  font-family: 'Freesentation-9Black';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-9Black.woff2')
    format('woff2');
  font-weight: 900;
  font-style: normal;
  color: rgb(244, 254, 255);
  text-decoration: none;
  font-size: 25px;
}

.special-gothic-condensed-one-regular-2 {
  font-family: 'Freesentation-9Black';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-9Black.woff2')
    format('woff2');
  font-weight: 900;
  font-style: normal;
  color: rgb(244, 254, 255);
  text-decoration: none;
  font-size: 20px;
}

.menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  justify-content: space-between;
}

.menu .text {
  list-style: none;
  display: flex;
  margin-right: 50px;
  padding: 0;
}

.menu .text li {
  list-style: none;
  position: relative;
}

.menu .text li a {
  display: block;
  padding: 0 30px;
  background: rgb(3, 21, 65);
  height: 40px;
  line-height: 40px;
  color: #fff;
}

.menu .text li .submenu {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  z-index: 1000; /* 이거 추가해야 content들보다  위에 위치함 */
  left: 0;
  top: 100%;
  width: 100%;
  background: rgb(3, 21, 65);
  padding: 0;
  text-align: center;
}

.menu .text li .submenu li {
  margin: 0;
}

.menu .text li .submenu li a {
  display: block;
  padding: 10px 0;
  color: #fff;
  background: rgb(3, 21, 65);
  font-size: 18px;
  border-bottom: 1px solid rgb(3, 21, 65);
  text-decoration: none;
}

.menu .text li .submenu li:last-child a {
  border-bottom: none;
}

.menu .text li:hover .submenu {
  max-height: 800px;
  opacity: 1;
}

.menu .text li:hover a {
  transform: scale(1.08);
  color: rgb(251, 255, 202);
}

.menu .text .submenu li a:hover {
  transform: scale(1.08);
  color: rgb(255, 235, 133);
}

#check {
  color: rgb(141, 227, 255);
  text-decoration: underline;
}

h1{
  font-size: 60px;
}

/* ###################### 반응형 웹 ###################### */

/* 미디어 유형이 스크린이고, 최대 너비 600px의 경우 적용할 css */
@media screen and (max-width: 600px) {
  #logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px auto;
    width: 100%;
  }

  .menu {
    flex-direction: column;
    align-items: center;
    height: auto;
  }

  .menu .text {
    flex-direction: column;
    align-items: center;
    margin-right: 0;
  }

  .menu .text li {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .menu .text li a {
    padding: 0 18px;
    font-size: 18px;
    text-align: center;
    border-radius: 0;
    width: 100%;
  }

  .menu .text li .submenu {
    display: none;
    position: static !important;
    width: 100%;
    box-shadow: none;
    text-align: center;
    color: rgb(255, 235, 133);
    opacity: 1 !important;
    max-height: none !important;
    transition: none !important;
  }

  .menu .text li:hover .submenu,
  .menu .text li:focus-within .submenu {
    color: rgb(255, 235, 133);
    display: block;
  }

  .menu .text li .submenu li a {
    color: rgb(255, 235, 133);
    font-size: 15px;
    padding-left: 0;
    width: 100%;
    text-align: center;
  }
}

/* ##########################################################내가 바꾼 부분 */
/* 플래시카드 그리드: 3열 고정, 간격(gap) 16px */
/* 1) 부모에 상대위치, 퍼스펙티브 설정 */
.title{
    justify-content: center;
    display: flex;
}
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(4, 220px);
  justify-content: center;
  gap: 60px;
  padding: 20px 0;
  margin: 0 auto;
}


.flashcard {
  position: relative;            /* 내부 절대위치 기준 */
  width: 220px;                  /* grid-template-columns 값과 동일 */
  height: 140px;                 /* grid-auto-rows와 동일 */
  perspective: 2000px;           /* 왜곡 최소화 */
  perspective-origin: center;    /* 카드 중앙에 원근 투영 기준 */
  cursor: pointer;
}

/* 2) 플립할 요소: 절대위치로 딱 고정 */
.card-inner {
  position: absolute;            /* ← 이거 꼭 필요 */
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transform-origin: center;      /* 회전 중심을 카드 중앙으로 */
  transition: transform 0.5s;
}

/* 3) 앞면 / 뒷면 (크기·위치·박스모델 완전히 동일) */
.card-front,
.card-back {
  position: absolute;            /* 동일 위치 유지 */
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  box-sizing: border-box;        /* padding·border가 크기에 영향 안 주게 */
  margin: 0;                     /* 브라우저 기본 마진 제거 */
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 1rem;
  text-align: center;
}

/* 앞면 색상 */
.card-front {
  background: #2563eb;
  color: #fff;
  font-weight: bold;
}

/* 뒷면 색상 + 회전 */
.card-back {
  background: #f1f5f9;
  color: #102a43;
  transform: rotateY(180deg);
}

/* 실제 뒤집기 */
.card-inner.is-flipped {
  transform: rotateY(180deg);
}


/* 페이지네이션: 화면 하단에 고정 */
.pagination {
  position: relative;
  /* bottom: 20px; */
  margin-top: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.pagination .page-btn {
  margin: 0 4px;
  padding: 6px 12px;
  border: none;
  background: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
}
.pagination .page-btn:hover {
  background: #cbd5e1;
}
.pagination .page-btn.active {
  background: #2563eb;
  color: #fff;
}

/* ────── 퀴즈 전체 레이아웃 ────── */
.quiz-section {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ────── 퀴즈 카드 ────── */
.quiz-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

/* 질문 텍스트 */
.quiz-question,
.quiz-command {
  font-size: 1.2rem;
  font-weight: 500;
  color: #102a43;
  margin-bottom: 16px;
}

/* 부가 설명(커맨드 퀴즈) */
.quiz-desc {
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 20px;
}

/* ────── 버튼 그룹 ────── */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* 답안 버튼 */
.ans-btn {
  flex: 1 1 calc(50% - 12px);
  padding: 12px 0;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.ans-btn:hover {
  background: #1e40af;
  transform: translateY(-2px);
}

.ans-btn:active {
  transform: translateY(0);
}

/* ────── 결과 화면 ────── */
.quiz-result {
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.quiz-result p {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

#retry {
  padding: 10px 20px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#retry:hover {
  background: #059669;
}

/* ────── 이미지 퀴즈 추가 스타일 ────── */
.quiz-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ────── 페이지 전환 애니메이션 ────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);  }
}

/* ────── 반응형 ────── */
@media (max-width: 480px) {
  .ans-btn {
    flex: 1 1 100%;
  }
  .quiz-card {
    padding: 16px;
  }
}






@media screen and (max-width: 600px) {
    .character-display {
        display: none;
    }

}

/* ###################### 캐릭터 및 슬라이더 스타일 ###################### */

.heading {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.link-btn {
    display: block;
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    text-align: center;
    margin-top: 10px; /* 캐릭터창 아래 여백 */
    font-size: 14px;
}

.link-btn:hover {
    background-color: #2563eb;
}

.slider-container {
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    position: relative;
}

.slider {
    display: flex;
    transform: translateX(-100%);
    transition: transform 0.5s ease-in-out;
}

.slider .image-wrapper {
    width: 100%;
    flex: 0 0 100%;
    position: relative;
}

.slider img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

.select-btn {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(59, 130, 246, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.image-wrapper:hover .select-btn {
    display: block;
}

.input-container {
    margin-top: 20px;
    text-align: center;
}

.input-field {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.confirm-btn {
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
}

.confirm-btn:hover {
    background-color: #059669;
}

.arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(59, 130, 246, 0.8);
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.arrow-btn:hover {
    background-color: rgba(59, 130, 246, 1);
}

#prevBtn {
    left: 10px;
}

#nextBtn {
    right: 10px;
}

.complete-btn {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    z-index: 1200;
}

.complete-btn:hover {
    background-color: #059669;
}

.character-display {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: white;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
  z-index: 1100;
}

.character-display img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.character-display p {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  text-align: center;
  line-height: 1.2;
}

.character-display .score {
  font-size: 0.75rem;
  color: #4b5563;
  margin: 0;
}

.link-btn {
    display: block;
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    text-align: center;
    margin-top: 10px; /* 캐릭터창 아래 여백 */
    font-size: 14px;
}

@media screen and (max-width: 600px) {
  .flashcard-grid{
    grid-template-columns: 1fr !important;
    width: 0%;
  }
      .character-display {
        bottom: 10px;
        right: 10px;
        width: 100px;
        padding: 8px;
    }

    .character-display img {
        width: 48px;
        height: 48px;
    }

    .link-btn {
        font-size: 11px;
        padding: 3px 6px;
    }
}