:root {
  --bg-deep: #080b1a;
  --bg-mid: #13213d;
  --bg-soft: #243b63;
  --panel: rgba(7, 10, 24, 0.74);
  --panel-border: rgba(255, 255, 255, 0.13);
  --text: #f6f1e4;
  --muted: #d1c7b1;
  --accent: #ffe6a6;
  --accent-strong: #f7c96a;
  --danger: #d76363;
  --danger-soft: rgba(215, 99, 99, 0.15);
  --shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, #21335f 0%, transparent 42%),
    radial-gradient(circle at 84% 20%, #33456f 0%, transparent 35%),
    radial-gradient(circle at 70% 78%, #1f2f52 0%, transparent 45%), linear-gradient(165deg, var(--bg-mid), var(--bg-deep) 65%);
}

body.night-deep {
  background: radial-gradient(circle at 12% 8%, #172748 0%, transparent 36%),
    radial-gradient(circle at 86% 18%, #202f56 0%, transparent 33%),
    radial-gradient(circle at 69% 76%, #13223f 0%, transparent 40%), linear-gradient(170deg, #0a1026, #050811 70%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  margin: 0;
  font-family: "MaruBuri", "Nanum Myeongjo", "Times New Roman", serif;
  letter-spacing: 0.02em;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
}

.tagline {
  color: var(--muted);
  font-size: 0.92rem;
}

.chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(247, 201, 106, 0.18);
  color: #ffe7b2;
  font-size: 0.75rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.sky-panel {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  isolation: isolate;
}

.sky-panel::before,
.sky-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sky-panel::before {
  background-image: radial-gradient(1px 1px at 20% 22%, rgba(255, 255, 255, 0.74), transparent),
    radial-gradient(1px 1px at 79% 35%, rgba(255, 255, 255, 0.63), transparent),
    radial-gradient(1.3px 1.3px at 58% 72%, rgba(255, 255, 255, 0.66), transparent),
    radial-gradient(1px 1px at 90% 82%, rgba(255, 255, 255, 0.61), transparent),
    radial-gradient(1px 1px at 32% 87%, rgba(255, 255, 255, 0.6), transparent);
  opacity: 0.7;
  z-index: -2;
}

.sky-panel::after {
  background: radial-gradient(circle at center, rgba(255, 225, 164, 0.08), transparent 65%);
  z-index: -1;
}

.sky-canvas {
  position: absolute;
  inset: 0;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.empty-state h2 {
  margin: 0;
  font-family: "MaruBuri", "Nanum Myeongjo", serif;
  font-size: 1.4rem;
}

.empty-state p {
  margin: 0;
  max-width: 32ch;
  line-height: 1.5;
}

.star {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle at 30% 28%, #fff7df 0%, #ffe8bb 40%, rgba(255, 209, 143, 0.36) 100%);
  box-shadow: 0 0 24px rgba(255, 221, 167, 0.34);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.star::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: inherit;
  pointer-events: none;
}

.star:hover,
.star:focus-visible {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 32px rgba(255, 226, 170, 0.55);
  outline: none;
}

.star.anniversary {
  box-shadow: 0 0 34px rgba(255, 223, 145, 0.82);
}

.star.twinkle {
  animation: twinkle 1.2s ease-in-out 3;
}

@keyframes twinkle {
  0%,
  100% {
    filter: brightness(0.95);
    box-shadow: 0 0 18px rgba(255, 218, 154, 0.35);
  }
  45% {
    filter: brightness(1.45);
    box-shadow: 0 0 40px rgba(255, 231, 182, 0.86);
  }
}

.tooltip {
  position: absolute;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(5, 7, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 230px;
  pointer-events: none;
  transform: translate(-50%, -112%);
  color: #fff6df;
  font-size: 0.85rem;
  line-height: 1.4;
}

.tooltip strong {
  display: block;
  margin-bottom: 2px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 18px;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  background: rgba(9, 12, 29, 0.48);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  font-family: "MaruBuri", "Nanum Myeongjo", serif;
}

.field-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  padding: 10px 12px;
  background: rgba(3, 4, 11, 0.55);
  color: var(--text);
}

input:focus,
textarea:focus {
  border-color: rgba(255, 223, 147, 0.7);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.btn {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  padding: 10px 13px;
  font-weight: 600;
  transition: transform 180ms ease, opacity 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #2f2209;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
}

.btn.danger {
  background: var(--danger-soft);
  color: #ffd7d7;
  border: 1px solid rgba(240, 125, 125, 0.4);
}

.mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.mini-item {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 7, 18, 0.62);
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mini-item button {
  border: 0;
  background: transparent;
  color: #ffe5ac;
  cursor: pointer;
}

.detail-layout {
  min-height: 78vh;
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-title {
  margin: 0;
  font-family: "MaruBuri", "Nanum Myeongjo", serif;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem);
}

.detail-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.record-box {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  background: rgba(6, 9, 19, 0.62);
  display: grid;
  gap: 10px;
}

.record-box p {
  margin: 0;
  color: var(--muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(5, 8, 18, 0.58);
  padding: 11px 13px;
  display: grid;
  gap: 6px;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #ffe7b2;
  font-size: 0.86rem;
}

.timeline-item p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.timeline-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

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

  .sky-panel {
    min-height: 58vh;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    padding: 12px;
  }

  .side-panel,
  .detail-layout {
    padding: 14px;
  }

  .chip {
    display: none;
  }
}
