@font-face {
  font-family: 'Cafe24Ssurround';
  src: url('../assets/fonts/Cafe24Ssurround.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  /* 여백을 단색이 아닌 디자인의 실제 그레인 텍스처로 채운다 (경계 티 방지) */
  background: #1AB26C url('../assets/bg-tile.webp') repeat;
  background-size: 256px 256px;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* 디자인 원본 비율(402:874)을 유지하는 스테이지.
   화면 비율이 다르면 상하 또는 좌우가 배경색으로 채워진다. */
#stage {
  position: relative;
  height: 100dvh;
  aspect-ratio: 402 / 874;
  max-width: 100vw;
  margin: 0 auto;
  overflow: hidden;
}
@supports not (height: 100dvh) {
  #stage { height: 100vh; }
}
/* 가로가 부족하면(=폭 기준 스케일) 세로 중앙 정렬 */
@media (max-aspect-ratio: 402/874) {
  #stage {
    height: auto;
    width: 100vw;
    aspect-ratio: 402 / 874;
    top: 50%;
    transform: translateY(-50%);
  }
}

.screen {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* ── 투명 핫스팟 (시작하기 — 디자인에 구워진 버튼 위) ── */
.hotspot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

/* ── 객관식 보기: 투명 히트 영역 (시각 상태는 .state-overlay가 담당) ── */
.option {
  position: absolute;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation; /* 더블탭 확대 대기 없이 즉시 반응 */
}

/* ── 상태 오버레이 ──
   시안의 분홍 버튼 픽셀에서 생성한 PNG(assets/states/)를 그대로 겹친다.
   -wrong(분홍)·-right(초록)·-ring(선택 테두리) 모두 실제 버튼 실루엣과
   모서리가 픽셀 단위로 일치한다. 글자 부분은 투명이라 밑의 글자가 보인다. */
.state-overlay {
  position: absolute;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  display: none;
}
.state-overlay.show { display: block; }

/* ── 주관식 글자칸 (입력 글자 표시 + 탭 영역) ── */
.charbox {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cafe24Ssurround', sans-serif;
  color: #222;
  cursor: text;
}

/* 실제 입력은 숨긴 input이 받는다 (모바일 IME) */
#textbox-wrap { position: absolute; inset: 0; pointer-events: none; }
#text-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  font-size: 16px; /* iOS 자동 확대 방지 */
}

/* ── 하단 동작 버튼 (정답 확인하기 / 다시 도전하기 / 다음 문제로) ── */
.bottom-btn {
  position: absolute;
  border: none;
  cursor: pointer;
  border-radius: 12%/46%;
  /* 비비드 초록 배경(≈#1BB26C) 위에서 시안의 진초록 버튼(≈#1A824E)이 되도록 */
  background: rgba(20, 20, 10, 0.30);
  font-family: 'Cafe24Ssurround', sans-serif;
  color: #FFFFFF;
  text-shadow: 0 2px 5px rgba(0, 60, 30, 0.45);
  letter-spacing: 0.06em;
}
.bottom-btn { touch-action: manipulation; }
.bottom-btn:active { filter: brightness(0.92); }
.bottom-btn.disabled { opacity: 0.55; }

.charbox { touch-action: manipulation; }
