html, body {
  height: 100%;
}
/* 실제로 보이는 높이 (키보드가 뜨면 줄어듦, useKeyboardViewport) */
#root {
  height: var(--app-h, 100%);
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 예능 자막 느낌의 외곽선 글씨 */
.stroke-text {
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
}

.safe-top { padding-top: max(env(safe-area-inset-top), 0.75rem); }
.safe-bottom { padding-bottom: max(env(safe-area-inset-bottom), 1rem); }

/* 매 초마다 숫자가 툭 튀어나오는 효과 (key 변경으로 재실행) */
@keyframes tick-pop {
  0% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.tick-pop { animation: tick-pop 0.25s ease-out; display: inline-block; }

/* 판정 오버레이 등장 */
/* 투명도는 건드리지 않아 애니메이션이 멈춰도 글자가 보이게 한다 */
@keyframes pop-in {
  0% { transform: scale(0.5) rotate(-8deg); }
  60% { transform: scale(1.1) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.pop-in { animation: pop-in 0.35s cubic-bezier(.2,.9,.3,1.3); }

/* 땡! / 시간 초과 시 화면 좌우 흔들림 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-14px) rotate(-1deg); }
  30% { transform: translateX(12px) rotate(1deg); }
  45% { transform: translateX(-10px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
  90% { transform: translateX(3px); }
}
.shake { animation: shake 0.45s ease-in-out; }

/* 카드 뒤집기 (진행자 확인 → 문제 공개) */
@keyframes flip-in {
  from { transform: perspective(900px) rotateY(85deg); }
  to { transform: perspective(900px) rotateY(0); }
}
.flip-in { animation: flip-in 0.4s ease-out; }

/* 마지막 1초: 타이머 숫자 확대 */
.timer-urgent { transform: scale(1.35); transition: transform 0.15s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .tick-pop, .pop-in, .rise, .urgent-flash, .shake, .flip-in { animation: none !important; }
}

/* 시간이 얼마 안 남았을 때 화면 테두리 깜빡임 */
@keyframes urgent-flash {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: inset 0 0 0 6px rgba(239, 68, 68, 0.8); }
}
.urgent-flash { animation: urgent-flash 0.5s ease-in-out infinite; }

/* 첫 번째 진입 애니메이션 */
@keyframes rise {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}
.rise { animation: rise 0.3s ease-out; }
