/* 전역 스타일 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Noto+Sans+KR:wght@300;500&display=swap');

:root {
    --hologram-cyan: #00f2ff;
    --hologram-blue: #004d7a;
    --bg-dark: #010a13;
}

body {
    background-color: var(--bg-dark);
    color: var(--hologram-cyan);
    font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh; /* height: 100vh에서 변경 (스크롤 가능하게) */
    background-image: linear-gradient(0deg, transparent 24%, rgba(0, 242, 255, .05) 25%, rgba(0, 242, 255, .05) 26%, transparent 27%, transparent 74%, rgba(0, 242, 255, .05) 75%, rgba(0, 242, 255, .05) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, rgba(0, 242, 255, .05) 25%, rgba(0, 242, 255, .05) 26%, transparent 27%, transparent 74%, rgba(0, 242, 255, .05) 75%, rgba(0, 242, 255, .05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
}

#wrapper {
    background: rgba(1, 10, 19, 0.8); /* 배경을 조금 더 어둡게 */
}

/* 섹션 공통 */
.section-invitation, .section-location, .section-contact, .section-share {
    background: rgba(0, 77, 122, 0.1);
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* 타이틀 및 라벨 */
.label {
    text-align: center;
    display: block;
    font-size: 0.8rem;
    color: rgba(0, 242, 255, 0.6);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.main-title {
    text-align: center;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 10px var(--hologram-cyan);
    margin-bottom: 20px;
}

/* 메인 설명 텍스트 */
.text_invite {
    text-align: center;
    color: var(--hologram-cyan);
    font-weight: normal;
    text-shadow: 0 0 5px var(--hologram-cyan);
    margin-top: 30px;
    font-size: 1.2rem;
}

.text_invite_body {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-top: 20px;
}

/* 위치 및 주소 */
.text_head {
    color: var(--hologram-cyan);
    letter-spacing: 3px;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 5px var(--hologram-cyan);
    margin-bottom: 15px;
    text-align: center;
}

.address {
    margin-top: 20px;
    font-size: 24px;
    font-family: 'Noto Sans KR', sans-serif; /* 동글이 너무 튀면 기본폰트로 */
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
    text-align: center;
}

/* 버튼 */
.btn-hologram {
    background: transparent;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.6);
    border: 1px solid var(--hologram-cyan);
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    display: block;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    margin-top: 10px;

}

.btn-hologram:hover {
    background: var(--hologram-cyan);
    color: #000 !important; /* 배경이 밝아지므로 글자는 검정색으로 */
    color: #000;
    box-shadow: 0 0 20px var(--hologram-cyan);
}

/* 스캔라인 애니메이션 */
.scanline {
    width: 100%;
    height: 2px;
    background: rgba(0, 242, 255, 0.5);
    position: absolute;
    left: 0;
    z-index: 2;
    box-shadow: 0 0 10px var(--hologram-cyan);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.section_final {
    background-color: var(--hologram-blue);
    color: var(--hologram-cyan);
    text-align: center;
    padding: 25px;
}

.text_final {
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* style.css에 추가 */
.diary-body {
    display: flex;
    justify-content: center; /* 가로 중앙 정렬 */
    align-items: flex-start; /* 상단부터 정렬 */
    padding-top: 50px;
    min-height: 100vh;
}
.container {
    width: 90%;
    max-width: 450px; /* 박스가 너무 퍼지지 않게 제한 */
    margin: 0 auto;
    padding: 40px 20px;
}

#diary-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
    line-height: 1.4;
    word-break: keep-all;
}

hr {
    border: 0;
    border-top: 1px solid rgba(0, 242, 255, 0.5);
    margin: 20px 0;
}

.paper {
    text-align: left; /* 본문 텍스트는 좌측 정렬 유지 */
}

/* style.css 하단에 추가 또는 수정 */
#diary-content {
    background: rgba(0, 242, 255, 0.05); /* 아주 투명한 배경색 */
    border: 1px solid rgba(0, 242, 255, 0.3); /* 연한 청록색 테두리 */
    padding: 20px;
    margin-top: 25px;
    border-radius: 4px;
    line-height: 1.8;
    position: relative;
    /* 안쪽으로 살짝 빛나는 효과 */
    box-shadow: inset 0 0 15px rgba(0, 242, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    word-break: keep-all; /* 단어 단위로 줄바꿈되어 깔끔함 */
}

/* 박스 왼쪽 상단에 작은 장식 추가 (연구소 느낌) */
#diary-content::before {
    content: "Message";
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--bg-dark); /* 배경색과 맞춤 */
    padding: 0 5px;
    font-size: 0.65rem;
    color: var(--hologram-cyan);
    letter-spacing: 1px;
}

/* style.css 하단에 추가 */
.blink {
    animation: blink-animation 1s steps(2, start) infinite;
    -webkit-animation: blink-animation 1s steps(2, start) infinite;
    color: #ff3333; /* 가동 중임을 알리는 붉은색 계열 (선택 사항) */
    font-weight: bold;
}

@keyframes blink-animation {
    to { visibility: hidden; }
}

@-webkit-keyframes blink-animation {
    to { visibility: hidden; }
}


/* 서재 시나리오 전용 성공 연출 */
.crown-success {
    animation: crown-glow 2s ease-in-out infinite alternate;
}

.crown-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px #ffd700);
}

.final-code {
    margin-top: 15px;
    color: #fff;
    background: rgba(255, 215, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
}

@keyframes crown-glow {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.1); filter: brightness(1.3); }
}

/* 입력창 나란히 배치 */
.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.input-group input {
    width: 80px;
    text-align: center;
}

/* 입력창 그룹 정렬 */
.input-group-custom {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

/* 입력창 세부 디자인 */
.input-group-custom input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--hologram-cyan);
    color: var(--hologram-cyan);
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    width: 80px; /* 장/절 박스 크기 */
}

#bible-book {
    width: 120px; /* 성경권 박스는 조금 더 크게 */
}

/* 해독 실패 시 빨간색 강조 */
.fail-text {
    color: #ff4444; /* 강렬한 경고 레드 */
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    display: block;
    margin-top: 15px;
}

/* 해독 버튼 전용 스타일 업그레이드 */
.decode-btn {
    width: 100%;
    margin-top: 25px;
    padding: 15px 25px;

    /* 1. 모서리를 둥글게 처리 (가장 효과적인 버튼 느낌) */
    border-radius: 8px;

    /* 2. 배경: 은은한 수직 그라데이션으로 입체감 부여 */
    background: linear-gradient(to bottom, #222 0%, #111 100%);

    /* 3. 테두리 & 글자색: 청록색 포인트 유지 */
    border: 2px solid var(--hologram-cyan);
    color: var(--hologram-cyan);

    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;

    /* 4. 그림자: 버튼이 화면에서 떠 있는 듯한 느낌 (깊이감) */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);

    transition: all 0.15s ease-in-out; /* 반응 속도를 조금 더 빠르게 */
}

/* 5. 마우스를 올렸을 때 (Hover) - 하이라이트 효과 */
.decode-btn:hover {
    background: linear-gradient(to bottom, #333 0%, #222 100%); /* 배경이 살짝 밝아짐 */
    box-shadow: 0 6px 12px rgba(0, 242, 255, 0.2); /* 은은한 청록색 광채 */
    color: #fff; /* 글자는 흰색으로 강조 */
}

/* 6. ★핵심: 클릭했을 때 (Active) - 눌리는 효과 */
.decode-btn:active {
    /* 버튼이 실제로 눌린 것처럼 아래로 살짝 이동 */
    transform: translateY(2px);

    /* 그림자를 줄여서 바닥에 붙은 느낌 연출 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

    /* 배경 그라데이션을 반전시켜 오목한 느낌 부여 (선택사항) */
    background: linear-gradient(to bottom, #111 0%, #222 100%);
}

/* style.css 수정 */
.result-box {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;    /* 가로 중앙 정렬 */
    justify-content: center; /* 세로 중앙 정렬 */
    text-align: center;     /* 텍스트 중앙 정렬 */
    width: 100%;
}

.crown-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.final-code {
    margin-top: 15px;
    color: #ffd700; /* 글자색 금색으로 */
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    width: 100%;       /* 컨테이너 안에서 꽉 차게 */
    max-width: 280px;  /* 너무 넓어지지 않게 제한 */
    text-align: center;
}

/* 실패 메시지도 중앙에 오도록 */
.fail-text {
    display: block;
    width: 100%;
    text-align: center;
    color: #ff4444;
    margin-top: 15px;
}

/* style.css에 추가 */

/* 해독 실패 시 깜빡이는 빨간색 텍스트 전용 클래스 */
.blink-fail-text {
    color: #ff4444; /* 경고 레드 */
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.7);
    text-align: center;
    display: block;
    margin-top: 15px;

    /* 깜빡임 애니메이션 적용: 1초 동안 부드럽게 무한 반복 */
    animation: fail-blink 1s ease-in-out infinite;
}

/* 초록색 승인 완료 전용 클래스 */
.success-approved {
    color: #00ff00; /* 홀로그램 초록 */
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

/* CSS 애니메이션 정의 */
@keyframes fail-blink {
    0%   { opacity: 1; }
    50%  { opacity: 0.3; } /* 완전히 사라지지 않고 흐려짐 */
    100% { opacity: 1; }
}

.glitch-img-area {
    position: relative;
    overflow: hidden;       /* 중요: 삐져나온 이미지의 선을 잘라냄 */
    background-color: #000; /* 틈새가 생겨도 검은색이 보이도록 설정 */
    line-height: 0;
    width: 100%;
}

.glitch-img-area img {
    display: block;
    /* 이미지를 1.05배 정도로 키워서 가장자리의 선들을 박스 밖으로 밀어냄 */
    transform: scale(1.05);
    width: 100%;
    height: auto;

    /* 혹시 모를 잔여 스타일 제거 */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}