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

[hidden] {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(255,255,255,0.28), rgba(255,255,255,0.28)),
    url("./assets/background.png");
  background-size: cover;
  background-position: left bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #333;
  min-height: 100vh;
  padding: 16px 16px 48px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255,255,255,0.82);
  border-radius: 12px;
  padding: 0 28px 32px;
}

/* Header */
header {
  text-align: center;
  padding: 32px 0 28px;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2a7a6f;
  letter-spacing: 0.04em;
}

.subtitle {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* Form */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
  border: 2px solid #c8e6e2;
  border-radius: 10px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.textarea:focus {
  border-color: #2a7a6f;
}

.char-count {
  font-size: 0.8rem;
  color: #888;
  text-align: right;
}

.char-count.over {
  color: #d9534f;
  font-weight: 600;
}

/* Emoji */
.emoji-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-btn {
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  border: 2px solid #c8e6e2;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.emoji-btn[aria-pressed="true"] {
  border-color: #2a7a6f;
  background: #e8f5f3;
}

.emoji-btn:hover {
  border-color: #2a7a6f;
}

/* Select */
.select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #c8e6e2;
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select.is-selected {
  border-color: #2a7a6f;
}

/* Error */
.error-message {
  font-size: 0.875rem;
  color: #d9534f;
  min-height: 1.2em;
}

/* Declare button */
.btn-declare {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #2a7a6f;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-declare:hover {
  background: #22655b;
}

.btn-declare:active {
  background: #1a5049;
}

/* Previous declaration */
.prev-section {
  margin-bottom: 24px;
}

.prev-card {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px 20px;
}

.prev-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 6px;
}

.prev-body {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  word-break: break-all;
}

/* Result */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.result-card {
  background: #e8f5f3;
  border: 2px solid #2a7a6f;
  border-radius: 12px;
  padding: 20px;
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2a7a6f;
  margin-bottom: 10px;
}

.result-date {
  font-size: 1rem;
  font-weight: 700;
  color: #2a7a6f;
  margin-bottom: 10px;
}

.result-body {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  word-break: break-all;
}

.btn-reset {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #2a7a6f;
  background: #fff;
  border: 2px solid #2a7a6f;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-reset:hover {
  background: #e8f5f3;
}

/* Footprints */
.footprints-section {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid #e8e8e8;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
}

.footprints-note {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 14px;
}

.footprints-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footprint-item {
  padding: 11px 14px;
  font-size: 0.88rem;
  color: #555;
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 8px;
  line-height: 1.5;
}

.footprints-empty {
  font-size: 0.85rem;
  color: #bbb;
  text-align: center;
  padding: 20px 0;
}
