/**
 * style.css - 시뮬레이션 메인 스타일
 * - guideOverlay, speechBubble, profileHUD, virtualKeypad, frame UI 등
 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* 시작 안내 오버레이 */
#guideOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;

  transform: translateY(-180px); 
}

#guideOverlay.hide {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.guideText {
  padding: 30px 30px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 16px;
  letter-spacing: -0.5px;
  text-align: center;
  animation: guidePulse 1.8s ease-in-out infinite;
}

@keyframes guidePulse {
  0%   { transform: scale(1); opacity: 0.85; }
  50%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

/* 말풍선 컨테이너 */
#speechBubble {
  position: absolute;
  pointer-events: auto;
  z-index: 1000;
  transform-origin: bottom center;
}

/* 말풍선 본체 */
#speechBubble .bubble {
  background: linear-gradient(
    180deg,
    #fff6fc 0%,
    #eef1ff 100%
  );
  padding: 18px 22px;
  border-radius: 26px;
  font-size: 20px;
  font-weight: 500;
  color: #444;
  max-width: 340px;
  text-align: center;
  position: relative;
  animation: bubbleFloat 2.2s ease-in-out infinite;
  pointer-events: auto;
  border: 3px solid #c9ceff;

  box-shadow:
    0 6px 0 #b7bcff,
    0 14px 26px rgba(120, 120, 200, 0.35);
}

/* 말풍선 꼬리 */
#speechBubble .bubble::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  width: 26px;
  height: 26px;
  background: #eef1ff;
  transform: translateX(-50%) rotate(45deg);
  border-left: 3px solid #c9ceff;
  border-bottom: 3px solid #c9ceff;
  border-radius: 0 0 8px 0;
}

.hidden {
  display: none;
}
.speechBtns {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 0 6px;
}

/* 버튼 그룹 이전,다음*/
.speechBtns button {
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  will-change: transform;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;

  background: linear-gradient(
    180deg,
    #ff9ad5,
    #ff6fb1
  );

  border-radius: 14px;
  box-shadow:
  inset 0 1px 0 rgba(255,255,255,0.35),
  0 6px 0 #e64a94,
  0 14px 26px rgba(230,74,148,0.35);
  cursor: pointer;
  pointer-events: auto;
}

.speechBtns button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 2px 0 #e64a94,
    0 6px 12px rgba(230,74,148,0.3);
}

#speechPrevBtn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

#speechConfirmBtn.hidden {
  display: none;
}
.speechBtns.center {
  justify-content: center;
}



/* 둥둥 */
@keyframes bubbleFloat {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-7px); }
  100% { transform: translateY(0); }
}


/* =========================
   Inspect 설명 프레임
========================= */
.frame {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame__content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.frame--inspect .frame__content {
  width: auto;
  max-width: 520px;
  padding: 24px;
}

.frame--quiz .frame__content {
  width: 600px;
  padding: 24px;
}

.frame--game .frame__content {
  width: 1000px;
  height: 700px;
  padding: 0;
  display: flex;
}

.frame--game canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#frame {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 97, 0.45);
  display: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#frameContent {
  width: 72%;
  max-width: 760px;

  background: #ffffff;
  border-radius: 22px;
  padding: 32px 36px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

/* 제목 */
.inspect-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 18px;
  color: #2b2b2b;
}

/* 설명 본문 */
.inspect-body {
  font-size: 20px;
  line-height: 1.7;
  color: #555;
  max-height: 320px;
  overflow-y: auto;
}

.inspect-body p {
  margin-bottom: 14px;
}
/* 확인 버튼 */
.inspect-close {
  display: block;
  margin: 26px auto 0;
  padding: 12px 28px;

  border-radius: 16px;
  border: none;

  font-size: 15px;
  font-weight: 700;
  color: #ffffff;

  background: linear-gradient(
    180deg,
    #3b6cff 0%,
    #2c4fd7 100%
  );

  /* 테두리 착시 제거 버전 */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 6px 0 #1f3fb8,
    0 18px 36px rgba(59,108,255,0.35);

  cursor: pointer;
  
  outline: none;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  will-change: transform;

  animation: confirm 1.4s ease-in-out infinite;
}

.inspect-close:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 2px 0 #1f3fb8,
    0 8px 14px rgba(59,108,255,0.3);
}

@keyframes confirm {
  0% {
    transform: scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.35),
      0 6px 0 #1f3fb8,
      0 18px 36px rgba(59,108,255,0.35);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.45),
      0 8px 0 #1f3fb8,
      0 26px 52px rgba(59,108,255,0.55);
  }
  100% {
    transform: scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.35),
      0 6px 0 #1f3fb8,
      0 18px 36px rgba(59,108,255,0.35);
  }
}

/* 확인해보기 버튼 */
#inspectBtn {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  padding: 30px 64px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;

  border-radius: 42px;
  border: none;

  background: linear-gradient(
    180deg,
    #3b6cff 0%,
    #2c4fd7 100%
  );
  color: #ffffff;

  /* 🔥 테두리 착시 제거 버전 */
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.35),
    0 8px 0 #1f3fb8,
    0 26px 52px rgba(59,108,255,0.4);

  z-index: 9999;
  cursor: pointer;

  outline: none;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  will-change: transform;

  animation: inspectPulseBlue 1.4s ease-in-out infinite;
}

@keyframes inspectPulseBlue {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.35),
      0 8px 0 #1f3fb8,
      0 26px 52px rgba(59,108,255,0.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.45),
      0 10px 0 #1f3fb8,
      0 36px 72px rgba(59,108,255,0.6);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.35),
      0 8px 0 #1f3fb8,
      0 26px 52px rgba(59,108,255,0.4);
  }
}


/* =========================
   퀴즈 프레임 
========================= */

.quiz {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 36px;
  background: linear-gradient(180deg, #ffffff, #f6f7fb);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  text-align: center;
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
}

.quiz-header {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 2px;
  color: #7a5cff;
  margin-bottom: 12px;
}

.quiz-subject {
  font-size: 16px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

#gameQuestion {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #222;
  margin-bottom: 28px;
}

/* =========================
   정답 고를때
========================= */

#gameChoices {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#gameChoices button {
  position: relative;
  padding: 16px 18px 16px 56px;
  border-radius: 14px;
  border: none;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

#gameChoices button::before {
  content: attr(data-label);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #7a5cff;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameChoices button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.15);
  background: #f3f0ff;
}

/* =========================
   결과 메세지
========================= */

#gameResult {
  margin-top: 24px;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

#gameResult.correct {
  color: #2ecc71;
}

#gameResult.wrong {
  color: #e74c3c;
}

.hidden {
  display: none;
}

/* 결과 메시지 */
#gameResult {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

/* 정답 */
#gameResult.correct {
  color: #2f6bff; /* 파란색 */
}

/* 오답 */
#gameResult.wrong {
  color: #e74c3c; /* 빨간색 */
}

#gameResult .chance {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 500;
  color: #555;
}
/* ===== 탑승하기 홀드 버튼 ===== */
#boardBtn {
  position: fixed;
  left: 50%;
  top: 60%;
  transform: translateX(-50%);

  width: 260px;
  height: 64px;
  border-radius: 32px;
  border: none;

  background: #2b2f36;
  color: #fff;

  font-size: 18px;
  font-weight: 800;
  cursor: pointer;

  overflow: hidden; /* 게이지 잘리게 하는 핵심 */

  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    0 10px 0 #1e2126,
    0 26px 48px rgba(0,0,0,0.4);
}

/* 버튼 텍스트 */
#boardBtn .label {
  position: relative;
  z-index: 1;
}


.virtual-keypad {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 9000;

  display: flex;
  flex-direction: column;
  gap: 10px;

  user-select: none;
  pointer-events: auto;
}

/* 키 행 */
.virtual-keypad .key-row {
  display: flex;
  gap: 10px;
}

.virtual-keypad .key-row.center {
  justify-content: center;
}

/* 버튼 기본 */
.virtual-keypad button {
  width: 64px;
  height: 64px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.35);

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.25),
    rgba(255,255,255,0.08)
  );

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  color: #fff;
  font-size: 22px;
  font-weight: 600;

  box-shadow:
    0 6px 14px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);

  cursor: pointer;

  transition:
    transform 0.06s ease,
    background 0.1s ease,
    box-shadow 0.1s ease;
}

/* 눌림 효과 */
.virtual-keypad button:active {
  transform: translateY(2px) scale(0.97);

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.35),
    rgba(255,255,255,0.15)
  );

  box-shadow:
    0 3px 8px rgba(0,0,0,0.45),
    inset 0 2px 4px rgba(0,0,0,0.25);
}

/* 프레임 열릴 때 숨김용 */
.virtual-keypad.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
/* =========================
 터치용
========================= */

html, body {
  touch-action: none;
  overscroll-behavior: none;
}

/* 캔버스 */
canvas {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 모든 UI 버튼 */
button,
.virtual-keypad,
.virtual-keypad button,
#speechBubble,
#inspectBtn,
#boardBtn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* 길게 누르면 뜨는 메뉴 차단 */
* {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;

  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}
#speechBubble .text {
  white-space: pre-wrap;
  word-break: keep-all;
}

/* =========================
   Hint UI (Modern / Kiosk)
========================= */

/* 힌트 버튼 */
#hintBtn {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 9000;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 100px;
  height: 60px;
  padding: 0 36px;

  padding: 12px 18px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.6px;

  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(50, 90, 255, 0.85),
    rgba(90, 140, 255, 0.85)
  );

  border: none;
  border-radius: 999px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255,255,255,0.15);

  cursor: pointer;
  user-select: none;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease;
}

#hintBtn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255,255,255,0.2);
}

#hintBtn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 2px 6px rgba(0,0,0,0.25);
}


/* 힌트 박스 */
#hintBox {
  position: fixed;
  top: 90.5px;     /* 버튼 바로 아래 */
  left: 28px;
  z-index: 9000;

  width: 400px;
  padding: 26px 28px 24px;

  background: rgba(20, 22, 28, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: #ffffff;
  font-size: 14.5px;
  line-height: 1.6;

  border-radius: 18px;

  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255,255,255,0.08);

  transform-origin: top left;
  animation: hintPop 0.18s ease-out;

  pointer-events: auto;
}

/* 숨김 */
#hintBox.hidden {
  display: none;
}

/* 힌트 텍스트 */
#hintBox .hint-text {
  margin-bottom: 14px;
  white-space: pre-line;
  font-weight: 500;
  color: #f2f4ff;
}

/* 닫기 버튼 */
#hintCloseBtn {
  width: 100%;
  height: 54px;

  border: none;
  border-radius: 12px;

  background: linear-gradient(
    135deg,
    #ffffff,
    #e8ecff
  );

  color: #2b2f55;
  font-size: 17px;
  font-weight: 900;

  cursor: pointer;
  user-select: none;

  box-shadow:
    0 6px 16px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(0,0,0,0.05);

  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

#hintCloseBtn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.3),
    inset 0 0 0 1px rgba(0,0,0,0.06);
}

#hintCloseBtn:active {
  transform: translateY(0);
  box-shadow:
    0 3px 6px rgba(0,0,0,0.25),
    inset 0 2px 4px rgba(0,0,0,0.25);
}
#hintBox .hint-list {
  margin: 0 0 14px 0;
  padding: 0;
  list-style: none;
}

#hintBox .hint-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;

  font-size: 17px;
  line-height: 1.8;
}

#hintBox .hint-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: #9fb4ff;
  font-size: 22px;
  line-height: 1;
}



/* 등장 애니메이션 */
@keyframes hintPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.game-confirm-btn {
  min-width: 200px;
  height: 56px;
  border-radius: 999px;

  border: none;
  background: linear-gradient(135deg, #5b4bdb, #7b6cf6);
  color: #fff;

  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;

  cursor: pointer;
  box-shadow: 0 8px 20px rgba(91, 75, 219, 0.35);
  transition: all 0.18s ease;
}

.game-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(91, 75, 219, 0.45);
}

.game-confirm-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(91, 75, 219, 0.35);
}

/* 프로필ui */
#profileHUD {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;

  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 200px;         
  padding: 12px 20px;      

  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 16px;

  color: #fff;
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
}

#profilePhoto {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profileInfo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;             
}

#profileName {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;   /* 이름 길어도 안전 */
}

#profileSalary {
  font-size: 14px;
  font-weight: 700;
  color: #ffd966;
}

.inspect-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 16px;
}

.nav-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6f8cff, #4f6cff);
  box-shadow: 0 6px 16px rgba(79,108,255,0.35);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(79,108,255,0.45);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.page-indicator {
  font-size: 14px;
  font-weight: 700;
  color: #4f6cff;
}

.inspect-confirm {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #ff9f4f, #ff7a18);
  box-shadow: 0 8px 20px rgba(255,122,24,0.4);
}

.inspect-confirm.hidden {
  display: none;
}

/* =========================
   가로형 화면 말풍선 대응
========================= */
@media (orientation: landscape) {

  #speechBubble {
    max-width: 80vw;           /* 화면 가로 기준 */
  }

  #speechBubble .bubble {
    max-width: 80vw;           /* 기존 340px → 가로 확장 */
    font-size: 22px;           /* 가로 화면 가독성 */
    padding: 22px 28px;
  }

  /* 너무 위로 밀리는 것 방지 */
  #speechBubble {
    transform: translate(-50%, 0);
  }
}
#topLeftBtns {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 9000;

  display: flex;
  gap: 14px;
  align-items: center;
}
#hintBtn,
#goHomeBtn {
  position: static;
}
#goHomeBtn {
  height: 60px;
  padding: 0 28px;
  border-radius: 999px;

  font-size: 20px;
  font-weight: 600;

  background: rgba(255,255,255,0.95);
  color: #2b2f55;

  border: none;
  cursor: pointer;

  box-shadow:
    0 6px 18px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(0,0,0,0.08);

  transition: transform .15s ease, box-shadow .15s ease;
}

#goHomeBtn:hover {
  transform: translateY(-2px);
}

#goHomeBtn:active {
  transform: translateY(2px);
}

/* collect_submit 마지막 미션 지시문 (화면 상단에 계속 표시) - profileHUD 아래 */
#collectMissionInstruction {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  max-width: 92vw;
  padding: 14px 24px;
  background: rgba(45, 27, 97, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

#collectMissionInstruction.hidden {
  display: none !important;
  visibility: hidden;
}

#collectMissionInstruction:not(.hidden) {
  display: block !important;
  visibility: visible;
}

.collect-mission-instruction-text {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff;
  text-align: center;
}

@media (min-width: 768px) {
  .collect-mission-instruction-text {
    font-size: 17px;
  }
}
