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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #fff;
  color: #111;
  font-size: 18px;
  padding: 52px 28px 80px;
  max-width: 460px;
  margin: 0 auto;
}

/* ── Counter ─────────────────────────────────────────────── */

#count,
#count-after {
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}

.count-label {
  color: #111;
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.intro {
  color: #888;
  font-size: 1rem;
  font-weight: 400;
  margin-top: 10px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

hr.divider {
  border: none;
  border-top: 1.5px solid #f0f0f0;
  margin: 36px 0;
}

/* ── Form ────────────────────────────────────────────────── */

.form {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

textarea {
  width: 100%;
  height: 112px;
  background: #f4f4f4;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  color: #111;
  letter-spacing: -0.01em;
}

textarea::placeholder { color: #bbb; }

/* hide the real file input */
#photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.btn-photo-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 110px;
  background: #f4f4f4;
  border: 2px dashed #d8d8d8;
  border-radius: 16px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.btn-photo-big:hover,
.btn-photo-big:active {
  background: #eee;
  border-color: #bbb;
  color: #333;
}

.photo-preview-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.photo-preview-big {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.btn-remove-photo {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.btn-remove-photo:hover { background: rgba(0, 0, 0, 0.7); }

.btn-submit {
  width: 100%;
  height: 52px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 16px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}

.btn-submit:hover   { background: #333; }
.btn-submit:active  { background: #000; }
.btn-submit:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Result ──────────────────────────────────────────────── */

.result-message {
  margin-top: 32px;
  background: #f4f4f4;
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 0.975rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: break-word;
  white-space: pre-wrap;
  color: #333;
}

.result-photo {
  width: 100%;
  border-radius: 16px;
  margin-top: 10px;
  display: block;
}

/* ── Admin page ──────────────────────────────────────────── */

body.admin {
  max-width: 1000px;
  padding: 48px 32px 80px;
}

/* Login */

#login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

#login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

#login input {
  height: 48px;
  background: #f4f4f4;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  color: #111;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  background: #f4f4f4;
  border-radius: 16px;
  padding: 22px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: #999;
  margin-top: 6px;
  font-weight: 500;
}

/* Card grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.card {
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: border-color 0.15s;
}

.card:hover { border-color: #ddd; }

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f4f4f4;
}

.card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-message {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #111;
  word-break: break-word;
  flex: 1;
  letter-spacing: -0.01em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 8px;
}

.card-meta {
  font-size: 0.72rem;
  color: #bbb;
  letter-spacing: -0.01em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete {
  background: none;
  border: none;
  color: #ddd;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  flex-shrink: 0;
  padding: 0;
  transition: color 0.15s;
}

.btn-delete:hover { color: #e44; }
