/* =====================================================
   pages.css - 비밀번호 페이지(index.html) / 게임 설명 페이지(intro.html) 디자인
   ★ 새로 추가된 파일이에요. 게임 화면(style.css)과는 별개예요.
   색을 바꾸고 싶으면 맨 위 :root 값만 고치면 돼요.
   ===================================================== */

:root {
  --pink: #ff8fab;
  --pink-dark: #e0557c;
  --pink-soft: #fff0f5;
  --gold: #f5b83d;
  --text: #6b4a5a;
  --text-soft: #a58592;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.9) 0, transparent 38%),
    radial-gradient(circle at 90% 30%, rgba(255, 236, 179, 0.55) 0, transparent 40%),
    linear-gradient(180deg, #ffd9e6 0%, #fff1f6 50%, #fff6dc 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ----- 떠다니는 장식 (터치를 방해하지 않아요) ----- */
.deco { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.deco-item {
  position: absolute; bottom: -40px; opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 0.55; }
  85% { opacity: 0.4; }
  100% { transform: translateY(-110vh) rotate(40deg); opacity: 0; }
}

.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(22px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center;
}
.page.center { justify-content: center; }

.card {
  width: 100%; background: rgba(255, 255, 255, 0.93);
  border-radius: 28px; padding: 22px 20px;
  box-shadow: 0 8px 24px rgba(224, 85, 124, 0.16);
  border: 3px solid #fff;
}

/* ===== 1페이지: 비밀번호 ===== */
.lock-wrap { text-align: center; margin-bottom: 8px; }
.lock {
  display: inline-block; font-size: 72px; line-height: 1;
  filter: drop-shadow(0 6px 8px rgba(224, 85, 124, 0.25));
  animation: bob 2.6s ease-in-out infinite;
}
.lock.open { animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pop { 0% { transform: scale(0.6) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }

.bubble {
  position: relative; margin: 0 0 12px; padding: 12px 16px;
  background: var(--pink-soft); border-radius: 18px;
  font-size: 18px; line-height: 1.55; word-break: keep-all; text-align: center;
}
.bubble.soft { background: #fff7e0; }

.quiz {
  margin: 16px 0 14px; padding: 16px 16px 14px; border-radius: 20px;
  background: linear-gradient(180deg, #fff6cc, #ffe9a6);
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px #ffe08a;
  color: #7a5a00; text-align: center;
}
.quiz-title { font-size: 20px; margin-bottom: 8px; }
.quiz-body { font-size: 19px; line-height: 1.6; word-break: keep-all; }
.quiz-names { display: block; margin-top: 6px; font-size: 21px; letter-spacing: 0.5px; color: #b0610a; }

.answer-row { display: flex; gap: 8px; }
.answer-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px;
  border: 3px solid #ffd6e3; border-radius: 16px; background: #fff;
  font-family: inherit; font-size: 20px; color: var(--text); outline: none;
}
.answer-row input:focus { border-color: var(--pink); }
.answer-row input::placeholder { color: #d4bcc6; }
.btn {
  border: none; border-radius: 16px; min-height: 52px; padding: 0 20px;
  font-family: inherit; font-size: 19px; color: #fff; background: var(--pink);
  box-shadow: 0 4px 0 var(--pink-dark); cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-dark); }
.gate-msg { min-height: 26px; margin: 12px 0 0; text-align: center; font-size: 17px; }
.gate-msg.bad { color: #d6455f; }
.gate-msg.good { color: #3f9a68; }
.shake { animation: shake 0.45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}

/* ===== 2페이지: 게임 설명 ===== */
.hero { text-align: center; margin: 6px 0 18px; }
.hero-emoji { font-size: 64px; line-height: 1; animation: bob 3s ease-in-out infinite; }
.hero h1 { margin: 6px 0 4px; font-size: 34px; color: var(--pink-dark); font-weight: normal; }
.hero p { margin: 0; font-size: 17px; color: var(--text-soft); }

.section { margin-bottom: 14px; padding: 18px 18px 16px; }
.section h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: 22px; font-weight: normal; color: var(--pink-dark);
}
.section h2 .no {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pink); color: #fff; font-size: 18px;
}
.section p, .section li { font-size: 18px; line-height: 1.65; word-break: keep-all; margin: 0 0 6px; }
.section ul { margin: 0; padding-left: 0; list-style: none; }
.section li { position: relative; padding-left: 26px; }
.section li::before { content: attr(data-i); position: absolute; left: 0; top: 0; }
.section b { color: var(--pink-dark); font-weight: normal; background: linear-gradient(transparent 62%, #ffe3ec 62%); }

.time-badge {
  display: inline-block; margin: 2px 0 6px; padding: 8px 18px; border-radius: 999px;
  background: linear-gradient(180deg, #fff6cc, #ffe08a); color: #8a5a00; font-size: 24px;
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px #ffe08a;
}

.controls { display: grid; gap: 8px; margin-top: 4px; }
.control {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 16px; background: var(--pink-soft); font-size: 17px; line-height: 1.45; word-break: keep-all;
}
.control .ico { flex: none; width: 40px; text-align: center; font-size: 28px; }

.secret {
  text-align: center; background: linear-gradient(180deg, #fff6cc, #ffe9a6);
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px #ffe08a;
}
.secret h2 { justify-content: center; color: #a86a00; }
.secret .wow { font-size: 21px; color: #b0610a; margin-top: 8px; }

.play-wrap { width: 100%; margin-top: 8px; position: sticky; bottom: calc(10px + var(--safe-bottom)); }
.play-btn {
  display: block; width: 100%; min-height: 62px; border: none; border-radius: 999px;
  font-family: inherit; font-size: 24px; color: #fff; text-align: center; text-decoration: none; line-height: 62px;
  background: linear-gradient(180deg, #ffa9c0, #f06a8d); box-shadow: 0 5px 0 #c9456a, 0 10px 20px rgba(224, 85, 124, 0.3);
  animation: pulse 2s ease-in-out infinite;
}
.play-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9456a; animation: none; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.foot-note { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--text-soft); }

@media (max-width: 340px) {
  .hero h1 { font-size: 30px; }
  .section p, .section li { font-size: 17px; }
  .quiz-body { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .deco-item, .lock, .hero-emoji, .play-btn { animation: none; }
}

/* ----- 2페이지: 공지 카드 / 마지막 비밀번호 카드 ----- */
.notice { background: linear-gradient(180deg, #eaf4ff, #dcecff); border-color: #fff; box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px #b9d6f5; }
.notice h2 { color: #3f6fb0; }
.notice h2 .no { background: #5b8fd6; font-size: 18px; }
.notice b { color: #3f6fb0; background: linear-gradient(transparent 62%, #cfe3fa 62%); }
.lock2 .quiz { margin: 10px 0 12px; }
.quiz-hint { display: block; margin-top: 6px; font-size: 15px; color: #a07a2a; }
.lock2 .gate-msg { margin-top: 10px; }
.lock2.done .quiz { display: none; }
.play-btn { cursor: pointer; }
