/* Kucanto 홈 · 음성 화면 (시안 1~3번) */

:root {
  /* 팔레트: Ice Silver #DDE3E8 · Deep Aubergine #3A0F34 · Marigold #EAAA00
     마리골드 위 글자는 아우베르진(--accent-ink), 밝은 바탕 위 강조 글자는 진한 금색(--accent-deep) */
  --bg: #f7f5f5;
  --surface: #ffffff;
  --line: #dcd9d9;
  --ink: #2a2a2a;
  --ink-2: #3d3d3d;
  --ink-3: #5a5a5a;
  --accent: #e10600;
  --accent-ink: #ffffff;
  --accent-deep: #9a0500;
  --accent-soft: #f4d9d6;
  --night: #141416;
  --night-ink: #f4f1ec;
  --night-ink-2: #a7a29a;
  --radius: 18px;
  /* 클레이: 빛은 왼쪽 위에서. 바깥 그림자(아래·오른쪽) + 안쪽 어두운 면(아래·오른쪽) + 안쪽 하이라이트(위·왼쪽) */
  --clay-sh: rgba(70, 70, 70, 0.22);
  --clay-in: rgba(70, 70, 70, 0.12);
  --clay-hi: rgba(255, 255, 255, 0.95);
  --clay: 9px 11px 22px var(--clay-sh), inset -6px -6px 12px var(--clay-in), inset 6px 6px 12px var(--clay-hi);
  --clay-sm: 5px 6px 12px rgba(70, 70, 70, 0.2), inset -3px -3px 7px var(--clay-in), inset 3px 3px 7px var(--clay-hi);
  --clay-well: inset 4px 4px 9px rgba(70, 70, 70, 0.2), inset -4px -4px 9px rgba(255, 255, 255, 0.9);
  --clay-orange: inset -7px -8px 14px rgba(110, 0, 0, 0.3), inset 7px 8px 14px rgba(255, 255, 255, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* 브라우저 기본 표면도 색에 맞춘다 */
::selection { background: var(--accent-soft); color: var(--ink); }
input { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:focus-visible, a:focus-visible { border-radius: inherit; }

/* ---------- 앱 틀 ---------- */
/* 폰: 화면 전체. 넓은 화면: 가운데 폰 크기(390×844) 틀, 바깥은 다른 색으로 구분한다.
   홈은 틀 안에서 스크롤하고, 탭바와 음성 화면은 틀 기준으로 붙는다. */

.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 560px) {
  body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: #e2dede;
  }
  .app {
    width: 390px;
    height: min(844px, calc(100vh - 48px));
    border-radius: 40px;
    box-shadow: 0 0 0 1px rgba(60, 60, 60, 0.08), 0 30px 80px rgba(60, 60, 60, 0.22);
  }
}

/* ---------- 1. 홈 ---------- */

.home::-webkit-scrollbar { display: none; }

.home {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none; /* 폰처럼 스크롤바를 숨긴다 */
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

/* 로고 u 위의 주황 붓터치 */
.logo-u { position: relative; }
.logo-u::before {
  content: "";
  position: absolute;
  left: -2px;
  right: -3px;
  top: -3px;
  height: 5px;
  border-radius: 6px 2px 6px 2px;
  background: var(--accent);
  transform: rotate(-8deg);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-2);
}
.icon-btn:hover { background: rgba(60, 60, 60, 0.06); }

.greet {
  margin: 28px 0 24px;
  font-size: 26px;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(60, 60, 60, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ask:focus-within {
  border-color: #e0807a;
  box-shadow: 0 6px 24px rgba(225, 6, 0, 0.22);
}
.ask input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.ask input::placeholder { color: var(--ink-3); }

.mic-fab {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.4);
  transition: transform 0.2s var(--ease);
}
.mic-fab:active { transform: scale(0.94); }

.hint {
  min-height: 18px;
  margin: 8px 4px 4px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.hint.err { color: #9a0500; }

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.chip:hover { background: #fff; }

.sec-title {
  margin: 32px 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.item:hover { box-shadow: 0 8px 22px rgba(60, 60, 60, 0.09); }
.item:active { transform: scale(0.99); }

.chip-ico { width: 18px; height: 18px; color: var(--accent); }
.thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f0403a, #e10600);
  box-shadow: 3px 4px 8px rgba(225, 6, 0, 0.35), var(--clay-orange);
}

.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 700; }
.item-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-arrow { flex: none; color: var(--ink-3); }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: 2px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.empty { font-size: 13px; color: var(--ink-3); padding: 8px 4px; }

/* 하단 탭 */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 0;
  font-size: 11px;
  color: var(--ink-3);
  text-decoration: none;
}
.tab.on { color: var(--ink); font-weight: 600; }
.tab.off { opacity: 0.5; cursor: default; }

/* ---------- 2·3. 음성 화면 ---------- */

.voice {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(20px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  background: var(--night);
  color: var(--night-ink);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.35s;
}
.voice.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease), visibility 0s;
}

/* 음성 화면은 모달이 아니라 화면 전환이다: 넓은 화면에서도 전체를 덮고, 내용만 가운데 폭으로 둔다 */
.voice-top { display: flex; align-self: stretch; }

.voice-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--night-ink);
}
.voice-close:hover { background: rgba(255, 255, 255, 0.08); }

.voice-text {
  margin-top: 28px;
  min-height: 84px;
  text-align: center;
}
.voice-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  white-space: pre-line;
  color: var(--night-ink);
}
.voice-quote {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--night-ink);
  word-break: keep-all;
}
.voice-quote.placeholder { color: var(--night-ink-2); font-weight: 500; }
.voice[data-mode="think"] .voice-quote { display: none; }
.voice[data-mode="think"] .voice-title { font-size: 18px; font-weight: 600; line-height: 1.45; }

/* 가운데 불꽃 캐릭터: 남는 높이를 모두 쓴다. 불빛·불티가 잘리지 않게 좌우 여백까지 넓힌다 */
.stage {
  position: relative;
  flex: 1;
  width: calc(100% + 48px);
  margin: 0 -24px;
  min-height: 260px;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.voice-bottom {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.voice-mic {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.voice-mic:active { transform: scale(0.94); }
.voice[data-mode="think"] .voice-mic { opacity: 0.55; pointer-events: none; }

.voice-state {
  margin: 0;
  font-size: 13px;
  color: var(--night-ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .voice, .voice.open { transition: none; }
}

/* ---------- 상단 배너 ---------- */

.banner { margin: 8px -20px 22px; }
.banner-track {
  display: flex;
  gap: 10px;
  padding: 6px 20px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  width: 82%;
  height: 176px;
  padding: 16px 18px;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  scroll-snap-align: start;
  background: #ececec;
  box-shadow: 6px 8px 16px rgba(70, 70, 70, 0.24);
}
.banner-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30, 14, 6, 0.78) 0%, rgba(30, 14, 6, 0.25) 55%, rgba(30, 14, 6, 0) 100%);
}
.banner-label, .banner-title { position: relative; z-index: 1; }
.banner-label { font-size: 12.5px; font-weight: 600; opacity: 0.95; }
.banner-title { font-size: 21px; line-height: 1.3; font-weight: 700; letter-spacing: -0.03em; word-break: keep-all; max-width: 90%; }
.banner-dots { display: flex; justify-content: center; gap: 5px; }
.banner-dots i { width: 14px; height: 4px; border-radius: 2px; background: #d6d3d3; transition: width 0.3s var(--ease), background 0.3s; }
.banner-dots i.on { width: 26px; background: var(--accent); }

/* 목록 썸네일은 사진 */
.thumb { overflow: hidden; background: #ececec; box-shadow: 3px 4px 8px rgba(70, 70, 70, 0.2); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rank { flex: none; width: 18px; font-size: 15px; font-weight: 700; color: var(--accent-deep); text-align: center; }
.top10 .sec-title { margin-top: 8px; }

/* 섹션 사이 두꺼운 회색 구분 띠 (화면 폭 전체) */
.top10 { margin-top: 28px; }
.top10::before { content: ""; display: block; height: 8px; margin: 0 -20px 24px; background: #e6e3e3; }
.top10 .sec-title { margin-top: 0; }

.banner-slide { border-radius: 6px; }

/* 가운데 정렬: 양옆 여백을 (100% - 카드폭) / 2 로 두고 카드가 가운데에 멈추게 한다 */
.banner-track { padding-left: 9%; padding-right: 9%; scroll-padding: 0; }
.banner-slide { scroll-snap-align: center; scroll-snap-stop: always; }

.banner { margin-bottom: 40px; }

/* 종류별 바로가기 */
.banner { margin-bottom: 30px; }
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 26px 0 28px; }
.cat { display: grid; justify-items: center; gap: 8px; padding: 0; border: 0; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cat-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: var(--accent-soft); color: #2a2a2a; transition: transform 0.18s var(--ease), background 0.18s; }
.cat:active .cat-ico { transform: scale(0.94); }
.hint { min-height: 0; margin: 6px 4px 0; }
.hint:empty { display: none; }

/* 섹션 제목 줄 + 더보기 */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; }
.more { font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; font-family: inherit; }
.more::after { content: " ›"; }
.top10 { margin-bottom: 8px; }
.top-all { margin-top: 18px; }

.tag { color: #2a2a2a; }
.mic-fab { color: var(--accent-ink); }

/* 종류별 바로가기: 박스 없이 아이콘만 */
.cat-ico { width: 44px; height: 44px; background: transparent; }
.cat-ico svg { width: 34px; height: 34px; }
.cat:active .cat-ico { transform: scale(0.9); }

.banner-dots i { background: #d6d3d3; }
.banner-dots i.on { background: var(--accent); }

.cat-ico { width: 52px; height: 52px; }
.cat-ico svg { width: 48px; height: 48px; }

.cat-ico { width: 48px; height: 48px; }
.cat-ico svg { width: 44px; height: 44px; }

.cat-ico { width: 56px; height: 56px; }
.cat-ico img { display: block; width: 56px; height: 56px; object-fit: contain; }

/* 별점 */
.stars { display: inline-flex; align-items: center; gap: 2px; }
.star { width: 13px; height: 13px; fill: #d4d1d1; }
.star.on { fill: var(--accent); }
.star-num { margin-left: 5px; font-size: 12px; color: var(--ink-2); font-weight: 600; }

.kuma-replies { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.kuma-replies[hidden] { display: none; }
.kuma-reply { padding: 10px 16px; border: 1.5px solid rgba(255, 255, 255, 0.8); border-radius: 10px; background: transparent; color: #fff; font: 700 14px/1 inherit; cursor: pointer; }
.kuma-reply:active { transform: scale(0.96); }

/* 쿠마 인사 화면의 입력줄 (어두운 바탕: 흰 글자·흰 선). cook.css 의 .chat-form 보다 늦게 읽혀도 이기도록 클래스를 겹쳐 쓴다 */
.chat-form.kuma-chat { width: min(420px, 100%); margin: 0 auto 14px; border-bottom-color: rgba(255, 255, 255, 0.7); }
.chat-form.kuma-chat[hidden] { display: none; }
.chat-form.kuma-chat:focus-within { border-bottom-color: #fff; }
.chat-form.kuma-chat input { color: rgba(255, 255, 255, 0.7); caret-color: #fff; font-size: 16px; }
.chat-form.kuma-chat input::placeholder { color: rgba(255, 255, 255, 0.7); }
.chat-form.kuma-chat input::selection { background: rgba(255, 255, 255, 0.35); color: #fff; }
.chat-form.kuma-chat .chat-icon { border-color: rgba(255, 255, 255, 0.6); color: #fff; }
