:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  background-color: #111;
  color: #f5f5f5;
}

body {
  margin: 0;
  padding: 1.5rem;
  max-width: 1200px;
  margin-inline: auto;
}

header {
  margin-bottom: 2rem;
}

.preference-form {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem;
  border-radius: 12px;
}

.preference-input-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preference-input {
  flex: 1 1 280px;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
}

.preference-input:focus {
  outline: 2px solid #ff477e;
  outline-offset: 2px;
}

.save-preference-button {
  background: #3fb950;
  border: none;
  color: #0b1215;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.save-preference-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.preference-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  opacity: 0.8;
}

.preference-status.error {
  color: #ff6b6b;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.image-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.image-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

figcaption {
  padding: 1rem;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: inherit;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.like-button {
  background: #ff477e;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.like-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.delete-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: inherit;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.delete-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.delete-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.like-count {
  font-variant-numeric: tabular-nums;
}

.empty-state {
  margin-top: 4rem;
  text-align: center;
  opacity: 0.75;
}

.hidden {
  display: none;
}
