/* 책상 위 한지 카드. 색 이름은 화면 전체에서 같이 씁니다. */
:root {
  --ink: #241c16;
  --paper: #f6f0e4;
  --paper_deep: #efe4d2;
  --cinnabar: #8f2d2a;
  --pine: #1f4f4a;
  --muted: #6f5e4d;
  --line: #e3d4be;
  --desk: #231910;
  --cream: #fffaf3;
  --seal_color: #8a4b22;
  --line_color: rgba(138, 75, 34, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Nanum Gothic", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  background-color: var(--desk);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(214, 146, 92, 0.22), transparent 34%),
    radial-gradient(circle at 88% 100%, rgba(120, 42, 36, 0.28), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 8px);
}

button,
input {
  font: inherit;
}

.stage {
  width: min(1040px, calc(100% - 32px));
  margin: 36px auto 56px;
}

.hero {
  margin-bottom: 28px;
  color: #f6efe4;
  text-align: center;
}

.brand_seal {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border: 2px solid rgba(246, 239, 228, 0.7);
  border-radius: 50%;
  color: #f6efe4;
  font-family: "Nanum Myeongjo", Batang, serif;
  font-size: 28px;
}

.hero h1 {
  margin: 0;
  font-family: "Nanum Myeongjo", Batang, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 38rem;
  margin: 10px auto 0;
  color: #e4d5c2;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(300px, 1.08fr);
  gap: 22px;
  align-items: stretch;
}

.panel,
.result_card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 28%),
    var(--paper);
  border: 1px solid rgba(255, 248, 236, 0.28);
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.panel {
  padding: 26px 22px 22px;
}

.panel h2,
.card_title {
  margin: 0;
  font-family: "Nanum Myeongjo", Batang, serif;
  letter-spacing: -0.03em;
}

.panel h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.field {
  margin: 0 0 18px;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

fieldset {
  border: 0;
  min-inline-size: 0;
  padding: 0;
}

.field_hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

#age_input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d9c8ae;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
}

.choice_row,
.mood_grid {
  display: grid;
  gap: 8px;
}

.choice_row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mood_grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px;
  border: 1px solid #d9c8ae;
  border-radius: 12px;
  background: rgba(255, 250, 243, 0.7);
  cursor: pointer;
  text-align: center;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.choice span {
  font-weight: 700;
}

.choice:has(input:checked) {
  border-color: var(--cinnabar);
  background: #fff7ef;
  box-shadow: inset 0 0 0 1px var(--cinnabar);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

.message_slot {
  min-height: 3rem;
  margin-bottom: 8px;
}

.form_message,
.status_message {
  margin: 0;
  line-height: 1.5;
}

.form_message {
  color: var(--cinnabar);
  font-weight: 700;
}

.status_message {
  color: var(--pine);
  font-weight: 700;
}

.button {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button_primary {
  border: 0;
  background: var(--cinnabar);
  color: #fff8f2;
  font-weight: 700;
}

.button_primary:hover:not(:disabled) {
  background: #7b2422;
}

.button_row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.button_ghost {
  border: 1px solid #c9b59a;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.button_ghost:hover:not(:disabled) {
  background: rgba(255, 250, 243, 0.8);
}

.button:focus-visible,
#age_input:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

.result_card {
  --seal_color: #8a4b22;
  --line_color: rgba(138, 75, 34, 0.45);
  padding: 14px;
}

.result_card[data-gender="female"] {
  --seal_color: #9c3044;
  --line_color: rgba(156, 48, 68, 0.45);
}

.result_card[data-gender="male"] {
  --seal_color: #1f4f4a;
  --line_color: rgba(31, 79, 74, 0.5);
}

.result_card[data-gender="none"] {
  --seal_color: #8a4b22;
  --line_color: rgba(138, 75, 34, 0.5);
}

.result_frame {
  position: relative;
  height: 100%;
  min-height: 420px;
  padding: 28px 22px 26px;
  border: 1px solid var(--line_color);
  border-radius: 16px;
}

.result_frame::before,
.result_frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line_color);
}

.result_frame::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.result_frame::after {
  right: 8px;
  bottom: 8px;
  border-top: 0;
  border-left: 0;
}

.card_empty {
  margin: 0;
  color: var(--muted);
  font-family: "Nanum Myeongjo", Batang, serif;
  font-size: 1.2rem;
  line-height: 1.8;
}

.card_top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card_date {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card_meta {
  margin: 8px 0 0;
  color: var(--seal_color);
  font-weight: 700;
}

.card_mood {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  margin: 0;
  border: 2px solid var(--seal_color);
  border-radius: 50%;
  color: var(--seal_color);
  font-family: "Nanum Myeongjo", Batang, serif;
  font-weight: 700;
  transform: rotate(-8deg);
}

.card_title {
  margin: 18px 0 8px;
  font-size: 1.8rem;
}

.sentence_label {
  margin: 18px 0 6px;
  color: var(--seal_color);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sentence_lead,
.sentence_caution {
  margin: 0;
  font-family: "Nanum Myeongjo", Batang, serif;
  line-height: 1.85;
}

.sentence_lead {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 700;
}

.sentence_lead:focus {
  outline: none;
}

.sentence_caution {
  color: #4e4034;
  font-size: 1.08rem;
}

.footnote {
  margin: 18px 0 0;
  color: #d9cbb8;
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .stage {
    margin-top: 20px;
  }

  .result_frame {
    min-height: 320px;
  }

  .choice_row,
  .mood_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice_row .choice:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
