* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #111318;
  color: #f0f0f0;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.app {
  width: 100%;
  max-width: 640px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.video-wrap {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

#preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-dot {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #ff4d4d;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  animation: blink 1.4s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.status {
  margin-top: 1rem;
  min-height: 1.4em;
  color: #b8bcc8;
}

.controls {
  margin-top: 1rem;
}

button {
  background: #e5484d;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

button:disabled {
  background: #555;
  cursor: not-allowed;
}

.gallery {
  max-width: 960px;
}

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

.card {
  background: #1a1d24;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}

.no-preview {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #b8bcc8;
  font-size: 0.85rem;
  padding: 0.5rem;
  text-align: center;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #b8bcc8;
  padding: 0.6rem 0.8rem 0;
}

.download {
  display: block;
  color: #f0f0f0;
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem 0.8rem;
  text-decoration: none;
  word-break: break-all;
}

.download:hover {
  text-decoration: underline;
}

.delete-form {
  padding: 0 0.8rem 0.8rem;
}

.delete-btn {
  width: 100%;
  padding: 0.4rem;
  font-size: 0.85rem;
  background: #3a1f1f;
  border: 1px solid #e5484d;
}

.delete-btn:hover {
  background: #e5484d;
}
