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

body {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  background: #f5f5f5;
  color: #222;
  padding: 1rem;
}

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

.hidden { display: none !important; }

/* Login */
#login {
  max-width: 320px;
  margin: 4rem auto;
  background: #fff;
  padding: 2rem;
  border: 1px solid #ddd;
}

#login h1 { text-align: center; }

.form-group { margin-top: 1rem; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 0.25rem; color: #555; }
.form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  background: #333;
  color: #fff;
}
.btn:hover { background: #555; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.btn-danger { background: none; color: #c00; border: 1px solid #c00; }
.btn-danger:hover { background: #c00; color: #fff; }

#login .btn { width: 100%; margin-top: 1rem; }

.error { color: #c00; font-size: 0.85rem; margin-top: 0.5rem; }

/* App */
#app { max-width: 640px; margin: 0 auto; }

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
}

/* Birthday */
#birthday {
  text-align: center;
  margin-bottom: 1.5rem;
}
#birthday-photo img {
  max-width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
#birthday-message {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Projects */
#projects-list { list-style: none; }
#projects-list li {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 3px solid transparent;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#projects-list li:hover { background: #f0f0f0; }
#projects-list li.streaming { border-left-color: #2a9d2a; }

.project-name { cursor: pointer; flex: 1; }
.project-meta { display: flex; align-items: center; gap: 0.75rem; }

.stream-btn {
  background: none;
  color: #555;
  border: 1px solid #bbb;
  min-width: 2rem;
}
.stream-btn:hover { background: #eee; color: #222; }
.streaming .stream-btn { color: #2a9d2a; border-color: #2a9d2a; }

.new-project {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.new-project input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}

/* Project view */
#back-btn { margin-bottom: 1rem; display: block; background: none; color: #333; border: 1px solid #999; }
#back-btn:hover { background: #eee; }

#upload-area {
  border: 2px dashed #ccc;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  cursor: pointer;
  background: #fff;
}
#upload-area:hover { border-color: #888; }
#file-input { display: none; }

#files-list { list-style: none; }
#files-list li {
  background: #fff;
  border: 1px solid #ddd;
  padding: 0.6rem 1rem;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-name { cursor: pointer; text-decoration: underline; color: #0055cc; }
.file-size { font-size: 0.8rem; color: #777; }

.upload-progress { margin-top: 0.5rem; font-size: 0.85rem; color: #555; }

/* Modal */
#media-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
#modal-content {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-content img,
#modal-content video {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  display: block;
}
