:root {
  --bg-top: #f8f4e8;
  --bg-bottom: #efe6d3;
  --ink: #1c2b24;
  --card: rgba(244, 251, 246, 0.92);
  --line: #b8d4c4;
  --accent: #2b7a58;
  --accent-hover: #1f6548;
  --error: #8f1d1d;
  --muted: #dcefe3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.6), transparent 22%),
    radial-gradient(circle at 86% 82%, rgba(255, 255, 255, 0.45), transparent 24%),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.2;
}

.shape-a {
  width: 280px;
  height: 280px;
  background: #d8cab1;
  top: -80px;
  right: -60px;
}

.shape-b {
  width: 360px;
  height: 360px;
  background: #cdbb9b;
  bottom: -140px;
  left: -100px;
}

.container {
  width: min(1100px, 92%);
  margin: 36px auto 48px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(520px, 1.6fr);
  gap: 20px;
}

.hero {
  text-align: center;
  grid-column: 1 / -1;
  animation: fade-up 600ms ease-out;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #6b5f49;
}

h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.subtitle {
  margin: 0;
  color: #6f6250;
}

.card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(6, 30, 20, 0.22);
  animation: fade-up 700ms ease-out;
}

.form-card {
  grid-column: 1;
  align-self: start;
}

.list-card {
  grid-column: 2;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(255, 255, 255, 0.06), transparent 30%),
    linear-gradient(155deg, #2e6a4a, #1f5139);
  border: 1px solid #3d7d5a;
  box-shadow: 0 16px 28px rgba(8, 35, 23, 0.3);
}

.list-card h2 {
  color: #e7f6eb;
}

h2 {
  margin-top: 2px;
  margin-bottom: 14px;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c8decf;
  background: #f9fefb;
}

textarea {
  resize: vertical;
}

button {
  margin-top: 12px;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}

#submitButton {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

#submitButton:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#reloadButton {
  margin-top: 0;
  background: #d5ebdd;
  color: #1f4e37;
  font-weight: 600;
}

#reloadButton:hover {
  background: #c6e2d1;
}

.status {
  min-height: 24px;
  margin-top: 10px;
  font-weight: 600;
}

.error {
  color: #ffd6d6;
  font-weight: 700;
  min-height: 24px;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.note-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 12px;
  min-height: 150px;
  background: #ffe8ad;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.14);
  transform: rotate(-1.2deg);
  position: relative;
  animation: pop-in 260ms ease-out;
}

.note-item::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.note-item:nth-child(4n + 1) {
  background: #ffd9de;
  transform: rotate(-1.8deg);
}

.note-item:nth-child(4n + 2) {
  background: #fff1b8;
  transform: rotate(1.3deg);
}

.note-item:nth-child(4n + 3) {
  background: #cfefff;
  transform: rotate(-0.6deg);
}

.note-item:nth-child(4n + 4) {
  background: #dff7cf;
  transform: rotate(1.9deg);
}

.note-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.note-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.note-time {
  color: #4a5e55;
  font-size: 0.86rem;
}

.note-message {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.empty {
  text-align: center;
  color: #e3f2e8;
  padding: 16px 10px;
  border: 1px dashed #96c2ac;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .container {
    margin-top: 22px;
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px;
  }

  .form-card,
  .list-card,
  .hero {
    grid-column: 1;
  }

  .list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .note-list {
    grid-template-columns: 1fr;
  }

  #reloadButton {
    width: 100%;
  }
}
