* {
  box-sizing: border-box;
}

:root {
  --pink-50: #fff6f9;
  --pink-100: #ffe8f0;
  --pink-200: #ffd4e3;
  --pink-400: #ee7fa0;
  --pink-600: #d83e68;
  --red-bg: #fff0f5;
  --red-line: #f3a5bc;
  --blue-100: #eaf1ff;
  --blue-300: #9db7f1;
  --blue-600: #4d76d9;
  --blue-bg: #eef5ff;
  --blue-line: #a9c0f4;
  --purple-100: #f5eaff;
  --purple-400: #a06aca;
  --gold: #d8a85e;
  --ink: #3f3034;
  --muted: #9b858c;
  --card: rgba(255, 255, 255, 0.86);
  --line: rgba(211, 152, 166, 0.28);
  --shadow: 0 22px 60px rgba(181, 99, 121, 0.18);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 78% 16%, rgba(255, 228, 239, 0.75), transparent 28%),
    linear-gradient(135deg, #fff7f9 0%, #ffeef5 42%, #fff8fb 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
  background-image:
    radial-gradient(circle, rgba(219, 163, 83, 0.42) 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1.4px, transparent 2.4px);
  background-size: 130px 130px, 180px 180px;
  background-position: 30px 40px, 90px 10px;
}

.curtain {
  position: fixed;
  top: 0;
  width: min(260px, 28vw);
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
}

.curtain-left {
  left: 0;
}

.curtain-right {
  right: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 34px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.title-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.crown {
  width: 74px;
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(185, 110, 125, 0.22));
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 80px);
  letter-spacing: -0.06em;
  line-height: 1;
  color: #dd5f84;
  text-shadow:
    0 2px 0 #fff,
    0 7px 22px rgba(201, 87, 117, 0.28);
}

.title-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.title-deco span {
  display: block;
  width: 130px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218, 112, 137, 0.8), transparent);
}

.title-deco img {
  width: 42px;
}

.subtitle {
  margin: 10px 0 0;
  color: #b06e82;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: stretch;
}

.calendar-card,
.message-card,
.important-card,
.guide-card {
  border: 1px solid rgba(220, 170, 183, 0.42);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.calendar-card {
  border-radius: 26px;
  padding: 28px 24px 22px;
}

.calendar-top {
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.month-btn {
  border: 1px solid rgba(220, 160, 176, 0.4);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 14px 18px;
  color: #5a454b;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(179, 92, 116, 0.13);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.month-btn:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 16px 28px rgba(179, 92, 116, 0.2);
}

.month-btn:active {
  transform: translateY(0);
}

.arrow {
  font-size: 28px;
  line-height: 0;
  vertical-align: -2px;
}

.month-title {
  text-align: center;
}

.month-title .mini-label {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.month-title h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.small-line {
  margin-top: 6px;
  color: #df90a8;
  font-weight: 800;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: rgba(255, 246, 249, 0.75);
}

.weekdays div {
  min-height: 48px;
  display: grid;
  place-items: center;
  font-weight: 900;
  border-right: 1px solid var(--line);
}

.weekdays div:last-child {
  border-right: 0;
}

.weekdays .sun {
  color: var(--pink-600);
}

.weekdays .sat {
  color: #704cc4;
}

.calendar-grid {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}

.day {
  position: relative;
  min-height: 112px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.day:nth-child(7n) {
  border-right: 0;
}

.date-number {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 800;
}

.other-month .date-number {
  color: #c9bdc0;
}

.sunday .date-number {
  color: var(--pink-600);
}

.saturday .date-number {
  color: #704cc4;
}

.period-red {
  background:
    linear-gradient(145deg, rgba(255, 240, 246, 0.96), rgba(255, 218, 231, 0.86)),
    rgba(255,255,255,0.75);
  box-shadow: inset 0 0 0 2px rgba(216, 62, 104, 0.15);
}

.period-blue {
  background:
    linear-gradient(145deg, rgba(240, 246, 255, 0.98), rgba(218, 230, 255, 0.86)),
    rgba(255,255,255,0.75);
  box-shadow: inset 0 0 0 2px rgba(77, 118, 217, 0.15);
}

.period-red .date-number {
  color: var(--pink-600);
  background: #fff8fb;
  border: 1px solid rgba(216, 62, 104, 0.35);
  box-shadow: 0 8px 16px rgba(216, 62, 104, 0.12);
}

.period-blue .date-number {
  color: var(--blue-600);
  background: #f8fbff;
  border: 1px solid rgba(77, 118, 217, 0.35);
  box-shadow: 0 8px 16px rgba(77, 118, 217, 0.12);
}

.period-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: block;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
}

.period-red .period-label {
  color: var(--pink-600);
}

.period-blue .period-label {
  color: var(--blue-600);
}

.period-start::before {
  content: "시작";
  position: absolute;
  top: 12px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: #c27b30;
  border: 1px solid rgba(216, 168, 94, 0.36);
  font-size: 11px;
  font-weight: 950;
}

.period-end::after {
  content: "끝";
  position: absolute;
  top: 12px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: #8f7280;
  border: 1px solid rgba(160, 120, 135, 0.28);
  font-size: 11px;
  font-weight: 950;
}

.today .today-label {
  position: absolute;
  top: 12px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff2c7;
  color: #a56f00;
  font-size: 11px;
  font-weight: 950;
  z-index: 2;
}

.period-start.today .today-label,
.period-end.today .today-label {
  top: 38px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 15px 18px;
  border: 1px solid rgba(220, 160, 176, 0.25);
  border-radius: 16px;
  background: rgba(255, 250, 252, 0.8);
  color: #856570;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-block;
}

.legend-dot.red {
  background: var(--pink-600);
}

.legend-dot.blue {
  background: var(--blue-600);
}

.legend p {
  margin: 0 0 0 auto;
  font-size: 14px;
  color: #9d858c;
}

.side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.message-card,
.important-card,
.guide-card {
  border-radius: 22px;
}

.message-card {
  min-height: 220px;
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.message-card::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(217, 159, 104, 0.5);
  border-radius: 999px;
}

.message-card img {
  width: 58px;
  z-index: 1;
}

.message-card p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  line-height: 1.7;
  font-size: 17px;
  font-weight: 800;
  color: #71535c;
}

.important-card {
  position: relative;
  overflow: hidden;
}

.card-ribbon {
  position: absolute;
  top: -8px;
  right: 14px;
}

.card-ribbon img {
  width: 54px;
}

.important-card h3,
.guide-card h3 {
  margin: 0;
  font-size: 18px;
  color: #8550a8;
}

.important-card h3 {
  padding: 18px 22px;
  background: linear-gradient(90deg, #f8eafd, #fff5fb);
  border-bottom: 1px solid rgba(198, 146, 211, 0.28);
}

.period-list {
  padding: 18px 22px 22px;
  display: grid;
  gap: 12px;
}

.period-item {
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(220, 160, 176, 0.25);
  background: rgba(255, 255, 255, 0.65);
}

.period-item.red {
  border-color: rgba(216, 62, 104, 0.22);
  background: rgba(255, 240, 246, 0.72);
}

.period-item.blue {
  border-color: rgba(77, 118, 217, 0.22);
  background: rgba(240, 246, 255, 0.78);
}

.period-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.period-item.red strong {
  color: var(--pink-600);
}

.period-item.blue strong {
  color: var(--blue-600);
}

.period-item span {
  display: block;
  color: #7f6d74;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.guide-card {
  position: relative;
  padding: 20px 20px 26px;
  overflow: hidden;
}

.guide-card ol {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.guide-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #675158;
  font-size: 14px;
  font-weight: 800;
}

.guide-card li span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #ffd9e6;
  color: #cc4169;
  font-size: 13px;
}

.guide-card .heart {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 48px;
  opacity: 0.8;
}

.footer {
  text-align: center;
  margin-top: 22px;
  color: #d36f8d;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.footer span {
  color: var(--gold);
  margin: 0 10px;
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .message-card {
    min-height: 190px;
  }

  .calendar-top {
    grid-template-columns: 1fr;
  }

  .month-btn {
    width: 100%;
  }

  #prevMonth {
    order: 2;
  }

  .month-title {
    order: 1;
  }

  #nextMonth {
    order: 3;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, 1280px);
    padding-top: 30px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .calendar-card {
    padding: 18px 12px;
  }

  .weekdays div {
    min-height: 40px;
  }

  .day {
    min-height: 76px;
    padding: 6px;
  }

  .date-number {
    min-width: 28px;
    height: 28px;
    font-size: 17px;
  }

  .period-label {
    display: none;
  }

  .period-start::before,
  .period-end::after,
  .today .today-label {
    display: none;
  }

  .legend p {
    margin-left: 0;
  }

  .title-deco span {
    width: 78px;
  }
}
