:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #767676;
  --accent: #b8895f;
  --accent-dark: #8f6a47;
  --border: #e6ddd2;
  --error: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

header.site {
  text-align: center;
  padding: 32px 16px 8px;
}

header.site h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

header.site p {
  color: var(--muted);
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
}

button:hover { background: var(--accent-dark); }
button:disabled { background: #ccc; cursor: not-allowed; }

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 10px;
}

.success-box { text-align: center; }

#qrcode {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.share-link {
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 1;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reactions {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.reactions button {
  width: auto;
  margin: 0;
  padding: 2px 6px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  border-radius: 12px;
}

.upload-count {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 8px;
}

.hidden { display: none; }
