:root {
  --bg: #0b0f12;
  --surface: #12181f;
  --text: #e8eef7;
  --muted: #90a4ae;
  --primary: #4f9cf9;
  --danger: #ff4d4f;
  --border: #1f2a36;
}
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #0b0f12, #10151a);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}
.header {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 31, 0.7);
  backdrop-filter: blur(8px);
}
.header h1 {
  margin: 0;
  font-size: 24px;
}
.uploader {
  margin-top: 20px;
}
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(18, 24, 31, 0.6);
}
.dropzone.active {
  border-color: var(--primary);
  background: rgba(79, 156, 249, 0.1);
}
.dropzone-text {
  font-size: 14px;
  color: var(--muted);
}
.dropzone-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.button {
  appearance: none;
  border: 1px solid var(--border);
  background: #19212b;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 156, 249, 0.2);
  border-color: rgba(79, 156, 249, 0.4);
}
.button:active {
  transform: translateY(0);
  box-shadow: none;
}
.button.danger {
  border-color: rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.1);
  color: #ffb3b3;
}
.button.danger:hover {
  box-shadow: 0 6px 18px rgba(255, 77, 79, 0.25);
}
#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.status {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.gallery {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.card {
  background: rgba(18, 24, 31, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
}
.card-body {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.card-name {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actions {
  display: flex;
  gap: 8px;
}
.viewer.hidden {
  display: none;
}
.viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}
.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.viewer-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-width: 90vw;
  max-height: 85vh;
  display: grid;
  gap: 12px;
}
.viewer-content img {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
}
.viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
