:root {
  --bg-top: #0b1026;
  --bg-mid: #151033;
  --bg-bottom: #1f0f3a;
  --text: #eef0ff;
  --text-muted: rgba(238, 240, 255, 0.62);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.22);
  --accent: #9b8cff;
  --accent-soft: rgba(155, 140, 255, 0.45);
  --danger: #ff8ba0;
  --shadow-compose: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(124, 108, 240, 0.15);
  --shadow-view: 0 2px 12px rgba(0, 0, 0, 0.12);
  --radius: 20px;
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.star-burst__particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(220, 230, 255, 0.9);
  animation: particle-rise 1.4s ease-out forwards;
}

@keyframes particle-rise {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0);
  }
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  gap: 1.75rem;
}

.brand {
  text-align: center;
}

.brand__title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-shadow: 0 0 24px rgba(155, 140, 255, 0.35);
}

.brand__tagline {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.card-wrap {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.glass-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
}

/* 조회: 은은한 카드 */
.glass-card--view {
  min-height: 180px;
  padding: 2.25rem 1.75rem 1.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-view);
}

.btn-report {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(200, 55, 85, 0.9);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(232, 106, 136, 0.35);
  transition: transform 0.15s ease, background 0.2s ease;
  z-index: 2;
}

.btn-report:hover:not(:disabled) {
  background: #e86a88;
  transform: scale(1.08);
}

.btn-report:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.note-admin-meta {
  margin-top: 1.15rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  line-height: 1.65;
  color: rgba(238, 240, 255, 0.42);
  letter-spacing: 0.02em;
}

.note-admin-meta span {
  display: block;
}

.glass-card--view .note-text {
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* 작성: 강조 카드 */
.glass-card--compose {
  min-height: 220px;
  padding: 1.35rem 1.5rem 1.25rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-compose);
}

.compose-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.compose-header__icon {
  color: var(--accent);
  font-size: 0.85rem;
  text-shadow: 0 0 12px var(--accent-soft);
}

.compose-header__label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: none;
}

.compose-footer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.glass-card--fly {
  animation: become-star 1.45s cubic-bezier(0.25, 0.9, 0.35, 1) forwards;
  pointer-events: none;
}

@keyframes become-star {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: brightness(1);
    box-shadow: var(--shadow-compose);
  }
  20% {
    transform: scale(1.04) translateY(-12px);
    filter: brightness(1.25);
    box-shadow: 0 0 30px rgba(200, 210, 255, 0.5), var(--shadow-compose);
  }
  45% {
    transform: scale(0.75) translateY(-60px);
    opacity: 1;
    filter: brightness(1.6) drop-shadow(0 0 24px rgba(255, 255, 255, 0.7));
  }
  70% {
    transform: scale(0.35) translateY(-45vh);
    opacity: 0.85;
    filter: brightness(2) drop-shadow(0 0 40px rgba(255, 255, 255, 0.95));
  }
  100% {
    transform: scale(0.02) translateY(-110vh) rotate(12deg);
    opacity: 0;
    filter: brightness(2.5) drop-shadow(0 0 60px #fff);
  }
}

.note-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.note-text--visible {
  opacity: 1;
  transform: translateY(0);
}

.note-text--fade-out {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: 0.45s;
}

.note-input {
  width: 100%;
  min-height: 140px;
  resize: none;
  border: none;
  outline: none;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.8;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.note-input:focus {
  border-color: rgba(155, 140, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.12);
}

.note-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.note-input::placeholder {
  color: rgba(238, 240, 255, 0.35);
}

.char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 1.5rem;
}

.actions-wrap {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  width: 100%;
}

.btn-guide {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.68rem 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  color: rgba(238, 240, 255, 0.38);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.btn-guide:hover {
  color: rgba(238, 240, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.25rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, opacity 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, #7c6cf0, #5a4fd1);
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-soft);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.btn--muted {
  background: transparent;
  border-color: rgba(255, 139, 160, 0.35);
  color: var(--danger);
  font-size: 0.85rem;
}

.btn--muted:hover:not(:disabled) {
  background: rgba(255, 139, 160, 0.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.overlay[hidden] {
  display: none !important;
}

.overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 8, 20, 0.72);
  backdrop-filter: blur(6px);
}

.overlay__panel {
  width: min(420px, 100%);
  min-height: auto;
  text-align: center;
  padding: 1.5rem;
}

.overlay__panel p {
  margin: 0 0 1.25rem;
  line-height: 1.7;
  color: var(--text);
}

/* 이용안내 모달 */
.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.guide-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.guide-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.55);
  backdrop-filter: blur(4px);
}

.guide-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  background: rgba(18, 22, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.guide-modal.is-visible .guide-modal__panel {
  transform: translateY(0);
  opacity: 1;
}

.guide-modal__scroll {
  overflow-y: auto;
  padding: 1.5rem 1.5rem 0.5rem;
  flex: 1;
}

.guide-modal__head {
  margin-bottom: 1.25rem;
  text-align: center;
}

.guide-modal__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: 0.1em;
}

.guide-modal__subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.guide-section {
  margin-bottom: 1.25rem;
}

.guide-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(238, 240, 255, 0.88);
}

.guide-section p,
.guide-section li {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.guide-section ul {
  margin: 0;
  padding-left: 1.1rem;
}

.guide-section li {
  margin-bottom: 0.55rem;
}

.guide-section strong {
  color: rgba(238, 240, 255, 0.78);
  font-weight: 500;
}

.guide-modal__closing {
  margin: 0.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.88rem;
  color: rgba(200, 190, 255, 0.75);
  line-height: 1.7;
  font-style: italic;
}

.guide-modal__close {
  margin: 0 1rem 1rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .glass-card--view,
  .glass-card--compose {
    padding: 1.25rem 1.1rem;
  }

  .actions--primary {
    flex-direction: column;
  }

  .actions--primary .btn {
    width: 100%;
  }

  .compose-actions {
    flex-direction: column-reverse;
  }

  .compose-actions .btn {
    width: 100%;
  }
}
