:root {
  --accent: #c51236;
  --accent-dark: #970d29;
  --ink: #242428;
  --muted: #73737d;
  --line: #ececef;
  --paper: #ffffff;
  --soft: #f7f5f3;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 13px max(18px, env(safe-area-inset-left));
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255,255,255,.16);
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
}

.site-header h1 { margin: 0; font-size: 21px; }
.site-header p { margin: 2px 0 0; font-size: 12px; opacity: .82; }

.page-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 14px calc(32px + env(safe-area-inset-bottom));
}

.hero-card,
.form-card,
.result-card {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(30,20,20,.05);
}

.hero-card { margin-bottom: 24px; }
.hero-card h2 { margin: 6px 0 7px; font-size: 23px; letter-spacing: -.04em; }
.hero-card p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 11px;
}

.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.menu-grid { display: grid; gap: 10px; }

.fortune-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.fortune-card:active { transform: scale(.99); }
.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  height: 50px;
  border-radius: 15px;
  color: #fff;
  background: var(--accent);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.card-copy strong { font-size: 16px; }
.card-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.arrow { color: #aaa; font-size: 28px; }
.notice { margin: 22px 4px 0; color: var(--muted); font-size: 12px; text-align: center; }

.page-title { margin: 2px 0 15px; font-size: 24px; letter-spacing: -.04em; }
.back-link { display: inline-flex; margin-bottom: 10px; color: var(--accent); font-size: 14px; font-weight: 700; }
.person-block + .person-block { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.person-block h2 { margin: 0 0 14px; font-size: 17px; }
.field { margin-top: 15px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.radio-row { display: flex; gap: 18px; min-height: 44px; align-items: center; }
.radio-row label { display: inline-flex; gap: 7px; align-items: center; }
.select-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 7px; }
.time-row { grid-template-columns: 1fr 1fr 1.35fr; }

select,
button {
  min-height: 46px;
  border-radius: 11px;
  font: inherit;
}

select {
  width: 100%;
  padding: 0 9px;
  border: 1px solid #d9d9df;
  color: var(--ink);
  background: #fff;
}

.submit-button {
  width: 100%;
  margin-top: 24px;
  border: 0;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.submit-button:active { background: var(--accent-dark); }
.result-card { font-size: 15px; line-height: 1.8; white-space: normal; }
.error-card { color: #8d1730; background: #fff7f8; }
.single-select { grid-template-columns: minmax(0, 220px); }
.fortune-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.fortune-section h2 { margin: 0 0 7px; color: var(--accent); font-size: 17px; }
.fortune-section p { margin: 0; }

.legacy-content { overflow: hidden; }
.legacy-content table { width: 100% !important; max-width: 100% !important; }
.legacy-content td { height: auto; padding: 6px 3px; font-family: inherit; font-size: 14px; line-height: 1.55; }
.legacy-content img { max-width: 100%; height: auto; }
.legacy-content form { width: 100%; }
.legacy-content select,
.legacy-content input[type="text"] { max-width: 100%; min-height: 42px; margin: 3px 1px; }
.legacy-content input[type="button"],
.legacy-content input[type="submit"] { min-height: 44px; margin: 4px 1px; padding: 0 12px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); font-weight: 700; }
.legacy-content br + br { line-height: .6; }

@media (min-width: 620px) {
  .page-shell { padding-top: 28px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-card, .form-card, .result-card { padding: 28px; }
}
