/* core/web: 공통 테마 (크림색, 버터 노랑, 팥 갈색) */
:root {
  --cream: #fff8ec;
  --cream-2: #fdf0d8;
  --paper: #fffdf8;
  --butter: #f6c85f;
  --butter-2: #ffe29a;
  --butter-dark: #e0a92a;
  --bean: #6b3f2a;
  --bean-2: #8a5a3b;
  --ink: #3b2316;
  --ink-2: #7a5a48;
  --guilty: #e5635a;
  --guilty-soft: #fde1dc;
  --innocent: #4c9be8;
  --innocent-soft: #dcecfd;
  --ok: #4caf7a;
  --line: #ecd9b8;
  --shadow: 0 6px 0 #ecd9b8;
  --radius: 22px;
  --font: 'Jua', 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  background-image: radial-gradient(circle at 12px 12px, #f6e6c6 2px, transparent 2.5px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .display { font-family: var(--font); font-weight: 400; margin: 0; }
a { color: var(--bean-2); }
button { font-family: var(--font); }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* 버튼 */
.btn {
  border: 0; cursor: pointer; border-radius: 999px; padding: 12px 22px; font-size: 18px;
  background: var(--butter); color: var(--ink); box-shadow: 0 4px 0 var(--butter-dark);
  transition: transform .08s ease, box-shadow .08s ease, filter .2s; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--butter-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.bean { background: var(--bean); color: #fff8ec; box-shadow: 0 4px 0 #43261a; }
.btn.ghost { background: var(--paper); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.small { padding: 7px 14px; font-size: 15px; }
.link-btn { background: none; border: 0; color: var(--bean-2); cursor: pointer; text-decoration: underline; font-family: var(--font-body); font-size: 15px; padding: 4px; }

/* 카드 */
.card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin: 16px 0;
}
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--cream-2);
  font-size: 13px; color: var(--ink-2); border: 1.5px solid var(--line);
}
.muted { color: var(--ink-2); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }
.big-emoji { font-size: 56px; line-height: 1; }

/* 입력 */
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 17px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; font-family: var(--font-body); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--butter-dark); }
.error-text { color: var(--guilty); font-size: 14px; min-height: 20px; margin: 6px 0; }

/* 모달 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(59, 35, 22, .35); display: flex; align-items: flex-end;
  justify-content: center; z-index: 50; animation: fade-in .18s ease;
}
.modal-overlay.closing { animation: fade-out .18s ease forwards; }
.modal-box {
  background: var(--paper); width: 100%; max-width: 480px; border-radius: 26px 26px 0 0; padding: 24px 20px 28px;
  max-height: 92vh; overflow: auto; animation: slide-up .25s cubic-bezier(.2, .9, .3, 1.2);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 26px; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 60;
  background: var(--bean); color: var(--cream); padding: 12px 20px; border-radius: 999px; font-family: var(--font);
  transition: all .3s ease; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* 마스코트 */
.mascot { display: inline-block; line-height: 0; }
.mascot svg { overflow: visible; }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }
.mascot-gavel { transform-box: fill-box; transform-origin: 50% 100%; }

/* 말풍선 */
.bubble {
  position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px;
  font-family: var(--font); font-size: 17px;
}
.bubble::before {
  content: ''; position: absolute; left: -9px; top: 18px; border: 8px solid transparent; border-right-color: var(--line);
}

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--cream-2), #fff6e4, var(--cream-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 16px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
