/* EOTM(comic.css) 팔레트 이식 — 잉크 #2a2330 · 크림 종이 #f6f1e9 · 페이지 #e8e4da · 레드 #b3312f · 골드 #f2b01e */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --page: #e8e4da;      /* 페이지 배경 */
  --paper: #f6f1e9;     /* 본문 종이 */
  --paper-2: #fbf9f4;   /* 밝은 종이 (바·카드) */
  --ink: #2a2330;       /* 잉크 (텍스트·테두리) */
  --muted: #6e6878;     /* 흐린 잉크 */
  --tan: #f0e4cc;       /* 내 말풍선 */
  --tan-text: #8a6b42;
  --dim-ink: #4a4454;   /* 배경과 구분되는 보조 텍스트 */
  --red: #b3312f;
  --gold: #f2b01e;
  --gold-deep: #a5813f;
  --green: #3e8e5a;
}

html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Nanum Gothic", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
}

#app {
  height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
#title { font-family: "NanumSquare", "Nanum Gothic", sans-serif; font-weight: 800; font-size: 23px; color: var(--ink); white-space: nowrap; }
#mandate { font-size: 13px; color: var(--dim-ink); font-weight: 700; word-break: keep-all; line-height: 1.5; }

#suitor-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 2px solid var(--ink);
  background: var(--tan);
}
#status { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#status-line1 { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
#suitor-label { font-family: "NanumSquare", "Nanum Gothic", sans-serif; font-weight: 800; font-size: 16px; word-break: keep-all; }
#progress { color: var(--dim-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
#suitor-dowry { color: var(--dim-ink); font-size: 14px; font-weight: 700; word-break: keep-all; line-height: 1.5; }
#actions { display: flex; gap: 8px; align-self: flex-start; flex-shrink: 0; }
#actions button { padding: 4px 12px; font-size: 13px; }

/* 좁은 화면: 텍스트는 좌측 열에서 줄바꿈, 버튼은 우측 상단 고정 (겹침 금지) */
@media (max-width: 520px) {
  #topbar { padding: 10px 14px; }
  #title { font-size: 20px; }
  #suitor-bar { gap: 8px; }
  .scene { font-size: 11px; }
}

button {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 6px 13px;
  font-weight: 700;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--tan); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.danger { color: #fff; background: var(--red); border-color: var(--ink); }
button.danger:hover:not(:disabled) { background: #9a2624; }
button.primary { color: var(--ink); background: var(--gold); border-color: var(--ink); }
button.primary:hover:not(:disabled) { background: #dfa011; }

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-col { max-width: 78%; display: flex; flex-direction: column; }
.msg-row.mine .msg-col { align-items: flex-end; }
.speaker { font-size: 12px; color: var(--dim-ink); font-weight: 700; margin: 0 4px 3px; }
.bubble {
  padding: 9px 13px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--ink);
  border-bottom-left-radius: 4px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.msg-row.mine .bubble {
  background: var(--tan);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}

.narration {
  text-align: center;
  color: #575060;
  font-size: 14px;
  padding: 3px 20px;
  line-height: 1.7;
}
.scene {
  text-align: center;
  color: var(--red);
  font-family: "NanumSquare", "Nanum Gothic", sans-serif;
  font-size: 14pt;
  font-weight: 800;
  margin: 10px 0;
  line-height: 1.6;
}
.system { text-align: center; color: var(--red); font-size: 12px; font-weight: 700; }

.continue-hint {
  text-align: center;
  color: var(--dim-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  cursor: pointer;
  animation: hintPulse 1.4s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.report {
  align-self: center;
  width: 92%;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 6px 0;
  box-shadow: 3px 3px 0 rgba(42, 35, 48, 0.15);
}
.report h3 {
  font-size: 12px;
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 3px 10px;
  margin-bottom: 9px;
  letter-spacing: 0.02em;
}
.report .value { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.report .value.high { color: var(--green); }
.report .value.mid { color: var(--gold-deep); }
.report .value.low { color: var(--red); }
.report .fact { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.report p { color: var(--ink); line-height: 1.7; font-size: 13px; margin-top: 6px; }
.report table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.report td { padding: 5px 6px; border-top: 1px solid #d9cfbd; vertical-align: top; line-height: 1.6; }
.report td.num { text-align: right; font-weight: 800; white-space: nowrap; }
.report td.num.high { color: var(--green); }
.report td.num.mid { color: var(--gold-deep); }
.report td.num.low { color: var(--red); }
.report td.name { white-space: nowrap; font-weight: 700; }
.report .met { color: var(--muted); font-size: 11px; font-weight: 400; }

.typing .bubble { color: var(--muted); }

#suggests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 0;
  border-top: 2px solid var(--ink);
  background: var(--paper-2);
}
#suggests:empty { display: none; }
#suggests .chip {
  font-size: 12.5px;
  font-weight: 400;
  padding: 5px 11px;
  border-radius: 14px;
  border: 1.5px solid var(--ink);
  background: #fff;
  text-align: left;
  line-height: 1.4;
}
#suggests .chip:hover:not(:disabled) { background: var(--tan); }

#composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--paper-2);
}
#suggests + #composer { border-top: 0; }
#suggests:empty + #composer { border-top: 2px solid var(--ink); }
#input {
  flex: 1;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
}
#input:focus { box-shadow: 0 0 0 3px var(--gold); }
#btn-say { background: var(--gold); }
#btn-say:hover:not(:disabled) { background: #dfa011; }
