* {
    padding: 0;
    margin: 0;
    font-family: "Jua", sans-serif;
    background-color: #fff6ec;
}

.ads-bottom {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.pc {
    display: none;
}

.mobile {
    display: inline-block;
}

.left-ad, .right-ad {
    display: none;
    position: absolute;
    top: 70px;
    margin: 4px;
}

.right-ad {
    right: 4px;
}

header {
    padding: 10px;
    font-size: 1.5rem;
    filter: brightness(1.03);
    border-bottom: 1px  solid rgb(188, 178, 161);
    position: relative;
    display: flex;
    height: 65px;
    box-sizing: border-box;
    margin-bottom: 10px;
    z-index: 100;
}

header p {
    margin-inline-start: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;

}

header p a {
    text-decoration: none; /* 밑줄 제거 */
    color: inherit; /* 글자색 상속 (검정) */
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px; /* 막대기 사이 간격 */
  background: none;
  border: none;
  cursor: pointer;
  padding-top: 10px;
  position: relative;
  z-index: 100;
}

.hamburger span {
  display: block;
  width: 25px; /* 막대기 길이 */
  height: 3px; /* 막대기 두께 */
  background-color: black; /* 색상 */
  border-radius: 2px;
  pointer-events: none;
}

.hamburger:hover {
    transform: scale(1.05 )
}

/* 첫 번째 줄: 45도 회전해서 내려옴 */
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

/* 두 번째 줄: 투명해짐 (사라짐) */
.hamburger.active span:nth-child(2) {
    opacity: 0;
}

/* 세 번째 줄: -45도 회전해서 올라감 */
.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0; /* 왼쪽에서 나오게 하려면 left, 오른쪽은 right */
    width: 250px;
    max-width: 50%;
    height: 100vh;
    background-color: #fdecdaef;
    z-index: 90; /* 버튼(100)보다는 아래, 배경(80)보다는 위 */
    padding-top: 80px; /* 버튼 피해서 내용 시작 */
    
    /* 평소엔 숨김 */
    transform: translateX(-100%); 
    transition: transform 0.3s ease;
}

/* 메뉴 활성화 */
.side-menu.active {
    transform: translateX(0);
}

.backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 80;
    display: none; /* 평소엔 아예 없음 */
}


.backdrop.active {
    display: block;
}

.side-menu ul{
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 15px;
    background-color: transparent;
}

.side-menu li {
    margin-inline-start: 30px;
    list-style: square;
    width: 80%;
    background-color: inherit;
    color: rgb(35, 35, 35);
}

.side-menu li * {
    background-color: transparent;
}

.side-menu li:hover {
    scale: 1.05;
}

.side-menu li a {
    text-decoration: none; /* 밑줄 제거 */
    color: inherit; /* 글자색 상속 (검정) */
}

#ig {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-40%); /* 정확한 수직 중앙 정렬 */
    display: none;
}

#ig img {
    width: 2rem;
    aspect-ratio: 1;
}

#ig img:hover {
    transform: scale(1.05);
}

footer {
    text-align: center;
    bottom: 18px;
    margin-top: 18px;
}

.back-home, .retry {
    width: 30px;
    height: 30px;
}

.back-home:hover, .retry:hover {
    scale : 1.1;
}

.after-game {
    padding: 0;
    margin: 0;
    margin-top: 10px;
    display: none;
    flex-direction: row;
    justify-content: center;
    gap:20px;
}


/* 기본 입력창 스타일 (transition 필수) */
.answer-container {
    transition: all 0.3s ease; /* 색이 부드럽게 바뀌도록 */
}

.answer-container * {
    transition: all 0.3s ease;
}

/* ✅ 정답일 때: 초록색 배경 + 테두리 */
.answer-container.correct {
    background-color: #d1fae5; /* 연한 초록 */
    border-color: #10b981;     /* 진한 초록 */
    color: #065f46;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); /* 초록색 광채 */
}

.answer-container.correct * {
    background-color: transparent;
}

/* ❌ 오답일 때: 빨간색 배경 + 테두리 + 흔들림 효과 */
.answer-container.wrong {
    background-color: #fee2e2; /* 연한 빨강 */
    border-color: #ef4444;     /* 진한 빨강 */
    color: #991b1b;
    animation: shake 0.4s ease-in-out; /* 흔들리는 애니메이션 */
}

.answer-container.wrong * {
    background-color: transparent;
}

/* 흔들림(Shake) 키프레임 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}


@media (min-width: 768px) {
    #ig {
        display: block;
    }

    .back-home, .retry {
    width: 50px;
    height: 50px;   
    }

    .side-menu li {
        font-size: 20px;
        margin-inline-start: 40px;
    }

    .pc{
        display: inline-block;
    }

    .mobile {
        display: none;
    }
}

@media (min-width: 1300px) {
    .left-ad, .right-ad{
        display: inline-block;
    }
}