:root{
  --yellow:#ffd100;
  --shadow:0 10px 28px rgba(0,0,0,.12);
  --card: rgba(255,255,255,.85);
  --radius:14px;
}

/* reset */
*{box-sizing:border-box}
html,body{height:100%;margin:0}

/* base */
/* base */
/* base */
/* base */
body {
  font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif !important;
  color: #222;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}


/* 고정 배경 레이어 */
body::before{
  content:"";
  position:fixed; inset:0; z-index:0;
  background-image:url("../img/Background.png");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-attachment:scroll;      /* iOS 고정 버그 방지 */
  will-change:transform;
  transform:translateZ(0);
}

.hidden{display:none !important}

/* ===== 고정 헤더 ===== */
/* 고정 헤더 (인트로 포함 모든 화면 위로 올라오게) */
.site-header {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 18px;
  z-index: 1000;        
  pointer-events: auto;
}

.brand-link {
  display: inline-block;
}

.brand-logo {
  height: 70px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
  transition: transform .2s ease;
  cursor: pointer;
}

.brand-logo:hover {
  transform: scale(1.05);
}


/* ===== 공통 패널 ===== */
.panel{
  position:relative; z-index:1;    /* 고정 배경 위 */
  width:min(92vw,560px);
  background:rgba(255,255,255,.55);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:28px 22px;
  text-align:center;
  backdrop-filter:blur(14px);
}
.question{ font-size:1.25rem; font-weight:700; margin:0 0 18px }

/* 버튼 그리드 */
.grid-2{
  display:grid; grid-template-columns:1fr 1fr; gap:14px;
  max-width:420px; margin:0 auto;
}
.pill{
  padding:14px 12px; border:0; border-radius:12px;
  background:rgba(255,255,255,.22);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
  font-size:1rem; font-weight:500; color:#222;
  transition:all .25s ease;
}
.pill:hover{
  background:rgba(255,255,255,.38);
  transform:translateY(-2px) scale(1.03);
  box-shadow:0 6px 14px rgba(0,0,0,.10);
}
.pill:active{ transform:scale(.97); background:rgba(255,255,255,.18) }

/* ===== 인트로: 정확히 수평/수직 중앙 고정 ===== */
.intro{
  position: fixed; inset: 0; z-index: 50;
  display: flex; justify-content: center; align-items: center;
  background: transparent !important;
  padding: 0 !important;     /* body padding 영향 제거 */
}
.intro-media{
  position: relative;
  display: flex; justify-content: center; align-items: center;
  transform: translateY(-3vh);    /* 시각적 균형 위해 살짝 위로 */
}
.intro-gif{
  display: block;
  width: min(92vw, 700px);
  height: auto;
  cursor: pointer;
  transition: transform .25s ease;
  filter: none !important; box-shadow: none !important;
}
.intro-gif:active{ transform: scale(.97) }

/* 모바일 */
@media (max-width: 480px){
  .intro-media{ transform: translateY(-2vh); }
  .intro-gif{ width: 90vw; height: auto; object-fit: contain; }
}


/* 페이드 */
.fade-out{ animation:fadeOut .8s forwards }
.fade-in { animation:fadeIn  .8s forwards }
@keyframes fadeOut{ from{opacity:1} to{opacity:0} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* 분석 화면 */
.dots span{opacity:.2; animation:blink 1.2s infinite}
.dots span:nth-child(2){animation-delay:.2s}
.dots span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%{opacity:.2}50%{opacity:1}100%{opacity:.2}}

/* 게이지 */
.progress-container{
  width:70%; max-width:320px; height:8px; margin:24px auto 0;
  background:rgba(0,0,0,.08); border-radius:4px; overflow:hidden;
}
.progress-bar{
  width:0%; height:100%;
  background:linear-gradient(90deg,#ffd100,#e2231a);
  border-radius:4px; transition:width 2s ease;
}

/* 결과 메시지 */
.message-card{
  max-width:480px; margin:0 auto; padding:28px 22px;
  background:var(--card); border-radius:14px;
  box-shadow:0 4px 20px rgba(0,0,0,.08);
  font-size:1.15rem; line-height:1.7; font-weight:500; color:#111;
  min-height:120px; display:flex; align-items:center; justify-content:center;
  white-space:pre-line;
}

/* 액션 */
.actions{ display:flex; justify-content:center; gap:10px; margin-top:16px }

/* 되돌리기: 노란 배지 + 흰색 아이콘, 작은 원형 */
#finalMessage .actions #replayBtn{
  appearance: none;
  border: 0;
  outline: 0;

  /* 기본 사이즈 (데스크톱) */
  width: 52px;
  height: 52px;
  border-radius: 9999px;

  /* 중앙 정렬 */
  display: grid;
  place-items: center;

  /* 노란 그라데이션 배경 */
  background: radial-gradient(110% 120% at 30% 20%, #ffe36b 0%, #ffd100 45%, #ffb800 100%) !important;

  /* 살짝 그림자 */
  box-shadow:
    0 12px 26px rgba(255, 209, 0, .32),
    inset 0 1px 0 rgba(255,255,255,.45);

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

/* 버튼 안의 흰색 아이콘 (텍스트 없이 아이콘만) */
#finalMessage .actions #replayBtn::before{
  content: "↻";
  color: #fff;           /* ← 아이콘을 흰색으로 */
  font-size: 22px;       /* 아이콘 크기 */
  line-height: 1;
  font-weight: 700;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.15));
}

/* hover / active 피드백 */
#finalMessage .actions #replayBtn:hover{
  transform: translateY(-1px);
  box-shadow:
    0 16px 30px rgba(255, 209, 0, .36),
    inset 0 1px 0 rgba(255,255,255,.55);
}
#finalMessage .actions #replayBtn:active{
  transform: translateY(1px) scale(.98);
  filter: brightness(.96);
  box-shadow:
    0 10px 18px rgba(255, 209, 0, .28),
    inset 0 1px 0 rgba(255,255,255,.35);
}

/* 모바일: 더 작게 */
@media (max-width: 480px){
  #finalMessage .actions #replayBtn{
    width: 35px;
    height: 35px;
  }
  #finalMessage .actions #replayBtn::before{
    font-size: 18px;
  }
}


/* ===== 라면 추천(깔끔 버전) ===== */
.ramen-box{
  display:flex; flex-direction:column; align-items:center;
  gap:10px; margin-bottom:18px; animation:fadeIn .6s ease both;
}
.ramen-badge{
  padding:8px 14px; border-radius:999px; font-size:.9rem; font-weight:700;
  color:#fff; background:linear-gradient(90deg,#ffd100,#e2231a);
  box-shadow:0 4px 10px rgba(226,35,26,.25);
}
.ramen-card{ background:none !important; box-shadow:none !important; padding:0 !important; border:none !important; }
.ramen-img{ width:160px; height:auto; display:block; filter:none !important; box-shadow:none !important; border-radius:0 !important; }
.ramen-name{ font-size:1.1rem; font-weight:700; color:#111 }

/* ===== 인트로 안내 문구 ===== */
.intro-hint{
  position:fixed; bottom:20vh; left:50%; transform:translateX(-50%);
  font-size:1.05rem; font-weight:500; color:rgba(0,0,0,.65);
  background:rgba(255,255,255,.6); padding:6px 14px; border-radius:999px;
  box-shadow:0 3px 10px rgba(0,0,0,.08);
  animation:hintFade 2.6s ease-in-out infinite alternate;
  z-index:99;
}
@keyframes hintFade{
  0%{opacity:.5; transform:translateX(-50%) translateY(0)}
  100%{opacity:1; transform:translateX(-50%) translateY(-3px)}
}

/* ===== 모바일 ===== */
@media (max-width:480px){
  body{ padding:0 !important }
  .site-header{ top:max(10px, env(safe-area-inset-top)); left:12px }
  .brand-logo{ height:70px }

  .intro-media{ width:100vw !important; height:100dvh !important; padding:0 !important }
  .intro-gif{
    width:100vw !important; height:100dvh !important;
    max-width:none !important; max-height:none !important;
    object-fit:cover !important; object-position:center !important;
  }
  .ramen-img{ width:140px }
  .ramen-badge{ font-size:.85rem; padding:6px 10px }

  .intro-hint{
    bottom:calc(20vh + env(safe-area-inset-bottom, 0px)) !important;
    font-size:1rem; background:rgba(255,255,255,.7)
  }
}

/* 전역 폰트 통일 */
*,
button,
input,
select,
textarea,
.pill,
.question,
.message-card,
.ramen-name,
.ramen-badge,
.site-header,
.intro-hint {
  font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif !important;
}

