:root {
  --bg: #f6f3ee;
  --ink: #211d1b;
  --muted: #746d67;
  --line: #ded6cd;
  --panel: #fffaf4;
  --accent: #155c62;
  --accent-strong: #0d4045;
  --gold: #c88d2a;
  --rose: #b95763;
  --green: #4f7d53;
  --shadow: 0 22px 60px rgba(48, 37, 25, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 18% 22%, rgba(200, 141, 42, 0.16) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 28%, rgba(21, 92, 98, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 62% 82%, rgba(185, 87, 99, 0.15) 0 2px, transparent 3px),
    linear-gradient(135deg, #f8f2e8 0%, #eef5f3 52%, #fbf1f2 100%);
  background-size: 180px 180px, 220px 220px, 200px 200px, auto;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.fortune-panel {
  width: min(100%, 760px);
  position: relative;
}

.fortune-panel::before {
  content: "";
  position: absolute;
  inset: -32px -26px auto auto;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(21, 92, 98, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(21, 92, 98, 0.16) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(21, 92, 98, 0.16) 49% 51%, transparent 52%);
  pointer-events: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 29, 27, 0.13);
  border-radius: 8px;
  background: var(--accent);
  color: #fff9ee;
  font-size: 32px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.input-card,
.result-card {
  border: 1px solid rgba(33, 29, 27, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-card {
  padding: 22px;
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.calendar-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: min(100%, 260px);
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calendar-toggle label {
  min-height: 40px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.calendar-toggle input:checked + label {
  color: #fff;
  background: var(--accent);
}

.calendar-toggle input:focus-visible + label {
  box-shadow: 0 0 0 3px rgba(21, 92, 98, 0.18);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 92, 98, 0.14);
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.result-card {
  padding: 24px;
}

.is-hidden {
  display: none;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.12;
  letter-spacing: 0;
}

.score-badge {
  width: 84px;
  min-width: 84px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #241f1d;
  color: #fffaf4;
  line-height: 1;
}

.score-badge span {
  font-size: 32px;
  font-weight: 900;
}

.score-badge small {
  margin-top: -14px;
  color: rgba(255, 250, 244, 0.75);
  font-weight: 800;
}

.main-message {
  margin-bottom: 10px;
  color: #403934;
  font-size: 18px;
  line-height: 1.65;
}

.result-context {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.fortune-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.fortune-grid article,
.lucky-row > div {
  min-height: 108px;
  border: 1px solid rgba(33, 29, 27, 0.1);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.fortune-grid span,
.lucky-row span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.fortune-grid strong,
.lucky-row strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.42;
}

.fortune-grid article:nth-child(2) strong {
  color: var(--rose);
}

.fortune-grid article:nth-child(3) strong {
  color: var(--gold);
}

.fortune-grid article:nth-child(4) strong {
  color: var(--green);
}

.lucky-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lucky-row > div {
  min-height: 82px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.secondary-button {
  min-width: 118px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(21, 92, 98, 0.24);
  color: var(--accent-strong);
  background: #f3fbf8;
}

.secondary-button:hover {
  color: #fff;
  background: var(--accent);
}

.share-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .app-shell {
    place-items: start center;
    padding-top: 24px;
  }

  .fortune-panel::before {
    width: 108px;
    height: 108px;
    inset: -14px -8px auto auto;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .input-row,
  .fortune-grid,
  .lucky-row {
    grid-template-columns: 1fr;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-header {
    align-items: center;
  }

  .score-badge {
    width: 74px;
    min-width: 74px;
  }
}
