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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.container {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.camera-button {
  display: block;
  background: #2563eb;
  color: #fff;
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.camera-button:active {
  background: #1d4ed8;
}

.gallery-button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: #2563eb;
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-button:active {
  background: #1d4ed8;
}

.camera-button input {
  display: none;
}

.preview {
  margin-top: 1.5rem;
}

.preview img {
  width: 100%;
  border-radius: 0.75rem;
  display: block;
}

.upload-button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: #16a34a;
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-button:active {
  background: #15803d;
}

.upload-button:disabled {
  background: #475569;
  cursor: not-allowed;
}

.comment-field {
  margin-top: 1rem;
  text-align: left;
}

.comment-field label {
  display: block;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.comment-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.status {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.status.success {
  color: #4ade80;
}

.status.error {
  color: #f87171;
}

.hidden {
  display: none;
}

.gallery-view {
  width: 100%;
  max-width: 480px;
  text-align: left;
}

.gallery-view h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.gallery-close {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  background: #334155;
  color: #fff;
  padding: 0.75rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-close:active {
  background: #1e293b;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gallery-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 0.5rem;
}

.gallery-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

.gallery-info {
  flex: 1;
  min-width: 0;
}

.gallery-date {
  display: block;
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 0.4rem;
}

.comment-button {
  background: #334155;
  color: #fff;
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-right: 0.4rem;
  transition: background 0.2s;
}

.comment-button:active {
  background: #1e293b;
}

.gallery-comment {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.delete-button {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  background: #dc2626;
  color: #fff;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-button:active {
  background: #b91c1c;
}

.gallery-empty {
  color: #94a3b8;
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:active {
  background: rgba(255, 255, 255, 0.3);
}

.version {
  margin-top: 2.5rem;
  color: #64748b;
  font-size: 0.8rem;
}
