* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #1e1e2e;
  color: #cdd6f4;
  min-height: 100vh;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  color: #cba6f7;
  letter-spacing: 2px;
}

header p {
  color: #a6adc8;
  margin-top: 0.4rem;
}

/* Form */
.form-section {
  max-width: 480px;
  margin: 0 auto 3rem;
  background: #313244;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

#note-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

input[type="text"],
textarea {
  background: #1e1e2e;
  border: 1px solid #45475a;
  border-radius: 8px;
  color: #cdd6f4;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #cba6f7;
}

textarea {
  height: 100px;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.color-picker label {
  font-size: 0.9rem;
  color: #a6adc8;
}

.colors {
  display: flex;
  gap: 0.5rem;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-btn:hover {
  transform: scale(1.15);
}

.color-btn.selected {
  border-color: #cba6f7;
  transform: scale(1.15);
}

#submit-btn {
  background: #cba6f7;
  color: #1e1e2e;
  border: none;
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#submit-btn:hover {
  background: #b694e0;
}

#submit-btn:active {
  transform: scale(0.97);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Board */
.board {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
}

.loading {
  color: #a6adc8;
  text-align: center;
  width: 100%;
  padding: 2rem;
}

/* Notes */
.note {
  width: 200px;
  min-height: 180px;
  border-radius: 4px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.4);
  transform: rotate(var(--rot));
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  word-break: break-word;
  animation: pop-in 0.3s ease;
}

.note:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 6px 6px 20px rgba(0,0,0,0.5);
  z-index: 10;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.7) rotate(var(--rot)); }
  to   { opacity: 1; transform: scale(1) rotate(var(--rot)); }
}

.note-message {
  font-size: 0.95rem;
  color: #1e1e2e;
  line-height: 1.5;
  flex: 1;
}

.note-footer {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.note-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(30,30,46,0.6);
}

.note-time {
  font-size: 0.7rem;
  color: rgba(30,30,46,0.5);
}

/* Colors */
.note.yellow   { background: #fef08a; }
.note.pink     { background: #fbcfe8; }
.note.blue     { background: #bae6fd; }
.note.green    { background: #bbf7d0; }
.note.orange   { background: #fed7aa; }
.note.lavender { background: #e9d5ff; }

/* Error */
.error-msg {
  color: #f38ba8;
  text-align: center;
  width: 100%;
  padding: 1rem;
}
